Skip to main content
Package: monaco.api.trades Source: protos/api/trades.proto Use TradesService for a pair’s trade history, the trade feed across every market, and single-trade lookup. For the authenticated user’s trade history, use AccountsService.GetUserTrades.

Notes

  • GetTrades, GetTradesRPC, ListTrades and GetTradeById do not require authentication.
  • GetTrades is cursor-paginated, newest first: send an empty page_token to start, then each response’s next_page_token until it comes back empty; an empty token is definitive. page_size defaults to 25 and must be 1–1000. The walk seeks on (executed_at, id), so a page never repeats or skips a trade when new fills land mid-walk. The token is pinned to its trading_pair_id, so a token reused for another pair, or one minted by ListUserTrades, is rejected. There is no page field: code that still sets it fails to compile against a regenerated stub, and a stub generated from an older proto has the unknown field discarded and reads the first page on every call. The walk covers the pair’s whole history, recent and archived trades alike, so the empty token is the end of the pair’s history.
  • ListTrades is the trade feed: every market’s trades, newest first, recent and archived alike. Set taker_application_id to list only the trades whose taker order that application (frontend) placed; an unknown application, or one the explorer does not display as a builder, returns an empty page (the unfiltered feed carries every trade). page_size defaults to 25 and must be 1–1000; walk next_page_token until it comes back empty, which means the walk is finished. The token is pinned to taker_application_id, so it is rejected if the filter changes. Each client IP has a public read budget: over it the call fails with RESOURCE_EXHAUSTED. An invalid filter, page size or page token is INVALID_ARGUMENT.
  • TradeData on GetTrades, GetTradesRPC, GetTradeById and ListTrades carries maker_address, taker_address, taker_fee_raw (the Monaco taker fee in raw quote-asset units, excluding the builder fee), quote_volume_raw (executed notional in raw quote-asset units), taker_application_id and builder_fee_raw (the taker’s builder fee, the add-on its frontend charged, in raw quote-asset units; "0" when none), each omitted when unset. The maker order’s application is not public.
  • ListUserTrades is deprecated and will be removed. Use AccountsService.GetUserTrades (GET /api/v1/accounts/trades), which takes the same margin_account_id and order_id filters and returns the full trade row with normalized and raw amounts. Until removal, ListUserTrades is authenticated, gRPC-only, returns ListedUserTrade rows with fee, monaco_fee and builder_fee as raw quote-unit integer strings, and never sets realized_pnl.