Skip to main content

Trading Pairs

An operator-managed market is public only while its launch’s durable runtime projection reads live — the coordinator’s own launch phase is not what publishes it, so a launch whose phase is already live stays hidden whenever its runtime projection is anything else, halted included. Until then it is excluded from pair discovery, pair detail, the screener and the public price reads, and asking for inactive markets does not surface it either. A pair with no managed launch is an ordinary instrument and keeps its existing visibility, so this changes nothing about the markets that trade today. The maker side of such a launch is driven through sdk.managedMarkets.
(params?) => Promise<GetTradingPairsResponse>
Fetch paginated list of trading pairs.Parameters: all optional
  • page?: number
  • pageSize?: number
  • category?: "crypto" | "equities" | "commodities" | "fx" — filter by asset class
Each TradingPair includes a category field indicating its asset class, and baseAssetName / quoteAssetName — the human-readable asset display names from the asset registry (e.g. "Robinhood Markets" for HOOD, "USDC" for USDC). Use them for name-based market search (a query like “Robinhood” can match the HOOD market) and to render display names next to tickers. Also present on getTradingPair and getTradingPairBySymbol.isolatedOnly (boolean) marks an isolated-only market: cross margin may only reduce a position there. A CROSS order that is not reduce-only is rejected with the error code CROSS_MARGIN_NOT_ALLOWED; open the position with marginMode: "ISOLATED". Also present on getTradingPair and getTradingPairBySymbol.
(tradingPairId: string) => Promise<TradingPair>
Fetch a single trading pair by its UUID. Returns the unwrapped TradingPair. Rejects with an APIError (404) when no pair with that UUID exists — it never resolves undefined.Parameters:
  • tradingPairId: string - Trading pair UUID
Example:
(symbol: string, marketType?: TradingMode) => Promise<TradingPair | undefined>
Get a specific trading pair by symbol. Resolves undefined on a miss — it never throws for an unknown symbol, so guard the result before dereferencing. Note the failure modes are opposite: getTradingPair rejects, getTradingPairBySymbol resolves undefined. The lookup scans only the first 100 pairs (optionally filtered by marketType); use getPaginatedTradingPairs directly if the listing ever exceeds that.Parameters:
  • symbol: string - Trading pair symbol (e.g. "BTC/USDC")
  • marketType?: TradingMode - Restrict the lookup to "SPOT" or "MARGIN" pairs

Market Screener

(params?: GetScreenerParams) => Promise<GetScreenerResponse>
Fetch the paginated market screener. Each row carries 1h/24h/7d quote-volume and price-change windows plus a 7-day daily snapshot. Results are sorted by 24h quote volume descending, with nulls last.Parameters: params? - all optional
  • page?: number - Page number (min 1, default 1)
  • pageSize?: number - Items per page (min 1, max 100, default 50)
  • marketType?: "SPOT" | "MARGIN" - Filter by market type
  • isActive?: boolean - Filter by active status; defaults to true so delisted pairs are hidden. The managed-market fence is an additional gate rather than an override of this filter: a managed launch is hidden until its runtime projection is live, and once live its pair is active, so isActive: false still excludes it
  • category?: "crypto" | "equities" | "commodities" | "fx" - Filter by asset class
Returns: GetScreenerResponse:
  • items: ScreenerItem[]
  • page: number
  • pageSize: number
  • total: number
  • totalPages: number
