Market Data Endpoints

With the introduction of AMM V2, we now provide aggregated endpoints that combine both spot engine and AMM liquidity. These V2 endpoints are recommended for new integrations as they provide more comprehensive market data.

V1 vs V2 Interface Differences

Feature
V1 Interface
V2 Interface

Data Source

Spot engine only

Spot engine + AMM aggregated

Liquidity

Order book only

Order book + AMM liquidity

Trades

Spot engine trades only

All trades (spot + AMM)

Klines

Spot engine volume only

Combined volume from all sources

Depth

Order book depth only

Merged depth with AMM liquidity

Performance

Standard

Optimized with AMM integration

Recommendation

Legacy support

Use V2 for new integrations

Key Advantages of V2 Interfaces:

  • Enhanced Liquidity: Includes AMM pool liquidity mapped to order book

  • Complete Market View: Shows all trading activity (spot + AMM)

  • Better Price Discovery: AMM provides additional price levels

  • Unified Data: Single endpoint for comprehensive market data

  • Future-Proof: Designed for the new AMM V2 architecture

Migration Guide:

  • Replace /klines with /klines/v2

  • Replace /depth with /depth/v2

  • Replace /latest-trades with /latest-trades/v2

  • Response format remains the same, but data includes AMM sources

Get depth

get
/api/v1/depth

Get order book by pool id

Query parameters
pool_idstringRequired

pool_id

precisionstringOptional

0.00000001 ~ 10000

limitintegerOptional

limit

Responses
200

order depth

application/json
get
/api/v1/depth
GET /api/v1/depth?pool_id=text HTTP/1.1
Host: api-v1.1dex.com
Accept: */*
200

order depth

{
  "data": {
    "asks": [
      [
        "text"
      ]
    ],
    "bids": [
      [
        "text"
      ]
    ],
    "pool_id": 1,
    "precision": "text",
    "timestamp": 1
  }
}

Get kline data

get
/api/v1/klines

Get kline data by pool id and interval

Query parameters
pool_idstringRequired

pool id

intervalstring · enumRequired

interval

Possible values:
startintegerOptional

start timestamp

endintegerOptional

end timestamp

Responses
200

kline data

application/json
get
/api/v1/klines
GET /api/v1/klines?pool_id=text&interval=1m HTTP/1.1
Host: api-v1.1dex.com
Accept: */*
200

kline data

{
  "data": [
    {
      "close": 1,
      "count": 1,
      "high": 1,
      "interval": "text",
      "low": 1,
      "open": 1,
      "pool_id": 1,
      "timestamp": "text",
      "turnover": 1,
      "volume": 1
    }
  ]
}

Get latest trades

get
/api/v1/latest-trades

Get latest trades

Query parameters
pool_idstringOptional

pool_id

limitintegerOptional

limit count

Responses
200

trade list

application/json
get
/api/v1/latest-trades
GET /api/v1/latest-trades HTTP/1.1
Host: api-v1.1dex.com
Accept: */*
200

trade list

{
  "data": [
    {
      "buyer": "text",
      "pool_id": 1,
      "price": "text",
      "quantity": "text",
      "seller": "text",
      "side": "buy",
      "traded_at": "text"
    }
  ]
}

Last updated