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.

Table 1. PowerTrade WebSocket API Services:
Service User guide Message set URI in Production Is authentication required?

Market Data

Market Data Guide

Market Data Messages

wss://api.wss.prod.power.trade/v1/market_data

yes

Market Data Demo

Market Data Guide

Market Data Messages

wss://api.wss.prod.power.trade/v1/market_data_demo

no

Order Management

Order Management Guide

Order Management Requests/Responses

wss://api.wss.prod.power.trade/v1/order_management

yes

Position Data

Position Data Guide

Position Data Messages

wss://api.wss.prod.power.trade/v1/position_data

yes

Table 2. Sandbox environment of PowerTrade WebSocket API available for API clients testing:
Service URI in Sandbox

Market Data

wss://api.wss.test.power.trade/v1/market_data

Market Data Demo

wss://api.wss.test.power.trade/v1/market_data_demo

Order Management

wss://api.wss.test.power.trade/v1/order_management

Position Data

wss://api.wss.test.power.trade/v1/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:

Table 3. From scaled integer:

scaled integer

2345600

decimal_places

4

integer

2345600 / 10^decimal_places = 234

fractional

2345600 % 10^decimal_places = 5600

resulting exact value

234.5600

Table 4. To scaled integer:

original exact value

234.56

decimal_places

4

integer

234

fractional padded by zeros up to decimal_places

56 → 5600

scaled integer

integer * 10^decimal_places + fractional

= 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.

Table 5. Protocols of PowerTrade WebSocket API Services:
Service Protocols

Market Data Demo

Session Control Protocol without authentication

+ Market Data Messages

Market Data

Session Control Protocol with authentication

+ Market Data Messages

Order Management

Session Control Protocol with authentication

+ Order Management Requests/Responses

Position Data

Session Control Protocol with authentication

+ Position Data Messages

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 to api.

  • 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.

Client Client Server Server Connect to secure WebSocket URI WebSocket Opening handshake WebSocket Opening handshake [OPTIONAL] Authentication (see if required in Table of API Services ) 1) login 2) login_accepted or in case of failure : 2) login_rejected Session openning 1) session_started to keep session alive, heartbeating is required from now on a) heartbeat b) heartbeat 2) channel_added with assigned channel_id 3) request_stream with channel_id from channel_added 4) stream_started Service-specific protocol to keep session alive, make sure that Client is idle less than 15 sec by sending heartbeat to Server during idle periods so Server will see that Client is alive heartbeat always handshake Server's heartbeat too a) heartbeat b) heartbeat Session ending 1) logout 2) session_ended Closing WebSocket WebSocket Closing handshake WebSocket Closing handshake Do not test in production, test in sandbox PowerTrade Exchange
Figure 1. Diagram of Session Control 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".

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).

Table 6. Reference Data messages included in Market Data message set:
Name Description

deliverable<fx_spot>

Reference data for a single spot deliverable.

deliverable<future>

Reference data for a single future deliverable.

deliverable<option>

Reference data for a single option deliverable.

deliverable<exchange_token>

Reference data for an exchange token deliverable.

deliverable<stable_token>

Reference data for a stable token deliverable.

deliverable<fiat_currency>

Reference data for a fiat currency deliverable.

deliverable<aliased_deliverable>

Reference data for an aliased deliverable.

deliverable<exchange_trading_limit>

Reference data for an exchange trading limit deliverable.

deliverable<perpetual_future>

Reference data for a perpetual future deliverable.

deliverable<index>

Reference data for n index deliverable.

tradeable_entity<simple_market>

Reference data for a tradeable entity that is traded using a simple, single market.

tradeable_entity<multi_market>

Reference data for a tradeable entity that is traded using multiple markets.

trading_rule

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").

Client Client Server Server Session Control Protocol Note : for simplicity, heartbeating is not shown here but it is required to keep session alive Market Data Protocol 1st Cycle cycle_starting prolog Reference data for existing deliverables deliverable Reference data for existing tradeable entities tradeable_entity The state of the tradeable entities trading_state Restatement of display orders that were already open display_order_added Top of book information if there are open orders top_of_book cycle_started real-time various real-time Market Data : trade , top_of_book , display_order_added , display_order_deleted , display_order_updated ,.. and so on cycle_ending epilog optional : display_order_deleted and so on cycle_ended and so on Nth Cycle cycle_starting prolog key Reference Data cycle_started real-time various real-time Market Data cycle_ending epilog optional : display_order_deleted cycle_ended and so on Do not test in production, test in sandbox PowerTrade Exchange
Figure 2. Diagram of Market Data Protocol

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.

Client Client Server Server Session Control Protocol Note : for simplicity, heartbeating is not shown here but it is required to keep session alive Order Management Protocol i-Cycle cycle_starting cycle_started new order entering enter_order<simple_order<account_id>> in case of success : order_entered<simple_order<account_id>> in case of failure : order_action_rejected<enter_order<simple_order<account_id>>> cancelation of order using order_token : cancel_order<order_token> in case of success : order_cancelled in case of failure : order_action_rejected<cancel_order<order_token>> cancelation of order using order_id : cancel_order<order_id> in case of success : order_cancelled in case of failure : order_action_rejected<cancel_order<order_id>> examples of asynchronous order-related notifications order_executed order_updated order_restated<simple_order<account_id>> and so on cycle_ending cycle_ended and so on Do not test in production, test in sandbox PowerTrade Exchange
Figure 3. Diagram of Order Management Protocol

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:11:00.839906

1

100

1300

1350

50

4

2020-09-25T02:19:21.968567

2020-09-25T02:21:20.132500

5

300

1300

1400

200

3

2020-09-25T02:16:34.942338

2020-09-25T02:14:33.287232

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:11:00.839906

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:11:00.839906

1

100

1300

2020-09-25T02:14:33.287232

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:11:00.839906

1

100

1300

1400

200

3

2020-09-25T02:16:34.942338

2020-09-25T02:14:33.287232

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:11:00.839906

1

100

1300

1350

50

4

2020-09-25T02:19:21.968567

2020-09-25T02:14:33.287232

2

150

1200

1400

200

3

2020-09-25T02:16:34.942338

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:11:00.839906

1

100

1300

1350

50

4

2020-09-25T02:19:21.968567

2020-09-25T02:21:20.132500

5

300

1300

1400

200

3

2020-09-25T02:16:34.942338

2020-09-25T02:14:33.287232

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

1

2

400

1300

1350

50

1

1

2

1

150

1200

1400

200

1

2

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:11:00.839906

1

100

1300

1350

50

4

2020-09-25T02:19:21.968567

2020-09-25T02:21:20.132500

5

300

1300

1400

200

3

2020-09-25T02:16:34.942338

2020-09-25T02:14:33.287232

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:11:00.839906

1

100

1300

1400

200

3

2020-09-25T02:16:34.942338

2020-09-25T02:21:20.132500

5

300

1300

2020-09-25T02:14:33.287232

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:11:00.839906

1

100

1300

1400

200

3

2020-09-25T02:16:34.942338

2020-09-25T02:21:20.132500

5

300

1300

2020-09-25T02:14:33.287232

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:54:42.430470

1

40

1300

1400

200

3

2020-09-25T02:16:34.942338

2020-09-25T02:21:20.132500

5

300

1300

2020-09-25T02:14:33.287232

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:21:20.132500

5

300

1300

1400

200

3

2020-09-25T02:16:34.942338

2020-09-25T02:14:33.287232

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:11:00.839906

1

100

1300

1350

50

4

2020-09-25T02:19:21.968567

2020-09-25T02:21:20.132500

5

300

1300

1400

200

3

2020-09-25T02:16:34.942338

2020-09-25T02:14:33.287232

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

Timestamp

Id

Qty

Price

Price

Qty

Id

Timestamp

2020-09-25T02:21:20.132500

5

300

1300

1350

50

4

2020-09-25T02:19:21.968567

2020-09-25T02:54:52.430970

9

120

1300

1400

200

3

2020-09-25T02:16:34.942338

2020-09-25T02:14:33.287232

2

150

1200

4.9. Position Data Handling

The corresponding message set can be found in Position Data Messages.

Client Client Server Server Session Control Protocol Note : for simplicity, heartbeating is not shown here but it is required to keep session alive Position Data Protocol i-Cycle cycle_starting empty prolog phase cycle_started real-time any time later real-time position data any time later real-time position data real-time position_consistency_marker any time later real-time position data real-time position_consistency_marker and so on cycle_ending empty epilog phase cycle_ended and so on Do not test in production, test in sandbox PowerTrade Exchange
Figure 4. Diagram of Position Data Protocol

The position data is mainly provided in position message update and the most important fields of it listed below:

Table 7. The most important position fields:
Name Type Description

product_deliverable_id

deliverable_id

A unique, exchange-assigned identifier for the product deliverable.

position_kind

position_kind

Whether the position kind is cash, unrealised, exposure or margin.

