Class: CBAdvancedTradeGlobalClient
REST client for Coinbase's Global Derivatives Advanced Trade API: https://docs.cdp.coinbase.com/coinbase-app/advanced-trade-apis/guides/derivatives/overview
Deribit-powered gateway running on the Starbase platform. JSON-RPC 2.0 at https://drb.coinbase.com/api/v2
Parameters and responses are not the Advanced Trade REST shapes. Prices and sizes are JSON numbers. instrument_name replaces the old product id (BTC-PERP-INTX becomes BTC_USDC-PERPETUAL). label replaces client_order_id and is not unique. Order type, time in force, and status are lowercase. BaseRestClient handles JSON-RPC formatting, result extraction, errors and authentication.
Block/RFQ methods typed with any describe the SDK’s request routes, not a verified current API contract. Confirm their availability and parameters against current Coinbase documentation before use.
Extends
BaseRestClient
Constructors
Constructor
new CBAdvancedTradeGlobalClient(restClientOptions?: RestClientOptions, networkOptions?: AxiosRequestConfig): CBAdvancedTradeGlobalClient;Create an instance of the REST client. Pass API credentials in the object in the first parameter.
Parameters
| Parameter | Type | Description |
|---|---|---|
restClientOptions? | RestClientOptions | options to configure REST API connectivity |
networkOptions? | AxiosRequestConfig | HTTP networking options for axios |
Returns
CBAdvancedTradeGlobalClient
Inherited from
BaseRestClient.constructor
Methods
acceptBlockRfq()
acceptBlockRfq(params?: any): Promise<any>;JSON-RPC wrapper for private/accept_block_rfq, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
addBlockRfqQuote()
addBlockRfqQuote(params?: any): Promise<any>;JSON-RPC wrapper for private/add_block_rfq_quote, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>. When parameters are supplied, the SDK applies its label validation before sending.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
approveBlockTrade()
approveBlockTrade(params?: any): Promise<any>;JSON-RPC wrapper for private/approve_block_trade, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
auth()
auth(params?: AdvTradeGlobalAuthRequest): Promise<AdvTradeGlobalAuthResult>;Auth
Authenticate using a Coinbase-issued credential. Only POST is supported. Send the JSON-RPC request in the request body; query-string credentials are not accepted.
JSON-RPC: public/auth
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalAuthRequest |
Returns
Promise<AdvTradeGlobalAuthResult>
cancelAll()
cancelAll(params?: AdvTradeGlobalCancelAllRequest): Promise<number>;Cancel All
Cancels all open orders and trigger orders for the authenticated account across all currencies and instrument kinds. This is a bulk cancellation operation useful for quickly clearing all active orders. Use the detailed parameter to receive a list of all cancelled orders. Set freeze_quotes to reject incoming quotes for one second after cancellation. Note: This operation cannot be undone. All open orders will be permanently cancelled.
Replaces POST /orders/batch_cancel
JSON-RPC: private/cancel_all
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalCancelAllRequest |
Returns
Promise<number>
cancelAllBlockRfqQuotes()
cancelAllBlockRfqQuotes(params?: any): Promise<any>;JSON-RPC wrapper for private/cancel_all_block_rfq_quotes, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
cancelAllByCurrency()
cancelAllByCurrency(params: AdvTradeGlobalCancelAllByCurrencyRequest): Promise<number>;Cancel All By Currency
Cancels all open orders for a specific currency. This is useful for quickly clearing all orders across multiple instruments in a currency. Orders can be optionally filtered by instrument kind (future, option, etc.) and/or order type (limit, market, stop, etc.). Use the detailed parameter to receive a list of all cancelled orders.
Replaces POST /orders/batch_cancel
JSON-RPC: private/cancel_all_by_currency
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalCancelAllByCurrencyRequest |
Returns
Promise<number>
cancelAllByCurrencyPair()
cancelAllByCurrencyPair(params: AdvTradeGlobalCancelAllByCurrencyPairRequest): Promise<number>;Cancel All By Currency Pair
Cancels all open orders for a specific currency pair. This is useful for quickly clearing all orders across instruments in a currency pair. Orders can be optionally filtered by instrument kind (future, option, etc.) and/or order type (limit, market, stop, etc.). Use the detailed parameter to receive a list of all cancelled orders.
Replaces POST /orders/batch_cancel
JSON-RPC: private/cancel_all_by_currency_pair
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalCancelAllByCurrencyPairRequest |
Returns
Promise<number>
cancelAllByInstrument()
cancelAllByInstrument(params: AdvTradeGlobalCancelAllByInstrumentRequest): Promise<number>;Cancel All By Instrument
Cancels all open orders for a specific instrument. This is useful for quickly clearing all orders for a single instrument. Orders can be optionally filtered by order type (limit, market, stop, etc.). Use the detailed parameter to receive a list of all cancelled orders. The include_combos parameter can be used to include combo orders in the cancellation.
Replaces POST /orders/batch_cancel
JSON-RPC: private/cancel_all_by_instrument
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalCancelAllByInstrumentRequest |
Returns
Promise<number>
cancelAllByKindOrType()
cancelAllByKindOrType(params: AdvTradeGlobalCancelAllByKindOrTypeRequest): Promise<number>;Cancel All By Kind Or Type
Cancels all open orders in one or more currencies, optionally filtered by instrument kind and/or order type. This provides flexible bulk cancellation across multiple currencies. Specify one or more currencies, and optionally filter by instrument kind (future, option, etc.) and/or order type (limit, market, stop, etc.). Use the detailed parameter to receive a list of all cancelled orders.
Replaces POST /orders/batch_cancel
JSON-RPC: private/cancel_all_by_kind_or_type
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalCancelAllByKindOrTypeRequest |
Returns
Promise<number>
cancelBlockRfq()
cancelBlockRfq(params?: any): Promise<any>;JSON-RPC wrapper for private/cancel_block_rfq, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
cancelBlockRfqQuote()
cancelBlockRfqQuote(params?: any): Promise<any>;JSON-RPC wrapper for private/cancel_block_rfq_quote, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
cancelBlockRfqTrigger()
cancelBlockRfqTrigger(params?: any): Promise<any>;JSON-RPC wrapper for private/cancel_block_rfq_trigger, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
cancelByLabel()
cancelByLabel(params: AdvTradeGlobalCancelByLabelRequest): Promise<number>;Cancel By Label
Cancels all orders (including trigger orders) that have a specific label. This is useful for managing groups of related orders that share the same label. Orders can be cancelled across all currencies or filtered to a specific currency. When cancelling by currency, the currency queue is used for processing. Rate Limits: When called without the currency parameter, this method is subject to cancel_all rate limits. Different rate limit values may apply for per-currency cancels versus calls without providing the currency parameter.
Replaces POST /orders/batch_cancel
JSON-RPC: private/cancel_by_label
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalCancelByLabelRequest |
Returns
Promise<number>
cancelOrder()
cancelOrder(params: AdvTradeGlobalCancelRequest): Promise<AdvTradeGlobalOrder>;Cancel
Cancels a specific order identified by its order ID. The order must be open (not yet filled or cancelled) to be cancelled successfully. Once cancelled, the order is removed from the order book and cannot be restored. Any unfilled portion of the order will be cancelled.
Replaces POST /orders/batch_cancel
JSON-RPC: private/cancel
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalCancelRequest |
Returns
Promise<AdvTradeGlobalOrder>
changeMarginModel()
changeMarginModel(params: AdvTradeGlobalChangeMarginModelRequest): Promise<AdvTradeGlobalChangeMarginModelItem[]>;Change Margin Model
Changes the margin model for the authenticated account or a specified subaccount. Margin models determine how margin requirements are calculated (e.g., Standard Margin vs. Portfolio Margin). Changing the margin model may affect margin requirements, available funds, and trading capabilities. Use the dry_run parameter to preview the impact of the change before applying it.
Replaces POST /intx/multi_asset_collateral
JSON-RPC: private/change_margin_model
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalChangeMarginModelRequest |
Returns
Promise<AdvTradeGlobalChangeMarginModelItem[]>
closePosition()
closePosition(params: AdvTradeGlobalClosePositionRequest): Promise<AdvTradeGlobalClosePositionResult>;Close Position
Places a reduce-only order to close an existing position. Reduce-only orders can only reduce or close a position; they cannot open a new position or increase an existing one. You can specify whether to use a market or limit order. If using a limit order, provide the price. The order will automatically be set to reduce-only to ensure it only closes the position.
Replaces POST /orders/close_position
JSON-RPC: private/close_position
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalClosePositionRequest |
Returns
Promise<AdvTradeGlobalClosePositionResult>
createBlockRfq()
createBlockRfq(params?: any): Promise<any>;JSON-RPC wrapper for private/create_block_rfq, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>. When parameters are supplied, the SDK applies its label validation before sending.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
createCombo()
createCombo(params: AdvTradeGlobalCreateComboRequest): Promise<AdvTradeGlobalCombo>;Create Combo
Verifies and creates a combo book or returns an existing combo matching the given trades. Combos allow trading on multiple instruments (futures and options) simultaneously as a single strategy. If a combo matching the provided trades already exists, this method returns the existing combo. Otherwise, it creates a new combo book with the specified leg structure.
JSON-RPC: private/create_combo
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalCreateComboRequest |
Returns
Promise<AdvTradeGlobalCombo>
deletePrivate()
deletePrivate(endpoint: string, params?: ParamsInRequest): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | ParamsInRequest |
Returns
Promise<any>
Inherited from
BaseRestClient.deletePrivate
disableCancelOnDisconnect()
disableCancelOnDisconnect(params?: AdvTradeGlobalDisableCancelOnDisconnectRequest): Promise<"ok">;Disable Cancel On Disconnect
Disable Cancel On Disconnect for the connection. When change is applied for the account, then every newly opened connection will start with inactive Cancel on Disconnect. WebSocket Only: This method is designed exclusively for WebSocket connections. Attempting to use it via REST/HTTP will result in an error response.
JSON-RPC: private/disable_cancel_on_disconnect
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalDisableCancelOnDisconnectRequest |
Returns
Promise<"ok">
editBlockRfqQuote()
editBlockRfqQuote(params?: any): Promise<any>;JSON-RPC wrapper for private/edit_block_rfq_quote, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
enableCancelOnDisconnect()
enableCancelOnDisconnect(params?: AdvTradeGlobalEnableCancelOnDisconnectRequest): Promise<"ok">;Enable Cancel On Disconnect
Enable Cancel On Disconnect for the connection. After enabling, all orders created via this connection will be automatically cancelled when the connection is closed. Cancel is triggered in the following cases: when the TCP connection is properly terminated, when the connection is closed due to 10 minutes of inactivity, or when a heartbeat detects a disconnection. To reduce the inactivity timeout, consider using public/set_heartbeat. Note: If the connection is gracefully closed using private/logout, cancel-on-disconnect will not be triggered. Notice: Cancel-on-Disconnect does not affect orders created by other connections - they will remain active! When change is applied on the account scope, then every newly opened connection will start with active Cancel on Disconnect. WebSocket Only: This method is designed exclusively for WebSocket connections. Attempting to use it via REST/HTTP will result in an error response.
JSON-RPC: private/enable_cancel_on_disconnect
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalEnableCancelOnDisconnectRequest |
Returns
Promise<"ok">
executeBlockTrade()
executeBlockTrade(params?: any): Promise<any>;JSON-RPC wrapper for private/execute_block_trade, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
generateNewOrderId()
generateNewOrderId(): string;Returns
string
Inherited from
BaseRestClient.generateNewOrderId
get()
get(endpoint: string, params?: object): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | object |
Returns
Promise<any>
Inherited from
BaseRestClient.get
getAccessLog()
getAccessLog(params?: AdvTradeGlobalGetAccessLogRequest): Promise<AdvTradeGlobalAccessLog[]>;Get Access Log
Retrieves a log of API access attempts and authentication events for the authenticated account. The log includes information such as IP addresses, timestamps, API methods called, and authentication status. Use this method to monitor account security, review API usage patterns, and identify unauthorized access attempts. Results can be paginated using the offset and count parameters.
JSON-RPC: private/get_access_log
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalGetAccessLogRequest |
Returns
Promise<AdvTradeGlobalAccessLog[]>
getAccountSummaries()
getAccountSummaries(params?: AdvTradeGlobalGetAccountSummariesRequest): Promise<AdvTradeGlobalGetAccountSummariesResult>;Get Account Summaries
Retrieves a per-currency list of account summaries for the authenticated user. Each summary includes balance, equity, available funds, and margin information for each currency. To retrieve summaries for a specific subaccount, use the subaccount_id parameter. When the extended parameter is set to true, additional account details such as account ID, username, email, and account type are included.
JSON-RPC: private/get_account_summaries
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalGetAccountSummariesRequest |
Returns
Promise<AdvTradeGlobalGetAccountSummariesResult>
getAccountSummary()
getAccountSummary(params: AdvTradeGlobalGetAccountSummaryRequest): Promise<AdvTradeGlobalGetAccountSummaryResult>;Get Account Summary
Retrieves the account summary for a specific currency. The summary includes cash balance, equity, margin_balance, available_funds, available_withdrawal_funds, initial/maintenance margin, session and total PnL, options greeks, and related fields. Key relationships (standard margin): equity = balance + futures session PnL
- options_value, margin_balance = equity - options_value, available_funds = max(0, margin_balance - initial_margin). Under portfolio margin, margin_balance equals equity. Session PnL fields reset at daily settlement; total_pl does not. To retrieve the summary for a specific subaccount, use the subaccount_id parameter. When the extended parameter is set to true, additional account details such as account ID, username, email, and account type are included.
Replaces GET /intx/portfolio/
JSON-RPC: private/get_account_summary
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetAccountSummaryRequest |
Returns
Promise<AdvTradeGlobalGetAccountSummaryResult>
getAnnouncements()
getAnnouncements(params?: AdvTradeGlobalGetAnnouncementsRequest): Promise<AdvTradeGlobalGetAnnouncementsItem[]>;Get Announcements
Retrieves platform announcements and important notices. Announcements include system updates, maintenance schedules, new features, policy changes, and other important information. Results are returned in reverse chronological order (newest first). The default start_timestamp is the current time, and the count parameter must be between 1 and 50 (default is 5).
JSON-RPC: public/get_announcements
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalGetAnnouncementsRequest |
Returns
Promise<AdvTradeGlobalGetAnnouncementsItem[]>
getBlockRfqMakers()
getBlockRfqMakers(params?: any): Promise<any>;JSON-RPC wrapper for private/get_block_rfq_makers, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
getBlockRfqQuotes()
getBlockRfqQuotes(params?: any): Promise<any>;JSON-RPC wrapper for private/get_block_rfq_quotes, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
getBlockRfqs()
getBlockRfqs(params?: any): Promise<any>;JSON-RPC wrapper for private/get_block_rfqs, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
getBlockRfqTrades()
getBlockRfqTrades(params?: any): Promise<any>;JSON-RPC wrapper for public/get_block_rfq_trades, sent as POST /api/v2.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
getBlockRfqUserInfo()
getBlockRfqUserInfo(params?: any): Promise<any>;JSON-RPC wrapper for private/get_block_rfq_user_info, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
getBlockTrade()
getBlockTrade(params?: any): Promise<any>;JSON-RPC wrapper for private/get_block_trade, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
getBlockTradeRequests()
getBlockTradeRequests(params?: any): Promise<any>;JSON-RPC wrapper for private/get_block_trade_requests, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
getBlockTrades()
getBlockTrades(params?: any): Promise<any>;JSON-RPC wrapper for private/get_block_trades, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
getBookSummaryByCurrency()
getBookSummaryByCurrency(params: AdvTradeGlobalGetBookSummaryByCurrencyRequest): Promise<AdvTradeGlobalBookSummary[]>;Get Book Summary By Currency
Retrieves summary information such as open interest, 24-hour volume, best bid/ask prices, last trade price, and other market statistics for all instruments in a given currency. Results can be filtered by instrument kind (future, option, etc.). This method provides a quick overview of market activity across all instruments for a currency. Note: For real-time updates, we recommend using the WebSocket subscription to ticker.{instrument_name}.{interval} instead of polling this endpoint.
JSON-RPC: public/get_book_summary_by_currency
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetBookSummaryByCurrencyRequest |
Returns
Promise<AdvTradeGlobalBookSummary[]>
getBookSummaryByInstrument()
getBookSummaryByInstrument(params: AdvTradeGlobalGetBookSummaryByInstrumentRequest): Promise<AdvTradeGlobalBookSummary[]>;Get Book Summary By Instrument
Retrieves summary information such as open interest, 24-hour volume, best bid/ask prices, last trade price, mark price, and other market statistics for a specific instrument. This method provides a quick overview of current market activity and liquidity for a single instrument.
JSON-RPC: public/get_book_summary_by_instrument
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetBookSummaryByInstrumentRequest |
Returns
Promise<AdvTradeGlobalBookSummary[]>
getBrokerTradeRequests()
getBrokerTradeRequests(params?: any): Promise<any>;JSON-RPC wrapper for private/get_broker_trade_requests, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
getBrokerTrades()
getBrokerTrades(params?: any): Promise<any>;JSON-RPC wrapper for private/get_broker_trades, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
getCancelOnDisconnect()
getCancelOnDisconnect(params?: AdvTradeGlobalGetCancelOnDisconnectRequest): Promise<AdvTradeGlobalGetCancelOnDisconnectResult>;Get Cancel On Disconnect
Read current Cancel On Disconnect configuration for the account.
JSON-RPC: private/get_cancel_on_disconnect
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalGetCancelOnDisconnectRequest |
Returns
Promise<AdvTradeGlobalGetCancelOnDisconnectResult>
getClientType()
getClientType(): RestClientType;Defines the client type (affecting how requests & signatures behave)
Returns
RestClientType
Overrides
BaseRestClient.getClientType
getComboDetails()
getComboDetails(params: AdvTradeGlobalGetComboDetailsRequest): Promise<AdvTradeGlobalCombo>;Get Combo Details
Retrieves detailed information about a specific combo, including its leg structure, state, and other properties. Use public/get_combo_ids to get a list of available combo IDs.
JSON-RPC: public/get_combo_details
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetComboDetailsRequest |
Returns
Promise<AdvTradeGlobalCombo>
getComboIds()
getComboIds(params: AdvTradeGlobalGetComboIdsRequest): Promise<string[]>;Get Combo Ids
Retrieves available combo IDs. This method can be used to get the list of all combos, or only the list of combos in the given state. Use public/get_combo_details to retrieve detailed information about a specific combo.
JSON-RPC: public/get_combo_ids
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetComboIdsRequest |
Returns
Promise<string[]>
getCombos()
getCombos(params: AdvTradeGlobalGetCombosRequest): Promise<AdvTradeGlobalCombo[]>;Get Combos
Retrieves information about active combos for the specified currency. Returns detailed information including leg structures and combo properties. For a list of combo IDs only, use public/get_combo_ids. For details about a specific combo, use public/get_combo_details.
JSON-RPC: public/get_combos
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetCombosRequest |
Returns
Promise<AdvTradeGlobalCombo[]>
getContractSize()
getContractSize(params: AdvTradeGlobalGetContractSizeRequest): Promise<AdvTradeGlobalGetContractSizeResult>;Get Contract Size
Retrieves the contract size (also known as contract multiplier) for a given instrument. The contract size is the value of one contract, expressed in the same unit as the order amount: USD for inverse (reversed) futures and perpetuals, and the base currency coin for options, spots, and linear futures and perpetuals. This value is essential for calculating position values, margin requirements, and P&L calculations. Different instruments may have different contract sizes.
JSON-RPC: public/get_contract_size
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetContractSizeRequest |
Returns
Promise<AdvTradeGlobalGetContractSizeResult>
getCurrencies()
getCurrencies(): Promise<AdvTradeGlobalCurrencyWithApr[]>;List currencies supported by the Global API, including their codes and basic information. This method takes no parameters.
JSON-RPC: public/get_currencies.
Returns
Promise<AdvTradeGlobalCurrencyWithApr[]>
getDeliveryPrices()
getDeliveryPrices(params: AdvTradeGlobalGetDeliveryPricesRequest): Promise<AdvTradeGlobalGetDeliveryPricesResult>;Get Delivery Prices
Retrieves historical delivery prices for a given index. Delivery prices are the settlement prices used when futures or options contracts expire and are settled. Results can be paginated using the offset and count parameters. This method is useful for analyzing historical settlement prices and understanding how contracts have been settled over time.
JSON-RPC: public/get_delivery_prices
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetDeliveryPricesRequest |
Returns
Promise<AdvTradeGlobalGetDeliveryPricesResult>
getExpirations()
getExpirations(params: AdvTradeGlobalGetExpirationsRequest): Promise<AdvTradeGlobalExpirations[]>;Get Expirations
Retrieves all available expiration timestamps for instruments. This method can be used to discover which expiration dates are available for trading, which is useful for finding instruments with specific expiration dates. Results can be filtered by settlement currency, instrument kind (future or option), and currency pair. The response includes expiration timestamps in milliseconds since the UNIX epoch.
JSON-RPC: public/get_expirations
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetExpirationsRequest |
Returns
Promise<AdvTradeGlobalExpirations[]>
getFundingChartData()
getFundingChartData(params: AdvTradeGlobalGetFundingChartDataRequest): Promise<AdvTradeGlobalGetFundingChartDataResult>;Get Funding Chart Data
Retrieves funding rate chart data points for a PERPETUAL instrument within a given time period. The data is formatted for use in charting applications and includes funding rate values at regular intervals. Use the length parameter to specify the time period for which to retrieve chart data. This method is useful for visualizing funding rate trends over time.
JSON-RPC: public/get_funding_chart_data
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetFundingChartDataRequest |
Returns
Promise<AdvTradeGlobalGetFundingChartDataResult>
getFundingRateHistory()
getFundingRateHistory(params: AdvTradeGlobalGetFundingRateHistoryRequest): Promise<AdvTradeGlobalGetFundingRateHistoryItem[]>;Get Funding Rate History
Retrieves hourly historical funding rate (interest rate) data for a PERPETUAL instrument over a specified time period. Funding rates are periodic payments exchanged between long and short positions in perpetual contracts. The response includes hourly funding rate values, which can be used to analyze funding rate trends and calculate historical funding costs. This method is applicable only for PERPETUAL instruments.
JSON-RPC: public/get_funding_rate_history
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetFundingRateHistoryRequest |
Returns
Promise<AdvTradeGlobalGetFundingRateHistoryItem[]>
getFundingRateValue()
getFundingRateValue(params: AdvTradeGlobalGetFundingRateValueRequest): Promise<number>;Get Funding Rate Value
Retrieves the funding rate (interest rate) value for a perpetual instrument over a specified time period. Funding rates are periodic payments exchanged between long and short positions in perpetual contracts. This method is applicable only for PERPETUAL instruments. The funding rate is typically expressed as a percentage and is used to keep the perpetual contract price aligned with the underlying index price.
JSON-RPC: public/get_funding_rate_value
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetFundingRateValueRequest |
Returns
Promise<number>
getHistoricalVolatility()
getHistoricalVolatility(params: AdvTradeGlobalGetHistoricalVolatilityRequest): Promise<AdvTradeGlobalGetHistoricalVolatilityItem[]>;Get Historical Volatility
Provides historical volatility data for a given cryptocurrency. Historical volatility measures the degree of price variation over a past period and is useful for risk assessment and option pricing. The response includes volatility statistics calculated from historical price movements. This data can be used for portfolio risk analysis and understanding market conditions.
JSON-RPC: public/get_historical_volatility
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetHistoricalVolatilityRequest |
Returns
Promise<AdvTradeGlobalGetHistoricalVolatilityItem[]>
getIndexChartData()
getIndexChartData(params: AdvTradeGlobalGetIndexChartDataRequest): Promise<number[][]>;Get Index Chart Data
Returns historical price index chart data for the specified index name and time range. The data is formatted for use in charting applications and shows price index values over time. Use the range parameter to specify the time period for which to retrieve chart data. This method is useful for visualizing price index trends and historical movements.
JSON-RPC: public/get_index_chart_data
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetIndexChartDataRequest |
Returns
Promise<number[][]>
getIndexPrice()
getIndexPrice(params: AdvTradeGlobalGetIndexPriceRequest): Promise<AdvTradeGlobalGetIndexPriceResult>;Get Index Price
Retrieves the current index price value for a given index name. Index prices are used as reference prices for mark price calculations and settlement. Use get_index_price_names or get_supported_index_names to retrieve available index names.
JSON-RPC: public/get_index_price
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetIndexPriceRequest |
Returns
Promise<AdvTradeGlobalGetIndexPriceResult>
getIndexPriceNames()
getIndexPriceNames(params?: AdvTradeGlobalGetIndexPriceNamesRequest): Promise<AdvTradeGlobalGetIndexPriceNamesItem[]>;Get Index Price Names
Retrieves the identifiers (names) of all supported price indexes. Price indexes are reference prices used for mark price calculations, settlement, and other market operations. When the extended parameter is set to true, the response includes additional information such as whether future combo creation and option combo creation are enabled for each index.
JSON-RPC: public/get_index_price_names
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalGetIndexPriceNamesRequest |
Returns
Promise<AdvTradeGlobalGetIndexPriceNamesItem[]>
getInstrument()
getInstrument(params: AdvTradeGlobalGetInstrumentRequest): Promise<AdvTradeGlobalInstrument>;Get Instrument
Retrieves detailed information about a specific instrument, including instrument specifications, contract details, tick size, settlement currency, expiration date (for futures and options), strike price (for options), underlying type, and other instrument parameters. This method is useful for obtaining instrument metadata needed for trading operations and calculations.
JSON-RPC: public/get_instrument
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetInstrumentRequest |
Returns
Promise<AdvTradeGlobalInstrument>
getInstruments()
getInstruments(params: AdvTradeGlobalGetInstrumentsRequest): Promise<AdvTradeGlobalInstrument[]>;Get Instruments
Retrieves available trading instruments. This method can be used to see which instruments are available for trading, or which instruments have recently expired. Note - This method has distinct API rate limiting requirements: Sustained rate: 1 request/second. To avoid rate limits, we recommend using either the REST requests for server-cached data or the WebSocket subscription to instrument_state.{kind}.{currency} for real-time updates. For more information, see Rate Limits. Results can be filtered by currency and instrument kind (future, option, etc.). Set the expired parameter to true to retrieve recently expired instruments instead of active ones. Each instrument includes the underlying_type field indicating the underlying asset class (such as crypto, equity, or commodity).
Replaces GET /products
JSON-RPC: public/get_instruments
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetInstrumentsRequest |
Returns
Promise<AdvTradeGlobalInstrument[]>
See
Advanced Trade Global market data
getLastSettlementsByCurrency()
getLastSettlementsByCurrency(params: AdvTradeGlobalGetLastSettlementsByCurrencyRequest): Promise<AdvTradeGlobalGetLastSettlementsByCurrencyResult>;Get Last Settlements By Currency
Retrieves historical settlement, delivery, and bankruptcy events from all instruments within a given currency. Settlement vs. delivery: Settlement is a daily event (at 08:00 UTC) for futures and perpetual positions that converts unrealized profit and loss into realized profit and loss. Option positions do not settle. Delivery is a one-time event that occurs when a futures or options contract expires
- any remaining open position is closed at the delivery price. Delivery does not apply to perpetual or spot instruments. Both events take place at 08:00 UTC, which is why they are sometimes conflated. Results can be filtered by settlement type and timestamp. Use pagination parameters (count and continuation) to retrieve large settlement histories. This data is useful for analyzing historical contract settlements and understanding market events. Note on profit_loss and session_profit_loss: Because this is a public endpoint, these fields are platform-wide aggregates, not per-account values. profit_loss is the sum of realized P&L of all position holders at the settlement price. session_profit_loss is the sum of each holder's total session P&L (realized + unrealized) across all participants.
JSON-RPC: public/get_last_settlements_by_currency
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetLastSettlementsByCurrencyRequest |
Returns
Promise<AdvTradeGlobalGetLastSettlementsByCurrencyResult>
getLastSettlementsByInstrument()
getLastSettlementsByInstrument(params: AdvTradeGlobalGetLastSettlementsByInstrumentRequest): Promise<AdvTradeGlobalGetLastSettlementsByInstrumentResult>;Get Last Settlements By Instrument
Retrieves historical settlement, delivery, and bankruptcy events for a specific instrument. Settlement vs. delivery: Settlement is a daily event (at 08:00 UTC) for futures and perpetual positions that converts unrealized profit and loss into realized profit and loss. Option positions do not settle. Delivery is a one-time event that occurs when a futures or options contract expires - any remaining open position is closed at the delivery price. Delivery does not apply to perpetual or spot instruments. Both events take place at 08:00 UTC, which is why they are sometimes conflated. Results can be filtered by settlement type and timestamp. Use pagination parameters (count and continuation) to retrieve large settlement histories. This method is useful for tracking settlement history for a specific instrument. Note on profit_loss and session_profit_loss: Because this is a public endpoint, these fields are platform-wide aggregates, not per-account values. profit_loss is the sum of realized P&L of all position holders at the settlement price. session_profit_loss is the sum of each holder's total session P&L (realized
- unrealized) across all participants.
JSON-RPC: public/get_last_settlements_by_instrument
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetLastSettlementsByInstrumentRequest |
Returns
Promise<AdvTradeGlobalGetLastSettlementsByInstrumentResult>
getLastTradesByCurrency()
getLastTradesByCurrency(params: AdvTradeGlobalGetLastTradesByCurrencyRequest): Promise<AdvTradeGlobalGetLastTradesByCurrencyResult>;Get Last Trades By Currency
Retrieves the latest trades that have occurred for instruments in a specific currency. Returns trade details including price, amount, direction, timestamp, and trade ID for all instruments in the currency. Results can be filtered by instrument kind and trade ID range or timestamp range. Use the count parameter to limit the number of trades returned, and sorting to control the order (ascending or descending by trade ID). Note: For currencies with spot instruments routed to Coinbase Exchange, this call is not supported when kind is spot or any - and any is the default when kind is omitted. A currency counts as routed when it is the base or the quote of a routed pair. Other kinds are unaffected. Use Get product trades directly for full trade history by instrument.
JSON-RPC: public/get_last_trades_by_currency
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetLastTradesByCurrencyRequest |
Returns
Promise<AdvTradeGlobalGetLastTradesByCurrencyResult>
getLastTradesByCurrencyAndTime()
getLastTradesByCurrencyAndTime(params: AdvTradeGlobalGetLastTradesByCurrencyAndTimeRequest): Promise<AdvTradeGlobalGetLastTradesByCurrencyAndTimeResult>;Get Last Trades By Currency And Time
Retrieves the latest trades that have occurred for instruments in a specific currency within a specified time range. Returns trade details including price, amount, direction, timestamp, and trade ID. Results can be filtered by instrument kind. Use the count parameter to limit the number of trades returned, and sorting to control the order (ascending or descending by trade ID). Note: For currencies with spot instruments routed to Coinbase Exchange, this call is not supported when kind is spot or any - and any is the default when kind is omitted. A currency counts as routed when it is the base or the quote of a routed pair. Other kinds are unaffected. Use Get product trades directly for full trade history by instrument.
JSON-RPC: public/get_last_trades_by_currency_and_time
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetLastTradesByCurrencyAndTimeRequest |
Returns
Promise<AdvTradeGlobalGetLastTradesByCurrencyAndTimeResult>
getLastTradesByInstrument()
getLastTradesByInstrument(params: AdvTradeGlobalGetLastTradesByInstrumentRequest): Promise<AdvTradeGlobalGetLastTradesByInstrumentResult>;Get Last Trades By Instrument
Retrieves the latest trades that have occurred for a specific instrument. Returns trade details including price, amount, direction, timestamp, and trade ID. Results can be filtered by sequence number range or timestamp range. Use the count parameter to limit the number of trades returned, and sorting to control the order (ascending or descending by trade ID). Note: For spot instruments routed to Coinbase Exchange, this call is not supported. Use Get product trades directly for full trade history.
JSON-RPC: public/get_last_trades_by_instrument
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetLastTradesByInstrumentRequest |
Returns
Promise<AdvTradeGlobalGetLastTradesByInstrumentResult>
getLastTradesByInstrumentAndTime()
getLastTradesByInstrumentAndTime(params: AdvTradeGlobalGetLastTradesByInstrumentAndTimeRequest): Promise<AdvTradeGlobalGetLastTradesByInstrumentAndTimeResult>;Get Last Trades By Instrument And Time
Retrieves the latest trades that have occurred for a specific instrument within a specified time range. Returns trade details including price, amount, direction, timestamp, and trade ID. Use the count parameter to limit the number of trades returned, and sorting to control the order (ascending or descending by trade ID). This method is useful for analyzing trading activity over specific time periods. Note: For spot instruments routed to Coinbase Exchange, this call is not supported. Use Get product trades directly for full trade history.
JSON-RPC: public/get_last_trades_by_instrument_and_time
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetLastTradesByInstrumentAndTimeRequest |
Returns
Promise<AdvTradeGlobalGetLastTradesByInstrumentAndTimeResult>
getLegPrices()
getLegPrices(params: AdvTradeGlobalGetLegPricesRequest): Promise<AdvTradeGlobalGetLegPricesResult>;Get Leg Prices
Returns individual leg prices for a given combo structure based on an aggregated price of the strategy and the mark prices of the individual legs. Note: Leg prices change dynamically with mark price fluctuations, and the algorithm is calibrated only for conventional option structures and future spreads. This method supports both inverse strategies and known linear structures within a single currency pair.
JSON-RPC: private/get_leg_prices
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetLegPricesRequest |
Returns
Promise<AdvTradeGlobalGetLegPricesResult>
getMargins()
getMargins(params: AdvTradeGlobalGetMarginsRequest): Promise<AdvTradeGlobalGetMarginsResult>;Get Margins
Calculates margin requirements for a hypothetical order on a given instrument. Returns initial margin and maintenance margin for the specified instrument, quantity, and price. This method is useful for estimating margin requirements before placing an order, helping to ensure sufficient funds are available and understanding the margin impact of potential trades.
JSON-RPC: private/get_margins
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetMarginsRequest |
Returns
Promise<AdvTradeGlobalGetMarginsResult>
getMarkPriceHistory()
getMarkPriceHistory(params: AdvTradeGlobalGetMarkPriceHistoryRequest): Promise<number[][]>;Get Mark Price History
Retrieves 5-minute historical mark price data for an instrument. Mark prices are used for margin calculations and position valuations. Note: Currently, mark price history is available only for a subset of options that participate in volatility index calculations. All other instruments, including futures and perpetuals, will return an empty list.
JSON-RPC: public/get_mark_price_history
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetMarkPriceHistoryRequest |
Returns
Promise<number[][]>
getOpenOrders()
getOpenOrders(params?: AdvTradeGlobalGetOpenOrdersRequest): Promise<AdvTradeGlobalOrder[]>;Get Open Orders
Retrieves a list of all open orders for the authenticated account across all currencies. Open orders are orders that have been placed but not yet filled or cancelled. Results can be filtered by instrument kind and order type. This method provides a comprehensive view of all active orders.
JSON-RPC: private/get_open_orders
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalGetOpenOrdersRequest |
Returns
Promise<AdvTradeGlobalOrder[]>
getOpenOrdersByCurrency()
getOpenOrdersByCurrency(params: AdvTradeGlobalGetOpenOrdersByCurrencyRequest): Promise<AdvTradeGlobalOrder[]>;Get Open Orders By Currency
Retrieves a list of all open orders for a specific currency. Open orders are orders that have been placed but not yet filled or cancelled. Results can be filtered by instrument kind and order type. This method provides a view of all active orders within a currency.
JSON-RPC: private/get_open_orders_by_currency
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetOpenOrdersByCurrencyRequest |
Returns
Promise<AdvTradeGlobalOrder[]>
getOpenOrdersByInstrument()
getOpenOrdersByInstrument(params: AdvTradeGlobalGetOpenOrdersByInstrumentRequest): Promise<AdvTradeGlobalOrder[]>;Get Open Orders By Instrument
Retrieves a list of all open orders for a specific instrument. Open orders are orders that have been placed but not yet filled or cancelled. Results can be filtered by order type. This method is useful for checking active orders for a particular instrument.
JSON-RPC: private/get_open_orders_by_instrument
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetOpenOrdersByInstrumentRequest |
Returns
Promise<AdvTradeGlobalOrder[]>
getOpenOrdersByLabel()
getOpenOrdersByLabel(params: AdvTradeGlobalGetOpenOrdersByLabelRequest): Promise<AdvTradeGlobalOrder[]>;Get Open Orders By Label
Retrieves a list of all open orders that have a specific label within a given currency. This is useful for tracking and managing groups of related orders that share the same label. Open orders are orders that have been placed but not yet filled or cancelled. The label helps organize and identify related orders.
JSON-RPC: private/get_open_orders_by_label
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetOpenOrdersByLabelRequest |
Returns
Promise<AdvTradeGlobalOrder[]>
getOrderBook()
getOrderBook(params: AdvTradeGlobalGetOrderBookRequest): Promise<AdvTradeGlobalTickerNotificationWithBidsAndAsks>;Get Order Book
Retrieves the order book (bids and asks) for a given instrument, along with other market values such as best bid/ask prices, last trade price, mark price, and index price. The order book depth can be controlled using the depth parameter, which accepts values from 1 to 10000. The response includes price levels sorted by price (bids descending, asks ascending).
Replaces GET /product_book
JSON-RPC: public/get_order_book
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetOrderBookRequest |
Returns
Promise<AdvTradeGlobalTickerNotificationWithBidsAndAsks>
getOrderBookByInstrumentId()
getOrderBookByInstrumentId(params: AdvTradeGlobalGetOrderBookByInstrumentIdRequest): Promise<AdvTradeGlobalTickerNotificationWithBidsAndAsks>;Get Order Book By Instrument Id
Retrieves the order book (bids and asks) for a given instrument ID, along with other market values such as best bid/ask prices, last trade price, mark price, and index price. This method is similar to get_order_book but uses instrument ID instead of instrument name. The order book depth can be controlled using the depth parameter, which accepts values from 1 to 10000.
JSON-RPC: public/get_order_book_by_instrument_id
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetOrderBookByInstrumentIdRequest |
Returns
Promise<AdvTradeGlobalTickerNotificationWithBidsAndAsks>
getOrderHistoryByCurrency()
getOrderHistoryByCurrency(params: AdvTradeGlobalGetOrderHistoryByCurrencyRequest): Promise<AdvTradeGlobalOrder[]>;Get Order History By Currency
Retrieves the order history for a specific currency. The history includes orders that have been partially or fully filled, as well as cancelled orders (if include_unfilled_orders is set to true). Results can be filtered by instrument kind and paginated using offset and count parameters, or using continuation tokens. Use include_old_orders to include orders from before a certain date, and historical to retrieve historical order data.
Replaces GET /orders/historical/batch
JSON-RPC: private/get_order_history_by_currency
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetOrderHistoryByCurrencyRequest |
Returns
Promise<AdvTradeGlobalOrder[]>
getOrderHistoryByInstrument()
getOrderHistoryByInstrument(params: AdvTradeGlobalGetOrderHistoryByInstrumentRequest): Promise<AdvTradeGlobalOrder[]>;Get Order History By Instrument
Retrieves the order history for a specific instrument. The history includes orders that have been partially or fully filled, as well as cancelled orders (if include_unfilled_orders is set to true). Results can be paginated using offset and count parameters, or using continuation tokens. Use include_old_orders to include orders from before a certain date, and historical to retrieve historical order data.
Replaces GET /orders/historical/batch
JSON-RPC: private/get_order_history_by_instrument
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetOrderHistoryByInstrumentRequest |
Returns
Promise<AdvTradeGlobalOrder[]>
getOrderMarginByIds()
getOrderMarginByIds(params: AdvTradeGlobalGetOrderMarginByIdsRequest): Promise<AdvTradeGlobalOrderIdInitialMarginPair[]>;Get Order Margin By Ids
Retrieves the initial margin requirements for one or more orders identified by their order IDs. Initial margin is the amount of funds required to open a position with these orders. Use this method to inspect the margin requirements of existing orders by order ID. To estimate margin for a proposed order, use getMargins().
JSON-RPC: private/get_order_margin_by_ids
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetOrderMarginByIdsRequest |
Returns
Promise<AdvTradeGlobalOrderIdInitialMarginPair[]>
getOrderState()
getOrderState(params: AdvTradeGlobalGetOrderStateRequest): Promise<AdvTradeGlobalOrder>;Get Order State
Retrieves the current state of an order identified by its order ID. The response includes order details such as status (open, filled, cancelled), filled amount, remaining amount, price, and other order properties. Important Note for Mass Quotes: Quote orders are order-like structures that don't fully translate to normal orders. When checking order state for quotes, the amount field represents the remaining amount, not the original order amount. Note: This method does not support the historical flag and only returns an order that closed within the last 30 minutes (same recency window as historical=false). For orders older than that, use private/get_order_history_by_currency or private/get_order_history_by_instrument with historical=true.
Replaces GET /orders/historical/
JSON-RPC: private/get_order_state
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetOrderStateRequest |
Returns
Promise<AdvTradeGlobalOrder>
getOrderStateByLabel()
getOrderStateByLabel(params: AdvTradeGlobalGetOrderStateByLabelRequest): Promise<AdvTradeGlobalOrder[]>;Get Order State By Label
Retrieves the state of recent orders that have a specific label. This is useful for tracking orders that share the same label, which is helpful for managing related orders. Results are filtered by currency and label. The response includes order details such as status, filled amount, remaining amount, and other order properties for all orders with the specified label. Note: This method does not support the historical flag and only returns orders that closed within the last 30 minutes (same recency window as historical=false). This also applies to a trigger order and the order it creates upon triggering - once either has been closed for more than 30 minutes, it will no longer appear here, even though the same label was carried over between them. For orders older than that, use private/get_order_history_by_currency or private/get_order_history_by_instrument with historical=true.
JSON-RPC: private/get_order_state_by_label
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetOrderStateByLabelRequest |
Returns
Promise<AdvTradeGlobalOrder[]>
getPosition()
getPosition(params: AdvTradeGlobalGetPositionRequest): Promise<AdvTradeGlobalPositionWithOpenOrdersMargin>;Get Position
Retrieves the open position for a specific instrument. Returns detailed position information including size, average entry price, mark price, unrealized P&L, initial margin, maintenance margin, and other position-related metrics. If no position exists for the specified instrument, the response will indicate a zero position.
Replaces GET /intx/positions/{portfolio_uuid}/
JSON-RPC: private/get_position
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetPositionRequest |
Returns
Promise<AdvTradeGlobalPositionWithOpenOrdersMargin>
getPositions()
getPositions(params?: AdvTradeGlobalGetPositionsRequest): Promise<AdvTradeGlobalPositionWithOpenOrdersMargin[]>;Get Positions
Retrieves all open positions for the authenticated account. Returns position details including size, average entry price, mark price, unrealized P&L, initial margin, maintenance margin, and other position-related information. Results can be filtered by currency and instrument kind (future, option, etc.). To retrieve positions for a specific subaccount, use the subaccount_id parameter.
Replaces GET /intx/positions/
JSON-RPC: private/get_positions
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalGetPositionsRequest |
Returns
Promise<AdvTradeGlobalPositionWithOpenOrdersMargin[]>
getPrivate()
getPrivate(endpoint: string, params?: object): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | object |
Returns
Promise<any>
Inherited from
BaseRestClient.getPrivate
getSettlementHistoryByCurrency()
getSettlementHistoryByCurrency(params: AdvTradeGlobalGetSettlementHistoryByCurrencyRequest): Promise<AdvTradeGlobalGetSettlementHistoryByCurrencyResult>;Get Settlement History By Currency
Retrieves settlement, delivery, and bankruptcy events that have affected your account for a specific currency. Settlement vs. delivery: Settlement is a daily event (at 08:00 UTC) for futures and perpetual positions that converts unrealized profit and loss into realized profit and loss. Option positions do not settle. Delivery is a one-time event that occurs when a futures or options contract expires
- any remaining open position is closed at the delivery price. Delivery does not apply to perpetual or spot instruments. Both events take place at 08:00 UTC, which is why they are sometimes conflated. Results can be filtered by settlement type and timestamp. Use pagination parameters (count and continuation) to retrieve large settlement histories. This data is useful for tracking account-affecting settlement events and understanding how contract expirations impact your account.
JSON-RPC: private/get_settlement_history_by_currency
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetSettlementHistoryByCurrencyRequest |
Returns
Promise<AdvTradeGlobalGetSettlementHistoryByCurrencyResult>
getSettlementHistoryByInstrument()
getSettlementHistoryByInstrument(params: AdvTradeGlobalGetSettlementHistoryByInstrumentRequest): Promise<AdvTradeGlobalGetSettlementHistoryByInstrumentResult>;Get Settlement History By Instrument
Retrieves settlement, delivery, and bankruptcy events for a specific instrument that have affected your account. Settlement vs. delivery: Settlement is a daily event (at 08:00 UTC) for futures and perpetual positions that converts unrealized profit and loss into realized profit and loss. Option positions do not settle. Delivery is a one-time event that occurs when a futures or options contract expires
- any remaining open position is closed at the delivery price. Delivery does not apply to perpetual or spot instruments. Both events take place at 08:00 UTC, which is why they are sometimes conflated. Results can be filtered by settlement type and timestamp. Use pagination parameters (count and continuation) to retrieve large settlement histories. This method is useful for tracking settlement events for a specific instrument.
JSON-RPC: private/get_settlement_history_by_instrument
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetSettlementHistoryByInstrumentRequest |
Returns
Promise<AdvTradeGlobalGetSettlementHistoryByInstrumentResult>
getSignTimestampMs()
getSignTimestampMs(): number;Timestamp used to sign the request. Override this method to implement your own timestamp/sync mechanism
Returns
number
Inherited from
BaseRestClient.getSignTimestampMs
getStatus()
getStatus(): Promise<AdvTradeGlobalGetStatusResult>;Get Status
Method used to get information about locked currencies
JSON-RPC: public/status
Returns
Promise<AdvTradeGlobalGetStatusResult>
getSupportedIndexNames()
getSupportedIndexNames(params?: AdvTradeGlobalGetSupportedIndexNamesRequest): Promise<AdvTradeGlobalGetSupportedIndexNamesItem[]>;Get Supported Index Names
Retrieves the identifiers (names) of all supported price indexes, optionally filtered by index type. Price indexes are reference prices used for mark price calculations, settlement, and other market operations. Use the type parameter to filter indexes by type (e.g., spot, futures, etc.). This method helps discover available indexes for use with other API methods.
JSON-RPC: public/get_supported_index_names
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalGetSupportedIndexNamesRequest |
Returns
Promise<AdvTradeGlobalGetSupportedIndexNamesItem[]>
getTicker()
getTicker(params: AdvTradeGlobalGetTickerRequest): Promise<AdvTradeGlobalTickerNotification>;Get Ticker
Retrieves the ticker (24-hour statistics) for a specific instrument. The ticker includes the last trade price, best bid/ask prices, 24-hour high/low, 24-hour volume, open interest, mark price, and other market statistics. This is a lightweight method for getting current market data for a single instrument. For real-time updates, consider using WebSocket subscriptions to ticker channels.
Replaces GET /best_bid_ask
JSON-RPC: public/ticker
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetTickerRequest |
Returns
Promise<AdvTradeGlobalTickerNotification>
getTime()
getTime(): Promise<number>;Get the API server time in milliseconds to compare with your local clock.
JSON-RPC: public/get_time.
Returns
Promise<number>
getTradeVolumes()
getTradeVolumes(params?: AdvTradeGlobalGetTradeVolumesRequest): Promise<AdvTradeGlobalTradesVolumes[]>;Get Trade Volumes
Retrieves aggregated 24-hour trade volumes for different instrument types and currencies. The volume statistics include all executed trades across the platform. Note: Position moves are not included in this volume. Block trades and Block RFQ trades are included in the volume calculations. Use the extended parameter to include additional volume statistics and breakdowns. Note: For currencies with spot instruments routed to Coinbase Exchange, spot_volume is omitted, as are spot_volume_7d and spot_volume_30d when extended is used. Use Get all product volume for venue spot volume.
JSON-RPC: public/get_trade_volumes
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalGetTradeVolumesRequest |
Returns
Promise<AdvTradeGlobalTradesVolumes[]>
getTradingviewChartData()
getTradingviewChartData(params: AdvTradeGlobalGetTradingviewChartDataRequest): Promise<AdvTradeGlobalGetTradingviewChartDataResult>;Get Tradingview Chart Data
Retrieves publicly available market data formatted for generating TradingView-compatible candle charts. The data includes open, high, low, close (OHLC) prices and volume for specified time intervals. Set resolution to the candle interval in minutes (for example, "1", "5", or "60"), or "1D" for daily candles. This method provides the standard format used by TradingView and other charting platforms. Note: For spot instruments routed to Coinbase Exchange, this call is not supported. Use Get product candles instead.
Replaces GET /products/{product_id}/candles
JSON-RPC: public/get_tradingview_chart_data
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetTradingviewChartDataRequest |
Returns
Promise<AdvTradeGlobalGetTradingviewChartDataResult>
getTransactionLog()
getTransactionLog(params: AdvTradeGlobalGetTransactionLogRequest): Promise<AdvTradeGlobalGetTransactionLogResult>;Get account transactions, including trades, deposits, withdrawals, transfers and fees. Filter by currency, time range or transaction type, use continuation for pagination, and set subaccount_id to query a subaccount. API history extends back to account creation. The sustained rate limit is one request per second.
Starbase trades include starbase_match_id, starbase_order_id and starbase_timestamp. An option that expires out of the money produces only an expiry entry, with no settlement into futures.
JSON-RPC: private/get_transaction_log.
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetTransactionLogRequest |
Returns
Promise<AdvTradeGlobalGetTransactionLogResult>
getTriggerOrderHistory()
getTriggerOrderHistory(params: AdvTradeGlobalGetTriggerOrderHistoryRequest): Promise<AdvTradeGlobalGetTriggerOrderHistoryResult>;Get Trigger Order History
Retrieves a detailed log of all trigger orders (stop orders, take-profit orders, etc.) for the authenticated account. The log includes trigger order creation, activation, execution, and cancellation events. Results can be filtered by currency and instrument name. Use pagination parameters (count and continuation) to retrieve large trigger order histories. This is useful for tracking trigger order activity and debugging trigger order behavior.
JSON-RPC: private/get_trigger_order_history
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetTriggerOrderHistoryRequest |
Returns
Promise<AdvTradeGlobalGetTriggerOrderHistoryResult>
getUserTradesByCurrency()
getUserTradesByCurrency(params: AdvTradeGlobalGetUserTradesByCurrencyRequest): Promise<AdvTradeGlobalGetUserTradesByCurrencyResult>;Get User Trades By Currency
Retrieves the latest user trades that have occurred for instruments in a specific currency. Returns trade details including price, amount, direction, timestamp, trade ID, and order ID for all instruments in the currency. Results can be filtered by instrument kind, trade ID range, or timestamp range. Use the count parameter to limit the number of trades returned, and sorting to control the order. To retrieve trades for a specific subaccount, use the subaccount_id parameter. Use historical to retrieve historical trade data.
Replaces GET /orders/historical/fills
JSON-RPC: private/get_user_trades_by_currency
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetUserTradesByCurrencyRequest |
Returns
Promise<AdvTradeGlobalGetUserTradesByCurrencyResult>
getUserTradesByCurrencyAndTime()
getUserTradesByCurrencyAndTime(params: AdvTradeGlobalGetUserTradesByCurrencyAndTimeRequest): Promise<AdvTradeGlobalGetUserTradesByCurrencyAndTimeResult>;Get User Trades By Currency And Time
Retrieves the latest user trades that have occurred for instruments in a specific currency within a specified time range. Returns trade details including price, amount, direction, timestamp, trade ID, and order ID for all instruments in the currency. Results can be filtered by instrument kind. Use the count parameter to limit the number of trades returned, and sorting to control the order. Use historical to retrieve historical trade data. This method is useful for analyzing trading activity across a currency over specific time periods. Main accounts may use the subaccount_id parameter to retrieve trade data for a specific subaccount (requires mainaccount scope).
Replaces GET /orders/historical/fills
JSON-RPC: private/get_user_trades_by_currency_and_time
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetUserTradesByCurrencyAndTimeRequest |
Returns
Promise<AdvTradeGlobalGetUserTradesByCurrencyAndTimeResult>
getUserTradesByInstrument()
getUserTradesByInstrument(params: AdvTradeGlobalGetUserTradesByInstrumentRequest): Promise<AdvTradeGlobalGetUserTradesByInstrumentResult>;Get User Trades By Instrument
Retrieves the latest user trades that have occurred for a specific instrument. Returns trade details including price, amount, direction, timestamp, trade ID, and order ID. Results can be filtered by sequence number range or timestamp range. Use the count parameter to limit the number of trades returned, and sorting to control the order (ascending or descending by trade ID). Use historical to retrieve historical trade data. Main accounts may use the subaccount_id parameter to retrieve trade data for a specific subaccount (requires mainaccount scope).
Replaces GET /orders/historical/fills
JSON-RPC: private/get_user_trades_by_instrument
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetUserTradesByInstrumentRequest |
Returns
Promise<AdvTradeGlobalGetUserTradesByInstrumentResult>
getUserTradesByInstrumentAndTime()
getUserTradesByInstrumentAndTime(params: AdvTradeGlobalGetUserTradesByInstrumentAndTimeRequest): Promise<AdvTradeGlobalGetUserTradesByInstrumentAndTimeResult>;Get User Trades By Instrument And Time
Retrieves the latest user trades that have occurred for a specific instrument within a specified time range. Returns trade details including price, amount, direction, timestamp, trade ID, and order ID. Use the count parameter to limit the number of trades returned, and sorting to control the order (ascending or descending by trade ID). Use historical to retrieve historical trade data. This method is useful for analyzing trading activity over specific time periods. Main accounts may use the subaccount_id parameter to retrieve trade data for a specific subaccount (requires mainaccount scope).
Replaces GET /orders/historical/fills
JSON-RPC: private/get_user_trades_by_instrument_and_time
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetUserTradesByInstrumentAndTimeRequest |
Returns
Promise<AdvTradeGlobalGetUserTradesByInstrumentAndTimeResult>
getUserTradesByOrder()
getUserTradesByOrder(params: AdvTradeGlobalGetUserTradesByOrderRequest): Promise<AdvTradeGlobalUserTrade[]>;Get User Trades By Order
Retrieves all trades that were executed from a specific order. When an order is filled, it may result in multiple trades (partial fills). This method returns all trades associated with a given order ID. Results can be sorted in ascending or descending order by trade ID. Use historical to retrieve historical trade data. This is useful for tracking how an order was filled and analyzing execution quality. Main accounts may use the subaccount_id parameter to retrieve trade data for a specific subaccount (requires mainaccount scope).
Replaces GET /orders/historical/fills
JSON-RPC: private/get_user_trades_by_order
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetUserTradesByOrderRequest |
Returns
Promise<AdvTradeGlobalUserTrade[]>
getVolatilityIndexData()
getVolatilityIndexData(params: AdvTradeGlobalGetVolatilityIndexDataRequest): Promise<AdvTradeGlobalGetVolatilityIndexDataResult>;Get Volatility Index Data
Retrieves volatility index (VIX) chart data formatted as candles. Volatility indexes measure market expectations of future volatility and are useful for risk assessment and trading strategies. Set resolution to the candle interval in seconds, or "1D" for daily candles. The data shows historical volatility index values over time and is formatted for use in charting applications.
JSON-RPC: public/get_volatility_index_data
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalGetVolatilityIndexDataRequest |
Returns
Promise<AdvTradeGlobalGetVolatilityIndexDataResult>
invalidateBlockTradeSignature()
invalidateBlockTradeSignature(params?: any): Promise<any>;JSON-RPC wrapper for private/invalidate_block_trade_signature, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
patchPrivate()
patchPrivate(endpoint: string, params?: ParamsInRequest): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | ParamsInRequest |
Returns
Promise<any>
Inherited from
BaseRestClient.patchPrivate
post()
post(endpoint: string, params?: ParamsInRequest): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | ParamsInRequest |
Returns
Promise<any>
Inherited from
BaseRestClient.post
postPrivate()
postPrivate(endpoint: string, params?: ParamsInRequest): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | ParamsInRequest |
Returns
Promise<any>
Inherited from
BaseRestClient.postPrivate
putPrivate()
putPrivate(endpoint: string, params?: ParamsInRequest): Promise<any>;Parameters
| Parameter | Type |
|---|---|
endpoint | string |
params? | ParamsInRequest |
Returns
Promise<any>
Inherited from
BaseRestClient.putPrivate
rejectBlockTrade()
rejectBlockTrade(params?: any): Promise<any>;JSON-RPC wrapper for private/reject_block_trade, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
simulateBlockTrade()
simulateBlockTrade(params?: any): Promise<any>;JSON-RPC wrapper for private/simulate_block_trade, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>
simulatePme()
simulatePme(params: AdvTradeGlobalSimulatePmeRequest): Promise<object>;Simulate PME
Calculates the Extended Risk Matrix (ERM) and detailed margin information for Portfolio Margin accounts. The ERM provides a comprehensive view of portfolio risk across different scenarios and market conditions. You can calculate the ERM for a specific currency or for the entire Cross-Collateral portfolio. The response includes margin requirements, risk metrics, and scenario analysis that helps assess portfolio risk under various market conditions. Use this method to understand margin requirements and risk exposure before making trading decisions in a Portfolio Margin account.
JSON-RPC: private/pme/simulate
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalSimulatePmeRequest |
Returns
Promise<object>
simulatePortfolio()
simulatePortfolio(params: AdvTradeGlobalSimulatePortfolioRequest): Promise<AdvTradeGlobalSimulatePortfolioResult>;Simulate Portfolio
Calculates portfolio margin requirements and risk metrics for simulated positions or the current portfolio. This method helps you understand margin requirements before opening new positions or assess the impact of potential trades. You can simulate adding new positions to the current portfolio or calculate margin for a completely simulated portfolio. The response includes initial margin, maintenance margin, available funds, and other risk metrics. Note: This method has a restricted rate limit of not more than once per second due to the computational complexity of portfolio margin calculations.
JSON-RPC: private/simulate_portfolio
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalSimulatePortfolioRequest |
Returns
Promise<AdvTradeGlobalSimulatePortfolioResult>
submitBuy()
submitBuy(params: AdvTradeGlobalPlaceOrderRequest): Promise<AdvTradeGlobalBuyResult>;Buy
Places a buy order for an instrument. Supports various order types including limit, market, stop, and advanced order types (stop-limit, take-profit, take-profit-limit, trailing-stop, etc.). You can specify order parameters such as price, quantity, time-in-force, post-only, reduce-only, and trigger conditions. Orders can be labeled for easier management and tracking. Note: For spot orders routed to Coinbase Exchange, fills come back asynchronously. It is recommended to receive fills from the user.trades channel.
Replaces POST /orders. Side is the method.
JSON-RPC: private/buy
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalPlaceOrderRequest |
Returns
Promise<AdvTradeGlobalBuyResult>
submitSell()
submitSell(params: AdvTradeGlobalPlaceOrderRequest): Promise<AdvTradeGlobalSellResult>;Sell
Places a sell order for an instrument. Supports various order types including limit, market, stop, and advanced order types (stop-limit, take-profit, take-profit-limit, trailing-stop, etc.). You can specify order parameters such as price, quantity, time-in-force, post-only, reduce-only, and trigger conditions. Orders can be labeled for easier management and tracking. Market Maker Protection (MMP) can be enabled to prevent excessive quoting. Note: For spot orders routed to Coinbase Exchange, fills come back asynchronously. It is recommended to receive fills from the user.trades channel.
Replaces POST /orders. Side is the method.
JSON-RPC: private/sell
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalPlaceOrderRequest |
Returns
Promise<AdvTradeGlobalSellResult>
testConnection()
testConnection(params?: AdvTradeGlobalTestRequest): Promise<AdvTradeGlobalTestResult>;Test
Tests the connection to the API server, and returns its version. You can use this to make sure the API is reachable, and matches the expected version.
JSON-RPC: public/test
Parameters
| Parameter | Type |
|---|---|
params? | AdvTradeGlobalTestRequest |
Returns
Promise<AdvTradeGlobalTestResult>
updateOrder()
updateOrder(params: AdvTradeGlobalEditRequest): Promise<AdvTradeGlobalEditResult>;Edit
Modifies an existing order by changing its price, amount, and/or other properties such as time-in-force, post-only, reduce-only, trigger conditions, or advanced order type. The order is identified by its order ID. Only open orders can be edited. Changes take effect immediately and may result in the order being filled if the new price matches the market. Note: For spot orders routed to Coinbase Exchange, fills come back asynchronously. It is recommended to receive fills from the user.trades channel.
Replaces POST /orders/edit
JSON-RPC: private/edit
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalEditRequest |
Returns
Promise<AdvTradeGlobalEditResult>
updateOrderByLabel()
updateOrderByLabel(params: AdvTradeGlobalEditByLabelRequest): Promise<AdvTradeGlobalEditByLabelResult>;Edit By Label
Modifies an order identified by its label. This method works only when there is exactly one open order with the specified label. You can change the order's price, amount, and/or other properties such as time-in-force, post-only, reduce-only, trigger conditions, or advanced order type. Changes take effect immediately. Note: For spot orders routed to Coinbase Exchange, fills come back asynchronously. It is recommended to receive fills from the user.trades channel.
Replaces POST /orders/edit
JSON-RPC: private/edit_by_label
Parameters
| Parameter | Type |
|---|---|
params | AdvTradeGlobalEditByLabelRequest |
Returns
Promise<AdvTradeGlobalEditByLabelResult>
verifyBlockTrade()
verifyBlockTrade(params?: any): Promise<any>;JSON-RPC wrapper for private/verify_block_trade, sent as POST /api/v2. Accepts an optional any request body and returns Promise<any>.
Parameters
| Parameter | Type |
|---|---|
params? | any |
Returns
Promise<any>