Complete technical reference for the DEX module including CLI commands, messages, queries, events, state, and data structures
/module-reference/x/dex/client/cli/
and protocol buffer definitions in /module-reference/proto/dex/
, ensuring 100% accuracy with source code.neutrond
command-line interface allows users to interact with the Dex module using positional arguments.
receiver
: Address to receive the liquidity positiontoken-a
: First token in the pairtoken-b
: Second token in the pairlist of amount-0
: Comma-separated amounts of token A to depositlist of amount-1
: Comma-separated amounts of token B to depositlist of tick-index
: Comma-separated tick indexes (use brackets for negative values: [-10,5]
)list of fees
: Comma-separated fee tiers in basis pointsdisable_autoswap
: Comma-separated boolean values for autoswap optionsfail_tx_on_BEL
: Comma-separated boolean values for BEL (Below Expected Liquidity) failure options--swap-on-deposit
: Enable swap on deposit (optional)receiver
: Address to receive withdrawn tokenstoken-a
: First token in the pairtoken-b
: Second token in the pairlist of shares-to-remove
: Comma-separated amounts of shares to removelist of tick-indexes
: Comma-separated tick indexeslist of fees
: Comma-separated fee tiersreceiver
: Address to receive the output tokenstoken-in
: Input token denominationtoken-out
: Output token denominationtick-index
: Price tick for the order (wrap negative values in brackets: [-10]
)amount-in
: Amount of input tokensorder-type
(optional): Order type (GOOD_TIL_CANCELLED
, FILL_OR_KILL
, IMMEDIATE_OR_CANCEL
, JUST_IN_TIME
, GOOD_TIL_TIME
)expirationTime
(optional): Expiration time for time-limited orders (format: 01/02/2006 15:04:05
)--max-amount-out
: Maximum amount of output tokens--price
: Limit price for the ordertranche-key
: Key of the limit order tranche to canceltranche-key
: Key of the filled limit order tranchereceiver
: Address to receive output tokensroutes
: Semicolon-separated list of hop routes, where each route is comma-separated hops (format: route1;route2
where route1=tokenA,tokenB,tokenC
)amount-in
: Amount of input tokensexit-limit-price
: Minimum acceptable pricepick-best-route
: Whether to automatically pick the best route (boolean)<>
characters.
Example:
MsgDeposit
allows users to add liquidity to concentrated liquidity pools.
MsgWithdrawal
allows users to remove liquidity from pools.
MsgPlaceLimitOrder
submits a limit order to the DEX.
MsgWithdrawFilledLimitOrder
withdraws proceeds from filled limit orders.
MsgCancelLimitOrder
cancels an existing limit order.
MsgMultiHopSwap
executes trades across multiple pools to achieve better prices.
/module-reference/proto/dex/query.proto
for 100% accuracy.pair_id
: Token pair identifier (e.g., “tokenA<>tokenB”)tick_index
: Tick index of the poolfee
: Fee tier in basis pointspool_id
: Unique pool identifierpair_id
: Token pair identifiertoken_in
: Input token denominationpair_id
: Token pair identifiertoken_in
: Input token denominationtick_index
: Tick index of the poolfee
: Fee tier in basis pointsid
: Pool metadata IDaddress
: User addresstranche_key
: Limit order tranche keypagination.key
(optional): Base64-encoded key for paginationpagination.offset
(optional): Numeric offset for paginationpagination.limit
(optional): Maximum number of results to returnpagination.count_total
(optional): Count total number of recordspagination.reverse
(optional): Reverse the order of resultsaddress
: User addresspair_id
: Token pair identifiertoken_in
: Input token denominationtick_index
: Tick indextranche_key
: Tranche identifierpair_id
: Token pair identifiertoken_in
: Input token denominationaddress
: User addresspair_id
: Token pair identifiertoken_in
: Input token denominationmsg
: MsgDeposit message in JSON formatmsg
: MsgWithdrawal message in JSON formatmsg
: MsgPlaceLimitOrder message in JSON formatmsg
: MsgWithdrawFilledLimitOrder message in JSON formatmessage
dex
DepositLP
Attributes:
Creator
: Address of the user who initiated the depositReceiver
: Address that received the liquidity positionTokenZero
: The denomination of token0 in the poolTokenOne
: The denomination of token1 in the poolTickIndex
: The tick index where liquidity was addedFee
: The fee tier (in basis points) of the poolReservesZeroDeposited
: Amount of token0 deposited into reservesReservesOneDeposited
: Amount of token1 deposited into reservesSharesMinted
: Amount of share tokens issuedAmountInTokenZero
: Total amount of token0 provided by userAmountInTokenOne
: Total amount of token1 provided by usermessage
dex
WithdrawLP
Attributes:
Creator
: Address of the user who initiated the withdrawalReceiver
: Address that received the withdrawn tokensTokenZero
: The denomination of token0 in the poolTokenOne
: The denomination of token1 in the poolTickIndex
: The tick index where liquidity was removedFee
: The fee tier (in basis points) of the poolReservesZeroWithdrawn
: Amount of token0 withdrawn from reservesReservesOneWithdrawn
: Amount of token1 withdrawn from reservesSharesRemoved
: Amount of share tokens removedmessage
dex
PlaceLimitOrder
Attributes:
Creator
: Address placing the limit orderReceiver
: Address that will receive the output tokensTokenIn
: Input token denominationTokenOut
: Output token denominationAmountIn
: Amount of input tokensLimitTick
: Tick index representing the limit priceOrderType
: Type of limit order (GTC, FOK, IOC, JIT, GTT)Shares
: Number of shares in the limit order trancheTrancheKey
: Unique identifier for the limit order trancheExpirationTime
: Expiration time for time-limited ordersmessage
dex
WithdrawLimitOrder
Attributes:
Creator
: Address withdrawing the filled orderTrancheKey
: Key of the limit order trancheTokenOut
: Output token denominationAmountOut
: Amount of tokens withdrawnmessage
dex
CancelLimitOrder
Attributes:
Creator
: Address cancelling the limit orderTrancheKey
: Key of the cancelled limit order trancheTokenIn
: Input token that was returnedTokenOut
: Output token denominationAmountIn
: Amount of input tokens returnedAmountOut
: Amount of output tokens received (for partially filled orders)message
dex
MultihopSwap
Attributes:
Creator
: Address initiating the swapReceiver
: Address receiving the output tokensMakerDenom
: Input token denominationTokenOut
: Final output token denominationAmountIn
: Amount of input tokensAmountOut
: Amount of final output tokensRoute
: Route taken through the pools (comma-separated hops)Dust
: Any dust amounts from intermediate swapsTickLiquidity/value/
: TickLiquidity storageLimitOrderTrancheUser/value
: LimitOrderTrancheUser storageInactiveLimitOrderTranche/value/
: InactiveLimitOrderTranche storageLimitOrderExpiration/value/
: LimitOrderExpiration storagePool/id/
: Pool storage (by ID or by pair+tick+fee)PoolMetadata/value/
: PoolMetadata storagePool/count/
: Pool count storageParams/value/
: Module parameters storageJITsInBlock/count/
: JIT limit orders per block countfee_tiers
: [0, 1, 2, 3, 4, 5, 10, 20, 50, 100, 150, 200]paused
: falsemax_jits_per_block
: 25good_til_purge_allowance
: 540000whitelisted_lps
: [] (empty array)