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]
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.
# Create a position with 10ATOM/10USD which provide liquidity to price range [9,11] crescentdtxammadd-liquidity191110000000uatom,10000000uusd \--chain-id localnet \--from alice## Tips## You can query expected result of add-liquidity by using the following commandcrescentdqammadd-liquidity-simulation191110000000uatom,10000000uusd-ojson|jq
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
remove-liquidity [position-id] [liquidity]
Example
# Remove 10000 liquidity from position with id 1crescentdtxammremove-liquidity110000 \--chain-id localnet \--from alice## Tips## You can query expected result of remove-liquidity by using the following commandcrescentdqammremove-liquidity-simulation110000-ojson|jq
Collect
Collect rewards accumulated in a position.
The reward consists of the swap fee and farming reward accumulated in the position.
Usage
collect [position-id] [amount]
Example
# Withdraw 10uATOM and 10uUSD of reward from the positinocrescentdtxammcollect110uatom,10uusd \--chain-id localnet \--from alice## Tips## You can query collectible reward by using the following commandcrescentdcrescentdqammcollectible-coins--position-id1-ojson|jq
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.
# Create private farming plancrescentd tx amm create-private-farming-plan "New farming plan" cre1zaavvzxez0elundtn32qnk9lkm8kmcszxclz6p 2023-01-01T00:00:00Z 2024-01-01T00:00:00Z 1:1000000uatom \
--chain-idlocalnet \--from alice \## Tips## You can query farming plans by using the following commandcrescentdqammfarming-plans-ojson|jq
TerminatePrivateFarmingPlan
Terminate a private farming plan.
The plan's termination address must be same with the message sender.
Usage
terminate-private-farming-plan [farming-plan-id]
| Argument | Description | | |:------------------|:--------------- | | farming-plan-id | farming plan id |
Example
# Withdraw pool coin from the poolcrescentdtxammterminate-private-farming-plan1 \--chain-id localnet \--from alice \## Tips## You can query farming plans by using the following commandcrescentdqammfarming-plans-ojson|jq
Query
Params
Query the current amm parameters information
Usage
params
Example
crescentdqammparams-ojson|jq
AllPools
Query for all pools
Usage
pools
Example
crescentdqammpools-ojson|jq
Pool
Query details for the particular pool
Usage
pool [pool-id]
Example
crescentdqammpool1-ojson|jq
AllPositions
Query for all positions
Usage
positions
Example
# Query all positionscrescentdqammpositions-ojson|jq# Query all positions that has the pool idcrescentdqammpositions--pool-id1-ojson|jq# Query all positions of particular addresscrescentdqammposition--ownercre1zaavvzxez0elundtn32qnk9lkm8kmcszxclz6p-ojson|jq
Query collectible coins(fees, rewards) in the position.
Usage
collectible-coins
Example
# Query collectible coins with addresscrescentdqammcollectible-coins--ownercre1zaavvzxez0elundtn32qnk9lkm8kmcszxclz6p-ojson|jq# Query collectible coins with position idcrescentdqammcollectible-coins--position-id1-ojson|jq
AllTickInfos
Query for information of all ticks in the particular pool
Usage
tick-infos [pool-id]
Example
# Query all ticks in poolcrescentdqammtick-infos1-ojson|jq# Query all ticks above designated lower tickcrescentdqammtick-infos1--lower-tick10000-ojson|jq# Query all ticks below designated upper tickcrescentdqammtick-infos1--upper-tick10000-ojson|jq
TickInfo
Query details for the particular tick in the pool
Usage
tick-info [pool-id] [tick]
Example
crescentdqammtick-info110000-ojson|jq
AllFarmingPlans
Query for all farming plans
Usage
farming-plans
Example
# Query all farming planscrescentdqammfarming-plans-ojson|jq# Query farming plans based on private statuscrescentdqammfarming-plans--is-privatetrue-ojson|jq# Query farming plans based on private statuscrescentdqammfarming-plans--is-terminatedtrue-ojson|jq
FarmingPlan
Query details for the particular farming plan
Usage
farming-plan [plan-id]
Example
crescentdqammfarming-plan1-ojson|jq
Argument
Description
market-id
id of the market where the pool's order will be placed
price
initial pool price
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
Argument
Description
position-id
position id
liquidity
amount of liquidity to be removed from the position
Argument
Description
position-id
position id
amount
amounts of reward to be withdrawn
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