Each ScreenerItem:
  • tradingPairId: string - Trading pair UUID
  • symbol: string - Trading pair symbol (e.g. “BTC/USDC”)
  • category: string - Asset class: "crypto", "equities", "commodities", or "fx"
  • baseIconUrl: string - Base token icon URL
  • quoteIconUrl: string - Quote token icon URL
  • lastPrice: string | null - Most recent close price (null if no trades yet)
  • lastPriceTimestamp: string | null - Timestamp of the last candle (ms since epoch, as string; null if no trades yet)
  • quoteVolume1h: string | null - Quote-token volume over the last 1 hour (null if insufficient history)
  • quoteVolume24h: string | null - Quote-token volume over the last 24 hours (null if insufficient history)
  • quoteVolume7d: string | null - Quote-token volume over the last 7 days (null if insufficient history)
  • priceChangePercent1h: string | null - Percent price change over the last 1 hour (null if insufficient history)
  • priceChangePercent24h: string | null - Percent price change over the last 24 hours (null if insufficient history)
  • priceChangePercent7d: string | null - Percent price change over the last 7 days (null if insufficient history). Screener rows carry percent changes only — for an absolute 24h change, read priceChange24h from getMarketMetadata / getPerpMarketSummary, or estimate it from lastPrice and priceChangePercent24h (approximate, since the percentage is rounded)
  • snapshot7d: ScreenerSnapshotPoint[] - Up to 7 UTC-day buckets (oldest first); empty when less than 1 day of history. Each point is { bucketStart, quoteVolume, priceChangePercent, openInterestNotionalAvg }. The daily average is string | null and needs at least 95% of the completed UTC day’s 1440 minutes (1368) to be valued.
  • totalQuoteVolumeLtd: string - Cumulative quote-token volume since inception (decimal string; "0" if no trades)
  • totalTradeCountLtd: number - Cumulative trade count since inception (0 if no trades)
  • totalVolumeLtdBySource?: LtdVolumeBySource - The life-to-date totals split into their order-book and RFQ parts, which add up exactly to the totals beside them: orderBookQuoteVolume, rfqQuoteVolume, orderBookTradeCount and rfqTradeCount. The base volume fields are not set on screener rows; read them from getMarketMetadata()
  • quoteVolume24hBySource?: { orderBookQuoteVolume, rfqQuoteVolume } | null - quoteVolume24h split into its order-book and RFQ parts; absent while any candle in the window has no recorded split, or when quoteVolume24h is null
  • latestFundingRate: string | null - Latest capped settled funding rate (decimal fraction per window); null for spot pairs and perps with no settled window yet
  • lastFundingTime: string | null - Close time of the latest settled funding window (ms since epoch, as string); null for spot pairs and perps with no settled window yet
  • estimatedNextFundingRate: string | null - Estimated rate for the in-progress funding window (decimal fraction per window), the same value as getFundingState().estimatedNextFundingRate; null for spot pairs and perps whose current window has no samples yet. It can differ from the rate that settles: see the note under getFundingState
  • openInterestBase: string | null - One-sided LONG base-asset open interest (each contract counted once) from the latest completed-minute sample; null for spot pairs or when no sample was recorded in the last five minutes, "0" for a margin pair with no open positions
  • openInterestNotional: string | null - One-sided LONG open-interest notional in quote units, valued at the pair’s latest trade price (a snapshot — for a mark-accurate notional use getPerpMarketSummary or getOpenInterest); null for spot pairs, "0" for a margin pair with no open positions
  • openInterestNotionalAvg1h, openInterestNotionalAvg24h, openInterestNotionalAvg7d: string | null - Arithmetic averages of the valued completed UTC minute observations in the last 60, 1440, or 10080 minutes ending at the current minute boundary, published once at least 95% of those minutes (57, 1368, or 9576) are valued. Each observation is the LONG open position size multiplied by latest trade price in quote units, the same price openInterestNotional uses; a minute without a trade price is unvalued rather than zero. null for spot or below that coverage; known zero is "0". No historical backfill; windows warm after deployment.
Example: Install decimal.js (npm install decimal.js) to compute surge directly from decimal strings.

Market Metadata

(tradingPairId: string) => Promise<MarketMetadata>
Get comprehensive market metadata including current price and 24-hour statisticsParameters:
  • tradingPairId: string - Trading pair UUID
Returns: MarketMetadata:
  • symbol: string - Trading pair symbol (e.g., “BTC/USDC”)
  • lastPrice: string - Current price (8 decimal precision)
  • lastPriceTimestamp: number - Unix timestamp (ms)
  • high24h: string | null - 24h high price
  • low24h: string | null - 24h low price
  • volume24h: string | null - 24h trading volume in base-asset units
  • quoteVolume24h?: string | null - 24h trading volume in quote-token (USDC) units
  • priceChange24h: string | null - Absolute price change
  • priceChangePercent24h: string | null - Percentage change
  • marketInitializationTimestamp: number | null - Market start time
  • totalBaseVolumeLtd: string - Cumulative base-token volume since inception (decimal string; "0" if no trades)
  • totalQuoteVolumeLtd: string - Cumulative quote-token volume since inception (decimal string; "0" if no trades)
  • totalTradeCountLtd: number - Cumulative trade count since inception (0 if no trades)
  • totalVolumeLtdBySource?: LtdVolumeBySource - The life-to-date totals split into their order-book and RFQ parts (base volume, quote volume and trade count), which add up exactly to the totals beside them
  • volume24hBySource?: Volume24hBySource | null - The rolling 24h volumes split into their order-book and RFQ parts: orderBookBaseVolume, rfqBaseVolume, and orderBookQuoteVolume and rfqQuoteVolume (null when the 24h quote volume is unavailable); absent while any candle in the window has no recorded split
