> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ai.exchange/llms.txt
> Use this file to discover all available pages before exploring further.

# Websocket orders

## Quickstart

### 1. Get a token

```bash theme={null}
curl -s -X POST https://gateway.sandbox.ai.exchange/api/authenticate \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","api_secret":"YOUR_SECRET","expiration_seconds":3600}'
# Response: {"token":"<bearer-token>"}
```

### 2. Connect to the WebSocket

Pass the token as an `Authorization` header on the WebSocket upgrade request. Invalid or missing tokens are rejected with HTTP 401 before the connection is established.

```bash wscat theme={null}
# Store the token
TOKEN=$(curl -s -X POST https://gateway.sandbox.ai.exchange/api/authenticate \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","api_secret":"YOUR_SECRET","expiration_seconds":3600}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['token'])")

# Connect
wscat -c wss://gateway.sandbox.ai.exchange/orders/ws \
  -H "Authorization: Bearer $TOKEN"
```

```bash websocat theme={null}
# Store the token
TOKEN=$(curl -s -X POST https://gateway.sandbox.ai.exchange/api/authenticate \
  -H "Content-Type: application/json" \
  -d '{"api_key":"YOUR_KEY","api_secret":"YOUR_SECRET","expiration_seconds":3600}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['token'])")

# Connect
websocat -H="Authorization: Bearer $TOKEN" \
  wss://gateway.sandbox.ai.exchange/orders/ws
```

Replace `gateway.sandbox.ai.exchange` with `gateway.ai.exchange` for production.

### 3. Login response

On successful connection, the server sends a login response with `rid: 0` containing your user ID and your open orders. `o` is `null` when you have no open orders:

```json theme={null}
{"rid":0,"res":{"li":"01KB4E-MGKR-HXEG","o":null,"cod":false}}
```

### 4. Place an order

```json theme={null}
{"rid":1,"t":"p","s":"JPYUSD-2027-MAR","d":"B","q":100,"p":"0.006500","tif":"DAY","po":false}
```

