Schemas

SubscriptionResponseMessage

// Response message indicating the success or failure of a subscription operation.
{
  // Indicates if the subscription operation was successful.
  success: boolean
  // Additional information about the subscription operation.
  message: string
}

SubscriptionType

{
  "type": "string",
  "description": "Indicates the type of subscription action.",
  "enum": [
    "Subscribe",
    "Unsubscribe"
  ]
}

AccountDataStream

{
  "type": "string",
  "description": "Represents the type of account data stream.",
  "enum": [
    "AccountOrderUpdate",
    "AccountTradeUpdate",
    "AccountAggregatedTradeUpdate",
    "AccountPositionUpdate",
    "AccountUpdate",
    "AccountTransactionUpdate",
    "AccountCommandFailureUpdate"
  ]
}

AccountSubscriptionMessage

// Subscription message for account data streams.
{
  // The authentication token for the account.
  authToken?: string
  // Indicates the type of subscription action.
  method: enum[Subscribe, Unsubscribe]
  // Represents the type of account data stream.
  dataStreams?: enum[AccountOrderUpdate, AccountTradeUpdate, AccountAggregatedTradeUpdate, AccountPositionUpdate, AccountUpdate, AccountTransactionUpdate, AccountCommandFailureUpdate][]
}

MarketSubscriptionStreams

// Represents the type of market data stream and its parameters.
{
  // The symbol of the market stream to subscribe to (Leave empty for TickerAll stream)
  symbol: string
  streams?: enum[Recent_Trade, Ticker, Ticker_All, Diff_Depth_10_ms, Diff_Depth_200_ms, Diff_Depth_500_ms, Partial_Depth_5, Partial_Depth_10, Partial_Depth_20, Oracle_Price, Mark_Price, Market_Price, Candlestick_1m_Last, Candlestick_3m_Last, Candlestick_5m_Last, Candlestick_15m_Last, Candlestick_30m_Last, Candlestick_1h_Last, Candlestick_2h_Last, Candlestick_4h_Last, Candlestick_6h_Last, Candlestick_8h_Last, Candlestick_12h_Last, Candlestick_1d_Last, Candlestick_1w_Last, Candlestick_1Mo_Last, Candlestick_1m_Oracle, Candlestick_3m_Oracle, Candlestick_5m_Oracle, Candlestick_15m_Oracle, Candlestick_30m_Oracle, Candlestick_1h_Oracle, Candlestick_2h_Oracle, Candlestick_4h_Oracle, Candlestick_6h_Oracle, Candlestick_8h_Oracle, Candlestick_12h_Oracle, Candlestick_1d_Oracle, Candlestick_1w_Oracle, Candlestick_1Mo_Oracle, Candlestick_1m_Mark, Candlestick_3m_Mark, Candlestick_5m_Mark, Candlestick_15m_Mark, Candlestick_30m_Mark, Candlestick_1h_Mark, Candlestick_2h_Mark, Candlestick_4h_Mark, Candlestick_6h_Mark, Candlestick_8h_Mark, Candlestick_12h_Mark, Candlestick_1d_Mark, Candlestick_1w_Mark, Candlestick_1Mo_Mark, Candlestick_1m_Market, Candlestick_3m_Market, Candlestick_5m_Market, Candlestick_15m_Market, Candlestick_30m_Market, Candlestick_1h_Market, Candlestick_2h_Market, Candlestick_4h_Market, Candlestick_6h_Market, Candlestick_8h_Market, Candlestick_12h_Market, Candlestick_1d_Market, Candlestick_1w_Market, Candlestick_1Mo_Market][]
}

MarketDataStreamName

{
  "type": "string",
  "enum": [
    "Recent_Trade",
    "Ticker",
    "Ticker_All",
    "Diff_Depth_10_ms",
    "Diff_Depth_200_ms",
    "Diff_Depth_500_ms",
    "Partial_Depth_5",
    "Partial_Depth_10",
    "Partial_Depth_20",
    "Oracle_Price",
    "Mark_Price",
    "Market_Price",
    "Candlestick_1m_Last",
    "Candlestick_3m_Last",
    "Candlestick_5m_Last",
    "Candlestick_15m_Last",
    "Candlestick_30m_Last",
    "Candlestick_1h_Last",
    "Candlestick_2h_Last",
    "Candlestick_4h_Last",
    "Candlestick_6h_Last",
    "Candlestick_8h_Last",
    "Candlestick_12h_Last",
    "Candlestick_1d_Last",
    "Candlestick_1w_Last",
    "Candlestick_1Mo_Last",
    "Candlestick_1m_Oracle",
    "Candlestick_3m_Oracle",
    "Candlestick_5m_Oracle",
    "Candlestick_15m_Oracle",
    "Candlestick_30m_Oracle",
    "Candlestick_1h_Oracle",
    "Candlestick_2h_Oracle",
    "Candlestick_4h_Oracle",
    "Candlestick_6h_Oracle",
    "Candlestick_8h_Oracle",
    "Candlestick_12h_Oracle",
    "Candlestick_1d_Oracle",
    "Candlestick_1w_Oracle",
    "Candlestick_1Mo_Oracle",
    "Candlestick_1m_Mark",
    "Candlestick_3m_Mark",
    "Candlestick_5m_Mark",
    "Candlestick_15m_Mark",
    "Candlestick_30m_Mark",
    "Candlestick_1h_Mark",
    "Candlestick_2h_Mark",
    "Candlestick_4h_Mark",
    "Candlestick_6h_Mark",
    "Candlestick_8h_Mark",
    "Candlestick_12h_Mark",
    "Candlestick_1d_Mark",
    "Candlestick_1w_Mark",
    "Candlestick_1Mo_Mark",
    "Candlestick_1m_Market",
    "Candlestick_3m_Market",
    "Candlestick_5m_Market",
    "Candlestick_15m_Market",
    "Candlestick_30m_Market",
    "Candlestick_1h_Market",
    "Candlestick_2h_Market",
    "Candlestick_4h_Market",
    "Candlestick_6h_Market",
    "Candlestick_8h_Market",
    "Candlestick_12h_Market",
    "Candlestick_1d_Market",
    "Candlestick_1w_Market",
    "Candlestick_1Mo_Market"
  ]
}