Example:

Exchange Statistics

() => Promise<MarketStats>
Fetch exchange-wide life-to-date cumulative statistics. No authentication required.Returns: MarketStats:
  • totalQuoteVolumeLtd: string - Cumulative quote-token (notional) volume across all trading pairs, as a decimal string in display units
  • totalTradeCountLtd: number - Cumulative trade count across all trading pairs
  • totalVolumeLtdBySource?: LtdVolumeBySource - The totals split into their order-book and RFQ parts (quote volume and trade count; the base volume fields are not set), which add up exactly to the totals beside them
Volume is summed across all pairs; base volume is intentionally omitted because base quantities are not comparable across different base assets. Pairs with no trades contribute "0" / 0.Example:

Candlestick Data

(tradingPairId: string, interval: Interval, params?: GetCandlesticksParams) => Promise<Candlestick[]>
Fetch OHLCV candlestick data for a trading pair.Parameters:
  • tradingPairId: string - Trading pair UUID (use getTradingPairBySymbol to get this)
  • interval: "1m" | "5m" | "15m" | "1h" | "4h" | "1d"
  • params?: Optional query parameters
    • startTime?: number - Unix timestamp in ms (for forward pagination)
    • endTime?: number - Unix timestamp in ms (for backward pagination)
    • limit?: number - Max candlesticks to return (default: 350, max: 500)
    • priceType?: "trade" | "mark" | "reference" - price series to chart. "trade" (default) is the trade-derived OHLCV series; "mark" is the close-only mark-price series for margin pairs, where each candle’s open/high/low/close are the minute’s closing mark and volume is 0. "mark" on a spot pair returns a 400; "reference" is full OHLC of the mark price over each bucket with volume 0, for charting markets with little trading; like "mark" it is margin-only (a spot pair returns a 400), and a margin pair with no reference history returns no candles
Query behaviour:
  • startTime and endTime (Unix ms, UTC) are independent: pass either, both or neither. With both, startTime must be less than endTime. startTime alone reads forward from it; endTime alone returns up to limit bars ending at it.
  • Both bounds are inclusive and absolute: no bar outside the window is returned, and a window holding fewer bars than limit comes back short rather than padded with earlier history.
  • limit is a hard cap. When the window holds more bars, the first limit bars of the window are returned.
  • Buckets with no trades come back as flat bars carrying the previous close, so a response has no holes. These bars count toward limit.
  • Bars are in ascending order, oldest first.
Returns: Candlestick[] — T and t are the period start and end (Unix ms, UTC); o, h, l, c and v are decimal strings; n is the trade count.Each returned Candlestick may also include openInterestBase (one-sided LONG quantity in base-asset units) and openInterestNotional (quote-asset notional valued with the price paired to that same OI sample). Both are aligned to the candle end; the notional is not rebuilt from the candle close. They are null when the observation or paired price is unavailable.Example:

Perp Market Data

