Trading Pairs
An operator-managed market is public only while its launch’s durable runtime projection readslive — 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?: numberpageSize?: numbercategory?:"crypto" | "equities" | "commodities" | "fx"— filter by asset class
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
(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 optionalpage?: number - Page number (min 1, default 1)pageSize?: number - Items per page (min 1, max 100, default 50)marketType?:"SPOT" | "MARGIN"- Filter by market typeisActive?: boolean - Filter by active status; defaults totrueso 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, soisActive: falsestill excludes itcategory?:"crypto" | "equities" | "commodities" | "fx"- Filter by asset class
GetScreenerResponse:items:ScreenerItem[]page: numberpageSize: numbertotal: numbertotalPages: number
ScreenerItem:tradingPairId: string - Trading pair UUIDsymbol: string - Trading pair symbol (e.g. “BTC/USDC”)category: string - Asset class:"crypto","equities","commodities", or"fx"baseIconUrl: string - Base token icon URLquoteIconUrl: string - Quote token icon URLlastPrice: 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, readpriceChange24hfromgetMarketMetadata/getPerpMarketSummary, or estimate it fromlastPriceandpriceChangePercent24h(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 isstring | nulland 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 (0if 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,orderBookTradeCountandrfqTradeCount. The base volume fields are not set on screener rows; read them fromgetMarketMetadata()quoteVolume24hBySource?:{ orderBookQuoteVolume, rfqQuoteVolume }| null -quoteVolume24hsplit into its order-book and RFQ parts; absent while any candle in the window has no recorded split, or whenquoteVolume24his nulllatestFundingRate: string | null - Latest capped settled funding rate (decimal fraction per window);nullfor spot pairs and perps with no settled window yetlastFundingTime: string | null - Close time of the latest settled funding window (ms since epoch, as string);nullfor spot pairs and perps with no settled window yetestimatedNextFundingRate: string | null - Estimated rate for the in-progress funding window (decimal fraction per window), the same value asgetFundingState().estimatedNextFundingRate;nullfor spot pairs and perps whose current window has no samples yet. It can differ from the rate that settles: see the note undergetFundingStateopenInterestBase: string | null - One-sided LONG base-asset open interest (each contract counted once) from the latest completed-minute sample;nullfor spot pairs or when no sample was recorded in the last five minutes,"0"for a margin pair with no open positionsopenInterestNotional: 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 usegetPerpMarketSummaryorgetOpenInterest);nullfor spot pairs,"0"for a margin pair with no open positionsopenInterestNotionalAvg1h,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 priceopenInterestNotionaluses; a minute without a trade price is unvalued rather than zero.nullfor spot or below that coverage; known zero is"0". No historical backfill; windows warm after deployment.
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
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 pricelow24h: string | null - 24h low pricevolume24h: string | null - 24h trading volume in base-asset unitsquoteVolume24h?: string | null - 24h trading volume in quote-token (USDC) unitspriceChange24h: string | null - Absolute price changepriceChangePercent24h: string | null - Percentage changemarketInitializationTimestamp: number | null - Market start timetotalBaseVolumeLtd: 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 (0if 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 themvolume24hBySource?:Volume24hBySource| null - The rolling 24h volumes split into their order-book and RFQ parts:orderBookBaseVolume,rfqBaseVolume, andorderBookQuoteVolumeandrfqQuoteVolume(null when the 24h quote volume is unavailable); absent while any candle in the window has no recorded split
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 unitstotalTradeCountLtd: number - Cumulative trade count across all trading pairstotalVolumeLtdBySource?: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
"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 (usegetTradingPairBySymbolto get this)interval:"1m" | "5m" | "15m" | "1h" | "4h" | "1d"params?: Optional query parametersstartTime?: 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 is0."mark"on a spot pair returns a400;"reference"is full OHLC of the mark price over each bucket with volume0, for charting markets with little trading; like"mark"it is margin-only (a spot pair returns a400), and a margin pair with no reference history returns no candles
startTimeandendTime(Unix ms, UTC) are independent: pass either, both or neither. With both,startTimemust be less thanendTime.startTimealone reads forward from it;endTimealone returns up tolimitbars ending at it.- Both bounds are inclusive and absolute: no bar outside the window is returned, and a window holding fewer bars than
limitcomes back short rather than padded with earlier history. limitis a hard cap. When the window holds more bars, the firstlimitbars 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.
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: stringminLeverage,maxLeverage: string (decimal)initialMarginRatio,maintenanceMarginRatio: stringfundingIntervalSeconds: numberliquidationFeeBps?: stringriskTiers:RiskTier[], ascending bylowerBoundNotional— each{ tierLevel, lowerBoundNotional, maxLeverage?, initialMarginRatio, maintenanceMarginRatio, initialMarginDeduction, maintenanceMarginDeduction, maxPositionNotional? }.maxPositionNotionalis the most USD notional a position may hold at that tier’smaxLeverage: the next tier’slowerBoundNotional, 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.maxPositionSizeis deprecated and no longer set.initialMarginDeduction/maintenanceMarginDeductionkeep the ladder floor and maintenance margin continuous at a tier bound:IM_floor(N) = N x initialMarginRatio - initialMarginDeduction,MM(N) = N x maintenanceMarginRatio - maintenanceMarginDeductionfor a position of notionalNin that tier. Actual position initial margin is the greater ofIM_floor(N)and the selected-leverage initial margin scaled to the current mark. A position’s tier is the last one whoselowerBoundNotionalis at or below its notional. See Margin ladders.updatedAt: stringfundingImpactNotional: string (decimal, quote units). The per-market quote notional 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.
(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: stringlastPrice,markPrice,indexPrice: stringhigh24h?,low24h?,priceChange24h?,priceChangePercent24h?: stringvolume24h?: string — 24h volume in base-asset unitsquoteVolume24h?: string — 24h volume in quote-token (USDC) unitsopenInterest: string — one-sided LONG open interest (each contract counted once) in base-asset units (alias ofopenInterestBase)openInterestBase?: string — one-sided LONG open interest (each contract counted once) in base-asset unitsopenInterestNotional?: string — one-sided LONG open-interest notional in quote (USDC) units, equal toopenInterestBase× mark price (falling back to the latest trade/close price when no mark is available)currentFundingRate?,estimatedNextFundingRate?: stringnextFundingTime?: string — ISO 8601marketStatus,marketRegime: stringupdatedAt: 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 stringpageSize?: number — items per page, 1 to 1000 (default 50)pageToken?: string — pagination cursor: omitted or""starts a walk from the newest settlement (the oldest underorderBy: "ASC"); a previousnextPageTokenresumes it. There is nopage: the SDK rejects one with aValidationErrorbefore sending, and a raw REST request carrying it gets400. The walk seeks on(settledAt, id), so a page boundary inside one settlement instant no longer repeats or drops a row. The filters andorderBymust match the request that minted the tokenorderBy?:"ASC" | "DESC"— sort direction forsettledAt, defaultDESC
{ 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 optionalstartTime?,endTime?: string — ms-epoch strings, inclusive bounds onsettledAtpageSize?: number — items per page, 1 to 1000 (default 50)pageToken?: string — pagination cursor: omitted or""starts a walk from the newest settlement (the oldest underorderBy: "ASC"); a previousnextPageTokenresumes it. There is nopage: the SDK rejects one with aValidationErrorbefore sending, and a raw REST request carrying it gets400. The walk seeks on(settledAt, id), so a page boundary inside one settlement instant no longer repeats or drops a row. The filters andorderBymust match the request that minted the tokenorderBy?:"ASC" | "DESC"— sort direction forsettledAt, defaultDESC
{ 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 UUIDoptions?: Optional settingsdepth?: number - Number of price levels per side (default: 10, max: 1000). Above 100 the snapshot is read from the market-data service, carriesbookSeq, and counts toward the deep orderbook read budgettradingMode?: “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
symbol: string - Trading pair symboltradingMode: “SPOT” | “MARGIN” - Trading modebids: 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 decimalsquoteDecimals: number - Quote token decimalstimestamp: string - Snapshot timestamp (UTC)sequence: number - Legacy sequence number; do not compare it across snapshotsbookSeq?: 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 applyingdepthframes; for a live book usesdk.ws.depth
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 UUIDoptions?: Optional settingspageSize?: number - Max records to return (default: 25, max: 1000)pageToken?: string - Cursor from a previous response’snextPageToken; omit to start at the most recent tradeexecutionSource?:"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, taggedexecutionSource: "RFQ". A page token is tied to the filter it was minted under
{ 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 UUIDtradingMode: “SPOT” | “MARGIN”data:tradeId: string - Unique trade IDprice: string - Execution pricequantity: string - Executed quantitymakerSide: “BUY” | “SELL” - Side of the maker orderexecutedAt: string - ISO 8601 date-time timestamp (UTC), empty string if the trade has no recorded execution timeexecutionSource?: “CLOB” | “RFQ” - How the trade executed: on the order book, or as an RFQ block fill. REST trade reads onlymakerAddress?/takerAddress?: string - The two walletstakerFeeRaw?: string - Monaco’s taker fee in raw quote-asset units (smallest unit), excluding the frontend’s builder feebuilderFeeRaw?: string - The taker’s builder fee (the add-on its frontend charged) in raw quote-asset units, on top oftakerFeeRaw;"0"when it charged none. REST trade reads onlyquoteVolumeRaw?: 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
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 UUIDoptions?:sinceExecutionId?: string - The newestexecutionIdyou already have; omit to read only the newest pagepageSize?: number - Rows per page (default: 100, max: 1000)maxPages?: number - Most pages to read (default: 10)
{ 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 UUIDpageSize?: number - Max records to return (default: 25, max: 1000)pageToken?: string - Cursor from a previous response’snextPageToken; omit to start at the most recent trade
{ 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
TradeEvent (same shape as the entries returned by getTrades). data.executedAt is an empty string if the trade has no recorded execution time.Example:
