Skip to main content
Returns the current state of the order book, including all bids and asks with their respective price levels and quantities.

Endpoint

GET /api/v1/depth

Query parameters

symbol
string
required
Trading pair symbol (e.g., SOL_USDC, BTC_USDT)

Response

bids
array
Array of bid orders in the order book. Each bid is represented as a tuple of [price, quantity].
asks
array
Array of ask orders in the order book. Each ask is represented as a tuple of [price, quantity].

Example request

curl -X GET "http://localhost:3000/api/v1/depth?symbol=SOL_USDC"

Example response

{
  "bids": [
    ["150.50", "10.5"],
    ["150.45", "25.3"],
    ["150.40", "15.7"]
  ],
  "asks": [
    ["150.55", "8.2"],
    ["150.60", "12.4"],
    ["150.65", "20.1"]
  ]
}

Error responses

500
error
Internal server error - Failed to retrieve depth from the matching engine

Notes

  • Bids are sorted in descending order by price (highest bid first)
  • Asks are sorted in ascending order by price (lowest ask first)
  • Quantities at each price level represent the sum of all orders at that price
  • The depth data is retrieved in real-time from the matching engine via Redis pub/sub

Build docs developers (and LLMs) love