One Trading API
REST APIWebSocket API
REST APIWebSocket API
  1. Mark Price
  • Introduction
  • Authenticate
  • Subscribe
  • Ping / Pong
  • Trading
    • Introduction
    • Create Order
    • Cancel All Orders
    • Cancel Order by Client ID
    • Cancel Order by Order ID
    • Margin Update
    • Settlement
    • Funding Payment
    • Order Booked
    • Order Rejected
    • Order Closed
    • Trade Executed
    • Order Fully Filled
    • Move Order
    • Balance Adjustment
  • Orderbook
    • Introduction
    • Orderbook Snapshot
    • Orderbook Update
  • Price Ticks
    • Introduction
    • Price Tick
  • Book Ticker
    • Introduction
    • Book Tick
  • Mark Price
    • Mark Price Update
    • Introduction
  • Account
    • Introduction
    • Exotic Order Registered
    • Exotic Order Updated
    • Exotic Order Activated
    • Exotic Order Triggered
    • Exotic Order Executed
    • Exotic Order Cancelled
  1. Mark Price

Introduction

The MARK_PRICE WebSocket channel sends the mark price of futures instruments every 5 seconds, as MARK_PRICE_UPDATE messages.
Note
Only futures instrument codes (e.g. BTC_USD_P) have a mark price. A spot instrument code is rejected.

Subscribe#

instrument_codes is optional on this channel. Leave it out to receive the mark price of every futures instrument:
{
    "type": "SUBSCRIBE",
    "channels": [
        {
            "name": "MARK_PRICE"
        }
    ]
}
Or list the instruments you want:
{
    "type": "SUBSCRIBE",
    "channels": [
        {
            "name": "MARK_PRICE",
            "instrument_codes": [
                "BTC_USD_P",
                "ETH_USD_P"
            ]
        }
    ]
}

Subscription Confirmation#

instrument_codes is present only when you listed them.
{
    "type": "SUBSCRIPTIONS",
    "channels": [
        {
            "name": "MARK_PRICE",
            "instrument_codes": [
                "BTC_USD_P",
                "ETH_USD_P"
            ]
        }
    ],
    "time": 1762700000299000000
}
The current mark prices are sent straight after the confirmation. From then on, one message per instrument is sent every 5 seconds, on the clock (:00, :05, :10, …).

Changing the instruments#

A connection has one MARK_PRICE selection: every instrument, or a list. A new SUBSCRIBE replaces it, so you never receive a mark twice. UPDATE_SUBSCRIPTION does the same and answers with SUBSCRIPTION_UPDATED:
{
    "type": "UPDATE_SUBSCRIPTION",
    "channels": [
        {
            "name": "MARK_PRICE",
            "instrument_codes": [
                "SOL_USD_P"
            ]
        }
    ]
}
{
    "type": "SUBSCRIPTION_UPDATED",
    "channel_name": "MARK_PRICE"
}
A request that is rejected leaves the previous selection in place.

Errors#

{
    "channel_name": "MARK_PRICE",
    "error": "INVALID_INSTRUMENT_CODES",
    "invalid_instruments": [
        "BTC_USDT"
    ]
}
errorMeaning
INVALID_INSTRUMENT_CODES_LISTinstrument_codes was sent as an empty list. Leave the field out to receive every instrument.
INVALID_INSTRUMENT_CODESOne or more instrument codes are unknown, or are spot instruments. They are listed in invalid_instruments.
Previous
Mark Price Update
Next
Introduction
Built with