Skip to content

Commit

Permalink
Add example for leveragelp pool registration proposal, open/close pos…
Browse files Browse the repository at this point in the history
…itions (#376)

add example for leveragelp pool registration proposal, open/close positions
  • Loading branch information
jelysn authored Feb 15, 2024
1 parent 7225524 commit defdd2b
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions scripts/examples/leveragelp/leveragelp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash

# list pool
elysd query leveragelp list-pool
elysd query leveragelp get-positions-for-address $(elysd keys show -a treasury --keyring-backend=test)
elysd query leveragelp get-positions

# Put pool 2 on leveragelp (Testnet)
elysd tx gov submit-proposal proposal.json --from=t2a --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000 --node=https://rpc.testnet.elys.network:443 --fees=250uelys
```
{
"title": "Enable ATOM/USDC pool (PoolId 2) on leveragelp",
"summary": "Enable ATOM/USDC pool (PoolId 2) on leveragelp",
"messages": [
{
"@type": "/elys.leveragelp.MsgUpdatePools",
"authority": "elys10d07y265gmmuvt4z0w9aw880jnsr700j6z2zm3",
"pools": [
{
"amm_pool_id": 2,
"health": "0.0",
"enabled": true,
"closed": false,
"leveraged_lp_amount": "0",
"leverage_max": "10.0"
}
]
}
],
"deposit": "10000000uelys"
}
```

# Local test
elysd tx gov submit-proposal proposal.json --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000
elysd tx gov vote 1 Yes --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000

# Open 100 USDC position
elysd tx leveragelp open 5 ibc/2180E84E20F5679FCC760D8C165B60F42065DEF7F46A72B447CFF1B7DC6C0A65 100000000 2 --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000
elysd tx leveragelp open [leverage] [collateral-asset] [collateral-amount] [amm-pool-id] [flags]

# Close position
elysd tx leveragelp close 1 --from=treasury --keyring-backend=test --chain-id=elystestnet-1 --yes --gas=1000000
elysd tx leveragelp close [position-id] [flags]

0 comments on commit defdd2b

Please sign in to comment.