# Table of Contents - [What is Yoki Finance? | Yoki Finance](#what-is-yoki-finance-yoki-finance) - [Our Values | Yoki Finance](#our-values-yoki-finance) - [$YOKI token | Yoki Finance](#-yoki-token-yoki-finance) - [Subscription payments gateway | Yoki Finance](#subscription-payments-gateway-yoki-finance) - [For merchant | Yoki Finance](#for-merchant-yoki-finance) - [Glossary | Yoki Finance](#glossary-yoki-finance) - [How to create the subscription plan | Yoki Finance](#how-to-create-the-subscription-plan-yoki-finance) - [Payment plan page | Yoki Finance](#payment-plan-page-yoki-finance) - [Money flows and settlement | Yoki Finance](#money-flows-and-settlement-yoki-finance) - [Get subscription statuses | Yoki Finance](#get-subscription-statuses-yoki-finance) - [API integration | Yoki Finance](#api-integration-yoki-finance) - [Introduction | Yoki Finance](#introduction-yoki-finance) - [Steps | Yoki Finance](#steps-yoki-finance) - [Localhost environment | Yoki Finance](#localhost-environment-yoki-finance) - [API brief overview | Yoki Finance](#api-brief-overview-yoki-finance) - [Data export | Yoki Finance](#data-export-yoki-finance) - [Sending to Telegram group | Yoki Finance](#sending-to-telegram-group-yoki-finance) - [Chains and Tokens | Yoki Finance](#chains-and-tokens-yoki-finance) - [Overview | Yoki Finance](#overview-yoki-finance) - [Architecture | Yoki Finance](#architecture-yoki-finance) - [Dollar-Cost-Averaging app | Yoki Finance](#dollar-cost-averaging-app-yoki-finance) - [Chains and Tokens | Yoki Finance](#chains-and-tokens-yoki-finance) - [Analytics | Yoki Finance](#analytics-yoki-finance) - [Fees | Yoki Finance](#fees-yoki-finance) - [Integration | Yoki Finance](#integration-yoki-finance) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [What is Yoki Finance? | Yoki Finance](#what-is-yoki-finance-yoki-finance) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Subscription payments gateway | Yoki Finance](#subscription-payments-gateway-yoki-finance) - [Unknown](#unknown) - [Creating the first subscription | Yoki Finance](#creating-the-first-subscription-yoki-finance) - [Dollar-Cost-Averaging app | Yoki Finance](#dollar-cost-averaging-app-yoki-finance) - [Unknown](#unknown) --- # What is Yoki Finance? | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/introduction/what-is-yoki-finance.md) . ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FVIPTez2SBNFAIR5HFWlp%252FPost.png%3Falt%3Dmedia%26token%3D0fb4526b-24c1-4915-9a95-b208f635d2b4&width=768&dpr=3&quality=100&sign=57d692b3&sv=2) Yoki Finance is a decentralized non-custodial payment automation solution. Our mission is to make recurring crypto payments accessible, easy, and customizable. **Name** Yoki is derived from “Your Key” which is part of a famous crypto catchphrase “Not your keys - not your crypto” and highlights our devotion to self-custody and lack of third-party control over users’ funds. **Overview** In the fiat space recurring payments are a giant industry with an estimated transaction volume exceeding 13 trillion USD in 2022. And it is estimated to grow significantly higher due to the shift to the subscription economy. Fiat payment subscription is expensive for business and users are struggling the subscriptions that they are not willing to pay for anymore, but forgot to cancel. At the same time, Web3 provides a unique advantage of self-custody, allowing users to have complete control over their assets. However, this feature also poses the challenge of requiring manual approvals for every transaction. These approvals are complicated on the user level, but for organizations such as DAOs, it is a disaster, given their multi-sig approvals. Yoki Finance team believes that automating Web3 recurring payments will combine the benefits of the traditional subscription economy with the benefits of blockchain and self-custody. Implementing such functionality on a larger scale is critical for the mass adoption of the crypto payment infrastructure both in Web3 and non-Web3 spaces. [NextOur Values](https://yokifinance.gitbook.io/docs/introduction/our-values) Last updated 2 years ago --- # Our Values | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/introduction/our-values.md) . Yoki Finance stands on three main principles: * Self-Custody * Transparency * User-centricity **Self-custody** Our approach in building recurring payment solutions is to ensure that users maintain complete control over their funds at every step. **Transparency** Open-sourcing the contracts empowers users by providing an auditable framework where information and transactions are publicly accessible, fostering accountability in decentralized systems. **User-centricity** User experience has been an issue in Web3 space since its beginning. We're committed to providing our users with the most straightforward and accessible experience possible. [PreviousWhat is Yoki Finance?](https://yokifinance.gitbook.io/docs) [Next$YOKI token](https://yokifinance.gitbook.io/docs/introduction/usdyoki-token) Last updated 2 years ago --- # $YOKI token | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/introduction/usdyoki-token.md) . Yoki team has not disclosed the tokenomics and plans for the token yet. Please verify the information on Yoki Finance's social networks: * [https://twitter.com/yokifinance](https://twitter.com/yokifinance) * [https://t.me/yokifinance](https://t.me/yokifinance) [PreviousOur Values](https://yokifinance.gitbook.io/docs/introduction/our-values) [NextSubscription payments gateway](https://yokifinance.gitbook.io/docs/subscription-payments/subscription-payments-gateway) Last updated 2 years ago --- # Subscription payments gateway | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/subscription-payments-gateway.md) . Yoki Finance is pioneering the integration of the subscription economy with Web3 through our permissionless platform and infrastructure. With a market currently evaluated at $285 billion, the subscription economy has been a dominant trend for the past two decades. Our platform empowers individuals and businesses to seamlessly accept recurring crypto payments, offering support for various subscription-based products such as SaaS, gated community and content access, paywall, donations, Dollar-Cost-Averaging, automated loan repayments, and more. In the Web3 landscape, where over 30 million monthly active users cannot set up recurring payments, Yoki Finance fills a crucial gap. Existing Web3 businesses relying on subscription models often resort to fiat gateways or manual invoicing, creating inefficiencies. Our permissionless solution is accessible to anyone with a Web3 wallet, presenting significant growth opportunities in over 150 countries where traditional subscription payment gateways are inaccessible. Yoki Finance revolutionizes user experience by providing intuitive subscription management tools, offering users unparalleled control over their subscriptions compared to traditional finance solutions. With the implementation of EIP-4337, our solution becomes not only viable but also user-friendly, abstracting complex actions like gas fee payments in native tokens. Join us as we redefine subscription payments in the Web3 era. [Previous$YOKI token](https://yokifinance.gitbook.io/docs/introduction/usdyoki-token) [NextFor merchant](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant) Last updated 2 years ago --- # For merchant | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant.md) . [Glossary](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/glossary) [How to create the subscription plan](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/how-to-create-the-subscription-plan) [Payment plan page](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/payment-plan-page) [Money flows and settlement](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/money-flows-and-settlement) [Get subscription statuses](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/get-subscription-statuses) [API integration](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration) [Data export](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/data-export) [PreviousSubscription payments gateway](https://yokifinance.gitbook.io/docs/subscription-payments/subscription-payments-gateway) [NextGlossary](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/glossary) Last updated 2 years ago --- # Glossary | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/glossary.md) . Term Meaning Merchant The entity or person who sells products or services and accepts crypto payments from customers. Customer The individual or organization that subscribes to services by paying with crypto. Subscriber A customer that has already subscribed to a Merchant payment plan. Product Goods or services offered by the merchant for sale to customers. Payment plan The different pricing tiers or levels offered by merchants for their products or services with different frequencies (eg. Monthly, Yearly) Pricing contract An unchangeable smart contract accepting a specific token, with a fixed price and frequency. It could only be cancelled by the merchant Subscription A recurring payment arrangement where customers pay a fixed amount at regular intervals for continued access to a service or product [PreviousFor merchant](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant) [NextHow to create the subscription plan](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/how-to-create-the-subscription-plan) Last updated 2 years ago --- # How to create the subscription plan | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/how-to-create-the-subscription-plan.md) . After the platform launch anyone with a Web3 wallet will be able to create the subscription payment page. Currently, the service is available on demand. To create the subscription plan: 1. Fill out the Yoki Finance business development form [https://forms.gle/YTmEs1HrFeastb598](https://forms.gle/YTmEs1HrFeastb598) 2. Yoki BD team will reach out to you in 1-2 days 3. Provide the following data: * Merchant name * Merchant short name for the URL * Merchant logo link (300x300 px) * Settlement wallet address * Webhook callback URL (optional) * Home page URL (optional) * Product name * Product short name for the URL * Product Description * Return URL after the successful subscription * Product logo (if different from merchant logo) * Payment plan name * Payment plan short name for the URL * Payment plan price * Payment plan frequency * Choose the chains (Polygon, Optimism, or both) * Choose the tokens (USDT, USDC, or both) [PreviousGlossary](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/glossary) [NextPayment plan page](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/payment-plan-page) Last updated 2 years ago --- # Payment plan page | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/payment-plan-page.md) . [Demo page (dev version)](https://yoki-rps-front-end-dev.qa.aspirity.com/innmind.com/test?with_unsubscribe=true) The purpose of this page is to allow Customers to subscribe to a product on sale by the merchant. 1. A payment plan page is created by the Yoki team upon request from the Merchant. 2. In case the merchant needs to automate the payment plan creation we could provide the API access. 3. The page will be available at [https://pay.yoki.finance/\*merchant-name\*/\*pricing-name\*](https://pay.yoki.finance/*merchantname*/*pricing-name*) 4. The page will have the Merchant’s logo, website link, product description, pricing, and frequency. 5. The customer connects a Web3 wallet to proceed with the payment. [PreviousHow to create the subscription plan](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/how-to-create-the-subscription-plan) [NextMoney flows and settlement](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/money-flows-and-settlement) Last updated 2 years ago --- # Money flows and settlement | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/money-flows-and-settlement.md) . ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252F4TVWhZKqZyOagc5ZmnXL%252Fscheme.jpg%3Falt%3Dmedia%26token%3D76d834a6-a7cb-4519-bda6-02f7ddc87b16&width=768&dpr=3&quality=100&sign=8a66fef3&sv=2) Money flows and settlement 1. The merchant provides its wallet address for funds settlement. This address is identical for all chains. 2. Yoki collects a 2% fee for all processed payments, the rest is transferred immediately to the settlement wallet provided by the merchant. E.g if the subscription is 100 USDT monthly, 98 USDT will be sent to the settlement wallet upon every monthly payment and 2 USDT to the Yoki Finance treasury wallet. 3. The first payment is deducted immediately from the customer, the next one is scheduled according to the details. 4. The smart contract is unchangeable but can be stopped. So to implement the changes (eg increase the pricing) merchant has to create the new smart contract by requesting the Yoki Finance team or using the API. 5. Yoki Finance does not hold customer funds which provides a better experience for the merchants and highly decreases any associated risks. [PreviousPayment plan page](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/payment-plan-page) [NextGet subscription statuses](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/get-subscription-statuses) Last updated 1 year ago --- # Get subscription statuses | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/get-subscription-statuses.md) . Merchants have two ways to be informed about statuses of their subscriptions (someone subscribed, paid and so on): * Telegram group. The easiest option. Yoki team creates it with the subscription and gives merchant an invite link and merchant receives messages like this: ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FCRQqR8R3KcLkq1dDZRbD%252Fimage.png%3Falt%3Dmedia%26token%3D49d50058-17ff-42b3-8df5-b0ad67cf0088&width=768&dpr=3&quality=100&sign=b1eca60&sv=2) * [API integration](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration) via webhooks. That's when merchant needs more than just a Telegram group. Send notifications to email, WhatsApp, display the status in your SaaS – sky's the limit! In this case, all processing is done by merchant – we just send a webhook that merchant will handle. In this case, if merchant still wants to receive notifications into a Telegram group, they can [implement it themselves](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/sending-to-telegram-group) . If merchant needs external developer bandwidth to implement the integration into their website/app, Yoki has a trusted development partner company. Please let us know if you need this option. [PreviousMoney flows and settlement](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/money-flows-and-settlement) [NextAPI integration](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration) Last updated 2 years ago --- # API integration | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration.md) . [Introduction](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/introduction) [Steps](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/steps) [Localhost environment](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/localhost-environment) [API brief overview](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/api-brief-overview) [Sending to Telegram group](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/sending-to-telegram-group) [PreviousGet subscription statuses](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/get-subscription-statuses) [NextIntroduction](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/introduction) Last updated 2 years ago --- # Introduction | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/introduction.md) . This page describes high-level how a merchant can get [notifications about subscription statuses](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/get-subscription-statuses) via API. To read more about API and its objects please go to [API brief overview](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/api-brief-overview) . Yoki notifies the merchant by firing webhook handler URL (provided by merchant) with POST request upon the following events: 1. [Subscription is created](https://api-rps.yoki.fi/swagger#/Sandbox/CallbackSandboxController_subscriptionCreatedExample) . 2. [Periodic payment is processed](https://api-rps.yoki.fi/swagger#/Sandbox/CallbackSandboxController_paymentProcessedExample) . 3. [Periodic payment is failed](https://api-rps.yoki.fi/swagger#/Sandbox/CallbackSandboxController_paymentFailedExample) . We provide a retry mechanism, so there can be two cases: 1. Subscription went to error state (e.g., not enough funds or allowance) and stopped. 2. Subscription will try to charge the user in 24 hours (max 5 tries). If in the webhook payload _paymentFailedInfo.nextRunDate_ is null, then it means it was the last retry and subscription will be stopped. 4. [Subscription is cancelled](https://api-rps.yoki.fi/swagger#/Sandbox/CallbackSandboxController_subscriptionCancelledExample) by the user. This event is fired only when **user intentionally** canceled a subscription. To see the data that will be passed to your API, you can click to links above and use services like [https://webhook.site/](https://webhook.site/) , [https://webhook-test.com/](https://webhook-test.com/) (no endorsement), to see the data that comes in. **Important**: in your actual implementation webhook API must return either an empty response or {} (empty JSON object) and 2XX status code, otherwise call is considered unsuccessful and will be retried. Max number of retries is 18 over the course of 12 hours. [PreviousAPI integration](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration) [NextSteps](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/steps) Last updated 2 years ago --- # Steps | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/steps.md) . This page describes steps by merchant to receive subscription statuses in their apps: 1. Read the introduction to understand how Yoki [webhooks work](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/introduction) . 2. Create environment TEST to test receiving webhooks. 3. Send to Yoki the URL of webhook handler for TEST environment. It can be [environment running on localhost](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/localhost-environment) . 4. Yoki circles back to merchant and provides links to test tariff plans. Merchant's TEST webhook handler URL will be called in case [of any event](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/introduction) in your subscriptions. 5. Merchant programs integration as they wish, tests it. 6. Merchant creates PROD (production) environment and sends URL of webhook handler for PROD environment to Yoki. 7. Yoki wires the webhook receiver URL to its PROD environment and informs merchant with the message "Production environment is ready". 8. **Now the system is ready for production use by merchant**. Important customisations: * If merchant wants to test integration on localhost, please refer to [Localhost environment](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/localhost-environment) section. * If merchant receives subscription statuses in their apps via webhooks (how is outlined on this page), sending them to Telegram group has to be done by merchant programmatically, please refer to [Sending to Telegram group](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/sending-to-telegram-group) section for implementation details. [PreviousIntroduction](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/introduction) [NextLocalhost environment](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/localhost-environment) Last updated 2 years ago --- # Localhost environment | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/localhost-environment.md) . This page describes how to handle Yoki webhooks on localhost so that merchant can debug subscription statuses coming from Yoki. **Short answer** Use [https://webhookrelay.com/](https://webhookrelay.com/) to forward Yoki webhooks to localhost. In the Webhookrelay's dashboard go to Request Forwarding -> Buckets -> Forward To and choose Internal Destination. The flow is pretty well explained up there. **Long answer** 1. Run webhook handler on localhost. Let's say, you receive requests on http://localhost:8088 2. Register on [https://webhookrelay.com/](https://webhookrelay.com/) 3. Go to webhookrelay's dashboard 4. Select Request Forwarding -> Buckets -> Forward To and choose Internal Destination. ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FoSRoIM9IrDzvZmscemSA%252FScreenshot%25202024-03-29%2520at%252015.07.13.png%3Falt%3Dmedia%26token%3D1629cf9c-38ec-4906-b56a-b8fbcb5adfe5&width=768&dpr=3&quality=100&sign=48802f11&sv=2) 5. Specify local URL to forward requests to (in this case http://localhost:8088): ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252Fyl1a4xywq3vcvbCzxcUK%252Fimage.png%3Falt%3Dmedia%26token%3D0494f9e0-8d77-41ec-a47b-6ca0e1840c34&width=768&dpr=3&quality=100&sign=ac33c9b7&sv=2) 6. Install the agent on local machine (commands for operating systems are given), press "Generate Auth Token", then run authenticate command. After completed, run forwarding command as per screenshot below. ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FDBHSp2niH24nm8VtUjm7%252Fimage.png%3Falt%3Dmedia%26token%3D898abada-58b8-4072-9d25-a574a4b203d9&width=768&dpr=3&quality=100&sign=55c24605&sv=2) 7. After it is done, you'll see "Agent is connected and subscribed!". Press "Start forwarding". ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FKhngrzH4BS29SbEdGYEk%252Fimage.png%3Falt%3Dmedia%26token%3D3c76b42c-757d-46ab-967d-0fc063b583db&width=768&dpr=3&quality=100&sign=9d29cff1&sv=2) 8. You're done! You can now see the public webhook handler URL that you can give to Yoki to test integration locally. All requests will be forwarded to localhost:8088 (or any other URL). ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252Fq925FdJKpABiuM6hYN5J%252FScreenshot%25202024-03-29%2520at%252015.19.24.png%3Falt%3Dmedia%26token%3D69265dfe-1c02-48b4-ba49-a1c29c8cc51f&width=768&dpr=3&quality=100&sign=f7e6005e&sv=2) [PreviousSteps](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/steps) [NextAPI brief overview](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/api-brief-overview) Last updated 2 years ago --- # API brief overview | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/api-brief-overview.md) . The [Introduction](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/introduction) gives a brief overview about events Yoki notifies a merchant via webhooks. Full API reference can be found here [https://api-rps.yoki.fi/swagger](https://api-rps.yoki.fi/swagger) . Yoki API uses Stripe API terminology where possible to ease onboarding and integration. Let's see what objects are used in Yoki API: Object Description Merchant This is company receiving payments. Normally, one merchant corresponds to one client, but there can be situations (when client is a marketplace or payment system), when client wants to manage multiple merchants via API. In this case an Organization is created as an umbrella object for multiple merchants. Organization High-level organization that can create multiple merchants. It has separate payment fee and API key. Product Product describes specific goods or services merchants offer to their customers. You can also think about this as set of characteristics customers buy. For example, you can offer Standard and Premium version of your service. In this case, each would be a separate product. Price Prices define cost, currency (for now only USD is supported) and payment terms. For instance, you can offer Standard product for $5/month or $50/year. So, there will be two prices for one Product. A product can have multiple prices. Payment contract Payment contract defines how customers pay certain Price onchain. For instance, for a price $5/month, there could be two payment contracts – one to pay in USDT and another in USDC. [PreviousLocalhost environment](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/localhost-environment) [NextSending to Telegram group](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/sending-to-telegram-group) Last updated 2 years ago --- # Data export | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/data-export.md) . The merchant has multiple options to get the number of subscribers and their payments. **API Endpoints** Yoki Finance provides two API endpoints supplying data in CSV format (which can be easily imported into Google Sheets). This is a private endpoint for each merchant. 1. GetSubscribers – returns a list of subscribers (email, wallet address, payment plan, activeSubscription: true/false – to include past subscribers) for the merchant. 2. GetPayments – returns a log of payments for the merchant. Each row includes 1. Subscriber data (email (if previously provided in the redirection request), wallet address, product, pricing, etc). 2. Payment date/time and status. 3. Single payment amount. **CSV Export** ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FfYnaquFbbwFAvuoAqkmd%252FScreen%2520Shot%25202024-02-06%2520at%252018.05.24.png%3Falt%3Dmedia%26token%3Db9c67129-e8ba-47ad-8cfd-8f7ef63d7141&width=768&dpr=3&quality=100&sign=806d2537&sv=2) **CSV Export** The second option for the merchant is to connect with his wallet to the _https://yoki.fi/\*merchant-name\*/statistic_ page and download the subscriptions and payment data. [PreviousSending to Telegram group](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/sending-to-telegram-group) [NextChains and Tokens](https://yokifinance.gitbook.io/docs/subscription-payments/chains-and-tokens) Last updated 2 years ago --- # Sending to Telegram group | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/sending-to-telegram-group.md) . This page describes how to send messages into Telegram group if merchant wants to implement this functionality as part of [API integration](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration) . **Step 1 – create Telegram group** You can reuse existing group or create new from scratch (recommended). We recommend to name it appropriately and set up a group picture. **Step 2 – create a bot and get its token** DM [@BotFather](https://t.me/BotFather) , and create a new bot. You'll get bot token that looks like Copy 11111111111:XXXXXXXXXXXXXXXXXXXXXXXXxxxx We recommend to name bot appropriately like "Subscriptions bot" or "Payments bot", whatever you like. We also recommend to set up bot's picture (open bot profile -> Edit) to make it look better in the group. **Step 3 – add bot into the group** This is pretty self-explanatory, just add this bot into the group you created on step 1. **Step 4 – get chat id** In the browser (or via CURL) open the URL Copy https://api.telegram.org/bot/getUpdates where you get latest bot's activity. Visually scan the updates for text like Copy "sender_chat":{"id":-1003057777777 , .... } here "id" is the group id you need (a big negative number). **Step 5 – send message to group** This code in TypeScript is self-explanatory, Telegram's [sendMessage](https://core.telegram.org/bots/api#sendmessage) method is used, and lots of options are available. Here is the simplest possible case presented. Copy import axios from "axios"; export const sendTelegramMessage = (botToken: string, chatId: number, msg: string) => { return axios.get( `https://api.telegram.org/bot${botToken}/sendMessage`, { params: { parse_mode: "HTML", chat_id: chatId, text: msg, disable_web_page_preview: true, }, } ); }; In this case HTML markup is used, (see [https://core.telegram.org/bots/api#formatting-options](https://core.telegram.org/bots/api#formatting-options) ), so you can format the message any way you want. [PreviousAPI brief overview](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/api-brief-overview) [NextData export](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/data-export) Last updated 2 years ago --- # Chains and Tokens | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/chains-and-tokens.md) . **Supported chains** * Optimism * Polygon * Blast (TBA) * Mantle (TBA) * ZkSync (TBA) * BNB Chain (TBA) * Ethereum (TBA) * Arbitrum (TBA) * Avalanche (TBA) **Supported tokens** * USDT * USDC [PreviousData export](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/data-export) [NextDollar-Cost-Averaging app](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/dollar-cost-averaging-app) Last updated 2 years ago --- # Overview | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview.md) . ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FivdfrP9A0zGsrYGRmH1U%252Fimage.png%3Falt%3Dmedia%26token%3Df7484f89-4476-4f42-b2cf-da088fa69991&width=768&dpr=3&quality=100&sign=d0d49ff7&sv=2) Yoki Finance provides users with an easy way to create a recurring purchase subscription (DCA) through the Yoki widget, which is available on the dedicated page on the [Yoki website](https://dca.yoki.finance/) or embedded into other crypto-project websites. This feature allows users to shortcut the investment process for a particular project. The token subscription widget is built on the Yoki Finance smart contracts and could be integrated with any project with an ERC-20 token traded on Decentralized Exchanges. By installing the Yoki widget on their website, Web3 projects can provide their users with a seamless and secure purchase experience, allowing them to quickly start a long-term investment in the project's token. This is a great way for crypto projects to stimulate and forecast stable token purchases, and increase engagement and loyalty among their users. ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FWDHdlDjcV1Vzc3fQX5G4%252Fimage.png%3Falt%3Dmedia%26token%3Df08459b2-eab1-4afa-a2d4-5ad5ebaa0f05&width=768&dpr=3&quality=100&sign=19a00d34&sv=2) Yoki Finance combines the benefits of the automation with the benefits of the self-custody ### **Problem**[](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview#problem) Purchasing cryptocurrencies regularly can be a time-consuming and complex, leaving holders unsure about security and transparency. The traditional approach to that often involves the following challenges: * Manual management requires significant time and energy, which may not be feasible. * Automated investment platforms often require transferring control of funds to centralized entities, leaving participants vulnerable to security risks. * A lack of transparency makes it hard to understand how the strategies work, and the users may not know where and how their money is being used. ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252F1NXIzOW03rMziWetS6Rj%252FScreen%2520Shot%25202023-05-25%2520at%252016.41.21.png%3Falt%3Dmedia%26token%3Df7625069-fc86-45dc-87d0-379aa573d483&width=768&dpr=3&quality=100&sign=8f41361f&sv=2) ### **Solution**[](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview#solution) Yoki Finance provides a simple and secure solution for businesses looking to provide DCA utility for their community and retail crypto users looking to automate their purchase strategies. By leveraging smart contracts, Yoki Finance enables users to create and manage investment strategies that are stored and executed on EVM-compatible blockchains. ### **Revamping project and investor community interaction**[](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview#revamping-project-and-investor-community-interaction) ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FAQkFerWg2vgkaqYx9LXw%252FScreen%2520Shot%25202023-05-25%2520at%252016.41.32.png%3Falt%3Dmedia%26token%3Dc8333567-b270-4b19-aea0-7c95e32c913f&width=768&dpr=3&quality=100&sign=4d547970&sv=2) #### Before DCA Widget[](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview#before-dca-widget) 1. Users get to know about the project from influencers, token trackers, or friends 2. Purchase some amount of tokens 3. ⛔️ Attention span is changed to other projects #### With DCA Widget[](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview#with-dca-widget) 1. Users get to know about the project from influencers, token trackers, or friends 2. Setup the purchasing schedule to mitigate the price fluctuation risk 3. ✅ The token purchase is done automatically as long as the strategy is set up ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FhWvL9zFuKCGLK1rbsxi0%252FScreen%2520Shot%25202023-05-25%2520at%252016.41.50.png%3Falt%3Dmedia%26token%3Da5e3207d-0e11-4eea-90d8-43e49adb13b7&width=768&dpr=3&quality=100&sign=704e93da&sv=2) **Benefits for the partners** * Manage long-term demand for your token * Interact with the most loyal community members (eg NFT distribution for certain investment milestones) * Create an additional revenue stream * Keep the purchase process in-house (your website/app) **Benefits for the community** * Risk reduction * Time economy * Gasless transactions * Additional bounties from the project * Additional bounties from Yoki Finance ### **Why Dollar-Cost-Average?**[](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview#why-dollar-cost-average) Dollar-cost averaging is an investment strategy where an individual consistently invests a fixed amount of money at regular intervals, regardless of the asset's price. It aims to reduce the impact of market volatility by spreading out the investment over time, potentially resulting in lower average costs and mitigating the risk of making poor investment timing decisions. [PreviousDollar-Cost-Averaging app](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/dollar-cost-averaging-app) [NextArchitecture](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/architecture) Last updated 2 years ago --- # Architecture | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/architecture.md) . Yoki Finance uses a set of already established and trusted solutions to facilitate the development process. ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FKMf0rpMk1yNsKavtbhbd%252FYoki_architecture.jpeg%3Falt%3Dmedia%26token%3D5b478ab9-cd30-4b11-a3b4-f1493f476b35&width=768&dpr=3&quality=100&sign=f4d80d56&sv=2) ### **Authorization**[](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/architecture#authorization) The authorization process with Web3 wallets with **Metamask** or **WalletConnect** is accustomed to every Web3 Enthusiast. Future integration with **Web3Auth** helps non-Web3 people with onboarding by authorizing using their social graph. ### **Strategy creation**[](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/architecture#strategy-creation) In the widget interface users with a connected wallet could set up the recurring token purchase strategy. For every scenario, Yoki Finance creates a separate smart contract with information about the transaction parameters. At the same time, the data about the strategy schedule is stored on the workers' side. Workers are initially stored on Yoki Finance's backend but then changed to decentralized workers in the next releases (e.g **Chainlink Automation**, **Gelato Automation)**. Using **decentralized workers** helps us to be assured that user strategy will be executed in time and be stored decentralized. User funds are stored in his wallet and are not accessed by Yoki smart contracts besides the purchase time. ### **Strategy execution**[](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/architecture#strategy-execution) When the time for the next transaction comes our workers refer to the smart contract with the users' strategy data, which executes the swap on **Uniswap** (later on the liquidity aggregators such as **1inch** and **Kyberswap)**. Using liquidity aggregators routes the trade through the Decentralized Exchanges with the best available price, splitting the trade across multiple DEXs if necessary to achieve the best possible price for the user. As a result of the transaction user wallet receives the purchased tokens and the analytical data is loaded into the widget. [PreviousOverview](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview) [NextCreating the first subscription](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/creating-the-first-subscription) Last updated 3 years ago --- # Dollar-Cost-Averaging app | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/dollar-cost-averaging-app.md) . ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FCkwIQIslRteTHhkKoGAA%252FScreen%2520Shot%25202023-05-24%2520at%252015.51.34.png%3Falt%3Dmedia%26token%3Df5b8523f-fea2-4129-8dca-7432bc8aece1&width=768&dpr=3&quality=100&sign=91ddb737&sv=2) The Web3 Dollar-Cost-Averaging app is a tool that allows users to set up periodic purchases of a token of their choice. Through the widget, community members set up purchase subscriptions (DCA) in a decentralized and self-custody manner. The widget could be integrated into the websites in two ways: 1. With a pre-chosen token. Best suitable for projects with ERC-20 tokens traded on decentralized exchanges. 2. Without a pre-chosen token. Best suitable for any projects that would like to provide additional utility for their visitors. E.g. DeFi projects, Wallets, Media, etc More about the DCA widget can be found in the corresponding topic: [Overview](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview) [PreviousChains and Tokens](https://yokifinance.gitbook.io/docs/subscription-payments/chains-and-tokens) [NextOverview](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview) Last updated 2 years ago --- # Chains and Tokens | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/chains-and-tokens.md) . **Supported chains** * Optimism * Polygon * BNB Chain (TBA) * Ethereum (TBA) * Arbitrum (TBA) * Avalanche (TBA) * Gnosis (TBA) **Supported tokens** Currently, the Yoki Finance admin is selecting the assets that could be integrated. In the future, any ERC-20 token traded on Decentralized Exchanges with sufficient liquidity could be integrated and automatically purchased and sold via the Yoki Finance Web3 DCA app. [PreviousCreating the first subscription](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/creating-the-first-subscription) [NextAnalytics](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/analytics) Last updated 2 years ago --- # Analytics | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/analytics.md) . To be added [PreviousChains and Tokens](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/chains-and-tokens) [NextFees](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/fees) Last updated 2 years ago --- # Fees | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/fees.md) . By the design, DCA dapp is forever **gasless**. During the beta stage, the DCA app has **zero** fees and it will remain so for all the subscriptions created during that time. After the beta stage, Yoki Finance plans to introduce the 0,5% fee to cover the gas costs. [PreviousAnalytics](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/analytics) [NextIntegration](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/integration) Last updated 2 years ago --- # Integration | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/integration.md) . 1. Fill out the Yoki Finance business development form [https://forms.gle/EKnVBGHwRKUTJBgVA](https://forms.gle/EKnVBGHwRKUTJBgVA) 2. Yoki BD team will reach out to you in 1-2 days 3. Specify the requested type of integration (widget/separate page/link) 4. Deploy the code 5. Enjoy increased community loyalty and market cap growth The docs for a permissionless integration to be announced [PreviousFees](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/fees) Last updated 3 years ago --- # Unknown \# Yoki Finance ## Yoki Finance - \[What is Yoki Finance?\](https://yokifinance.gitbook.io/docs/introduction/what-is-yoki-finance.md): Introduction to Yoki Finance - \[Our Values\](https://yokifinance.gitbook.io/docs/introduction/our-values.md) - \[$YOKI token\](https://yokifinance.gitbook.io/docs/introduction/usdyoki-token.md) - \[Subscription payments gateway\](https://yokifinance.gitbook.io/docs/subscription-payments/subscription-payments-gateway.md) - \[For merchant\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant.md) - \[Glossary\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/glossary.md) - \[How to create the subscription plan\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/how-to-create-the-subscription-plan.md) - \[Payment plan page\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/payment-plan-page.md) - \[Money flows and settlement\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/money-flows-and-settlement.md) - \[Get subscription statuses\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/get-subscription-statuses.md) - \[API integration\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration.md) - \[Introduction\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/introduction.md) - \[Steps\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/steps.md) - \[Localhost environment\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/localhost-environment.md) - \[API brief overview\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/api-brief-overview.md) - \[Sending to Telegram group\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/sending-to-telegram-group.md) - \[Data export\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/data-export.md) - \[Chains and Tokens\](https://yokifinance.gitbook.io/docs/subscription-payments/chains-and-tokens.md): What chains and tokens do we support? - \[Dollar-Cost-Averaging app\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/dollar-cost-averaging-app.md) - \[Overview\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview.md): What is a Web3 Dollar-Cost-Averaging app and what problem does it solve? - \[Architecture\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/architecture.md): Technologies Under the Hood - \[Creating the first subscription\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/creating-the-first-subscription.md): The step-by-step guide on setting up your first subscription - \[Chains and Tokens\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/chains-and-tokens.md): What chains and tokens do we support? - \[Analytics\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/analytics.md) - \[Fees\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/fees.md) - \[Integration\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/integration.md) --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/introduction/what-is-yoki-finance.md). # What is Yoki Finance?
Yoki Finance is a decentralized non-custodial payment automation solution. Our mission is to make recurring crypto payments accessible, easy, and customizable. \*\*Name\*\* Yoki is derived from “Your Key” which is part of a famous crypto catchphrase “Not your keys - not your crypto” and highlights our devotion to self-custody and lack of third-party control over users’ funds. \\ \*\*Overview\*\* In the fiat space recurring payments are a giant industry with an estimated transaction volume exceeding 13 trillion USD in 2022. And it is estimated to grow significantly higher due to the shift to the subscription economy. Fiat payment subscription is expensive for business and users are struggling the subscriptions that they are not willing to pay for anymore, but forgot to cancel. At the same time, Web3 provides a unique advantage of self-custody, allowing users to have complete control over their assets. However, this feature also poses the challenge of requiring manual approvals for every transaction. These approvals are complicated on the user level, but for organizations such as DAOs, it is a disaster, given their multi-sig approvals. Yoki Finance team believes that automating Web3 recurring payments will combine the benefits of the traditional subscription economy with the benefits of blockchain and self-custody. Implementing such functionality on a larger scale is critical for the mass adoption of the crypto payment infrastructure both in Web3 and non-Web3 spaces. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/introduction/our-values.md). # Our Values Yoki Finance stands on three main principles: \* Self-Custody \* Transparency \* User-centricity \*\*Self-custody\*\* Our approach in building recurring payment solutions is to ensure that users maintain complete control over their funds at every step. \*\*Transparency\*\* Open-sourcing the contracts empowers users by providing an auditable framework where information and transactions are publicly accessible, fostering accountability in decentralized systems. \*\*User-centricity\*\* User experience has been an issue in Web3 space since its beginning. We're committed to providing our users with the most straightforward and accessible experience possible. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/introduction/usdyoki-token.md). # $YOKI token Yoki team has not disclosed the tokenomics and plans for the token yet. Please verify the information on Yoki Finance's social networks: \* \* --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/subscription-payments-gateway.md). # Subscription payments gateway Yoki Finance is pioneering the integration of the subscription economy with Web3 through our permissionless platform and infrastructure. With a market currently evaluated at $285 billion, the subscription economy has been a dominant trend for the past two decades. Our platform empowers individuals and businesses to seamlessly accept recurring crypto payments, offering support for various subscription-based products such as SaaS, gated community and content access, paywall, donations, Dollar-Cost-Averaging, automated loan repayments, and more. In the Web3 landscape, where over 30 million monthly active users cannot set up recurring payments, Yoki Finance fills a crucial gap. Existing Web3 businesses relying on subscription models often resort to fiat gateways or manual invoicing, creating inefficiencies. Our permissionless solution is accessible to anyone with a Web3 wallet, presenting significant growth opportunities in over 150 countries where traditional subscription payment gateways are inaccessible. Yoki Finance revolutionizes user experience by providing intuitive subscription management tools, offering users unparalleled control over their subscriptions compared to traditional finance solutions. With the implementation of EIP-4337, our solution becomes not only viable but also user-friendly, abstracting complex actions like gas fee payments in native tokens. Join us as we redefine subscription payments in the Web3 era. --- # What is Yoki Finance? | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/introduction/what-is-yoki-finance.md) . ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FVIPTez2SBNFAIR5HFWlp%252FPost.png%3Falt%3Dmedia%26token%3D0fb4526b-24c1-4915-9a95-b208f635d2b4&width=768&dpr=3&quality=100&sign=57d692b3&sv=2) Yoki Finance is a decentralized non-custodial payment automation solution. Our mission is to make recurring crypto payments accessible, easy, and customizable. **Name** Yoki is derived from “Your Key” which is part of a famous crypto catchphrase “Not your keys - not your crypto” and highlights our devotion to self-custody and lack of third-party control over users’ funds. **Overview** In the fiat space recurring payments are a giant industry with an estimated transaction volume exceeding 13 trillion USD in 2022. And it is estimated to grow significantly higher due to the shift to the subscription economy. Fiat payment subscription is expensive for business and users are struggling the subscriptions that they are not willing to pay for anymore, but forgot to cancel. At the same time, Web3 provides a unique advantage of self-custody, allowing users to have complete control over their assets. However, this feature also poses the challenge of requiring manual approvals for every transaction. These approvals are complicated on the user level, but for organizations such as DAOs, it is a disaster, given their multi-sig approvals. Yoki Finance team believes that automating Web3 recurring payments will combine the benefits of the traditional subscription economy with the benefits of blockchain and self-custody. Implementing such functionality on a larger scale is critical for the mass adoption of the crypto payment infrastructure both in Web3 and non-Web3 spaces. [NextOur Values](https://yokifinance.gitbook.io/docs/introduction/our-values) Last updated 2 years ago --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant.md). # For merchant - \[Glossary\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/glossary.md) - \[How to create the subscription plan\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/how-to-create-the-subscription-plan.md) - \[Payment plan page\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/payment-plan-page.md) - \[Money flows and settlement\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/money-flows-and-settlement.md) - \[Get subscription statuses\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/get-subscription-statuses.md) - \[API integration\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration.md) - \[Introduction\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/introduction.md) - \[Steps\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/steps.md) - \[Localhost environment\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/localhost-environment.md) - \[API brief overview\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/api-brief-overview.md) - \[Sending to Telegram group\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/sending-to-telegram-group.md) - \[Data export\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/data-export.md) --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/glossary.md). # Glossary | Term | Meaning | | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | Merchant | The entity or person who sells products or services and accepts crypto payments from customers. | | Customer | The individual or organization that subscribes to services by paying with crypto. | | Subscriber | A customer that has already subscribed to a Merchant payment plan. | | Product | Goods or services offered by the merchant for sale to customers. | | Payment plan | The different pricing tiers or levels offered by merchants for their products or services with different frequencies (eg. Monthly, Yearly) | | Pricing contract |

