A pool is tied to a single market and places orders to market based on the preset logic. Once a pool is created, liquidity providers can create positions.
Usage
create-pool [market-id] [price]
Argument
Description
market-id
id of the market where the pool's order will be placed
price
initial pool price
Example
# Create a poolcrescentdtxammcreate-pool110\--chain-id localnet\--from alice## Tips## You can query pools by using the following commandcrescentdqammpools-ojson|jq
AddLiquidity
Add liquidity to existing position or make a new position.
Position(s) belong to a pool. Therefore, a pool must exist in order to create a position. Anyone can create a position with custom range.
Usage
Argument
Description
pool-id
pool id
lower-price
lower bound for price range of liquidity providing
upper-price
upper bound for price range of liquidity providing
desired-amount
deposit amounts of base and quote coins
Example
RemoveLiquidity
Withdraw coins from the liquidity providing position.
Withdrawal requests are typically processed in the order they are received, rather than being delayed until the end of a batch.
Usage
Argument
Description
position-id
position id
liquidity
amount of liquidity to be removed from the position
Example
Collect
Collect rewards accumulated in a position.
The reward consists of the swap fee and farming reward accumulated in the position.
Usage
Argument
Description
position-id
position id
amount
amounts of reward to be withdrawn
Example
CreatePrivateFarmingPlan
Create a new private farming plan.
The newly created plan's farming pool address is automatically generated and will have no balances in the account initially.
Manually send enough reward coins to the generated farming pool address to make sure that the rewards allocation happens.
The plan's termination address is set to the plan creator.
Argument
Description
description
a brief description of the plan
termination-address
address where the remaining farming rewards in the farming pool transferred when the plan is terminated
start-time
the time at which the plan begins, in RFC3339 format
end-time
the time at which the plan ends, in RFC3339 format
reward-allocations...
whitespace-separated list of the reward allocations
Example
TerminatePrivateFarmingPlan
Terminate a private farming plan.
The plan's termination address must be same with the message sender.
Usage
| Argument | Description | | |:------------------|:--------------- | | farming-plan-id | farming plan id |
Example
Query
Params
Query the current amm parameters information
Usage
Example
AllPools
Query for all pools
Usage
Example
Pool
Query details for the particular pool
Usage
Example
AllPositions
Query for all positions
Usage
Example
Position
Query details for the particular position
Usage
Example
AddLiquiditySimulation
Query expected result for add-liquidity
Usage
Example
RemoveLiquiditySimulation
Query expected result for remove-liquidity
Usage
Example
CollectibleCoins
Query collectible coins(fees, rewards) in the position.
Usage
Example
AllTickInfos
Query for information of all ticks in the particular pool
# Create a position with 10ATOM/10USD which provide liquidity to price range [9,11]
crescentd tx amm add-liquidity 1 9 11 10000000uatom,10000000uusd \
--chain-id localnet \
--from alice
#
# Tips
#
# You can query expected result of add-liquidity by using the following command
crescentd q amm add-liquidity-simulation 1 9 11 10000000uatom,10000000uusd -o json | jq
remove-liquidity [position-id] [liquidity]
# Remove 10000 liquidity from position with id 1
crescentd tx amm remove-liquidity 1 10000 \
--chain-id localnet \
--from alice
#
# Tips
#
# You can query expected result of remove-liquidity by using the following command
crescentd q amm remove-liquidity-simulation 1 10000 -o json | jq
collect [position-id] [amount]
# Withdraw 10uATOM and 10uUSD of reward from the positino
crescentd tx amm collect 1 10uatom,10uusd \
--chain-id localnet \
--from alice
#
# Tips
#
# You can query collectible reward by using the following command
crescentd crescentd q amm collectible-coins --position-id 1 -o json | jq
# Create private farming plan
crescentd tx amm create-private-farming-plan "New farming plan" cre1zaavvzxez0elundtn32qnk9lkm8kmcszxclz6p 2023-01-01T00:00:00Z 2024-01-01T00:00:00Z 1:1000000uatom \
--chain-id localnet \
--from alice \
#
# Tips
#
# You can query farming plans by using the following command
crescentd q amm farming-plans -o json | jq
terminate-private-farming-plan [farming-plan-id]
# Withdraw pool coin from the pool
crescentd tx amm terminate-private-farming-plan 1 \
--chain-id localnet \
--from alice \
#
# Tips
#
# You can query farming plans by using the following command
crescentd q amm farming-plans -o json | jq
params
crescentd q amm params -o json | jq
pools
crescentd q amm pools -o json | jq
pool [pool-id]
crescentd q amm pool 1 -o json | jq
positions
# Query all positions
crescentd q amm positions -o json | jq
# Query all positions that has the pool id
crescentd q amm positions --pool-id 1 -o json | jq
# Query all positions of particular address
crescentd q amm position --owner cre1zaavvzxez0elundtn32qnk9lkm8kmcszxclz6p -o json | jq