Liquidity tab
This guide will walk you through the process of providing liquidity on the Hydranet order book. Our Liquidity tab allows you to provide liquidity in a way similar to traditional on-chain decentralized exchanges such as Uniswap. You set a minimum and maximum price level, effectively creating a liquidity pool that is either below, above, or at the current trading price.
Before using the Liquidity tab, you must have active state channels opened for the trading pair you wish to provide liquidity for, and sufficient inbound and outbound liquidity. If you need guidance on managing your state channel liquidity, refer to this guide.
Importantly, if you lose connectivity or close your wallet, your liquidity position will be removed. Hydranet operates off-chain using state channel protocols, which require both channel peers to be online to sign and process the off-chain transactions. If one peer goes offline, transactions cannot be processed, resulting in the automatic removal of your liquidity position for the order book to remain efficient. We are actively researching options and solutions on how to provide liquidity even when offline.
Setting Up Liquidity Orders
The following steps will guide you through the process of placing liquidity on Hydranet’s order book. A practical example is given below.
- Create position
Navigate to the Liquidity page and click Create Position. - Select pair
Select the two assets you want to provide liquidity for (e.g., HDN/USDC). The assets can either be on the same blockchain or on different. - Define price range
Set a minimum price – this is the lowest price at which your liquidity will be available, and a maximum price – this is the highest price at which your liquidity will be available. Your liquidity will be distributed within this price range, either below, above, or at the current market price, depending on your minimum and maximum price. - Set the amount
Input the amount of liquidity you want to provide for the trading pair. If your defined price range is above the current trading price, you only need to specify the amount of the base asset you want to sell once the price reaches your range. If your defined price range is below the current trading price, you only need to specify the amount of the base asset you want to buy when the price drops into your range. For example, in a HDN/USDC trading pair, setting a price range above the current trading price allows you to specify how much HDN you want to sell once the price rises into your defined range. Conversely, setting a price range below the current trading price lets you specify how much HDN you want to buy when the price drops into your range. - Confirm position
Review your price range, amount, and total allocation. Click Confirm Liquidity Position to submit your liquidity. Your liquidity will now be available on the order book within the specified price range. - Remove
Withdraw your liquidity at any time by clicking Cancel on the Liquidity page. Your liquidity will also automatically be removed if you refresh or close your browser.
A practical example
Let's walk through an example of adding liquidity to a HDN/USDC trading pair. In this example, we’ve opened state channels that are equally balanced, meaning they have the same amount of inbound (Can receive) and outbound (Can send) liquidity for both assets.
Example 1: Providing Liquidity Within the Current Trading Price
- We follow the steps outlined above. Upon reaching step 3, we see that the current trading price of HDN/USDC is $0.02538556.
- Since we want to place liquidity within the current trading price, we set the minimum and maximum price at ±0.001 of the current trading price.
- We decide to provide 250 HDN as liquidity. The system automatically calculates the equivalent value in USDC, which amounts to approximately 6.47 USDC. The colored bars indicate how much of our inbound (Can receive) and outbound (Can send) liquidity we will allocate for this liquidity position.
- As the price moves up, our 250 HDN will gradually be traded for USDC until the price reaches our maximum defined price and we’ve sold all of our provided HDN.
- Conversely, if the price of HDN moves down, our USDC will gradually be traded for HDN until the price reaches our minimum defined price.
Example 2: Providing Liquidity Above the Current Trading Price
- We follow the steps outlined above. Upon reaching step 3, we see that the current trading price of HDN/USDC is $0.02538556.
- Since we want to place liquidity above the current trading price, we set the minimum and maximum price at $0.026 to $0.027. The minimum and maximum price can be set to whatever value above the current trading price.
- We decide to provide 250 HDN as liquidity.
- As the price rises into our range, our 250 HDN will gradually be traded for USDC until the price reaches our maximum defined price.
- If the price does not reach our defined range, our liquidity will remain unused until the price moves into the specified range.
Ideas for testing
Your feedback is crucial in refining the Liquidity tab’s functionality. Here are some areas to test and provide feedback on:
- Can you successfully place and remove liquidity orders?
- What happens if you place liquidity below, above, or at the market price?
- Does your provided liquidity get executed as expected when the market price reaches your set range?
- Are your earnings correctly reflected after successful trades?
- Is the interface intuitive for setting and managing liquidity?
- What happens to your liquidity position when you update your state channel balances by spending or renting liquidity?
Please share your thoughts and findings with the Hydranet team in the Alpha Testnet channel on Discord. If you encounter any issues, submit a support ticket for further assistance.
Good luck and happy testing!