An unchangeable smart contract accepting a specific token, with a fixed price and frequency. It could only be cancelled by the merchant


| | Subscription | A recurring payment arrangement where customers pay a fixed amount at regular intervals for continued access to a service or product | --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/how-to-create-the-subscription-plan.md). # How to create the subscription plan After the platform launch anyone with a Web3 wallet will be able to create the subscription payment page. Currently, the service is available on demand. To create the subscription plan: 1. Fill out the Yoki Finance business development form 2. Yoki BD team will reach out to you in 1-2 days 3. Provide the following data: \* Merchant name \* Merchant short name for the URL \* Merchant logo link (300x300 px) \* Settlement wallet address \* Webhook callback URL (optional) \* Home page URL (optional) \* Product name \* Product short name for the URL \* Product Description \* Return URL after the successful subscription \* Product logo (if different from merchant logo) \* Payment plan name \* Payment plan short name for the URL \* Payment plan price \* Payment plan frequency \* Choose the chains (Polygon, Optimism, or both) \* Choose the tokens (USDT, USDC, or both) --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/payment-plan-page.md). # Payment plan page \[Demo page (dev version) \](https://yoki-rps-front-end-dev.qa.aspirity.com/innmind.com/test?with\_unsubscribe=true) The purpose of this page is to allow Customers to subscribe to a product on sale by the merchant. 1. A payment plan page is created by the Yoki team upon request from the Merchant. 2. In case the merchant needs to automate the payment plan creation we could provide the API access. 3. The page will be available at \[https://pay.yoki.finance/\\\*merchant-name\\\*/\\\*pricing-name\\\*\](https://pay.yoki.finance/\*merchantname\*/\*pricing-name\*) 4. The page will have the Merchant’s logo, website link, product description, pricing, and frequency. 5. The customer connects a Web3 wallet to proceed with the payment. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/money-flows-and-settlement.md). # Money flows and settlement

