CLI Reference

Transaction

CreateMarket

Create a market for trading assets.

Usage

create-market [base-denom] [quote-denom]

Argument

Description

base-denom

denom of the base coin for the market

quote-denom

denom of the quote coin for the market

Example

# Create a pool
crescentd tx exchange create-market uatom uusd \
--chain-id localnet \
--from alice

#
# Tips
#
# You can query markets using the following command
crescentd q exchange markets -o json | jq

PlaceLimitOrder

Place a limit order to markets. This order will be placed in sequential matching stage.

For buy orders, it allows orders up to 10% above the current price, and for sell orders, it allows orders up to 10% below the current price. This is to prevent users from incurring large financial losses due to simple mistakes.

Usage

Argument

Description

market-id

market id

is-buy

if this is true, the order is placed to buy base coin

price

order price; the exchange ratio is the amount of quote coin over the amount of base coin

quantity

amount of base coin that the orderer is willing to buy or sell

lifespan

duration that the order lives until it is expired

Example

PlaceBatchLimitOrder

Place a batch limit order. Batch orders are matched prior to normal orders in a batch matching stage.

For buy orders, it allows orders up to 10% above the current price, and for sell orders, it allows orders up to 10% below the current price. This is to prevent users from incurring large financial losses due to simple mistakes.

Usage

Argument

Description

market-id

market id

is-buy

if this is true, the order is placed to buy base coin

price

order price; the exchange ratio is the amount of quote coin over the amount of base coin

quantity

amount of base coin that the orderer is willing to buy or sell

lifespan

duration that the order lives until it is expired

Example

PlaceMMLimitOrder

Place a market maker limit order.

For buy orders, it allows orders up to 10% above the current price, and for sell orders, it allows orders up to 10% below the current price. This is to prevent users from incurring large financial losses due to simple mistakes.

Usage

Argument

Description

market-id

market id

is-buy

if this is true, the order is placed to buy base coin

price

order price; the exchange ratio is the amount of quote coin over the amount of base coin

quantity

amount of base coin that the orderer is willing to buy or sell

lifespan

duration that the order lives until it is expired

Example

PlaceMMBatchLimitOrder

Place a market maker batch limit order. Batch orders are matched prior to normal orders in a batch matching stage.

For buy orders, it allows orders up to 10% above the current price, and for sell orders, it allows orders up to 10% below the current price. This is to prevent users from incurring large financial losses due to simple mistakes.

Usage

Argument

Description

market-id

market id

is-buy

if this is true, the order is placed to buy base coin

price

order price; the exchange ratio is the amount of quote coin over the amount of base coin

quantity

amount of base coin that the orderer is willing to buy or sell

lifespan

duration that the order lives until it is expired

Example

PlaceMarketOrder

Place a market order.

Usage

Argument

Description

market-id

market id

is-buy

if this is true, the order is placed to buy base coin

quantity

amount of base coin that the orderer is willing to buy or sell

Example

CancelOrder

Cancel an existing order.

Usage

Argument

Description

order-id

order id

Example

CancelAllOrders

Cancel all orders in a market placed by the sender

Usage

Argument

Description

market-id

market id

Example

SwapExactAmountIn

Swap with exact input amount.

User need to specify swap routes from input to output. If the result of the swap falls short of user's desired output, the request will be reverted.

Usage

Argument

Description

routes

sequential swap routes

input

input token denom and amount

min-output

The denom and minimum amount of the user's desired output token

Example

Query

Params

Query the current exchange parameters information

Usage

Example

AllMarkets

Query for all markets

Usage

Example

Market

Query details for the particular market

Usage

Example

AllOrders

Query for all orders

Usage

Example

Order

Query details for the particular order

Usage

Example

BestSwapExactAmountInRoutes

Query for the route that can be swapped at the best price given the input token denom and volume, and the denom of the output token.

Usage

Example

Orderbook

Query orderbook of particular market from exisiting orders

Usage

Example

Last updated