Channel liquidity
This guide is designed to help you manage your off-chain liquidity on Hydranet. Before delving into this guide, let’s clarify two liquidity concepts:
- Inbound liquidity: The amount of funds you can receive off-chain
- Outbound liquidity: The amount of funds you can send off-chain.
While you have direct control over your outbound liquidity, your inbound liquidity depends on the counterparty funding your state channel. To simplify this, Hydranet offers a Channel Rental Manager, allowing you to rent inbound liquidity on-demand, whenever needed. Read more about these concepts and how off-chain networks function here.
Ensure that you’ve set up your Hydranet testnet wallet and requested funds using the faucet bot on Hydranet’s Discord before diving into this guide. If you haven’t completed these steps yet, check out our Wallet setup guide for assistance.
Managing outbound liquidity - Moving funds between on- and off-chain
Hydranet leverages off-chain networks to facilitate instant and gas-free transactions. This requires the ability to move funds seamlessly between on-chain and off-chain networks. These steps will show you how. Remember that moving funds between on- and off-chain is associated with an on-chain interaction and you will have to pay gas fees for such operations. Make sure to keep some native assets such as ETH and/or BTC in your wallet to pay for this.
Transferring funds off-chain
- Select asset
Navigate to your wallet and choose the asset you’d like to transfer to off-chain. Click Transfer and select Transfer to off-chain - Allowance transaction
For EVM tokens such as USDC, you’ll be prompted to authorize the Lithium protocol to interact with your wallet. This is done via an allowance transaction. Common practice is to set a reasonable allowance limit. However, as this is testnet, you can proceed setting a large limit without concern.
Confirm the transferOnce the allowance transaction is confirmed, finalize the transfer to off-chain. Wait for the on-chain transaction to confirm. When successful, your off-chain balance will update, and the channel status on the Channels page will switch to ACTIVE.
Transferring funds back on-chain
- Select asset
Navigate to your wallet and choose the asset you’d like to transfer back on-chain. Click Transfer and select Transfer back on-chain - Fill in the details
Enter the amount you wish to transfer back on-chain. - Confirm the transfer
Confirm the transaction and wait for the on-chain confirmation.
Managing inbound liquidity - Renting a channel liquidity
Receiving off-chain payments require inbound liquidity, which can be rented using Hydranet’s Channel Rental Manager. This feature makes it easy to increase your inbound liquidity on demand.
- Channels page
Navigate to the Channels page, found on the left-hand side of your screen. The Channels page will show you an overview of all your open state channels. - Rent a channel
Click the Rent a channel button on the top right. Specify the asset you want to rent, the amount, the rental duration, and the currency for payment. Note that payments for rentals are made off-chain, meaning you will need at least one open state channel with sufficient outbound liquidity to pay for your rental. - Confirm the rental
Wait for the on-chain transaction to confirm. Once completed, your state channel will be ready for receiving off-chain payments.
You may observe that your inbound liquidity increases not just by the amount you rented but also by the amount you paid for the rental. This happens because the rental payment is made through an off-chain transaction, effectively shifting funds from your side of the state channel to your peer's side. While these funds remain within the channel, control over them passes to your peer - the Hydranet Hub. You can verify this by noting that the total channel capacity remains unchanged. It still reflects the sum of your initial deposit and the rented amount. For instance, if you rented 10 USDC and paid with 2 USDC off-chain, your inbound liquidity will end up being 12 USDC during the rental period.
Ideas for testing
Your feedback is highly valuable for Hydranet. Use this opportunity to explore all the features this release has to offer and provide insights into your user experience. Be creative in your testing and test all possible options and combinations you can think of. The more we know the better. Here are some testing suggestions to guide your efforts:
- Channel rentals
Can you successfully pay for rentals using different currencies? And do the rented channels close automatically when the rental period expires? How many rental channels can you open? Do your channels behave differently when you have more than one rented channel? - Off-chain transfers
Test both full and partial withdrawals from state channels. Verify the accuracy of balance updates after each transfer. Are the balances and channel status behaving as expected?
Share your thoughts and findings with the Hydranet team in the Alpha Testnet channel on Discord. If necessary, submit a support ticket for further assistance.
Good luck and happy testing!