Money flows and settlement

1. The merchant provides its wallet address for funds settlement.\\ This address is identical for all chains. 2. Yoki collects a 2% fee for all processed payments, the rest is transferred immediately to the settlement wallet provided by the merchant. E.g if the subscription is 100 USDT monthly, 98 USDT will be sent to the settlement wallet upon every monthly payment and 2 USDT to the Yoki Finance treasury wallet. 3. The first payment is deducted immediately from the customer, the next one is scheduled according to the details. 4. The smart contract is unchangeable but can be stopped. So to implement the changes (eg increase the pricing) merchant has to create the new smart contract by requesting the Yoki Finance team or using the API. 5. Yoki Finance does not hold customer funds which provides a better experience for the merchants and highly decreases any associated risks. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/get-subscription-statuses.md). # Get subscription statuses Merchants have two ways to be informed about statuses of their subscriptions (someone subscribed, paid and so on): \* Telegram group. The easiest option. Yoki team creates it with the subscription and gives merchant an invite link and merchant receives messages like this:
\* \[API integration\](/docs/subscription-payments/for-merchant/api-integration.md) via webhooks. That's when merchant needs more than just a Telegram group. Send notifications to email, WhatsApp, display the status in your SaaS – sky's the limit! In this case, all processing is done by merchant – we just send a webhook that merchant will handle. In this case, if merchant still wants to receive notifications into a Telegram group, they can \[implement it themselves\](/docs/subscription-payments/for-merchant/api-integration/sending-to-telegram-group.md). If merchant needs external developer bandwidth to implement the integration into their website/app, Yoki has a trusted development partner company. Please let us know if you need this option. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration.md). # API integration - \[Introduction\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/introduction.md) - \[Steps\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/steps.md) - \[Localhost environment\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/localhost-environment.md) - \[API brief overview\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/api-brief-overview.md) - \[Sending to Telegram group\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/sending-to-telegram-group.md) --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/introduction.md). # Introduction This page describes high-level how a merchant can get \[notifications about subscription statuses\](/docs/subscription-payments/for-merchant/get-subscription-statuses.md) via API. To read more about API and its objects please go to \[API brief overview\](/docs/subscription-payments/for-merchant/api-integration/api-brief-overview.md). Yoki notifies the merchant by firing webhook handler URL (provided by merchant) with POST request upon the following events: 1. \[Subscription is created\](https://api-rps.yoki.fi/swagger#/Sandbox/CallbackSandboxController\_subscriptionCreatedExample). 2. \[Periodic payment is processed\](https://api-rps.yoki.fi/swagger#/Sandbox/CallbackSandboxController\_paymentProcessedExample). 3. \[Periodic payment is failed\](https://api-rps.yoki.fi/swagger#/Sandbox/CallbackSandboxController\_paymentFailedExample). We provide a retry mechanism, so there can be two cases: 1. Subscription went to error state (e.g., not enough funds or allowance) and stopped. 2. Subscription will try to charge the user in 24 hours (max 5 tries). If in the webhook payload \*paymentFailedInfo.nextRunDate\* is null, then it means it was the last retry and subscription will be stopped. 4. \[Subscription is cancelled\](https://api-rps.yoki.fi/swagger#/Sandbox/CallbackSandboxController\_subscriptionCancelledExample) by the user. This event is fired only when \*\*user intentionally\*\* canceled a subscription. To see the data that will be passed to your API, you can click to links above and use services like , (no endorsement), to see the data that comes in. \*\*Important\*\*: in your actual implementation webhook API must return either an empty response or {} (empty JSON object) and 2XX status code, otherwise call is considered unsuccessful and will be retried. Max number of retries is 18 over the course of 12 hours. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/steps.md). # Steps This page describes steps by merchant to receive subscription statuses in their apps: 1. Read the introduction to understand how Yoki \[webhooks work\](/docs/subscription-payments/for-merchant/api-integration/introduction.md). 2. Create environment TEST to test receiving webhooks. 3. Send to Yoki the URL of webhook handler for TEST environment. It can be \[environment running on localhost\](/docs/subscription-payments/for-merchant/api-integration/localhost-environment.md). 4. Yoki circles back to merchant and provides links to test tariff plans. Merchant's TEST webhook handler URL will be called in case \[of any event\](/docs/subscription-payments/for-merchant/api-integration/introduction.md) in your subscriptions. 5. Merchant programs integration as they wish, tests it. 6. Merchant creates PROD (production) environment and sends URL of webhook handler for PROD environment to Yoki. 7. Yoki wires the webhook receiver URL to its PROD environment and informs merchant with the message "Production environment is ready". 8. \*\*Now the system is ready for production use by merchant\*\*. Important customisations: \* If merchant wants to test integration on localhost, please refer to \[Localhost environment\](/docs/subscription-payments/for-merchant/api-integration/localhost-environment.md) section. \* If merchant receives subscription statuses in their apps via webhooks (how is outlined on this page), sending them to Telegram group has to be done by merchant programmatically, please refer to \[Sending to Telegram group\](/docs/subscription-payments/for-merchant/api-integration/sending-to-telegram-group.md) section for implementation details. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/localhost-environment.md). # Localhost environment This page describes how to handle Yoki webhooks on localhost so that merchant can debug subscription statuses coming from Yoki. \*\*Short answer\*\* Use to forward Yoki webhooks to localhost. In the Webhookrelay's dashboard go to Request Forwarding -> Buckets -> Forward To and choose Internal Destination. The flow is pretty well explained up there. \*\*Long answer\*\* 1. Run webhook handler on localhost. Let's say, you receive requests on 2. Register on 3. Go to webhookrelay's dashboard 4. Select Request Forwarding -> Buckets -> Forward To and choose Internal Destination.
5. Specify local URL to forward requests to (in this case ):
6. Install the agent on local machine (commands for operating systems are given), press "Generate Auth Token", then run authenticate command. After completed, run forwarding command as per screenshot below.
7. After it is done, you'll see "Agent is connected and subscribed!". Press "Start forwarding".
8. You're done! You can now see the public webhook handler URL that you can give to Yoki to test integration locally. All requests will be forwarded to localhost:8088 (or any other URL).
--- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/api-brief-overview.md). # API brief overview The \[Introduction\](/docs/subscription-payments/for-merchant/api-integration/introduction.md) gives a brief overview about events Yoki notifies a merchant via webhooks. Full API reference can be found here . Yoki API uses Stripe API terminology where possible to ease onboarding and integration. Let's see what objects are used in Yoki API:
ObjectDescription
MerchantThis is company receiving payments. Normally, one merchant corresponds to one client, but there can be situations (when client is a marketplace or payment system), when client wants to manage multiple merchants via API. In this case an Organization is created as an umbrella object for multiple merchants.
OrganizationHigh-level organization that can create multiple merchants. It has separate payment fee and API key.
ProductProduct describes specific goods or services merchants offer to their customers. You can also think about this as set of characteristics customers buy.
For example, you can offer Standard and Premium version of your service. In this case, each would be a separate product.
PricePrices define cost, currency (for now only USD is supported) and payment terms. For instance, you can offer Standard product for $5/month or $50/year. So, there will be two prices for one Product. A product can have multiple prices.
Payment contractPayment contract defines how customers pay certain Price onchain. For instance, for a price $5/month, there could be two payment contracts – one to pay in USDT and another in USDC.
--- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/data-export.md). # Data export The merchant has multiple options to get the number of subscribers and their payments. \*\*API Endpoints\*\* Yoki Finance provides two API endpoints supplying data in CSV format (which can be easily imported into Google Sheets). This is a private endpoint for each merchant. 1. GetSubscribers – returns a list of subscribers (email, wallet address, payment plan, activeSubscription: true/false – to include past subscribers) for the merchant. 2. GetPayments – returns a log of payments for the merchant. Each row includes 1. Subscriber data (email (if previously provided in the redirection request), wallet address, product, pricing, etc). 2. Payment date/time and status. 3. Single payment amount. \*\*CSV Export\*\*

