Skip to content
This repository was archived by the owner on Apr 10, 2026. It is now read-only.

Commit 5b1e8f6

Browse files
Added Deposit, Withdraw Token, Minor Fixes (#760)
* Added Deposit, Withdraw Token, Minor Fixes - Added code with us session YouTube link - Added 'channel' check instruction to Send your own Token. - Removed parenthesis from bash code of Swap Token and added -y flag for bypassing confirmation prompt. - Added the functionality - Deposit Token and Withdraw Token - Added conclusion * Minor fixes
1 parent 0aef6ad commit 5b1e8f6

1 file changed

Lines changed: 51 additions & 3 deletions

File tree

liquidity-module/index.md

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ The liquidity module allows users to use pools to trade those tokens on your blo
1717

1818
In this tutorial, you create your own blockchain, send tokens to another blockchain, create a pool, deposit to a pool, withdraw from a pool, and swap tokens.
1919

20+
You can follow the [code with us session](https://www.youtube.com/watch?v=GxaqpzMk0jk&t=978s) for hands-on experience
21+
2022
**Important** In the code examples throughout this tutorial, when you see username be sure to substitute your username.
2123

2224
**You will learn how to:**
@@ -227,7 +229,9 @@ See your balance at [https://api.testnet.cosmos.network/cosmos/bank/v1beta1/bala
227229
Now that your account on testnet is funded with testnet tokens, you can send your own token to the testnet.
228230
229231
At your local terminal, enter the IBC module command to transfer your token to the testnet.
230-
Make sure to replace `cosmosxxxxx` with your address, `mytoken` with your token name and `username` with your username.
232+
Make sure to replace `cosmosxxxxx` with your address, `mytoken` with your token name, `username` with your username and `channel-0` with channel
233+
234+
**Note:** Make sure to use *channel* as shown in terminal when you run `starport relayer connect`
231235
232236
```bash
233237
myblockchaind tx ibc-transfer transfer transfer channel-0 cosmosxxxxx "15000000mytoken" --from username
@@ -237,7 +241,7 @@ After your transaction is complete, check your balance on the Gravity DEX testne
237241
238242
Make sure to replace `cosmosxxxxx` with your address.
239243
240-
**Tip** Sometimes transactions don't go through on the first try. Make sure you check the terminal window that shows the relayer process and verify that you see output similar to the following output:
244+
**Tip:** Sometimes transactions don't go through on the first try. Make sure you check the terminal window that shows the relayer process and verify that you see output similar to the following output:
241245
242246
```markdown
243247
Relay 1 packets from myblockchain => cosmoshub-testnet
@@ -317,11 +321,55 @@ Confirm the pool has been created. See:
317321
You are ready to swap tokens! You now have uphoton token in your account and want to swap for the new IBC coin:
318322
319323
```bash
320-
gaiad tx liquidity swap 1 1 100000uphoton ibc/longibchash 0.1 0.003 --from username --chain-id cosmoshub-testnet --gas-prices "0.025stake" --node https://[rpc.testnet.cosmos.network:443](https://rpc.testnet.cosmos.network/)
324+
gaiad tx liquidity swap 1 1 100000uphoton ibc/longibchash 0.1 0.003 --from username --chain-id cosmoshub-testnet --gas-prices "0.025stake" --node https://rpc.testnet.cosmos.network:443 -y
321325
```
326+
**Optional:** Add -y flag to bypass confirmation prompt
322327
323328
Check the balance on the new account that made the trade:
324329
325330
[https://api.testnet.cosmos.network/cosmos/bank/v1beta1/balances/cosmosxxx](https://api.testnet.cosmos.network/cosmos/bank/v1beta1/balances/cosmosxxx)
326331
327332
Make sure to replace `cosmosxxxxx` with your address.
333+
334+
335+
## Deposit Token
336+
337+
You can Deposit tokens to the pool you have created.
338+
339+
```bash
340+
gaiad tx liquidity deposit 1 100uphoton,100ibc/longibchash --from username --chain-id cosmoshub-testnet --gas-prices "0.025stake" --node https://rpc.testnet.cosmos.network:443 -y
341+
```
342+
**Optional:** Add -y flag to bypass confirmation prompt
343+
344+
**Note:** Deposits must be the same coin denoms as the reserve coins.
345+
346+
Check the balance on the new deposit that you have made:
347+
348+
[https://api.testnet.cosmos.network/cosmos/bank/v1beta1/balances/cosmosxxx](https://api.testnet.cosmos.network/cosmos/bank/v1beta1/balances/cosmosxxx)
349+
350+
351+
## Withdraw Token
352+
353+
You can also withdraw tokens from the pool you have created.
354+
355+
```bash
356+
gaiad tx liquidity withdraw 1 100pool-id --from username --chain-id cosmoshub-testnet --gas-prices "0.025stake" --node https://rpc.testnet.cosmos.network:443
357+
```
358+
**Note:** Make sure to replace pool-id found [here](https://api.testnet.cosmos.network/cosmos/bank/v1beta1/balances/cosmosxxx)
359+
360+
Check the balance on the new withdrawal that you have made:
361+
362+
[https://api.testnet.cosmos.network/cosmos/bank/v1beta1/balances/cosmosxxx](https://api.testnet.cosmos.network/cosmos/bank/v1beta1/balances/cosmosxxx)
363+
364+
365+
## 🎉 Congratulations 🎉
366+
367+
By completing this tutorial you have learned how to use liquidity module.
368+
369+
Here’s what you accomplished in this tutorial:
370+
371+
- Creating a Blockchain with Starport and connecting to testnet
372+
- Creating a new liquidity pool with IBC token
373+
- Swap tokens within the pool
374+
- Deposit tokens to the pool
375+
- Withdraw tokens from the pool

0 commit comments

Comments
 (0)