Crescent Docs
  • Introduction
    • What is Crescent?
    • Crescent DEX
      • Market
      • Pool (Liquidity Pool)
      • Position
      • Order-book and Tick system
      • Hybrid DEX
      • Batch Matching
      • Sequential Matching
      • Multi-hop Swap(SlipLess Swap)
      • Ranged Liquidity
        • Comparison with Basic position
        • Liquidity Amplification Factor
        • Possibility of Change to a Single-Coin position
        • Multiple Positions in the Pool
      • Fee
      • Farming
        • Current Farming vs Legacy Farming
      • Market Maker Incentives
        • MarketMaker Apply / Incentive Claim
        • MarketMaker Scoring
    • Liquid Staking
      • Staking vs. Liquid Staking
      • Overview of Staking Rewards
      • Calculations for Staking Rewards
      • Liquid Staking Validator
    • Snowball (Liquid AMM)
      • Mint & Burn sb-Token
      • Reward Auction
        • How to Participate
    • Gas and Fees
    • Liquid Governance
    • Partnership
    • Crescent Derivatives
    • Crescent DEX (legacy)
      • Coin Pair
      • Liquidity Pool
      • Legacy Farming Rewards (LP Incentives)
      • New Farming Rewards (LP Incentives)
      • Orderbook and Tick System
      • Hybrid DEX
      • Batch Execution
      • Ranged Pools
      • Market Maker Incentives
        • MarketMaker Apply / Incentive Claim
        • MarketMaker Scoring
      • Synergy with Crescent Boost
  • Developer Guide
    • CLI and API
      • AMM module
        • CLI Reference
        • API Reference
      • Exchange module
        • CLI Reference
        • API Reference
      • LiquidStaking module
        • CLI Reference
        • API Reference
      • LiquidAmm module
        • CLI Reference
        • API Reference
  • Technical Guide
    • Market Maker
    • Farming Planner
  • Other Information
    • Network Configurations
    • Crescent Design Assets
Powered by GitBook
On this page
  • Params
  • AllMarkets
  • Market
  • AllOrders
  • Order
  • BestSwapExactAmountInRoutes
  • Orderbook
  1. Developer Guide
  2. CLI and API
  3. Exchange module

API Reference

Params

Example Request

http://localhost:1317/crescent/exchange/v1beta1/params

Example Response

{
  "params": {
    "market_creation_fee": [
      {
        "denom": "stake",
        "amount": "1000000"
      }
    ],
    "fees": {
      "default_maker_fee_rate": "0.001500000000000000",
      "default_taker_fee_rate": "0.003000000000000000",
      "default_order_source_fee_ratio": "0.500000000000000000"
    },
    "max_order_lifespan": "86400s",
    "max_order_price_ratio": "0.100000000000000000",
    "max_swap_routes_len": 3,
    "max_num_mm_orders": 15
  }
}

AllMarkets

Example Request

http://localhost:1317/crescent/exchange/v1beta1/markets

Example Response

{
  "markets": [
    {
      "id": "1",
      "base_denom": "uatom",
      "quote_denom": "uusd",
      "escrow_address": "cre1whhqyaxuv9vrmr00slaqa6zg9cf30nk4k6ltpqvp6ecn6vks5mfsttzq30",
      "maker_fee_rate": "0.001500000000000000",
      "taker_fee_rate": "0.003000000000000000",
      "order_source_fee_ratio": "0.500000000000000000",
      "last_price": "15.000000000000000000",
      "last_matching_height": "6948"
    }
  ],
  "pagination": {
    "next_key": null,
    "total": "1"
  }
}

Market

Example Request

http://localhost:1317/crescent/exchange/v1beta1/markets/1

Example Response

{
  "market": {
    "id": "1",
    "base_denom": "uatom",
    "quote_denom": "uusd",
    "escrow_address": "cre1whhqyaxuv9vrmr00slaqa6zg9cf30nk4k6ltpqvp6ecn6vks5mfsttzq30",
    "maker_fee_rate": "0.001500000000000000",
    "taker_fee_rate": "0.003000000000000000",
    "order_source_fee_ratio": "0.500000000000000000",
    "last_price": "15.000000000000000000",
    "last_matching_height": "6948"
  }
}

AllOrders

Example Request

http://localhost:1317/crescent/exchange/v1beta1/orders

Example Response

{
  "orders": [
    {
      "id": "6",
      "type": "ORDER_TYPE_MM",
      "orderer": "cre1zaavvzxez0elundtn32qnk9lkm8kmcszxclz6p",
      "market_id": "1",
      "is_buy": true,
      "price": "15.000000000000000000",
      "quantity": "100000.000000000000000000",
      "msg_height": "7213",
      "open_quantity": "100000.000000000000000000",
      "remaining_deposit": "1500000.000000000000000000",
      "deadline": "2023-08-30T05:30:50.090404Z"
    }
  ],
  "pagination": {
    "next_key": null,
    "total": "1"
  }
}

Order

Example Request

http://localhost:1317/crescent/exchange/v1beta1/orders/1

Example Response

{
  "order": {
    "id": "1",
    "type": "ORDER_TYPE_LIMIT",
    "orderer": "cre1zaavvzxez0elundtn32qnk9lkm8kmcszxclz6p",
    "market_id": "1",
    "is_buy": true,
    "price": "9.000000000000000000",
    "quantity": "100000",
    "msg_height": "6549",
    "open_quantity": "100000",
    "remaining_deposit": "900000",
    "deadline": "2023-06-29T07:28:37.840415Z"
  }
}

BestSwapExactAmountInRoutes

Example Request

http://localhost:1317/crescent/exchange/v1beta1/best_swap_exact_amount_in_routes?input=100uatom&output_denom=uusd

Example Response

{
  "routes": [
    "1"
  ],
  "output": {
    "denom": "uusd",
    "amount": "1016"
  },
  "results": [
    {
      "market_id": "1",
      "input": {
        "denom": "uatom",
        "amount": "100"
      },
      "output": {
        "denom": "uusd",
        "amount": "1016"
      },
      "fee": {
        "denom": "uusd",
        "amount": "4"
      }
    }
  ]
}

Orderbook

Example Request

http://localhost:1317/crescent/exchange/v1beta1/markets/1/order_book

Example Response

{
  "order_books": [
    {
      "price_interval": "0.001000000000000000",
      "sells": [
      ],
      "buys": [
        {
          "p": "15.000000000000000000",
          "q": "100000.000000000000000000"
        }
      ]
    },
    {
      "price_interval": "0.010000000000000000",
      "sells": [
      ],
      "buys": [
        {
          "p": "15.000000000000000000",
          "q": "100000.000000000000000000"
        }
      ]
    },
    {
      "price_interval": "0.100000000000000000",
      "sells": [
      ],
      "buys": [
        {
          "p": "15.000000000000000000",
          "q": "100000.000000000000000000"
        }
      ]
    }
  ]
}
PreviousCLI ReferenceNextLiquidStaking module

Last updated 1 year ago