CSV Export

The second option for the merchant is to connect with his wallet to the \*\* page and download the subscriptions and payment data.\\
--- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant/api-integration/sending-to-telegram-group.md). # Sending to Telegram group This page describes how to send messages into Telegram group if merchant wants to implement this functionality as part of \[API integration\](/docs/subscription-payments/for-merchant/api-integration.md). \*\*Step 1 – create Telegram group\*\* You can reuse existing group or create new from scratch (recommended). We recommend to name it appropriately and set up a group picture. \*\*Step 2 – create a bot and get its token\*\* DM \[@BotFather\](https://t.me/BotFather), and create a new bot. You'll get bot token that looks like \`\`\`typescript 11111111111:XXXXXXXXXXXXXXXXXXXXXXXXxxxx \`\`\` We recommend to name bot appropriately like "Subscriptions bot" or "Payments bot", whatever you like. We also recommend to set up bot's picture (open bot profile -> Edit) to make it look better in the group. \*\*Step 3 – add bot into the group\*\* This is pretty self-explanatory, just add this bot into the group you created on step 1. \*\*Step 4 – get chat id\*\* In the browser (or via CURL) open the URL \`\`\`typescript https://api.telegram.org/bot/getUpdates \`\`\` where you get latest bot's activity. Visually scan the updates for text like \`\`\`json "sender\_chat":{"id":-1003057777777 , .... } \`\`\` here "id" is the group id you need (a big negative number). \*\*Step 5 – send message to group\*\* This code in TypeScript is self-explanatory, Telegram's \[sendMessage\](https://core.telegram.org/bots/api#sendmessage) method is used, and lots of options are available. Here is the simplest possible case presented. \`\`\`typescript import axios from "axios"; export const sendTelegramMessage = (botToken: string, chatId: number, msg: string) => { return axios.get( \`https://api.telegram.org/bot${botToken}/sendMessage\`, { params: { parse\_mode: "HTML", chat\_id: chatId, text: msg, disable\_web\_page\_preview: true, }, } ); }; \`\`\` In this case HTML markup is used, (see ), so you can format the message any way you want. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/dollar-cost-averaging-app.md). # Dollar-Cost-Averaging app
The Web3 Dollar-Cost-Averaging app is a tool that allows users to set up periodic purchases of a token of their choice. Through the widget, community members set up purchase subscriptions (DCA) in a decentralized and self-custody manner. The widget could be integrated into the websites in two ways: 1. With a pre-chosen token. Best suitable for projects with ERC-20 tokens traded on decentralized exchanges. 2. Without a pre-chosen token. Best suitable for any projects that would like to provide additional utility for their visitors. E.g. DeFi projects, Wallets, Media, etc More about the DCA widget can be found in the corresponding topic: {% content-ref url="/pages/uvqDkeBD6UDgNSYZgRrk" %} \[Overview\](/docs/dollar-cost-averaging/overview.md) {% endcontent-ref %}
--- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/subscription-payments/chains-and-tokens.md). # Chains and Tokens \*\*Supported chains\*\* \* Optimism \* Polygon \* Blast (TBA) \* Mantle (TBA) \* ZkSync (TBA) \* BNB Chain (TBA) \* Ethereum (TBA) \* Arbitrum (TBA) \* Avalanche (TBA) \*\*Supported tokens\*\* \* USDT \* USDC --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview.md). # Overview
Yoki Finance provides users with an easy way to create a recurring purchase subscription (DCA) through the Yoki widget, which is available on the dedicated page on the \[Yoki website\](https://dca.yoki.finance) or embedded into other crypto-project websites. This feature allows users to shortcut the investment process for a particular project. The token subscription widget is built on the Yoki Finance smart contracts and could be integrated with any project with an ERC-20 token traded on Decentralized Exchanges. By installing the Yoki widget on their website, Web3 projects can provide their users with a seamless and secure purchase experience, allowing them to quickly start a long-term investment in the project's token. This is a great way for crypto projects to stimulate and forecast stable token purchases, and increase engagement and loyalty among their users.

Yoki Finance combines the benefits of the automation with the benefits of the self-custody

### \*\*Problem\*\* Purchasing cryptocurrencies regularly can be a time-consuming and complex, leaving holders unsure about security and transparency. The traditional approach to that often involves the following challenges: \* Manual management requires significant time and energy, which may not be feasible. \* Automated investment platforms often require transferring control of funds to centralized entities, leaving participants vulnerable to security risks. \* A lack of transparency makes it hard to understand how the strategies work, and the users may not know where and how their money is being used.
### \*\*Solution\*\* Yoki Finance provides a simple and secure solution for businesses looking to provide DCA utility for their community and retail crypto users looking to automate their purchase strategies. By leveraging smart contracts, Yoki Finance enables users to create and manage investment strategies that are stored and executed on EVM-compatible blockchains. ### \*\*Revamping project and investor community interaction\*\*
#### Before DCA Widget 1. Users get to know about the project from influencers, token trackers, or friends 2. Purchase some amount of tokens 3. ⛔️ Attention span is changed to other projects #### With DCA Widget 1. Users get to know about the project from influencers, token trackers, or friends 2. Setup the purchasing schedule to mitigate the price fluctuation risk 3. ✅ The token purchase is done automatically as long as the strategy is set up
\*\*Benefits for the partners\*\* \* Manage long-term demand for your token \* Interact with the most loyal community members (eg NFT distribution for certain investment milestones) \* Create an additional revenue stream \* Keep the purchase process in-house (your website/app) \*\*Benefits for the community\*\* \* Risk reduction \* Time economy \* Gasless transactions \* Additional bounties from the project \* Additional bounties from Yoki Finance ### \*\*Why Dollar-Cost-Average?\*\* Dollar-cost averaging is an investment strategy where an individual consistently invests a fixed amount of money at regular intervals, regardless of the asset's price. It aims to reduce the impact of market volatility by spreading out the investment over time, potentially resulting in lower average costs and mitigating the risk of making poor investment timing decisions. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/architecture.md). # Architecture Yoki Finance uses a set of already established and trusted solutions to facilitate the development process.
### \*\*Authorization\*\* The authorization process with Web3 wallets with \*\*Metamask\*\* or \*\*WalletConnect\*\* is accustomed to every Web3 Enthusiast. Future integration with \*\*Web3Auth\*\* helps non-Web3 people with onboarding by authorizing using their social graph. ### \*\*Strategy creation\*\* In the widget interface users with a connected wallet could set up the recurring token purchase strategy. For every scenario, Yoki Finance creates a separate smart contract with information about the transaction parameters. At the same time, the data about the strategy schedule is stored on the workers' side. Workers are initially stored on Yoki Finance's backend but then changed to decentralized workers in the next releases (e.g \*\*Chainlink Automation\*\*, \*\*Gelato Automation)\*\*. Using \*\*decentralized workers\*\* helps us to be assured that user strategy will be executed in time and be stored decentralized. User funds are stored in his wallet and are not accessed by Yoki smart contracts besides the purchase time. ### \*\*Strategy execution\*\* When the time for the next transaction comes our workers refer to the smart contract with the users' strategy data, which executes the swap on \*\*Uniswap\*\* (later on the liquidity aggregators such as \*\*1inch\*\* and \*\*Kyberswap)\*\*. Using liquidity aggregators routes the trade through the Decentralized Exchanges with the best available price, splitting the trade across multiple DEXs if necessary to achieve the best possible price for the user. As a result of the transaction user wallet receives the purchased tokens and the analytical data is loaded into the widget. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/chains-and-tokens.md). # Chains and Tokens \*\*Supported chains\*\* \* Optimism \* Polygon \* BNB Chain (TBA) \* Ethereum (TBA) \* Arbitrum (TBA) \* Avalanche (TBA) \* Gnosis (TBA) \*\*Supported tokens\*\* Currently, the Yoki Finance admin is selecting the assets that could be integrated. In the future, any ERC-20 token traded on Decentralized Exchanges with sufficient liquidity could be integrated and automatically purchased and sold via the Yoki Finance Web3 DCA app. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/analytics.md). # Analytics To be added --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/fees.md). # Fees By the design, DCA dapp is forever \*\*gasless\*\*. During the beta stage, the DCA app has \*\*zero\*\* fees and it will remain so for all the subscriptions created during that time. After the beta stage, Yoki Finance plans to introduce the 0,5% fee to cover the gas costs. --- # Subscription payments gateway | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/subscription-payments/subscription-payments-gateway.md) . Yoki Finance is pioneering the integration of the subscription economy with Web3 through our permissionless platform and infrastructure. With a market currently evaluated at $285 billion, the subscription economy has been a dominant trend for the past two decades. Our platform empowers individuals and businesses to seamlessly accept recurring crypto payments, offering support for various subscription-based products such as SaaS, gated community and content access, paywall, donations, Dollar-Cost-Averaging, automated loan repayments, and more. In the Web3 landscape, where over 30 million monthly active users cannot set up recurring payments, Yoki Finance fills a crucial gap. Existing Web3 businesses relying on subscription models often resort to fiat gateways or manual invoicing, creating inefficiencies. Our permissionless solution is accessible to anyone with a Web3 wallet, presenting significant growth opportunities in over 150 countries where traditional subscription payment gateways are inaccessible. Yoki Finance revolutionizes user experience by providing intuitive subscription management tools, offering users unparalleled control over their subscriptions compared to traditional finance solutions. With the implementation of EIP-4337, our solution becomes not only viable but also user-friendly, abstracting complex actions like gas fee payments in native tokens. Join us as we redefine subscription payments in the Web3 era. [Previous$YOKI token](https://yokifinance.gitbook.io/docs/introduction/usdyoki-token) [NextFor merchant](https://yokifinance.gitbook.io/docs/subscription-payments/for-merchant) Last updated 2 years ago --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/integration.md). # Integration 1. Fill out the Yoki Finance business development form 2. Yoki BD team will reach out to you in 1-2 days 3. Specify the requested type of integration (widget/separate page/link) 4. Deploy the code 5. Enjoy increased community loyalty and market cap growth The docs for a permissionless integration to be announced --- # Creating the first subscription | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/creating-the-first-subscription.md) . The setup process for an automated purchase is very straightforward: 1. Connect the Web3 wallet 2. Change the network to the one on which your token is available (if necessary) 3. Choose the asset you'll be selling, likely a stablecoin, and purchase amount 4. Specify the purchase frequency (1h, 4h, 8h, 12h, daily, weekly, bi-weekly, monthly) 5. Specify the duration (or make it infinite) 6. Approve the spending limit 7. Voila, the automated transaction process is set up 8. The user receives the base asset with the average price for as long as his strategy is on [PreviousArchitecture](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/architecture) [NextChains and Tokens](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/chains-and-tokens) Last updated 2 years ago --- # Dollar-Cost-Averaging app | Yoki Finance For the complete documentation index, see [llms.txt](https://yokifinance.gitbook.io/docs/llms.txt) . This page is also available as [Markdown](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/dollar-cost-averaging-app.md) . ![](https://yokifinance.gitbook.io/docs/~gitbook/image?url=https%3A%2F%2F3265399743-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FICgNvamA13XK1KZtqMys%252Fuploads%252FCkwIQIslRteTHhkKoGAA%252FScreen%2520Shot%25202023-05-24%2520at%252015.51.34.png%3Falt%3Dmedia%26token%3Df5b8523f-fea2-4129-8dca-7432bc8aece1&width=768&dpr=3&quality=100&sign=91ddb737&sv=2) The Web3 Dollar-Cost-Averaging app is a tool that allows users to set up periodic purchases of a token of their choice. Through the widget, community members set up purchase subscriptions (DCA) in a decentralized and self-custody manner. The widget could be integrated into the websites in two ways: 1. With a pre-chosen token. Best suitable for projects with ERC-20 tokens traded on decentralized exchanges. 2. Without a pre-chosen token. Best suitable for any projects that would like to provide additional utility for their visitors. E.g. DeFi projects, Wallets, Media, etc More about the DCA widget can be found in the corresponding topic: [Overview](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview) [PreviousChains and Tokens](https://yokifinance.gitbook.io/docs/subscription-payments/chains-and-tokens) [NextOverview](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/overview) Last updated 2 years ago --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://yokifinance.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://yokifinance.gitbook.io/docs/dollar-cost-averaging/creating-the-first-subscription.md). # Creating the first subscription {% embed url="" %} The setup process for an automated purchase is very straightforward: 1. Connect the Web3 wallet 2. Change the network to the one on which your token is available (if necessary) 3. Choose the asset you'll be selling, likely a stablecoin, and purchase amount 4. Specify the purchase frequency (1h, 4h, 8h, 12h, daily, weekly, bi-weekly, monthly) 5. Specify the duration (or make it infinite) 6. Approve the spending limit 7. Voila, the automated transaction process is set up 8. The user receives the base asset with the average price for as long as his strategy is on ---