Perp-specific market endpoints. For margin concepts, see Margin.
(tradingPairId: string) => Promise<PerpMarketConfig>
Static configuration for a perp pair: leverage bounds, base margin ratios, funding interval, risk tiers, liquidation fee.Returns — PerpMarketConfig:
  • tradingPairId, symbol: string
  • minLeverage, maxLeverage: string (decimal)
  • initialMarginRatio, maintenanceMarginRatio: string
  • fundingIntervalSeconds: number
  • liquidationFeeBps?: string
  • riskTiers: RiskTier[], ascending by lowerBoundNotional — each { tierLevel, lowerBoundNotional, maxLeverage?, initialMarginRatio, maintenanceMarginRatio, initialMarginDeduction, maintenanceMarginDeduction, maxPositionNotional? }. maxPositionNotional is the most USD notional a position may hold at that tier’s maxLeverage: the next tier’s lowerBoundNotional, or the market’s position cap on the top tier, and absent there when the market is uncapped. Below the top tier the cap is exclusive, since a notional at the next bound already sits in the next tier. maxPositionSize is deprecated and no longer set. initialMarginDeduction/maintenanceMarginDeduction keep the ladder floor and maintenance margin continuous at a tier bound: IM_floor(N) = N x initialMarginRatio - initialMarginDeduction, MM(N) = N x maintenanceMarginRatio - maintenanceMarginDeduction for a position of notional N in that tier. Actual position initial margin is the greater of IM_floor(N) and the selected-leverage initial margin scaled to the current mark. A position’s tier is the last one whose lowerBoundNotional is at or below its notional. See Margin ladders.
  • updatedAt: string
  • fundingImpactNotional: string (decimal, quote units). The per-market quote notional QmQ_m each funding premium sample walks through each side of the book to read the impact bid and ask. Markets start at "2000". See Impact Prices.
Example — two-tier ladder:
(tradingPairId: string) => Promise<PerpMarketSummary>
Aggregate snapshot of a perp market: mark, index, 24h stats, one-sided LONG open interest, current and estimated next funding rate.Returns — PerpMarketSummary:
  • tradingPairId, symbol: string
  • lastPrice, markPrice, indexPrice: string
  • high24h?, low24h?, priceChange24h?, priceChangePercent24h?: string
  • volume24h?: string — 24h volume in base-asset units
  • quoteVolume24h?: string — 24h volume in quote-token (USDC) units
  • openInterest: string — one-sided LONG open interest (each contract counted once) in base-asset units (alias of openInterestBase)
  • openInterestBase?: string — one-sided LONG open interest (each contract counted once) in base-asset units
  • openInterestNotional?: string — one-sided LONG open-interest notional in quote (USDC) units, equal to openInterestBase × mark price (falling back to the latest trade/close price when no mark is available)
  • currentFundingRate?, estimatedNextFundingRate?: string
  • nextFundingTime?: string — ISO 8601
  • marketStatus, marketRegime: string
  • updatedAt: string
(tradingPairId: string) => Promise<MarkPrice>
Live mark price (oracle reference used for PnL and liquidation).Returns: { tradingPairId, markPrice, oracleProvider, oracleEpoch?, regime, updatedAt }
(tradingPairId: string) => Promise<IndexPrice>
Live index price (aggregated external fair-value reference used for funding).Returns: { tradingPairId, indexPrice, components: IndexComponent[], updatedAt }. Each IndexComponent is { provider, price, weight?, updatedAt? }.
(tradingPairId: string) => Promise<FundingState>
Current and estimated-next funding rate, plus next settlement time.Returns: { tradingPairId, currentFundingRate, estimatedNextFundingRate?, nextFundingTime, fundingIntervalSeconds, lastFundingTime?, updatedAt }nextFundingTime reflects the market’s actual settlement cadence and is always in the future (once a boundary passes, it is the following one), and estimatedNextFundingRate refreshes as new samples arrive.estimatedNextFundingRate is an estimate, not a promise. A window that ends with too few accepted samples settles at zero instead (the next window with enough samples settles normally), so the rate that settles can differ from the last estimate. The screener (ScreenerItem.estimatedNextFundingRate) and the all-markets WebSocket market_stats row (fundingRate) carry the same estimate.
(tradingPairId: string, params?: ListFundingHistoryParams) => Promise<ListFundingHistoryResponse>
Historical settled funding for a single pair.Parameters: all optional
  • startTime?, endTime?: string — ISO 8601 or ms-epoch string
  • pageSize?: number — items per page, 1 to 1000 (default 50)
  • pageToken?: string — pagination cursor: omitted or "" starts a walk from the newest settlement (the oldest under orderBy: "ASC"); a previous nextPageToken resumes it. There is no page: the SDK rejects one with a ValidationError before sending, and a raw REST request carrying it gets 400. The walk seeks on (settledAt, id), so a page boundary inside one settlement instant no longer repeats or drops a row. The filters and orderBy must match the request that minted the token
  • orderBy?: "ASC" | "DESC" — sort direction for settledAt, default DESC