MarketSubscriptionMessage

// Subscription message for market data streams.
{
  // Indicates the type of subscription action.
  method: enum[Subscribe, Unsubscribe]
  // Represents the type of market data stream and its parameters.
  dataStreams: {
    // The symbol of the market stream to subscribe to (Leave empty for TickerAll stream)
    symbol: string
    streams?: enum[Recent_Trade, Ticker, Ticker_All, Diff_Depth_10_ms, Diff_Depth_200_ms, Diff_Depth_500_ms, Partial_Depth_5, Partial_Depth_10, Partial_Depth_20, Oracle_Price, Mark_Price, Market_Price, Candlestick_1m_Last, Candlestick_3m_Last, Candlestick_5m_Last, Candlestick_15m_Last, Candlestick_30m_Last, Candlestick_1h_Last, Candlestick_2h_Last, Candlestick_4h_Last, Candlestick_6h_Last, Candlestick_8h_Last, Candlestick_12h_Last, Candlestick_1d_Last, Candlestick_1w_Last, Candlestick_1Mo_Last, Candlestick_1m_Oracle, Candlestick_3m_Oracle, Candlestick_5m_Oracle, Candlestick_15m_Oracle, Candlestick_30m_Oracle, Candlestick_1h_Oracle, Candlestick_2h_Oracle, Candlestick_4h_Oracle, Candlestick_6h_Oracle, Candlestick_8h_Oracle, Candlestick_12h_Oracle, Candlestick_1d_Oracle, Candlestick_1w_Oracle, Candlestick_1Mo_Oracle, Candlestick_1m_Mark, Candlestick_3m_Mark, Candlestick_5m_Mark, Candlestick_15m_Mark, Candlestick_30m_Mark, Candlestick_1h_Mark, Candlestick_2h_Mark, Candlestick_4h_Mark, Candlestick_6h_Mark, Candlestick_8h_Mark, Candlestick_12h_Mark, Candlestick_1d_Mark, Candlestick_1w_Mark, Candlestick_1Mo_Mark, Candlestick_1m_Market, Candlestick_3m_Market, Candlestick_5m_Market, Candlestick_15m_Market, Candlestick_30m_Market, Candlestick_1h_Market, Candlestick_2h_Market, Candlestick_4h_Market, Candlestick_6h_Market, Candlestick_8h_Market, Candlestick_12h_Market, Candlestick_1d_Market, Candlestick_1w_Market, Candlestick_1Mo_Market][]
  }[]
}

AccountStreamMessage

// Account stream message for account-related events.
// The payload depends on the event type.
// 
{
  // The type of account-related event.
  event: enum[AccountUpdate, AccountTradeUpdate, AccountAggregatedTradeUpdate, AccountOrderUpdate, AccountPositionUpdate, AccountTransactionUpdate, AccountLeverageFailureUpdate]
  // The reason for the account-related event.
  reason: enum[Deposit, Withdraw, OrderCreated, OrderMatched, OrderCancelled, OrdersForMarketCancelled, LeverageUpdated, IsolatedMarginUpdated, FundingRatePayment]
  // The payload of the message, which varies based on the event type.
  payload: AccountUpdate | AccountTradeUpdate | AccountAggregatedTradeUpdate | AccountOrderUpdate | AccountTransactionUpdate | AccountPositionUpdate | AccountCommandFailureUpdate
}

AccountEventType

{
  "type": "string",
  "description": "The type of account-related event.",
  "enum": [
    "AccountUpdate",
    "AccountTradeUpdate",
    "AccountAggregatedTradeUpdate",
    "AccountOrderUpdate",
    "AccountPositionUpdate",
    "AccountTransactionUpdate",
    "AccountLeverageFailureUpdate"
  ]
}

AccountEventReason

{
  "type": "string",
  "description": "The reason for the account-related event.",
  "enum": [
    "Deposit",
    "Withdraw",
    "OrderCreated",
    "OrderMatched",
    "OrderCancelled",
    "OrdersForMarketCancelled",
    "LeverageUpdated",
    "IsolatedMarginUpdated",
    "FundingRatePayment"
  ]
}

