From 05c0e9ef29743a2bc4e05913bbc1fafa66028eaa Mon Sep 17 00:00:00 2001 From: Sergey Rodin Date: Tue, 21 May 2024 10:25:13 +0700 Subject: [PATCH] feat: merge --- docs/apps/katana/guides/add-liquidity.mdx | 82 ++++++++++++++ docs/apps/katana/guides/create-farm.mdx | 27 ++--- .../guides/{pool.mdx => create-pool.mdx} | 103 +++--------------- .../guides/{farm.mdx => farm-tokens.mdx} | 2 +- .../guides/{swap.mdx => swap-tokens.mdx} | 0 docs/apps/katana/overview.mdx | 8 +- sidebars.js | 40 +++++-- 7 files changed, 149 insertions(+), 113 deletions(-) create mode 100644 docs/apps/katana/guides/add-liquidity.mdx rename docs/apps/katana/guides/{pool.mdx => create-pool.mdx} (61%) rename docs/apps/katana/guides/{farm.mdx => farm-tokens.mdx} (97%) rename docs/apps/katana/guides/{swap.mdx => swap-tokens.mdx} (100%) diff --git a/docs/apps/katana/guides/add-liquidity.mdx b/docs/apps/katana/guides/add-liquidity.mdx new file mode 100644 index 0000000..1cdfbf0 --- /dev/null +++ b/docs/apps/katana/guides/add-liquidity.mdx @@ -0,0 +1,82 @@ +--- +title: Add liquidity to a pool +description: Add your tokens to a liquidity pool to earn fees from transactions. +--- + +## Overview + +You can add more liquidity to an existing pool on Katana to earn fees from transactions. When you contribute liquidity to a pool, you receive liquidity pool (LP) tokens in return. These tokens represent your share in the pool and entitle you to a portion of the trading fees generated by the pool's transactions, directly proportional to your contribution. +You can also remove your liquidity from a pool at any time. Removing pool tokens converts your position back into underlying tokens at the current rate, proportional to your share of the pool. Accrued fees are included in the amounts you receive. + +## Add liquidity to a pool + +1. Open [Katana](https://app.roninchain.com/swap) and connect your Ronin Wallet. +2. Select the **Liquidity pool** page, then open the pool you want to contribute to. + ![Liquidity pool](../assets/katana-pool.png) +3. Enter the amount of tokens you want to contribute, then click **Add**. Katana automatically calculates the equivalent amount of the other token based on the current exchange rate. You may need to approve both tokens in your Ronin Wallet if you interact with them for the first time. + + ![Enter amount](../assets/katana-pool-enter-amount.png) + +4. Review the details of your liquidity contribution: + * The amount of LP tokens you will get in return. + * The amount of tokens you are contributing. + * The share of the pool you will receive. + + Click **Confirm add liquidity**, then confirm the transaction in your Ronin Wallet. + + ![Review details](../assets/katana-pool-confirm-add.png) + +Your transaction is now submitted to the blockchain. When it completes, Katana displays a confirmation pop-up. Close it or click **View on explorer** to see the detailed information about the transaction. + +![Successful liquidity addition](../assets/katana-pool-add-success.png) + +The **My position** panel is now updated with your latest contribution: + +* The amount of ERC20 tokens you contributed. +* The amount of LP tokens received in return. + +![My position](../assets/katana-pool-add-position.png) + +## View your positions + +To see all the pools you contributed to and the fees earned, open the **Liquidity pool** page, then select **My positions**. + +![My positions](../assets/katana-pool-my-positions.png) + +Here you can see the following information: + +* The pools to which you contributed. +* The annual percentage rate (APR) for each pool. +* Your position in each pool. +* The fees you earned from each pool. +* Your claimable rewards from farming, if the pool supports it. + +To view more details, such as the amount of LP tokens and the pool's performance over time, select each pool. + +## Remove liquidity from a pool + +1. Open the **Liquidity pool** page, then select the pool from which you want to withdraw liquidity. + + ![Liquidity pool](../assets/katana-pool.png) + +2. Select the **Remove liquidity** panel. + + ![Remove liquidity panel](../assets/katana-pool-remove-liquidity-panel.png) + +3. Select the portion of your liquidity you want to remove, or enter the amount manually. Then, click **Remove**. + + ![Enter amount to remove](../assets/katana-pool-remove-amount.png) + +4. Review how much you're getting when removing liquidity, then click **Confirm remove liquidity** and confirm the transaction in your Ronin Wallet. + + ![Review details](../assets/katana-pool-confirm-remove.png) + +Your transaction is now submitted to the blockchain. When it completes, Katana displays a confirmation pop-up. Close it or click **View on explorer** to see the detailed information about the transaction. + +![Successful liquidity removal](../assets/katana-pool-remove-success.png) + +The **My position** panel is now updated with your latest position after removing liquidity: + +![My position](../assets/katana-pool-remove-position.png) + +You have now removed your liquidity by removing your LP tokens, and have gotten your tokens with the accrued fees, proportionate to your shares. Thank you for your service. diff --git a/docs/apps/katana/guides/create-farm.mdx b/docs/apps/katana/guides/create-farm.mdx index b26f0b9..c55156b 100644 --- a/docs/apps/katana/guides/create-farm.mdx +++ b/docs/apps/katana/guides/create-farm.mdx @@ -30,26 +30,26 @@ An important metric for farms is the rewards per second. This metric shows how m ## Prerequisites -* Only _whitelisted_ Ronin addresses can create farms. To get whitelisted, submit your Ronin address to Sky Mavis. This address will be linked to our farm contract. **Note: **this address can be the same as the one you used for pool creation, but you still need to get it whitelisted for farm creation. -* A liquidity pool with your ERC20 token created on Katana. For more information, see [Create a liquidity pool](pool.mdx#create-a-liquidity-pool). +* Only _whitelisted_ Ronin addresses can create farms. To get whitelisted, submit your Ronin address to Sky Mavis. This address will be linked to our farm contract. **Note:** this address can be the same as the one you used for pool creation, but you still need to get it whitelisted for farm creation. +* A liquidity pool with your ERC20 token created on Katana. For more information, see [Create a liquidity pool](create-pool.mdx). ## Create a farm 1. Go to [Katana](https://app.roninchain.com/liquidity) and connect your whitelisted Ronin address for farm creation. This address can be the same as the one you used for pool creation, or a different one. 1. On the **Liquidity pool** page, select the pool you want to create a farm for, then click **Incentivize a pool**. - Incentivize a pool + ![Incentivize a pool](../assets/katana-incentivize-pool.png) 2. In the **Incentivize a pool** section, configure the farm rewards: * Set the start and end dates for reward distribution. The start date must be at least 7 days in the future. * Select the token you want to distribute as a reward, and enter the amount. You may need to approve the spending cap for the token in your Ronin Wallet. - Configure farm rewards + ![Configure farm rewards](../assets/katana-configure-farm-rewards.png) 3. Click **Incentivize pool** to finish configuring your farm. - Confirm incentives + ![Confirm pool incentive](../assets/katana-confirm-pool-incentive.png) 4. Click **Incentivise pool & Supply**, then confirm the transaction in your Ronin Wallet. - Supply liquidity for farm rewards + ![Supply liquidity for farm rewards](../assets/katana-incentivize-supply.png) Your farm is now created and scheduled for publishing on the start date. As long as the farm is in a scheduled state, only you can see it. On the start date, the farm becomes visible to everyone. -Successful farm creation +![Successful farm creation](../assets/katana-incentivize-pool-success.png) Click **View farm details** to see the farm details and if you need to, edit the duration or the reward amount of the farm before it's published. @@ -60,17 +60,18 @@ Before your farm is published, you can change the initial reward amount and adju 1. Go to [Katana](https://app.roninchain.com/liquidity) and connect your whitelisted Ronin address for farm creation. 2. On the **Liquidity pool** page, select the scheduled farm that you want to edit, then click **Incentivize a pool**. 3. In the **Edit pool incentives** section, modify the farm duration or reward amount. Then, click **Confirm changes**. - Edit a scheduled farm + ![Edit a scheduled farm](../assets/katana-edit-scheduled-farm.png) 4. Review the amount of tokens you need to top up or receive due to the changes, then press **Confirm**, and then confirm the transaction in your Ronin Wallet. - Confirm farm edit + ![Confirm farm edit](../assets/katana-edit-scheduled-farm-confirm.png) ## Edit a published farm -After the farm is published, you can extend the reward distribution period or end it earlier. If you decide to extend the farm, the system will calculate the amount of rewards you need to pay on top of the initial rewards. If you want to end the farm earlier, the system will issue a refund for the remaining rewards. +After publishing your farm, you can extend its reward distribution period or end it earlier. If you decide to extend the farm, the system will calculate the amount of rewards you need to pay on top of the initial rewards. If you want to end the farm earlier, the system will issue a refund for the remaining rewards. 1. Go to [Katana](https://app.roninchain.com/liquidity) and connect your whitelisted Ronin address for farm creation. 2. On the **Liquidity pool** page, select the published farm that you want to edit, then click **Incentivize a pool**. -3. In the **Edit pool incentives** section, edit the end date. The reward amount will be recalculated automatically. Then, click **Confirm changes**. - Edit a published farm +3. In the **Edit pool incentives** section, edit the end date. Then, click **Confirm changes**. + ![Edit a published farm](../assets/katana-edit-published-farm.png) 4. Click **Confirm changes**, review the details, then confirm the transaction in your Ronin Wallet. - Confirm farm edit + ![Confirm farm edit](../assets/katana-edit-published-farm-confirm.png) + diff --git a/docs/apps/katana/guides/pool.mdx b/docs/apps/katana/guides/create-pool.mdx similarity index 61% rename from docs/apps/katana/guides/pool.mdx rename to docs/apps/katana/guides/create-pool.mdx index a32954f..0486d60 100644 --- a/docs/apps/katana/guides/pool.mdx +++ b/docs/apps/katana/guides/create-pool.mdx @@ -1,5 +1,5 @@ --- -description: Create new liquidity pools and contribute to existing pools on Katana to earn swap fees. +description: Create new liquidity pools on Katana to earn trading fees from transactions. slug: /apps/katana/pool title: Create a liquidity pool --- @@ -8,14 +8,6 @@ title: Create a liquidity pool You can create your own liquidity pools (LP) on Katana, contribute your liquidity to existing pools, and earn trading fees from the resulting transactions. This guide explains how to create a new pool, add liquidity to an existing pool, and remove liquidity from a pool. -:::info -If you're a token creator, you can launch your own ERC20 token on Katana and create a liquidity pool with it. This is a unique opportunity to bootstrap liquidity for your tokens and incentivize trading. By creating a pool, you provide a platform for users to trade your token with other tokens, increasing its utility and value. - -During an initial whitelisting period, only you as the owner of the Ronin address that deployed the ERC20 token can create liquidity pools with your token. After the whitelisting period ends, users can contribute liquidity to your pool or create their own pools with your token. - -After creating a liquidity pool, you can [create a farm](create-farm.mdx) to encourage users to contribute liquidity to your pool. -::: - When creating a new pool, you choose two tokens to pair together. These tokens can be any ERC20 tokens, including ["main" and "seed" tokens](../overview.mdx#trade-main-and-seed-tokens). The system deposits your tokens into a smart contract, effectively increasing the pool's liquidity. For example, if you decide to contribute to the AXS-RON pool, you need to @@ -28,12 +20,18 @@ These tokens not only signify your stake but also entitle you to a portion of the trading fees generated by the pool's transactions, directly proportional to your contribution. These fees are added to pool and accrue in real-time. You can claim them by withdrawing your liquidity. -You can also stake your LP tokens to earn farm rewards. For more information, see [Farm](farm.mdx). - Be aware that earning a profit through providing liquidity isn't guaranteed. You may face what's known as _impermanent loss_, a risk that arises from fluctuations in the value of the deposited tokens. +:::info Token creators +If you're a token creator, you can launch your own ERC20 token on Katana and create a liquidity pool with it. This is a unique opportunity to bootstrap liquidity for your tokens and incentivize trading. By creating a pool, you provide a platform for users to trade your token with other tokens, increasing its utility and value. + +During an initial whitelisting period, only you as the owner of the Ronin address that deployed the ERC20 token can create liquidity pools with your token. After the whitelisting period ends, users can contribute liquidity to your pool or create their own pools with your token. + +After creating a liquidity pool, you can [create a farm](create-farm.mdx) to encourage users to contribute liquidity to your pool. +::: + ## Prerequisites * Only _whitelisted_ Ronin addresses can create liquidity pools during a token whitelisting period. To apply, submit your Ronin address to Sky Mavis. This address will be linked to your token contract after you deploy it. @@ -97,85 +95,14 @@ As a token creator, you can also create a farm for your token. For more informat ## Edit a pool -You can change the amount of tokens in a pool as long as the pool is in a scheduled state. +You can change the initial amount of tokens in a pool as long as the pool is in a scheduled state. 1. On the **Liquidity pool** page, select the pool you want to edit. -2. Add or remove tokens from the pool. For more information, see [Add liquidity to a pool](#add-liquidity-to-a-pool) and [Remove liquidity from a pool](#remove-liquidity-from-a-pool). +2. Add or remove tokens from the pool. For more information, see [Add liquidity to a pool](add-liquidity.mdx). 3. Click **Confirm**, review the details, then confirm the transaction in your Ronin Wallet. -## Add liquidity to a pool - -You can contribute liquidity to existing pools to earn fees from the pool's transactions. - -1. Open [Katana](https://app.roninchain.com/swap) and connect your Ronin Wallet. -2. Select the **Liquidity pool** page, then open the pool you want to contribute to. - ![Liquidity pool](../assets/katana-pool.png) -3. Enter the amount of tokens you want to contribute, then click **Add**. Katana automatically calculates the equivalent amount of the other token based on the current exchange rate. You may need to approve both tokens in your Ronin Wallet if you interact with them for the first time. - - ![Enter amount](../assets/katana-pool-enter-amount.png) - -4. Review the details of your liquidity contribution: - * The amount of LP tokens you will get in return. - * The amount of tokens you are contributing. - * The share of the pool you will receive. - - Click **Confirm add liquidity**, then confirm the transaction in your Ronin Wallet. - - ![Review details](../assets/katana-pool-confirm-add.png) - -Your transaction is now submitted to the blockchain. When it completes, Katana displays a confirmation pop-up. Close it or click **View on explorer** to see the detailed information about the transaction. - -![Successful liquidity addition](../assets/katana-pool-add-success.png) - -The **My position** panel is now updated with your latest contribution: - -* The amount of ERC20 tokens you contributed. -* The amount of LP tokens received in return. - -![My position](../assets/katana-pool-add-position.png) - -## View your positions - -To see all the pools you contributed to and the fees earned, open the **Liquidity pool** page, then select **My positions**. - -![My positions](../assets/katana-pool-my-positions.png) - -Here you can see the following information: - -* The pools to which you contributed. -* The annual percentage rate (APR) for each pool. -* Your position in each pool. -* The fees you earned from each pool. -* Your claimable rewards from farming, if the pool supports it. - -To view more details, such as the amount of LP tokens and the pool's performance over time, select each pool. - -## Remove liquidity from a pool - -Removing pool tokens converts your position back into underlying tokens at the current rate, proportional to your share of the pool. Accrued fees are included in the amounts you receive. - -1. Open the **Liquidity pool** page, then select the pool from which you want to withdraw liquidity. - - ![Liquidity pool](../assets/katana-pool.png) - -2. Select the **Remove liquidity** panel. - - ![Remove liquidity panel](../assets/katana-pool-remove-liquidity-panel.png) - -3. Select the portion of your liquidity you want to remove, or enter the amount manually. Then, click **Remove**. - - ![Enter amount to remove](../assets/katana-pool-remove-amount.png) - -4. Review how much you're getting when removing liquidity, then click **Confirm remove liquidity** and confirm the transaction in your Ronin Wallet. - - ![Review details](../assets/katana-pool-confirm-remove.png) - -Your transaction is now submitted to the blockchain. When it completes, Katana displays a confirmation pop-up. Close it or click **View on explorer** to see the detailed information about the transaction. - -![Successful liquidity removal](../assets/katana-pool-remove-success.png) - -The **My position** panel is now updated with your latest position after removing liquidity: - -![My position](../assets/katana-pool-remove-position.png) +## See also -You have now removed your liquidity by removing your LP tokens, and have gotten your tokens with the accrued fees, proportionate to your shares. Thank you for your service. +* [Add liquidity to a pool](add-liquidity.mdx) +* [Create a farm](create-farm.mdx) +* [Farm tokens](farm-tokens.mdx) diff --git a/docs/apps/katana/guides/farm.mdx b/docs/apps/katana/guides/farm-tokens.mdx similarity index 97% rename from docs/apps/katana/guides/farm.mdx rename to docs/apps/katana/guides/farm-tokens.mdx index 8bf725f..ed1fe0d 100644 --- a/docs/apps/katana/guides/farm.mdx +++ b/docs/apps/katana/guides/farm-tokens.mdx @@ -10,7 +10,7 @@ When you provide liquidity to a pool on Katana, you receive liquidity pool (LP) ## Prerequisites -To farm tokens on Katana, you need to have LP tokens that you can stake. To acquire LP tokens, add your liquidity to a pool as described in the [Pool](pool.mdx#add-liquidity-to-a-pool) guide. +To farm tokens on Katana, you need to have LP tokens that you can stake. To acquire LP tokens, add your liquidity to a pool. For more information, see [Add liquidity to a pool](add-liquidity.mdx). ## Start farming diff --git a/docs/apps/katana/guides/swap.mdx b/docs/apps/katana/guides/swap-tokens.mdx similarity index 100% rename from docs/apps/katana/guides/swap.mdx rename to docs/apps/katana/guides/swap-tokens.mdx diff --git a/docs/apps/katana/overview.mdx b/docs/apps/katana/overview.mdx index 742ddac..ef4d8b2 100644 --- a/docs/apps/katana/overview.mdx +++ b/docs/apps/katana/overview.mdx @@ -18,9 +18,11 @@ Katana ([app.roninchain.com/swap](https://app.roninchain.com/swap)) is a decentr ## Key features -* [Swap](./guides/swap.mdx) between pairs of various ERC20 tokens, including wrapping RON to wRON to make offers on Mavis Market and participate in Ronin token launches, and swapping between "main" and "seed" tokens. -* [Create liquidity pools](./guides/pool.mdx) with two tokens, provide liquidity to existing pools, and earn trading fees. -* [Stake](./guides/farm.mdx) your liquidity pool (LP) tokens in a farm to earn rewards in the form of another ERC20 token. +* [Swap](./guides/swap-tokens.mdx) between pairs of various ERC20 tokens, including wrapping RON to wRON to make offers on Mavis Market and participate in Ronin token launches, and swapping between "main" and "seed" tokens. +* [Create liquidity pools](./guides/create-pool.mdx) with two tokens to earn trading fees. +* [Add liquidity](./guides/add-liquidity.mdx) to existing pools to earn fees from transactions. +* [Create farms](./guides/farm-tokens.mdx) to encourage users to contribute liquidity to your pool. +* [Stake](./guides/farm-tokens.mdx) your liquidity pool (LP) tokens in a farm to earn rewards in the form of another ERC20 token. Some features are only available on the Katana web app, while others are available on the Ronin Wallet mobile app and browser extension: diff --git a/sidebars.js b/sidebars.js index 65bd377..ecd1305 100644 --- a/sidebars.js +++ b/sidebars.js @@ -150,14 +150,38 @@ const sidebars = { }, items: [ // Swap tokens - 'apps/katana/guides/swap', - // Create a liquidity pool - 'apps/katana/guides/pool', - // Create a farm - 'apps/katana/guides/create-farm', - // Farm tokens - 'apps/katana/guides/farm', - ] + 'apps/katana/guides/swap-tokens', + // Liquidity pools + { + type: 'category', + label: 'Liquidity pools', + link: { + type: 'generated-index', + description: 'Guides for creating and managing liquidity pools.', + }, + items: [ + // Create a liquidity pool + 'apps/katana/guides/create-pool', + // Add liquidity to a pool + 'apps/katana/guides/add-liquidity', + ], + }, + // Farms + { + type: 'category', + label: 'Farms', + link: { + type: 'generated-index', + description: 'Guides for creating farms and staking LP tokens.', + }, + items: [ + // Create a farm + 'apps/katana/guides/create-farm', + // Farm tokens + 'apps/katana/guides/farm-tokens', + ], + }, + ], }, // Ronin Explorer 'apps/ronin-explorer',