Returns: { records: FundingRecord[], total, pageSize, nextPageToken, totalCapped }. nextPageToken is "" once the walk is exhausted — each page over-fetches one row, so an empty token is definitive; follow a non-empty one and do not drive the loop off total, which is bounded by the server count ceiling (totalCapped is true when more matched, making total a lower bound). The ergonomic FundingRecord surfaces { tradingPairId, fundingRate, cumulativeFundingPerUnit?, carried? } — carried is true when the window held too few accepted samples and settled at zero under the sparse-sample rule; a record from before that rule keeps the last settled rate it carried. The ergonomic type also carries the per-window fields — epoch, fundingDeltaPerUnit, referencePrice (the settlement mark price), sampleCount, windowStartedAt, windowClosedAt, and settledAt (the sort key for listAllFundingHistory). fundingDeltaPerUnit is normally fundingRate × referencePrice; in the one defensive case where that product cannot be represented (the engine bounds the rate below 100 % per window, so this needs a mark near the numeric ceiling), the record keeps the fundingRate that would have applied, settles fundingDeltaPerUnit as 0, leaves cumulativeFundingPerUnit unchanged and still advances epoch — a window in which nothing was paid, not a missing window.
(params?: ListAllFundingHistoryParams) => Promise<ListAllFundingHistoryResponse>
Settled funding history across every perp market in one call, so you no longer fan out one listFundingHistory request per pair. No authentication required.Parameters: all optional
  • startTime?, endTime?: string — ms-epoch strings, inclusive bounds on settledAt
  • pageSize?: number — items per page, 1 to 1000 (default 50)
  • pageToken?: string — pagination cursor: omitted or "" starts a walk from the newest settlement (the oldest under orderBy: "ASC"); a previous nextPageToken resumes it. There is no page: the SDK rejects one with a ValidationError before sending, and a raw REST request carrying it gets 400. The walk seeks on (settledAt, id), so a page boundary inside one settlement instant no longer repeats or drops a row. The filters and orderBy must match the request that minted the token
  • orderBy?: "ASC" | "DESC" — sort direction for settledAt, default DESC
Returns: { records: FundingRecord[], total, pageSize, nextPageToken, totalCapped }. nextPageToken is "" once the walk is exhausted — each page over-fetches one row, so an empty token is definitive; follow a non-empty one and do not drive the loop off total, which is bounded by the server count ceiling (totalCapped is true when more matched, making total a lower bound). Rows are sorted by the wire settledAt field. Each FundingRecord carries its own tradingPairId, so you can group rows by market client-side (see listFundingHistory for the full record shape).Example:
(tradingPairId: string) => Promise<OpenInterest>
Current one-sided LONG open interest (each contract counted once) in base-asset units and notional.Returns: { tradingPairId, openInterestBase, openInterestNotional, updatedAt }
(tradingPairId: string) => Promise<TraderMetrics>
Current public long/short account counts, account shares and ratio, and active-trader aggregates for a margin pair. Accounts are classified by net position across OPEN risk buckets; no account IDs are exposed. Position fields are null when either side has fewer than five margin accounts; within each active-trader window, all three counts are null if any cohort is below five users, or while the server’s active-trader history does not yet reach back to the window’s start (briefly, after that history is first built). Activity counts include system user IDs on liquidation and ADL fills. Responses may be reused for up to 30 seconds per pair. Ratios and shares are rounded to six decimal places.Returns: long/short account counts, account shares and ratio, plus distinct active traders and taker buyers/sellers for 1h, 24h, and 7d windows.
(tradingPairId: string, params: GetTradeFlowParams) => Promise<TradeFlow>
Taker buy/sell quote notional, net flow, and cumulative volume delta for a bounded range. Pass interval ("1m", "5m", or "1h"), inclusive startTime, and exclusive endTime, all times in Unix milliseconds. The range can span at most seven days and 2,048 UTC-aligned buckets. All executed trades, including liquidation and ADL fills, are included. Buckets without executed trades are omitted; cumulative volume delta begins at the selected range start. Notional remains in quote-asset units with no USD conversion, and ratios are rounded to six decimal places.
(tradingPairId: string, params?: ListLiquidationEventsParams) => Promise<ListLiquidationEventsResponse>
Fetch public per-fill liquidation rows for one margin pair, newest first. The first page defaults to 50 rows; pageSize is capped at 1,000 and pageToken is an opaque cursor. Optional startTime is inclusive and endTime is exclusive, in Unix milliseconds. Each row contains eventId, timestamp, tradingPairId, wallet, the liquidated position’s side, absolute base positionSize, the captured markPrice, markNotional, and quoteAssetSymbol. markNotional is that row’s positionSize × markPrice, in quote units. It is not repriced from a candle close or converted to USD. Each row also carries liquidationPrice, the position’s trigger price captured with the event, and liquidationFee, the penalty charged in quote-asset units (null when none was charged).
(params?: ListAllLiquidationEventsParams) => Promise<ListAllLiquidationEventsResponse>
The same rows as listLiquidationEvents, across every market, newest first: each carries its tradingPairId. Takes the same optional startTime, endTime, pageSize (default 50, max 1,000) and pageToken. Public; each client IP has a read budget, and a request over it fails with HTTP 429 and Retry-After. Follow nextPageToken until it comes back empty.
() => Promise<ListInsuranceFundsResponse>
Every insurance fund’s current balance, one per asset: assetId, availableBalanceRaw (raw asset units, the asset’s smallest unit; scale it with the asset’s decimals from the trading pairs listing) and updatedAt. Public; each client IP has a read budget.
(tradingPairId: string, params: GetLiquidationMetricsParams) => Promise<LiquidationMetrics>
Fetch long/short totals in UTC-aligned 1m, 5m, or 1h buckets for a half-open range, up to seven days and 2,048 buckets. eventCount counts persisted event rows; positionSize sums base units; markNotional sums each row’s size multiplied by its event-time mark in quote units. Return only populated buckets; for a populated bucket, the empty side has zero-valued measures. History and summaries are separate endpoints, and neither exposes internal user/account/position IDs.

