owned this note
owned this note
Published
Linked with GitHub
# BidderName Deployment Venue Queries
### Deployment Query
You can query the current holdings of the Hydro address in the pool
like this:
First, let's reveal how many LP tokens user has (do not forget to replace $USER_ADDRESS with your address in this command).
Command Line:
```
neutrond q wasm cs smart neutron1yem82r0wf837lfkwvcu2zxlyds5qrzwkz8alvmg0apyrjthk64gqeq2e98 '{"pair":{}}' --node $NEUTRON_1 -o j | jq .data.liquidity_token | sed 's/\"//g' | xargs -I {} neutrond q bank balance $USER_ADDRESS {} --node $NEUTRON_1 -o j | jq .balance.amount | sed 's/\"//g'
```
LCD query:
```
https://rest-kralum.neutron-1.neutron.org/cosmos/bank/v1beta1/balances/{address}
```
Second, let's take the output above and query shares from pool
Command line:
```
neutrond q wasm cs smart neutron1yem82r0wf837lfkwvcu2zxlyds5qrzwkz8alvmg0apyrjthk64gqeq2e98 '{"share":{"amount":"$VALUE_FROM_ABOVE"}}' --node $NEUTRON_1 -o j | jq .data
```
LCD query:
```
QUERY_MSG = b'''{
"simulate_withdraw": {
"lp_amount": "1000"
}
}'''
https://rest-kralum.neutron-1.neutron.org)/cosmwasm/wasm/v1/contract/{CONTRACT_ADDRESS}/smart/{query_b64encoded}
```
Example output:
```
[
{
"info": {
"native_token": {
"denom": "ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9"
}
},
"amount": "149"
},
{
"info": {
"native_token": {
"denom": "factory/neutron1k6hr0f83e7un2wjf29cspk7j69jrnskk65k3ek2nj9dztrlzpj6q00rtsa/udatom"
}
},
"amount": "97"
}
]
```
The total TVL can be obtained by querying:
Command line:
```
neutrond query wasm contract-state smart $CONTRACT_ADDRESS {"pool": {}}
```
LCD query:
```
QUERY_MSG = b'''{
"pool": {}
}'''
https://rest-kralum.neutron-1.neutron.org)/cosmwasm/wasm/v1/contract/{CONTRACT_ADDRESS}/smart/{query_b64encoded}
```
Example output:
```
{
"data": {
"assets": [
{
"info": {
"native_token": {
"denom": "factory/neutron1ffus553eet978k024lmssw0czsxwr97mggyv85lpcsdkft8v9ufsz3sa07/astro"
}
},
"amount": "1083"
},
{
"info": {
"native_token": {
"denom": "ibc/9598CDEB7C6DB7FC21E746C8E0250B30CD5154F39CA111A9D4948A4362F638BD"
}
},
"amount": "940"
}
],
"total_share": "1000"
}
}
```
[More explanation can also go here. For example:] To get the total assets owned by the Hydro address, query its balance for the xyz token by querying
.... To get the ATOM value of one xyz token, query ....
# BidderName Example Transactions
To enter the liquidity into the pool, issue a message:
```
{
"type": "osmosis/cl-create-position",
"value": {
"lower_tick": "50700",
"pool_id": "2371",
"sender": "osmo14fmxw54lgvheyn7m0p9efpr82fac68ysdnlg5z",
"token_min_amount0": "85000",
"token_min_amount1": "79915",
"tokens_provided": [
{
"amount": "94018",
"denom": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"
},
{
"amount": "100000",
"denom": "ibc/C1B4D4804EB8F95FFB75E6395A301F0AD6D7DDE5C3A45571B70E46A368DD353E"
}
],
"upper_tick": "83600"
}
}
```
lower_tick and upper_tick correspond to the lower and upper limit of the liquidity position.