AI Exchange accepts `DAY` and `IOC` for `tif`, and rejects `GTC`. It does not accept post-only orders: a request with `po: true` is rejected with code 400. See [Order and market data rules](https://docs.ai.exchange/guides/getting-started/order-rules.md).

The server responds with the order ID:

```json theme={null}
{"rid":1,"res":{"oid":"O-01ARZ3NDEKTSV4RRFFQ69G5FAV"}}
```

You then receive order lifecycle events as they happen (acknowledged `t="n"`, filled `t="f"`, canceled `t="c"`, rejected `t="j"`).

## Cancel on Disconnect

To automatically cancel all orders placed during a WebSocket session when the connection drops, pass the `cancel_on_disconnect` query parameter when opening the connection:

```js theme={null}
var ws = new WebSocket(
  'wss://gateway.sandbox.ai.exchange/orders/ws?cancel_on_disconnect=true'
);
```

```bash wscat theme={null}
wscat -c "wss://gateway.sandbox.ai.exchange/orders/ws?cancel_on_disconnect=true" \
  -H "Authorization: Bearer $TOKEN"
```

```bash websocat theme={null}
websocat -H="Authorization: Bearer $TOKEN" \
  "wss://gateway.sandbox.ai.exchange/orders/ws?cancel_on_disconnect=true"
```

Only orders sent on that specific connection are canceled; orders placed via other connections or the REST API are unaffected.

## Estimated funding rate

Request the live estimated funding rate for a symbol with a `t="ef"` message:

```json theme={null}
{"rid":6,"t":"ef","symbol":"WTI-PERP"}
```

The server replies with the estimate, correlated by `rid`:

```json theme={null}
{"rid":6,"res":{"symbol":"WTI-PERP","status":"ready","funding_rate":"0.00012","funding_amount":"6.00","benchmark_price":"50005.00","settlement_price":"50010.00","timestamp":"2021-01-01T00:00:00Z"}}
```

`status` is one of `ready`, `settlement_pending`, or `unavailable`. The numeric fields are populated only when `status` is `ready`; otherwise `res.reason` explains why no estimate is available. The same estimate is also published on the market data ticker stream — see [Websocket marketdata](https://docs.ai.exchange/api-reference/marketdata/md-ws.md).


## AsyncAPI

````yaml openapi/asyncapi-order-gateway.bundled.json orders
id: orders
title: Orders
description: ''
servers:
  - id: production
    protocol: wss
    host: gateway.ai.exchange
    bindings: []
    variables: []
  - id: sandbox
    protocol: wss
    host: gateway.sandbox.ai.exchange
    bindings: []
    variables: []
address: /orders/ws
parameters: []
bindings: []
operations:
  - &ref_2
    id: clientRequest
    title: Client request
    type: receive
    messages:
      - &ref_5
        id: placeOrderRequest
        contentType: application/json
        payload:
          - name: Place Order Request
            description: Request to place a new order (t="p")
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID for correlating response
                required: true
              - name: t
                type: string
                description: Message type (place order)
                required: true
              - name: s
                type: string
                description: Order symbol (e.g. XAU-PERP, EURUSD-PERP)
                required: true
              - name: d
                type: string
                description: Order side (B=Buy, S=Sell)
                enumValues:
                  - B
                  - S
                required: true
              - name: q
                type: integer
                description: Order quantity in contracts
                required: true
              - name: p
                type: string
                description: Order price in USD as decimal string
                required: true
              - name: tif
                type: string
                description: Time in force (e.g. GTC, IOC, DAY)
                required: true
              - name: po
                type: boolean
                description: >-
                  Whether the order is post-only (maker-or-cancel). Defaults to
                  false.
                required: false
              - name: rb
                type: string
                description: >
                  Optional reprice behavior. When post-only is `true`, then this
                  selects what happens if the order would cross on entry.
                  Defaults to `rej`.


                  - `rej` ("reject") rejects a post-only order that would
                  execute.

                  - `bo` ("behind opposite") reprices to be one tick less
                  aggressive than the opposite side.

                  - `tbl` ("to best limit") reprices to the best price on the
                  same side of the book.
                enumValues:
                  - rej
                  - bo
                  - tbl
                required: false
              - name: tag
                type: string
                description: Optional order tag (max 10 alphanumeric characters)
                required: false
              - name: bid
                type: string
                description: >-
                  Optional ID of the partner software or broker that sends this
                  order; 3 to 10 letters or digits, case-insensitive. The
                  integration sets it, not the user. `tag` is for the user's own
                  labels.
                required: false
              - name: cid
                type: integer
                description: >-
                  Optional client order ID. Must be unique among the user's open
                  orders; the server rejects placement if the cid is already in
                  use. When an order is replaced, the replacement inherits the
                  original's cid.
                required: false
              - name: st
                type: string
                description: >
                  Optional self-trade prevention behavior for place-order
                  requests. Defaults to `CancelIncoming`.


                  The short aliases `xi`, `xr`, and `xb` are accepted on input
                  only (for

                  `CancelIncoming`, `CancelResting`, and `CancelBoth`
                  respectively); the

                  server always normalizes to and emits the long form.


                  - `CancelIncoming`: cancel the incoming aggressor order;
                  resting orders remain on the book.

                  - `CancelResting`: cancel resting orders that would
                  self-match; allow the incoming aggressor order.

                  - `CancelBoth`: cancel both the resting orders and incoming
                  aggressor order.
                enumValues:
                  - CancelIncoming
                  - CancelResting
                  - CancelBoth
                  - xi
                  - xr
                  - xb
                required: false
              - name: aid
                type: string
                description: >-
                  Optional owning account the order is placed on. If omitted,
                  the account is inferred from the connection — the user's
                  default account, or the session's account for an
                  account-scoped connection.
                required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
              - t
              - s
              - d
              - q
              - p
              - tif
            properties:
              rid:
                type: integer
                description: Request ID for correlating response
                x-parser-schema-id: <anonymous-schema-2>
              t:
                type: string
                const: p
                description: Message type (place order)
                x-parser-schema-id: <anonymous-schema-3>
              s:
                type: string
                description: Order symbol (e.g. XAU-PERP, EURUSD-PERP)
                x-parser-schema-id: <anonymous-schema-4>
              d:
                type: string
                enum:
                  - B
                  - S
                description: Order side (B=Buy, S=Sell)
                x-parser-schema-id: <anonymous-schema-5>
              q:
                type: integer
                format: uint64
                description: Order quantity in contracts
                x-parser-schema-id: <anonymous-schema-6>
              p:
                type: string
                pattern: ^-?\d+(\.\d+)?$
                description: Order price in USD as decimal string
                x-parser-schema-id: <anonymous-schema-7>
              tif:
                type: string
                description: Time in force (e.g. GTC, IOC, DAY)
                x-parser-schema-id: <anonymous-schema-8>
              po:
                type: boolean
                description: >-
                  Whether the order is post-only (maker-or-cancel). Defaults to
                  false.
                x-parser-schema-id: <anonymous-schema-9>
              rb:
                type: string
                enum:
                  - rej
                  - bo
                  - tbl
                description: >
                  Optional reprice behavior. When post-only is `true`, then this
                  selects what happens if the order would cross on entry.
                  Defaults to `rej`.


                  - `rej` ("reject") rejects a post-only order that would
                  execute.

                  - `bo` ("behind opposite") reprices to be one tick less
                  aggressive than the opposite side.

                  - `tbl` ("to best limit") reprices to the best price on the
                  same side of the book.
                x-parser-schema-id: <anonymous-schema-10>
              tag:
                type: string
                maxLength: 10
                description: Optional order tag (max 10 alphanumeric characters)
                x-parser-schema-id: <anonymous-schema-11>
              bid:
                type: string
                pattern: ^[A-Za-z0-9]{3,10}$
                description: >-
                  Optional ID of the partner software or broker that sends this
                  order; 3 to 10 letters or digits, case-insensitive. The
                  integration sets it, not the user. `tag` is for the user's own
                  labels.
                x-parser-schema-id: <anonymous-schema-12>
              cid:
                type: integer
                format: uint64
                description: >-
                  Optional client order ID. Must be unique among the user's open
                  orders; the server rejects placement if the cid is already in
                  use. When an order is replaced, the replacement inherits the
                  original's cid.
                x-parser-schema-id: <anonymous-schema-13>
              st:
                type: string
                enum:
                  - CancelIncoming
                  - CancelResting
                  - CancelBoth
                  - xi
                  - xr
                  - xb
                description: >
                  Optional self-trade prevention behavior for place-order
                  requests. Defaults to `CancelIncoming`.


                  The short aliases `xi`, `xr`, and `xb` are accepted on input
                  only (for

                  `CancelIncoming`, `CancelResting`, and `CancelBoth`
                  respectively); the

                  server always normalizes to and emits the long form.


                  - `CancelIncoming`: cancel the incoming aggressor order;
                  resting orders remain on the book.

                  - `CancelResting`: cancel resting orders that would
                  self-match; allow the incoming aggressor order.

                  - `CancelBoth`: cancel both the resting orders and incoming
                  aggressor order.
                x-parser-schema-id: <anonymous-schema-14>
              aid:
                type: string
                description: >-
                  Optional owning account the order is placed on. If omitted,
                  the account is inferred from the connection — the user's
                  default account, or the session's account for an
                  account-scoped connection.
                x-parser-schema-id: <anonymous-schema-15>
            x-parser-schema-id: <anonymous-schema-1>
        title: Place Order Request
        description: Request to place a new order (t="p")
        example: |-
          {
            "rid": 1,
            "t": "p",
            "s": "XAU-PERP",
            "d": "B",
            "q": 100,
            "p": "50000.50",
            "tif": "GTC",
            "po": false,
            "tag": "trade001",
            "rb": "tbl",
            "st": "CancelIncoming"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: placeOrderRequest
      - &ref_6
        id: cancelOrderRequest
        contentType: application/json
        payload:
          - name: Cancel Order Request
            description: >-
              Request to cancel an existing order (t="x"). Exactly one of oid or
              cid must be provided.
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID for correlating response
                required: true
              - name: t
                type: string
                description: Message type (cancel order)
                required: true
              - name: oid
                type: string
                description: Order ID to cancel. Mutually exclusive with cid.
                required: false
              - name: cid
                type: integer
                description: Client order ID to cancel. Mutually exclusive with oid.
                required: false
              - name: aid
                type: string
                description: >-
                  Optional owning account the target order belongs to. Only
                  meaningful when the order is given by `cid` (unique per
                  account). If omitted, inferred from the connection.
                required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
              - t
            properties:
              rid:
                type: integer
                description: Request ID for correlating response
                x-parser-schema-id: <anonymous-schema-17>
              t:
                type: string
                const: x
                description: Message type (cancel order)
                x-parser-schema-id: <anonymous-schema-18>
              oid:
                type: string
                description: Order ID to cancel. Mutually exclusive with cid.
                x-parser-schema-id: <anonymous-schema-19>
              cid:
                type: integer
                format: uint64
                description: Client order ID to cancel. Mutually exclusive with oid.
                x-parser-schema-id: <anonymous-schema-20>
              aid:
                type: string
                description: >-
                  Optional owning account the target order belongs to. Only
                  meaningful when the order is given by `cid` (unique per
                  account). If omitted, inferred from the connection.
                x-parser-schema-id: <anonymous-schema-21>
            x-parser-schema-id: <anonymous-schema-16>
        title: Cancel Order Request
        description: >-
          Request to cancel an existing order (t="x"). Exactly one of oid or cid
          must be provided.
        example: |-
          {
            "rid": 2,
            "t": "x",
            "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: cancelOrderRequest
      - &ref_7
        id: cancelAllOrdersRequest
        contentType: application/json
        payload:
          - name: Cancel All Orders Request
            description: Request to cancel all open orders (t="X")
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID for correlating response
                required: true
              - name: t
                type: string
                description: Message type (cancel all orders)
                required: true
              - name: symbol
                type: string
                description: >-
                  Optional symbol filter. If provided, only orders for this
                  symbol will be canceled.
                required: false
              - name: aid
                type: string
                description: >-
                  Optional owning account whose orders to cancel. If omitted,
                  inferred from the connection — the user's default account, or
                  the session's account for an account-scoped connection.
                required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
              - t
            properties:
              rid:
                type: integer
                description: Request ID for correlating response
                x-parser-schema-id: <anonymous-schema-23>
              t:
                type: string
                const: X
                description: Message type (cancel all orders)
                x-parser-schema-id: <anonymous-schema-24>
              symbol:
                type: string
                description: >-
                  Optional symbol filter. If provided, only orders for this
                  symbol will be canceled.
                x-parser-schema-id: <anonymous-schema-25>
              aid:
                type: string
                description: >-
                  Optional owning account whose orders to cancel. If omitted,
                  inferred from the connection — the user's default account, or
                  the session's account for an account-scoped connection.
                x-parser-schema-id: <anonymous-schema-26>
            x-parser-schema-id: <anonymous-schema-22>
        title: Cancel All Orders Request
        description: Request to cancel all open orders (t="X")
        example: |-
          {
            "rid": 5,
            "t": "X"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: cancelAllOrdersRequest
      - &ref_8
        id: replaceOrderRequest
        contentType: application/json
        payload:
          - name: Replace Order Request
            description: >-
              Request to cancel and replace an existing order with a new order
              (t="r"). Exactly one of oid or cid must be provided. The
              replacement order inherits the original's client order ID (cid).
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID for correlating response
                required: true
              - name: t
                type: string
                description: Message type (replace order)
                required: true
              - name: oid
                type: string
                description: Order ID to replace. Mutually exclusive with cid.
                required: false
              - name: cid
                type: integer
                description: >-
                  Client order ID of the order to replace. Mutually exclusive
                  with oid.
                required: false
              - name: q
                type: integer
                description: >-
                  Order quantity in contracts (optional, inherits from original
                  order if not provided)
                required: false
              - name: p
                type: string
                description: >-
                  Order price in USD as decimal string (optional, inherits from
                  original order if not provided)
                required: false
              - name: tif
                type: string
                description: >-
                  Time in force (e.g. GTC, IOC, DAY) (optional, inherits from
                  original order if not provided)
                required: false
              - name: po
                type: boolean
                description: >-
                  Whether the order is post-only (maker-or-cancel) (optional,
                  inherits from original order if not provided)
                required: false
              - name: rb
                type: string
                description: >-
                  Reprice behavior for the replacement when it enters the book.
                  Applies to this request only and does not carry over from the
                  original order. Used only when `po` is explicitly true on this
                  request; otherwise ignored. Defaults to `rej`. The replacement
                  reports this value as its `rb` either way.
                required: false
              - name: aid
                type: string
                description: >-
                  Optional owning account the target order belongs to. Only
                  meaningful when the order is given by `cid` (unique per
                  account). If omitted, inferred from the connection.
                required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
              - t
            properties:
              rid:
                type: integer
                description: Request ID for correlating response
                x-parser-schema-id: <anonymous-schema-28>
              t:
                type: string
                const: r
                description: Message type (replace order)
                x-parser-schema-id: <anonymous-schema-29>
              oid:
                type: string
                description: Order ID to replace. Mutually exclusive with cid.
                x-parser-schema-id: <anonymous-schema-30>
              cid:
                type: integer
                format: uint64
                description: >-
                  Client order ID of the order to replace. Mutually exclusive
                  with oid.
                x-parser-schema-id: <anonymous-schema-31>
              q:
                type: integer
                format: uint64
                description: >-
                  Order quantity in contracts (optional, inherits from original
                  order if not provided)
                x-parser-schema-id: <anonymous-schema-32>
              p:
                type: string
                pattern: ^-?\d+(\.\d+)?$
                description: >-
                  Order price in USD as decimal string (optional, inherits from
                  original order if not provided)
                x-parser-schema-id: <anonymous-schema-33>
              tif:
                type: string
                description: >-
                  Time in force (e.g. GTC, IOC, DAY) (optional, inherits from
                  original order if not provided)
                x-parser-schema-id: <anonymous-schema-34>
              po:
                type: boolean
                description: >-
                  Whether the order is post-only (maker-or-cancel) (optional,
                  inherits from original order if not provided)
                x-parser-schema-id: <anonymous-schema-35>
              rb:
                allOf:
                  - type: string
                    enum:
                      - rej
                      - bo
                      - tbl
                    description: >
                      Optional reprice behavior. When post-only is `true`, then
                      this selects what happens if the order would cross on
                      entry. Defaults to `rej`.


                      - `rej` ("reject") rejects a post-only order that would
                      execute.

                      - `bo` ("behind opposite") reprices to be one tick less
                      aggressive than the opposite side.

                      - `tbl` ("to best limit") reprices to the best price on
                      the same side of the book.
                    x-parser-schema-id: <anonymous-schema-37>
                description: >-
                  Reprice behavior for the replacement when it enters the book.
                  Applies to this request only and does not carry over from the
                  original order. Used only when `po` is explicitly true on this
                  request; otherwise ignored. Defaults to `rej`. The replacement
                  reports this value as its `rb` either way.
                x-parser-schema-id: <anonymous-schema-36>
              aid:
                type: string
                description: >-
                  Optional owning account the target order belongs to. Only
                  meaningful when the order is given by `cid` (unique per
                  account). If omitted, inferred from the connection.
                x-parser-schema-id: <anonymous-schema-38>
            x-parser-schema-id: <anonymous-schema-27>
        title: Replace Order Request
        description: >-
          Request to cancel and replace an existing order with a new order
          (t="r"). Exactly one of oid or cid must be provided. The replacement
          order inherits the original's client order ID (cid).
        example: |-
          {
            "rid": 3,
            "t": "r",
            "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "p": "50001.00"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: replaceOrderRequest
      - &ref_9
        id: getOrderStatusRequest
        contentType: application/json
        payload:
          - name: Get Order Status Request
            description: >-
              Request to retrieve one order by server order ID or client order
              ID (t="s"). Exactly one of oid or cid must be provided.
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID for correlating response
                required: true
              - name: t
                type: string
                description: Message type (get order status)
                required: true
              - name: oid
                type: string
                description: Server order ID to query. Mutually exclusive with cid.
                required: false
              - name: cid
                type: integer
                description: Client order ID to query. Mutually exclusive with oid.
                required: false
              - name: aid
                type: string
                description: >-
                  Optional owning account whose `cid` namespace the reference
                  resolves against. Only meaningful when the order is given by
                  `cid`. If omitted, inferred from the connection.
                required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
              - t
            oneOf:
              - required:
                  - oid
                x-parser-schema-id: <anonymous-schema-45>
              - required:
                  - cid
                x-parser-schema-id: <anonymous-schema-46>
            properties:
              rid:
                type: integer
                description: Request ID for correlating response
                x-parser-schema-id: <anonymous-schema-40>
              t:
                type: string
                const: s
                description: Message type (get order status)
                x-parser-schema-id: <anonymous-schema-41>
              oid:
                type: string
                description: Server order ID to query. Mutually exclusive with cid.
                x-parser-schema-id: <anonymous-schema-42>
              cid:
                type: integer
                format: uint64
                description: Client order ID to query. Mutually exclusive with oid.
                x-parser-schema-id: <anonymous-schema-43>
              aid:
                type: string
                description: >-
                  Optional owning account whose `cid` namespace the reference
                  resolves against. Only meaningful when the order is given by
                  `cid`. If omitted, inferred from the connection.
                x-parser-schema-id: <anonymous-schema-44>
            x-parser-schema-id: <anonymous-schema-39>
        title: Get Order Status Request
        description: >-
          Request to retrieve one order by server order ID or client order ID
          (t="s"). Exactly one of oid or cid must be provided.
        example: |-
          {
            "rid": 5,
            "t": "s",
            "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: getOrderStatusRequest
      - &ref_10
        id: getOpenOrdersRequest
        contentType: application/json
        payload:
          - name: Get Open Orders Request
            description: Request to retrieve all open orders (t="o")
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID for correlating response
                required: true
              - name: t
                type: string
                description: Message type (get open orders)
                required: true
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
              - t
            properties:
              rid:
                type: integer
                description: Request ID for correlating response
                x-parser-schema-id: <anonymous-schema-48>
              t:
                type: string
                const: o
                description: Message type (get open orders)
                x-parser-schema-id: <anonymous-schema-49>
            x-parser-schema-id: <anonymous-schema-47>
        title: Get Open Orders Request
        description: Request to retrieve all open orders (t="o")
        example: |-
          {
            "rid": 4,
            "t": "o"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: getOpenOrdersRequest
      - &ref_11
        id: getEstimatedFundingRateRequest
        contentType: application/json
        payload:
          - name: Get Estimated Funding Rate Request
            description: Request the live estimated funding rate for a symbol (t="ef")
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID for correlating response
                required: true
              - name: t
                type: string
                description: Message type (get estimated funding rate)
                required: true
              - name: symbol
                type: string
                description: Instrument symbol to query, e.g. WTI-PERP
                required: true
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
              - t
              - symbol
            properties:
              rid:
                type: integer
                description: Request ID for correlating response
                x-parser-schema-id: <anonymous-schema-51>
              t:
                type: string
                const: ef
                description: Message type (get estimated funding rate)
                x-parser-schema-id: <anonymous-schema-52>
              symbol:
                type: string
                description: Instrument symbol to query, e.g. WTI-PERP
                x-parser-schema-id: <anonymous-schema-53>
            x-parser-schema-id: <anonymous-schema-50>
        title: Get Estimated Funding Rate Request
        description: Request the live estimated funding rate for a symbol (t="ef")
        example: |-
          {
            "rid": 6,
            "t": "ef",
            "symbol": "WTI-PERP"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: getEstimatedFundingRateRequest
      - &ref_12
        id: heartbeatRequest
        contentType: application/json
        payload:
          - name: Heartbeat Request
            description: >-
              Client liveness heartbeat (t="h"). Fire-and-forget — no `rid` and
              no response. Send it comfortably more often than the
              `client_heartbeat_timeout` negotiated at connect so the server
              does not close the connection (which triggers cancel-on-disconnect
              when enabled).
            type: object
            properties:
              - name: t
                type: string
                description: Message type (heartbeat)
                required: true
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - t
            properties:
              t:
                type: string
                const: h
                description: Message type (heartbeat)
                x-parser-schema-id: <anonymous-schema-55>
            x-parser-schema-id: <anonymous-schema-54>
        title: Heartbeat Request
        description: >-
          Client liveness heartbeat (t="h"). Fire-and-forget — no `rid` and no
          response. Send it comfortably more often than the
          `client_heartbeat_timeout` negotiated at connect so the server does
          not close the connection (which triggers cancel-on-disconnect when
          enabled).
        example: |-
          {
            "t": "h"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: heartbeatRequest
    bindings: []
    extensions: &ref_1
      - id: x-parser-unique-object-id
        value: orders
  - &ref_3
    id: serverResponse
    title: Server response
    type: send
    messages:
      - &ref_13
        id: loginResponse
        contentType: application/json
        payload:
          - name: Login Response
            description: Initial response upon WebSocket connection (rid=0)
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID (always 0 for login)
                required: true
              - name: res
                type: object
                required: false
                properties:
                  - name: li
                    type: string
                    description: User ID of the logged in user
                    required: true
                  - name: o
                    type: &ref_0
                      - array
                      - 'null'
                    description: Open orders at login time. Null when there are none.
                    required: false
                  - name: cod
                    type: boolean
                    description: Whether cancel-on-disconnect is active for this session
                    required: false
                  - name: chb
                    type: integer
                    description: >-
                      The client heartbeat timeout (seconds) the server accepted
                      for this session, echoing the `client_heartbeat_timeout`
                      query parameter when one was requested. Absent when not
                      requested.
                    required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
            properties:
              rid:
                type: integer
                const: 0
                description: Request ID (always 0 for login)
                x-parser-schema-id: <anonymous-schema-57>
              res:
                type: object
                required:
                  - li
                properties:
                  li:
                    type: string
                    description: User ID of the logged in user
                    x-parser-schema-id: <anonymous-schema-59>
                  o:
                    type: *ref_0
                    description: Open orders at login time. Null when there are none.
                    items:
                      type: object
                      description: Order details
                      required:
                        - oid
                        - u
                        - aid
                        - s
                        - p
                        - q
                        - xq
                        - rq
                        - o
                        - d
                        - tif
                        - po
                        - ts
                        - tn
                      properties:
                        oid:
                          type: string
                          description: Order ID
                          x-parser-schema-id: <anonymous-schema-62>
                        u:
                          type: string
                          format: uuid
                          description: >-
                            Actor of record — the authenticated user who placed
                            this order. Distinct from the owning account `aid`:
                            a user may place orders on an account they do not
                            own (e.g. a proxy or algo acting for another party).
                          x-parser-schema-id: <anonymous-schema-63>
                        aid:
                          type: string
                          description: >-
                            Owning account — whose position, balance, and risk
                            this order moves.
                          x-parser-schema-id: <anonymous-schema-64>
                        s:
                          type: string
                          description: Symbol (e.g. XAU-PERP)
                          x-parser-schema-id: <anonymous-schema-65>
                        p:
                          type: string
                          pattern: ^-?\d+(\.\d+)?$
                          description: Order price as decimal string
                          x-parser-schema-id: <anonymous-schema-66>
                        q:
                          type: integer
                          format: uint64
                          description: Order quantity in contracts
                          x-parser-schema-id: <anonymous-schema-67>
                        xq:
                          type: integer
                          format: uint64
                          description: Filled quantity
                          x-parser-schema-id: <anonymous-schema-68>
                        rq:
                          type: integer
                          format: uint64
                          description: Remaining quantity
                          x-parser-schema-id: <anonymous-schema-69>
                        o:
                          type: string
                          enum:
                            - PENDING
                            - ACCEPTED
                            - PARTIALLY_FILLED
                            - FILLED
                            - CANCELED
                            - REJECTED
                            - EXPIRED
                            - REPLACED
                            - DONE_FOR_DAY
                            - UNKNOWN
                          description: Order state
                          x-parser-schema-id: <anonymous-schema-70>
                        d:
                          type: string
                          enum:
                            - B
                            - S
                          description: Side (B=Buy, S=Sell)
                          x-parser-schema-id: <anonymous-schema-71>
                        tif:
                          type: string
                          description: Time in force (e.g. GTC, IOC, DAY)
                          x-parser-schema-id: <anonymous-schema-72>
                        po:
                          type: boolean
                          description: Whether the order is post-only (maker-or-cancel)
                          x-parser-schema-id: <anonymous-schema-73>
                        tag:
                          type: string
                          description: Optional order tag (max 10 alphanumeric characters)
                          x-parser-schema-id: <anonymous-schema-74>
                        bid:
                          type: string
                          description: Broker ID sent with the order, if any
                          x-parser-schema-id: <anonymous-schema-75>
                        cid:
                          type: integer
                          format: uint64
                          description: Optional client order ID
                          x-parser-schema-id: <anonymous-schema-76>
                        r:
                          type: string
                          enum:
                            - CLOSE_ONLY
                            - INSUFFICIENT_MARGIN
                            - INSUFFICIENT_CREDIT_LIMIT
                            - MAX_OPEN_ORDERS_EXCEEDED
                            - UNKNOWN_SYMBOL
                            - EXCHANGE_CLOSED
                            - INCORRECT_QUANTITY
                            - INVALID_PRICE_INCREMENT
                            - INCORRECT_ORDER_TYPE
                            - PRICE_OUT_OF_BOUNDS
                            - NO_LIQUIDITY
                            - ORIGINAL_ORDER_TERMINATED
                            - DUPLICATE_CLIENT_ORDER_ID
                            - UNKNOWN
                          description: Reason for order rejection
                          x-parser-schema-id: <anonymous-schema-77>
                        txt:
                          type: string
                          description: Optional reject message
                          x-parser-schema-id: <anonymous-schema-78>
                        rb:
                          oneOf:
                            - type: 'null'
                              x-parser-schema-id: <anonymous-schema-80>
                            - type: string
                              enum:
                                - rej
                                - bo
                                - tbl
                              description: >
                                Optional reprice behavior. When post-only is
                                `true`, then this selects what happens if the
                                order would cross on entry. Defaults to `rej`.


                                - `rej` ("reject") rejects a post-only order
                                that would execute.

                                - `bo` ("behind opposite") reprices to be one
                                tick less aggressive than the opposite side.

                                - `tbl` ("to best limit") reprices to the best
                                price on the same side of the book.
                              x-parser-schema-id: <anonymous-schema-81>
                          description: >-
                            The reprice behavior the client sent with this
                            order's most recent entry into the book (the place,
                            or the latest replace). Reported as sent, whether or
                            not it applied. It applied only if `po` was true on
                            that same request. Unlike `po`, it does not carry
                            over between requests: a replace that omits `rb`
                            reports `rej`. Absent for orders placed before it
                            was recorded.
                          x-parser-schema-id: <anonymous-schema-79>
                        ts:
                          type: integer
                          format: int32
                          description: Order timestamp seconds since epoch
                          x-parser-schema-id: <anonymous-schema-82>
                        tn:
                          type: integer
                          format: uint32
                          minimum: 0
                          description: Order timestamp nanoseconds
                          x-parser-schema-id: <anonymous-schema-83>
                      x-parser-schema-id: <anonymous-schema-61>
                    x-parser-schema-id: <anonymous-schema-60>
                  cod:
                    type: boolean
                    description: Whether cancel-on-disconnect is active for this session
                    x-parser-schema-id: <anonymous-schema-84>
                  chb:
                    type: integer
                    format: uint32
                    description: >-
                      The client heartbeat timeout (seconds) the server accepted
                      for this session, echoing the `client_heartbeat_timeout`
                      query parameter when one was requested. Absent when not
                      requested.
                    x-parser-schema-id: <anonymous-schema-85>
                x-parser-schema-id: <anonymous-schema-58>
            x-parser-schema-id: <anonymous-schema-56>
        title: Login Response
        description: Initial response upon WebSocket connection (rid=0)
        example: |-
          {
            "rid": 0,
            "res": {
              "li": "01KB4E-MGKR-HXEG",
              "o": [
                {
                  "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
                  "u": "01KB4E-MGKR-HXEG",
                  "aid": "ACME-1",
                  "po": false,
                  "s": "XAU-PERP",
                  "p": "50000.00",
                  "q": 100,
                  "xq": 0,
                  "rq": 100,
                  "o": "ACCEPTED",
                  "d": "B",
                  "tif": "GTC",
                  "ts": 1609459200,
                  "tn": 0
                }
              ],
              "cod": false
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: loginResponse
      - &ref_14
        id: placeOrderResponse
        contentType: application/json
        payload:
          - name: Place Order Response
            description: Response to place order request
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID matching the request
                required: true
              - name: res
                type: object
                required: false
                properties:
                  - name: oid
                    type: string
                    description: Order ID of the placed order
                    required: true
              - name: err
                type: object
                description: Error information if request failed
                required: false
                properties:
                  - name: code
                    type: integer
                    description: Error code
                    required: false
                  - name: msg
                    type: string
                    description: Error message
                    required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
            properties:
              rid:
                type: integer
                description: Request ID matching the request
                x-parser-schema-id: <anonymous-schema-87>
              res:
                type: object
                required:
                  - oid
                properties:
                  oid:
                    type: string
                    description: Order ID of the placed order
                    x-parser-schema-id: <anonymous-schema-89>
                x-parser-schema-id: <anonymous-schema-88>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-91>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-92>
                x-parser-schema-id: <anonymous-schema-90>
            x-parser-schema-id: <anonymous-schema-86>
        title: Place Order Response
        description: Response to place order request
        example: |-
          {
            "rid": 1,
            "res": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: placeOrderResponse
      - &ref_15
        id: cancelOrderResponse
        contentType: application/json
        payload:
          - name: Cancel Order Response
            description: Response to cancel order request
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID matching the request
                required: true
              - name: res
                type: object
                required: false
                properties:
                  - name: cxl_rx
                    type: boolean
                    description: Whether the cancel request has been accepted
                    required: true
              - name: err
                type: object
                description: Error information if request failed
                required: false
                properties:
                  - name: code
                    type: integer
                    description: Error code
                    required: false
                  - name: msg
                    type: string
                    description: Error message
                    required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
            properties:
              rid:
                type: integer
                description: Request ID matching the request
                x-parser-schema-id: <anonymous-schema-94>
              res:
                type: object
                required:
                  - cxl_rx
                properties:
                  cxl_rx:
                    type: boolean
                    description: Whether the cancel request has been accepted
                    x-parser-schema-id: <anonymous-schema-96>
                x-parser-schema-id: <anonymous-schema-95>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-98>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-99>
                x-parser-schema-id: <anonymous-schema-97>
            x-parser-schema-id: <anonymous-schema-93>
        title: Cancel Order Response
        description: Response to cancel order request
        example: |-
          {
            "rid": 2,
            "res": {
              "cxl_rx": true
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: cancelOrderResponse
      - &ref_16
        id: replaceOrderResponse
        contentType: application/json
        payload:
          - name: Replace Order Response
            description: Response to replace order request
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID matching the request
                required: true
              - name: res
                type: object
                required: false
                properties:
                  - name: oid
                    type: string
                    description: Order ID of the new replacement order
                    required: true
              - name: err
                type: object
                description: Error information if request failed
                required: false
                properties:
                  - name: code
                    type: integer
                    description: Error code
                    required: false
                  - name: msg
                    type: string
                    description: Error message
                    required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
            properties:
              rid:
                type: integer
                description: Request ID matching the request
                x-parser-schema-id: <anonymous-schema-101>
              res:
                type: object
                required:
                  - oid
                properties:
                  oid:
                    type: string
                    description: Order ID of the new replacement order
                    x-parser-schema-id: <anonymous-schema-103>
                x-parser-schema-id: <anonymous-schema-102>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-105>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-106>
                x-parser-schema-id: <anonymous-schema-104>
            x-parser-schema-id: <anonymous-schema-100>
        title: Replace Order Response
        description: Response to replace order request
        example: |-
          {
            "rid": 3,
            "res": {
              "oid": "O-01BX5ZZKBKACTAV9WEVGEMMVRE"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: replaceOrderResponse
      - &ref_17
        id: cancelAllOrdersResponse
        contentType: application/json
        payload:
          - name: Cancel All Orders Response
            description: Response to cancel all orders request
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID matching the request
                required: true
              - name: res
                type: object
                description: Empty object on success
                required: false
              - name: err
                type: object
                description: Error information if request failed
                required: false
                properties:
                  - name: code
                    type: integer
                    description: Error code
                    required: false
                  - name: msg
                    type: string
                    description: Error message
                    required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
            properties:
              rid:
                type: integer
                description: Request ID matching the request
                x-parser-schema-id: <anonymous-schema-108>
              res:
                type: object
                description: Empty object on success
                x-parser-schema-id: <anonymous-schema-109>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-111>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-112>
                x-parser-schema-id: <anonymous-schema-110>
            x-parser-schema-id: <anonymous-schema-107>
        title: Cancel All Orders Response
        description: Response to cancel all orders request
        example: |-
          {
            "rid": 5,
            "res": {}
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: cancelAllOrdersResponse
      - &ref_18
        id: getOrderStatusResponse
        contentType: application/json
        payload:
          - name: Get Order Status Response
            description: Response to get order status request
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID matching the request
                required: true
              - name: res
                type: object
                required: false
                properties:
                  - name: status
                    type: object
                    description: Current order status
                    required: true
                    properties:
                      - name: symbol
                        type: string
                        description: Order symbol
                        required: true
                      - name: order_id
                        type: string
                        description: Server order ID
                        required: true
                      - name: clord_id
                        type: integer
                        description: Optional client order ID
                        required: false
                      - name: state
                        type: string
                        description: Order state
                        enumValues:
                          - PENDING
                          - ACCEPTED
                          - PARTIALLY_FILLED
                          - FILLED
                          - CANCELED
                          - REJECTED
                          - EXPIRED
                          - REPLACED
                          - DONE_FOR_DAY
                          - UNKNOWN
                        required: true
                      - name: filled_quantity
                        type: integer
                        description: Filled quantity, if available
                        required: false
                      - name: remaining_quantity
                        type: integer
                        description: Remaining quantity, if available
                        required: false
                      - name: reject_reason
                        type: string
                        description: Reason for order rejection
                        enumValues:
                          - CLOSE_ONLY
                          - INSUFFICIENT_MARGIN
                          - INSUFFICIENT_CREDIT_LIMIT
                          - MAX_OPEN_ORDERS_EXCEEDED
                          - UNKNOWN_SYMBOL
                          - EXCHANGE_CLOSED
                          - INCORRECT_QUANTITY
                          - INVALID_PRICE_INCREMENT
                          - INCORRECT_ORDER_TYPE
                          - PRICE_OUT_OF_BOUNDS
                          - NO_LIQUIDITY
                          - ORIGINAL_ORDER_TERMINATED
                          - DUPLICATE_CLIENT_ORDER_ID
                          - UNKNOWN
                        required: false
                      - name: reject_message
                        type: string
                        description: Optional reject message
                        required: false
              - name: err
                type: object
                description: Error information if request failed
                required: false
                properties:
                  - name: code
                    type: integer
                    description: Error code
                    required: false
                  - name: msg
                    type: string
                    description: Error message
                    required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
            properties:
              rid:
                type: integer
                description: Request ID matching the request
                x-parser-schema-id: <anonymous-schema-114>
              res:
                type: object
                required:
                  - status
                properties:
                  status:
                    type: object
                    description: Current order status
                    required:
                      - symbol
                      - order_id
                      - state
                    properties:
                      symbol:
                        type: string
                        description: Order symbol
                        x-parser-schema-id: <anonymous-schema-117>
                      order_id:
                        type: string
                        description: Server order ID
                        x-parser-schema-id: <anonymous-schema-118>
                      clord_id:
                        type: integer
                        format: uint64
                        description: Optional client order ID
                        x-parser-schema-id: <anonymous-schema-119>
                      state:
                        type: string
                        enum:
                          - PENDING
                          - ACCEPTED
                          - PARTIALLY_FILLED
                          - FILLED
                          - CANCELED
                          - REJECTED
                          - EXPIRED
                          - REPLACED
                          - DONE_FOR_DAY
                          - UNKNOWN
                        description: Order state
                        x-parser-schema-id: <anonymous-schema-120>
                      filled_quantity:
                        type: integer
                        format: uint64
                        description: Filled quantity, if available
                        x-parser-schema-id: <anonymous-schema-121>
                      remaining_quantity:
                        type: integer
                        format: uint64
                        description: Remaining quantity, if available
                        x-parser-schema-id: <anonymous-schema-122>
                      reject_reason:
                        type: string
                        enum:
                          - CLOSE_ONLY
                          - INSUFFICIENT_MARGIN
                          - INSUFFICIENT_CREDIT_LIMIT
                          - MAX_OPEN_ORDERS_EXCEEDED
                          - UNKNOWN_SYMBOL
                          - EXCHANGE_CLOSED
                          - INCORRECT_QUANTITY
                          - INVALID_PRICE_INCREMENT
                          - INCORRECT_ORDER_TYPE
                          - PRICE_OUT_OF_BOUNDS
                          - NO_LIQUIDITY
                          - ORIGINAL_ORDER_TERMINATED
                          - DUPLICATE_CLIENT_ORDER_ID
                          - UNKNOWN
                        description: Reason for order rejection
                        x-parser-schema-id: <anonymous-schema-123>
                      reject_message:
                        type: string
                        description: Optional reject message
                        x-parser-schema-id: <anonymous-schema-124>
                    x-parser-schema-id: <anonymous-schema-116>
                x-parser-schema-id: <anonymous-schema-115>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-126>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-127>
                x-parser-schema-id: <anonymous-schema-125>
            x-parser-schema-id: <anonymous-schema-113>
        title: Get Order Status Response
        description: Response to get order status request
        example: |-
          {
            "rid": 5,
            "res": {
              "status": {
                "symbol": "XAU-PERP",
                "order_id": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
                "clord_id": 12345,
                "state": "ACCEPTED",
                "filled_quantity": 0,
                "remaining_quantity": 100
              }
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: getOrderStatusResponse
      - &ref_19
        id: getOpenOrdersResponse
        contentType: application/json
        payload:
          - name: Get Open Orders Response
            description: Response to get open orders request
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID matching the request
                required: true
              - name: res
                type: object
                required: false
                properties:
                  - name: orders
                    type: array
                    description: List of open orders
                    required: true
                    properties:
                      - name: oid
                        type: string
                        description: Order ID
                        required: true
                      - name: u
                        type: string
                        description: >-
                          Actor of record — the authenticated user who placed
                          this order. Distinct from the owning account `aid`: a
                          user may place orders on an account they do not own
                          (e.g. a proxy or algo acting for another party).
                        required: true
                      - name: aid
                        type: string
                        description: >-
                          Owning account — whose position, balance, and risk
                          this order moves.
                        required: true
                      - name: s
                        type: string
                        description: Symbol (e.g. XAU-PERP)
                        required: true
                      - name: p
                        type: string
                        description: Order price as decimal string
                        required: true
                      - name: q
                        type: integer
                        description: Order quantity in contracts
                        required: true
                      - name: xq
                        type: integer
                        description: Filled quantity
                        required: true
                      - name: rq
                        type: integer
                        description: Remaining quantity
                        required: true
                      - name: o
                        type: string
                        description: Order state
                        enumValues:
                          - PENDING
                          - ACCEPTED
                          - PARTIALLY_FILLED
                          - FILLED
                          - CANCELED
                          - REJECTED
                          - EXPIRED
                          - REPLACED
                          - DONE_FOR_DAY
                          - UNKNOWN
                        required: true
                      - name: d
                        type: string
                        description: Side (B=Buy, S=Sell)
                        enumValues:
                          - B
                          - S
                        required: true
                      - name: tif
                        type: string
                        description: Time in force (e.g. GTC, IOC, DAY)
                        required: true
                      - name: po
                        type: boolean
                        description: Whether the order is post-only (maker-or-cancel)
                        required: true
                      - name: tag
                        type: string
                        description: Optional order tag (max 10 alphanumeric characters)
                        required: false
                      - name: bid
                        type: string
                        description: Broker ID sent with the order, if any
                        required: false
                      - name: cid
                        type: integer
                        description: Optional client order ID
                        required: false
                      - name: r
                        type: string
                        description: Reason for order rejection
                        enumValues:
                          - CLOSE_ONLY
                          - INSUFFICIENT_MARGIN
                          - INSUFFICIENT_CREDIT_LIMIT
                          - MAX_OPEN_ORDERS_EXCEEDED
                          - UNKNOWN_SYMBOL
                          - EXCHANGE_CLOSED
                          - INCORRECT_QUANTITY
                          - INVALID_PRICE_INCREMENT
                          - INCORRECT_ORDER_TYPE
                          - PRICE_OUT_OF_BOUNDS
                          - NO_LIQUIDITY
                          - ORIGINAL_ORDER_TERMINATED
                          - DUPLICATE_CLIENT_ORDER_ID
                          - UNKNOWN
                        required: false
                      - name: txt
                        type: string
                        description: Optional reject message
                        required: false
                      - name: rb
                        type: string
                        description: >-
                          The reprice behavior the client sent with this order's
                          most recent entry into the book (the place, or the
                          latest replace). Reported as sent, whether or not it
                          applied. It applied only if `po` was true on that same
                          request. Unlike `po`, it does not carry over between
                          requests: a replace that omits `rb` reports `rej`.
                          Absent for orders placed before it was recorded.
                        required: false
                      - name: ts
                        type: integer
                        description: Order timestamp seconds since epoch
                        required: true
                      - name: tn
                        type: integer
                        description: Order timestamp nanoseconds
                        required: true
              - name: err
                type: object
                description: Error information if request failed
                required: false
                properties:
                  - name: code
                    type: integer
                    description: Error code
                    required: false
                  - name: msg
                    type: string
                    description: Error message
                    required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
            properties:
              rid:
                type: integer
                description: Request ID matching the request
                x-parser-schema-id: <anonymous-schema-129>
              res:
                type: object
                required:
                  - orders
                properties:
                  orders:
                    type: array
                    description: List of open orders
                    items:
                      type: object
                      description: Order details
                      required:
                        - oid
                        - u
                        - aid
                        - s
                        - p
                        - q
                        - xq
                        - rq
                        - o
                        - d
                        - tif
                        - po
                        - ts
                        - tn
                      properties:
                        oid:
                          type: string
                          description: Order ID
                          x-parser-schema-id: <anonymous-schema-133>
                        u:
                          type: string
                          format: uuid
                          description: >-
                            Actor of record — the authenticated user who placed
                            this order. Distinct from the owning account `aid`:
                            a user may place orders on an account they do not
                            own (e.g. a proxy or algo acting for another party).
                          x-parser-schema-id: <anonymous-schema-134>
                        aid:
                          type: string
                          description: >-
                            Owning account — whose position, balance, and risk
                            this order moves.
                          x-parser-schema-id: <anonymous-schema-135>
                        s:
                          type: string
                          description: Symbol (e.g. XAU-PERP)
                          x-parser-schema-id: <anonymous-schema-136>
                        p:
                          type: string
                          pattern: ^-?\d+(\.\d+)?$
                          description: Order price as decimal string
                          x-parser-schema-id: <anonymous-schema-137>
                        q:
                          type: integer
                          format: uint64
                          description: Order quantity in contracts
                          x-parser-schema-id: <anonymous-schema-138>
                        xq:
                          type: integer
                          format: uint64
                          description: Filled quantity
                          x-parser-schema-id: <anonymous-schema-139>
                        rq:
                          type: integer
                          format: uint64
                          description: Remaining quantity
                          x-parser-schema-id: <anonymous-schema-140>
                        o:
                          type: string
                          enum:
                            - PENDING
                            - ACCEPTED
                            - PARTIALLY_FILLED
                            - FILLED
                            - CANCELED
                            - REJECTED
                            - EXPIRED
                            - REPLACED
                            - DONE_FOR_DAY
                            - UNKNOWN
                          description: Order state
                          x-parser-schema-id: <anonymous-schema-141>
                        d:
                          type: string
                          enum:
                            - B
                            - S
                          description: Side (B=Buy, S=Sell)
                          x-parser-schema-id: <anonymous-schema-142>
                        tif:
                          type: string
                          description: Time in force (e.g. GTC, IOC, DAY)
                          x-parser-schema-id: <anonymous-schema-143>
                        po:
                          type: boolean
                          description: Whether the order is post-only (maker-or-cancel)
                          x-parser-schema-id: <anonymous-schema-144>
                        tag:
                          type: string
                          description: Optional order tag (max 10 alphanumeric characters)
                          x-parser-schema-id: <anonymous-schema-145>
                        bid:
                          type: string
                          description: Broker ID sent with the order, if any
                          x-parser-schema-id: <anonymous-schema-146>
                        cid:
                          type: integer
                          format: uint64
                          description: Optional client order ID
                          x-parser-schema-id: <anonymous-schema-147>
                        r:
                          type: string
                          enum:
                            - CLOSE_ONLY
                            - INSUFFICIENT_MARGIN
                            - INSUFFICIENT_CREDIT_LIMIT
                            - MAX_OPEN_ORDERS_EXCEEDED
                            - UNKNOWN_SYMBOL
                            - EXCHANGE_CLOSED
                            - INCORRECT_QUANTITY
                            - INVALID_PRICE_INCREMENT
                            - INCORRECT_ORDER_TYPE
                            - PRICE_OUT_OF_BOUNDS
                            - NO_LIQUIDITY
                            - ORIGINAL_ORDER_TERMINATED
                            - DUPLICATE_CLIENT_ORDER_ID
                            - UNKNOWN
                          description: Reason for order rejection
                          x-parser-schema-id: <anonymous-schema-148>
                        txt:
                          type: string
                          description: Optional reject message
                          x-parser-schema-id: <anonymous-schema-149>
                        rb:
                          oneOf:
                            - type: 'null'
                              x-parser-schema-id: <anonymous-schema-151>
                            - type: string
                              enum:
                                - rej
                                - bo
                                - tbl
                              description: >
                                Optional reprice behavior. When post-only is
                                `true`, then this selects what happens if the
                                order would cross on entry. Defaults to `rej`.


                                - `rej` ("reject") rejects a post-only order
                                that would execute.

                                - `bo` ("behind opposite") reprices to be one
                                tick less aggressive than the opposite side.

                                - `tbl` ("to best limit") reprices to the best
                                price on the same side of the book.
                              x-parser-schema-id: <anonymous-schema-152>
                          description: >-
                            The reprice behavior the client sent with this
                            order's most recent entry into the book (the place,
                            or the latest replace). Reported as sent, whether or
                            not it applied. It applied only if `po` was true on
                            that same request. Unlike `po`, it does not carry
                            over between requests: a replace that omits `rb`
                            reports `rej`. Absent for orders placed before it
                            was recorded.
                          x-parser-schema-id: <anonymous-schema-150>
                        ts:
                          type: integer
                          format: int32
                          description: Order timestamp seconds since epoch
                          x-parser-schema-id: <anonymous-schema-153>
                        tn:
                          type: integer
                          format: uint32
                          minimum: 0
                          description: Order timestamp nanoseconds
                          x-parser-schema-id: <anonymous-schema-154>
                      x-parser-schema-id: <anonymous-schema-132>
                    x-parser-schema-id: <anonymous-schema-131>
                x-parser-schema-id: <anonymous-schema-130>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-156>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-157>
                x-parser-schema-id: <anonymous-schema-155>
            x-parser-schema-id: <anonymous-schema-128>
        title: Get Open Orders Response
        description: Response to get open orders request
        example: |-
          {
            "rid": 3,
            "res": {
              "orders": [
                {
                  "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
                  "u": "01KB4E-MGKR-HXEG",
                  "aid": "ACME-1",
                  "po": false,
                  "s": "XAU-PERP",
                  "p": "50000.00",
                  "q": 100,
                  "xq": 0,
                  "rq": 100,
                  "o": "ACCEPTED",
                  "d": "B",
                  "tif": "GTC",
                  "ts": 1609459200,
                  "tn": 0
                },
                {
                  "oid": "O-01BX5ZZKBKACTAV9WEVGEMMVRE",
                  "u": "01KB4E-MGKR-HXEG",
                  "aid": "ACME-1",
                  "po": false,
                  "s": "XAG-PERP",
                  "p": "32.505",
                  "q": 200,
                  "xq": 50,
                  "rq": 150,
                  "o": "PARTIALLY_FILLED",
                  "d": "S",
                  "tif": "GTC",
                  "ts": 1609459300,
                  "tn": 500000000
                }
              ]
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: getOpenOrdersResponse
      - &ref_20
        id: getEstimatedFundingRateResponse
        contentType: application/json
        payload:
          - name: Get Estimated Funding Rate Response
            description: Response to get estimated funding rate request
            type: object
            properties:
              - name: rid
                type: integer
                description: Request ID matching the request
                required: true
              - name: res
                type: object
                description: >-
                  Live estimated funding rate for a symbol. The numeric fields
                  are populated only when `status` is `ready`.
                required: false
                properties:
                  - name: symbol
                    type: string
                    description: Instrument symbol
                    required: true
                  - name: status
                    type: string
                    description: >-
                      Estimate availability. `ready` — a current estimate is
                      available and the numeric fields are populated.
                      `settlement_pending` — funding settlement is in progress
                      for the symbol, so the estimate is temporarily suppressed;
                      numeric fields are null and `reason` indicates settlement
                      is pending. `unavailable` — no current estimate can be
                      produced; numeric fields are null and `reason` explains
                      why (e.g. the index or mark price data is not yet
                      available, is insufficient, or is too stale, or no
                      estimate has been published yet).
                    enumValues:
                      - ready
                      - settlement_pending
                      - unavailable
                    required: true
                  - name: reason
                    type: string
                    description: >-
                      Human-readable explanation, present when no estimate is
                      available
                    required: false
                  - name: funding_rate
                    type: string
                    description: Estimated funding rate
                    required: false
                  - name: funding_amount
                    type: string
                    description: Estimated funding amount per contract in USD
                    required: false
                  - name: benchmark_price
                    type: string
                    description: Benchmark (index) price used for the estimate in USD
                    required: false
                  - name: settlement_price
                    type: string
                    description: Settlement (mark) price used for the estimate in USD
                    required: false
                  - name: timestamp
                    type: string
                    description: Time the estimate was computed (RFC 3339)
                    required: true
              - name: err
                type: object
                description: Error information if request failed
                required: false
                properties:
                  - name: code
                    type: integer
                    description: Error code
                    required: false
                  - name: msg
                    type: string
                    description: Error message
                    required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
            properties:
              rid:
                type: integer
                description: Request ID matching the request
                x-parser-schema-id: <anonymous-schema-159>
              res:
                type: object
                description: >-
                  Live estimated funding rate for a symbol. The numeric fields
                  are populated only when `status` is `ready`.
                required:
                  - symbol
                  - status
                  - timestamp
                properties:
                  symbol:
                    type: string
                    description: Instrument symbol
                    x-parser-schema-id: <anonymous-schema-161>
                  status:
                    type: string
                    enum:
                      - ready
                      - settlement_pending
                      - unavailable
                    description: >-
                      Estimate availability. `ready` — a current estimate is
                      available and the numeric fields are populated.
                      `settlement_pending` — funding settlement is in progress
                      for the symbol, so the estimate is temporarily suppressed;
                      numeric fields are null and `reason` indicates settlement
                      is pending. `unavailable` — no current estimate can be
                      produced; numeric fields are null and `reason` explains
                      why (e.g. the index or mark price data is not yet
                      available, is insufficient, or is too stale, or no
                      estimate has been published yet).
                    x-parser-schema-id: <anonymous-schema-162>
                  reason:
                    type: string
                    description: >-
                      Human-readable explanation, present when no estimate is
                      available
                    x-parser-schema-id: <anonymous-schema-163>
                  funding_rate:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Estimated funding rate
                    x-parser-schema-id: <anonymous-schema-164>
                  funding_amount:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Estimated funding amount per contract in USD
                    x-parser-schema-id: <anonymous-schema-165>
                  benchmark_price:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Benchmark (index) price used for the estimate in USD
                    x-parser-schema-id: <anonymous-schema-166>
                  settlement_price:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Settlement (mark) price used for the estimate in USD
                    x-parser-schema-id: <anonymous-schema-167>
                  timestamp:
                    type: string
                    format: date-time
                    description: Time the estimate was computed (RFC 3339)
                    x-parser-schema-id: <anonymous-schema-168>
                x-parser-schema-id: <anonymous-schema-160>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-170>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-171>
                x-parser-schema-id: <anonymous-schema-169>
            x-parser-schema-id: <anonymous-schema-158>
        title: Get Estimated Funding Rate Response
        description: Response to get estimated funding rate request
        example: |-
          {
            "rid": 6,
            "res": {
              "symbol": "WTI-PERP",
              "status": "ready",
              "funding_rate": "0.00012",
              "funding_amount": "6.00",
              "benchmark_price": "50005.00",
              "settlement_price": "50010.00",
              "timestamp": "2021-01-01T00:00:00Z"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: getEstimatedFundingRateResponse
    bindings: []
    extensions: *ref_1
  - &ref_4
    id: serverEvent
    title: Server event
    type: send
    messages:
      - &ref_21
        id: heartbeatEvent
        contentType: application/json
        payload:
          - name: Heartbeat Event
            description: Heartbeat/timestamp event (t="h")
            type: object
            properties:
              - name: t
                type: string
                description: Message type (heartbeat)
                required: true
              - name: ts
                type: integer
                description: Timestamp seconds since epoch
                required: true
              - name: tn
                type: integer
                description: Timestamp nanoseconds
                required: true
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - t
              - ts
              - tn
            properties:
              t:
                type: string
                const: h
                description: Message type (heartbeat)
                x-parser-schema-id: <anonymous-schema-173>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-174>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-175>
            x-parser-schema-id: <anonymous-schema-172>
        title: Heartbeat Event
        description: Heartbeat/timestamp event (t="h")
        example: |-
          {
            "t": "h",
            "ts": 1609459200,
            "tn": 123456789
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: heartbeatEvent
      - &ref_22
        id: cancelRejectedEvent
        contentType: application/json
        payload:
          - name: Cancel Rejected Event
            description: Cancel or replace request was rejected (t="e")
            type: object
            properties:
              - name: t
                type: string
                description: Message type (cancel or replace rejected)
                required: true
              - name: ts
                type: integer
                description: Timestamp seconds since epoch
                required: true
              - name: tn
                type: integer
                description: Timestamp nanoseconds
                required: true
              - name: oid
                type: string
                description: Order ID
                required: true
              - name: cid
                type: integer
                description: >-
                  Optional client order ID of the rejected request's target
                  order (present when the original order carried a cid).
                required: false
              - name: r
                type: string
                description: Why the request was rejected, in plain English
                required: true
              - name: txt
                type: string
                description: Why the request was rejected, in plain English; same as `r`
                required: true
              - name: o
                type: object
                description: >-
                  The order whose cancel or replace was rejected, in its current
                  state. Optional for wire-compat with producers/consumers
                  predating this field.
                required: false
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    required: true
                  - name: aid
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    required: true
                  - name: s
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    required: true
                  - name: p
                    type: string
                    description: Order price as decimal string
                    required: true
                  - name: q
                    type: integer
                    description: Order quantity in contracts
                    required: true
                  - name: xq
                    type: integer
                    description: Filled quantity
                    required: true
                  - name: rq
                    type: integer
                    description: Remaining quantity
                    required: true
                  - name: o
                    type: string
                    description: Order state
                    enumValues:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    required: true
                  - name: d
                    type: string
                    description: Side (B=Buy, S=Sell)
                    enumValues:
                      - B
                      - S
                    required: true
                  - name: tif
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    required: true
                  - name: po
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    required: true
                  - name: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    required: false
                  - name: bid
                    type: string
                    description: Broker ID sent with the order, if any
                    required: false
                  - name: cid
                    type: integer
                    description: Optional client order ID
                    required: false
                  - name: r
                    type: string
                    description: Reason for order rejection
                    enumValues:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    required: false
                  - name: rb
                    type: string
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    required: false
                  - name: ts
                    type: integer
                    description: Order timestamp seconds since epoch
                    required: true
                  - name: tn
                    type: integer
                    description: Order timestamp nanoseconds
                    required: true
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - t
              - ts
              - tn
              - oid
              - r
              - txt
            properties:
              t:
                type: string
                const: e
                description: Message type (cancel or replace rejected)
                x-parser-schema-id: <anonymous-schema-177>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-178>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-179>
              oid:
                type: string
                description: Order ID
                x-parser-schema-id: <anonymous-schema-180>
              cid:
                type: integer
                format: uint64
                description: >-
                  Optional client order ID of the rejected request's target
                  order (present when the original order carried a cid).
                x-parser-schema-id: <anonymous-schema-181>
              r:
                type: string
                description: Why the request was rejected, in plain English
                x-parser-schema-id: <anonymous-schema-182>
              txt:
                type: string
                description: Why the request was rejected, in plain English; same as `r`
                x-parser-schema-id: <anonymous-schema-183>
              o:
                allOf:
                  - type: object
                    description: Order details
                    required:
                      - oid
                      - u
                      - aid
                      - s
                      - p
                      - q
                      - xq
                      - rq
                      - o
                      - d
                      - tif
                      - po
                      - ts
                      - tn
                    properties:
                      oid:
                        type: string
                        description: Order ID
                        x-parser-schema-id: <anonymous-schema-186>
                      u:
                        type: string
                        format: uuid
                        description: >-
                          Actor of record — the authenticated user who placed
                          this order. Distinct from the owning account `aid`: a
                          user may place orders on an account they do not own
                          (e.g. a proxy or algo acting for another party).
                        x-parser-schema-id: <anonymous-schema-187>
                      aid:
                        type: string
                        description: >-
                          Owning account — whose position, balance, and risk
                          this order moves.
                        x-parser-schema-id: <anonymous-schema-188>
                      s:
                        type: string
                        description: Symbol (e.g. XAU-PERP)
                        x-parser-schema-id: <anonymous-schema-189>
                      p:
                        type: string
                        pattern: ^-?\d+(\.\d+)?$
                        description: Order price as decimal string
                        x-parser-schema-id: <anonymous-schema-190>
                      q:
                        type: integer
                        format: uint64
                        description: Order quantity in contracts
                        x-parser-schema-id: <anonymous-schema-191>
                      xq:
                        type: integer
                        format: uint64
                        description: Filled quantity
                        x-parser-schema-id: <anonymous-schema-192>
                      rq:
                        type: integer
                        format: uint64
                        description: Remaining quantity
                        x-parser-schema-id: <anonymous-schema-193>
                      o:
                        type: string
                        enum:
                          - PENDING
                          - ACCEPTED
                          - PARTIALLY_FILLED
                          - FILLED
                          - CANCELED
                          - REJECTED
                          - EXPIRED
                          - REPLACED
                          - DONE_FOR_DAY
                          - UNKNOWN
                        description: Order state
                        x-parser-schema-id: <anonymous-schema-194>
                      d:
                        type: string
                        enum:
                          - B
                          - S
                        description: Side (B=Buy, S=Sell)
                        x-parser-schema-id: <anonymous-schema-195>
                      tif:
                        type: string
                        description: Time in force (e.g. GTC, IOC, DAY)
                        x-parser-schema-id: <anonymous-schema-196>
                      po:
                        type: boolean
                        description: Whether the order is post-only (maker-or-cancel)
                        x-parser-schema-id: <anonymous-schema-197>
                      tag:
                        type: string
                        description: Optional order tag (max 10 alphanumeric characters)
                        x-parser-schema-id: <anonymous-schema-198>
                      bid:
                        type: string
                        description: Broker ID sent with the order, if any
                        x-parser-schema-id: <anonymous-schema-199>
                      cid:
                        type: integer
                        format: uint64
                        description: Optional client order ID
                        x-parser-schema-id: <anonymous-schema-200>
                      r:
                        type: string
                        enum:
                          - CLOSE_ONLY
                          - INSUFFICIENT_MARGIN
                          - INSUFFICIENT_CREDIT_LIMIT
                          - MAX_OPEN_ORDERS_EXCEEDED
                          - UNKNOWN_SYMBOL
                          - EXCHANGE_CLOSED
                          - INCORRECT_QUANTITY
                          - INVALID_PRICE_INCREMENT
                          - INCORRECT_ORDER_TYPE
                          - PRICE_OUT_OF_BOUNDS
                          - NO_LIQUIDITY
                          - ORIGINAL_ORDER_TERMINATED
                          - DUPLICATE_CLIENT_ORDER_ID
                          - UNKNOWN
                        description: Reason for order rejection
                        x-parser-schema-id: <anonymous-schema-201>
                      txt:
                        type: string
                        description: Optional reject message
                        x-parser-schema-id: <anonymous-schema-202>
                      rb:
                        oneOf:
                          - type: 'null'
                            x-parser-schema-id: <anonymous-schema-204>
                          - type: string
                            enum:
                              - rej
                              - bo
                              - tbl
                            description: >
                              Optional reprice behavior. When post-only is
                              `true`, then this selects what happens if the
                              order would cross on entry. Defaults to `rej`.


                              - `rej` ("reject") rejects a post-only order that
                              would execute.

                              - `bo` ("behind opposite") reprices to be one tick
                              less aggressive than the opposite side.

                              - `tbl` ("to best limit") reprices to the best
                              price on the same side of the book.
                            x-parser-schema-id: <anonymous-schema-205>
                        description: >-
                          The reprice behavior the client sent with this order's
                          most recent entry into the book (the place, or the
                          latest replace). Reported as sent, whether or not it
                          applied. It applied only if `po` was true on that same
                          request. Unlike `po`, it does not carry over between
                          requests: a replace that omits `rb` reports `rej`.
                          Absent for orders placed before it was recorded.
                        x-parser-schema-id: <anonymous-schema-203>
                      ts:
                        type: integer
                        format: int32
                        description: Order timestamp seconds since epoch
                        x-parser-schema-id: <anonymous-schema-206>
                      tn:
                        type: integer
                        format: uint32
                        minimum: 0
                        description: Order timestamp nanoseconds
                        x-parser-schema-id: <anonymous-schema-207>
                    x-parser-schema-id: <anonymous-schema-185>
                description: >-
                  The order whose cancel or replace was rejected, in its current
                  state. Optional for wire-compat with producers/consumers
                  predating this field.
                x-parser-schema-id: <anonymous-schema-184>
            x-parser-schema-id: <anonymous-schema-176>
        title: Cancel Rejected Event
        description: Cancel or replace request was rejected (t="e")
        example: |-
          {
            "t": "e",
            "ts": 1609459200,
            "tn": 123456789,
            "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "cid": 12345,
            "r": "order would trade against your own resting order",
            "txt": "order would trade against your own resting order",
            "o": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "u": "01KB4E-MGKR-HXEG",
              "aid": "ACME-1",
              "po": false,
              "s": "XAU-PERP",
              "p": "50000.00",
              "q": 100,
              "xq": 0,
              "rq": 100,
              "o": "ACCEPTED",
              "d": "B",
              "tif": "GTC",
              "cid": 12345,
              "ts": 1609459200,
              "tn": 0
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: cancelRejectedEvent
      - &ref_23
        id: orderAckedEvent
        contentType: application/json
        payload:
          - name: Order Acknowledged Event
            description: Order has been acknowledged by the exchange (t="n")
            type: object
            properties:
              - name: t
                type: string
                description: Message type (order acknowledged)
                required: true
              - name: ts
                type: integer
                description: Timestamp seconds since epoch
                required: true
              - name: tn
                type: integer
                description: Timestamp nanoseconds
                required: true
              - name: eid
                type: string
                description: Execution ID
                required: true
              - name: o
                type: object
                description: Order details
                required: true
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    required: true
                  - name: aid
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    required: true
                  - name: s
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    required: true
                  - name: p
                    type: string
                    description: Order price as decimal string
                    required: true
                  - name: q
                    type: integer
                    description: Order quantity in contracts
                    required: true
                  - name: xq
                    type: integer
                    description: Filled quantity
                    required: true
                  - name: rq
                    type: integer
                    description: Remaining quantity
                    required: true
                  - name: o
                    type: string
                    description: Order state
                    enumValues:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    required: true
                  - name: d
                    type: string
                    description: Side (B=Buy, S=Sell)
                    enumValues:
                      - B
                      - S
                    required: true
                  - name: tif
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    required: true
                  - name: po
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    required: true
                  - name: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    required: false
                  - name: bid
                    type: string
                    description: Broker ID sent with the order, if any
                    required: false
                  - name: cid
                    type: integer
                    description: Optional client order ID
                    required: false
                  - name: r
                    type: string
                    description: Reason for order rejection
                    enumValues:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    required: false
                  - name: rb
                    type: string
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    required: false
                  - name: ts
                    type: integer
                    description: Order timestamp seconds since epoch
                    required: true
                  - name: tn
                    type: integer
                    description: Order timestamp nanoseconds
                    required: true
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - t
              - ts
              - tn
              - eid
              - o
            properties:
              t:
                type: string
                const: 'n'
                description: Message type (order acknowledged)
                x-parser-schema-id: <anonymous-schema-209>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-210>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-211>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-212>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - aid
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - po
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-214>
                  u:
                    type: string
                    format: uuid
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    x-parser-schema-id: <anonymous-schema-215>
                  aid:
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    x-parser-schema-id: <anonymous-schema-216>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-217>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-218>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-219>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-220>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-221>
                  o:
                    type: string
                    enum:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    description: Order state
                    x-parser-schema-id: <anonymous-schema-222>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-223>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-224>
                  po:
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    x-parser-schema-id: <anonymous-schema-225>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-226>
                  bid:
                    type: string
                    description: Broker ID sent with the order, if any
                    x-parser-schema-id: <anonymous-schema-227>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-228>
                  r:
                    type: string
                    enum:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-229>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-230>
                  rb:
                    oneOf:
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-232>
                      - type: string
                        enum:
                          - rej
                          - bo
                          - tbl
                        description: >
                          Optional reprice behavior. When post-only is `true`,
                          then this selects what happens if the order would
                          cross on entry. Defaults to `rej`.


                          - `rej` ("reject") rejects a post-only order that
                          would execute.

                          - `bo` ("behind opposite") reprices to be one tick
                          less aggressive than the opposite side.

                          - `tbl` ("to best limit") reprices to the best price
                          on the same side of the book.
                        x-parser-schema-id: <anonymous-schema-233>
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    x-parser-schema-id: <anonymous-schema-231>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-234>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-235>
                x-parser-schema-id: <anonymous-schema-213>
            x-parser-schema-id: <anonymous-schema-208>
        title: Order Acknowledged Event
        description: Order has been acknowledged by the exchange (t="n")
        example: |-
          {
            "t": "n",
            "ts": 1609459200,
            "tn": 123456789,
            "eid": "E-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "o": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "u": "01KB4E-MGKR-HXEG",
              "aid": "ACME-1",
              "po": false,
              "s": "XAU-PERP",
              "p": "50000.00",
              "q": 100,
              "xq": 0,
              "rq": 100,
              "o": "ACCEPTED",
              "d": "B",
              "tif": "GTC",
              "ts": 1609459200,
              "tn": 0
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderAckedEvent
      - &ref_24
        id: orderCanceledEvent
        contentType: application/json
        payload:
          - name: Order Canceled Event
            description: Order has been canceled (t="c")
            type: object
            properties:
              - name: t
                type: string
                description: Message type (order canceled)
                required: true
              - name: ts
                type: integer
                description: Timestamp seconds since epoch
                required: true
              - name: tn
                type: integer
                description: Timestamp nanoseconds
                required: true
              - name: eid
                type: string
                description: Execution ID
                required: true
              - name: o
                type: object
                description: Order details
                required: true
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    required: true
                  - name: aid
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    required: true
                  - name: s
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    required: true
                  - name: p
                    type: string
                    description: Order price as decimal string
                    required: true
                  - name: q
                    type: integer
                    description: Order quantity in contracts
                    required: true
                  - name: xq
                    type: integer
                    description: Filled quantity
                    required: true
                  - name: rq
                    type: integer
                    description: Remaining quantity
                    required: true
                  - name: o
                    type: string
                    description: Order state
                    enumValues:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    required: true
                  - name: d
                    type: string
                    description: Side (B=Buy, S=Sell)
                    enumValues:
                      - B
                      - S
                    required: true
                  - name: tif
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    required: true
                  - name: po
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    required: true
                  - name: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    required: false
                  - name: bid
                    type: string
                    description: Broker ID sent with the order, if any
                    required: false
                  - name: cid
                    type: integer
                    description: Optional client order ID
                    required: false
                  - name: r
                    type: string
                    description: Reason for order rejection
                    enumValues:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    required: false
                  - name: rb
                    type: string
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    required: false
                  - name: ts
                    type: integer
                    description: Order timestamp seconds since epoch
                    required: true
                  - name: tn
                    type: integer
                    description: Order timestamp nanoseconds
                    required: true
              - name: xr
                type: string
                description: >-
                  Cancel reason. Empty for a cancel that the user requested.
                  `CONNECTION_LOSS` or `LOGOUT` when the end of a session
                  canceled the order.
                required: true
              - name: txt
                type: string
                description: Cancel message. Empty for a cancel that the user requested.
                required: true
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - t
              - ts
              - tn
              - eid
              - o
              - xr
              - txt
            properties:
              t:
                type: string
                const: c
                description: Message type (order canceled)
                x-parser-schema-id: <anonymous-schema-237>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-238>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-239>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-240>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - aid
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - po
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-242>
                  u:
                    type: string
                    format: uuid
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    x-parser-schema-id: <anonymous-schema-243>
                  aid:
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    x-parser-schema-id: <anonymous-schema-244>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-245>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-246>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-247>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-248>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-249>
                  o:
                    type: string
                    enum:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    description: Order state
                    x-parser-schema-id: <anonymous-schema-250>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-251>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-252>
                  po:
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    x-parser-schema-id: <anonymous-schema-253>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-254>
                  bid:
                    type: string
                    description: Broker ID sent with the order, if any
                    x-parser-schema-id: <anonymous-schema-255>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-256>
                  r:
                    type: string
                    enum:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-257>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-258>
                  rb:
                    oneOf:
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-260>
                      - type: string
                        enum:
                          - rej
                          - bo
                          - tbl
                        description: >
                          Optional reprice behavior. When post-only is `true`,
                          then this selects what happens if the order would
                          cross on entry. Defaults to `rej`.


                          - `rej` ("reject") rejects a post-only order that
                          would execute.

                          - `bo` ("behind opposite") reprices to be one tick
                          less aggressive than the opposite side.

                          - `tbl` ("to best limit") reprices to the best price
                          on the same side of the book.
                        x-parser-schema-id: <anonymous-schema-261>
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    x-parser-schema-id: <anonymous-schema-259>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-262>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-263>
                x-parser-schema-id: <anonymous-schema-241>
              xr:
                type: string
                description: >-
                  Cancel reason. Empty for a cancel that the user requested.
                  `CONNECTION_LOSS` or `LOGOUT` when the end of a session
                  canceled the order.
                x-parser-schema-id: <anonymous-schema-264>
              txt:
                type: string
                description: Cancel message. Empty for a cancel that the user requested.
                x-parser-schema-id: <anonymous-schema-265>
            x-parser-schema-id: <anonymous-schema-236>
        title: Order Canceled Event
        description: Order has been canceled (t="c")
        example: |-
          {
            "t": "c",
            "ts": 1609459200,
            "tn": 123456789,
            "eid": "E-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "o": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "u": "01KB4E-MGKR-HXEG",
              "aid": "ACME-1",
              "po": false,
              "s": "XAU-PERP",
              "p": "50000.00",
              "q": 100,
              "xq": 0,
              "rq": 100,
              "o": "CANCELED",
              "d": "B",
              "tif": "GTC",
              "ts": 1609459200,
              "tn": 0
            },
            "xr": "",
            "txt": ""
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderCanceledEvent
      - &ref_25
        id: orderReplacedOrAmendedEvent
        contentType: application/json
        payload:
          - name: Order Replaced/Amended Event
            description: Order has been replaced or amended (t="r")
            type: object
            properties:
              - name: t
                type: string
                description: Message type (order replaced/amended)
                required: true
              - name: ts
                type: integer
                description: Timestamp seconds since epoch
                required: true
              - name: tn
                type: integer
                description: Timestamp nanoseconds
                required: true
              - name: eid
                type: string
                description: Execution ID
                required: true
              - name: 'no'
                type: object
                description: >-
                  The new replacement order. Present only for a cancel-replace;
                  absent on an in-place amend.
                required: false
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    required: true
                  - name: aid
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    required: true
                  - name: s
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    required: true
                  - name: p
                    type: string
                    description: Order price as decimal string
                    required: true
                  - name: q
                    type: integer
                    description: Order quantity in contracts
                    required: true
                  - name: xq
                    type: integer
                    description: Filled quantity
                    required: true
                  - name: rq
                    type: integer
                    description: Remaining quantity
                    required: true
                  - name: o
                    type: string
                    description: Order state
                    enumValues:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    required: true
                  - name: d
                    type: string
                    description: Side (B=Buy, S=Sell)
                    enumValues:
                      - B
                      - S
                    required: true
                  - name: tif
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    required: true
                  - name: po
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    required: true
                  - name: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    required: false
                  - name: bid
                    type: string
                    description: Broker ID sent with the order, if any
                    required: false
                  - name: cid
                    type: integer
                    description: Optional client order ID
                    required: false
                  - name: r
                    type: string
                    description: Reason for order rejection
                    enumValues:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    required: false
                  - name: rb
                    type: string
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    required: false
                  - name: ts
                    type: integer
                    description: Order timestamp seconds since epoch
                    required: true
                  - name: tn
                    type: integer
                    description: Order timestamp nanoseconds
                    required: true
              - name: noid
                type: string
                description: >-
                  The order ID of the new replacement order. Present only for a
                  cancel-replace; absent on an in-place amend.
                required: false
              - name: ro
                type: object
                description: >-
                  The original order that was replaced, now in terminal REPLACED
                  state.
                required: true
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    required: true
                  - name: aid
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    required: true
                  - name: s
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    required: true
                  - name: p
                    type: string
                    description: Order price as decimal string
                    required: true
                  - name: q
                    type: integer
                    description: Order quantity in contracts
                    required: true
                  - name: xq
                    type: integer
                    description: Filled quantity
                    required: true
                  - name: rq
                    type: integer
                    description: Remaining quantity
                    required: true
                  - name: o
                    type: string
                    description: Order state
                    enumValues:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    required: true
                  - name: d
                    type: string
                    description: Side (B=Buy, S=Sell)
                    enumValues:
                      - B
                      - S
                    required: true
                  - name: tif
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    required: true
                  - name: po
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    required: true
                  - name: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    required: false
                  - name: bid
                    type: string
                    description: Broker ID sent with the order, if any
                    required: false
                  - name: cid
                    type: integer
                    description: Optional client order ID
                    required: false
                  - name: r
                    type: string
                    description: Reason for order rejection
                    enumValues:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    required: false
                  - name: rb
                    type: string
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    required: false
                  - name: ts
                    type: integer
                    description: Order timestamp seconds since epoch
                    required: true
                  - name: tn
                    type: integer
                    description: Order timestamp nanoseconds
                    required: true
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - t
              - ts
              - tn
              - eid
              - ro
            properties:
              t:
                type: string
                const: r
                description: Message type (order replaced/amended)
                x-parser-schema-id: <anonymous-schema-267>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-268>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-269>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-270>
              'no':
                allOf:
                  - type: object
                    description: Order details
                    required:
                      - oid
                      - u
                      - aid
                      - s
                      - p
                      - q
                      - xq
                      - rq
                      - o
                      - d
                      - tif
                      - po
                      - ts
                      - tn
                    properties:
                      oid:
                        type: string
                        description: Order ID
                        x-parser-schema-id: <anonymous-schema-273>
                      u:
                        type: string
                        format: uuid
                        description: >-
                          Actor of record — the authenticated user who placed
                          this order. Distinct from the owning account `aid`: a
                          user may place orders on an account they do not own
                          (e.g. a proxy or algo acting for another party).
                        x-parser-schema-id: <anonymous-schema-274>
                      aid:
                        type: string
                        description: >-
                          Owning account — whose position, balance, and risk
                          this order moves.
                        x-parser-schema-id: <anonymous-schema-275>
                      s:
                        type: string
                        description: Symbol (e.g. XAU-PERP)
                        x-parser-schema-id: <anonymous-schema-276>
                      p:
                        type: string
                        pattern: ^-?\d+(\.\d+)?$
                        description: Order price as decimal string
                        x-parser-schema-id: <anonymous-schema-277>
                      q:
                        type: integer
                        format: uint64
                        description: Order quantity in contracts
                        x-parser-schema-id: <anonymous-schema-278>
                      xq:
                        type: integer
                        format: uint64
                        description: Filled quantity
                        x-parser-schema-id: <anonymous-schema-279>
                      rq:
                        type: integer
                        format: uint64
                        description: Remaining quantity
                        x-parser-schema-id: <anonymous-schema-280>
                      o:
                        type: string
                        enum:
                          - PENDING
                          - ACCEPTED
                          - PARTIALLY_FILLED
                          - FILLED
                          - CANCELED
                          - REJECTED
                          - EXPIRED
                          - REPLACED
                          - DONE_FOR_DAY
                          - UNKNOWN
                        description: Order state
                        x-parser-schema-id: <anonymous-schema-281>
                      d:
                        type: string
                        enum:
                          - B
                          - S
                        description: Side (B=Buy, S=Sell)
                        x-parser-schema-id: <anonymous-schema-282>
                      tif:
                        type: string
                        description: Time in force (e.g. GTC, IOC, DAY)
                        x-parser-schema-id: <anonymous-schema-283>
                      po:
                        type: boolean
                        description: Whether the order is post-only (maker-or-cancel)
                        x-parser-schema-id: <anonymous-schema-284>
                      tag:
                        type: string
                        description: Optional order tag (max 10 alphanumeric characters)
                        x-parser-schema-id: <anonymous-schema-285>
                      bid:
                        type: string
                        description: Broker ID sent with the order, if any
                        x-parser-schema-id: <anonymous-schema-286>
                      cid:
                        type: integer
                        format: uint64
                        description: Optional client order ID
                        x-parser-schema-id: <anonymous-schema-287>
                      r:
                        type: string
                        enum:
                          - CLOSE_ONLY
                          - INSUFFICIENT_MARGIN
                          - INSUFFICIENT_CREDIT_LIMIT
                          - MAX_OPEN_ORDERS_EXCEEDED
                          - UNKNOWN_SYMBOL
                          - EXCHANGE_CLOSED
                          - INCORRECT_QUANTITY
                          - INVALID_PRICE_INCREMENT
                          - INCORRECT_ORDER_TYPE
                          - PRICE_OUT_OF_BOUNDS
                          - NO_LIQUIDITY
                          - ORIGINAL_ORDER_TERMINATED
                          - DUPLICATE_CLIENT_ORDER_ID
                          - UNKNOWN
                        description: Reason for order rejection
                        x-parser-schema-id: <anonymous-schema-288>
                      txt:
                        type: string
                        description: Optional reject message
                        x-parser-schema-id: <anonymous-schema-289>
                      rb:
                        oneOf:
                          - type: 'null'
                            x-parser-schema-id: <anonymous-schema-291>
                          - type: string
                            enum:
                              - rej
                              - bo
                              - tbl
                            description: >
                              Optional reprice behavior. When post-only is
                              `true`, then this selects what happens if the
                              order would cross on entry. Defaults to `rej`.


                              - `rej` ("reject") rejects a post-only order that
                              would execute.

                              - `bo` ("behind opposite") reprices to be one tick
                              less aggressive than the opposite side.

                              - `tbl` ("to best limit") reprices to the best
                              price on the same side of the book.
                            x-parser-schema-id: <anonymous-schema-292>
                        description: >-
                          The reprice behavior the client sent with this order's
                          most recent entry into the book (the place, or the
                          latest replace). Reported as sent, whether or not it
                          applied. It applied only if `po` was true on that same
                          request. Unlike `po`, it does not carry over between
                          requests: a replace that omits `rb` reports `rej`.
                          Absent for orders placed before it was recorded.
                        x-parser-schema-id: <anonymous-schema-290>
                      ts:
                        type: integer
                        format: int32
                        description: Order timestamp seconds since epoch
                        x-parser-schema-id: <anonymous-schema-293>
                      tn:
                        type: integer
                        format: uint32
                        minimum: 0
                        description: Order timestamp nanoseconds
                        x-parser-schema-id: <anonymous-schema-294>
                    x-parser-schema-id: <anonymous-schema-272>
                description: >-
                  The new replacement order. Present only for a cancel-replace;
                  absent on an in-place amend.
                x-parser-schema-id: <anonymous-schema-271>
              noid:
                type: string
                description: >-
                  The order ID of the new replacement order. Present only for a
                  cancel-replace; absent on an in-place amend.
                x-parser-schema-id: <anonymous-schema-295>
              ro:
                allOf:
                  - type: object
                    description: Order details
                    required:
                      - oid
                      - u
                      - aid
                      - s
                      - p
                      - q
                      - xq
                      - rq
                      - o
                      - d
                      - tif
                      - po
                      - ts
                      - tn
                    properties:
                      oid:
                        type: string
                        description: Order ID
                        x-parser-schema-id: <anonymous-schema-298>
                      u:
                        type: string
                        format: uuid
                        description: >-
                          Actor of record — the authenticated user who placed
                          this order. Distinct from the owning account `aid`: a
                          user may place orders on an account they do not own
                          (e.g. a proxy or algo acting for another party).
                        x-parser-schema-id: <anonymous-schema-299>
                      aid:
                        type: string
                        description: >-
                          Owning account — whose position, balance, and risk
                          this order moves.
                        x-parser-schema-id: <anonymous-schema-300>
                      s:
                        type: string
                        description: Symbol (e.g. XAU-PERP)
                        x-parser-schema-id: <anonymous-schema-301>
                      p:
                        type: string
                        pattern: ^-?\d+(\.\d+)?$
                        description: Order price as decimal string
                        x-parser-schema-id: <anonymous-schema-302>
                      q:
                        type: integer
                        format: uint64
                        description: Order quantity in contracts
                        x-parser-schema-id: <anonymous-schema-303>
                      xq:
                        type: integer
                        format: uint64
                        description: Filled quantity
                        x-parser-schema-id: <anonymous-schema-304>
                      rq:
                        type: integer
                        format: uint64
                        description: Remaining quantity
                        x-parser-schema-id: <anonymous-schema-305>
                      o:
                        type: string
                        enum:
                          - PENDING
                          - ACCEPTED
                          - PARTIALLY_FILLED
                          - FILLED
                          - CANCELED
                          - REJECTED
                          - EXPIRED
                          - REPLACED
                          - DONE_FOR_DAY
                          - UNKNOWN
                        description: Order state
                        x-parser-schema-id: <anonymous-schema-306>
                      d:
                        type: string
                        enum:
                          - B
                          - S
                        description: Side (B=Buy, S=Sell)
                        x-parser-schema-id: <anonymous-schema-307>
                      tif:
                        type: string
                        description: Time in force (e.g. GTC, IOC, DAY)
                        x-parser-schema-id: <anonymous-schema-308>
                      po:
                        type: boolean
                        description: Whether the order is post-only (maker-or-cancel)
                        x-parser-schema-id: <anonymous-schema-309>
                      tag:
                        type: string
                        description: Optional order tag (max 10 alphanumeric characters)
                        x-parser-schema-id: <anonymous-schema-310>
                      bid:
                        type: string
                        description: Broker ID sent with the order, if any
                        x-parser-schema-id: <anonymous-schema-311>
                      cid:
                        type: integer
                        format: uint64
                        description: Optional client order ID
                        x-parser-schema-id: <anonymous-schema-312>
                      r:
                        type: string
                        enum:
                          - CLOSE_ONLY
                          - INSUFFICIENT_MARGIN
                          - INSUFFICIENT_CREDIT_LIMIT
                          - MAX_OPEN_ORDERS_EXCEEDED
                          - UNKNOWN_SYMBOL
                          - EXCHANGE_CLOSED
                          - INCORRECT_QUANTITY
                          - INVALID_PRICE_INCREMENT
                          - INCORRECT_ORDER_TYPE
                          - PRICE_OUT_OF_BOUNDS
                          - NO_LIQUIDITY
                          - ORIGINAL_ORDER_TERMINATED
                          - DUPLICATE_CLIENT_ORDER_ID
                          - UNKNOWN
                        description: Reason for order rejection
                        x-parser-schema-id: <anonymous-schema-313>
                      txt:
                        type: string
                        description: Optional reject message
                        x-parser-schema-id: <anonymous-schema-314>
                      rb:
                        oneOf:
                          - type: 'null'
                            x-parser-schema-id: <anonymous-schema-316>
                          - type: string
                            enum:
                              - rej
                              - bo
                              - tbl
                            description: >
                              Optional reprice behavior. When post-only is
                              `true`, then this selects what happens if the
                              order would cross on entry. Defaults to `rej`.


                              - `rej` ("reject") rejects a post-only order that
                              would execute.

                              - `bo` ("behind opposite") reprices to be one tick
                              less aggressive than the opposite side.

                              - `tbl` ("to best limit") reprices to the best
                              price on the same side of the book.
                            x-parser-schema-id: <anonymous-schema-317>
                        description: >-
                          The reprice behavior the client sent with this order's
                          most recent entry into the book (the place, or the
                          latest replace). Reported as sent, whether or not it
                          applied. It applied only if `po` was true on that same
                          request. Unlike `po`, it does not carry over between
                          requests: a replace that omits `rb` reports `rej`.
                          Absent for orders placed before it was recorded.
                        x-parser-schema-id: <anonymous-schema-315>
                      ts:
                        type: integer
                        format: int32
                        description: Order timestamp seconds since epoch
                        x-parser-schema-id: <anonymous-schema-318>
                      tn:
                        type: integer
                        format: uint32
                        minimum: 0
                        description: Order timestamp nanoseconds
                        x-parser-schema-id: <anonymous-schema-319>
                    x-parser-schema-id: <anonymous-schema-297>
                description: >-
                  The original order that was replaced, now in terminal REPLACED
                  state.
                x-parser-schema-id: <anonymous-schema-296>
            x-parser-schema-id: <anonymous-schema-266>
        title: Order Replaced/Amended Event
        description: Order has been replaced or amended (t="r")
        example: |-
          {
            "t": "r",
            "ts": 1609459200,
            "tn": 123456789,
            "eid": "E-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "no": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "u": "01KB4E-MGKR-HXEG",
              "aid": "ACME-1",
              "po": false,
              "s": "XAU-PERP",
              "p": "50100.00",
              "q": 100,
              "xq": 0,
              "rq": 100,
              "o": "ACCEPTED",
              "d": "B",
              "tif": "GTC",
              "ts": 1609459200,
              "tn": 0,
              "cid": 123456
            },
            "noid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "ro": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAS",
              "u": "01KB4E-MGKR-HXEG",
              "aid": "ACME-1",
              "po": false,
              "s": "XAU-PERP",
              "p": "50000.00",
              "q": 100,
              "xq": 0,
              "rq": 0,
              "o": "REPLACED",
              "d": "B",
              "tif": "GTC",
              "ts": 1609459100,
              "tn": 0,
              "cid": 123456
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderReplacedOrAmendedEvent
      - &ref_26
        id: orderRejectedEvent
        contentType: application/json
        payload:
          - name: Order Rejected Event
            description: New order has been rejected (t="j")
            type: object
            properties:
              - name: t
                type: string
                description: Message type (order rejected)
                required: true
              - name: ts
                type: integer
                description: Timestamp seconds since epoch
                required: true
              - name: tn
                type: integer
                description: Timestamp nanoseconds
                required: true
              - name: eid
                type: string
                description: Execution ID
                required: true
              - name: o
                type: object
                description: Order details
                required: true
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    required: true
                  - name: aid
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    required: true
                  - name: s
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    required: true
                  - name: p
                    type: string
                    description: Order price as decimal string
                    required: true
                  - name: q
                    type: integer
                    description: Order quantity in contracts
                    required: true
                  - name: xq
                    type: integer
                    description: Filled quantity
                    required: true
                  - name: rq
                    type: integer
                    description: Remaining quantity
                    required: true
                  - name: o
                    type: string
                    description: Order state
                    enumValues:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    required: true
                  - name: d
                    type: string
                    description: Side (B=Buy, S=Sell)
                    enumValues:
                      - B
                      - S
                    required: true
                  - name: tif
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    required: true
                  - name: po
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    required: true
                  - name: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    required: false
                  - name: bid
                    type: string
                    description: Broker ID sent with the order, if any
                    required: false
                  - name: cid
                    type: integer
                    description: Optional client order ID
                    required: false
                  - name: r
                    type: string
                    description: Reason for order rejection
                    enumValues:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    required: false
                  - name: rb
                    type: string
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    required: false
                  - name: ts
                    type: integer
                    description: Order timestamp seconds since epoch
                    required: true
                  - name: tn
                    type: integer
                    description: Order timestamp nanoseconds
                    required: true
              - name: r
                type: string
                description: Reason for order rejection
                enumValues:
                  - CLOSE_ONLY
                  - INSUFFICIENT_MARGIN
                  - INSUFFICIENT_CREDIT_LIMIT
                  - MAX_OPEN_ORDERS_EXCEEDED
                  - UNKNOWN_SYMBOL
                  - EXCHANGE_CLOSED
                  - INCORRECT_QUANTITY
                  - INVALID_PRICE_INCREMENT
                  - INCORRECT_ORDER_TYPE
                  - PRICE_OUT_OF_BOUNDS
                  - NO_LIQUIDITY
                  - ORIGINAL_ORDER_TERMINATED
                  - DUPLICATE_CLIENT_ORDER_ID
                  - UNKNOWN
                required: false
              - name: txt
                type: string
                description: Reject message
                required: false
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - t
              - ts
              - tn
              - eid
              - o
            properties:
              t:
                type: string
                const: j
                description: Message type (order rejected)
                x-parser-schema-id: <anonymous-schema-321>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-322>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-323>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-324>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - aid
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - po
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-326>
                  u:
                    type: string
                    format: uuid
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    x-parser-schema-id: <anonymous-schema-327>
                  aid:
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    x-parser-schema-id: <anonymous-schema-328>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-329>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-330>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-331>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-332>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-333>
                  o:
                    type: string
                    enum:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    description: Order state
                    x-parser-schema-id: <anonymous-schema-334>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-335>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-336>
                  po:
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    x-parser-schema-id: <anonymous-schema-337>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-338>
                  bid:
                    type: string
                    description: Broker ID sent with the order, if any
                    x-parser-schema-id: <anonymous-schema-339>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-340>
                  r:
                    type: string
                    enum:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-341>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-342>
                  rb:
                    oneOf:
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-344>
                      - type: string
                        enum:
                          - rej
                          - bo
                          - tbl
                        description: >
                          Optional reprice behavior. When post-only is `true`,
                          then this selects what happens if the order would
                          cross on entry. Defaults to `rej`.


                          - `rej` ("reject") rejects a post-only order that
                          would execute.

                          - `bo` ("behind opposite") reprices to be one tick
                          less aggressive than the opposite side.

                          - `tbl` ("to best limit") reprices to the best price
                          on the same side of the book.
                        x-parser-schema-id: <anonymous-schema-345>
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    x-parser-schema-id: <anonymous-schema-343>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-346>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-347>
                x-parser-schema-id: <anonymous-schema-325>
              r:
                type: string
                enum:
                  - CLOSE_ONLY
                  - INSUFFICIENT_MARGIN
                  - INSUFFICIENT_CREDIT_LIMIT
                  - MAX_OPEN_ORDERS_EXCEEDED
                  - UNKNOWN_SYMBOL
                  - EXCHANGE_CLOSED
                  - INCORRECT_QUANTITY
                  - INVALID_PRICE_INCREMENT
                  - INCORRECT_ORDER_TYPE
                  - PRICE_OUT_OF_BOUNDS
                  - NO_LIQUIDITY
                  - ORIGINAL_ORDER_TERMINATED
                  - DUPLICATE_CLIENT_ORDER_ID
                  - UNKNOWN
                description: Reason for order rejection
                x-parser-schema-id: <anonymous-schema-348>
              txt:
                type: string
                description: Reject message
                x-parser-schema-id: <anonymous-schema-349>
            x-parser-schema-id: <anonymous-schema-320>
        title: Order Rejected Event
        description: New order has been rejected (t="j")
        example: |-
          {
            "t": "j",
            "ts": 1609459200,
            "tn": 123456789,
            "eid": "E-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "o": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "u": "01KB4E-MGKR-HXEG",
              "aid": "ACME-1",
              "po": false,
              "s": "XAU-PERP",
              "p": "50000.00",
              "q": 100,
              "xq": 0,
              "rq": 100,
              "o": "REJECTED",
              "d": "B",
              "tif": "GTC",
              "ts": 1609459200,
              "tn": 0
            },
            "r": "INSUFFICIENT_MARGIN",
            "txt": "Insufficient margin to place order"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderRejectedEvent
      - &ref_27
        id: orderExpiredEvent
        contentType: application/json
        payload:
          - name: Order Expired Event
            description: Order has expired (t="x")
            type: object
            properties:
              - name: t
                type: string
                description: Message type (order expired)
                required: true
              - name: ts
                type: integer
                description: Timestamp seconds since epoch
                required: true
              - name: tn
                type: integer
                description: Timestamp nanoseconds
                required: true
              - name: eid
                type: string
                description: Execution ID
                required: true
              - name: o
                type: object
                description: Order details
                required: true
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    required: true
                  - name: aid
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    required: true
                  - name: s
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    required: true
                  - name: p
                    type: string
                    description: Order price as decimal string
                    required: true
                  - name: q
                    type: integer
                    description: Order quantity in contracts
                    required: true
                  - name: xq
                    type: integer
                    description: Filled quantity
                    required: true
                  - name: rq
                    type: integer
                    description: Remaining quantity
                    required: true
                  - name: o
                    type: string
                    description: Order state
                    enumValues:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    required: true
                  - name: d
                    type: string
                    description: Side (B=Buy, S=Sell)
                    enumValues:
                      - B
                      - S
                    required: true
                  - name: tif
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    required: true
                  - name: po
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    required: true
                  - name: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    required: false
                  - name: bid
                    type: string
                    description: Broker ID sent with the order, if any
                    required: false
                  - name: cid
                    type: integer
                    description: Optional client order ID
                    required: false
                  - name: r
                    type: string
                    description: Reason for order rejection
                    enumValues:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    required: false
                  - name: rb
                    type: string
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    required: false
                  - name: ts
                    type: integer
                    description: Order timestamp seconds since epoch
                    required: true
                  - name: tn
                    type: integer
                    description: Order timestamp nanoseconds
                    required: true
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - t
              - ts
              - tn
              - eid
              - o
            properties:
              t:
                type: string
                const: x
                description: Message type (order expired)
                x-parser-schema-id: <anonymous-schema-351>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-352>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-353>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-354>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - aid
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - po
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-356>
                  u:
                    type: string
                    format: uuid
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    x-parser-schema-id: <anonymous-schema-357>
                  aid:
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    x-parser-schema-id: <anonymous-schema-358>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-359>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-360>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-361>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-362>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-363>
                  o:
                    type: string
                    enum:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    description: Order state
                    x-parser-schema-id: <anonymous-schema-364>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-365>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-366>
                  po:
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    x-parser-schema-id: <anonymous-schema-367>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-368>
                  bid:
                    type: string
                    description: Broker ID sent with the order, if any
                    x-parser-schema-id: <anonymous-schema-369>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-370>
                  r:
                    type: string
                    enum:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-371>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-372>
                  rb:
                    oneOf:
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-374>
                      - type: string
                        enum:
                          - rej
                          - bo
                          - tbl
                        description: >
                          Optional reprice behavior. When post-only is `true`,
                          then this selects what happens if the order would
                          cross on entry. Defaults to `rej`.


                          - `rej` ("reject") rejects a post-only order that
                          would execute.

                          - `bo` ("behind opposite") reprices to be one tick
                          less aggressive than the opposite side.

                          - `tbl` ("to best limit") reprices to the best price
                          on the same side of the book.
                        x-parser-schema-id: <anonymous-schema-375>
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    x-parser-schema-id: <anonymous-schema-373>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-376>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-377>
                x-parser-schema-id: <anonymous-schema-355>
            x-parser-schema-id: <anonymous-schema-350>
        title: Order Expired Event
        description: Order has expired (t="x")
        example: |-
          {
            "t": "x",
            "ts": 1609459200,
            "tn": 123456789,
            "eid": "E-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "o": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "u": "01KB4E-MGKR-HXEG",
              "aid": "ACME-1",
              "po": false,
              "s": "XAU-PERP",
              "p": "50000.00",
              "q": 100,
              "xq": 0,
              "rq": 100,
              "o": "EXPIRED",
              "d": "B",
              "tif": "IOC",
              "ts": 1609459200,
              "tn": 0
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderExpiredEvent
      - &ref_28
        id: orderDoneForDayEvent
        contentType: application/json
        payload:
          - name: Order Done For Day Event
            description: Order is done for the day (t="d")
            type: object
            properties:
              - name: t
                type: string
                description: Message type (order done for day)
                required: true
              - name: ts
                type: integer
                description: Timestamp seconds since epoch
                required: true
              - name: tn
                type: integer
                description: Timestamp nanoseconds
                required: true
              - name: eid
                type: string
                description: Execution ID
                required: true
              - name: o
                type: object
                description: Order details
                required: true
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    required: true
                  - name: aid
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    required: true
                  - name: s
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    required: true
                  - name: p
                    type: string
                    description: Order price as decimal string
                    required: true
                  - name: q
                    type: integer
                    description: Order quantity in contracts
                    required: true
                  - name: xq
                    type: integer
                    description: Filled quantity
                    required: true
                  - name: rq
                    type: integer
                    description: Remaining quantity
                    required: true
                  - name: o
                    type: string
                    description: Order state
                    enumValues:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    required: true
                  - name: d
                    type: string
                    description: Side (B=Buy, S=Sell)
                    enumValues:
                      - B
                      - S
                    required: true
                  - name: tif
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    required: true
                  - name: po
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    required: true
                  - name: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    required: false
                  - name: bid
                    type: string
                    description: Broker ID sent with the order, if any
                    required: false
                  - name: cid
                    type: integer
                    description: Optional client order ID
                    required: false
                  - name: r
                    type: string
                    description: Reason for order rejection
                    enumValues:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    required: false
                  - name: rb
                    type: string
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    required: false
                  - name: ts
                    type: integer
                    description: Order timestamp seconds since epoch
                    required: true
                  - name: tn
                    type: integer
                    description: Order timestamp nanoseconds
                    required: true
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - t
              - ts
              - tn
              - eid
              - o
            properties:
              t:
                type: string
                const: d
                description: Message type (order done for day)
                x-parser-schema-id: <anonymous-schema-379>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-380>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-381>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-382>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - aid
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - po
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-384>
                  u:
                    type: string
                    format: uuid
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    x-parser-schema-id: <anonymous-schema-385>
                  aid:
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    x-parser-schema-id: <anonymous-schema-386>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-387>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-388>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-389>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-390>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-391>
                  o:
                    type: string
                    enum:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    description: Order state
                    x-parser-schema-id: <anonymous-schema-392>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-393>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-394>
                  po:
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    x-parser-schema-id: <anonymous-schema-395>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-396>
                  bid:
                    type: string
                    description: Broker ID sent with the order, if any
                    x-parser-schema-id: <anonymous-schema-397>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-398>
                  r:
                    type: string
                    enum:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-399>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-400>
                  rb:
                    oneOf:
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-402>
                      - type: string
                        enum:
                          - rej
                          - bo
                          - tbl
                        description: >
                          Optional reprice behavior. When post-only is `true`,
                          then this selects what happens if the order would
                          cross on entry. Defaults to `rej`.


                          - `rej` ("reject") rejects a post-only order that
                          would execute.

                          - `bo` ("behind opposite") reprices to be one tick
                          less aggressive than the opposite side.

                          - `tbl` ("to best limit") reprices to the best price
                          on the same side of the book.
                        x-parser-schema-id: <anonymous-schema-403>
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    x-parser-schema-id: <anonymous-schema-401>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-404>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-405>
                x-parser-schema-id: <anonymous-schema-383>
            x-parser-schema-id: <anonymous-schema-378>
        title: Order Done For Day Event
        description: Order is done for the day (t="d")
        example: |-
          {
            "t": "d",
            "ts": 1609459200,
            "tn": 123456789,
            "eid": "E-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "o": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "u": "01KB4E-MGKR-HXEG",
              "aid": "ACME-1",
              "po": false,
              "s": "XAU-PERP",
              "p": "50000.00",
              "q": 100,
              "xq": 50,
              "rq": 50,
              "o": "DONE_FOR_DAY",
              "d": "B",
              "tif": "DAY",
              "ts": 1609459200,
              "tn": 0
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderDoneForDayEvent
      - &ref_29
        id: orderPartiallyFilledEvent
        contentType: application/json
        payload:
          - name: Order Partially Filled Event
            description: Order has been partially filled (t="p")
            type: object
            properties:
              - name: t
                type: string
                description: Message type (order partially filled)
                required: true
              - name: ts
                type: integer
                description: Timestamp seconds since epoch
                required: true
              - name: tn
                type: integer
                description: Timestamp nanoseconds
                required: true
              - name: eid
                type: string
                description: Execution ID
                required: true
              - name: o
                type: object
                description: Order details
                required: true
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    required: true
                  - name: aid
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    required: true
                  - name: s
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    required: true
                  - name: p
                    type: string
                    description: Order price as decimal string
                    required: true
                  - name: q
                    type: integer
                    description: Order quantity in contracts
                    required: true
                  - name: xq
                    type: integer
                    description: Filled quantity
                    required: true
                  - name: rq
                    type: integer
                    description: Remaining quantity
                    required: true
                  - name: o
                    type: string
                    description: Order state
                    enumValues:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    required: true
                  - name: d
                    type: string
                    description: Side (B=Buy, S=Sell)
                    enumValues:
                      - B
                      - S
                    required: true
                  - name: tif
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    required: true
                  - name: po
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    required: true
                  - name: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    required: false
                  - name: bid
                    type: string
                    description: Broker ID sent with the order, if any
                    required: false
                  - name: cid
                    type: integer
                    description: Optional client order ID
                    required: false
                  - name: r
                    type: string
                    description: Reason for order rejection
                    enumValues:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    required: false
                  - name: rb
                    type: string
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    required: false
                  - name: ts
                    type: integer
                    description: Order timestamp seconds since epoch
                    required: true
                  - name: tn
                    type: integer
                    description: Order timestamp nanoseconds
                    required: true
              - name: xs
                type: object
                description: Fill details
                required: true
                properties:
                  - name: tid
                    type: string
                    description: Trade ID
                    required: true
                  - name: aid
                    type: string
                    description: Owning account of the fill.
                    required: true
                  - name: s
                    type: string
                    description: Symbol
                    required: true
                  - name: q
                    type: integer
                    description: Fill quantity in contracts
                    required: true
                  - name: p
                    type: string
                    description: Fill price as decimal string
                    required: true
                  - name: d
                    type: string
                    description: Side (B=Buy, S=Sell)
                    enumValues:
                      - B
                      - S
                    required: true
                  - name: agg
                    type: boolean
                    description: Whether this fill was the aggressor (taker)
                    required: true
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - t
              - ts
              - tn
              - eid
              - o
              - xs
            properties:
              t:
                type: string
                const: p
                description: Message type (order partially filled)
                x-parser-schema-id: <anonymous-schema-407>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-408>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-409>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-410>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - aid
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - po
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-412>
                  u:
                    type: string
                    format: uuid
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    x-parser-schema-id: <anonymous-schema-413>
                  aid:
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    x-parser-schema-id: <anonymous-schema-414>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-415>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-416>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-417>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-418>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-419>
                  o:
                    type: string
                    enum:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    description: Order state
                    x-parser-schema-id: <anonymous-schema-420>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-421>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-422>
                  po:
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    x-parser-schema-id: <anonymous-schema-423>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-424>
                  bid:
                    type: string
                    description: Broker ID sent with the order, if any
                    x-parser-schema-id: <anonymous-schema-425>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-426>
                  r:
                    type: string
                    enum:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-427>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-428>
                  rb:
                    oneOf:
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-430>
                      - type: string
                        enum:
                          - rej
                          - bo
                          - tbl
                        description: >
                          Optional reprice behavior. When post-only is `true`,
                          then this selects what happens if the order would
                          cross on entry. Defaults to `rej`.


                          - `rej` ("reject") rejects a post-only order that
                          would execute.

                          - `bo` ("behind opposite") reprices to be one tick
                          less aggressive than the opposite side.

                          - `tbl` ("to best limit") reprices to the best price
                          on the same side of the book.
                        x-parser-schema-id: <anonymous-schema-431>
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    x-parser-schema-id: <anonymous-schema-429>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-432>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-433>
                x-parser-schema-id: <anonymous-schema-411>
              xs:
                type: object
                description: Fill details
                required:
                  - tid
                  - aid
                  - s
                  - q
                  - p
                  - d
                  - agg
                properties:
                  tid:
                    type: string
                    description: Trade ID
                    x-parser-schema-id: <anonymous-schema-435>
                  aid:
                    type: string
                    description: Owning account of the fill.
                    x-parser-schema-id: <anonymous-schema-436>
                  s:
                    type: string
                    description: Symbol
                    x-parser-schema-id: <anonymous-schema-437>
                  q:
                    type: integer
                    format: uint64
                    description: Fill quantity in contracts
                    x-parser-schema-id: <anonymous-schema-438>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Fill price as decimal string
                    x-parser-schema-id: <anonymous-schema-439>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-440>
                  agg:
                    type: boolean
                    description: Whether this fill was the aggressor (taker)
                    x-parser-schema-id: <anonymous-schema-441>
                x-parser-schema-id: <anonymous-schema-434>
            x-parser-schema-id: <anonymous-schema-406>
        title: Order Partially Filled Event
        description: Order has been partially filled (t="p")
        example: |-
          {
            "t": "p",
            "ts": 1609459200,
            "tn": 123456789,
            "eid": "E-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "o": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "u": "01KB4E-MGKR-HXEG",
              "aid": "ACME-1",
              "po": false,
              "s": "XAU-PERP",
              "p": "50000.00",
              "q": 100,
              "xq": 50,
              "rq": 50,
              "o": "PARTIALLY_FILLED",
              "d": "B",
              "tif": "GTC",
              "ts": 1609459200,
              "tn": 0
            },
            "xs": {
              "tid": "T-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "aid": "ACME-1",
              "s": "XAU-PERP",
              "q": 50,
              "p": "50000.00",
              "d": "B",
              "agg": false
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderPartiallyFilledEvent
      - &ref_30
        id: orderFilledEvent
        contentType: application/json
        payload:
          - name: Order Filled Event
            description: Order has been completely filled (t="f")
            type: object
            properties:
              - name: t
                type: string
                description: Message type (order filled)
                required: true
              - name: ts
                type: integer
                description: Timestamp seconds since epoch
                required: true
              - name: tn
                type: integer
                description: Timestamp nanoseconds
                required: true
              - name: eid
                type: string
                description: Execution ID
                required: true
              - name: o
                type: object
                description: Order details
                required: true
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    required: true
                  - name: aid
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    required: true
                  - name: s
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    required: true
                  - name: p
                    type: string
                    description: Order price as decimal string
                    required: true
                  - name: q
                    type: integer
                    description: Order quantity in contracts
                    required: true
                  - name: xq
                    type: integer
                    description: Filled quantity
                    required: true
                  - name: rq
                    type: integer
                    description: Remaining quantity
                    required: true
                  - name: o
                    type: string
                    description: Order state
                    enumValues:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    required: true
                  - name: d
                    type: string
                    description: Side (B=Buy, S=Sell)
                    enumValues:
                      - B
                      - S
                    required: true
                  - name: tif
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    required: true
                  - name: po
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    required: true
                  - name: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    required: false
                  - name: bid
                    type: string
                    description: Broker ID sent with the order, if any
                    required: false
                  - name: cid
                    type: integer
                    description: Optional client order ID
                    required: false
                  - name: r
                    type: string
                    description: Reason for order rejection
                    enumValues:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    required: false
                  - name: rb
                    type: string
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    required: false
                  - name: ts
                    type: integer
                    description: Order timestamp seconds since epoch
                    required: true
                  - name: tn
                    type: integer
                    description: Order timestamp nanoseconds
                    required: true
              - name: xs
                type: object
                description: Fill details
                required: true
                properties:
                  - name: tid
                    type: string
                    description: Trade ID
                    required: true
                  - name: aid
                    type: string
                    description: Owning account of the fill.
                    required: true
                  - name: s
                    type: string
                    description: Symbol
                    required: true
                  - name: q
                    type: integer
                    description: Fill quantity in contracts
                    required: true
                  - name: p
                    type: string
                    description: Fill price as decimal string
                    required: true
                  - name: d
                    type: string
                    description: Side (B=Buy, S=Sell)
                    enumValues:
                      - B
                      - S
                    required: true
                  - name: agg
                    type: boolean
                    description: Whether this fill was the aggressor (taker)
                    required: true
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - t
              - ts
              - tn
              - eid
              - o
              - xs
            properties:
              t:
                type: string
                const: f
                description: Message type (order filled)
                x-parser-schema-id: <anonymous-schema-443>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-444>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-445>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-446>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - aid
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - po
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-448>
                  u:
                    type: string
                    format: uuid
                    description: >-
                      Actor of record — the authenticated user who placed this
                      order. Distinct from the owning account `aid`: a user may
                      place orders on an account they do not own (e.g. a proxy
                      or algo acting for another party).
                    x-parser-schema-id: <anonymous-schema-449>
                  aid:
                    type: string
                    description: >-
                      Owning account — whose position, balance, and risk this
                      order moves.
                    x-parser-schema-id: <anonymous-schema-450>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-451>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-452>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-453>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-454>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-455>
                  o:
                    type: string
                    enum:
                      - PENDING
                      - ACCEPTED
                      - PARTIALLY_FILLED
                      - FILLED
                      - CANCELED
                      - REJECTED
                      - EXPIRED
                      - REPLACED
                      - DONE_FOR_DAY
                      - UNKNOWN
                    description: Order state
                    x-parser-schema-id: <anonymous-schema-456>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-457>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-458>
                  po:
                    type: boolean
                    description: Whether the order is post-only (maker-or-cancel)
                    x-parser-schema-id: <anonymous-schema-459>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-460>
                  bid:
                    type: string
                    description: Broker ID sent with the order, if any
                    x-parser-schema-id: <anonymous-schema-461>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-462>
                  r:
                    type: string
                    enum:
                      - CLOSE_ONLY
                      - INSUFFICIENT_MARGIN
                      - INSUFFICIENT_CREDIT_LIMIT
                      - MAX_OPEN_ORDERS_EXCEEDED
                      - UNKNOWN_SYMBOL
                      - EXCHANGE_CLOSED
                      - INCORRECT_QUANTITY
                      - INVALID_PRICE_INCREMENT
                      - INCORRECT_ORDER_TYPE
                      - PRICE_OUT_OF_BOUNDS
                      - NO_LIQUIDITY
                      - ORIGINAL_ORDER_TERMINATED
                      - DUPLICATE_CLIENT_ORDER_ID
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-463>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-464>
                  rb:
                    oneOf:
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-466>
                      - type: string
                        enum:
                          - rej
                          - bo
                          - tbl
                        description: >
                          Optional reprice behavior. When post-only is `true`,
                          then this selects what happens if the order would
                          cross on entry. Defaults to `rej`.


                          - `rej` ("reject") rejects a post-only order that
                          would execute.

                          - `bo` ("behind opposite") reprices to be one tick
                          less aggressive than the opposite side.

                          - `tbl` ("to best limit") reprices to the best price
                          on the same side of the book.
                        x-parser-schema-id: <anonymous-schema-467>
                    description: >-
                      The reprice behavior the client sent with this order's
                      most recent entry into the book (the place, or the latest
                      replace). Reported as sent, whether or not it applied. It
                      applied only if `po` was true on that same request. Unlike
                      `po`, it does not carry over between requests: a replace
                      that omits `rb` reports `rej`. Absent for orders placed
                      before it was recorded.
                    x-parser-schema-id: <anonymous-schema-465>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-468>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-469>
                x-parser-schema-id: <anonymous-schema-447>
              xs:
                type: object
                description: Fill details
                required:
                  - tid
                  - aid
                  - s
                  - q
                  - p
                  - d
                  - agg
                properties:
                  tid:
                    type: string
                    description: Trade ID
                    x-parser-schema-id: <anonymous-schema-471>
                  aid:
                    type: string
                    description: Owning account of the fill.
                    x-parser-schema-id: <anonymous-schema-472>
                  s:
                    type: string
                    description: Symbol
                    x-parser-schema-id: <anonymous-schema-473>
                  q:
                    type: integer
                    format: uint64
                    description: Fill quantity in contracts
                    x-parser-schema-id: <anonymous-schema-474>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Fill price as decimal string
                    x-parser-schema-id: <anonymous-schema-475>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-476>
                  agg:
                    type: boolean
                    description: Whether this fill was the aggressor (taker)
                    x-parser-schema-id: <anonymous-schema-477>
                x-parser-schema-id: <anonymous-schema-470>
            x-parser-schema-id: <anonymous-schema-442>
        title: Order Filled Event
        description: Order has been completely filled (t="f")
        example: |-
          {
            "t": "f",
            "ts": 1609459200,
            "tn": 123456789,
            "eid": "E-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "o": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "u": "01KB4E-MGKR-HXEG",
              "aid": "ACME-1",
              "po": false,
              "s": "XAU-PERP",
              "p": "50000.00",
              "q": 100,
              "xq": 100,
              "rq": 0,
              "o": "FILLED",
              "d": "B",
              "tif": "GTC",
              "ts": 1609459200,
              "tn": 0
            },
            "xs": {
              "tid": "T-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "aid": "ACME-1",
              "s": "XAU-PERP",
              "q": 100,
              "p": "50000.00",
              "d": "B",
              "agg": true
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderFilledEvent
    bindings: []
    extensions: *ref_1
sendOperations:
  - *ref_2
receiveOperations:
  - *ref_3
  - *ref_4
sendMessages:
  - *ref_5
  - *ref_6
  - *ref_7
  - *ref_8
  - *ref_9
  - *ref_10
  - *ref_11
  - *ref_12
receiveMessages:
  - *ref_13
  - *ref_14
  - *ref_15
  - *ref_16
  - *ref_17
  - *ref_18
  - *ref_19
  - *ref_20
  - *ref_21
  - *ref_22
  - *ref_23
  - *ref_24
  - *ref_25
  - *ref_26
  - *ref_27
  - *ref_28
  - *ref_29
  - *ref_30
extensions:
  - id: x-parser-unique-object-id
    value: orders
securitySchemes:
  - id: token
    name: token
    type: http
    description: >
      Bearer token authentication using a session token from `POST
      /api/authenticate`.


      To connect to the WebSocket, include the Authorization header:

      ```

      Authorization: Bearer <token>

      ```
    scheme: bearer
    extensions: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.