RPC notifications

RPC notifications are only available when using websockets. To receive notifications, use the subscribe endpoint.

trade_event

This notification can be subscribed to by subscribing to the 'trade' channel. It is sent whenever a trade takes place.

Contents

The result field contains a list of trades. Each trade consists of:

This notification reports a list of trades in its result field. Each field consists of:

name type example description
tradeId int 3 trade id
timeStamp int 1418152290669 The trade timestamp in ms
instrument string "BTC-22JAN16" name of the traded instrument
quantity int 61 quantity, in contracts (e.g. $10 per contract for BTC futures, BTC 1 — for BTC options etc)
amount number 10000 The amount as quantity in contract currency units
price int 415 float, USD for futures, BTC for options
state string "closed" order state
direction string "buy" direction of the taker's order
orderId int 10 order id (the taker's order)
matchingId int 6 id of matching order (the maker's order)
makerComm float 0.0001 The maker commission in BTC
takerComm float 0.0005 The taker commission in BTC
indexPrice 420.69 index price
label string user defined label for the order from side of the subscribed user.
me string "t" "t" - if the subscriber is taker, "m" - the subscriber is maker, "" - empty string if the trade is between other users (trade without subscriber's participation) can be used to quickly detect subscriber's trades between other user trades
tickDirection int 0 Direction of the "tick". Valid values: 0 = Plus Tick; 1 = Zero-Plus Tick; 2 = Minus Tick; 3 = Zero-Minus Tick

my_trade_event

my_trade_event is different from trade_event: (1) only subscriber's trades are reported and (2) the trade are reported from user's perspective, therefore - of a bit different format

This notification reports a list of trades in its result field. Each field consists of:

name type example description
tradeId string 3 trade id
timeStamp int 1418152290669 The trade timestamp in ms
instrument string "BTC-22JAN16" name of the traded instrument
quantity number 61 quantity, in contracts ($10 per contract for futures, ฿1 — for options)
amount number 5 The amount as a quantity in contract currency units
tradeSeq string 1 The trade sequence number, unique value for trade in given instrument.
price float 415 float, USD for futures, BTC for options
state string "closed" subscriber's order state
direction string "buy" direction of the order, from the the perspective of the end user
orderId int 10 order id, if the subscriber is taker
liquidity string "T" T - if subscriber is taker, M - if subscriber is maker
matchingId int 6 id of matching order, if the subscriber is maker
indexPrice float 420.69 index price
makerComm number 0 maker's commission, if the subscriber is maker
takerComm number 0.000001176 taker's commission, if the subscriber is taker
label string user defined label for the order from side of the subscribed user (up to 4 chars)
me string "t" "t" - if the subscriber is taker, "m" - the subscriber is maker, "" - empty string if the trade is between other users (trade without subscriber's participation) can be used to quickly detect subscriber's trades between other user trades
tickDirection int 0 Direction of the "tick". Valid values: 0 = Plus Tick; 1 = Zero-Plus Tick; 2 = Minus Tick; 3 = Zero-Minus Tick

order_book_event

Notifies about a change of order book for certain instrument.

This notification reports a list of order books in its result field. Each order book consists of:

name type example description
bids list (see below) The list of all bids, best bid first. See below for entry details
asks list (see below) The list of all asks, best ask first. See below for entry details
state string "open" The state of the order book. Possible values include "open" and "closed".
settlementPrice float 11013.37 The settlement price for this currency
instrument string "BTC-23FEB18" REQUIRED, The name of the instrument.
tstamp int 1517329113791 The order book timestamp in milliseconds
last float 10350 The price for the last trade
low float 10296.11 The 24H low for the instrument
high float 10916.03 The 24H high for the instrument
mark float 10334.06 The mark price for the instrument
uPx float 10408.16 (Only for option) underlying price used for ask/bid implied volatility
uIx float "BTC-30MAR18" (Only for option) underlying future instrument name or "index_price"
iR float 0 (Only for option) interest rate used for implied volatility calculations
markIv float 135 (Only for option) implied volatility for mark price
askIv float 130.06 (Only for option) implied volatility for best ask
bidIv float 109.99 (Only for option) implied volatility for best bid
max float (Only for futures) The maximum price for the future
min float (Only for futures) The minimum price for the future

The fields bids and asks are lists of order book price level entries, sorted from best to worst.

name type example description
quantity int 800 The total quantity of orders for this price level
amount number 8000 The amount in contract currency units for this price level
price float 10322.5 The price level
cm int 800 The cumulative quantity
cm_amount int 8000 The cumulative amount

user_order_event

Notifies about a change of user's orders. This event is triggered for all changes of the user orders, it doesn't depend on 'instrument' argument at subscription.

This notification reports a list of orders in its result field. Each order consists of:

name type example description
id int 1031 order identifier (for compatibility with older API version)
orderId int 1031 order identifier
type string "limit" order type, "limit", "market", "stop_limit","stop_market"
instrument string "BTC-22JAN16" instrument name
direction string "sell" direction of the order "buy" or "sell"
price float 426 price, units depend on the asset type
quantity int 10 quantity, in contracts ($10 per contract for futures, ฿1 — for options)
amount number 10000 The amount as quantity in contract currency units
filledQuantity int 10 filled quantity, in contracts
filledAmount number 100 The already filled amount in contract currency units
state string "open" order state "open", "cancelled", "filled"
avgPrice float 6591.2 average price
label string "" order label
created int 1453454229858 Timestamp (in ms) when the order was created
modified int 1453454229858 Timestamp (in ms) when the order was last changed
postOnly boolean true true for post-only orders only
reduceOnly boolean true true for reduce-only orders only
max_show number 1 Deprecated. Maximum quantity within an order to be shown to other customers, 0 for invisible order.
maxShow number 1 Maximum quantity within an order to be shown to other customers, 0 for invisible order.
maxShowAmount number 10 Maximum amount in contract currency units within an order to be shown to other customers, 0 for invisible order.

announcements

Notifies with titles of new announcements.

The result field contains a list of announcements. Each announcement has the following fields:

name type example description
title string "Example announcement" The title of the announcement
body string "An announcement" The HTML body of the announcement
important bool false Whether the announcement is marked as important
id int 19288317 A unique identifier for the announcement
date int 1527844253000 Timestamp in ms at which the announcement was published

index

This notification reports two index prices in the result field.

name type example description
btc float 11628.81 The current index price for BTC-USD
edp float 11628.81 Estimated delivery price for BTC-USD. For more details, see Documentation > General > Expiration Price

portfolio_event

Notifies the user of any changes that occur to his portfolio.

The result field will contain two entries: portfolio and positions.

The portfolio field contains a list of portfolio summaries for each of the currencies in your account. A portfolio summary consists of:

name type example description
currency string "BTC" Code of the currency
equity 0.481203297 The total net equity of that currency
maintenanceMargin 0.000064855 The amount of the currency needed to maintain the current positions.
initialMargin 0.000123813 The amount of the currency needed to open or increase positions
availableFunds 0.481079484 Total funds available (after reservations)
unrealizedPl 5.65e-7 Unrealized profit or loss. These funds will be added (or deducted) to your available funds at the next settlement.
realizedPl 0 Realized profit or loss
totalPl 0.0005624 Total profit or loss

The positions field consists of a list of positions. Each position consist of:

name type example description
instrument "BTC-30MAR18" name of the instrument
kind string "future" The type of instrument. "future" or "option"
size integer 5893 The position size in contracts. Can be negative (short) or positive (long)
amount float 58930 Position size-amount in contract currency units. Can be negative (short) or positive (long)
averagePrice float 9693.502194671 average price for the position
direction string "buy" The direction of the position. Can be "buy" (long) or "sell" (short)
sizeBtc float 7.14775214 Position size in BTC (only in case of BTC base currency)
sizeEth float 5.14775 Position size in ETH (only in case of ETH base currency)
floatingPl float -0.703874042 floating PnL
realizedPl float 0, realized PnL
estLiqPrice float 99999.99 Estimated liquidation price
markPrice float 8244.55 mark price
indexPrice float 8242.12 index price
maintenanceMargin float 0.214432564 maintenance margin
initialMargin float 0.357387607 initial margin
settlementPrice float 9145.26 The settlement price for the instrument
delta float 7.14775214 The position delta
openOrderMargin float 0 The margin used to back the position
profitLoss float -1.068422015 The PnL for the position

results matching ""

    No results matching ""