product_type

product_type

Whether the product_type is balance, option, future or spot.

value

position_value

Value of the position.

position_deliverable_id

deliverable_id

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.

Example Cash Position
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”
}
Example Margin Option Position

“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”
}
Example Unrealised Option Position

“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”
}
Example Overall Unrealised USDT Position

“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”
}
Example Margin USDT Position

“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

cycle_starting

Indicates a new cycle is starting.

cycle_started

Indicates a new cycle has started.

cycle_ending

Indicates that the current cycle is ending soon.

cycle_ended

Indicates that the current cycle has ended.

deliverable<fx_spot>

Reference data for a single spot deliverable.

deliverable<future>

Reference data for a single future deliverable.

deliverable<option>

Reference data for a single option deliverable.

deliverable<exchange_token>

Reference data for an exchange token deliverable.

deliverable<stable_token>

Reference data for a stable token deliverable.

deliverable<fiat_currency>

Reference data for a fiat currency deliverable.

deliverable<exchange_trading_limit>

Reference data for an exchange trading limit deliverable.

deliverable<perpetual_future>

Reference data for a perpetual future deliverable.

deliverable<index>

Reference data for an index deliverable.

deliverable<aliased_deliverable>

Reference data for an aliased deliverable.

tradeable_entity<simple_market>

Reference data for a tradeable entity that is traded using a simple, single market.

tradeable_entity<multi_market>

Reference data for a tradeable entity that is traded using multiple markets.

trading_rule

A trading rule that determines order and trade validation.

time

Notification of an update to system time.

display_order_added

Notification that a new display order was added.

display_order_deleted

Notification that an existing display order was deleted.

display_order_executed

Notification that an existing display order executed.

display_order_updated

Notification that an existing display order was updated.

multi_leg_display_order_added

Notification that a new multi-leg display order was added.

multi_leg_display_order_deleted

Notification that an existing multi-leg display order was deleted.

multi_leg_display_order_executed

Notification that an existing multi-leg display order executed.

multi_leg_display_order_updated

Notification that an existing multi-leg display order was updated.

top_of_book

Notification of a change in the best bid and offer.

trade

Notification that a new trade was generated.

reference_price

Notification of a reference price update.

settlement_price

Notification of a settlement price update.

trading_state

Reflects the current state of trading in the tradeable entity and market.

funding_rate

Notification of a funding rate update.

5.1.2. Order Management Requests

This message set includes the following messages:

Name Description

cancel_order<order_id>

Cancels an order using the exchange-generated unique order ID.

cancel_order<order_token>

Cancels an order using the client-generated unique order token.

enter_order<simple_order<account_id>>

Enters a new order.

enter_order<multi_leg_order<account_id>>

Enters a new order.

enter_order<full_order<account_id>>

Enters a new order.

5.1.3. Order Management Responses

This message set includes the following messages:

Name Description

cycle_starting

Indicates a new cycle is starting.

cycle_started

Indicates a new cycle has started.

cycle_ending

Indicates that the current cycle is ending soon.

cycle_ended

Indicates that the current cycle has ended.

order_cancelled

Notification that an existing order was cancelled.

order_executed

Notification that an existing order executed.

order_execution_prevented

Notification that an existing order was prevented from executing.

order_updated

Notification of an unsolicited change to an order’s state.

order_entered<simple_order<account_id>>

Notification that a new order was entered.

order_restated<simple_order<account_id>>

Notification that an order was restated.

order_entered<multi_leg_order<account_id>>

Notification that a new order was entered.

order_restated<multi_leg_order<account_id>>

Notification that an order was restated.

order_entered<full_order<account_id>>

Notification that a new order was entered.

order_restated<full_order<account_id>>

Notification that an order was restated.

order_action_rejected<cancel_order<order_id>>

Notification that an order cancel was rejected.

order_action_rejected<cancel_order<order_token>>

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.

order_action_rejected<enter_order<full_order<account_id>>>

Notification that a new order was rejected.

5.1.4. Position Data Messages

This message set includes the following messages:

Name Description

cycle_starting

Indicates a new cycle is starting.

cycle_started

Indicates a new cycle has started.

cycle_ending

Indicates that the current cycle is ending soon.

cycle_ended

Indicates that the current cycle has ended.

position

Position data for a current position.

position_consistency_marker

Notification that the position messages are in a consistent state.

positions_health

Notification of the current net health score for an account’s current positions.

positions_greeks

Notification of the current net greeks values for an account’s current positions.

position_risk

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

Heartbeat message used to keep a session alive.

login

Initiate user authentication.

logout

End user authentication.

request_stream

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

Heartbeat message used to keep a session alive.

login_accepted

Notification that a login was accepted.

login_rejected

Notification that a login was rejected.

session_started

Notification that a new session was started.

session_ended

Notification that the current session was ended.

channel_added

Notification that a new channel was added to the session.

channel_removed

Notification that a channel was removed from the session.

stream_started

Notification that a stream has started.

stream_ended

Notification that a stream has ended.

stream_resumed

Notification that a stream has resumed.

stream_rejected

Notification that a stream request was rejected.

message_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:

Table 8. cancel_order<order_id> fields
Name Type Description

existing_order

object with a single field "order_id" of type order_id

Identifies the order to be cancelled.

client_reference

Bytes

A client-generated hash value that represents the client-side inputs to an order transaction.

