osmosis icon indicating copy to clipboard operation
osmosis copied to clipboard

docs(CL): useful CLI messages and queries

Open p0mvn opened this issue 1 year ago • 1 comments

Background

Documenting useful CLIs and queries for people to use.

The example of the CLI flow down below is for testing MsgAddToConcentratedLiquiditySuperfluidPosition See the list of other messages in a section below.

# useful queries
osmosisd q concentratedliquidity user-positions osmo1cyyzpxplxdzkeea7kwsydadg87357qnahakaks

osmosisd q concentratedliquidity pools

osmosisd q concentratedliquidity claimable-fees 1

osmosisd q concentratedliquidity claimable-incentives 1

# create pool
osmosisd tx concentratedliquidity create-pool uion uosmo 1 0.001 --from lo-test1 --keyring-backend test --chain-id localosmosis -b=block --fees 875uosmo

# create incentive
osmosisd tx concentratedliquidity create-incentive 69082uosmo 0.1 "2023-05-09T16:01:10.419543805" 1ns --pool-id 1 --from lo-test1 --keyring-backend test --chain-id localosmosis -b=block --fees 875uosmo

# Create a positions between ticks 0 to 100 and 50 to 150
osmosisd tx concentratedliquidity create-position 1 0 100 1000000uosmo,1000000uion 1 0 --from lo-test1 --keyring-backend test -b=block --chain-id=localosmosis --fees 875uosmo

# Create a full range position
osmosisd tx concentratedliquidity create-position 1 [-162000000] 342000000 2000000uosmo,2000000uion 1 0 --from lo-test1 --keyring-backend test -b=block --chain-id=localosmosis --fees 875uosmo

# Gov prop to enable SF asset
osmosisd tx gov submit-proposal set-superfluid-assets-proposal --title="set superfluid assets" --description="set superfluid assets description" --superfluid-assets="cl/pool/1" --deposit=10000000uosmo --from=lo-test1 --chain-id=localosmosis --keyring-backend=test --broadcast-mode=block --fees 1000000uosmo

# Pass the prop
osmosisd tx gov vote 1 yes --from val --keyring-backend test --chain-id=localosmosis -b=block --fees 2000uosmo

# create SF position
osmosisd tx superfluid create-full-range-position-and-sf-delegate 1000000uosmo,1000000uion osmovaloper12smx2wdlyttvyzvzg54y2vnqwq2qjatex7kgq4 1 --from lo-test1 -b block --chain-id localosmosis --keyring-backend test --fees 1000000uosmo --gas 9000000

# perform a swap
osmosisd tx poolmanager swap-exact-amount-in 2000000uosmo 1 --swap-route-pool-ids 1 --swap-route-denoms uion --from lo-test1 --keyring-backend test -b=block --chain-id=localosmosis --fees 875uosmo

# add to position
 osmosisd tx superfluid add-to-superfluid-cl-position 5 1000uosmo 1000uion --from lo-test1 --keyring-backend test --chain-id=localosmosis -b=block

All relevant messages by module

  • x/superfluid

    • MsgAddToConcentratedLiquiditySuperfluidPosition
    • MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition
    • MsgCreateFullRangePositionAndSuperfluidDelegate
  • x/gamm

    • MsgMigrateSharesToFullRangeConcentratedPosition
  • x/concentrated-liquidity

    • MsgCreatePosition
    • MsgWithdrawPosition
    • MsgAddToPosition
    • MsgCollectFees
    • MsgCollectIncentives
    • MsgCreateIncentive
    • MsgFungifyChargedPositions
  • x/poolmanager

    • MsgSwapExactAmountIn
    • MsgSwapExactAmountOut

Queries

  • x/twap - relevant CLI: https://github.com/osmosis-labs/osmosis/blob/db52bebe20363b2041539fa5def2e50a1745533a/x/twap/client/cli/query.go#L29

Relevant Material

  • Public docs: https://github.com/osmosis-labs/osmosis/tree/main/x/concentrated-liquidity
  • Various CL docs and scope: https://github.com/osmosis-labs/osmosis/issues/3014

p0mvn avatar May 17 '23 14:05 p0mvn

For full-range position the lower tick should be [-108000000]

It also helps to add a gas amount, auto failed but setting gas 450000 seemed fine.

Cordtus avatar Dec 08 '23 04:12 Cordtus