API Documentation

Version: 0.3.0 (2018-03-08)

Quedex provides a realtime asynchronous WebSocket API, which is divided into two parts: User Stream and Market Stream, which are described in detail below. User Stream enables sending of authenticated Commands on behalf of an account and receiving Events describing changes to an account. Market Stream enables receiving Events describing public trading data.

Open Source implementations

We provide implementations of the API in Java and Python. If you use one of these two languages we encourage you to use these implementations, as they hide most of the technical details. Please refer to the Github repositories linked above for the documentation; documentation on this page may still be useful, as it provides some general information and restrictions of the API.

There is also a simplistic, exemplary market making bot presenting how the Java API may be used.

Types

The whole API uses JSON as data serialization format. All the entities described below are JSON objects with the described fields. The following types are used throughout the API (other custom types are described in detail where they occur):

Type nameType description
Stringstandard JSON string
Decimalrepresents decimal value; always serialized to JSON string (events); accepted as JSON string or number (commands)
long64 bit precision signed integer; serialized to JSON string in all cases when it does not represent a timestamp, where JSON number is used (events); accepted as JSON string or number (commands)
int32 bit precision signed integer; serialized to JSON string in all cases; accepted as JSON string or number (commands)

Serialization of types Btc, long, int to JSON string in case of events and accepting JSON string in case of commands is motivated by compatibility with JavaScript (64 bit integers may not fit into JavaScript's number and JavaScript has no native representation of fixed precision numbers).

Important Notes

  • WebSocket endpoints for both streams close connections after 24 hours. You may freely reconnect in such case.

User Stream

To connect to the stream open a WebSocket connection to wss://api.quedex.net/user_stream. The stream enables sending authenticated Commands and receiving Events for an account. Each Command is accompanied by an Event which constitutes a response. Additionally, there is a number of asynchronous Events, which are emitted after subscribing (see subscribe Command).

Commands

Commands should be sent as text WebSocket messages, ASCII-armored PGP-signed and encrypted as defined by the PGP protocol (and implemented by e.g. GPG). The account's key should be used for signing - ASCII-armored key may be found in our web application - on the trading dashboard select the dropdown menu with your email address in the upper right corner and go to User Profile; they key is encrypted with your Session Password. Quedex's key with fingerprint 0C56 7B5B CE92 7242 05AD 9EC4 CEC2 D052 6BFA BE4F should be used for encryption (may be found e.g. on pgp.mit.edu). Whenever account_id is needed in a Command, it should be the id of your account - may be found in User Profile, similarly to the account's key.

Sending Commands is subject to the following limits:

  • max. 240 messages per minute with bursts (available after 30 seconds after connecting) of up to 20 messages may be sent (you have 20 "slots" for messages which will be processed instantly; the slots recover with 272 milliseconds delay); if message rate is exceeded backpressure will apply,
  • size of a single message must not exceed 1 MB,
  • a batch may not exceed 4 entries (if you need to send larger batches please contact us),
  • the maximum number of pending orders is 10000,
  • quantities of placed orders must not exceed 1000000,
  • prices of placed orders must not exceed 1000000.0,
  • an order cannot be placed, if an open position would exceed the quantity of 100000000.

Each command (apart from get_last_nonce) has a nonce field, which has to be a strictly increasing (per nonce_group) number. Please note that nonce_group equal to 0 is used in the webapplication, so if you want to be able to use the webapplication when your trading bot is running, you'll need to use a different nonce_group in the bot.

The following commands are available:

  • batch

    Sends a batch of place_order and cancel_order commands. Commands from the list will be run sequentially and no other command will interleave the execution. Errors in processing commands do not stop processing of the whole batch. Batching should be used whenever possible to minimise latency and maximise throughput.

    Command fields:

    NameTypeDescription
    typeStringalways equal to "batch"
    account_idlongid > 0 of the account
    batchOrderCommand[]nonempty list of objects containing place, cancel or modify order commands; the list must not contain more than 10 entries (if you need to send larger batches please contact us)
  • cancel_all_orders

    Cancels all orders placed by user. In case of success zero or more order_cancelled events are emitted, each for every cancelled order followed by single all_orders_cancelled event. In case of failure single cancel_all_orders_failed event is emitted. All responses have nonce the same as nonce of this command.

    Command fields:

    NameTypeDescription
    typeStringalways equal to "cancel_all_orders"
    noncelongstrictly increasing (per nonce group) number > 0
    nonce_groupintnumber between 0-9
    account_idlongid > 0 of the account
  • cancel_order

    Cancels a placed order. In response order_cancelled or order_cancel_failed event is sent.

    Command fields:

    NameTypeDescription
    typeStringalways equal to "cancel_order"
    noncelongstrictly increasing (per nonce group) number > 0
    nonce_groupintnumber between 0-9
    account_idlongid > 0 of the account
    client_order_idlongid > 0 of the order to cancel as specified in place order command
  • get_last_nonce

    Requests last nonce. In response last_nonce event is sent.

    Command fields:

    NameTypeDescription
    typeStringalways equal to "get_last_nonce"
    account_idlongid > 0 of the account
    nonce_groupintnumber between 0-9 for which last nonce is requested
  • internal_transfer

    Requests an internal transfer of BTC from the sender to user with given id. In response to this command, an internal_transfer_executed or internal_transfer_rejected event is sent. This functionality is disabled by default - please contact us, if you'd like to have it enabled.

    Command fields:

    NameTypeDescription
    typeStringalways equal to "internal_transfer"
    noncelongstrictly increasing (per nonce group) number > 0
    nonce_groupintnumber between 0-9
    account_idlongid > 0 of the sender account
    amountDecimalamount > of the internal transfer in BTC, has to be < account's free balance
    destination_account_idlongid > of the account to send funds to
  • modify_order

    Modifies price ond/or quantity of a placed order. In response order_modified or order_modification_failed event is sent.

    Command fields:

    NameTypeDescription
    typeStringalways equal to "modify_order"
    noncelongstrictly increasing (per nonce group) number > 0
    nonce_groupintnumber between 0-9
    account_idlongid > 0 of the account
    client_order_idlongid > 0 of the order, must be unique among all currently pending orders
    new_priceDecimalnew limit price of the order in USD for futures and BTC for options; may be absent or null if new quantity is specified
    new_quantityIntegernew initial quantity > 0 of the order, must be < 1000000; the filled quantity of the order will not be changed; may be absent or null if new price is specified
  • place_order

    Places new order. In response order_placed or order_place_failed event is sent. When the order is matched order_filled event is emitted (requires subscription). When the order is forcefully cancelled order_forcefully_cancelled event is emitted (requires subscription).

    Command fields:

    NameTypeDescription
    typeStringalways equal to "place_order"
    noncelongstrictly increasing (per nonce group) number > 0
    nonce_groupintnumber between 0-9
    account_idlongid > 0 of the account
    client_order_idlongid > 0 of the order, must be unique among all currently pending orders
    instrument_idintid > 0 of an instrument, must specify a valid tradable instrument
    order_typeOrderTypestring, currently always equal to "limit"
    limit_priceDecimallimit price of the order in USD for futures and BTC for options
    sideOrderSidestring, either "buy" or "sell"
    quantityintquantity > 0 of the order, must be < 1000000
  • subscribe

    Creates subscription on the user stream. In response to this command subscribed event is sent. Afterwards, events which require subscription will be sent, i.e.: account_state, deposit_confirmed, internal_transfer_received, socialised_losses, withdrawal_broadcast, withdrawal_cancelled, open_position, order_filled. An account may have up to 4 subscriptions at a time. A subscription is cancelled automatically when WebSocket connection is closed.

    Command fields:

    NameTypeDescription
    typeStringalways equal to "subscribe"
    noncelongstrictly increasing (per nonce group) number > 0
    nonce_groupintnumber between 0-9
    account_idlongid > 0 of the account
  • withdraw

    Requests a withdrawal of account funds. In response withdrawal_accepted or withdrawal_rejected event is sent.

    Command fields:

    NameTypeDescription
    typeStringalways equal to "withdraw"
    noncelongstrictly increasing (per nonce group) number > 0
    nonce_groupintnumber between 0-9
    account_idlongid > 0 of the account
    amountDecimalamount > 0.01 of the withdrawal in BTC, has to be < account's free balance
    btc_addressStringvalid BTC address the withdrawal should go to

Events

Events are received as text WebSocket messages. Each arrives as JSON with the following fields:

NameTypeDescription
typeStringone of "data", "error", "keepalive" (be prepared that new types may be added)
error_codeStringpresent if type is "error", specifies the error
dataStringpresent if type is "data"; contains ASCII-armored PGP-signed and encrypted message (signed using Quedex's key and encrypted using account's - for how to get the keys see section Commands above); the message is a JSON list of JSON objects, which may be one of the Events listed below

Keepalive messages are sent every 15 seconds. Lack of such message may indicate broken connection.

The following events are available (be prepared that new events not listed here may arrive):

  • account_state

    Emitted on changes to account state. All contained numeric values are in BTC.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "account_state"
    balanceDecimaltotal cash balance of the account in BTC
    free_balanceDecimalcash balance available for opening new positions in BTC
    total_initial_marginDecimaltotal initial margin of all positions and pending orders in BTC
    total_maintenance_marginDecimaltotal maintenance margin of all positions and pending orders in BTC
    total_locked_for_ordersDecimaltotal amount locked for order fees in BTC
    total_unsettled_pnlDecimaltotal unsettled PnL of the account in BTC
    total_pending_withdrawalDecimaltotal pending withdrawal of the account in BTC
    total_referrer_rebateDecimaltotal amount earned from referred users in BTC
    account_statusAccountStatusString status of the account, one of "active", "margin_call", "liquidation"
  • all_orders_cancelled

    Emitted in response to cancel_all_orders command.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "all_orders_cancelled"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
  • authentication_failed

    Emitted when authentication of a command failed.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "authentication_failed"
  • cancel_all_orders_failed

    Emitted in response to failed cancel_all_orders command.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "cancel_all_orders_failed"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
    causeCausestring, currently only one possible: "session_not_active"
  • deposit_confirmed

    Emitted when a BTC deposit is confirmed.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "deposit_confirmed"
    destination_addressBtcAddressdeposit BTC address of the account
    btc_amountDecimalamount of the deposit, in BTC
    btc_transaction_idStringtxid of the deposit transaction
    confirmationslongnumber of confirmations of the deposit transaction
  • internal_transfer_executed

    Emitted in response to internal_transfer command on successful transfer.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "internal_transfer_executed"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
    destination_account_idlongid of the account the funds were sent to
    amountDecimalamount of the internal transfer in BTC
  • internal_transfer_received

    Emitted when different account sends internal_transfer successful command with this account specified as destination.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "internal_transfer_received"
    source_account_idlongid of the account sending the internal transfer
    amountDecimalamount of the internal transfer received in BTC
  • internal_transfer_rejected

    Emitted in response to internal_transfer command on rejected transfer.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "internal_transfer_rejected"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
    causeCauseString cause of rejection, one of "insufficient_funds", "forbidden"
    destination_account_idlongid of the account the funds were sent to
    amountDecimalamount of the internal transfer in BTC
  • invalid_nonce

    Emitted after a command with an invalid nonce is received.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "invalid_nonce"
    message_nonceLongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
    last_nonceLonglast nonce of the account
  • last_nonce

    Emitted in response to get_last_nonce command.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "last_nonce"
    nonce_groupintnonce group of the command this event responds to
    last_noncelonglast nonce of the account
  • liquidation_order_cancelled

    Emitted by Quedex exchange when a liquidation order is cancelled.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "liquidation_order_cancelled"
    system_order_idlongsystem id of the cancelled order
    instrument_idintinstrument id this order is for
    sideOrderSidestring, either "buy" or "sell"
    order_typeOrderTypestring, aways equal to "market"
    initial_quantityintinitial quantity of the order
  • liquidation_order_filled

    Emitted when liquidation order is filled (a trade is made).

    Event fields:

    NameTypeDescription
    typeStringalways equal to "liquidation_order_filled"
    system_order_idlongsystem id of the order
    instrument_idintid of the instrument this order is for
    order_typeOrderTypestring, always equal to "market"
    order_sideOrderSidestring, either "buy" or "sell"
    order_initial_quantityintinitial quantity the order was created with
    leaves_order_quantityintcurrent unfilled quantity of the order
    trade_priceDecimalprice of the trade
    trade_quantityintquantity filled in this trade
    effective_feeDecimaleffective fee paid to the exchange
    taker_to_makerDecimalfee paid from the taker to maker of this trade
  • liquidation_order_placed

    Emitted when a liquidation order is placed by the exchange.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "liquidation_order_placed"
    system_order_idlongsystem id of the order
    instrument_idintid of the instrument this order is for
    order_typeOrderTypestring, always equal to "market"
    sideOrderSidestring, either "buy" or "sell"
    quantityintcurrent quantity of the order
    initial_quantityintinitial quantity of the order
  • open_position

    Emitted by Quedex exchange on each change to an open position.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "open_position"
    instrument_idintid of the instrument this position is for
    pnlDecimaltotal PnL of this position in BTC
    maintenance_marginDecimalmaintenance margin of this position in BTC
    initial_marginDecimalinitial margin of this position in BTC
    sidePositionSidestring, either "long" or "short"
    quantityintquantity > 0 of this position
    average_opening_priceDecimalaverage price this position has been opened at in BTC
  • order_cancel_failed

    Emitted in response to failed cancel_order command.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "order_cancel_failed"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
    client_order_idlongid of the order
    causeCausestring, one of "not_found", "session_not_active"
  • order_cancelled

    Emitted in response to a successful cancel_order command.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "order_cancelled"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
    client_order_idlongid of the order
    instrument_idintid of the instrument the order is for
    limit_priceDecimallimit price of the order
    sideOrderSidestring, either "buy" or "sell"
    order_typeOrderTypestring, always equal to "limit"
    initial_quantityintquantity the order was created with
  • order_filled

    Emitted when order is filled (a trade is made).

    Event fields:

    NameTypeDescription
    typeStringalways equal to "order_filled"
    client_order_idlongid of the order
    instrument_idintid of the instrument the order is for
    order_limit_priceDecimallimit price of the order
    order_typeOrderTypestring, always equal to "limit"
    order_sideOrderSidestring, either "buy" or "sell"
    order_initial_quantityintinitial quantity the order was created with
    leaves_order_quantityintcurrent unfilled quantity of the order
    trade_priceDecimalprice of the trade
    trade_quantityintquantity filled in this trade
    effective_feeDecimaleffective fee paid to the exchange
    taker_to_makerDecimalfee paid from the taker to maker of this trade
  • order_forcefully_cancelled

    Emitted when an order has been forcefully cancelled by the exchange.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "order_forcefully_cancelled"
    client_order_idlongid of the order
    instrument_idintid of the instrument the order was for
    limit_priceDecimallimit price of the order in BTC
    sideOrderSidestring, either "buy" or "sell"
    order_typeOrderTypestring, always equal to "limit"
    initial_quantityintinitial quantity the order has been placed with
    causeCausestring, either "liquidation" or "settlement"
  • order_modification_failed

    Emitted in response to a failed modify_order command.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "order_modification_failed"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
    client_order_idlongid of the order
    new_limit_priceDecimalprice of the order after modification
    new_initial_quantityintupdated initial quantity of the order
    causeCausestring, one of "invalid_order_id", "invalid_instrument_id", "session_not_active", "invalid_tick_size", "insufficient_funds", "margin_call", "not_found", "open_position_quantity_too_high"
  • order_modified

    Emitted in response to successful modify_order command.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "order_modified"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
    client_order_idlongid of the order
    instrument_idintid of the instrument the order is for
    new_limit_priceDecimalprice of the order after modification
    new_initial_quantityintupdated initial quantity of the order
    new_leaves_quantityintcurrent quantity of the order after the modification
    sideOrderSidestring, either "buy" or "sell"
    order_typeOrderTypestring, always equal to "limit"
  • order_place_failed

    Emitted in a response to failed place_order command.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "order_place_failed"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
    client_order_idlongid of the order
    instrument_idintid of the instrument the order was for
    order_typeOrderTypestring, always equal to "limit"
    limit_priceDecimallimit price of the order
    sideOrderSidestring, either "buy" or "sell"
    quantityintquantity of the order
    causeCausestring, one of "invalid_order_id", "invalid_instrument_id", "session_not_active", "invalid_tick_size", "insufficient_funds", "too_many_open_orders", "open_position_quantity_too_high"
  • order_placed

    Emitted in response to successful place_order command.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "order_placed"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
    client_order_idlongid of the order
    instrument_idintid of the instrument the order is for
    order_typeOrderTypestring, always equal to "limit"
    limit_priceDecimallimit price of the order
    sideOrderSidestring, either "buy" or "sell"
    quantityintquantity of the order
    initial_quantityintquantity of the order
  • subscribed

    Emitted in response to subscribe command. Immediately after this event is emitted, a "welcome pack" of events is sent, which will consist of order_placed event for each pending order, open_position event for each open position and an initial account_state. All the events emitted afterwards are guaranteed to modify this initial state.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "subscribed"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
  • withdrawal_accepted

    Emitted in response to a successful withdraw command.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "withdrawal_accepted"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
    destination_addressBtcAddressBTC address the withdrawal should go to
    btc_amountDecimalamount of the withdrawal in BTC
  • withdrawal_broadcast

    Emitted when a BTC withdrawal is broadcast to the network.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "withdrawal_broadcast"
    destination_addressBtcAddressBTC address the withdrawal goes to
    btc_amountDecimalamount of the withdrawal in BTC
  • withdrawal_cancelled

    Emitted when a BTC withdrawal is forcefully cancelled during liquidation.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "withdrawal_cancelled"
    destination_addressBtcAddressBTC address the withdrawal goes to
    btc_amountDecimalamount of the withdrawal in BTC
  • withdrawal_rejected

    Emitted in response to a rejected withdraw command.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "withdrawal_rejected"
    message_noncelongnonce of the command this event responds to
    message_nonce_groupintnonce group of the command this event responds to
    causeCauseString cause of rejection, one of "insufficient_funds", "amount_too_small", "too_many_pending_withdrawals"
    destination_addressBtcAddressvalid BTC address the withdrawal should go to
    btc_amountDecimalamount of the withdrawal in BTC

Market Stream

To connect to the stream open a WebSocket connection to wss://api.quedex.net/market_stream. The stream enables receiving asynchronous Events, which are described below. Once you connect to the stream a "welcome pack" will be sent, consisting of the following events: instrument_data, session_state and for each active instrument: last quotes, last order_book and last 10 trade events.

Events

Events are received as text WebSocket messages. Each arrives as JSON with the following fields:

NameTypeDescription
typeStringone of "data", "error", "keepalive" (be prepared that new types may be added)
error_codeStringpresent if type is "error", specifies the error
dataStringpresent if type is "data"; contains ACSII-armored PGP-clearsigned message (signed using Quedex's key - for how to get the key see section Commands in User Stream above); the message is a JSON object, which may be one of the Events listed below

Keepalive messages are sent every 15 seconds. Lack of such message may indicate broken connection.

The following events are available (be prepared that new events not listed here may arrive):

  • instrument_data

    Information about currently tradable instruments. Emitted when instruments expire or are issued.

    The objects describing instruments are as follows:

    inverse_futures

    Inverse futures contract definition.

    Instrument parameters:

    NameTypeDescription
    typeStringalways equal to "inverse_futures"
    symbolStringsymbol pattern is "F.BTCUSD.DDMMMYY", e.g. "F.BTCUSD.02FEB18"
    instrument_idintunique id of the instrument
    tick_sizeBtctick size of the instrument; price of all orders must be divisable by this number
    issue_datelongmillis from epoch pointing to the midnight of the issue day
    underlying_symbolStringcurrently always "USD"
    notional_amountlongthe amount of underlying the contact delivers
    expiration_datelongmillis from epoch pointing to the midnight of the expiration day
    settlement_methodSettlementMethodstring, currently always "financial"
    feeBtcbase fee fraction paid to the exchange by maker and taker from trade value
    taker_to_makerBtctaker to maker fee fraction paid from taker to maker from trade value
    initial_marginBtcfraction of the contracts value locked as initial margin
    maintenance_marginBtcfraction of the contract value locked as maintenance margin

    inverse_option

    Inverse Option instrument definition.

    Instrument parameters:

    NameTypeDescription
    typeStringalways equal to "inverse_option"
    symbolStringsymbol pattern is "O.BTCUSD.DDMMMYY:TXXXX", e.g. "F.BTCUSD.02FEB18:C7500" were T denotes option type and XXXX is the option strike
    instrument_idintunique id of the instrument
    tick_sizeBtctick size of the instrument; price of all orders must be divisable by this number
    issue_datelongmillis from epoch pointing to the midnight of the issue day
    underlying_symbolStringcurrently always "USD"
    notional_amountlongthe amount of underlying the contact delivers
    expiration_datelongmillis from epoch pointing to the midnight of the expiration day
    settlement_methodSettlementMethodstring, currently always "financial"
    option_typeOptionTypestring, either "call_european" or "put_european"
    strikeBtcstrike of the option in USD
    feeBtcbase fee fraction paid to the exchange by maker and taker
    taker_to_makerBtctaker to maker fee fraction paid from taker to maker
    initial_marginBtcfraction locked as initial margin
    maintenance_marginBtcfraction locked as maintenance margin

    Event fields:

    NameTypeDescription
    typeStringalways equal to "instrument_data"
    dataMapmap from int instrument id to object describing an instrument
  • order_book

    Snapshot of single instrument's order book.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "order_book"
    instrument_idintid of the instrument this order book is for
    bidsListlist of lists, where the internal lists are of size 2, the first element is Decimal price and the second element is integer quantity defining a level of an order book (max 100 levels)
    asksListlist of lists, where the internal lists are of size 2, the first element is Decimal price and the second element is integer quantity defining a level of an order book (max 100 levels)
  • quotes

    Snapshot of single instrument's quotes.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "quotes"
    instrument_idintid of the instrument these quotes are for
    lastDecimalprice of last trade
    last_quantityintquantity of last trade
    bidDecimalprice of the best buy level in the order book
    bid_quantityintsize of the best buy level in the order book
    askDecimalprice of the best sell level in the order book
    ask_quantityintsize of the best sell level in the order book
    volumeintcumulative volume on this instrument from the beginning of the current trading day (from opening auction)
    open_interestintcurrent open interest in this instrument
  • session_state

    Information about current state of trading session. Emitted when the state changes.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "session_state"
    stateGlobalSessionStatestring, new state of the session, one of "no_trading", "opening_auction", "continuous", "auction", "closing_auction"
    start_timestamplongmillis from epoch, start of the new session state
    scheduled_end_timestamplongmillis from epoch, scheduled end of the new session state
  • trade

    Emitted when a trade occurs.

    Event fields:

    NameTypeDescription
    typeStringalways equal to "trade"
    instrument_idintid of the instrument this trade is for
    trade_idlongunique id of the trade
    timestamplongmillis from epoch timestamp this trade happened at
    priceDecimalprice of the trade
    quantityintquantity of the trade
    liquidity_providerLiquidityProviderstring, specifies the maker side of a trade, one of "buyer", "seller", "auction", "reference", "settlement"