Orderbook Snapshot

Get a point-in-time orderbook snapshot via REST API. For real-time updates, use WebSocket subscriptions.
(tradingPairId: string, options?) => Promise<OrderbookEvent>
Fetch current orderbook state for a trading pairParameters:
  • tradingPairId: string - Trading pair UUID
  • options?: Optional settings
    • depth?: number - Number of price levels per side (default: 10, max: 1000). Above 100 the snapshot is read from the market-data service, carries bookSeq, and counts toward the deep orderbook read budget
    • tradingMode?: “SPOT” | “MARGIN” - Trading mode (default: “SPOT”)
    • magnitude?: number - Price grouping (0.000001, 0.00001, 0.0001, 0.001, 0.01, 0.1, 1, 10, 100, 1000, 10000)
    • denomination?: “BASE” | “QUOTE” - Quantity denomination
Returns:
  • symbol: string - Trading pair symbol
  • tradingMode: “SPOT” | “MARGIN” - Trading mode
  • bids: Array of { price, quantity, orderCount }
  • asks: Array of { price, quantity, orderCount }
  • bestBid?: string - Best bid price (optional)
  • bestAsk?: string - Best ask price (optional)
  • bidVolume?: string - Total bid volume (optional)
  • askVolume?: string - Total ask volume (optional)
  • priceChange?: object - Price change info (optional)
  • baseDecimals: number - Base token decimals
  • quoteDecimals: number - Quote token decimals
  • timestamp: string - Snapshot timestamp (UTC)
  • sequence: number - Legacy sequence number; do not compare it across snapshots
  • bookSeq?: string - Above 100 levels only: the sequence the snapshot is exact as of, a u64 as a decimal string. A point-in-time read and staleness check, not a base for applying depth frames; for a live book use sdk.ws.depth
A request for more than 100 levels fails with SERVICE_UNAVAILABLE (503) while the market-data service is unavailable; retry, or ask for 100 levels or fewer.Example:

Historical Trades

Fetch recent trade history for a trading pair. For real-time trade updates, use WebSocket subscriptions.
(tradingPairId: string, options?) => Promise<{ trades: TradeEvent[]; nextPageToken: string }>
Fetch one page of historical trades for a trading pair (newest first)Cursor paged. The page number was removed: trades is appended to continuously, so an offset silently re-served the newest trades as fills landed mid-walk. Omit pageToken to start, then follow nextPageToken until it comes back empty. Sending page is rejected before the request leaves the SDK, and the REST API answers 400 if it reaches the wire.A walk covers the pair’s whole history: recent and archived trades are read together, so the empty nextPageToken is the end of the pair’s history.Parameters:
  • tradingPairId: string - Trading pair UUID
  • options?: Optional settings
    • pageSize?: number - Max records to return (default: 25, max: 1000)
    • pageToken?: string - Cursor from a previous response’s nextPageToken; omit to start at the most recent trade
    • executionSource?: "RFQ" | "CLOB" - The execution source to keep: "RFQ" for RFQ block fills, "CLOB" for order-book fills. Omit for every fill. "RFQ" covers recent fills; older RFQ fills stay on the unfiltered pages, tagged executionSource: "RFQ". A page token is tied to the filter it was minted under
