VERSION 2.4 (see Revision History)
1. Introduction
This chapter provides an overview of the concepts and structure of PowerTrade WebSocket API.
The WebSocket API is an advanced technology that makes it possible to open a two-way interactive communication session between a client and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply, so it enables richer client/service interactions.
Service | User guide | Message set | URI in Production | Is authentication required? |
---|---|---|---|---|
Market Data |
|
yes |
||
Market Data Demo |
|
no |
||
Order Management |
|
yes |
||
Position Data |
|
yes |
Service | URI in Sandbox |
---|---|
Market Data |
|
Market Data Demo |
|
Order Management |
|
Position Data |
|
A secure WebSocket connection must be made to most of the services in order to send requests and receive updates from the platform. for more details please see the Authentication chapter.
Access to the PowerTrade WebSocket API is structured around four core concepts: Sessions, Cycles, Streams and Channels. You can read more detail about these core concepts in the section Sessions, Channels, Streams and Cycles.
To summarise here though, a Session is started on a per connection basis when connection is established to one of the services above. As shown in chapter Session Control Protocol, the protocols follow a synchronous request/response pattern until a session established, at which point the API becomes asynchronous. These session-related messages are described in their corresponding reference sections: Session Protocol Requests, Session Protocol Responses.
A session will be maintained while two conditions are met: first, heartbeats are sent every 15 seconds during idle periods when no messages are sent by a client or a server, and second, the client does not explicitly log out or the session is terminated.
Cycles are specific intervals of time that are used to provide a logical separation of the trading session over time. They are continuous in that once a cycle ends, a new cycle starts. You can read more about this in the chapter Sessions, Channels, Streams and Cycles.
Channels represent a set of sequenced messages that correspond to the beginning and end of a cycle. Clients can receive numerous channel messages in a single session, since a client will often remain connected across many cycles.
Streams are used by the various services in the platform to update clients on the state of the service at any given point in time. A stream is a subset of application messages from a channel. Upon opening a session and successful authentication, the client can request the latest state of a service via a stream.
A stream is effectively a series of events that are broadcast over the channel associated with the service (Market Data, Order Management, Position Data etc.). These events describe changes of the state of the service over time. Each event in a stream is identified by a sequence number. The stream would normally start with a snapshot of the state of service at the beginning of the current cycle and a sequence of events that when put together with the “snapshot” would provide the full state of the service (or the objects that underlie the service).
2. Tradeable Products
In order to understand how tradeable products (or financial products/instruments as they are typically known) are managed by the PowerTrade platform, it is important to understand two foundational concepts: the Deliverable and the Tradeable Entity.
A Deliverable is essentially a financial product such as a specific Option contract (for example, a BTC call option expiring in March 2021 with a $20,000 strike price) or a Futures contract (such as an ETH perpetual). It is also used to capture currency instruments, including Fundable instruments, such as USDT, BTC and ETH. Each of these instruments are deliverables.
A Tradeable Entity is the exchange’s representation of something that can be traded and is expressed in terms of two deliverables: the deliverable you will use to price the deliverable that is being traded. We refer to the first deliverable as the "price" deliverable and the second deliverable as the "quantity" deliverable.
To understand this more clearly we can apply this description to a deliverable that is an option. If the option is a BTC "cash" settled in a currency, like USDT, and is therefore also priced in USDT, then we have two deliverables. The price deliverable is USDT and the option itself is the quantity deliverable. The tradeable entity then is the orderbook in the exchange that allows trading in that option, priced in USDT.
It is worth noting at this time that financial products are often quoted in different currencies such USDT, USD, GBP and so on. Tradeable Entities allows the exchange to offer trading in the same deliverable but priced in different currencies. That is, the quantity deliverable across multiple tradeable entities would be the same but the price deliverable would be different.
It should be noted that initially in Power-Trade all Derivative products (options and futures) will be priced and cash-settled in USDT. This will mean that the "settlement deliverable" for these deliverables will be USDT and that the "price deliverable" for any tradeable entities will also be USDT.
In summary then, this combination of Product + Pricing Currency, represented as a Order book is known as a Tradeable Entity. It is also worth noting that there is a one-to-many relationship between Deliverables and Tradeable Entities.
3. Monetary Values
In this section we explain how to handle inbound and outbound monetary values.
The key requirement for proper handling of monetary values is to ensure their precise handling without rounding. The challange here is that most general purpose CPUs don’t have native hardware decimal types for numbers with fractional parts. Instead binary-based floating point values available in their FPUs are widely used in programs for calculations. The floating point values have no fixed precision, hence the term "floating". This means that during calculations using such values, the precision of the resulting values changes dynamically, e.g. inputs may have 6 precise digits after the decimal point and output can be automatically rounded to 3 decimal places with a corresponding degradation in precision from 6 to 3 digits after decimal point.
Please note that all numerical values are being sent by PowerTrade’s platform as JSON strings.
To keep all monetary values precise, PowerTrade’s platform represents monetary values using simple integer-based notation with corresponding scaling defined by the number of decimals in fractional parts for each currency.
To be able to encode or decode monetary values, any client of the API should collect and store the Reference Data provided through the Market Data Service Protocol which will indicate the number of decimal places that should be assumed for scaling values in the given deliverable or tradeable entity. This is sent at the beginning of each cycle and updated as needed.
As an example consider that we have a tradeable entity described as follows:
{
"tradeable_entity": {
"tradeable_entity_id": "12345",
"symbol": "BTC-USDT 25-Dec-2020 C15000",
"price_deliverable_id":"2", // USDT
"price_decimal_places":"4",
"quantity_deliverable_id":"10", // Option: BTC-USDT 25-Dec-2020 C15000
"quantity_decimal_places":"1",
// ...
}
}
and we receive a message over the Market Data Service Protocol which has an integer price of "2345600"
and whose tradeable_entity_id field corresponds to the tradeable entity shown above, that is, "12345"
.
We know from looking up tradeable entity 12345
that the price of the tradeable entity is represented as the corresponding price_deliverable_id (which we know to be USDT if we look up deliverable_id 2
in our stored deliverables.
We also know that prices listed for this tradeable entity will have 4
decimal places assumed because the value for price_decimal_places is 4
. This means that for the number given of 2345600
, the actual price is 234.5600
.
To convert to and from the scaled integer representation you can use the following simple formulas:
scaled integer |
2345600 |
|
4 |
|
2345600 |
|
2345600 |
resulting exact value |
234.5600 |
original exact value |
234.56 |
|
4 |
|
234 |
|
56 → 5600 |
scaled integer |
= 2340000 + 5600 = 2345600 |
3.1. Tradeable Entity or Deliverable for Decimal Places?
In the example given we were interpreting data sent over the Market Data Service Protocol which provides market data, like trades and display order messages to allow you to build a view of the orderbooks currently active in the system. As such the messages will refer to the tradeable entities which they are providing information for. You can think of a tradeable entity as being another name for an "order book". This means that all prices and quantities listed in these messages will use the decimal places listed for the price and quantity in the corresponding tradeable entity.
However, if you receive a message that refers to a deliverable specifically then you should interpret numbers in that message based on the decimal places for the appropriate deliverable. For example you might receive a message like this over the Position Data Service Protocol:
{
"position":{
"timestamp":"<time in nanoseconds since epoch>",
"account_id":"456",
"product_deliverable_id":"4", // ETH
"position_kind":"cash",
"product_type":"balance",
"value":"10000000000", // 100.0 ETH
"position_deliverable_id":"4", // ETH
"anchor_price":"none",
"balance":"none",
"mark_price":"none",
"base_deliverable_id":"none",
"source_type":"deposit",
"source_id":"none"
}
}
This message has a value
of 10000000000
and the position_deliverable_id
is 4
which we look up and find to be ETH which in turn we learn has a decimal_places
field of 8
. The key point is that this message has numbers associated with it that refer to deliverables and so we look up the appropriate deliveralbe id to determine the number of decimal places to use when scaling the number.
To learn more about which deliverable ids to refer to for which fields and the rules around that you should refer to the appropriate section later in this documentation. In this case the Position Data Service Protocol.
For the example shown we use the formula above and see that we hold 10000000000 / pow( 10, 8 ) = 100.0
ETH.
4. Protocols
4.1. Protocols Overview
All API services listed in Table PowerTrade WebSocket API services are based on session control protocol, as described in details in section Session Control Protocol.
The session control protocol is essentially a synchronous protocol, because all its stages required to be passed by client in the predefined order with confirmation from server sent in form of corresponding responses. After a session becomes properly established, the communication follows a service-specific protocol, essential for a particular service, e.g. for Market Data service the protocol is one-way (read-only, listen-only) where a client receives market data updates from a service as market changes happen. In case of Order Management service, the service-specific protocols is two-ways, so a client can control their orders by sending requests and receiving corresponding confirmation from a service in the form of responses.
Service | Protocols |
---|---|
Market Data Demo |
Session Control Protocol without authentication |
Market Data |
Session Control Protocol with authentication |
Order Management |
Session Control Protocol with authentication |
Position Data |
Session Control Protocol with authentication |
4.2. Authentication
PowerTrade requires clients to use API keys in order to access the APIs.
There are two components to an API key: the key itself and an API secret_key
. Both are needed in order to authenticate and use API services.
The secret_key
is used to sign session protocol messages sent to the platform’s backend during login.
The details about signing procedure can be found below.
4.2.1. Obtaining API keys and secrets
API keys can be obtained here <link>.
4.2.2. Generating credentials_secret
To initiate a session after establishing a WSS connection to a service, users must send a login message to the backend using their email as the credentials
and a generated credentials_secret
.
The credentials_secret
is a specially constructed JSON Web Token (JWT) that is signed using the user’s API secret_key
. The following JWT claims are required in order to submit a valid credentials_secret
:
-
client
- Set toapi
. -
uri
- The production endpoint of the requested service. -
nonce
- Monotonically increasing integer number. Usually, a timestamp can be used. -
iat
- The Unix time at which the JWT was issued, in seconds. -
exp
- The expiration Unix time on and after which the JWT must not be accepted for processing, in seconds. Must be less than iat+30sec. -
sub
- The API Key.
The JWT should be signed with the API secret_key
using the ES256 (elliptic curves using sha256) algorithm.
Examples
To go through the next few code samples, export the following environment variables in your shell.
# Replace with your api_key
export API_KEY="8557379d6d62080a1169740f183f16bf"
# Replace with your secret_key
export PEM_SECRET_KEY="-----BEGIN EC PRIVATE KEY-----\nMHcCAQEEILwnCHltSNt5BT+oB2C/I/YjI6OObYMaGLw0cTtOVHsroAoGCCqGSM49\nAwEHoUQDQgAELzRQAq3U6JtDa7hLHTzX+tzlJurj1v2hcrHSdk4X3hzHQYJu1DB6\n/gnZqe5mv3KS/HGvGCCyL1WFAz1S7VJ9uw==\n-----END EC PRIVATE KEY-----\n"
TODO: place c++ code here
import os
import time
import jwt # Using PyJWT to generate JWT's - `pip install pyjwt`
def generate_credential_secret(api_key, pem_secret_key):
now = int(time.time())
payload = {
"client": "api",
"uri": "", # TODO - fill in with example production url
"nonce": now,
"iat": now,
"exp": now + 30,
"sub": api_key
}
try:
return jwt.encode(payload, pem_secret_key, algorithm="ES256")
except jwt.exceptions.PyJWTError as err:
print("Error: {}".format(err))
exit(0)
if __name__ == '__main__':
API_KEY = os.getenv("API_KEY")
PEM_SECRET_KEY = os.getenv("PEM_SECRET_KEY")
print(generate_credential_secret(API_KEY, PEM_SECRET_KEY))
import (
"fmt"
"os"
"time"
// We recommend using the dgrijalva/jwt-go library for generating and validating JWTs
jwt "github.com/dgrijalva/jwt-go"
)
type ClientCredentialsClaim struct {
Uri string
Client string
Nonce int64
jwt.StandardClaims
}
func GenerateCredentialsSecret() string {
apiKey := os.Getenv("API_KEY")
secretKey := os.Getenv("PEM_SECRET_KEY")
now := time.Now()
claims := ClientCredentialsClaim{
Uri: "", // TODO - fill in with example production url
Client: "api",
Nonce: now.Unix(),
StandardClaims: jwt.StandardClaims{
ExpiresAt: now.UTC().Add(30 * time.Second).Unix(),
IssuedAt: now.Unix(),
Subject: apiKey,
},
}
token := jwt.NewWithClaims(jwt.SigningMethodES256, claims)
privateKey, err := jwt.ParseECPrivateKeyFromPEM([]byte(secretKey))
if err != nil {
panic(err)
}
credentialsSecret, err := token.SignedString(privateKey)
if err != nil {
panic(err)
}
return credentialsSecret
}
func main() {
fmt.Println(GenerateCredentialsSecret())
}
Example Ouput
eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnQiOiJhcGkiLCJub25jZSI6MTYxMTQwMjU0MSwiZXhwIjoxNjIwMDQyNTQxLCJpYXQiOjE2MTE0MDI1NDEsImlzcyI6InB0LXRlc3QuY2xlYXJwb29sLmRldjo0OTYyMSIsInN1YiI6Ijg1NTczNzlkNmQ2MjA4MGExMTY5NzQwZjE4M2YxNmJmIn0.oEjCgumgFfnYWw-otLW7vRAZ7p1KakMnDkmUz_LXWXKJlpZ3N7Ev6xeHSNEA9ZKJXwfHfEnvCAJbHWackjGSLA
4.3. Session Control Protocol
Data access to a particular service requires establishing a secure WebSocket connection and completing the Session protocol.
The details of related messages can be found in Session Protocol Requests, Session Protocol Responses.
4.4. Sessions, Channels, Streams and Cycles
As shown on Diagram of Session Control Protocol Sessions, Channels and Streams are closely related. When a new session begins, the platform notifies the client with a new channel ID. The client must use the new channel ID to request a new stream from the platform.
As described in earlier sections, streams are essentially a set of events. Each event represents an action and the resulting state change of objects of that service. Streams are associated with channels. In order for the client to start receiving a stream, the channel ID must be provided to the backend.
A cycle represents a logical division of time within a trading session, so a trading session may go through multiple cycles.
A cycle starts as soon as the previous one ends, e.g. as shown on the diagram of Market Data Protocol. Cycles currently last one hour in the production platform.
In turn, a cycle also goes through three phases: "prolog", "real-time", "epilog".
-
prolog: begins after cycle_starting and ends by cycle_started;
-
real-time: begins after cycle_started and ends by cycle_ending;
-
epilog: begins after cycle_ending and ends by cycle_ended;
At prolog phase, a service sends to clients all essential information needed to prepare for the real-time phase.
At real-time phase, clients may begin processing real-time updates sent by the requested service.
At epilog phase, a service may send information about expiring items which life-time is bounded by the number of cycles etc.
4.5. Reference Data
The reference data is a key information disseminated by Market Data Service during each cycle as it provides the descriptors of all products currently available for trading in the current cycle of the exchange (about exchange cycles please read in Introduction and Sessions, Channels, Streams and Cycles).
API clients should keep reference data available for usage in all API Services and, for example, to encode/decode all monetary values (as explained in Monetary Values).
Name | Description |
---|---|
Reference data for a single spot deliverable. |
|
Reference data for a single future deliverable. |
|
Reference data for a single option deliverable. |
|
Reference data for an exchange token deliverable. |
|
Reference data for a stable token deliverable. |
|
Reference data for a fiat currency deliverable. |
|
Reference data for an aliased deliverable. |
|
Reference data for an exchange trading limit deliverable. |
|
Reference data for a perpetual future deliverable. |
|
Reference data for n index deliverable. |
|
Reference data for a tradeable entity that is traded using a simple, single market. |
|
Reference data for a tradeable entity that is traded using multiple markets. |
|
A trading rule that determines order and trade validation. |
4.6. Market Data
Market Data Service provides information essential for trading on PowerTrade exchange, including Reference Data.
As mentioned in Sessions, Channels, Streams and Cycles chapter, trading session goes through multiple cycles and, in turn, each cycle also goes through three phases: prolog, real-time, epilog.
It is important to understand how corresponding information "carries over" the state of all related items (orders, markets, products etc) between cycles.
At prolog phase, Market Data service sends to clients all essential information needed to prepare for participating in real-time part:
-
Reference data for existing deliverables and tradeable entities (e.g. deliverable, tradeable_entity);
-
The state of the tradeable entities at the beginning of the cycle (trading_state);
-
Restatement of display orders that were already open before the cycle started (display_order_added);
-
Top of book information if there are open orders (top_of_book).
At epilog phase, Market Data service may send information about deletions for orders that are expiring (display_order_deleted for orders who have reached the end of their time_in_force set to "good_for_cycles").
The corresponding message set can be found in Market Data Messages.
4.7. Order Management
This section explains how to enter orders and control their state.
The corresponding message sets can be found in Order Management Requests/Responses.
4.7.1. Dead Man’s Switch (Auto Cancel)
TBD
4.8. Order Book Handling
In this section we will examine how the market data messages display_order_added, display_order_deleted, display_order_executed, and display_order_updated are used to incrementally build and maintain an order book view for display.
4.8.1. Order Book Identification
An order book is identified by the combination of the tradeable_entity_id
and
market_id
fields. When processing the market data messages, use these fields
to determine which order book must be updated.
4.8.2. Displaying an Order Book
An order book may be viewed as market by order or market by price.
A market by order view shows the individual orders in the display. For example:
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
1 |
100 |
1300 |
1350 |
50 |
4 |
||
5 |
300 |
1300 |
1400 |
200 |
3 |
||
2 |
150 |
1200 |
A market by price view shows the aggregated quantity at each price level in the display. For example:
BUY |
SELL |
||||||
Lvl |
Orders |
AggQty |
Price |
Price |
AggQty |
Orders |
Lvl |
1 |
2 |
400 |
1300 |
1350 |
50 |
1 |
1 |
2 |
1 |
150 |
1200 |
1400 |
200 |
1 |
2 |
4.8.3. Sorting Orders in an Order Book
Orders in a market by order view are sorted in price-time priority.
The price
field of an order is the major sort key. Orders with a side
value
of buy
are sorted from highest (best) to lowest, and sell
orders are sorted
from lowest (best) to highest.
The display_order_id
is used as the minor sort key for orders at the same
price level. This value represents the time of an order relative to another,
with higher values representing newer orders.
4.8.4. Processing display_order_added
The display_order_added message is used to indicate that a new order should be added to the book.
Let us begin with an empty order book:
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
A display_order_added message arrives for a new buy
order with price 1300
and quantity 100
:
{
"display_order_added": {
"timestamp": "1600999860839906000",
"tradeable_entity_id": "2",
"market_id": "0",
"side": "buy",
"display_order_id": "1",
"display_price": "1300",
"display_quantity": "100"
}
}
After processing this message, the order book will look like this:
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
1 |
100 |
1300 |
We then receive another display_order_added message for a buy
order, this time with price 1200
and quantity 150
:
{
"display_order_added": {
"timestamp": "1601000073287232000",
"tradeable_entity_id": "2",
"market_id": "0",
"side": "buy",
"display_order_id": "2",
"display_price": "1200",
"display_quantity": "150"
}
}
This price is worse (lower) than the existing buy
order, so the new order is
added below it in the book:
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
1 |
100 |
1300 |
|||||
2 |
150 |
1200 |
Next we receive a display_order_added for a sell
order at price 1400
and quantity 200
:
{
"display_order_added": {
"timestamp": "1601000194942338000",
"tradeable_entity_id": "2",
"market_id": "0",
"side": "sell",
"display_order_id": "3",
"display_price": "1400",
"display_quantity": "200"
}
}
This order is inserted on the other side of the book:
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
1 |
100 |
1300 |
1400 |
200 |
3 |
||
2 |
150 |
1200 |
Another sell
order arrives, this time at price 1350
and quantity 50
.
{
"display_order_added": {
"timestamp": "1601000361968567000",
"tradeable_entity_id": "2",
"market_id": "0",
"side": "sell",
"display_order_id": "4",
"display_price": "1350",
"display_quantity": "50"
}
}
For sell orders, a lower price is better, so this new order will be inserted at the top of the sell side of the book:
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
1 |
100 |
1300 |
1350 |
50 |
4 |
||
2 |
150 |
1200 |
1400 |
200 |
3 |
Finally a buy
order arrives with price 1300
and quantity 300
:
{
"display_order_added": {
"timestamp": "1601000480132500000",
"tradeable_entity_id": "2",
"market_id": "0",
"side": "buy",
"display_order_id": "5",
"display_price": "1300",
"display_quantity": "300"
}
}
There is already an order at this price level. The new order 5
is inserted
below the existing order 1
because it is newer, as indicated by its having a
higher display_order_id
.
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
1 |
100 |
1300 |
1350 |
50 |
4 |
||
5 |
300 |
1300 |
1400 |
200 |
3 |
||
2 |
150 |
1200 |
With two orders at the same price level, we can now see how the market by
price view differs. It shows a single level for price 1300
containing two
orders and an aggregated quantity of 400
.
BUY |
SELL |
||||||
Lvl |
Orders |
AggQty |
Price |
Price |
AggQty |
Orders |
Lvl |
2 |
400 |
1300 |
1350 |
50 |
1 |
||
1 |
150 |
1200 |
1400 |
200 |
1 |
4.8.5. Processing display_order_deleted
The display_order_deleted message is used to remove an individual order from the book.
Let us continue with the order book that was constructed in the preceding section:
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
1 |
100 |
1300 |
1350 |
50 |
4 |
||
5 |
300 |
1300 |
1400 |
200 |
3 |
||
2 |
150 |
1200 |
A display_order_deleted message arrives for the existing sell
order 4
.
{
"display_order_deleted": {
"timestamp": "1601002113866061000",
"tradeable_entity_id": "2",
"market_id": "0",
"side": "sell",
"display_order_id": "4"
}
}
This order is removed, which leaves the book looking like this:
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
1 |
100 |
1300 |
1400 |
200 |
3 |
||
5 |
300 |
1300 |
|||||
2 |
150 |
1200 |
As this was the only sell
order at price 1350
, the corresponding level is
removed from the market by price view.
BUY |
SELL |
||||||
Lvl |
Orders |
AggQty |
Price |
Price |
AggQty |
Orders |
Lvl |
1 |
2 |
400 |
1300 |
1400 |
200 |
1 |
1 |
2 |
1 |
150 |
1200 |
4.8.6. Processing display_order_executed
The display_order_executed message indicates that an order executed some or all of its remaining quantity. If all remaining quantity executed, the order should be removed from the book.
Let us continue with the order book that was constructed in the preceding section:
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
1 |
100 |
1300 |
1400 |
200 |
3 |
||
5 |
300 |
1300 |
|||||
2 |
150 |
1200 |
A display_order_executed message arrives which shows that quantity 60
of
order 1
has executed.
{
"display_order_executed": {
"timestamp": "1601002482430470000",
"tradeable_entity_id": "2",
"market_id": "0",
"side": "buy",
"display_order_id": "1",
"executed_price": "1300",
"executed_quantity": "60",
"trade_id": "1"
}
}
Prior to this message, order 1
had remaining quantity of 100
on display. As
60
has now executed, this leaves us with a remaining quantity of 40
.
Consequently, the order remains open and is left in the book:
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
1 |
40 |
1300 |
1400 |
200 |
3 |
||
5 |
300 |
1300 |
|||||
2 |
150 |
1200 |
Another display_order_executed message arrives for order 1
, this time
showing that quantity 40
has executed.
{
"display_order_executed": {
"timestamp": "1601002572694660000",
"tradeable_entity_id": "2",
"market_id": "0",
"side": "buy",
"display_order_id": "1",
"executed_price": "1300",
"executed_quantity": "40",
"trade_id": "2"
}
}
This time order 1
started with a remaining quantity 40
, and this quantity
has fully executed. With no remaining quantity the order is removed from the
book:
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
5 |
300 |
1300 |
1400 |
200 |
3 |
||
2 |
150 |
1200 |
The market by price view now shows that there is a single buy
order at
price 1300
.
BUY |
SELL |
||||||
Lvl |
Orders |
AggQty |
Price |
Price |
AggQty |
Orders |
Lvl |
1 |
1 |
300 |
1300 |
1400 |
200 |
1 |
1 |
2 |
1 |
150 |
1200 |
4.8.7. Processing display_order_updated
A display_order_updated message is used to apply an update to an existing order in the book. This may require the orders in the book to be re-sorted.
Let us start with an orderbook as follows:
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
1 |
100 |
1300 |
1350 |
50 |
4 |
||
5 |
300 |
1300 |
1400 |
200 |
3 |
||
2 |
150 |
1200 |
A display_order_updated message arrives to update the details for order
1
. Following the update, it will be identified as order 9
.
{
"display_order_updated": {
"timestamp": "1601002492430970000",
"tradeable_entity_id": "2",
"market_id": "0",
"side": "buy",
"old_display_order_id": "1",
"new_display_order_id": "9",
"display_price": "1300",
"display_quantity": "120"
}
}
The existing entry for order 1
is removed and a new entry for order 9
is
inserted. There is another order at the price level, so the updated order 9
is inserted below the existing order 5
because it is newer, as indicated by
its having a higher display_order_id
.
BUY |
SELL |
||||||
Id |
Qty |
Price |
Price |
Qty |
Id |
||
5 |
300 |
1300 |
1350 |
50 |
4 |
||
9 |
120 |
1300 |
1400 |
200 |
3 |
||
2 |
150 |
1200 |
4.9. Position Data Handling
The corresponding message set can be found in Position Data Messages.
The position data is mainly provided in position message update and the most important fields of it listed below:
Name | Type | Description |
---|---|---|
|
A unique, exchange-assigned identifier for the product deliverable. |
|
|
Whether the position kind is cash, unrealised, exposure or margin. |
|
|
Whether the product_type is balance, option, future or spot. |
|
|
Value of the position. |
|
|
A unique, exchange-assigned identifier for the position deliverable. |
The value of a position is the main field that you care about.
The tuple of:
-
product_deliverable_id, position_kind, product_type
identifies the position.
The position_deliverable_id tells you what the value is in. The number of decimal places that value uses will be determined by the decimal_places of the position_deliveralbe_id.
4.9.1. Primary Exchange Currency
In addition to supporting positions in different combinations of deliverables the exchange also provides an overview position in primary (or default) currency of the exchange: USDT. This means any positions that are not valued in USDT will have a USDT equivalent position calculated for it.
4.9.2. Different Kinds of Position Message
The position kind tells you how to interpret the value of the position and how it should be treated from an accounting perspective, that is, which “bucket” does it fall into. This allows us to form an overall view of positions.
-
cash - this position represents deliverables that you hold, what you deposited and what you expect to be able to withdraw, assuming a withdrawal would not put your account at risk of default;
-
margin - this represents your margin obligations;
-
unrealised - this represents your potential earnings or losses;
-
realised - this represents the positions that are realised but not yet fully settled;
-
payoff - this represents the potential payoff of any option-like positions that are currently unrealised. This is provided as an alternative view of the potential value of the options that you hold.
To understand your available BTC position you would consider all “balance” (see below) positions for BTC and perform the sum:
-
available = cash + realised + unrealised - margin
To understand your t overview position in USDT you would consider all “overview” (see below) positions for USDT and perform the sum same sum as above:
-
available = cash + realised + unrealised - margin
4.9.3. Different Product Types
Positions can also be defined by their product type. This in essence tells you why the position is there and how it should be interpreted.
-
reference_balance - the position represents an overview position of the primary currency of the exchange;
-
balance - the position represents a balance that is held because of a deposit, withdrawal, trade or settlement;
-
spot - the position represents an unrealised position as the result of a trade or mark price change;
-
future - the position represents an unrealised or margin position that resulted from a trade or mark price change;
-
option - the position represents an unrealised or margin position that resulted from a trade or mark price change.
4.9.4. Allowable Combinations of Position Kind and Product Type
Not all combinations of position kind and product type make sense, or are allowed. The following table shows the allowed combinations:
position_kind | reference_balance | balance | spot | future | option |
---|---|---|---|---|---|
cash |
OK |
OK |
|||
realised |
OK |
OK |
OK |
OK |
OK |
unrealised |
OK |
OK |
OK |
OK |
|
margin |
OK |
OK |
OK |
OK |
|
payoff |
OK |
4.9.5. Summary of Positions
For the primary exchange deliverable, USDT, you will see the following positions:
-
cash-reference_balance — this position tells you how much USDT you hold as deposited “cash” or realised “cash”.
-
realised-reference_balance — this position tells you overall how much USDT you have in all realised positions that have yet to be settled to your cash positions.
-
unrealised-reference_balance — this position tells you overall how much USDT you have in all unrealised positions you hold.
-
margin-reference_balance — this position tells you overall how much USDT you have set aside as margin for all unrealised positions you currently hold.
For base deliverables like USDT, BTC and ETH you will see the following positions:
-
cash-balance — this position tells you how much of [USDT, ETH or BTC] you hold as deposited “cash” or realised “cash”.
-
realised-balance — this position tells you overall how much [USDT, ETH or BTC] you have in all realised positions that have yet to be settled to your cash positions.
-
unrealised-balance — this position tells you overall how much [USDT, ETH or BTC] you have in all unrealised positions you hold.
-
margin-balance — this position tells you overall how much [USDT, ETH or BTC] you have set aside as margin for all unrealised positions you currently hold.
For future deliverables like BTC_USDT-10DEC20 you will see the following associated positions:
-
margin-future — this position tells you how much margin you are maintaining for the given future.
-
realised-future — this position tells you how much money you have realised while trading (or holding expired) futures which has not yet settled to your cash position.
-
unrealised-future — this position tells you how much money you are making or losing because you hold a position in the future.
For option deliverables like BTC_USDT-10DEC20-10000C you will see the following associated positions:
-
margin-option — this position tells you how much margin you are maintaining for the given option.
-
realised-option — this position tells you how much money you have realised while trading (or holding expired) option which has not yet settled to your cash position.
-
unrealised-option — this position tells you how much money you are making or losing because you hold a position in the option.
For spot deliverables like BTC_USDT you will see the following position:
-
realised-spot — this position tells you how much money you have realised while trading deliverables in spot markets which has not yet been settled to a cash position for the respective deliverable.
-
unrealised-spot — this position tells you how much money you are making or losing because you hold a position in the base deliverable. In this case by holding BTC you are making or losing USDT as the price of BTC moves.
position
{
utc_timestamp timestamp;
account_id account_id;
deliverable_id product_deliverable_id; // USDT’s deliverable_id
position_kind position_kind; // “cash”
product_type product_type; // “balance”
position_value value; // "10000"
deliverable_id position_deliverable_id; // USDT’s deliverable_id
price anchor_price; // “none”
position_balance balance; // “none”
price mark_price; // “none”
}
“Account A holds 10,000 USDT as Margin for 10 BTC 9000C Options based on a BTC_USDT spot price of 11,000 USDT”:
position
{
utc_timestamp timestamp;
account_id account_id;
deliverable_id product_deliverable_id; // Option’s deliverable_id
position_kind position_kind; // “margin”
product_type product_type; // “option”
position_value value; // "10000"
deliverable_id position_deliverable_id; // USDT’s deliverable_id
price anchor_price; // "11000"
position_balance balance; // "10"
price mark_price; // “none”
}
“Account A has potential value of 20,000 USDT in the future because they hold 10 BTC 9000C Options based on a BTC_USDT spot price of 11,000 USDT”:
position
{
utc_timestamp timestamp;
account_id account_id;
deliverable_id product_deliverable_id; // Option’s deliverable_id
position_kind position_kind; // “unrealised”
product_type product_type; // “option”
position_value value; // "20000"
deliverable_id position_deliverable_id; // USDT’s deliverable_id
price anchor_price; // "11000"
position_balance balance; // "10"
price mark_price; // “none”
}
“Account A has an OVERALL UNREALISED value of X USDt because they hold (many) positions valued in USDT” - In this case they are LOSING money:
position
{
utc_timestamp timestamp;
account_id account_id;
deliverable_id product_deliverable_id; // USDT’s deliverable_id
position_kind position_kind; // “unrealised”
product_type product_type; // “balance”
position_value value; // "-83242"
deliverable_id position_deliverable_id; // USDT’s deliverable_id
price anchor_price; // “none”
position_balance balance; // “none”
price mark_price; // “none”
}
“Account A has an OVERALL MARGIN commitment of X USDT because they hold margined positions valued in USDT”:
position
{
utc_timestamp timestamp;
account_id account_id;
deliverable_id product_deliverable_id; // USDT’s deliverable_id
position_kind position_kind; // “margin”
product_type product_type; // “balance”
position_value value; // "103242"
deliverable_id position_deliverable_id; // USDT’s deliverable_id
price anchor_price; // “none”
position_balance balance; // “none”
price mark_price; // “none”
}
5. Message Reference Book
5.1. Message Sets
This section describes the following message sets:
5.1.1. Market Data Messages
This message set includes the following messages:
Name | Description |
---|---|
Indicates a new cycle is starting. |
|
Indicates a new cycle has started. |
|
Indicates that the current cycle is ending soon. |
|
Indicates that the current cycle has ended. |
|
Reference data for a single spot deliverable. |
|
Reference data for a single future deliverable. |
|
Reference data for a single option deliverable. |
|
Reference data for an exchange token deliverable. |
|
Reference data for a stable token deliverable. |
|
Reference data for a fiat currency deliverable. |
|
Reference data for an exchange trading limit deliverable. |
|
Reference data for a perpetual future deliverable. |
|
Reference data for an index deliverable. |
|
Reference data for an aliased deliverable. |
|
Reference data for a tradeable entity that is traded using a simple, single market. |
|
Reference data for a tradeable entity that is traded using multiple markets. |
|
A trading rule that determines order and trade validation. |
|
Notification of an update to system time. |
|
Notification that a new display order was added. |
|
Notification that an existing display order was deleted. |
|
Notification that an existing display order executed. |
|
Notification that an existing display order was updated. |
|
Notification that a new multi-leg display order was added. |
|
Notification that an existing multi-leg display order was deleted. |
|
Notification that an existing multi-leg display order executed. |
|
Notification that an existing multi-leg display order was updated. |
|
Notification of a change in the best bid and offer. |
|
Notification that a new trade was generated. |
|
Notification of a reference price update. |
|
Notification of a settlement price update. |
|
Reflects the current state of trading in the tradeable entity and market. |
|
Notification of a funding rate update. |
5.1.2. Order Management Requests
This message set includes the following messages:
Name | Description |
---|---|
Cancels an order using the exchange-generated unique order ID. |
|
Cancels an order using the client-generated unique order token. |
|
Enters a new order. |
|
Enters a new order. |
|
Enters a new order. |
5.1.3. Order Management Responses
This message set includes the following messages:
Name | Description |
---|---|
Indicates a new cycle is starting. |
|
Indicates a new cycle has started. |
|
Indicates that the current cycle is ending soon. |
|
Indicates that the current cycle has ended. |
|
Notification that an existing order was cancelled. |
|
Notification that an existing order executed. |
|
Notification that an existing order was prevented from executing. |
|
Notification of an unsolicited change to an order’s state. |
|
Notification that a new order was entered. |
|
Notification that an order was restated. |
|
Notification that a new order was entered. |
|
Notification that an order was restated. |
|
Notification that a new order was entered. |
|
Notification that an order was restated. |
|
Notification that an order cancel was rejected. |
|
Notification that an order cancel was rejected. |
|
order_action_rejected<enter_order<simple_order<account_id>>> |
Notification that a new order was rejected. |
order_action_rejected<enter_order<multi_leg_order<account_id>>> |
Notification that a new order was rejected. |
Notification that a new order was rejected. |
5.1.4. Position Data Messages
This message set includes the following messages:
Name | Description |
---|---|
Indicates a new cycle is starting. |
|
Indicates a new cycle has started. |
|
Indicates that the current cycle is ending soon. |
|
Indicates that the current cycle has ended. |
|
Position data for a current position. |
|
Notification that the position messages are in a consistent state. |
|
Notification of the current net health score for an account’s current positions. |
|
Notification of the current net greeks values for an account’s current positions. |
|
Notification of the current risk values (E.g. the Greeks) for a single position. |
5.1.5. Session Protocol Requests
This message set includes the following messages:
Name | Description |
---|---|
Heartbeat message used to keep a session alive. |
|
Initiate user authentication. |
|
End user authentication. |
|
Request a new stream associated with a specified channel. |
5.1.6. Session Protocol Responses
This message set includes the following messages:
Name | Description |
---|---|
Heartbeat message used to keep a session alive. |
|
Notification that a login was accepted. |
|
Notification that a login was rejected. |
|
Notification that a new session was started. |
|
Notification that the current session was ended. |
|
Notification that a new channel was added to the session. |
|
Notification that a channel was removed from the session. |
|
Notification that a stream has started. |
|
Notification that a stream has ended. |
|
Notification that a stream has resumed. |
|
Notification that a stream request was rejected. |
|
Notification that a message was rejected. |
5.2. Messages
This section describes the following messages:
5.2.1. cancel_order
cancel_order
may refer to one of the following messages:
5.2.2. cancel_order<order_id>
Cancels an order using the exchange-generated unique order ID.
Requests cancellation of an order.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
object with a single field |
Identifies the order to be cancelled. |
|
Bytes |
A client-generated hash value that represents the client-side inputs to an order transaction. |
{
"cancel_order":{
"existing_order":{
"order_id":"1234567890"
},
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000"
}
}
5.2.3. cancel_order<order_token>
Cancels an order using the client-generated unique order token.
Requests cancellation of an order.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
object with a single field |
Identifies the order to be cancelled. |
|
Bytes |
A client-generated hash value that represents the client-side inputs to an order transaction. |
{
"cancel_order":{
"existing_order":{
"order_token":"12345678901234567890"
},
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000"
}
}
5.2.4. channel_added
Notification that a new channel was added to the session.
Generated whenever a channel is added to a session.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the channel was added to the session. |
|
|
The unique, server-assigned identifier for the channel. |
|
|
The next sequence number for the next message to be generated on the channel. |
|
|
The sequence number of the oldest message available on the channel. |
|
|
Identifies the channel’s default stream. |
{
"channel_added":{
"timestamp":"1618427227000000000",
"channel_id":"1",
"next_sequence_number":"12345",
"oldest_sequence_number":"12345",
"default_stream_id":"1"
}
}
5.2.5. channel_removed
Notification that a channel was removed from the session.
Generated whenever a channel is removed from a session.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the channel was removed from the session. |
|
|
The unique, server-assigned identifier for the channel. |
{
"channel_removed":{
"timestamp":"1618427227000000000",
"channel_id":"1"
}
}
5.2.6. cycle_ended
Indicates that the current cycle has ended.
Generated to indicate that the current cycle has ended.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
A timestamp that uniquely identifies the current cycle. |
|
|
A timestamp that uniquely identifies the next cycle, or 'none' if there will be no new cycle. |
{
"cycle_ended":{
"cycle_id":"1618427227000000000",
"next_cycle_id":"1618427827000000000"
}
}
5.2.7. cycle_ending
Indicates that the current cycle is ending soon.
Generated to indicate that the current cycle will be ending soon.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
A timestamp that uniquely identifies the current cycle. |
|
|
A timestamp that uniquely identifies the next cycle, or 'none' if there will be no new cycle. |
{
"cycle_ending":{
"cycle_id":"1618427227000000000",
"next_cycle_id":"1618427827000000000"
}
}
5.2.8. cycle_started
Indicates a new cycle has started.
Generated to indicate that a new cycle has started.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
A timestamp that uniquely identifies the current cycle. |
|
|
A timestamp that uniquely identifies the previous cycle, or 'none' if there was no preceding cycle. |
{
"cycle_started":{
"cycle_id":"1618427227000000000",
"previous_cycle_id":"1618426627000000000"
}
}
5.2.9. cycle_starting
Indicates a new cycle is starting.
Generated to indicate that a new cycle is starting.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
A timestamp that uniquely identifies the new cycle. |
|
|
A timestamp that uniquely identifies the previous cycle, or 'none' if there was no preceding cycle. |
{
"cycle_starting":{
"cycle_id":"1618427227000000000",
"previous_cycle_id":"1618426627000000000"
}
}
5.2.10. deliverable
deliverable
may refer to one of the following messages:
5.2.11. deliverable<aliased_deliverable>
Reference data for an aliased deliverable.
Contains reference data associated with a single deliverable.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The unique, exchange-assigned identifier for the deliverable. |
|
|
String |
A human-readable identifier for the deliverable. |
|
array of String |
A collection of tags used for classifying the deliverable. |
|
The number of decimal places used when expressing quantities and balances in terms of the deliverable. |
|
|
The listing status of the deliverable. |
|
|
object with a single field |
Contains additional details describing the deliverable. |
{
"deliverable":{
"deliverable_id":"6257",
"symbol":"Reference USD",
"tags":["usd_aliased_deliverable"],
"decimal_places":"2",
"listing_status":"active",
"details":{
"aliased_deliverable":{
"aliased_deliverable_id":"2"
}
}
}
}
5.2.12. deliverable<exchange_token>
Reference data for an exchange token deliverable.
Contains reference data associated with a single deliverable.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The unique, exchange-assigned identifier for the deliverable. |
|
|
String |
A human-readable identifier for the deliverable. |
|
array of String |
A collection of tags used for classifying the deliverable. |
|
The number of decimal places used when expressing quantities and balances in terms of the deliverable. |
|
|
The listing status of the deliverable. |
|
|
object with a single field |
Contains additional details describing the deliverable. |
{
"deliverable":{
"deliverable_id":"3",
"symbol":"BTC",
"tags":["fundable"],
"decimal_places":"8",
"listing_status":"active",
"details":{
"exchange_token":{
"common_name":"Bitcoin",
"ledger_name":"Bitcoin",
"ledger_address":"0x000000000000000000000000000000",
"minor_units":"0"
}
}
}
}
5.2.13. deliverable<exchange_trading_limit>
Reference data for an exchange trading limit deliverable.
Contains reference data associated with a single deliverable.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The unique, exchange-assigned identifier for the deliverable. |
|
|
String |
A human-readable identifier for the deliverable. |
|
array of String |
A collection of tags used for classifying the deliverable. |
|
The number of decimal places used when expressing quantities and balances in terms of the deliverable. |
|
|
The listing status of the deliverable. |
|
|
object with a single field |
Contains additional details describing the deliverable. |
{
"deliverable":{
"deliverable_id":"7",
"symbol":"BTC Buy Trading Limit",
"tags":[],
"decimal_places":"8",
"listing_status":"active",
"details":{
"exchange_trading_limit":{
"quote_deliverable_id":"3",
"side":"buy"
}
}
}
}
5.2.14. deliverable<fiat_currency>
Reference data for a fiat currency deliverable.
Contains reference data associated with a single deliverable.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The unique, exchange-assigned identifier for the deliverable. |
|
|
String |
A human-readable identifier for the deliverable. |
|
array of String |
A collection of tags used for classifying the deliverable. |
|
The number of decimal places used when expressing quantities and balances in terms of the deliverable. |
|
|
The listing status of the deliverable. |
|
|
object with a single field |
Contains additional details describing the deliverable. |
{
"deliverable":{
"deliverable_id":"2",
"symbol":"USD",
"tags":["reference_deliverable","fundable"],
"decimal_places":"10",
"listing_status":"active",
"details":{
"fiat_currency":{
"currency":"US Dollar",
"code":"USD",
"number":"840",
"minor_units":"2"
}
}
}
}
5.2.15. deliverable<future>
Reference data for a single future deliverable.
Contains reference data associated with a single deliverable.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The unique, exchange-assigned identifier for the deliverable. |
|
|
String |
A human-readable identifier for the deliverable. |
|
array of String |
A collection of tags used for classifying the deliverable. |
|
The number of decimal places used when expressing quantities and balances in terms of the deliverable. |
|
|
The listing status of the deliverable. |
|
|
object with a single field |
Contains additional details describing the deliverable. |
{
"deliverable":{
"deliverable_id":"23",
"symbol":"BTC-20210924",
"tags":["BTC","future","month"],
"decimal_places":"4",
"listing_status":"active",
"details":{
"future":{
"expiry":{
"datetime":{
"date":{
"year":"2021",
"month":"9",
"day":"24"
},
"time":{
"hours":"8",
"minutes":"0",
"seconds":"0",
"nanoseconds":"0"
}
},
"timezone":"UTC"
},
"delivery_style":"cash",
"underlying_deliverable_id":"3",
"contract_size_deliverable_id":"3",
"contract_size":"100000000",
"settlement_deliverable_id":"2",
"utc_creation_time":"1615315440212884641",
"creation_source_id":"0",
"margin_spec_id":"2"
}
}
}
}
5.2.16. deliverable<fx_spot>
Reference data for a single spot deliverable.
Contains reference data associated with a single deliverable.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The unique, exchange-assigned identifier for the deliverable. |
|
|
String |
A human-readable identifier for the deliverable. |
|
array of String |
A collection of tags used for classifying the deliverable. |
|
The number of decimal places used when expressing quantities and balances in terms of the deliverable. |
|
|
The listing status of the deliverable. |
|
|
object with a single field |
Contains additional details describing the deliverable. |
{
"deliverable":{
"deliverable_id":"14",
"symbol":"BTC-USD",
"tags":["spot"],
"decimal_places":"8",
"listing_status":"active",
"details":{
"fx_spot":{
"base_deliverable_id":"3",
"quote_deliverable_id":"2",
"contract_size":"1"
}
}
}
}
5.2.17. deliverable<index>
Reference data for an index deliverable.
Contains reference data associated with a single deliverable.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The unique, exchange-assigned identifier for the deliverable. |
|
|
String |
A human-readable identifier for the deliverable. |
|
array of String |
A collection of tags used for classifying the deliverable. |
|
The number of decimal places used when expressing quantities and balances in terms of the deliverable. |
|
|
The listing status of the deliverable. |
|
|
object with a single field |
Contains additional details describing the deliverable. |
{
"deliverable":{
"deliverable_id":"14",
"symbol":"BTC-USD-INDEX",
"tags":["BTC","index"],
"decimal_places":"6",
"listing_status":"active",
"details":{
"index":{
"base_deliverable_id":"3",
"quote_deliverable_id":"2"
}
}
}
}
5.2.18. deliverable<option>
Reference data for a single option deliverable.
Contains reference data associated with a single deliverable.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The unique, exchange-assigned identifier for the deliverable. |
|
|
String |
A human-readable identifier for the deliverable. |
|
array of String |
A collection of tags used for classifying the deliverable. |
|
The number of decimal places used when expressing quantities and balances in terms of the deliverable. |
|
|
The listing status of the deliverable. |
|
|
object with a single field |
Contains additional details describing the deliverable. |
{
"deliverable":{
"deliverable_id":"92",
"symbol":"BTC-20210625-20000P",
"tags":["BTC","option","month"],
"decimal_places":"4",
"listing_status":"active",
"details":{
"option":{
"expiry":{
"datetime":{
"date":{
"year":"2021",
"month":"6",
"day":"25"
},
"time":{
"hours":"8",
"minutes":"0",
"seconds":"0",
"nanoseconds":"0"
}
},
"timezone":"UTC"
},
"strike_price":"20000000000",
"option_type":"put",
"exercise_style":"european",
"valuation_approach":"vanilla",
"delivery_style":"cash",
"underlying_deliverable_id":"3",
"contract_size_deliverable_id":"3",
"contract_size":"100000000",
"settlement_deliverable_id":"2",
"utc_creation_time":"1615315441357287486",
"creation_source_id":"0",
"margin_spec_id":"1",
"strikes_spec_id":"1"
}
}
}
}
5.2.19. deliverable<perpetual_future>
Reference data for a perpetual future deliverable.
Contains reference data associated with a single deliverable.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The unique, exchange-assigned identifier for the deliverable. |
|
|
String |
A human-readable identifier for the deliverable. |
|
array of String |
A collection of tags used for classifying the deliverable. |
|
The number of decimal places used when expressing quantities and balances in terms of the deliverable. |
|
|
The listing status of the deliverable. |
|
|
object with a single field |
Contains additional details describing the deliverable. |
{
"deliverable":{
"deliverable_id":"24",
"symbol":"BTC-USD-PERPETUAL",
"tags":["BTC","future","perpetual"],
"decimal_places":"4",
"listing_status":"active",
"details":{
"perpetual_future":{
"funding_period":{
"hours":"1",
"minutes":"0",
"seconds":"0",
"nanoseconds":"0"
},
"funding_reference_time":{
"datetime":{
"date":{
"year":"2021",
"month":"0",
"day":"0"
},
"time":{
"hours":"1",
"minutes":"0",
"seconds":"0",
"nanoseconds":"0"
}
},
"timezone":"UTC"
},
"funding_spec_id":"1",
"underlying_deliverable_id":"14",
"contract_size_deliverable_id":"3",
"contract_size":"100000000",
"settlement_deliverable_id":"2",
"utc_creation_time":"1615315440215106227",
"creation_source_id":"0",
"margin_spec_id":"3"
}
}
}
}
5.2.20. deliverable<stable_token>
Reference data for a stable token deliverable.
Contains reference data associated with a single deliverable.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The unique, exchange-assigned identifier for the deliverable. |
|
|
String |
A human-readable identifier for the deliverable. |
|
array of String |
A collection of tags used for classifying the deliverable. |
|
The number of decimal places used when expressing quantities and balances in terms of the deliverable. |
|
|
The listing status of the deliverable. |
|
|
object with a single field |
Contains additional details describing the deliverable. |
{
"deliverable":{
"deliverable_id":"2",
"symbol":"USDT",
"tags":["reference_deliverable", "fundable"],
"decimal_places":"6",
"listing_status":"active",
"details":{
"stable_token":{
"common_name":"USDt ERC20 Token",
"ledger_name":"Ethereum",
"ledger_address":"0x000000000000000000000000000000",
"minor_units":"6",
"stabilisation_approach":"fiat_backed",
"backing_deliverable_id":"123"
}
}
}
}
5.2.21. display_order_added
Notification that a new display order was added.
Represents the addition of a displayed order to the tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was added. |
|
|
A unique, exchange-assigned identifier for the tradeable entity. |
|
|
Identifies the target market for the order. |
|
|
Whether the order is a buy or sell. |
|
|
The unique, exchange-assigned identifier for the displayed order. |
|
|
The displayed price of the order. The number of decimal places is determined by the tradeable entity. |
|
|
The displayed quantity of the order. The number of decimal places is determined by the tradeable entity. |
{
"display_order_added":{
"timestamp":"1618427227000000000",
"tradeable_entity_id":"7777",
"market_id":"0",
"side":"buy",
"display_order_id":"777",
"display_price":"10000000000000",
"display_quantity":"10000000000"
}
}
5.2.22. display_order_deleted
Notification that an existing display order was deleted.
Represents the deletion of a displayed order from the tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was deleted. |
|
|
A unique, exchange-assigned identifier for the tradeable entity. |
|
|
Identifies the target market for the order. |
|
|
Whether the order is a buy or sell. |
|
|
The unique, exchange-assigned identifier for the displayed order. |
{
"display_order_deleted":{
"timestamp":"1618427227000000000",
"tradeable_entity_id":"7777",
"market_id":"0",
"side":"buy",
"display_order_id":"777"
}
}
5.2.23. display_order_executed
Notification that an existing display order executed.
Represents the addition of a displayed order to the tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was executed. |
|
|
A unique, exchange-assigned identifier for the tradeable entity. |
|
|
Identifies the target market for the order. |
|
|
Whether the order is a buy or sell. |
|
|
The unique, exchange-assigned identifier for the displayed order. |
|
|
The price of the trade. The number of decimal places is determined by the tradeable entity. |
|
|
The quantity of the trade. The number of decimal places is determined by the tradeable entity. |
|
|
The unique, exchange-assigned identifier for the trade. |
{
"display_order_executed":{
"timestamp":"1618427227000000000",
"tradeable_entity_id":"7777",
"market_id":"0",
"side":"buy",
"display_order_id":"777",
"executed_price":"10000000000000",
"executed_quantity":"10000000000",
"trade_id":"1234567"
}
}
5.2.24. display_order_updated
Notification that an existing display order was updated.
Represents the update of a displayed order in a tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was updated. |
|
|
A unique, exchange-assigned identifier for the tradeable entity. |
|
|
Identifies the target market for the order. |
|
|
Whether the order is a buy or sell. |
|
|
The current unique, exchange-assigned identifier for the displayed order. |
|
|
The new unique, exchange-assigned identifier for the displayed order. |
|
|
The displayed price of the order. The number of decimal places is determined by the tradeable entity. |
|
|
The displayed quantity of the order. The number of decimal places is determined by the tradeable entity. |
{
"display_order_updated":{
"timestamp":"1618427227000000000",
"tradeable_entity_id":"7777",
"market_id":"0",
"side":"buy",
"old_display_order_id":"777",
"new_display_order_id":"777",
"display_price":"10000000000000",
"display_quantity":"10000000000"
}
}
5.2.25. enter_order
enter_order
may refer to one of the following messages:
5.2.26. enter_order<full_order<account_id>>
Enters a new order.
Requests entry of a new order.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
A client-generated unique order identifier. |
|
|
Bytes |
A client-generated hash value that represents the client-side inputs to an order transaction. |
|
object with a single field |
New order attributes. |
{
"enter_order":{
"order_token":"123",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"new_order":{
"full_order":{
"tradeable_entity_id":"123",
"market_id":"123",
"side":"buy",
"time_in_force":"good_for_cycles",
"time_to_live":"123",
"quantity":"123",
"minimum_quantity":"123",
"price":"123",
"party_data":{
"account_id":"none"
},
"execution_instructions":[
"participate_do_not_initiate"
],
"trigger_instructions":{
"event_type":"partial_execution",
"tradeable_entity_id":"123",
"market_id":"123",
"price_type":"best_bid",
"price_direction":"up",
"price":"123"
}
}
}
}
}
5.2.27. enter_order<multi_leg_order<account_id>>
Enters a new order.
Requests entry of a new order.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
A client-generated unique order identifier. |
|
|
Bytes |
A client-generated hash value that represents the client-side inputs to an order transaction. |
|
object with a single field |
New order attributes. |
{
"enter_order":{
"order_token":"12345678901234567890",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"new_order":{
"multi_leg_order":{
"legs":[
{
"tradeable_entity_id":"7777",
"ratio":"123"
}
],
"market_id":"0",
"side":"buy",
"time_in_force":"good_for_cycles",
"time_to_live":"65535",
"quantity":"10000000000",
"minimum_quantity":"10000000000",
"price":"10000000000000",
"party_data":{
"account_id":"1234567890"
},
"execution_instructions":[
"participate_do_not_initiate"
]
}
}
}
}
5.2.28. enter_order<simple_order<account_id>>
Enters a new order.
Requests entry of a new order.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
A client-generated unique order identifier. |
|
|
Bytes |
A client-generated hash value that represents the client-side inputs to an order transaction. |
|
object with a single field |
New order attributes. |
{
"enter_order":{
"order_token":"12345678901234567890",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"new_order":{
"simple_order":{
"tradeable_entity_id":"7777",
"market_id":"0",
"side":"buy",
"time_in_force":"good_for_cycles",
"time_to_live":"65535",
"quantity":"10000000000",
"price":"10000000000000",
"party_data":{
"account_id":"1234567890"
}
}
}
}
}
5.2.29. funding_rate
Notification of a funding rate update.
Communicates an update to the funding rate for a specified tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the funding rate update was generated. |
|
|
A unique, exchange-assigned identifier for the tradeable entity associated with this funding rate. |
|
|
The time from when the funding rate applies. |
|
|
The rate as calculated in basis points. |
|
|
The mark price associated with the funding rate. |
|
|
The underlying price associated with the funding rate. |
{
"funding_rate":{
"timestamp":"1618427227000000000",
"tradeable_entity_id":"7777",
"applies_from":"1618427227000000000",
"rate":"100",
"mark_price":"10000000000000",
"underlying_price":"10000000000000"
}
}
5.2.30. heartbeat
Heartbeat message used to keep a session alive.
Keeps the session alive.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the heartbeat was generated. |
{
"heartbeat":{
"timestamp":"1618427227000000000"
}
}
5.2.31. login
Initiate user authentication.
Used to initiate user authentication.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
String |
Required credentials. |
|
String |
Required credentials or none. |
{
"login":{
"credentials":"powertrade-demo",
"credentials_secret":"demo-secret-key"
}
}
5.2.32. login_accepted
Notification that a login was accepted.
Generated in response to a successful login.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the login was accepted. |
{
"login_accepted":{
"timestamp":"1618427227000000000"
}
}
5.2.33. login_rejected
Notification that a login was rejected.
Generated in response to a failed login.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the login was rejected. |
{
"login_rejected":{
"timestamp":"1618427227000000000"
}
}
5.2.34. logout
End user authentication.
Used to request the end of an authenticated session.
This message contains no fields.
{
"logout":{
}
}
5.2.35. message_rejected
Notification that a message was rejected.
Sent to indicate that a message was rejected, e.g. due to an inability to decode the message.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the message was rejected. |
|
|
Bytes |
A hash of the rejected message, used to correlate the rejection with the original message. |
|
String |
Some text to indicate why the message was rejected. |
{
"message_rejected":{
"timestamp":"123",
"message_hash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"text":"A"
}
}
5.2.36. multi_leg_display_order_added
Notification that a new multi-leg display order was added.
Represents the addition of a displayed order to the tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was added. |
|
|
array of tradeable_entity_leg |
Identifies the target tradeable entities and leg ratios for the order. Contains at least two entries, in ascending order by tradeable_entity_id, with each tradeable entity appearing no more than once. The greatest common divisor of the absolute values of the leg ratios is one. The ratio of the first leg is always positive. |
|
Identifies the target market for the order. |
|
|
Whether the order is a buy or sell. |
|
|
The unique, exchange-assigned identifier for the displayed order. |
|
|
The displayed price of the order, with decimal places. The number of decimal places is the smallest price_decimal_places value for the tradeable entities in the legs. |
|
|
The displayed quantity of the order, with decimal places. The number of decimal places is the smallest quantity_decimal_places value for the tradeable entities in the legs. |
{
"multi_leg_display_order_added":{
"timestamp":"1618427227000000000",
"legs":[
{
"tradeable_entity_id":"7777",
"ratio":"123"
}
],
"market_id":"0",
"side":"buy",
"display_order_id":"777",
"display_price":"10000000000000",
"display_quantity":"10000000000"
}
}
5.2.37. multi_leg_display_order_deleted
Notification that an existing multi-leg display order was deleted.
Represents the addition of a displayed order to the tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was deleted. |
|
|
array of tradeable_entity_leg |
Identifies the target tradeable entities and leg ratios for the order. Contains at least two entries, in ascending order by tradeable_entity_id, with each tradeable entity appearing no more than once. The greatest common divisor of the absolute values of the leg ratios is one. The ratio of the first leg is always positive. |
|
Identifies the target market for the order. |
|
|
Whether the order is a buy or sell. |
|
|
The unique, exchange-assigned identifier for the displayed order. |
{
"multi_leg_display_order_deleted":{
"timestamp":"1618427227000000000",
"legs":[
{
"tradeable_entity_id":"7777",
"ratio":"123"
}
],
"market_id":"0",
"side":"buy",
"display_order_id":"777"
}
}
5.2.38. multi_leg_display_order_executed
Notification that an existing multi-leg display order executed.
Represents the addition of a displayed order to the tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was executed. |
|
|
array of tradeable_entity_leg |
Identifies the target tradeable entities and leg ratios for the order. Contains at least two entries, in ascending order by tradeable_entity_id, with each tradeable entity appearing no more than once. The greatest common divisor of the absolute values of the leg ratios is one. The ratio of the first leg is always positive. |
|
Identifies the target market for the order. |
|
|
Whether the order is a buy or sell. |
|
|
The unique, exchange-assigned identifier for the displayed order. |
|
|
The executed price of the order, with decimal places. The number of decimal places is the smallest price_decimal_places value for the tradeable entities in the legs. |
|
|
The executed quantity of the order, with decimal places. The number of decimal places is the smallest quantity_decimal_places value for the tradeable entities in the legs. |
{
"multi_leg_display_order_executed":{
"timestamp":"1618427227000000000",
"legs":[
{
"tradeable_entity_id":"7777",
"ratio":"123"
}
],
"market_id":"0",
"side":"buy",
"display_order_id":"777",
"executed_price":"10000000000000",
"executed_quantity":"10000000000"
}
}
5.2.39. multi_leg_display_order_updated
Notification that an existing multi-leg display order was updated.
Represents the addition of a displayed order to the tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was updated. |
|
|
array of tradeable_entity_leg |
Identifies the target tradeable entities and leg ratios for the order. Contains at least two entries, in ascending order by tradeable_entity_id, with each tradeable entity appearing no more than once. The greatest common divisor of the absolute values of the leg ratios is one. The ratio of the first leg is always positive. |
|
Identifies the target market for the order. |
|
|
Whether the order is a buy or sell. |
|
|
The current unique, exchange-assigned identifier for the displayed order. |
|
|
The new unique, exchange-assigned identifier for the displayed order. |
|
|
The displayed price of the order, with decimal places. The number of decimal places is the smallest price_decimal_places value for the tradeable entities in the legs. |
|
|
The displayed quantity of the order, with decimal places. The number of decimal places is the smallest quantity_decimal_places value for the tradeable entities in the legs. |
{
"multi_leg_display_order_updated":{
"timestamp":"1618427227000000000",
"legs":[
{
"tradeable_entity_id":"7777",
"ratio":"123"
}
],
"market_id":"0",
"side":"buy",
"old_display_order_id":"777",
"new_display_order_id":"777",
"display_price":"10000000000000",
"display_quantity":"10000000000"
}
}
5.2.40. order_action_rejected
order_action_rejected
may refer to one of the following messages:
5.2.41. order_action_rejected<cancel_order<order_id>>
Notification that an order cancel was rejected.
Generated as a response to indicate an action was rejected.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order action was rejected. |
|
|
object with a single field |
A copy of the order action that was rejected. |
|
The reason the order action was rejected. |
{
"order_action_rejected":{
"timestamp":"1618427227000000000",
"action":{
"cancel_order":{
"existing_order":{
"order_id":"1234567890"
},
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"reason":"invalid_tradeable_entity"
}
}
5.2.42. order_action_rejected<cancel_order<order_token>>
Notification that an order cancel was rejected.
Generated as a response to indicate an action was rejected.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order action was rejected. |
|
|
object with a single field |
A copy of the order action that was rejected. |
|
The reason the order action was rejected. |
{
"order_action_rejected":{
"timestamp":"1618427227000000000",
"action":{
"cancel_order":{
"existing_order":{
"order_token":"12345678901234567890"
},
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"reason":"invalid_tradeable_entity"
}
}
5.2.43. order_action_rejected<enter_order<full_order<account_id>>>
Notification that a new order was rejected.
Generated as a response to indicate an action was rejected.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order action was rejected. |
|
|
object with a single field |
A copy of the order action that was rejected. |
|
The reason the order action was rejected. |
{
"order_action_rejected":{
"timestamp":"1618427227000000000",
"action":{
"enter_order":{
"order_token":"123",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"new_order":{
"full_order":{
"tradeable_entity_id":"123",
"market_id":"123",
"side":"buy",
"time_in_force":"good_for_cycles",
"time_to_live":"123",
"quantity":"123",
"minimum_quantity":"123",
"price":"123",
"party_data":{
"account_id":"none"
},
"execution_instructions":[
"participate_do_not_initiate"
],
"trigger_instructions":{
"event_type":"partial_execution",
"tradeable_entity_id":"123",
"market_id":"123",
"price_type":"best_bid",
"price_direction":"up",
"price":"123"
}
}
}
}
},
"reason":"invalid_tradeable_entity"
}
}
5.2.44. order_action_rejected<enter_order<multi_leg_order<account_id>>>
Notification that a new order was rejected.
Generated as a response to indicate an action was rejected.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order action was rejected. |
|
|
object with a single field |
A copy of the order action that was rejected. |
|
The reason the order action was rejected. |
{
"order_action_rejected":{
"timestamp":"1618427227000000000",
"action":{
"enter_order":{
"order_token":"12345678901234567890",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"new_order":{
"multi_leg_order":{
"legs":[
{
"tradeable_entity_id":"7777",
"ratio":"123"
}
],
"market_id":"0",
"side":"buy",
"time_in_force":"good_for_cycles",
"time_to_live":"65535",
"quantity":"10000000000",
"minimum_quantity":"10000000000",
"price":"10000000000000",
"party_data":{
"account_id":"1234567890"
},
"execution_instructions":[
"participate_do_not_initiate"
]
}
}
}
},
"reason":"invalid_tradeable_entity"
}
}
5.2.45. order_action_rejected<enter_order<simple_order<account_id>>>
Notification that a new order was rejected.
Generated as a response to indicate an action was rejected.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order action was rejected. |
|
|
object with a single field |
A copy of the order action that was rejected. |
|
The reason the order action was rejected. |
{
"order_action_rejected":{
"timestamp":"1618427227000000000",
"action":{
"enter_order":{
"order_token":"12345678901234567890",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"new_order":{
"simple_order":{
"tradeable_entity_id":"7777",
"market_id":"0",
"side":"buy",
"time_in_force":"good_for_cycles",
"time_to_live":"65535",
"quantity":"10000000000",
"price":"10000000000000",
"party_data":{
"account_id":"1234567890"
}
}
}
}
},
"reason":"invalid_tradeable_entity"
}
}
5.2.46. order_cancelled
Notification that an existing order was cancelled.
Generated in response to cancel_order as well as other events that trigger order cancellation.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was cancelled. |
|
|
The unique, exchange-assigned identifier for the order. |
|
|
The unique, exchange-assigned identifier for the display order. |
|
|
The client-generated unique identifier for the order. |
|
|
Bytes |
The client-generated hash value that represents the client-side inputs to an order transaction. |
|
The reason the order was cancelled. |
{
"order_cancelled":{
"timestamp":"1618427227000000000",
"order_id":"1234567890",
"display_order_id":"777",
"order_token":"12345678901234567890",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"reason":"user_cancelled"
}
}
5.2.47. order_entered
order_entered
may refer to one of the following messages:
5.2.48. order_entered<full_order<account_id>>
Notification that a new order was entered.
Generated in response to enter_order to indicate that the order was successfully entered.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was entered. |
|
|
The unique, exchange-assigned identifier for the order. |
|
|
The unique, exchange-assigned identifier for the display order. |
|
|
The client-generated unique order identifier. |
|
|
Bytes |
The client-generated hash value that represents the client-side inputs to an order transaction. |
|
object with a single field |
The entered order attributes. |
|
Whether the order is live or dead. |
{
"order_entered":{
"timestamp":"1618427227000000000",
"order_id":"123",
"display_order_id":"123",
"order_token":"123",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"new_order":{
"full_order":{
"tradeable_entity_id":"123",
"market_id":"123",
"side":"buy",
"time_in_force":"good_for_cycles",
"time_to_live":"123",
"quantity":"123",
"minimum_quantity":"123",
"price":"123",
"party_data":{
"account_id":"none"
},
"execution_instructions":[
"participate_do_not_initiate"
],
"trigger_instructions":{
"event_type":"partial_execution",
"tradeable_entity_id":"123",
"market_id":"123",
"price_type":"best_bid",
"price_direction":"up",
"price":"123"
}
}
},
"order_state":"accepted"
}
}
5.2.49. order_entered<multi_leg_order<account_id>>
Notification that a new order was entered.
Generated in response to enter_order to indicate that the order was successfully entered.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was entered. |
|
|
The unique, exchange-assigned identifier for the order. |
|
|
The unique, exchange-assigned identifier for the display order. |
|
|
The client-generated unique order identifier. |
|
|
Bytes |
The client-generated hash value that represents the client-side inputs to an order transaction. |
|
object with a single field |
The entered order attributes. |
|
Whether the order is live or dead. |
{
"order_entered":{
"timestamp":"1618427227000000000",
"order_id":"1234567890",
"display_order_id":"777",
"order_token":"12345678901234567890",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"new_order":{
"multi_leg_order":{
"legs":[
{
"tradeable_entity_id":"7777",
"ratio":"123"
}
],
"market_id":"0",
"side":"buy",
"time_in_force":"good_for_cycles",
"time_to_live":"65535",
"quantity":"10000000000",
"minimum_quantity":"10000000000",
"price":"10000000000000",
"party_data":{
"account_id":"1234567890"
},
"execution_instructions":[
"participate_do_not_initiate"
]
}
},
"order_state":"accepted"
}
}
5.2.50. order_entered<simple_order<account_id>>
Notification that a new order was entered.
Generated in response to enter_order to indicate that the order was successfully entered.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was entered. |
|
|
The unique, exchange-assigned identifier for the order. |
|
|
The unique, exchange-assigned identifier for the display order. |
|
|
The client-generated unique order identifier. |
|
|
Bytes |
The client-generated hash value that represents the client-side inputs to an order transaction. |
|
object with a single field |
The entered order attributes. |
|
Whether the order is live or dead. |
{
"order_entered":{
"timestamp":"1618427227000000000",
"order_id":"1234567890",
"display_order_id":"777",
"order_token":"12345678901234567890",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"new_order":{
"simple_order":{
"tradeable_entity_id":"7777",
"market_id":"0",
"side":"buy",
"time_in_force":"good_for_cycles",
"time_to_live":"65535",
"quantity":"10000000000",
"price":"10000000000000",
"party_data":{
"account_id":"1234567890"
}
}
},
"order_state":"accepted"
}
}
5.2.51. order_executed
Notification that an existing order executed.
Generated to indicate that an order entered via enter_order has executed.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was executed. |
|
|
The unique, exchange-assigned identifier for the order. |
|
|
The unique, exchange-assigned identifier for the display order. |
|
|
The client-generated unique identifier for the order. |
|
|
The price of the trade. The number of decimal places is determined by the tradeable entity. |
|
|
The quantity of the trade. The number of decimal places is determined by the tradeable entity. |
|
|
The unique, exchange-assigned identifier for the counterparty display order. |
|
|
The unique, exchange-assigned identifier for the trade. |
|
|
Whether the order was responsible for adding or taking liquidity. |
{
"order_executed":{
"timestamp":"1618427227000000000",
"order_id":"1234567890",
"display_order_id":"777",
"order_token":"12345678901234567890",
"executed_price":"10000000000000",
"executed_quantity":"10000000000",
"counterparty_display_order_id":"777",
"trade_id":"1234567",
"liquidity_flag":"added"
}
}
5.2.52. order_execution_prevented
Notification that an existing order was prevented from executing.
Generated to indicate that an order execution that would have occurred was prevented.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was prevented from executing. |
|
|
The unique, exchange-assigned identifier for the order. |
|
|
The unique, exchange-assigned identifier for the display order. |
|
|
The client-generated unique identifier for the order. |
|
|
The price of the trade that was prevented. The number of decimal places is determined by the tradeable entity. |
|
|
The quantity of the trade that was prevented. The number of decimal places is determined by the tradeable entity. |
|
|
The quantity decremented from the order. The number of decimal places is determined by the tradeable entity. |
|
|
The unique, exchange-assigned identifier for the counterparty display order. |
|
|
Whether the order was responsible for adding or taking liquidity. |
|
|
The reason the order execution was prevented. |
{
"order_execution_prevented":{
"timestamp":"1618427227000000000",
"order_id":"1234567890",
"display_order_id":"777",
"order_token":"12345678901234567890",
"prevented_price":"10000000000000",
"prevented_quantity":"10000000000",
"decremented_quantity":"10000000000",
"counterparty_display_order_id":"777",
"liquidity_flag":"added",
"reason":"self_trade"
}
}
5.2.53. order_restated
order_restated
may refer to one of the following messages:
5.2.54. order_restated<full_order<account_id>>
Notification that an order was restated.
Generated to restate an open order to a client.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was restated. |
|
|
The unique, exchange-assigned identifier for the order. |
|
|
The unique, exchange-assigned identifier for the display order. |
|
|
The client-generated unique order identifier. |
|
|
Bytes |
The client-generated hash value that represents the client-side inputs to an order transaction. |
|
The time when the order was originally entered. |
|
|
object with a single field |
The original order attributes. |
|
The balance of the order that has not yet executed. |
|
|
Whether the order is live or dead. |
{
"order_restated":{
"timestamp":"1618427227000000000",
"order_id":"123",
"display_order_id":"123",
"order_token":"123",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"original_timestamp":"123",
"original_order":{
"full_order":{
"tradeable_entity_id":"123",
"market_id":"123",
"side":"buy",
"time_in_force":"good_for_cycles",
"time_to_live":"123",
"quantity":"123",
"minimum_quantity":"123",
"price":"123",
"party_data":{
"account_id":"none"
},
"execution_instructions":[
"participate_do_not_initiate"
],
"trigger_instructions":{
"event_type":"partial_execution",
"tradeable_entity_id":"123",
"market_id":"123",
"price_type":"best_bid",
"price_direction":"up",
"price":"123"
}
}
},
"balance":"123",
"order_state":"accepted"
}
}
5.2.55. order_restated<multi_leg_order<account_id>>
Notification that an order was restated.
Generated to restate an open order to a client.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was restated. |
|
|
The unique, exchange-assigned identifier for the order. |
|
|
The unique, exchange-assigned identifier for the display order. |
|
|
The client-generated unique order identifier. |
|
|
Bytes |
The client-generated hash value that represents the client-side inputs to an order transaction. |
|
The time when the order was originally entered. |
|
|
object with a single field |
The original order attributes. |
|
The balance of the order that has not yet executed. |
|
|
Whether the order is live or dead. |
{
"order_restated":{
"timestamp":"1618427227000000000",
"order_id":"1234567890",
"display_order_id":"777",
"order_token":"12345678901234567890",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"original_timestamp":"1618427227000000000",
"original_order":{
"multi_leg_order":{
"legs":[
{
"tradeable_entity_id":"7777",
"ratio":"123"
}
],
"market_id":"0",
"side":"buy",
"time_in_force":"good_for_cycles",
"time_to_live":"65535",
"quantity":"10000000000",
"minimum_quantity":"10000000000",
"price":"10000000000000",
"party_data":{
"account_id":"1234567890"
},
"execution_instructions":[
"participate_do_not_initiate"
]
}
},
"balance":"10000000000",
"order_state":"accepted"
}
}
5.2.56. order_restated<simple_order<account_id>>
Notification that an order was restated.
Generated to restate an open order to a client.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was restated. |
|
|
The unique, exchange-assigned identifier for the order. |
|
|
The unique, exchange-assigned identifier for the display order. |
|
|
The client-generated unique order identifier. |
|
|
Bytes |
The client-generated hash value that represents the client-side inputs to an order transaction. |
|
The time when the order was originally entered. |
|
|
object with a single field |
The original order attributes. |
|
The balance of the order that has not yet executed. |
|
|
Whether the order is live or dead. |
{
"order_restated":{
"timestamp":"1618427227000000000",
"order_id":"1234567890",
"display_order_id":"777",
"order_token":"12345678901234567890",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"original_timestamp":"1618427227000000000",
"original_order":{
"simple_order":{
"tradeable_entity_id":"7777",
"market_id":"0",
"side":"buy",
"time_in_force":"good_for_cycles",
"time_to_live":"65535",
"quantity":"10000000000",
"price":"10000000000000",
"party_data":{
"account_id":"1234567890"
}
}
},
"balance":"10000000000",
"order_state":"accepted"
}
}
5.2.57. order_updated
Notification of an unsolicited change to an order’s state.
Generated by events that trigger a change in order state or display identifier.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the order was updated. |
|
|
The unique, exchange-assigned identifier for the order. |
|
|
The unique, exchange-assigned identifier for the display order. |
|
|
The client-generated unique identifier for the order. |
|
|
Bytes |
The client-generated hash value that represents the client-side inputs to an order transaction. |
|
The current state of the order. |
{
"order_updated":{
"timestamp":"1618427227000000000",
"order_id":"1234567890",
"display_order_id":"777",
"order_token":"12345678901234567890",
"client_reference":"0x0000000000000000000000000000000000000000000000000000000000000000",
"order_state":"accepted"
}
}
5.2.58. position
Position data for a current position.
Represents a position on a deliverable for the specified account. A position for an account is uniquely identified by the tuple of ( product_deliverable_id, position_kind, product_type, position_deliverable_id )
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the position was last updated. |
|
|
The unique, exchange-assigned identifier for the account that is position is associated with. |
|
|
A unique, exchange-assigned identifier for the product deliverable. |
|
|
Whether the position kind is cash, realised, unrealised, margin or payoff. |
|
|
Whether the product_type is reference_balance, balance, option, future or spot. |
|
|
A unique, exchange-assigned identifier for the position deliverable. The value of the position is an amount of the position deliverable. For example, if the postiion deliverable was USD, then the value would be how many USD the position represents. |
|
|
The value of the position expressed in terms of the position deliverable, as identified by the position_deliverable_id. The number of decimal places is determined by the position deliverable. |
|
|
The anchor price for the position. The number of decimal places is determined by the deliverable. Depending on the position_kind and product_type the anchor_price could represent the spot price of an underlying deliverable, or it could represent the volume weighted average price paid for the balance of product deliverable. The number of decimal places is determined by the position deliverable. |
|
|
The number of the product deliverable held by the open position, for example. If the position is based on holding options then the balance field will tell you how many options. The sign indicates if you are short (-ve) or long (+ve) the deliverable. The number of decimal places is determined by the product deliverable. |
|
|
The mark price for the position. The number of decimal places is determined by the position deliverable. |
|
|
A unique, exchange-assigned identifier for the base deliverable. The base deliverable is used to identify which other deliverable may be needed to identify any relevant spot or mark price. |
|
|
The source type indicates the source that triggered the position update, for example a trade has occurred or there has been a relevant mark price change. |
|
|
The source id contains any relevant id that triggered the position update, for example the trade_id in the case of a trade. |
{
"position":{
"timestamp":"1618427227000000000",
"account_id":"1234567890",
"product_deliverable_id":"3333",
"position_kind":"cash",
"product_type":"reference_balance",
"position_deliverable_id":"3333",
"value":"10000000000",
"anchor_price":"10000000000000",
"balance":"987654321",
"mark_price":"10000000000000",
"base_deliverable_id":"3333",
"source_type":"deposit",
"source_id":"12345678901234567890"
}
}
5.2.59. position_consistency_marker
Notification that the position messages are in a consistent state.
Marks a point in the event stream where the state across objects is consistent.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the marker was generated. |
{
"position_consistency_marker":{
"timestamp":"1618427227000000000"
}
}
5.2.60. position_risk
Notification of the current risk values (E.g. the Greeks) for a single position.
Represents the position risk on a deliverable for the specified account.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the position_risk was last updated. |
|
|
The unique, exchange-assigned identifier for the account that the position risk is associated with. |
|
|
A unique, exchange-assigned identifier for the product deliverable. |
|
|
Whether the position kind is cash, realised, unrealised, margin, payoff, or risk |
|
|
Whether the product_type is reference_balance, balance, option, future or spot. |
|
|
A unique, exchange-assigned identifier for the position deliverable. |
|
|
The anchor price for the position. |
|
|
The number of the product deliverable held by the open position. |
|
|
The source type indicates the source that triggered the position update, for example a trade has occurred or there has been a relevant mark price change. |
|
|
The current greeks for the identified product deliverable. |
{
"position_risk":{
"timestamp":"1618427227000000000",
"account_id":"1234567890",
"product_deliverable_id":"3333",
"position_kind":"cash",
"product_type":"reference_balance",
"position_deliverable_id":"3333",
"anchor_price":"10000000000000",
"balance":"987654321",
"source_type":"deposit",
"greeks":{
"delta":"123",
"theta":"123",
"gamma":"123",
"vega":"123"
}
}
}
5.2.61. positions_greeks
Notification of the current net greeks values for an account’s current positions.
Represents the overall portfolio greeks for the identified account.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the portfolio greeks were last updated. |
|
|
The unique, exchange-assigned identifier for the account that the portfolio greeks are associated with. |
|
|
The current greeks for the identified account. |
{
"positions_greeks":{
"timestamp":"1618427227000000000",
"account_id":"1234567890",
"greeks":{
"delta":"123",
"theta":"123",
"gamma":"123",
"vega":"123"
}
}
}
5.2.62. positions_health
Notification of the current net health score for an account’s current positions.
Represents the overall positions health for the identified account.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the positions health was last updated. |
|
|
The unique, exchange-assigned identifier for the account that the positions health is associated with. |
|
|
The current health score as a percentage as determined by the positions held for the account. |
|
|
The current risk status as determined by the positions held for the account. |
{
"positions_health":{
"timestamp":"1618427227000000000",
"account_id":"1234567890",
"score":"500000",
"risk_status":"normal"
}
}
5.2.63. reference_price
Notification of a reference price update.
Communicates an update to the reference price for a specified tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the reference price update was generated. |
|
|
A unique, exchange-assigned identifier for the tradeable entity. |
|
|
Identifies the target market for the reference price update. |
|
|
The price. The number of decimal places is determined by the tradeable entity. |
|
|
The type of the reference price update |
{
"reference_price":{
"timestamp":"1618427227000000000",
"tradeable_entity_id":"7777",
"market_id":"0",
"price":"10000000000000",
"price_type":"reference"
}
}
5.2.64. request_stream
Request a new stream associated with a specified channel.
Used to request a stream of messages as described in the table below.
begin_sequence_number | end_sequence_number | Range of messages in stream |
---|---|---|
1 (or |
0 ( |
All messages in the channel. The stream ends when the channel is closed (meaning no further messages will be added). |
0 ( |
0 ( |
All new messages in the channel from the time of the request. The stream ends when the channel is closed. |
>0 |
0 ( |
All messages in the channel starting from |
0 ( |
>0 |
All new messages in the channel until the message numbered with |
>0 |
>0 |
All messages in the channel starting from |
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
A valid Channel Id in a multi-channel connection, or 0 ( |
|
|
The sequence number of the first message in the range of messages being requested, or 0 ( |
|
|
The sequence number of the last message in the range of messages being requested, or 0 ( |
|
|
An optional, client-assigned stream identifier used for correlation with response messages. |
{
"request_stream":{
"channel_id":"1",
"begin_sequence_number":"12345",
"end_sequence_number":"12345",
"stream_id":"1"
}
}
5.2.65. session_ended
Notification that the current session was ended.
Generated in response to logout or server-initiated session termination.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the session was ended. |
|
|
The unique, server-assigned identifier for the session. |
|
|
The reason the session was ended. |
{
"session_ended":{
"timestamp":"1618427227000000000",
"session_id":"1",
"reason":"logout"
}
}
5.2.66. session_started
Notification that a new session was started.
The first message sent by the server after successful authentication.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the session was started. |
|
|
The unique, server-assigned identifier for the session. |
|
|
Identifies the session’s default channel. |
{
"session_started":{
"timestamp":"1618427227000000000",
"session_id":"1",
"default_channel_id":"1"
}
}
5.2.67. settlement_price
Notification of a settlement price update.
Communicates an update to the settlement price for a specified tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the settlement price update was generated. |
|
|
A unique, exchange-assigned identifier for the tradeable entity. |
|
|
The price. The number of decimal places is determined by the tradeable entity. |
|
|
The type of the settlement price update |
|
|
Indicates the settlement date and time to which the settlement price applies. Interim settlement prices are typically published prior to this time, but may be published on or after this time if there is a delay in determining the final settlement price. Final prices are published only on or after this time. If equal to the quantity deliverable’s expiry, the price being published is for settlement at expiry and the settlement_event_type will be expiry. Otherwise, the settlement_event_type is cyclical. |
|
|
The type of the settlement event to which the price applies. |
{
"settlement_price":{
"timestamp":"1618427227000000000",
"tradeable_entity_id":"7777",
"price":"10000000000000",
"price_type":"interim_price",
"settlement_event":{
"datetime":{
"date":{
"year":"2021",
"month":"7",
"day":"31"
},
"time":{
"hours":"7",
"minutes":"0",
"seconds":"0",
"nanoseconds":"849936000"
}
},
"timezone":"UTC"
},
"settlement_event_type":"cyclical"
}
}
5.2.68. stream_ended
Notification that a stream has ended.
Marks the end of a stream of messages.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the stream was ended. |
|
|
A valid Channel Id in a multi-channel connection, or 0 ( |
|
|
A client-assigned stream identifier used for correlation with a request_stream message. |
{
"stream_ended":{
"timestamp":"1618427227000000000",
"channel_id":"1",
"stream_id":"1"
}
}
5.2.69. stream_rejected
Notification that a stream request was rejected.
Sent in response to an invalid request_stream message.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the stream request was rejected. |
|
|
The Channel ID specified by the client in the request_stream message. |
|
|
The client-assigned stream identifier used for correlation with a request_stream message. |
|
|
The reason the request_stream message was rejected. |
{
"stream_rejected":{
"timestamp":"1618427227000000000",
"channel_id":"1",
"stream_id":"1",
"reason":"invalid_channel_id"
}
}
5.2.70. stream_resumed
Notification that a stream has resumed.
Marks the beginning of a stream of messages.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the stream was resumed. |
|
|
A valid Channel Id in a multi-channel connection, or 0 ( |
|
|
The sequence number of the next message that will be transmitted as part of the stream. |
|
|
The client-assigned stream identifier used for correlation with a request_stream message. |
{
"stream_resumed":{
"timestamp":"1618427227000000000",
"channel_id":"1",
"next_sequence_number":"12345",
"stream_id":"1"
}
}
5.2.71. stream_started
Notification that a stream has started.
Marks the beginning of a stream of messages.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the stream was started. |
|
|
A valid Channel Id in a multi-channel connection, or 0 ( |
|
|
The sequence number of the first message that will be transmitted as part of the stream. |
|
|
The sequence number of the last message that will be transmitted as part of the stream, or 0 ( |
|
|
A client-assigned stream identifier used for correlation with a request_stream message. |
{
"stream_started":{
"timestamp":"1618427227000000000",
"channel_id":"1",
"begin_sequence_number":"12345",
"end_sequence_number":"12345",
"stream_id":"1"
}
}
5.2.72. time
Notification of an update to system time.
Used to communicate an update to the internal clock.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the message was generated. |
{
"time":{
"timestamp":"1618427227000000000"
}
}
5.2.73. top_of_book
Notification of a change in the best bid and offer.
The current best bid and best offer for a specified tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the top_of_book was generated. |
|
|
A unique, exchange-assigned identifier for the tradeable entity. |
|
|
Identifies the target market for the top-of-book information. |
|
|
The price of the best bid. The number of decimal places is determined by the tradeable entity. |
|
|
The total quantity at the best bid price. The number of decimal places is determined by the tradeable entity. |
|
|
The price of the best offer. The number of decimal places is determined by the tradeable entity. |
|
|
The total quantity at the best offer price. The number of decimal places is determined by the tradeable entity. |
{
"top_of_book":{
"timestamp":"1618427227000000000",
"tradeable_entity_id":"7777",
"market_id":"0",
"buy_price":"10000000000000",
"buy_quantity":"10000000000",
"sell_price":"10000000000000",
"sell_quantity":"10000000000"
}
}
5.2.74. trade
Notification that a new trade was generated.
A trade generated for the specified tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the trade was generated. |
|
|
A unique, exchange-assigned identifier for the tradeable entity. |
|
|
Identifies the target market for the trade. |
|
|
The unique identifier for the trade. |
|
|
The price of the trade. The number of decimal places is determined by the tradeable entity. |
|
|
Specifies how the price of the trade was determined. |
|
|
The quantity of the trade. The number of decimal places is determined by the tradeable entity. |
|
|
The unique, exchange-assigned identifier of the display order on the buy side of the trade. |
|
|
The unique, exchange-assigned identifier of the display order on the sell side of the trade. |
{
"trade":{
"timestamp":"1618427227000000000",
"tradeable_entity_id":"7777",
"market_id":"0",
"trade_id":"1234567",
"price":"10000000000000",
"price_type":"passive",
"quantity":"10000000000",
"buy_display_order_id":"777",
"sell_display_order_id":"777"
}
}
5.2.75. tradeable_entity
tradeable_entity
may refer to one of the following messages:
5.2.76. tradeable_entity<multi_market>
Reference data for a tradeable entity that is traded using multiple markets.
Contains reference data associated with a single tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The unique, exchange-assigned identifier for the tradeable entity. |
|
|
String |
A human-readable identifier for the tradeable entity. |
|
array of String |
A collection of tags used for classifying the tradeable entity. |
|
Identifies the deliverable used to express the price. |
|
|
The number of decimal places used for prices. |
|
|
Identifies the deliverable used to express the quantity. |
|
|
The number of decimal places used for quantities. |
|
|
Identifies the deliverable used to express trading limits for buy side orders and trades. |
|
|
Identifies the deliverable used to express trading limits for sell side orders and trades. |
|
|
Specifies the tradeability of a tradeable entity. |
|
|
object with a single field |
Contains additional details describing the tradeable entity. |
{
"tradeable_entity":{
"tradeable_entity_id":"123",
"symbol":"A",
"tags":[
"A"
],
"price_deliverable_id":"123",
"price_decimal_places":"123",
"quantity_deliverable_id":"123",
"quantity_decimal_places":"123",
"buy_trading_limit_deliverable_id":"123",
"sell_trading_limit_deliverable_id":"123",
"tradeability":"tradeable",
"details":{
"multi_market":{
"market_ids":[
"123"
]
}
}
}
}
5.2.77. tradeable_entity<simple_market>
Reference data for a tradeable entity that is traded using a simple, single market.
Contains reference data associated with a single tradeable entity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The unique, exchange-assigned identifier for the tradeable entity. |
|
|
String |
A human-readable identifier for the tradeable entity. |
|
array of String |
A collection of tags used for classifying the tradeable entity. |
|
Identifies the deliverable used to express the price. |
|
|
The number of decimal places used for prices. |
|
|
Identifies the deliverable used to express the quantity. |
|
|
The number of decimal places used for quantities. |
|
|
Identifies the deliverable used to express trading limits for buy side orders and trades. |
|
|
Identifies the deliverable used to express trading limits for sell side orders and trades. |
|
|
Specifies the tradeability of a tradeable entity. |
|
|
object with a single field |
Contains additional details describing the tradeable entity. |
{
"tradeable_entity":{
"tradeable_entity_id":"84",
"symbol":"BTC-20210625-20000P",
"tags":["BTC","option","month"],
"price_deliverable_id":"2",
"price_decimal_places":"6",
"quantity_deliverable_id":"92",
"quantity_decimal_places":"4",
"buy_trading_limit_deliverable_id":"11",
"sell_trading_limit_deliverable_id":"12",
"tradeability":"tradeable",
"details":{
"simple_market":{
"market_id":"0",
"settlement_event":{
"datetime":{
"date":{
"year":"2021",
"month":"6",
"day":"25"
},
"time":{
"hours":"8",
"minutes":"0",
"seconds":"0",
"nanoseconds":"0"
}
},
"timezone":"UTC"
}
}
}
}
}
5.2.78. trading_rule
A trading rule that determines order and trade validation.
Contains rules used to determine order and trade validity.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The tradeable entity to which the rule applies. If none, applies to all tradeable entities. |
|
|
The market to which the rule applies. If none, applies to all markets. |
|
|
Specifies the minimum price on an order. The number of decimal places is determined by the tradeable entity. |
|
|
Specifies the maximum price on an order. The number of decimal places is determined by the tradeable entity. |
|
|
Specifies the valid price step for an order. The number of decimal places is determined by the tradeable entity. |
|
|
Specifies the minimum quantity on an order. The number of decimal places is determined by the tradeable entity. |
|
|
Specifies the maximum quantity on an order. The number of decimal places is determined by the tradeable entity. |
|
|
Specifies the valid quantity step for an order. The number of decimal places is determined by the tradeable entity. |
|
|
Specifies the minimum value of an order. The number of decimal places is determined by the tradeable entity. |
|
|
Specifies the maximum value of an order. The number of decimal places is determined by the tradeable entity. |
{
"trading_rule":{
"tradeable_entity_id":"7777",
"market_id":"0",
"minimum_price":"10000000000000",
"maximum_price":"10000000000000",
"price_step":"10000000000000",
"minimum_quantity":"10000000000",
"maximum_quantity":"10000000000",
"quantity_step":"10000000000",
"minimum_value":"100000000",
"maximum_value":"100000000"
}
}
5.2.79. trading_state
Reflects the current state of trading in the tradeable entity and market.
Indicates the current state of a tradeable entity and market.
This message defines the following fields:
Name | Type | Description |
---|---|---|
|
The time when the trading state was reported. |
|
|
The tradeable entity to which the state applies. |
|
|
The market to which the state applies. |
|
|
Whether trading is active or suspended. |
|
|
Whether the tradeable entity is active or expired. |
|
|
The date and time against which trades will be recorded. |
{
"trading_state":{
"timestamp":"123",
"tradeable_entity_id":"123",
"market_id":"123",
"suspension_status":"active",
"expiry_status":"active",
"settlement_event":{
"datetime":{
"date":{
"year":"123",
"month":"123",
"day":"123"
},
"time":{
"hours":"123",
"minutes":"123",
"seconds":"123",
"nanoseconds":"123"
}
},
"timezone":"A"
}
}
}
5.3. Structures
This section describes the following structures:
5.3.1. aliased_deliverable
Contains reference data associated with an aliased deliverable.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The deliverable ID that is being aliased. |
5.3.2. date
Represents a calendar date.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The four digit year. |
|
|
The month (1-12). |
|
|
The day of the month (1-31). |
5.3.3. datetime
Represents a datetime.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The date. |
|
|
The time of day. |
5.3.4. exchange_token
Contains reference data associated with an exchange token.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
String |
The common name of the exchange token. |
|
String |
The name of the exchange token’s anchoring ledger. |
|
Bytes |
The address of the exchange token on the ledger, if any. |
|
The minor units supported for the token. |
5.3.5. exchange_trading_limit
Contains reference data associated with an exchange trading limit.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The deliverable that is being bought or sold in exchange for the quote deliverable. |
|
|
Whether the trading limit is a buy or sell. |
5.3.6. fiat_currency
Contains reference data associated with a fiat currency.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
String |
The ISO 4217 name of the currency. |
|
String |
The ISO 4217 alphabetic code for the currency. |
|
The ISO 4217 numeric code for the currency. |
|
|
The ISO 4217 specified number of minor units for the currency. |
5.3.7. full_order<account_id>
Attributes used for full order entry.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
Identifies the target tradeable entity for the order. |
|
|
Identifies the target market for the order. |
|
|
Whether the order is a buy or sell. |
|
|
Specifies how long the order remains valid. |
|
|
In conjunction with time_in_force, specifies how long the order remains valid. |
|
|
The quantity of the order. The number of decimal places is determined by the tradeable entity. |
|
|
The minimum quantity of the order. Must be 0 or 18446744073709551615 ("none") unless time_in_force is immediate_or_cancel. Must be less than or equal to the quantity of the order. The number of decimal places is determined by the tradeable entity. |
|
|
Order price. 9223372036854775807 ("none") denotes a market order. The number of decimal places is determined by the tradeable entity. |
|
|
object with a single field |
Contains attributes identifying the party associated with the order. |
|
optional array of execution_instruction |
Contains optional instructions specifying how an order should be handled. |
|
optional trigger_instructions |
Contains optional instructions specifying how and when the order will be triggered. |
5.3.8. future
Contains reference data associated with a single future entity.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The expiry for the future. |
|
|
The future delivery style. |
|
|
Denotes the unique deliverable_id assigned to the underlying security within exchange. |
|
|
Identifies the deliverable used to express the contract size. |
|
|
Specifies the contract size. |
|
|
Identifies the deliverable used to express settlement values. |
|
|
The UTC time when the future was created. |
|
|
The creation source ID for the future. |
|
|
Identifies the margin specification to be used for the future. |
5.3.9. fx_spot
Contains reference data associated with a single fx_spot entity.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The deliverable that is being bought or sold in exchange for the quote deliverable. |
|
|
The deliverable that is being paid to secure the base deliverable. |
|
|
Specifies the contract size. |
5.3.10. greeks
Represents each of the greek values.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
How much an options price is expected to change per $1 change in the underlying. |
|
|
The change in the price of an option for a one-day decrease in its time to expiration. |
|
|
The rate of change in an options delta per $1 change in the price of the underlying. |
|
|
The rate of change in an options price per 1% change in the implied volatility of the underlying. |
5.3.11. index
Contains reference data associated with a single index entity.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The deliverable that is being priced in reference to the quote deliverable. |
|
|
The deliverable that is being used to quote the base deliverable. |
5.3.12. multi_leg_order<account_id>
Attributes used for simple order entry.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
array of tradeable_entity_leg |
Identifies the target tradeable entities and leg ratios for the order. Must contain at least two entries, in ascending order by tradeable_entity_id, with each tradeable entity appearing no more than once. The greatest common divisor of the absolute values of the leg ratios must be one. The ratio of the first leg must be positive. |
|
Identifies the target market for the order. Must be a valid ID for all tradeable entities in the legs. |
|
|
Whether the order is a buy or sell. |
|
|
Specifies how long the order remains valid. |
|
|
In conjunction with time_in_force, specifies how long the order remains valid. Must be 65535 ("none") if the time_in_force is immediate_or_cancel. Otherwise, must be less than or equal to 65534. |
|
|
The quantity of the order. The number of decimal places is the smallest quantity_decimal_places value for the tradeable entities in the legs. |
|
|
The minimum quantity of the order. Must be 0 or 18446744073709551615 ("none") unless time_in_force is immediate_or_cancel. Must be less than or equal to the quantity of the order. The number of decimal places is the smallest quantity_decimal_places for the tradeable entities in the legs. |
|
|
Order price. 9223372036854775807 ("none") denotes a market order. The number of decimal places is the largest price_decimal_places value for the tradeable entities in the legs. |
|
|
object with a single field |
Contains attributes identifying the party associated with the order. |
|
optional array of execution_instruction |
Contains optional instructions specifying how an order should be handled. |
5.3.13. multi_market
Describes a set of markets valid for trading in a tradeable entity.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
array of market_id |
The market identifiers that are valid for the tradeable entity. |
5.3.14. option
Contains reference data associated with a single option entity.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The expiry for the option. |
|
|
The option strike price. |
|
|
The option type (Put or Call). |
|
|
The exercise style of the option. |
|
|
The valuation approach of the option. |
|
|
The option delivery style. |
|
|
Denotes the unique deliverable_id assigned to the underlying security within exchange. |
|
|
Identifies the deliverable used to express the contract size. |
|
|
Specifies the contract size. Uses the decimals specified on the corresponding contract deliverable. |
|
|
Identifies the deliverable used to express settlement values. |
|
|
The UTC time when the option was created. |
|
|
The creation source ID for the option. |
|
|
Identifies the margin specification to be used for the option. |
|
|
Identifies the strikes specification to be used for the option. |
5.3.15. perpetual_future
Contains reference data associated with a single perpetual future.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The funding period over which funding occures, expressed in hours, minutes and seconds. |
|
|
A date time that represents the reference time for funding periods. |
|
|
Identifies the funding specification to be used for the perpetual future. |
|
|
Denotes the unique deliverable_id assigned to the underlying security within exchange. |
|
|
Identifies the deliverable used to express the contract size. |
|
|
Specifies the contract size. |
|
|
Identifies the deliverable used to express settlement values. |
|
|
The UTC time when the perpetual future was created. |
|
|
The creation source ID for the perpetual future. |
|
|
Identifies the margin specification to be used for the perpetual future. |
5.3.16. simple_market
Describes a simple, single market for trading in a tradeable entity.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The market identifier. |
|
|
The date and time against which trades will be recorded. |
5.3.17. simple_order<account_id>
Attributes used for simple order entry.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
Identifies the target tradeable entity for the order. |
|
|
Identifies the target market for the order. |
|
|
Whether the order is a buy or sell. |
|
|
Specifies how long the order remains valid. |
|
|
In conjunction with time_in_force, specifies how long the order remains valid. |
|
|
The quantity of the order. The number of decimal places is determined by the tradeable entity. |
|
|
Order price. 9223372036854775807 ("none") denotes a market order. The number of decimal places is determined by the tradeable entity. |
|
|
object with a single field |
Contains attributes identifying the party associated with the order. |
5.3.18. stable_token
Contains reference data associated with a single stable_token entity.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
String |
The common name of the exchange token. |
|
String |
The name of the exchange tokens anchoring ledger. |
|
Bytes |
The address of the exchange token on the ledger, if any. |
|
The minor units supported for the token. |
|
|
The stabilisation approach used by the stable token. |
|
|
The deliverable used to back the stable token, if any. |
5.3.19. time_of_day
Represents a time of day.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The hours (0-23). |
|
|
The minutes (0-59). |
|
|
The seconds (0-59). |
|
|
The nanonseconds (0-999,999,999). |
5.3.20. tradeable_entity_leg
Represents a single leg in a multi-leg order or strategy.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The tradeable entity ID of the leg. |
|
|
Ratio indicating the quantity to buy/sell relative to other legs. |
5.3.21. trigger_instructions
Specifies how and when an order should be triggered.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The type of event when the trigger will be hit. |
|
|
Identifies the tradeable entity against which the trigger price will be compared. |
|
|
Identifies the market against which the trigger price will be compared. |
|
|
The type of the price in the target tradeable entity and market that the price is compared to. |
|
|
Whether the order is triggered based on a movement up or down through the trigger price. |
|
|
The trigger price. The number of decimal places is determined by the tradeable entity. |
5.3.22. zoned_datetime
Represents a zoned datetime.
This structure defines the following fields:
Name | Type | Description |
---|---|---|
|
The date and time of day. |
|
|
String |
The timezone. |
5.4. Types
This section describes the following types:
5.4.1. account_id
Uniquely identifies an account.
account_id
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
A constant used to specify no account ID. |
|
|
A constant used to specify all account IDs. |
5.4.2. basis_points
Basis Points.
basis_points
is a signed 64-bit integer with supported values from -9223372036854775808
to 9223372036854775807
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max signed 64-bit integer) |
A constant used to specify no basis points. |
5.4.3. channel_id
Uniquely identifies a channel.
channel_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
A constant used to specify no channel ID. |
5.4.4. contract_size
Specifies the contract size.
contract_size
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no contract size. |
5.4.5. creation_source_id
Identifies the source of an instrument.
creation_source_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no creation source. |
5.4.6. day
Day of the month (1-31).
day
is an unsigned 32-bit integer with supported values from 0
to 4294967295
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
A constant used to specify no day. |
5.4.7. decimal_places
Decimal Places.
decimal_places
is an unsigned 32-bit integer with supported values from 0
to 4294967295
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
A constant used to specify no decimal places. |
5.4.8. deliverable_id
Uniquely identifies a deliverable.
deliverable_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no deliverable ID. |
5.4.9. delivery_style
Specifies how derivative delivery will occur.
delivery_style
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The derivative settlement deliverable is the same as the quantity deliverable. |
|
|
The derivative settlement deliverable is a cash-style deliverable. |
|
|
The derivative is non-deliverable. |
|
|
The derivative’s delivery is elected at exercise. |
5.4.10. display_order_id
Uniquely identifies a display order.
display_order_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no display order ID. |
5.4.11. execution_instruction
Instructions for order handling
execution_instruction
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The order will participate in a match only when it is a passive order. It will not initiate a match as an aggressor. |
|
|
The order will be cancelled rather than participate in a match. |
5.4.12. expiry_status
Specifies whether an entity has expired or is active.
expiry_status
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The entity is active. |
|
|
The entity has expired. |
5.4.13. funding_spec_id
Uniquely identifies a funding specification for a perpetual derivative.
funding_spec_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no funding spec ID. |
5.4.14. hours
Hours.
hours
is an unsigned 32-bit integer with supported values from 0
to 4294967295
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
A constant used to specify no hours. |
5.4.15. iso4217_currency_number
Unique numeric identifier for a currency according to the ISO4217 standard.
iso4217_currency_number
is an unsigned 16-bit integer with supported values from 0
to 65535
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 16-bit integer) |
A constant used to specify no currency number. |
5.4.16. leg_ratio
A leg_ratio.
leg_ratio
is a signed 16-bit integer with supported values from -32768
to 32767
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max signed 16-bit integer) |
A constant used to specify no leg_ratio. |
5.4.17. liquidity_flag
Specifies how an order affects liquidity.
liquidity_flag
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
Liquidity was added |
|
|
Liquidity was taken |
|
|
Liquidity was neither added nor taken |
5.4.18. listing_status
Specifies the listing_status of a deliverable.
listing_status
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
An active deliverable. |
|
|
The deliverable is marked for delisting. |
5.4.19. margin_spec_id
Uniquely identifies a margin spec.
margin_spec_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no margin spec ID. |
5.4.20. market_id
Uniquely identifies a market.
market_id
is an unsigned 32-bit integer with supported values from 0
to 4294967295
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
A constant used to specify no market ID. |
5.4.21. minutes
Minutes.
minutes
is an unsigned 32-bit integer with supported values from 0
to 4294967295
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
A constant used to specify no minutes. |
5.4.22. month
Month (1-12).
month
is an unsigned 32-bit integer with supported values from 0
to 4294967295
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
A constant used to specify no month. |
5.4.23. nanoseconds
Nanoseconds.
nanoseconds
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no nanoseconds. |
5.4.24. option_exercise_style
Specifies how the option may be exercised.
option_exercise_style
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The option is a European style option and can only be exercised on expiry. |
5.4.25. option_type
Specifies whether option is a call or put.
option_type
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
Call option. |
|
|
Put option. |
5.4.26. option_valuation_approach
Specifies the general approach used to value the option.
option_valuation_approach
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The option is a Vanilla option. |
|
|
The option is an Asian option. |
|
|
The option is Digital (Binary) option. |
|
|
The option is a Barrier option. |
|
|
The option is a Digital Barrier option. |
|
|
The option is a Loopback option. |
5.4.27. order_action_reject_reason
Specifies why an order was rejected.
order_action_reject_reason
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
Invalid tradeable entity |
|
|
Invalid fields |
|
|
Fill side empty |
|
|
No orders to peg to |
|
|
Invalid this period |
|
|
Invalid order flow |
|
|
Illegal order flow |
|
|
Trading suspended |
|
|
Invalid participant |
|
|
Invalid account |
|
|
Insufficient account balance |
|
|
Invalid market |
|
|
The account is suspended |
|
|
The tradeable entity has expired |
|
|
Invalid quantity deliverable |
|
|
Invalid trading limit deliverable |
|
|
The deliverable is not a derivative |
|
|
The price of the order is less than the minimum price allowed by the trading rules that are currently in force. |
|
|
The price of the order is greater than the maximum price allowed by the trading rules that are currently in force. |
|
|
The price of the order is not on an allowed price step as required by the trading rules that are currently in force. |
|
|
The quantity of the order is less than the minimum quantity allowed by the trading rules that are currently in force. |
|
|
The quantity of the order is greater than the maximum quantity allowed by the trading rules that are currently in force. |
|
|
The quantity of the order is not on an allowed quantity step as required by the trading rules that are currently in force. |
|
|
The value of the order is greater than the maximum supported. |
|
|
The value of the order is less than the minimum value allowed by the trading rules that are currently in force. |
|
|
The value of the order is greater than the maximum value allowed by the trading rules that are currently in force. |
|
|
The legs of the multi-leg order do not conform to the rules on tradeable entity ordering, uniqueness, and ratios. |
|
|
The trigger instructions of the full order do not conform to the supported rules for triggered orders. |
|
|
There are too many existing trigger orders |
|
|
The execution instructions contain invalid values |
5.4.28. order_cancelled_reason
Specifies why an order was cancelled.
order_cancelled_reason
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The order was cancelled by the user. |
|
|
There was insufficient liquidity to match the immediate order. |
|
|
The order timed out due to its time_in_force attribute. |
|
|
The order was cancelled during account liquidation. |
|
|
The order was cancelled due to an insufficient account balance. |
|
|
The order was cancelled because this type of order cannot be in a pending state. |
|
|
The order was cancelled as concurrent pending orders on the same deliverable are not allowed. |
|
|
The order was cancelled as the cancel-on-disconnect setting applies to the endpoint, and a disconnection event occurred. |
|
|
The order was cancelled by a market supervisor. |
|
|
The order was cancelled as it was marked participate-do-not-initiate and would have initiated a match. |
|
|
The order was cancelled as it was marked do-not-participate and would have entered the order book. |
5.4.29. order_execution_prevented_reason
Specifies why an order execution was prevented.
order_execution_prevented_reason
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The order would have resulted in the party trading with itself. |
|
|
The order is a market maker order. |
5.4.30. order_id
Uniquely identifies an order.
order_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no order ID. |
5.4.31. order_state
Specifies state of an order following order_entered.
order_state
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The order has been accepted and is eligible for matching. |
|
|
The order is pending and not yet eligible for matching. |
|
|
The order is a triggered order and has not yet been triggered. |
|
|
The order has expired. No further messages will be generated for it. |
5.4.32. order_token
A 64-bit client-generated ID to uniquely identify an order. Must be increased for each inbound order management request. The top 8 bits are reserved and must be 0.
order_token
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no order token. |
5.4.33. percent
A percentage scaled to 4 decimal places.
percent
is a signed 64-bit integer with supported values from -9223372036854775808
to 9223372036854775807
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max signed 64-bit integer) |
A constant used to specify no percentage value. |
5.4.34. position_balance
A position balance.
position_balance
is a signed 64-bit integer with supported values from -9223372036854775808
to 9223372036854775807
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max signed 64-bit integer) |
A constant used to specify no position_balance. |
5.4.35. position_kind
Specifies the type of position being added.
position_kind
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
Cash position. |
|
|
Realised position. |
|
|
Unrealised position. |
|
|
Margin position. |
|
|
Payoff position. |
|
|
Payout (funding) position. |
|
|
The position is Expired but not yet realised. |
|
|
The position is no longer held but is due a funding payment. |
|
|
The position that represents the locked trading limit. |
|
|
The risk metrics (E.g. the Greeks) that are set for a position. |
|
|
Unrealised position based on pending buy orders. |
|
|
Unrealised position based on pending sell orders. |
|
|
Margin position based on pending buy orders. |
|
|
Margin position based on pending sell orders. |
|
|
Unrealised position based on open buy orders. |
|
|
Unrealised position based on sell orders. |
|
|
Margin position based on open buy orders. |
|
|
Margin position based on open sell orders. |
|
|
Cash position based on pending buy orders. |
|
|
Cash position based on pending sell orders. |
|
|
Cash position based on open buy orders. |
|
|
Cash position based on open sell orders. |
|
|
Cash position based on long open orders commitments. |
|
|
Cash position based on short open orders commitments. |
5.4.36. position_source_id
The source_id that triggered a position update.
position_source_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no position source ID. |
5.4.37. position_source_type
Specifies the source trigger for this position message
position_source_type
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The position update was triggered by a deposit. |
|
|
The position update was triggered by a withdrawal. |
|
|
The position update was triggered by a trade. |
|
|
The position update was triggered by an expiry. |
|
|
The position update was triggered by a mark to market settlement. |
|
|
The position update was triggered by a change in mark price. |
|
|
The position update was triggered by a change in settlement price. |
|
|
The position update was triggered by a new funding rate. |
|
|
The position update was triggered by a message from a portfolio risk engine. |
|
|
The position update was triggered by a message from the holdings and registry facility. |
|
|
The position update was triggered by the start of a cycle. |
|
|
The position update was by a pending order. |
|
|
A constant used to specify no source type. |
5.4.38. position_value
A position_value.
position_value
is a signed 64-bit integer with supported values from -9223372036854775808
to 9223372036854775807
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max signed 64-bit integer) |
A constant used to specify no position value. |
5.4.39. positions_risk_status
Indicates the risk status associated with outstanding positions
positions_risk_status
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The positions have a normal risk status. |
|
|
The positions are considered 'At Risk' and some restrictions will apply. |
|
|
The positions are considered 'Critical' and full trading restrictions will apply. |
|
|
The positions risk status has passed the 'Critical' level and the positions need to be liquidated. |
5.4.40. price
A price.
price
is a signed 64-bit integer with supported values from -9223372036854775808
to 9223372036854775807
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max signed 64-bit integer) |
A constant used to specify no price. |
5.4.41. product_type
Specifies product type of product a position is related to .
product_type
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
Balance positions for the reference currency. |
|
|
Balance. |
|
|
Spot. |
|
|
Future. |
|
|
Option. |
|
|
No product. |
|
|
The current trading limit. |
5.4.42. quantity
A quantity.
quantity
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no quantity. |
5.4.43. reference_price_type
Specifies the type of reference price.
reference_price_type
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
Reference price. |
|
|
Close price. |
5.4.44. scaled_fixed_point
A scaled_fixed_point scaled to 10 decimal places.
scaled_fixed_point
is a signed 64-bit integer with supported values from -9223372036854775808
to 9223372036854775807
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max signed 64-bit integer) |
A constant used to specify no scaled_fixed_pointage value. |
5.4.45. seconds
Seconds.
seconds
is an unsigned 32-bit integer with supported values from 0
to 4294967295
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
A constant used to specify no seconds. |
5.4.46. sequence_number
A message sequence number.
sequence_number
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
A used to specify no sequence number. |
5.4.47. session_end_reason
Specifies why a session was ended.
session_end_reason
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The session was ended due to a logout request from the client. |
|
|
The session was ended due to an inactivity timeout. |
|
|
The session was ended due to the server component being stopped. |
|
|
The session was ended due to a protocol violation by the client. |
5.4.48. session_id
Uniquely identifies a session.
session_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
A constant used to specify no session ID. |
5.4.49. settlement_event_type
Specifies the type of settlement event.
settlement_event_type
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The settlement event is cyclical, such as a daily settlement. |
|
|
The settlement event is associated with a deliverable’s expiry. |
5.4.50. settlement_price_type
Specifies the type of settlement price.
settlement_price_type
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
Interim price. |
|
|
Final price. |
5.4.51. side
Specifies whether order is a buy or sell.
side
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
Buy order. |
|
|
Sell order. |
5.4.52. stabilisation_approach
Specifies the general approach used to stabilise the token.
stabilisation_approach
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The token is backed by a fiat currency, either directly, or by pegging, or against a basket. |
|
|
The token is backed by an asset, such as commodities like gold price or other kinds of assets. |
|
|
The token is backed by other cryptoasset tokens, such as a diversified basket. |
|
|
The token is a seigniorage-style, unbacked token that uses some form of algorithm to control supply and value. |
5.4.53. stream_id
Uniquely identifies a stream.
stream_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
A constant used to specify no stream ID. |
5.4.54. stream_reject_reason
Specifies why a stream request was rejected.
stream_reject_reason
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The channel ID did not refer to a known channel |
|
|
The begin or end sequence number was invalid |
|
|
The stream ID is already being used for another active stream. |
|
|
The number of active streams is already at the maximum allowed. |
5.4.55. strikes_spec_id
Uniquely identifies a strikes specification.
strikes_spec_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no strikes spec ID. |
5.4.56. suspension_status
Specifies whether an entity is suspended or active.
suspension_status
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The entity is active. |
|
|
The entity is suspended. |
5.4.57. time_in_force
Specifies the duration of the order.
time_in_force
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
Good for the number of system cycles specified in time_to_live. |
|
|
Immediate or cancel order. |
5.4.58. time_to_live
Used in conjunction with time_in_force to specify an order’s lifetime.
time_to_live
is an unsigned 16-bit integer with supported values from 0
to 65535
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 16-bit integer) |
A constant used to specify no time_to_live. |
5.4.59. trade_id
Uniquely identifies a trade.
trade_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no trade ID. |
5.4.60. trade_price_type
Specifies how the price of a trade was determined.
trade_price_type
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The trade occurred during continuous matching and uses the price of the passive order. |
|
|
The trade occurred during an auction and uses a calculated equilibrium price. |
|
|
The trade was between two multi-leg orders and uses a price derived from one of the legs. |
|
|
The trade occurred off-market and uses a reported price. |
5.4.61. tradeability
Specifies the tradeability of a tradeable_entity.
tradeability
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
Can enter orders. |
|
|
Cannot enter orders, but we may publish market data. |
|
|
Cannot enter orders, no market data. |
|
|
The tradeable entity is set to be removed from the market data. |
5.4.62. tradeable_entity_id
Uniquely identifies a tradeable entity.
tradeable_entity_id
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no tradeable entity ID. |
5.4.63. trigger_event_type
Defines when the trigger will be hit.
trigger_event_type
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The order is triggered by partial execution at the trigger price. |
|
|
The order is triggered by price movement to or through the specified price. |
5.4.64. trigger_price_direction
The side from which the trigger price is reached.
trigger_price_direction
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The order is triggered if the price goes up to or through the specified price. |
|
|
The order is triggered if the price goes down to or through the specified price. |
5.4.65. trigger_price_type
The type of price that the specified trigger price is compared to.
trigger_price_type
is an enumeration with the following well-known string constants:
Value | Equivalent integer | Description |
---|---|---|
|
|
The specified trigger price is compared against the best bid. |
|
|
The specified trigger price is compared against the best offer. |
|
|
The specified trigger price is compared against the last trade. |
5.4.66. utc_timestamp
A UTC timestamp expressed in nanoseconds since the epoch (1970-01-01 00:00:00).
utc_timestamp
is an unsigned 64-bit integer with supported values from 0
to 18446744073709551615
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 64-bit integer) |
A constant used to specify no timestamp. |
5.4.67. value
A value.
value
is a signed 128-bit integer with supported values from -170141183460469231731687303715884105728
to 170141183460469231731687303715884105727
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max signed 128-bit integer) |
A constant used to specify no value. |
5.4.68. year
The year (YYYY).
year
is an unsigned 16-bit integer with supported values from 0
to 65535
inclusive.
The type also supports the following string constants:
Value | Equivalent integer | Description |
---|---|---|
|
(max unsigned 16-bit integer) |
A constant used to specify no year. |
6. Revision History
Date | Version | Notes |
---|---|---|
2022/08/31 |
2.4 |
Adding optional adding adding |
2022/08/19 |
2.3 |
Adding "reason" into session_ended |
2022/08/14 |
2.2 |
Adding tradeable_entity<multi_market> |