Skip to main content

Exact numbers

Prices, quantities, strikes and amounts are sent as exact fixed-point objects, never as floats:
value = units × 10^-decimals, so the example above is 105000.123456. units is a decimal integer string and may be negative (for example, a short position).
Do not parse units with JavaScript Number or parseFloat. Values can be larger than Number.MAX_SAFE_INTEGER (2^53 − 1), and floats lose precision. Use BigInt, or a decimal library in other languages.
Values that are compared with each other do not always share a decimals, so rescale before you compare. Balances and premiums are always in USDC atoms (decimals: 6).

Pagination

/markets, /positions, /orders and /fills use cursors:
  • Pass nextCursor back as cursor, unchanged, with the same filters. nextCursor: null means you have the last page.
  • Cursors are opaque. A cursor used with different filters, on another route, or after a cursor format change returns 400 INVALID_CURSOR. When that happens, drop the cursor and start again from the first page.
/executions does not use cursors. It uses a sequence checkpoint instead (see Executions).

List markets

GET /mm/v1/markets
integer
default:"50"
1–100.
string
nextCursor from the previous page.
string
Optional filter: ACTIVE, TRADING_CLOSED, EXPIRING or SETTLED.
Returns { markets, nextCursor, limit, serverTimeMs }.
  • With no status filter, results are sorted by instrumentId. Use this for a complete catalog sync.
  • With a status filter, results are sorted by expiry, then instrumentId. A market that changes status while you are paging can be missed, so use the unfiltered listing when you need every market.

Market fields

Status and pauses

tradingPaused is separate from status. A market can be ACTIVE but paused. Treat a paused market as not tradable until tradingPaused goes back to false. D1 does not publish the reason for a pause.

Get one market

GET /mm/v1/markets/{instrumentId}
market has the same fields as in the list (shortened above). settlement summarizes the accepted settlement: An unknown instrumentId returns 404 NOT_FOUND. A malformed one returns 400 MALFORMED_REQUEST.

Order book

GET /mm/v1/markets/{instrumentId}/orderbook
integer
default:"20"
Price levels per side, 1–50.
  • bids and asks are aggregated price levels, best first: highest bid first, lowest ask first.
  • quantity is the total resting quantity at the level. ownQuantity is the part of it that belongs to you, or 0 if none.
  • The book does not show individual orders or who placed them.

Partial and truncated books

D1 reads a bounded number of resting orders per side. When a book is very deep:
  • partial: true marks the one level where that bound was reached. Its quantity and ownQuantity are lower bounds: there may be more at that price.
  • truncated: true means more book exists than is shown, either beyond depth or beyond the read bound.
The levels before a partial level are complete. Do not treat the last level of a truncated book as the full liquidity at that price.