Returns: { trades, nextPageToken }, where nextPageToken is empty exactly when the walk is finished (the server over-fetches one row to prove it, so no confirming extra request is needed), and trades is an array of TradeEvent:
  • eventType: “trade”
  • tradingPairId: string - Trading pair UUID
  • tradingMode: “SPOT” | “MARGIN”
  • data:
    • tradeId: string - Unique trade ID
    • price: string - Execution price
    • quantity: string - Executed quantity
    • makerSide: “BUY” | “SELL” - Side of the maker order
    • executedAt: string - ISO 8601 date-time timestamp (UTC), empty string if the trade has no recorded execution time
    • executionSource?: “CLOB” | “RFQ” - How the trade executed: on the order book, or as an RFQ block fill. REST trade reads only
    • makerAddress? / takerAddress?: string - The two wallets
    • takerFeeRaw?: string - Monaco’s taker fee in raw quote-asset units (smallest unit), excluding the frontend’s builder fee
    • builderFeeRaw?: string - The taker’s builder fee (the add-on its frontend charged) in raw quote-asset units, on top of takerFeeRaw; "0" when it charged none. REST trade reads only
    • quoteVolumeRaw?: string - Executed notional in raw quote-asset units (smallest unit)
    • takerApplicationId?: string - The application (frontend) that placed the taker order; the trade’s volume and fees are attributed to it
Errors: 400 for an invalid trading pair ID (or a page), 404 when the trading pair does not exist.Timestamp format: executedAt is an ISO-8601 / RFC 3339 date-time string with an explicit +00:00 UTC offset (e.g. 2025-01-15T10:30:00+00:00). Any standard parser, including new Date(...), handles it.Example:
(tradingPairId: string, options?: RecoverRfqTradesOptions) => Promise<RecoveredRfqTrades>
Recover the RFQ block prints a sdk.ws.rfqTrades subscriber missed. It pages the pair’s RFQ history (getTrades with executionSource: "RFQ"), newest first, until it reaches sinceExecutionId, and returns what is newer, oldest first. It also returns the other fills sharing that print’s execution time, since an RFQ’s fills need not arrive in id order, so deduplicate replayed fills by executionId (a recovered trade’s tradeId).Parameters:
  • tradingPairId: string - Trading pair UUID
  • options?:
    • sinceExecutionId?: string - The newest executionId you already have; omit to read only the newest page
    • pageSize?: number - Rows per page (default: 100, max: 1000)
    • maxPages?: number - Most pages to read (default: 10)
Returns: { trades, complete }: trades is a TradeEvent[], oldest first; complete is false when the walk stopped at maxPages, so older prints may still be missing.
(options?) => Promise<{ trades: TradeEvent[]; nextPageToken: string }>
Fetch one page of the trade feed: every market, newest first, recent and archived trades alike. Set takerApplicationId to list only the trades one application (frontend) took. Rows have the same TradeEvent shape as getTrades, wallets, raw taker fee, raw quote volume and taker application included; an unknown application, or one the explorer does not display as a builder, reads as an empty page. The unfiltered feed carries every trade.Public; each client IP has a read budget, and a request over it fails with HTTP 429 and Retry-After.Parameters:
  • options?:
    • takerApplicationId?: string - Application UUID
    • pageSize?: number - Max records to return (default: 25, max: 1000)
    • pageToken?: string - Cursor from a previous response’s nextPageToken; omit to start at the most recent trade
Returns: { trades, nextPageToken }; nextPageToken is empty exactly when the walk is finished.
(tradeId: string) => Promise<TradeEvent>
Fetch a single trade by its UUID. Throws APIError if the trade is not found.Parameters:
  • tradeId: string - Trade UUID
Returns: A single TradeEvent (same shape as the entries returned by getTrades). data.executedAt is an empty string if the trade has no recorded execution time.Example: