Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
p6te committed Mar 27, 2024
1 parent e35be4d commit 4be6a35
Show file tree
Hide file tree
Showing 23 changed files with 139 additions and 104 deletions.
12 changes: 6 additions & 6 deletions docs/docs/tutorial/faq_tutorial.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ slug: /faq_tutorial

<details id='2'>
<summary>
Is slippage tolerance effective in both directions? <a href='/docs/faq_tutorial#2'>#</a>
Is slippage tolerance effective for both minimizing losses and maximizing bonus token
acquisition?? <a href='/docs/faq_tutorial#2'>#</a>
</summary>
<p>
No, slippage tolerance only safeguards you from excessive transaction fees. If the slippage
benefits you, the transaction will proceed without interruption.
No, slippage tolerance only safeguards you from excessive costs. If the slippage benefits you,
the transaction will proceed without interruption and you can get more tokens then expected.
</p>
</details>

Expand All @@ -39,9 +40,8 @@ slug: /faq_tutorial
</summary>
<p>
The fee is deducted upon initiating a transaction on Invariant, irrespective of its success or
failure. This fee covers processing and network costs associated with attempting the
transaction. Even if the transaction fails, these costs are incurred and not refunded to the
user.
failure. This fee covers processing the transaction. Even if the transaction fails, these costs
are incurred and not refunded to the user, but are smaller then in case of success.
</p>
</details>

Expand Down
45 changes: 22 additions & 23 deletions docs/docs/tutorial/how_to_add_liquidity.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,66 @@ slug: /how_to_add_liquidity

### Add new position to existing pool

1. Head to the "Pool" page and click **Add position**.
1. Head to the "Pool" page and click **Add position**.

![add position](/img/docs/app/add_position.png)

2. Select pair of tokens. We have chosen as an example pair of stable coins.
2. Select pair of tokens. We have chosen as an example pair of stable coins.

![liquidity position](/img/docs/app/liquidity_position.png)

3. Select **fee**. Each fee represents different liquidity pool.
3. Select **fee**. Each fee represents different liquidity pool.

![fee](/img/docs/app/fee.png)

Invariant provides specific fee values that you can choose to create you position. For your better experience, wondering which fee should choose, for some positions we highlighted which option is most recommended.
Invariant provides specific fee values that you can choose to create you position. For your better experience, wondering which fee should choose, for some positions we highlighted which option is most recommended.

<blockquote>
The fees associated with your liquidity position will be in both tokens of the given pair. After swapping between SOL and USDC, for instance, a small amount of both SOL and USDC will be credited to your account as rewards for providing liquidity.
Fees for your liquidity position are deducted from the first token you deposit, regardless of the swap direction. For example, if you add SOL and USDC to a pool, fees are taken in SOL. Conversely, if you add USDC and SOL, fees are deducted from your USDC balance.

Users have flexibility in determining the concentration of their range orders. Opting for a broader range may result in higher fee generation in the event of price fluctuations within your range, but it also raises the risk of incomplete orders if the spot price shifts before your entire range is executed.
Users control the precision of their range orders. A tighter range (smaller difference between upper and lower limits) can generate higher fees if the price fluctuates within your set range. However, it also increases the risk of incomplete orders if the market price moves significantly before your entire range is filled. Conversely, a wider range (larger difference between upper and lower limits) results in lower fees but provides less control over the final execution price.

When selecting a range for your orders, consider the characteristics of the assets involved. For stable coins, which typically have low volatility, a narrower range may be appropriate to capture smaller price movements and maintain stability in your liquidity provision. In contrast, for more dynamic coins with higher volatility, a wider range could be advantageous to accommodate larger price fluctuations and capture potential trading opportunities. Adjusting the range based on the stability and volatility of the assets allows you to optimize your liquidity provision strategy and adapt to market conditions effectively.

</blockquote>

4. Provide value of tokens. The value of tokens is interdependent, as the result of multiplying them must always yield the same outcome.
4. Provide amount of tokens. The amount of tokens is interdependent, as the result of multiplying them must always yield the same outcome.

5. Choose between two options for adding **concentrated liquidity** and setting up the pool range:
5. Choose between two options for adding **concentrated liquidity** and setting up the pool range:

- [**Uniform liquidity**](/docs/uniform_concentration) - Ideal for beginners, this option evenly distributes liquidity on both sides of the current price. It utilizes a simple slider to inform you about the potential increase in fees compared to the full range with the same amount of tokens

- [**Price range**](/docs/price_range) - Offers full customization, allowing you to set the liquidity range at any point, even on one side of the current price. This option utilizes movable flags on the chart to set the minimum and maximum price of the liquidity range.

![liquidity legend](/img/docs/app/liquidity_legend.png)
![line chart](/img/docs/app/line_chart.png)
![line chart](/img/docs/app/bar_chart.png)

#### Legend:

#### Legend:

<blockquote>

- <b>white dashed lines</b> - represents the active liquidity range in the liquidity chart. Active liquidity is determined by the maximum price range resulting from the statistical volume of swaps for the last 7 days.
- <b>white dashed lines</b> - represents the active liquidity range in the liquidity chart. Active liquidity is determined by the maximum price range resulting from the statistical volume of swaps for the last 7 days.

- <b>yellow bold line</b> - represents current price.

- <b>yellow bold line</b> - represents current price.
- <b>lines labeled with min and max</b> - represents the user-defined liquidity range for creating position in pool.

You can switch view between <b>Bar chart</b> and <b>Line chart</b>.

</blockquote>

![line chart](/img/docs/app/line_chart.png)
![line chart](/img/docs/app/bar_chart.png)

6. When you finish, just press **Add Liquidity**. After that you will have to confirm transaction in your wallet. Notice that from your wallet will be taken also small amount of **SOL** - which is deposit to create liquidity pool. Once you decide to close this pool, most of that fee will go back to you.
6. Once you're ready, click **Add Liquidity** You'll then be prompted to confirm the transaction in your wallet. A small amount of **SOL** will be deducted from your wallet as a deposit to create your liquidity pool and position. If the pool already exists, this fee is only for creating your position, not for pool creation itself. Most of this fee will be returned to you when you decide to close your position. However, currently, closing the entire pool is not possible.

7. If you come back to liquidity position list, then you can see your active positions.
7. In the liquidity position list, you can easily identify your active positions. These positions will have their fee highlighted in green, indicating that they are currently generating fees.

![line chart](/img/docs/app/pool_position.png)
![line chart](/img/docs/app/positions.png)

After some time you can observe **how price changes and take fees**, which you get from providing liquidity.
After some time you can observe **how price changes and take fees**, which you get from providing liquidity.

### Create new pool

![line chart](/img/docs/app/not_existing_pool.png)

It can happend that the pair of tokens that you have chosen not exist in any pool. In that case you can create it first. It's important to keep in mind, that estimated cost of creating a new pool is **0.1 SOL**

Creation process is almost the same like for existing pool. Difference is that you don't have an preview of chart and **you should specified staring price ratio for chosen pair of tokens**.


The creation process for a new pool is similar to adding liquidity to an existing one, but with two key differences. First, you won't see a preview chart of the liquidity range. Second, **you'll need to specify the starting price ratio for your chosen token pair**. It's recommended to check the global market price to ensure an accurate value.
4 changes: 2 additions & 2 deletions docs/docs/tutorial/how_to_add_liquidity/price_range.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ For greater precision compared to uniform concentration, Invariant offers the op

![liquidity legend](/img/docs/app/price_range_liquidity.png)

To set the price range, simply drag the movable flags on the liquidity chart labeled as **MIN** and **MAX**. Alternatively, you can use buttons to adjust the min and max prices by 0.01% increments, known as "one tick."
To set the price range, simply drag the movable flags on the liquidity chart labeled as **MIN** and **MAX**. Alternatively, you can use buttons to adjust the min and max prices of the range.

In cases where the price range does not cover the current market price, you can still create a specific liquidity pool by adding only one token from the pair. This allows users to participate in providing liquidity, even with a limited range, ensuring flexibility in managing assets within the decentralized exchange ecosystem.
In cases where the price range does not cover the current market price, you can still create a specific liquidity pool by adding only one token from the pair. This allows users to participate in providing liquidity, even with a limited range, ensuring flexibility in managing assets within the decentralized exchange ecosystem.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ title: Uniform concentration
slug: /uniform_concentration
---

Let's simplify the concept of uniform concentration to enhance transparency in liquidity provision. With uniform concentration, the liquidity range is symmetrically centered around the current token price. For instance, if the USDT/USDC pair is priced at 0.999 and we set the delta price to 0.1 percent, liquidity creation will be focused on the range of 0.998 to 1.
Let's simplify the concept of uniform concentration to enhance transparency in liquidity provision. With uniform concentration, the liquidity range is symmetrically centered around the current token price. For instance, if the USDT/USDC pair is priced at 0.999 and we set the delta price to 0.1 percent, liquidity will be alocated in the range from 0.998 to 1.

![liquidity legend](/img/docs/app/uniform_concentration.png)

Maintaining such a position suggests the potential to earn significantly higher fees compared to providing liquidity across the full range. For a user-friendly experience, we've introduced a concentration slider, enabling users to symmetrically boost liquidity around the current price while maximizing efficiency.

It's crucial to understand that the current price may change after you set up a pool with a specific range. If the current price moves outside your designated range, your liquidity pool will become inactive until the current price returns to your set range.
Liquidity positions are range-bound. If the price moves outside your set range after you add liquidity, your position will become inactive until the price returns within your chosen range.
4 changes: 1 addition & 3 deletions docs/docs/tutorial/how_to_claim_fee.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ slug: /how_to_claim_fee

2. Choose the pool from which you wish to claim fees.

3. Upon selecting a specific pool, locate the **Unclaimed fees** section. To collect your profits from the pool, simply click the **Claim fee** button.
3. Upon selecting a specific pool, locate the **Unclaimed fees** section. To collect your profits from the pool, simply click the **Claim fee** button. Any remaining fees will also be automatically returned to you when you close your position.

![claim fee](/img/docs/app/claim_fee.png)

4. If you opt to collect your fees, you'll need to approve the transaction in your wallet. Once approved, the tokens will be transferred to your wallet address. That concludes the process! Remember, each claim incurs a blockchain transaction, so consider holding onto unclaimed fees to minimize extra fees.


10 changes: 8 additions & 2 deletions docs/docs/tutorial/how_to_remove_liquidity.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ slug: /how_to_remove_liquidity

![close position](/img/docs/app/close_position.png)

2. Next, you'll need to confirm the transaction in your wallet. Note that you will receive back some **SOL - which was deposit for your pool position** - along with the value of tokens from your pool.
2. Next, you'll need to confirm the transaction in your wallet.

![confirm close](/img/docs/app/confirm_close.png)
After confirming the transaction in your wallet, you'll receive:

- **Returned deposit** - A portion of SOL will be returned, representing the deposit you initially made for your liquidity position.
- **Withdrawn liquidity** - You'll get back the tokens you provided as liquidity.
- **Unclaimed fees** (if any) - Any fees you haven't claimed yet will also be returned to you.

![confirm close](/img/docs/app/confirm_close.png)
18 changes: 11 additions & 7 deletions docs/docs/tutorial/how_to_swap.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ slug: /how_to_swap

Swapping tokens on Invariant is easy, fast, and cost-effective. Here's a step-by-step guide to get started:

1. Navigate to the **Swap** page.
1. Navigate to the **Swap** page.

2. Select the tokens you wish to swap. For instance, if you want to swap **SOL** tokens, click on the SOL token. A modal will appear where you can choose a specific token by either entering its name or selecting one from the list. Additionally, you can add a token by clicking the **plus** button and providing its token address. In this example, we're swapping from SOL to USDC.
2. Select the tokens you wish to swap. For instance, if you want to swap **SOL** tokens, click on the SOL token. A modal will appear where you can choose a specific token by either entering its name or selecting one from the list. Additionally, you can add a token by clicking the **plus** button and providing its token address. In this example, we're swapping from SOL to USDC.

![token](/img/docs/app/token.png)

Expand All @@ -22,8 +22,8 @@ Swapping tokens on Invariant is easy, fast, and cost-effective. Here's a step-by

![transaction details](/img/docs/app/transaction_details.png)

- **Exchange rate** - Indicates how much of one cryptocurrency you'll receive in exchange for another, helping you understand the impact of your trade on your holdings.
- **Fee** - Represents the cost associated with executing a trade on the blockchain, ensuring quick and secure transaction processing.
- **Exchange rate** - Indicates how much of one token you'll receive for another (e.g., 1 SOL = 190 USDC), helping you understand the trade's impact on your holdings.
- **Fee** - Represents the cost associated with using a particular liquidity pool to execute a transaction. It shows the amount paid to liquidity providers as an incentive for supplying liquidity.
- **Price impact** - Measures how much a trade affects the price of a cryptocurrency, providing insight into its potential market impact.
- **Slippage tolerance** - Sets the maximum difference between the expected and actual price of a trade, ensuring execution within a specified price range even if market conditions change.

Expand All @@ -32,11 +32,16 @@ You can also swap the exchange rate by clicking on the token's price.
![price 1](/img/docs/app/price1.png)
![price 2](/img/docs/app/price2.png)

5. Optional you can set **slippage tolerance** in the top right corner (By default set to 1).
5. In the top right corner, you can optionally set your slippage tolerance (defaults to 1%).

- This value is a percentage, where 1% is represented by 1.
- Clicking the **Auto** button sets the slippage tolerance to 1%.
- Maximum possible value is 50%.
- Invariant remembers your slippage tolerance setting for future use, even after you close your browser.

![swap transaction settings](/img/docs/app/swap_transaction_settings.png)

6. Before initiating a swap, you have the option to refresh token prices by clicking the **"refresh button"**. This action helps mitigate the risk of encountering high slippage during the transaction by providing updated pricing information.
6. Before initiating a swap, you have the option to refresh token prices by clicking the **"refresh button"**. This action helps mitigate the risk of encountering high slippage during the transaction by providing updated pricing information.

![refresh](/img/docs/app/refresh.png)

Expand All @@ -47,4 +52,3 @@ You can also swap the exchange rate by clicking on the token's price.
![confirm transaction](/img/docs/app/confirm_transaction.png)

9. That's it! After a few seconds, you should see your swapped tokens in your wallet.

8 changes: 3 additions & 5 deletions docs/docs/tutorial/interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ This tutorial will explain and show you how to use all the features of Invariant

Below is a breakdown of the interface elements you'll encounter when using our platform.


### Main features of Invariant

![tabs](/img/docs/app/tabs.png)

[**Swap**](/docs/how_to_swap) - This tab allows you to swiftly exchange one cryptocurrency for another directly from your wallet. It's a convenient feature for quick transactions.
[**Swap**](/docs/how_to_swap) - This tab allows you to swiftly exchange one cryptocurrency for another directly from your wallet. It's a convenient feature for quick transactions.

[**Pool**](/docs/how_to_add_liquidity) - In the Pool tab, you can provide liquidity to the decentralized exchange by depositing pairs of tokens into liquidity pools. These pools facilitate trading and earn you a share of the transaction fees.

[**Stats**](/docs/stats) - The Stats tab provides essential statistical information about various tokens, pools, and trading pairs available on the platform. It's a useful tool for making informed trading decisions.
[**Stats**](/docs/stats) - The Stats tab provides essential statistical information about various tokens, pools, and trading pairs available on the platform. These data can provide valuable insights for decision-making regarding liquidity provision or market-making strategies.

[**Farms**](/docs/interface) - This tab displays yield farming opportunities where you can stake your LP (Liquidity Provider) tokens to earn additional rewards in the form of the platform's native token or other incentives.

Expand All @@ -27,9 +26,8 @@ Below is a breakdown of the interface elements you'll encounter when using our p

[**Fee**](/docs/transaction_priority) - This button allows you to adjust the transaction fee or priority level when making trades. Higher fees typically result in faster transactions.

[**RPC**](/docs/rpc) - You can switch between different network configurations using this button.
[**RPC**](/docs/rpc) - You can switch between different RPC providers using this button.

[**Select Network**](/docs/networks) - You can switch between different blockchain networks using this feature. By default, the mainnet is selected, but you can explore other networks as needed.

[**Connect Wallet**](/docs/how_to_connect_your_wallet) - This button enables users to connect their cryptocurrency wallet to the Invariant, allowing to manage funds and interact with the platform seamlessly. After connecting your wallet, in this place will show up your wallet address."

Loading

0 comments on commit 4be6a35

Please sign in to comment.