JSON Example
{
    "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:

Table 9. cancel_order<order_token> fields
Name Type Description

existing_order

object with a single field "order_token" of type order_token

Identifies the order to be cancelled.

client_reference

Bytes

A client-generated hash value that represents the client-side inputs to an order transaction.

JSON Example
{
    "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:

Table 10. channel_added fields
Name Type Description

timestamp

utc_timestamp

The time when the channel was added to the session.

channel_id

channel_id

The unique, server-assigned identifier for the channel.

next_sequence_number

sequence_number

The next sequence number for the next message to be generated on the channel.

oldest_sequence_number

sequence_number

The sequence number of the oldest message available on the channel.

default_stream_id

stream_id

Identifies the channel’s default stream.

JSON Example

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:

Table 11. channel_removed fields
Name Type Description

timestamp

utc_timestamp

The time when the channel was removed from the session.

channel_id

channel_id

The unique, server-assigned identifier for the channel.

JSON Example
{
    "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:

Table 12. cycle_ended fields
Name Type Description

cycle_id

utc_timestamp

A timestamp that uniquely identifies the current cycle.

next_cycle_id

utc_timestamp

A timestamp that uniquely identifies the next cycle, or 'none' if there will be no new cycle.

JSON Example
{
    "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:

Table 13. cycle_ending fields
Name Type Description

cycle_id

utc_timestamp

A timestamp that uniquely identifies the current cycle.

next_cycle_id

utc_timestamp

A timestamp that uniquely identifies the next cycle, or 'none' if there will be no new cycle.

JSON Example
{
    "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:

Table 14. cycle_started fields
Name Type Description

cycle_id

utc_timestamp

A timestamp that uniquely identifies the current cycle.

previous_cycle_id

utc_timestamp

A timestamp that uniquely identifies the previous cycle, or 'none' if there was no preceding cycle.

JSON Example
{
    "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:

Table 15. cycle_starting fields
Name Type Description

cycle_id

utc_timestamp

A timestamp that uniquely identifies the new cycle.

previous_cycle_id

utc_timestamp

A timestamp that uniquely identifies the previous cycle, or 'none' if there was no preceding cycle.

JSON Example
{
    "cycle_starting":{
        "cycle_id":"1618427227000000000",
        "previous_cycle_id":"1618426627000000000"
    }
}

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:

Table 16. deliverable<aliased_deliverable> fields
Name Type Description

deliverable_id

deliverable_id

The unique, exchange-assigned identifier for the deliverable.

symbol

String

A human-readable identifier for the deliverable.

tags

array of String

A collection of tags used for classifying the deliverable.

decimal_places

decimal_places

The number of decimal places used when expressing quantities and balances in terms of the deliverable.

listing_status

listing_status

The listing status of the deliverable.

details

object with a single field "aliased_deliverable" of type aliased_deliverable

Contains additional details describing the deliverable.

JSON Example
{
    "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:

Table 17. deliverable<exchange_token> fields
Name Type Description

deliverable_id

deliverable_id

The unique, exchange-assigned identifier for the deliverable.

symbol

String

A human-readable identifier for the deliverable.

tags

array of String

A collection of tags used for classifying the deliverable.

decimal_places

decimal_places

The number of decimal places used when expressing quantities and balances in terms of the deliverable.

listing_status

listing_status

The listing status of the deliverable.

details

object with a single field "exchange_token" of type exchange_token

Contains additional details describing the deliverable.

JSON Example
{
    "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:

Table 18. deliverable<exchange_trading_limit> fields
Name Type Description

deliverable_id

deliverable_id

The unique, exchange-assigned identifier for the deliverable.

symbol

String

A human-readable identifier for the deliverable.

tags

array of String

A collection of tags used for classifying the deliverable.

decimal_places

decimal_places

The number of decimal places used when expressing quantities and balances in terms of the deliverable.

listing_status

listing_status

The listing status of the deliverable.

details

object with a single field "exchange_trading_limit" of type exchange_trading_limit

Contains additional details describing the deliverable.

JSON Example
{
    "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:

Table 19. deliverable<fiat_currency> fields
Name Type Description

deliverable_id

deliverable_id

The unique, exchange-assigned identifier for the deliverable.

symbol

String

A human-readable identifier for the deliverable.

tags

array of String

A collection of tags used for classifying the deliverable.

decimal_places

decimal_places

The number of decimal places used when expressing quantities and balances in terms of the deliverable.

listing_status

listing_status

The listing status of the deliverable.

details

object with a single field "fiat_currency" of type fiat_currency

Contains additional details describing the deliverable.

JSON Example
{
    "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:

Table 20. deliverable<future> fields
Name Type Description

deliverable_id

deliverable_id

The unique, exchange-assigned identifier for the deliverable.

symbol

String

A human-readable identifier for the deliverable.

tags

array of String

A collection of tags used for classifying the deliverable.

decimal_places

decimal_places

The number of decimal places used when expressing quantities and balances in terms of the deliverable.

listing_status

listing_status

The listing status of the deliverable.

details

object with a single field "future" of type future

Contains additional details describing the deliverable.

JSON Example
{
    "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:

Table 21. deliverable<fx_spot> fields
Name Type Description

deliverable_id

deliverable_id

The unique, exchange-assigned identifier for the deliverable.

symbol

String

A human-readable identifier for the deliverable.

tags

array of String

A collection of tags used for classifying the deliverable.

decimal_places

decimal_places

The number of decimal places used when expressing quantities and balances in terms of the deliverable.

listing_status

listing_status

The listing status of the deliverable.

details

object with a single field "fx_spot" of type fx_spot

Contains additional details describing the deliverable.

JSON Example
{
    "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:

Table 22. deliverable<index> fields
Name Type Description

deliverable_id

deliverable_id

The unique, exchange-assigned identifier for the deliverable.

symbol

String

A human-readable identifier for the deliverable.

tags

array of String

A collection of tags used for classifying the deliverable.

decimal_places

decimal_places

The number of decimal places used when expressing quantities and balances in terms of the deliverable.

listing_status

listing_status

The listing status of the deliverable.

details

object with a single field "index" of type index

Contains additional details describing the deliverable.

JSON Example
{
    "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:

Table 23. deliverable<option> fields
Name Type Description

deliverable_id

deliverable_id

The unique, exchange-assigned identifier for the deliverable.

symbol

String

A human-readable identifier for the deliverable.

tags

array of String

A collection of tags used for classifying the deliverable.

decimal_places

decimal_places

The number of decimal places used when expressing quantities and balances in terms of the deliverable.

listing_status

listing_status

The listing status of the deliverable.

details

object with a single field "option" of type option

Contains additional details describing the deliverable.

JSON Example
{
    "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:

Table 24. deliverable<perpetual_future> fields
Name Type Description

deliverable_id

deliverable_id

The unique, exchange-assigned identifier for the deliverable.

symbol

String

A human-readable identifier for the deliverable.

tags

array of String

A collection of tags used for classifying the deliverable.

decimal_places

decimal_places

The number of decimal places used when expressing quantities and balances in terms of the deliverable.

listing_status

listing_status

The listing status of the deliverable.

details

object with a single field "perpetual_future" of type perpetual_future

Contains additional details describing the deliverable.

JSON Example
{
    "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:

Table 25. deliverable<stable_token> fields
Name Type Description

deliverable_id

deliverable_id

The unique, exchange-assigned identifier for the deliverable.

symbol

String

A human-readable identifier for the deliverable.

tags

array of String

A collection of tags used for classifying the deliverable.

decimal_places

decimal_places

The number of decimal places used when expressing quantities and balances in terms of the deliverable.

listing_status

listing_status

The listing status of the deliverable.

details

object with a single field "stable_token" of type stable_token

Contains additional details describing the deliverable.

JSON Example
{
    "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:

Table 26. display_order_added fields
Name Type Description

timestamp

utc_timestamp

The time when the order was added.

tradeable_entity_id

tradeable_entity_id

A unique, exchange-assigned identifier for the tradeable entity.

market_id

market_id

Identifies the target market for the order.

side

side

Whether the order is a buy or sell.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the displayed order.

display_price

price

The displayed price of the order. The number of decimal places is determined by the tradeable entity.

display_quantity

quantity

The displayed quantity of the order. The number of decimal places is determined by the tradeable entity.

JSON Example
{
    "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:

Table 27. display_order_deleted fields
Name Type Description

timestamp

utc_timestamp

The time when the order was deleted.

tradeable_entity_id

tradeable_entity_id

A unique, exchange-assigned identifier for the tradeable entity.

market_id

market_id

Identifies the target market for the order.

side

side

Whether the order is a buy or sell.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the displayed order.

JSON Example
{
    "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:

Table 28. display_order_executed fields
Name Type Description

timestamp

utc_timestamp

The time when the order was executed.

tradeable_entity_id

tradeable_entity_id

A unique, exchange-assigned identifier for the tradeable entity.

market_id

market_id

Identifies the target market for the order.

side

side

Whether the order is a buy or sell.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the displayed order.

executed_price

price

The price of the trade. The number of decimal places is determined by the tradeable entity.

executed_quantity

quantity

The quantity of the trade. The number of decimal places is determined by the tradeable entity.

trade_id

trade_id

The unique, exchange-assigned identifier for the trade.

JSON Example
{
    "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:

Table 29. display_order_updated fields
Name Type Description

timestamp

utc_timestamp

The time when the order was updated.

tradeable_entity_id

tradeable_entity_id

A unique, exchange-assigned identifier for the tradeable entity.

market_id

market_id

Identifies the target market for the order.

side

side

Whether the order is a buy or sell.

old_display_order_id

display_order_id

The current unique, exchange-assigned identifier for the displayed order.

new_display_order_id

display_order_id

The new unique, exchange-assigned identifier for the displayed order.

display_price

price

The displayed price of the order. The number of decimal places is determined by the tradeable entity.

display_quantity

quantity

The displayed quantity of the order. The number of decimal places is determined by the tradeable entity.

JSON Example
{
    "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:

Table 30. enter_order<full_order<account_id>> fields
Name Type Description

order_token

order_token

A client-generated unique order identifier.

client_reference

Bytes

A client-generated hash value that represents the client-side inputs to an order transaction.

new_order

object with a single field "full_order" of type full_order<account_id>

New order attributes.

JSON Example
{
    "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:

Table 31. enter_order<multi_leg_order<account_id>> fields
Name Type Description

order_token

order_token

A client-generated unique order identifier.

client_reference

Bytes

A client-generated hash value that represents the client-side inputs to an order transaction.

new_order

object with a single field "multi_leg_order" of type multi_leg_order<account_id>

New order attributes.

JSON Example
{
    "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:

Table 32. enter_order<simple_order<account_id>> fields
Name Type Description

order_token

order_token

A client-generated unique order identifier.

client_reference

Bytes

A client-generated hash value that represents the client-side inputs to an order transaction.

new_order

object with a single field "simple_order" of type simple_order<account_id>

New order attributes.

JSON Example
{
    "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:

Table 33. funding_rate fields
Name Type Description

timestamp

utc_timestamp

The time when the funding rate update was generated.

tradeable_entity_id

tradeable_entity_id

A unique, exchange-assigned identifier for the tradeable entity associated with this funding rate.

applies_from

utc_timestamp

The time from when the funding rate applies.

rate

basis_points

The rate as calculated in basis points.

mark_price

price

The mark price associated with the funding rate.

underlying_price

price

The underlying price associated with the funding rate.

JSON Example
{
    "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:

Table 34. heartbeat fields
Name Type Description

timestamp

utc_timestamp

The time when the heartbeat was generated.

JSON Example
{
    "heartbeat":{
        "timestamp":"1618427227000000000"
    }
}

5.2.31. login

Initiate user authentication.

Used to initiate user authentication.

This message defines the following fields:

Table 35. login fields
Name Type Description

credentials

String

Required credentials.

credentials_secret

String

Required credentials or none.

JSON Example
{
    "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:

Table 36. login_accepted fields
Name Type Description

timestamp

utc_timestamp

The time when the login was accepted.

JSON Example
{
    "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:

Table 37. login_rejected fields
Name Type Description

timestamp

utc_timestamp

The time when the login was rejected.

JSON Example
{
    "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.

JSON Example
{
    "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:

Table 38. message_rejected fields
Name Type Description

timestamp

utc_timestamp

The time when the message was rejected.

message_hash

Bytes

A hash of the rejected message, used to correlate the rejection with the original message.

text

String

Some text to indicate why the message was rejected.

JSON Example
{
    "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:

Table 39. multi_leg_display_order_added fields
Name Type Description

timestamp

utc_timestamp

The time when the order was added.

legs

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.

market_id

market_id

Identifies the target market for the order.

side

side

Whether the order is a buy or sell.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the displayed order.

display_price

price

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.

display_quantity

quantity

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.

JSON Example
{
    "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:

Table 40. multi_leg_display_order_deleted fields
Name Type Description

timestamp

utc_timestamp

The time when the order was deleted.

legs

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.

market_id

market_id

Identifies the target market for the order.

side

side

Whether the order is a buy or sell.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the displayed order.

JSON Example
{
    "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:

Table 41. multi_leg_display_order_executed fields
Name Type Description

timestamp

utc_timestamp

The time when the order was executed.

legs

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.

market_id

market_id

Identifies the target market for the order.

side

side

Whether the order is a buy or sell.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the displayed order.

executed_price

price

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.

executed_quantity

quantity

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.

JSON Example
{
    "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:

Table 42. multi_leg_display_order_updated fields
Name Type Description

timestamp

utc_timestamp

The time when the order was updated.

legs

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.

market_id

market_id

Identifies the target market for the order.

side

side

Whether the order is a buy or sell.

old_display_order_id

display_order_id

The current unique, exchange-assigned identifier for the displayed order.

new_display_order_id

display_order_id

The new unique, exchange-assigned identifier for the displayed order.

display_price

price

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.

display_quantity

quantity

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.

JSON Example
{
    "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.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:

Table 43. order_action_rejected<cancel_order<order_id>> fields
Name Type Description

timestamp

utc_timestamp

The time when the order action was rejected.

action

object with a single field "cancel_order" of type cancel_order<order_id>

A copy of the order action that was rejected.

reason

order_action_reject_reason

The reason the order action was rejected.

JSON Example
{
    "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:

Table 44. order_action_rejected<cancel_order<order_token>> fields
Name Type Description

timestamp

utc_timestamp

The time when the order action was rejected.

action

object with a single field "cancel_order" of type cancel_order<order_token>

A copy of the order action that was rejected.

reason

order_action_reject_reason

The reason the order action was rejected.

JSON Example
{
    "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:

Table 45. order_action_rejected<enter_order<full_order<account_id>>> fields
Name Type Description

timestamp

utc_timestamp

The time when the order action was rejected.

action

object with a single field "enter_order" of type enter_order<full_order<account_id>>

A copy of the order action that was rejected.

reason

order_action_reject_reason

The reason the order action was rejected.

JSON Example
{
    "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:

Table 46. order_action_rejected<enter_order<multi_leg_order<account_id>>> fields
Name Type Description

timestamp

utc_timestamp

The time when the order action was rejected.

action

object with a single field "enter_order" of type enter_order<multi_leg_order<account_id>>

A copy of the order action that was rejected.

reason

order_action_reject_reason

The reason the order action was rejected.

JSON Example
{
    "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:

Table 47. order_action_rejected<enter_order<simple_order<account_id>>> fields
Name Type Description

timestamp

utc_timestamp

The time when the order action was rejected.

action

object with a single field "enter_order" of type enter_order<simple_order<account_id>>

A copy of the order action that was rejected.

reason

order_action_reject_reason

The reason the order action was rejected.

JSON Example
{
    "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:

Table 48. order_cancelled fields
Name Type Description

timestamp

utc_timestamp

The time when the order was cancelled.

order_id

order_id

The unique, exchange-assigned identifier for the order.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the display order.

order_token

order_token

The client-generated unique identifier for the order.

client_reference

Bytes

The client-generated hash value that represents the client-side inputs to an order transaction.

reason

order_cancelled_reason

The reason the order was cancelled.

JSON Example
{
    "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:

Table 49. order_entered<full_order<account_id>> fields
Name Type Description

timestamp

utc_timestamp

The time when the order was entered.

order_id

order_id

The unique, exchange-assigned identifier for the order.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the display order.

order_token

order_token

The client-generated unique order identifier.

client_reference

Bytes

The client-generated hash value that represents the client-side inputs to an order transaction.

new_order

object with a single field "full_order" of type full_order<account_id>

The entered order attributes.

order_state

order_state

Whether the order is live or dead.

JSON Example
{
    "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:

Table 50. order_entered<multi_leg_order<account_id>> fields
Name Type Description

timestamp

utc_timestamp

The time when the order was entered.

order_id

order_id

The unique, exchange-assigned identifier for the order.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the display order.

order_token

order_token

The client-generated unique order identifier.

client_reference

Bytes

The client-generated hash value that represents the client-side inputs to an order transaction.

new_order

object with a single field "multi_leg_order" of type multi_leg_order<account_id>

The entered order attributes.

order_state

order_state

Whether the order is live or dead.

JSON Example
{
    "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:

Table 51. order_entered<simple_order<account_id>> fields
Name Type Description

timestamp

utc_timestamp

The time when the order was entered.

order_id

order_id

The unique, exchange-assigned identifier for the order.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the display order.

order_token

order_token

The client-generated unique order identifier.

client_reference

Bytes

The client-generated hash value that represents the client-side inputs to an order transaction.

new_order

object with a single field "simple_order" of type simple_order<account_id>

The entered order attributes.

order_state

order_state

Whether the order is live or dead.

JSON Example
{
    "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:

Table 52. order_executed fields
Name Type Description

timestamp

utc_timestamp

The time when the order was executed.

order_id

order_id

The unique, exchange-assigned identifier for the order.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the display order.

order_token

order_token

The client-generated unique identifier for the order.

executed_price

price

The price of the trade. The number of decimal places is determined by the tradeable entity.

executed_quantity

quantity

The quantity of the trade. The number of decimal places is determined by the tradeable entity.

counterparty_display_order_id

display_order_id

The unique, exchange-assigned identifier for the counterparty display order.

trade_id

trade_id

The unique, exchange-assigned identifier for the trade.

liquidity_flag

liquidity_flag

Whether the order was responsible for adding or taking liquidity.

JSON Example
{
    "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:

Table 53. order_execution_prevented fields
Name Type Description

timestamp

utc_timestamp

The time when the order was prevented from executing.

order_id

order_id

The unique, exchange-assigned identifier for the order.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the display order.

order_token

order_token

The client-generated unique identifier for the order.

prevented_price

price

The price of the trade that was prevented. The number of decimal places is determined by the tradeable entity.

prevented_quantity

quantity

The quantity of the trade that was prevented. The number of decimal places is determined by the tradeable entity.

decremented_quantity

quantity

The quantity decremented from the order. The number of decimal places is determined by the tradeable entity.

counterparty_display_order_id

display_order_id

The unique, exchange-assigned identifier for the counterparty display order.

liquidity_flag

liquidity_flag

Whether the order was responsible for adding or taking liquidity.

reason

order_execution_prevented_reason

The reason the order execution was prevented.

JSON Example
{
    "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:

Table 54. order_restated<full_order<account_id>> fields
Name Type Description

timestamp

utc_timestamp

The time when the order was restated.

order_id

order_id

The unique, exchange-assigned identifier for the order.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the display order.

order_token

order_token

The client-generated unique order identifier.

client_reference

Bytes

The client-generated hash value that represents the client-side inputs to an order transaction.

original_timestamp

utc_timestamp

The time when the order was originally entered.

original_order

object with a single field "full_order" of type full_order<account_id>

The original order attributes.

balance

quantity

The balance of the order that has not yet executed.

order_state

order_state

Whether the order is live or dead.

JSON Example
{
    "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:

Table 55. order_restated<multi_leg_order<account_id>> fields
Name Type Description

timestamp

utc_timestamp

The time when the order was restated.

order_id

order_id

The unique, exchange-assigned identifier for the order.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the display order.

order_token

order_token

The client-generated unique order identifier.

client_reference

Bytes

The client-generated hash value that represents the client-side inputs to an order transaction.

original_timestamp

utc_timestamp

The time when the order was originally entered.

original_order

object with a single field "multi_leg_order" of type multi_leg_order<account_id>

The original order attributes.

balance

quantity

The balance of the order that has not yet executed.

order_state

order_state

Whether the order is live or dead.

JSON Example
{
    "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:

Table 56. order_restated<simple_order<account_id>> fields
Name Type Description

timestamp

utc_timestamp

The time when the order was restated.

order_id

order_id

The unique, exchange-assigned identifier for the order.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the display order.

order_token

order_token

The client-generated unique order identifier.

client_reference

Bytes

The client-generated hash value that represents the client-side inputs to an order transaction.

original_timestamp

utc_timestamp

The time when the order was originally entered.

original_order

object with a single field "simple_order" of type simple_order<account_id>

The original order attributes.

balance

quantity

The balance of the order that has not yet executed.

order_state

order_state

Whether the order is live or dead.

JSON Example
{
    "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:

Table 57. order_updated fields
Name Type Description

timestamp

utc_timestamp

The time when the order was updated.

order_id

order_id

The unique, exchange-assigned identifier for the order.

display_order_id

display_order_id

The unique, exchange-assigned identifier for the display order.

order_token

order_token

The client-generated unique identifier for the order.

client_reference

Bytes

The client-generated hash value that represents the client-side inputs to an order transaction.

order_state

order_state

The current state of the order.

JSON Example
{
    "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:

Table 58. position fields
Name Type Description

timestamp

utc_timestamp

The time when the position was last updated.

account_id

account_id

The unique, exchange-assigned identifier for the account that is position is associated with.

product_deliverable_id

deliverable_id

A unique, exchange-assigned identifier for the product deliverable.

position_kind

position_kind

Whether the position kind is cash, realised, unrealised, margin or payoff.

product_type

product_type

Whether the product_type is reference_balance, balance, option, future or spot.

position_deliverable_id

deliverable_id

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.

value

position_value

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.

anchor_price

price

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.

balance

position_balance

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.

mark_price

price

The mark price for the position. The number of decimal places is determined by the position deliverable.

base_deliverable_id

deliverable_id

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.

source_type

position_source_type

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.

source_id

position_source_id

The source id contains any relevant id that triggered the position update, for example the trade_id in the case of a trade.

JSON Example
{
    "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:

Table 59. position_consistency_marker fields
Name Type Description

timestamp

utc_timestamp

The time when the marker was generated.

JSON Example
{
    "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:

Table 60. position_risk fields
Name Type Description

timestamp

utc_timestamp

The time when the position_risk was last updated.

account_id

account_id

The unique, exchange-assigned identifier for the account that the position risk is associated with.

product_deliverable_id

deliverable_id

A unique, exchange-assigned identifier for the product deliverable.

position_kind

position_kind

Whether the position kind is cash, realised, unrealised, margin, payoff, or risk

product_type

product_type

Whether the product_type is reference_balance, balance, option, future or spot.

position_deliverable_id

deliverable_id

A unique, exchange-assigned identifier for the position deliverable.

anchor_price

price

The anchor price for the position.

balance

position_balance

The number of the product deliverable held by the open position.

source_type

position_source_type

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.

greeks

greeks

The current greeks for the identified product deliverable.

JSON Example
{
    "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:

Table 61. positions_greeks fields
Name Type Description

timestamp

utc_timestamp

The time when the portfolio greeks were last updated.

account_id

account_id

The unique, exchange-assigned identifier for the account that the portfolio greeks are associated with.

greeks

greeks

The current greeks for the identified account.

JSON Example
{
    "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:

Table 62. positions_health fields
Name Type Description

timestamp

utc_timestamp

The time when the positions health was last updated.

account_id

account_id

The unique, exchange-assigned identifier for the account that the positions health is associated with.

score

percent

The current health score as a percentage as determined by the positions held for the account.

risk_status

positions_risk_status

The current risk status as determined by the positions held for the account.

JSON Example
{
    "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:

Table 63. reference_price fields
Name Type Description

timestamp

utc_timestamp

The time when the reference price update was generated.

tradeable_entity_id

tradeable_entity_id

A unique, exchange-assigned identifier for the tradeable entity.

market_id

market_id

Identifies the target market for the reference price update.

price

price

The price. The number of decimal places is determined by the tradeable entity.

price_type

reference_price_type

The type of the reference price update

JSON Example
{
    "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 oldest_sequence_number from channel_added)

0 ("none")

All messages in the channel. The stream ends when the channel is closed (meaning no further messages will be added).

0 ("none")

0 ("none")

All new messages in the channel from the time of the request. The stream ends when the channel is closed.

>0

0 ("none")

All messages in the channel starting from begin_sequence_number. The stream ends when the channel is closed.

0 ("none")

>0

All new messages in the channel until the message numbered with end_sequence_number. The stream ends when the last message in the range is sent.

>0

>0

All messages in the channel starting from begin_sequence_number and ending with end_sequence_number. The stream ends when the last message in the range is sent.

This message defines the following fields:

Table 64. request_stream fields
Name Type Description

channel_id

channel_id

A valid Channel Id in a multi-channel connection, or 0 ("none") if channels are not used.

begin_sequence_number

sequence_number

The sequence number of the first message in the range of messages being requested, or 0 ("none") to request only new messages.

end_sequence_number

sequence_number

The sequence number of the last message in the range of messages being requested, or 0 ("none") to leave the stream open and receive all messages until the end of the channel.

stream_id

stream_id

An optional, client-assigned stream identifier used for correlation with response messages.

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:

Table 65. session_ended fields
Name Type Description

timestamp

utc_timestamp

The time when the session was ended.

session_id

session_id

The unique, server-assigned identifier for the session.

reason

session_end_reason

The reason the session was ended.

JSON Example
{
    "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:

Table 66. session_started fields
Name Type Description

timestamp

utc_timestamp

The time when the session was started.

session_id

session_id

The unique, server-assigned identifier for the session.

default_channel_id

channel_id

Identifies the session’s default channel.

JSON Example
{
    "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:

Table 67. settlement_price fields
Name Type Description

timestamp

utc_timestamp

The time when the settlement price update was generated.

tradeable_entity_id

tradeable_entity_id

A unique, exchange-assigned identifier for the tradeable entity.

price

price

The price. The number of decimal places is determined by the tradeable entity.

price_type

settlement_price_type

The type of the settlement price update

settlement_event

zoned_datetime

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.

settlement_event_type

settlement_event_type

The type of the settlement event to which the price applies.

JSON Example
{
    "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:

Table 68. stream_ended fields
Name Type Description

timestamp

utc_timestamp

The time when the stream was ended.

channel_id

channel_id

A valid Channel Id in a multi-channel connection, or 0 ("none") if channels are not used.

stream_id

stream_id

A client-assigned stream identifier used for correlation with a request_stream message.

JSON Example
{
    "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:

Table 69. stream_rejected fields
Name Type Description

timestamp

utc_timestamp

The time when the stream request was rejected.

channel_id

channel_id

The Channel ID specified by the client in the request_stream message.

stream_id

stream_id

The client-assigned stream identifier used for correlation with a request_stream message.

reason

stream_reject_reason

The reason the request_stream message was rejected.

JSON Example
{
    "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:

Table 70. stream_resumed fields
Name Type Description

timestamp

utc_timestamp

The time when the stream was resumed.

channel_id

channel_id

A valid Channel Id in a multi-channel connection, or 0 ("none") if channels are not used.

next_sequence_number

sequence_number

The sequence number of the next message that will be transmitted as part of the stream.

stream_id

stream_id

The client-assigned stream identifier used for correlation with a request_stream message.

JSON Example
{
    "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:

Table 71. stream_started fields
Name Type Description

timestamp

utc_timestamp

The time when the stream was started.

channel_id

channel_id

A valid Channel Id in a multi-channel connection, or 0 ("none") if channels are not used.

begin_sequence_number

sequence_number

The sequence number of the first message that will be transmitted as part of the stream.

end_sequence_number

sequence_number

The sequence number of the last message that will be transmitted as part of the stream, or 0 ("none") if the stream will remain open until the channel is closed.

stream_id

stream_id

A client-assigned stream identifier used for correlation with a request_stream message.

JSON Example
{
    "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:

Table 72. time fields
Name Type Description

timestamp

utc_timestamp

The time when the message was generated.

JSON Example
{
    "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:

Table 73. top_of_book fields
Name Type Description

timestamp

utc_timestamp

The time when the top_of_book was generated.

tradeable_entity_id

tradeable_entity_id

A unique, exchange-assigned identifier for the tradeable entity.

market_id

market_id

Identifies the target market for the top-of-book information.

buy_price

price

The price of the best bid. The number of decimal places is determined by the tradeable entity.

buy_quantity

quantity

The total quantity at the best bid price. The number of decimal places is determined by the tradeable entity.

sell_price

price

The price of the best offer. The number of decimal places is determined by the tradeable entity.

sell_quantity

quantity

The total quantity at the best offer price. The number of decimal places is determined by the tradeable entity.

JSON Example
{
    "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:

Table 74. trade fields
Name Type Description

timestamp

utc_timestamp

The time when the trade was generated.

tradeable_entity_id

tradeable_entity_id

A unique, exchange-assigned identifier for the tradeable entity.

market_id

market_id

Identifies the target market for the trade.

trade_id

trade_id

The unique identifier for the trade.

price

price

The price of the trade. The number of decimal places is determined by the tradeable entity.

price_type

trade_price_type

Specifies how the price of the trade was determined.

quantity

quantity

The quantity of the trade. The number of decimal places is determined by the tradeable entity.

buy_display_order_id

display_order_id

The unique, exchange-assigned identifier of the display order on the buy side of the trade.

sell_display_order_id

display_order_id

The unique, exchange-assigned identifier of the display order on the sell side of the trade.

JSON Example
{
    "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:

Table 75. tradeable_entity<multi_market> fields
Name Type Description

tradeable_entity_id

tradeable_entity_id

The unique, exchange-assigned identifier for the tradeable entity.

symbol

String

A human-readable identifier for the tradeable entity.

tags

array of String

A collection of tags used for classifying the tradeable entity.

price_deliverable_id

deliverable_id

Identifies the deliverable used to express the price.

price_decimal_places

decimal_places

The number of decimal places used for prices.

quantity_deliverable_id

deliverable_id

Identifies the deliverable used to express the quantity.

quantity_decimal_places

decimal_places

The number of decimal places used for quantities.

buy_trading_limit_deliverable_id

deliverable_id

Identifies the deliverable used to express trading limits for buy side orders and trades.

sell_trading_limit_deliverable_id

deliverable_id

Identifies the deliverable used to express trading limits for sell side orders and trades.

tradeability

tradeability

Specifies the tradeability of a tradeable entity.

details

object with a single field "multi_market" of type multi_market

Contains additional details describing the tradeable entity.

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:

Table 76. tradeable_entity<simple_market> fields
Name Type Description

tradeable_entity_id

tradeable_entity_id

The unique, exchange-assigned identifier for the tradeable entity.

symbol

String

A human-readable identifier for the tradeable entity.

tags

array of String

A collection of tags used for classifying the tradeable entity.

price_deliverable_id

deliverable_id

Identifies the deliverable used to express the price.

price_decimal_places

decimal_places

The number of decimal places used for prices.

quantity_deliverable_id

deliverable_id

Identifies the deliverable used to express the quantity.

quantity_decimal_places

decimal_places

The number of decimal places used for quantities.

buy_trading_limit_deliverable_id

deliverable_id

Identifies the deliverable used to express trading limits for buy side orders and trades.

sell_trading_limit_deliverable_id

deliverable_id

Identifies the deliverable used to express trading limits for sell side orders and trades.

tradeability

tradeability

Specifies the tradeability of a tradeable entity.

details

object with a single field "simple_market" of type simple_market

Contains additional details describing the tradeable entity.

JSON Example
{
    "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:

Table 77. trading_rule fields
Name Type Description

tradeable_entity_id

tradeable_entity_id

The tradeable entity to which the rule applies. If none, applies to all tradeable entities.

market_id

market_id

The market to which the rule applies. If none, applies to all markets.

minimum_price

price

Specifies the minimum price on an order. The number of decimal places is determined by the tradeable entity.

maximum_price

price

Specifies the maximum price on an order. The number of decimal places is determined by the tradeable entity.

price_step

price

Specifies the valid price step for an order. The number of decimal places is determined by the tradeable entity.

minimum_quantity

quantity

Specifies the minimum quantity on an order. The number of decimal places is determined by the tradeable entity.

maximum_quantity

quantity

Specifies the maximum quantity on an order. The number of decimal places is determined by the tradeable entity.

quantity_step

quantity

Specifies the valid quantity step for an order. The number of decimal places is determined by the tradeable entity.

minimum_value

value

Specifies the minimum value of an order. The number of decimal places is determined by the tradeable entity.

maximum_value

value

Specifies the maximum value of an order. The number of decimal places is determined by the tradeable entity.

JSON Example
{
    "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:

Table 78. trading_state fields
Name Type Description

timestamp

utc_timestamp

The time when the trading state was reported.

tradeable_entity_id

tradeable_entity_id

The tradeable entity to which the state applies.

market_id

market_id

The market to which the state applies.

suspension_status

suspension_status

Whether trading is active or suspended.

expiry_status

expiry_status

Whether the tradeable entity is active or expired.

settlement_event

zoned_datetime

The date and time against which trades will be recorded.

JSON Example
{
    "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:

Table 79. aliased_deliverable fields
Name Type Description

aliased_deliverable_id

deliverable_id

The deliverable ID that is being aliased.

5.3.2. date

Represents a calendar date.

This structure defines the following fields:

Table 80. date fields
Name Type Description

year

year

The four digit year.

month

month

The month (1-12).

day

day

The day of the month (1-31).

5.3.3. datetime

Represents a datetime.

This structure defines the following fields:

Table 81. datetime fields
Name Type Description

date

date

The date.

time

time_of_day

The time of day.

5.3.4. exchange_token

Contains reference data associated with an exchange token.

This structure defines the following fields:

Table 82. exchange_token fields
Name Type Description

common_name

String

The common name of the exchange token.

ledger_name

String

The name of the exchange token’s anchoring ledger.

ledger_address

Bytes

The address of the exchange token on the ledger, if any.

minor_units

decimal_places

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:

Table 83. exchange_trading_limit fields
Name Type Description

quote_deliverable_id

deliverable_id

The deliverable that is being bought or sold in exchange for the quote deliverable.

side

side

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:

Table 84. fiat_currency fields
Name Type Description

currency

String

The ISO 4217 name of the currency.

code

String

The ISO 4217 alphabetic code for the currency.

number

iso4217_currency_number

The ISO 4217 numeric code for the currency.

minor_units

decimal_places

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:

Table 85. full_order<account_id> fields
Name Type Description

tradeable_entity_id

tradeable_entity_id

Identifies the target tradeable entity for the order.

market_id

market_id

Identifies the target market for the order.

side

side

Whether the order is a buy or sell.

time_in_force

time_in_force

Specifies how long the order remains valid.

time_to_live

time_to_live

In conjunction with time_in_force, specifies how long the order remains valid.

quantity

quantity

The quantity of the order. The number of decimal places is determined by the tradeable entity.

minimum_quantity

quantity

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.

price

price

Order price. 9223372036854775807 ("none") denotes a market order. The number of decimal places is determined by the tradeable entity.

party_data

object with a single field "account_id" of type account_id

Contains attributes identifying the party associated with the order.

execution_instructions

optional array of execution_instruction

Contains optional instructions specifying how an order should be handled.

trigger_instructions

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:

Table 86. future fields
Name Type Description

expiry

zoned_datetime

The expiry for the future.

delivery_style

delivery_style

The future delivery style.

underlying_deliverable_id

deliverable_id

Denotes the unique deliverable_id assigned to the underlying security within exchange.

contract_size_deliverable_id

deliverable_id

Identifies the deliverable used to express the contract size.

contract_size

contract_size

Specifies the contract size.

settlement_deliverable_id

deliverable_id

Identifies the deliverable used to express settlement values.

utc_creation_time

utc_timestamp

The UTC time when the future was created.

creation_source_id

creation_source_id

The creation source ID for the future.

margin_spec_id

margin_spec_id

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:

Table 87. fx_spot fields
Name Type Description

base_deliverable_id

deliverable_id

The deliverable that is being bought or sold in exchange for the quote deliverable.

quote_deliverable_id

deliverable_id

The deliverable that is being paid to secure the base deliverable.

contract_size

contract_size

Specifies the contract size.

5.3.10. greeks

Represents each of the greek values.

This structure defines the following fields:

Table 88. greeks fields
Name Type Description

delta

scaled_fixed_point

How much an options price is expected to change per $1 change in the underlying.

theta

scaled_fixed_point

The change in the price of an option for a one-day decrease in its time to expiration.

gamma

scaled_fixed_point

The rate of change in an options delta per $1 change in the price of the underlying.

vega

scaled_fixed_point

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:

Table 89. index fields
Name Type Description

base_deliverable_id

deliverable_id

The deliverable that is being priced in reference to the quote deliverable.

quote_deliverable_id

deliverable_id

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:

Table 90. multi_leg_order<account_id> fields
Name Type Description

legs

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.

market_id

market_id

Identifies the target market for the order. Must be a valid ID for all tradeable entities in the legs.

side

side

Whether the order is a buy or sell.

time_in_force

time_in_force

Specifies how long the order remains valid.

time_to_live

time_to_live

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.

quantity

quantity

The quantity of the order. The number of decimal places is the smallest quantity_decimal_places value for the tradeable entities in the legs.

minimum_quantity

quantity

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.

price

price

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.

party_data

object with a single field "account_id" of type account_id

Contains attributes identifying the party associated with the order.

execution_instructions

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:

Table 91. multi_market fields
Name Type Description

market_ids

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:

Table 92. option fields
Name Type Description

expiry

zoned_datetime

The expiry for the option.

strike_price

price

The option strike price.

option_type

option_type

The option type (Put or Call).

exercise_style

option_exercise_style

The exercise style of the option.

valuation_approach

option_valuation_approach

The valuation approach of the option.

delivery_style

delivery_style

The option delivery style.

underlying_deliverable_id

deliverable_id

Denotes the unique deliverable_id assigned to the underlying security within exchange.

contract_size_deliverable_id

deliverable_id

Identifies the deliverable used to express the contract size.

contract_size

contract_size

Specifies the contract size. Uses the decimals specified on the corresponding contract deliverable.

settlement_deliverable_id

deliverable_id

Identifies the deliverable used to express settlement values.

utc_creation_time

utc_timestamp

The UTC time when the option was created.

creation_source_id

creation_source_id

The creation source ID for the option.

margin_spec_id

margin_spec_id

Identifies the margin specification to be used for the option.

strikes_spec_id

strikes_spec_id

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:

Table 93. perpetual_future fields
Name Type Description

funding_period

time_of_day

The funding period over which funding occures, expressed in hours, minutes and seconds.

funding_reference_time

zoned_datetime

A date time that represents the reference time for funding periods.

funding_spec_id

funding_spec_id

Identifies the funding specification to be used for the perpetual future.

underlying_deliverable_id

deliverable_id

Denotes the unique deliverable_id assigned to the underlying security within exchange.

contract_size_deliverable_id

deliverable_id

Identifies the deliverable used to express the contract size.

contract_size

contract_size

Specifies the contract size.

settlement_deliverable_id

deliverable_id

Identifies the deliverable used to express settlement values.

utc_creation_time

utc_timestamp

The UTC time when the perpetual future was created.

creation_source_id

creation_source_id

The creation source ID for the perpetual future.

margin_spec_id

margin_spec_id

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:

Table 94. simple_market fields
Name Type Description

market_id

market_id

The market identifier.

settlement_event

zoned_datetime

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:

Table 95. simple_order<account_id> fields
Name Type Description

tradeable_entity_id

tradeable_entity_id

Identifies the target tradeable entity for the order.

market_id

market_id

Identifies the target market for the order.

side

side

Whether the order is a buy or sell.

time_in_force

time_in_force

Specifies how long the order remains valid.

time_to_live

time_to_live

In conjunction with time_in_force, specifies how long the order remains valid.

quantity

quantity

The quantity of the order. The number of decimal places is determined by the tradeable entity.

price

price

Order price. 9223372036854775807 ("none") denotes a market order. The number of decimal places is determined by the tradeable entity.

party_data

object with a single field "account_id" of type account_id

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:

Table 96. stable_token fields
Name Type Description

common_name

String

The common name of the exchange token.

ledger_name

String

The name of the exchange tokens anchoring ledger.

ledger_address

Bytes

The address of the exchange token on the ledger, if any.

minor_units

decimal_places

The minor units supported for the token.

stabilisation_approach

stabilisation_approach

The stabilisation approach used by the stable token.

backing_deliverable_id

deliverable_id

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:

Table 97. time_of_day fields
Name Type Description

hours

hours

The hours (0-23).

minutes

minutes

The minutes (0-59).

seconds

seconds

The seconds (0-59).

nanoseconds

nanoseconds

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:

Table 98. tradeable_entity_leg fields
Name Type Description

tradeable_entity_id

tradeable_entity_id

The tradeable entity ID of the leg.

ratio

leg_ratio

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:

Table 99. trigger_instructions fields
Name Type Description

event_type

trigger_event_type

The type of event when the trigger will be hit.

tradeable_entity_id

tradeable_entity_id

Identifies the tradeable entity against which the trigger price will be compared.

market_id

market_id

Identifies the market against which the trigger price will be compared.

price_type

trigger_price_type

The type of the price in the target tradeable entity and market that the price is compared to.

price_direction

trigger_price_direction

Whether the order is triggered based on a movement up or down through the trigger price.

price

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:

Table 100. zoned_datetime fields
Name Type Description

datetime

datetime

The date and time of day.

timezone

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:

Table 101. account_id constants
Value Equivalent integer Description

"none"

18446744073709551615

A constant used to specify no account ID.

"all"

18446744073709551614

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:

Table 102. basis_points constants
Value Equivalent integer Description

"none"

9223372036854775807

(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:

Table 103. channel_id constants
Value Equivalent integer Description

"none"

0

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:

Table 104. contract_size constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 105. creation_source_id constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 106. day constants
Value Equivalent integer Description

"none"

255

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:

Table 107. decimal_places constants
Value Equivalent integer Description

"none"

255

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:

Table 108. deliverable_id constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 109. delivery_style constants
Value Equivalent integer Description

"physical"

80

The derivative settlement deliverable is the same as the quantity deliverable.

"cash"

67

The derivative settlement deliverable is a cash-style deliverable.

"non_deliverable"

78

The derivative is non-deliverable.

"elect_at_exercise"

69

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:

Table 110. display_order_id constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 111. execution_instruction constants
Value Equivalent integer Description

"participate_do_not_initiate"

54

The order will participate in a match only when it is a passive order. It will not initiate a match as an aggressor.

"do_not_participate"

68

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:

Table 112. expiry_status constants
Value Equivalent integer Description

"active"

65

The entity is active.

"expired"

69

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:

Table 113. funding_spec_id constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 114. hours constants
Value Equivalent integer Description

"none"

255

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:

Table 115. iso4217_currency_number constants
Value Equivalent integer Description

"none"

65535

(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:

Table 116. leg_ratio constants
Value Equivalent integer Description

"none"

32767

(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:

Table 117. liquidity_flag constants
Value Equivalent integer Description

"added"

65

Liquidity was added

"taken"

84

Liquidity was taken

"neither"

78

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:

Table 118. listing_status constants
Value Equivalent integer Description

"active"

65

An active deliverable.

"delisted"

88

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:

Table 119. margin_spec_id constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 120. market_id constants
Value Equivalent integer Description

"none"

255

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:

Table 121. minutes constants
Value Equivalent integer Description

"none"

255

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:

Table 122. month constants
Value Equivalent integer Description

"none"

255

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:

Table 123. nanoseconds constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 124. option_exercise_style constants
Value Equivalent integer Description

"european"

69

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:

Table 125. option_type constants
Value Equivalent integer Description

"call"

67

Call option.

"put"

80

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:

Table 126. option_valuation_approach constants
Value Equivalent integer Description

"vanilla"

86

The option is a Vanilla option.

"asian"

65

The option is an Asian option.

"digital"

68

The option is Digital (Binary) option.

"barrier"

66

The option is a Barrier option.

"digital_barrier"

71

The option is a Digital Barrier option.

"loopback"

76

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:

Table 127. order_action_reject_reason constants
Value Equivalent integer Description

"invalid_tradeable_entity"

1

Invalid tradeable entity

"invalid_fields"

2

Invalid fields

"fill_side_empty"

3

Fill side empty

"no_orders_to_peg_to"

4

No orders to peg to

"invalid_this_period"

5

Invalid this period

"invalid_order_flow"

6

Invalid order flow

"illegal_order_flow"

7

Illegal order flow

"trading_suspended"

8

Trading suspended

"invalid_participant"

9

Invalid participant

"invalid_account"

10

Invalid account

"insufficient_account_balance"

11

Insufficient account balance

"invalid_market"

12

Invalid market

"account_suspended"

13

The account is suspended

"expired_tradeable_entity"

14

The tradeable entity has expired

"invalid_quantity_deliverable"

15

Invalid quantity deliverable

"invalid_trading_limit_deliverable"

16

Invalid trading limit deliverable

"deliverable_is_not_a_derivative"

17

The deliverable is not a derivative

"price_less_than_minimum_price"

18

The price of the order is less than the minimum price allowed by the trading rules that are currently in force.

"price_greater_than_maximum_price"

19

The price of the order is greater than the maximum price allowed by the trading rules that are currently in force.

"price_not_a_valid_price_step"

20

The price of the order is not on an allowed price step as required by the trading rules that are currently in force.

"quantity_less_than_minimum_quantity"

21

The quantity of the order is less than the minimum quantity allowed by the trading rules that are currently in force.

"quantity_greater_than_maximum_quantity"

22

The quantity of the order is greater than the maximum quantity allowed by the trading rules that are currently in force.

"quantity_not_a_valid_quantity_step"

23

The quantity of the order is not on an allowed quantity step as required by the trading rules that are currently in force.

"order_value_greater_than_maximum_supported"

24

The value of the order is greater than the maximum supported.

"order_value_less_than_minimum_allowed"

25

The value of the order is less than the minimum value allowed by the trading rules that are currently in force.

"order_value_greater_than_maximum_allowed"

26

The value of the order is greater than the maximum value allowed by the trading rules that are currently in force.

"invalid_legs"

27

The legs of the multi-leg order do not conform to the rules on tradeable entity ordering, uniqueness, and ratios.

"invalid_trigger_instructions"

28

The trigger instructions of the full order do not conform to the supported rules for triggered orders.

"too_many_trigger_orders"

29

There are too many existing trigger orders

"invalid_execution_instructions"

30

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:

Table 128. order_cancelled_reason constants
Value Equivalent integer Description

"user_cancelled"

1

The order was cancelled by the user.

"immediate_with_insufficient_liquidity"

2

There was insufficient liquidity to match the immediate order.

"timeout"

3

The order timed out due to its time_in_force attribute.

"liquidation"

4

The order was cancelled during account liquidation.

"insufficient_account_balance"

5

The order was cancelled due to an insufficient account balance.

"invalid_pending_order_flow"

6

The order was cancelled because this type of order cannot be in a pending state.

"too_many_pending_orders"

7

The order was cancelled as concurrent pending orders on the same deliverable are not allowed.

"disconnection"

8

The order was cancelled as the cancel-on-disconnect setting applies to the endpoint, and a disconnection event occurred.

"supervisory"

9

The order was cancelled by a market supervisor.

"would_initiate"

10

The order was cancelled as it was marked participate-do-not-initiate and would have initiated a match.

"would_participate"

11

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:

Table 129. order_execution_prevented_reason constants
Value Equivalent integer Description

"self_trade"

1

The order would have resulted in the party trading with itself.

"market_maker"

2

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:

Table 130. order_id constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 131. order_state constants
Value Equivalent integer Description

"accepted"

65

The order has been accepted and is eligible for matching.

"pending"

80

The order is pending and not yet eligible for matching.

"untriggered"

85

The order is a triggered order and has not yet been triggered.

"expired"

69

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:

Table 132. order_token constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 133. percent constants
Value Equivalent integer Description

"none"

9223372036854775807

(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:

Table 134. position_balance constants
Value Equivalent integer Description

"none"

9223372036854775807

(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:

Table 135. position_kind constants
Value Equivalent integer Description

"cash"

67

Cash position.

"realised"

82

Realised position.

"unrealised"

85

Unrealised position.

"margin"

77

Margin position.

"payoff"

80

Payoff position.

"payout"

70

Payout (funding) position.

"expired"

69

The position is Expired but not yet realised.

"funding_due"

68

The position is no longer held but is due a funding payment.

"trading_limit"

84

The position that represents the locked trading limit.

"risk"

75

The risk metrics (E.g. the Greeks) that are set for a position.

"unrealised_pending_buy_orders"

90

Unrealised position based on pending buy orders.

"unrealised_pending_sell_orders"

79

Unrealised position based on pending sell orders.

"margin_pending_buy_orders"

89

Margin position based on pending buy orders.

"margin_pending_sell_orders"

65

Margin position based on pending sell orders.

"unrealised_open_buy_orders"

88

Unrealised position based on open buy orders.

"unrealised_open_sell_orders"

73

Unrealised position based on sell orders.

"margin_open_buy_orders"

87

Margin position based on open buy orders.

"margin_open_sell_orders"

74

Margin position based on open sell orders.

"cash_pending_buy_orders"

72

Cash position based on pending buy orders.

"cash_pending_sell_orders"

71

Cash position based on pending sell orders.

"cash_open_buy_orders"

83

Cash position based on open buy orders.

"cash_open_sell_orders"

76

Cash position based on open sell orders.

"cash_open_buy_orders_committed"

66

Cash position based on long open orders commitments.

"cash_open_sell_orders_committed"

78

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:

Table 136. position_source_id constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 137. position_source_type constants
Value Equivalent integer Description

"deposit"

68

The position update was triggered by a deposit.

"withdrawal"

87

The position update was triggered by a withdrawal.

"trade"

84

The position update was triggered by a trade.

"expiry"

69

The position update was triggered by an expiry.

"mark_to_market"

70

The position update was triggered by a mark to market settlement.

"mark_price"

77

The position update was triggered by a change in mark price.

"settlement_price"

83

The position update was triggered by a change in settlement price.

"funding_rate"

80

The position update was triggered by a new funding rate.

"portfolio_risk_engine"

82

The position update was triggered by a message from a portfolio risk engine.

"holdings_data"

72

The position update was triggered by a message from the holdings and registry facility.

"restatement"

88

The position update was triggered by the start of a cycle.

"order"

79

The position update was by a pending order.

"none"

78

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:

Table 138. position_value constants
Value Equivalent integer Description

"none"

9223372036854775807

(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:

Table 139. positions_risk_status constants
Value Equivalent integer Description

"normal"

78

The positions have a normal risk status.

"at_risk"

82

The positions are considered 'At Risk' and some restrictions will apply.

"critical"

67

The positions are considered 'Critical' and full trading restrictions will apply.

"liquidate"

76

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:

Table 140. price constants
Value Equivalent integer Description

"none"

9223372036854775807

(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:

Table 141. product_type constants
Value Equivalent integer Description

"reference_balance"

82

Balance positions for the reference currency.

"balance"

66

Balance.

"spot"

83

Spot.

"future"

70

Future.

"option"

79

Option.

"none"

78

No product.

"trading_limit"

84

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:

Table 142. quantity constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 143. reference_price_type constants
Value Equivalent integer Description

"reference"

82

Reference price.

"close"

67

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:

Table 144. scaled_fixed_point constants
Value Equivalent integer Description

"none"

9223372036854775807

(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:

Table 145. seconds constants
Value Equivalent integer Description

"none"

255

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:

Table 146. sequence_number constants
Value Equivalent integer Description

"none"

0

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:

Table 147. session_end_reason constants
Value Equivalent integer Description

"logout"

1

The session was ended due to a logout request from the client.

"timeout"

2

The session was ended due to an inactivity timeout.

"stopped"

3

The session was ended due to the server component being stopped.

"violation"

4

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:

Table 148. session_id constants
Value Equivalent integer Description

"none"

0

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:

Table 149. settlement_event_type constants
Value Equivalent integer Description

"cyclical"

67

The settlement event is cyclical, such as a daily settlement.

"expiry"

69

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:

Table 150. settlement_price_type constants
Value Equivalent integer Description

"interim_price"

73

Interim price.

"final_price"

70

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:

Table 151. side constants
Value Equivalent integer Description

"buy"

66

Buy order.

"sell"

83

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:

Table 152. stabilisation_approach constants
Value Equivalent integer Description

"fiat_backed"

70

The token is backed by a fiat currency, either directly, or by pegging, or against a basket.

"asset_backed"

65

The token is backed by an asset, such as commodities like gold price or other kinds of assets.

"token_backed"

84

The token is backed by other cryptoasset tokens, such as a diversified basket.

"unbacked"

85

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:

Table 153. stream_id constants
Value Equivalent integer Description

"none"

0

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:

Table 154. stream_reject_reason constants
Value Equivalent integer Description

"invalid_channel_id"

1

The channel ID did not refer to a known channel

"invalid_sequence_number"

2

The begin or end sequence number was invalid

"stream_id_in_use"

3

The stream ID is already being used for another active stream.

"too_many_streams"

4

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:

Table 155. strikes_spec_id constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 156. suspension_status constants
Value Equivalent integer Description

"active"

65

The entity is active.

"suspended"

83

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:

Table 157. time_in_force constants
Value Equivalent integer Description

"good_for_cycles"

67

Good for the number of system cycles specified in time_to_live.

"immediate_or_cancel"

73

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:

Table 158. time_to_live constants
Value Equivalent integer Description

"none"

65535

(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:

Table 159. trade_id constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 160. trade_price_type constants
Value Equivalent integer Description

"passive"

80

The trade occurred during continuous matching and uses the price of the passive order.

"equilibrium"

69

The trade occurred during an auction and uses a calculated equilibrium price.

"multi_leg_to_multi_leg"

77

The trade was between two multi-leg orders and uses a price derived from one of the legs.

"off_market"

79

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:

Table 161. tradeability constants
Value Equivalent integer Description

"tradeable"

84

Can enter orders.

"display_only"

68

Cannot enter orders, but we may publish market data.

"non_tradeable"

78

Cannot enter orders, no market data.

"delisted"

88

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:

Table 162. tradeable_entity_id constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 163. trigger_event_type constants
Value Equivalent integer Description

"partial_execution"

69

The order is triggered by partial execution at the trigger price.

"price_movement"

80

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:

Table 164. trigger_price_direction constants
Value Equivalent integer Description

"up"

85

The order is triggered if the price goes up to or through the specified price.

"down"

68

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:

Table 165. trigger_price_type constants
Value Equivalent integer Description

"best_bid"

66

The specified trigger price is compared against the best bid.

"best_offer"

79

The specified trigger price is compared against the best offer.

"last_trade"

84

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:

Table 166. utc_timestamp constants
Value Equivalent integer Description

"none"

18446744073709551615

(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:

Table 167. value constants
Value Equivalent integer Description

"none"

170141183460469231731687303715884105727

(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:

Table 168. year constants
Value Equivalent integer Description

"none"

65535

(max unsigned 16-bit integer)

A constant used to specify no year.

6. Revision History

Table 169. revision history:
Date Version Notes

2022/08/31

2.4

Adding optional "execution_instructions" into "multi_leg_order";

adding "participate_do_not_initiate" into execution_instruction;

adding "would_participate" into order_cancelled_reason.

2022/08/19

2.3

Adding "reason" into session_ended

2022/08/14

2.2

Adding tradeable_entity<multi_market>