OrderCancelReason

{
  "type": "string",
  "description": "The reason for an order cancellation.",
  "enum": [
    "UNSPECIFIED",
    "INSUFFICIENT_MARGIN",
    "DUPLICATE_ORDER",
    "POST_ONLY_WOULD_TRADE",
    "INVALID_SYMBOL",
    "SIGNED_AT_TOO_OLD",
    "ORDER_EXPIRED",
    "INVALID_LEVERAGE",
    "INVALID_INPUT",
    "PRICE_OUT_OF_BOUND",
    "QUANTITY_OUT_OF_BOUND",
    "PRICE_OUT_OF_TICK_SIZE",
    "QUANTITY_OUT_OF_STEP_SIZE",
    "REDUCE_ONLY_WOULD_OPEN",
    "TOO_MANY_OPEN_ORDERS_ON_MARKET",
    "USER_CANCELLED",
    "USER_CANCELLED_ALL_ON_MARKET",
    "SELF_TRADE_PREVENTION",
    "LEVERAGE_UPDATE",
    "ACCOUNT_NOT_FOUND",
    "MARKET_NOT_TRADING",
    "INSUFFICIENT_LIQUIDITY",
    "POSITION_NOT_FOUND",
    "LIQUIDATION_OUT_OF_ORDER",
    "ACCOUNT_NOT_LIQUIDATABLE",
    "ORDER_NOT_REDUCING_POSITION",
    "USER_CANCELLED_ALL_STANDBY_ON_MARKET"
  ]
}

OrderCancellationFailureReason

{
  "type": "string",
  "description": "The reason for failure to cancel an order.",
  "enum": [
    "ORDER_NOT_FOUND",
    "MARKET_NOT_FOUND",
    "ACCOUNT_NOT_FOUND",
    "NO_OPEN_ORDERS_ON_MARKET",
    "NO_FAILURE",
    "UNSPECIFIED"
  ]
}

AccountCommandFailureUpdate

// Details about a failure during an account command execution.
{
  // The reason for the failure.
  reason: string
  // The type of command that failed.
  failedCommandType: string
  // The timestamp when the command failed in milliseconds.
  failedAtMillis: integer
}

AccountOrderUpdate

// A message containing order update information.
{
}

OrderCancellationUpdate

// Details of an order cancellation.
{
  // The unique hash of the order.
  orderHash: string
  // The client-provided order ID.
  clientOrderId?: string
  // The symbol of the market.
  symbol: string
  // The address of the account.
  accountAddress: string
  // The timestamp of the order creation in milliseconds.
  createdAtMillis: integer
  // The reason for an order cancellation.
  cancellationReason: enum[UNSPECIFIED, INSUFFICIENT_MARGIN, DUPLICATE_ORDER, POST_ONLY_WOULD_TRADE, INVALID_SYMBOL, SIGNED_AT_TOO_OLD, ORDER_EXPIRED, INVALID_LEVERAGE, INVALID_INPUT, PRICE_OUT_OF_BOUND, QUANTITY_OUT_OF_BOUND, PRICE_OUT_OF_TICK_SIZE, QUANTITY_OUT_OF_STEP_SIZE, REDUCE_ONLY_WOULD_OPEN, TOO_MANY_OPEN_ORDERS_ON_MARKET, USER_CANCELLED, USER_CANCELLED_ALL_ON_MARKET, SELF_TRADE_PREVENTION, LEVERAGE_UPDATE, ACCOUNT_NOT_FOUND, MARKET_NOT_TRADING, INSUFFICIENT_LIQUIDITY, POSITION_NOT_FOUND, LIQUIDATION_OUT_OF_ORDER, ACCOUNT_NOT_LIQUIDATABLE, ORDER_NOT_REDUCING_POSITION, USER_CANCELLED_ALL_STANDBY_ON_MARKET]
  // The reason for failure to cancel an order.
  failureToCancelReason?: enum[ORDER_NOT_FOUND, MARKET_NOT_FOUND, ACCOUNT_NOT_FOUND, NO_OPEN_ORDERS_ON_MARKET, NO_FAILURE, UNSPECIFIED]
  // The remaining quantity of the order.
  remainingQuantityE9: string
}

ActiveOrderUpdate

// Information about an order update.
{
  // The unique hash of the order.
  orderHash: string
  // The client-provided order ID.
  clientOrderId?: string
  // The symbol of the market.
  symbol: string
  // The address of the account.
  accountAddress: string
  // The price of the order in scientific notation with 9 decimal places.
  priceE9: string
  // The quantity of the order in scientific notation with 9 decimal places.
  quantityE9: string
  // The filled quantity of the order in scientific notation with 9 decimal places.
  filledQuantityE9: string
  // Trade side based on the user order in this trade.
  side: enum[LONG, SHORT, UNSPECIFIED]
  // The leverage of the order in scientific notation with 9 decimal places.
  leverageE9: string
  // Indicates if the order is isolated.
  isIsolated: boolean
  // A unique salt for the order.
  salt: string
  // The expiration timestamp of the order in milliseconds.
  expiresAtMillis: integer
  // The signing timestamp of the order in milliseconds.
  signedAtMillis: integer
  // The address of the signer of the order request.
  signerAddress: string
  // The type of order.
  type: enum[LIMIT, MARKET, STOP_LIMIT, STOP_MARKET, LIQUIDATION, STOP_LOSS_MARKET, TAKE_PROFIT_MARKET, STOP_LOSS_LIMIT, TAKE_PROFIT_LIMIT, BANKRUPTCY_LIQUIDATION, UNSPECIFIED]
  // Indicates if the order is reduce-only.
  reduceOnly: boolean
  // Indicates if the order is post-only.
  postOnly: boolean
  // The time-in-force policy for the order. By default, all orders are GTT. UNSPECIFIED is set to default.
  // 
  // GTT: Good Til Time
  // 
  // IOC: Immediate Or Cancel
  // 
  // FOK: Fill Or Kill    
  // 
  timeInForce: enum[GTT, IOC, FOK, UNSPECIFIED] //default: GTT
  // The trigger price for stop-limit or stop-market orders.
  triggerPriceE9?: string
  // The current status of the order.
  status: enum[STANDBY, OPEN, PARTIALLY_FILLED_OPEN, PARTIALLY_FILLED_CANCELED, FILLED, CANCELLED, EXPIRED, PARTIALLY_FILLED_EXPIRED, UNSPECIFIED]
  // The strategy used to resolve self trades. 
  // 
  // TAKER: On a self trade, the taker order will be cancelled
  // 
  // MAKER: On a self trade, the maker order will be cancelled
  // 
  // BOTH: On a self trade, both the taker and the maker order will be cancelled
  // 
  // UNSPECIFIED: set to default value
  // 
  selfTradePreventionType: enum[TAKER, MAKER, BOTH, UNSPECIFIED] //default: MAKER
  // The timestamp when the order was placed, in milliseconds.
  createdAtMillis: integer
  // The timestamp of the last update of the order in milliseconds.
  updatedAtMillis: integer
}

AccountTransactionUpdate

// Details about a transaction in the account.
{
  // The symbol of the market.
  symbol?: string
  // Transaction type (what caused the change in the asset balance).
  transactionType: enum[TRANSFER, DEPOSIT, WITHDRAW, REALIZED_PNL, FUNDING_FEE, TRADING_FEE, TRADING_GAS_FEE, BONUS, UNSPECIFIED]
  // The amount of the transaction in scientific notation with 9 decimal places.
  amountE9: string
  // The symbol of the asset.
  assetSymbol?: string
  // The trade ID associated with the transaction.
  tradeId?: string
  // The timestamp when the transaction was executed in milliseconds.
  executedAtMillis: integer
}

AccountPositionUpdate

// Details about an account position update.
{
  // The symbol of the market.
  symbol: string
  // The average entry price for the position.
  avgEntryPriceE9: string
  // The leverage applied to the position.
  clientSetLeverageE9: string
  // The liquidation price of the position.
  liquidationPriceE9: string
  // The current mark price of the position.
  markPriceE9: string
  // The notional value of the position.
  notionalValueE9: string
  // The size of the position.
  sizeE9: string
  // The unrealized profit and loss for the position.
  unrealizedPnlE9: string
  // The side of the position, either long or short
  side: enum[LONG, SHORT, UNSPECIFIED]
  // The margin required for the position.
  marginRequiredE9: string
  // The maintenance margin required for the position.
  maintenanceMarginE9: string
  // Indicates if the position is isolated.
  isIsolated: boolean
  // The isolated margin applied to the position.
  isolatedMarginE9: string
  // The last update time for the position in milliseconds.
  updatedAtMillis: integer
}

AccountUpdate

// Account information for the data stream.
{
  tradingFees: {
    // The Account Maker Fee (e9 format).
    makerFeeE9: string
    // The Account Taker Fee (e9 format).
    takerFeeE9: string
    // Are the fees applied on the account?
    isApplied: boolean
  }
  // If the user can trade.
  canTrade: boolean
  // If the current user can deposit to the account.
  canDeposit: boolean
  // If the current user can withdraw from the account.
  canWithdraw: boolean
  // Total effective balance in USD (e9 format).
  crossEffectiveBalanceE9: string
  // The sum of initial margin required across all cross positions (e9 format).
  crossMarginRequiredE9: string
  // The sum of initial margin required across all open orders (e9 format).
  totalOrderMarginRequiredE9: string
  // The amount of margin available to open new positions and orders (e9 format).
  marginAvailableE9: string
  // The sum of maintenance margin required across all cross positions (e9 format).
  crossMaintenanceMarginRequiredE9: string
  // The amount of margin available before liquidation (e9 format).
  crossMaintenanceMarginAvailableE9: string
  // The ratio of the maintenance margin required to the account value (e9 format).
  crossMaintenanceMarginRatioE9: string
  // The leverage of the account (e9 format).
  crossLeverageE9: string
  // Total unrealized profit (e9 format).
  totalUnrealizedPnlE9: string
  // Unrealized profit of cross positions (e9 format).
  crossUnrealizedPnlE9: string
  // An implicitly negative number that sums only the losses of all cross positions.
  crossUnrealizedLossE9: string
  // The total value of the cross account, combining the cross effective
  // balance and unrealized PnL across all cross positions, and subtracting any pending
  // funding payments on any cross position.
  // 
  crossAccountValueE9: string
  // The total value of the account, combining the total effective
  // balance and unrealized PnL across all positions, and subtracting any pending
  // funding payments on any position.
  // 
  totalAccountValueE9: string
  // Last update time in milliseconds since Unix epoch.
  updatedAtMillis: integer
  // Details about an asset in the account.
  assets: {
    // The symbol of the asset.
    symbol: string
    // The quantity of the asset.
    quantityE9: string
    // The effective balance of the asset.
    effectiveBalanceE9: string
    // The maximum quantity that can be withdrawn.
    maxWithdrawQuantityE9: string
    // The timestamp of the last update in milliseconds.
    updatedAtMillis: integer
  }[]
  authorizedAccounts?: string[]
}

AccountTradeUpdate

// Details about a trade in the account.
{
  trade: {
    // Trade ID
    id: string
    // Client order ID.
    clientOrderId?: string
    // Market address.
    symbol?: string
    // Order hash.
    orderHash?: string
    // The type of order.
    orderType?: enum[LIMIT, MARKET, STOP_LIMIT, STOP_MARKET, LIQUIDATION, STOP_LOSS_MARKET, TAKE_PROFIT_MARKET, STOP_LOSS_LIMIT, TAKE_PROFIT_LIMIT, BANKRUPTCY_LIQUIDATION, UNSPECIFIED]
    // Type of trade.
    tradeType?: enum[ORDER, LIQUIDATION, DELEVERAGE, UNSPECIFIED]
    // Trade side based on the user order in this trade.
    side: enum[LONG, SHORT, UNSPECIFIED]
    // Indicates if the user was a maker to the trade.
    isMaker?: boolean
    // Trade price (e9 format).
    priceE9: string
    // Trade quantity (e9 format).
    quantityE9: string
    // Quote quantity (e9 format).
    quoteQuantityE9: string
    // Realized profit and loss (e9 format).
    realizedPnlE9?: string
    // The side of the position, either long or short
    positionSide?: enum[LONG, SHORT, UNSPECIFIED]
    // Trading fee (e9 format).
    tradingFeeE9?: string
    // Asset used for trading fee.
    tradingFeeAsset?: string
    // Gas fee.
    gasFeeE9?: string
    // Asset used for gas fee.
    gasFeeAsset?: string
    // Trade timestamp in milliseconds since Unix epoch.
    executedAtMillis: integer
  }
}

AccountAggregatedTradeUpdate

// Aggregated details about a trade in the account.
{
  trade: {
    // Trade ID
    id: string
    // Client order ID.
    clientOrderId?: string
    // Market address.
    symbol?: string
    // Order hash.
    orderHash?: string
    // The type of order.
    orderType?: enum[LIMIT, MARKET, STOP_LIMIT, STOP_MARKET, LIQUIDATION, STOP_LOSS_MARKET, TAKE_PROFIT_MARKET, STOP_LOSS_LIMIT, TAKE_PROFIT_LIMIT, BANKRUPTCY_LIQUIDATION, UNSPECIFIED]
    // Type of trade.
    tradeType?: enum[ORDER, LIQUIDATION, DELEVERAGE, UNSPECIFIED]
    // Trade side based on the user order in this trade.
    side: enum[LONG, SHORT, UNSPECIFIED]
    // Indicates if the user was a maker to the trade.
    isMaker?: boolean
    // Trade price (e9 format).
    priceE9: string
    // Trade quantity (e9 format).
    quantityE9: string
    // Quote quantity (e9 format).
    quoteQuantityE9: string
    // Realized profit and loss (e9 format).
    realizedPnlE9?: string
    // The side of the position, either long or short
    positionSide?: enum[LONG, SHORT, UNSPECIFIED]
    // Trading fee (e9 format).
    tradingFeeE9?: string
    // Asset used for trading fee.
    tradingFeeAsset?: string
    // Gas fee.
    gasFeeE9?: string
    // Asset used for gas fee.
    gasFeeAsset?: string
    // Trade timestamp in milliseconds since Unix epoch.
    executedAtMillis: integer
  }
}

MarketStreamMessage

// A market stream message containing an event type and a payload.
// The payload structure depends on the event type.
// 
{
  // The type of event communicated in the WebSocket message.
  event: enum[RecentTradesUpdates, TickerUpdate, TickerAllUpdate, OraclePriceUpdate, MarkPriceUpdate, MarketPriceUpdate, CandlestickUpdate, OrderbookDiffDepthUpdate, OrderbookPartialDepthUpdate]
  // The payload of the message, which varies based on the event type.
  payload: RecentTradesUpdates | TickerUpdate | TickerAllUpdate | OraclePriceUpdate | MarkPriceUpdate | MarketPriceUpdate | CandlestickUpdate | OrderbookDiffDepthUpdate | OrderbookPartialDepthUpdate
}

MarketEventType

{
  "type": "string",
  "description": "The type of event communicated in the WebSocket message.",
  "enum": [
    "RecentTradesUpdates",
    "TickerUpdate",
    "TickerAllUpdate",
    "OraclePriceUpdate",
    "MarkPriceUpdate",
    "MarketPriceUpdate",
    "CandlestickUpdate",
    "OrderbookDiffDepthUpdate",
    "OrderbookPartialDepthUpdate"
  ]
}

TickerAllUpdate

{
  // Represents detailed market ticker information.
  tickerAll: {
    // Market symbol.
    symbol: string
    // Last trade quantity (e9 format).
    lastQuantityE9: string
    // Last trade time in milliseconds.
    lastTimeAtMillis: integer
    // Last trade price (e9 format).
    lastPriceE9: string
    // Funding rate value (e9 format).
    lastFundingRateE9: string
    // Time in milliseconds of next funding rate update.
    nextFundingTimeAtMillis: integer
    // 8 hr average funding rate (e9 format).
    avgFundingRate8hrE9: string
    // Oracle price of the asset (e9 format).
    oraclePriceE9: string
    // Direction of oracle price computed by comparing current oracle price to last oracle price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last).
    oraclePriceDirection: integer
    // Mark price on the exchange (e9 format).
    markPriceE9: string
    // Direction of mark price computed by comparing current mark price to last mark price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last).
    markPriceDirection: integer
    // Simple average of bestBid and bestAsk, or lastPrice if either is not present (e9 format).
    marketPriceE9: string
    // Direction of market price computed by comparing current market price to last market price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last).
    marketPriceDirection: integer
    // Best bid price (e9 format).
    bestBidPriceE9: string
    // Best bid quantity (e9 format).
    bestBidQuantityE9: string
    // Best ask price (e9 format).
    bestAskPriceE9: string
    // Best ask quantity (e9 format).
    bestAskQuantityE9: string
    // Open interest value (e9 format).
    openInterestE9: string
    // Highest Price in the last 24 hours (e9 format).
    highPrice24hrE9: string
    // Lowest Price in the last 24 hours (e9 format).
    lowPrice24hrE9: string
    // Total market volume in last 24 hours of asset (e9 format).
    volume24hrE9: string
    // Total market volume in last 24 hours in USDC (e9 format).
    quoteVolume24hrE9: string
    // Close price 24 hours ago (e9 format).
    closePrice24hrE9: string
    // Open price in the last 24 hours (e9 format).
    openPrice24hrE9: string
    // 24 hour close timestamp in milliseconds.
    closeTime24hrAtMillis: integer
    // 24 hour open timetamp in milliseconds.
    openTime24hrAtMillis: integer
    // First trade ID in the last 24 hours.
    firstId24hr: integer
    // Last trade ID in the last 24 hours.
    lastId24hr: integer
    // Total number of trades in the last 24 hours.
    count24hr: string
    // 24 hour Market price change (e9 format).
    priceChange24hrE9: string
    // 24 hour Market price change as a percentage (e9 format).
    priceChangePercent24hrE9: string
    // Last update timestamp in milliseconds.
    updatedAtMillis: integer
  }[]
}

TickerUpdate

// Represents detailed market ticker information.
{
  // Market symbol.
  symbol: string
  // Last trade quantity (e9 format).
  lastQuantityE9: string
  // Last trade time in milliseconds.
  lastTimeAtMillis: integer
  // Last trade price (e9 format).
  lastPriceE9: string
  // Funding rate value (e9 format).
  lastFundingRateE9: string
  // Time in milliseconds of next funding rate update.
  nextFundingTimeAtMillis: integer
  // 8 hr average funding rate (e9 format).
  avgFundingRate8hrE9: string
  // Oracle price of the asset (e9 format).
  oraclePriceE9: string
  // Direction of oracle price computed by comparing current oracle price to last oracle price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last).
  oraclePriceDirection: integer
  // Mark price on the exchange (e9 format).
  markPriceE9: string
  // Direction of mark price computed by comparing current mark price to last mark price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last).
  markPriceDirection: integer
  // Simple average of bestBid and bestAsk, or lastPrice if either is not present (e9 format).
  marketPriceE9: string
  // Direction of market price computed by comparing current market price to last market price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last).
  marketPriceDirection: integer
  // Best bid price (e9 format).
  bestBidPriceE9: string
  // Best bid quantity (e9 format).
  bestBidQuantityE9: string
  // Best ask price (e9 format).
  bestAskPriceE9: string
  // Best ask quantity (e9 format).
  bestAskQuantityE9: string
  // Open interest value (e9 format).
  openInterestE9: string
  // Highest Price in the last 24 hours (e9 format).
  highPrice24hrE9: string
  // Lowest Price in the last 24 hours (e9 format).
  lowPrice24hrE9: string
  // Total market volume in last 24 hours of asset (e9 format).
  volume24hrE9: string
  // Total market volume in last 24 hours in USDC (e9 format).
  quoteVolume24hrE9: string
  // Close price 24 hours ago (e9 format).
  closePrice24hrE9: string
  // Open price in the last 24 hours (e9 format).
  openPrice24hrE9: string
  // 24 hour close timestamp in milliseconds.
  closeTime24hrAtMillis: integer
  // 24 hour open timetamp in milliseconds.
  openTime24hrAtMillis: integer
  // First trade ID in the last 24 hours.
  firstId24hr: integer
  // Last trade ID in the last 24 hours.
  lastId24hr: integer
  // Total number of trades in the last 24 hours.
  count24hr: string
  // 24 hour Market price change (e9 format).
  priceChange24hrE9: string
  // 24 hour Market price change as a percentage (e9 format).
  priceChangePercent24hrE9: string
  // Last update timestamp in milliseconds.
  updatedAtMillis: integer
}

CandlestickUpdate

// Represents a candlestick for a specific market and interval.
{
  // The symbol of the market for this candlestick.
  symbol: string
  // The start time of the candlestick in milliseconds since epoch.
  startTime: integer
  // The end time of the candlestick in milliseconds since epoch.
  endTime: integer
  // The interval of the candlestick (e.g., 1m, 5m, 1h).
  interval: string
  // The opening price of the candlestick.
  openPriceE9: string
  // The closing price of the candlestick.
  closePriceE9: string
  // The highest price during the candlestick interval.
  highPriceE9: string
  // The lowest price during the candlestick interval.
  lowPriceE9: string
  // The total trading volume during the candlestick interval.
  volumeE9: string
  // The total quote volume traded during the candlestick interval.
  quoteVolumeE9: string
  // The number of trades that occurred during the candlestick interval.
  numTrades: integer
}

OraclePriceUpdate

{
  // The symbol of the market.
  symbol: string
  // The price in scientific notation with 9 decimal places of precision.
  priceE9: string
  source: enum[Oracle]
  // The timestamp of the price update.
  updatedAtMillis: integer
}

MarketPriceUpdate

{
  // The symbol of the market.
  symbol: string
  // The price in scientific notation with 9 decimal places of precision.
  priceE9: string
  source: enum[Market]
  // The timestamp of the price update.
  updatedAtMillis: integer
}

MarkPriceUpdate

{
  // The symbol of the market.
  symbol: string
  // The price in scientific notation with 9 decimal places of precision.
  priceE9: string
  source: enum[Mark]
  // The timestamp of the price update.
  updatedAtMillis: integer
}

RecentTradesUpdates

{
  trades: {
    // Trade ID
    id: string
    // Client order ID.
    clientOrderId?: string
    // Market address.
    symbol?: string
    // Order hash.
    orderHash?: string
    // The type of order.
    orderType?: enum[LIMIT, MARKET, STOP_LIMIT, STOP_MARKET, LIQUIDATION, STOP_LOSS_MARKET, TAKE_PROFIT_MARKET, STOP_LOSS_LIMIT, TAKE_PROFIT_LIMIT, BANKRUPTCY_LIQUIDATION, UNSPECIFIED]
    // Type of trade.
    tradeType?: enum[ORDER, LIQUIDATION, DELEVERAGE, UNSPECIFIED]
    // Trade side based on the user order in this trade.
    side: enum[LONG, SHORT, UNSPECIFIED]
    // Indicates if the user was a maker to the trade.
    isMaker?: boolean
    // Trade price (e9 format).
    priceE9: string
    // Trade quantity (e9 format).
    quantityE9: string
    // Quote quantity (e9 format).
    quoteQuantityE9: string
    // Realized profit and loss (e9 format).
    realizedPnlE9?: string
    // The side of the position, either long or short
    positionSide?: enum[LONG, SHORT, UNSPECIFIED]
    // Trading fee (e9 format).
    tradingFeeE9?: string
    // Asset used for trading fee.
    tradingFeeAsset?: string
    // Gas fee.
    gasFeeE9?: string
    // Asset used for gas fee.
    gasFeeAsset?: string
    // Trade timestamp in milliseconds since Unix epoch.
    executedAtMillis: integer
  }[]
}

OrderbookDiffDepthUpdate

{
  // The timestamp of the orderbook update.
  updatedAtMillis: integer
  // The symbol of the market for the orderbook update.
  symbol: string
  bidsE9?: string[][]
  asksE9?: string[][]
  // The ID of the first update in this batch.
  firstUpdateId: integer
  // The ID of the last update in this batch.
  lastUpdateId: integer
}

OrderbookPartialDepthUpdate

{
  // The timestamp of the partial depth update.
  updatedAtMillis: integer
  // The symbol of the market for the partial depth update.
  symbol: string
  bidsE9?: string[][]
  asksE9?: string[][]
  // The unique identifier for the orderbook update.
  orderbookUpdateId: integer
  // The depth level of the orderbook snapshot.
  depthLevel: enum[5, 10, 20]
}

TradingFees

{
  // The Account Maker Fee (e9 format).
  makerFeeE9: string
  // The Account Taker Fee (e9 format).
  takerFeeE9: string
  // Are the fees applied on the account?
  isApplied: boolean
}

Asset

// Details about an asset in the account.
{
  // The symbol of the asset.
  symbol: string
  // The quantity of the asset.
  quantityE9: string
  // The effective balance of the asset.
  effectiveBalanceE9: string
  // The maximum quantity that can be withdrawn.
  maxWithdrawQuantityE9: string
  // The timestamp of the last update in milliseconds.
  updatedAtMillis: integer
}

OrderType

{
  "type": "string",
  "description": "The type of order.",
  "enum": [
    "LIMIT",
    "MARKET",
    "STOP_LIMIT",
    "STOP_MARKET",
    "LIQUIDATION",
    "STOP_LOSS_MARKET",
    "TAKE_PROFIT_MARKET",
    "STOP_LOSS_LIMIT",
    "TAKE_PROFIT_LIMIT",
    "BANKRUPTCY_LIQUIDATION",
    "UNSPECIFIED"
  ]
}

TradeType

{
  "type": "string",
  "description": "Type of trade.",
  "enum": [
    "ORDER",
    "LIQUIDATION",
    "DELEVERAGE",
    "UNSPECIFIED"
  ]
}

TradeSide

{
  "type": "string",
  "description": "Trade side based on the user order in this trade.",
  "enum": [
    "LONG",
    "SHORT",
    "UNSPECIFIED"
  ]
}

PositionSide

{
  "type": "string",
  "description": "The side of the position, either long or short",
  "enum": [
    "LONG",
    "SHORT",
    "UNSPECIFIED"
  ]
}

Trade

{
  // Trade ID
  id: string
  // Client order ID.
  clientOrderId?: string
  // Market address.
  symbol?: string
  // Order hash.
  orderHash?: string
  // The type of order.
  orderType?: enum[LIMIT, MARKET, STOP_LIMIT, STOP_MARKET, LIQUIDATION, STOP_LOSS_MARKET, TAKE_PROFIT_MARKET, STOP_LOSS_LIMIT, TAKE_PROFIT_LIMIT, BANKRUPTCY_LIQUIDATION, UNSPECIFIED]
  // Type of trade.
  tradeType?: enum[ORDER, LIQUIDATION, DELEVERAGE, UNSPECIFIED]
  // Trade side based on the user order in this trade.
  side: enum[LONG, SHORT, UNSPECIFIED]
  // Indicates if the user was a maker to the trade.
  isMaker?: boolean
  // Trade price (e9 format).
  priceE9: string
  // Trade quantity (e9 format).
  quantityE9: string
  // Quote quantity (e9 format).
  quoteQuantityE9: string
  // Realized profit and loss (e9 format).
  realizedPnlE9?: string
  // The side of the position, either long or short
  positionSide?: enum[LONG, SHORT, UNSPECIFIED]
  // Trading fee (e9 format).
  tradingFeeE9?: string
  // Asset used for trading fee.
  tradingFeeAsset?: string
  // Gas fee.
  gasFeeE9?: string
  // Asset used for gas fee.
  gasFeeAsset?: string
  // Trade timestamp in milliseconds since Unix epoch.
  executedAtMillis: integer
}

OrderTimeInForce

{
  "type": "string",
  "enum": [
    "GTT",
    "IOC",
    "FOK",
    "UNSPECIFIED"
  ],
  "default": "GTT",
  "description": "The time-in-force policy for the order. By default, all orders are GTT. UNSPECIFIED is set to default.\n\nGTT: Good Til Time\n\nIOC: Immediate Or Cancel\n\nFOK: Fill Or Kill    \n"
}

OrderStatus

{
  "type": "string",
  "description": "The current status of the order.",
  "enum": [
    "STANDBY",
    "OPEN",
    "PARTIALLY_FILLED_OPEN",
    "PARTIALLY_FILLED_CANCELED",
    "FILLED",
    "CANCELLED",
    "EXPIRED",
    "PARTIALLY_FILLED_EXPIRED",
    "UNSPECIFIED"
  ]
}

SelfTradePreventionType

{
  "type": "string",
  "enum": [
    "TAKER",
    "MAKER",
    "BOTH",
    "UNSPECIFIED"
  ],
  "default": "MAKER",
  "description": "The strategy used to resolve self trades. \n\nTAKER: On a self trade, the taker order will be cancelled\n\nMAKER: On a self trade, the maker order will be cancelled\n\nBOTH: On a self trade, both the taker and the maker order will be cancelled\n\nUNSPECIFIED: set to default value\n"
}

TransactionType

{
  "description": "Transaction type (what caused the change in the asset balance).",
  "type": "string",
  "enum": [
    "TRANSFER",
    "DEPOSIT",
    "WITHDRAW",
    "REALIZED_PNL",
    "FUNDING_FEE",
    "TRADING_FEE",
    "TRADING_GAS_FEE",
    "BONUS",
    "UNSPECIFIED"
  ]
}

# /components/securitySchemes/bearerAuth

{
  "type": "apiKey",
  "in": "header",
  "name": "Authorization",
  "description": "URL base64 encoded JWT token payload."
}