> ## Documentation Index
> Fetch the complete documentation index at: https://docs.architect.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.architect.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.

<CodeGroup>
  ```bash wscat theme={null}
  # Store the token
  TOKEN=$(curl -s -X POST https://gateway.sandbox.architect.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.architect.exchange/orders/ws \
    -H "Authorization: Bearer $TOKEN"
  ```

  ```bash websocat theme={null}
  # Store the token
  TOKEN=$(curl -s -X POST https://gateway.sandbox.architect.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.architect.exchange/orders/ws
  ```
</CodeGroup>

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

### 3. Login response

On successful connection, the server sends a login response with `rid: 0` containing your open orders:

```json theme={null}
{"rid":0,"res":{"li":"user@example.com","o":[]},"err":null}
```

### 4. Place an order

```json theme={null}
{"rid":1,"t":"p","s":"XAU-PERP","d":"B","q":100,"p":"50000.50","tif":"GTC","po":false}
```

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.architect.exchange/orders/ws?cancel_on_disconnect=true'
);
```

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

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

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](/api-reference/marketdata/md-ws).


## AsyncAPI

````yaml openapi/asyncapi-order-gateway.bundled.json orders
id: orders
title: Orders
description: ''
servers:
  - id: production
    protocol: wss
    host: gateway.sandbox.architect.exchange
    bindings: []
    variables: []
address: /orders/ws
parameters: []
bindings: []
operations:
  - &ref_1
    id: clientRequest
    title: Client request
    type: receive
    messages:
      - &ref_4
        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)
                required: true
              - 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: 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 also accepted for
                  `CancelIncoming`,

                  `CancelResting`, and `CancelBoth`, respectively.


                  - `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
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
              - t
              - s
              - d
              - q
              - p
              - tif
              - po
            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)
                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>
              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-12>
              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 also accepted for
                  `CancelIncoming`,

                  `CancelResting`, and `CancelBoth`, respectively.


                  - `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-13>
            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_5
        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
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
              - t
            properties:
              rid:
                type: integer
                description: Request ID for correlating response
                x-parser-schema-id: <anonymous-schema-15>
              t:
                type: string
                const: x
                description: Message type (cancel order)
                x-parser-schema-id: <anonymous-schema-16>
              oid:
                type: string
                description: Order ID to cancel. Mutually exclusive with cid.
                x-parser-schema-id: <anonymous-schema-17>
              cid:
                type: integer
                format: uint64
                description: Client order ID to cancel. Mutually exclusive with oid.
                x-parser-schema-id: <anonymous-schema-18>
            x-parser-schema-id: <anonymous-schema-14>
        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_6
        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
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
              - t
            properties:
              rid:
                type: integer
                description: Request ID for correlating response
                x-parser-schema-id: <anonymous-schema-20>
              t:
                type: string
                const: X
                description: Message type (cancel all orders)
                x-parser-schema-id: <anonymous-schema-21>
              symbol:
                type: string
                description: >-
                  Optional symbol filter. If provided, only orders for this
                  symbol will be canceled.
                x-parser-schema-id: <anonymous-schema-22>
            x-parser-schema-id: <anonymous-schema-19>
        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_7
        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
        headers: []
        jsonPayloadSchema:
          schema:
            type: object
            required:
              - rid
              - t
            properties:
              rid:
                type: integer
                description: Request ID for correlating response
                x-parser-schema-id: <anonymous-schema-24>
              t:
                type: string
                const: r
                description: Message type (replace order)
                x-parser-schema-id: <anonymous-schema-25>
              oid:
                type: string
                description: Order ID to replace. Mutually exclusive with cid.
                x-parser-schema-id: <anonymous-schema-26>
              cid:
                type: integer
                format: uint64
                description: >-
                  Client order ID of the order to replace. Mutually exclusive
                  with oid.
                x-parser-schema-id: <anonymous-schema-27>
              q:
                type: integer
                format: uint64
                description: >-
                  Order quantity in contracts (optional, inherits from original
                  order if not provided)
                x-parser-schema-id: <anonymous-schema-28>
              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-29>
              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-30>
              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-31>
            x-parser-schema-id: <anonymous-schema-23>
        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_8
        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-40>
              t:
                type: string
                const: o
                description: Message type (get open orders)
                x-parser-schema-id: <anonymous-schema-41>
            x-parser-schema-id: <anonymous-schema-39>
        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_9
        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-43>
              t:
                type: string
                const: ef
                description: Message type (get estimated funding rate)
                x-parser-schema-id: <anonymous-schema-44>
              symbol:
                type: string
                description: Instrument symbol to query, e.g. WTI-PERP
                x-parser-schema-id: <anonymous-schema-45>
            x-parser-schema-id: <anonymous-schema-42>
        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
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: orders
  - &ref_2
    id: serverResponse
    title: Server response
    type: send
    messages:
      - &ref_10
        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: Logged in user identifier
                    required: true
                  - name: o
                    type: array
                    description: Open orders at login time
                    required: false
                    properties:
                      - name: oid
                        type: string
                        description: Order ID
                        required: true
                      - name: u
                        type: string
                        description: User ID
                        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: tag
                        type: string
                        description: Optional order tag (max 10 alphanumeric characters)
                        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
                          - UNKNOWN
                        required: false
                      - name: txt
                        type: string
                        description: Optional reject message
                        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: cod
                    type: boolean
                    description: Whether cancel-on-disconnect is active for this session
                    required: false
              - name: err
                type: 'null'
                description: Error (null for successful login)
                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-47>
              res:
                type: object
                required:
                  - li
                properties:
                  li:
                    type: string
                    description: Logged in user identifier
                    x-parser-schema-id: <anonymous-schema-49>
                  o:
                    type: array
                    description: Open orders at login time
                    items:
                      type: object
                      description: Order details
                      required:
                        - oid
                        - u
                        - s
                        - p
                        - q
                        - xq
                        - rq
                        - o
                        - d
                        - tif
                        - ts
                        - tn
                      properties:
                        oid:
                          type: string
                          description: Order ID
                          x-parser-schema-id: <anonymous-schema-52>
                        u:
                          type: string
                          format: uuid
                          description: User ID
                          x-parser-schema-id: <anonymous-schema-53>
                        s:
                          type: string
                          description: Symbol (e.g. XAU-PERP)
                          x-parser-schema-id: <anonymous-schema-54>
                        p:
                          type: string
                          pattern: ^-?\d+(\.\d+)?$
                          description: Order price as decimal string
                          x-parser-schema-id: <anonymous-schema-55>
                        q:
                          type: integer
                          format: uint64
                          description: Order quantity in contracts
                          x-parser-schema-id: <anonymous-schema-56>
                        xq:
                          type: integer
                          format: uint64
                          description: Filled quantity
                          x-parser-schema-id: <anonymous-schema-57>
                        rq:
                          type: integer
                          format: uint64
                          description: Remaining quantity
                          x-parser-schema-id: <anonymous-schema-58>
                        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-59>
                        d:
                          type: string
                          enum:
                            - B
                            - S
                          description: Side (B=Buy, S=Sell)
                          x-parser-schema-id: <anonymous-schema-60>
                        tif:
                          type: string
                          description: Time in force (e.g. GTC, IOC, DAY)
                          x-parser-schema-id: <anonymous-schema-61>
                        tag:
                          type: string
                          description: Optional order tag (max 10 alphanumeric characters)
                          x-parser-schema-id: <anonymous-schema-62>
                        cid:
                          type: integer
                          format: uint64
                          description: Optional client order ID
                          x-parser-schema-id: <anonymous-schema-63>
                        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
                            - UNKNOWN
                          description: Reason for order rejection
                          x-parser-schema-id: <anonymous-schema-64>
                        txt:
                          type: string
                          description: Optional reject message
                          x-parser-schema-id: <anonymous-schema-65>
                        ts:
                          type: integer
                          format: int32
                          description: Order timestamp seconds since epoch
                          x-parser-schema-id: <anonymous-schema-66>
                        tn:
                          type: integer
                          format: uint32
                          minimum: 0
                          description: Order timestamp nanoseconds
                          x-parser-schema-id: <anonymous-schema-67>
                      x-parser-schema-id: <anonymous-schema-51>
                    x-parser-schema-id: <anonymous-schema-50>
                  cod:
                    type: boolean
                    description: Whether cancel-on-disconnect is active for this session
                    x-parser-schema-id: <anonymous-schema-68>
                x-parser-schema-id: <anonymous-schema-48>
              err:
                type: 'null'
                description: Error (null for successful login)
                x-parser-schema-id: <anonymous-schema-69>
            x-parser-schema-id: <anonymous-schema-46>
        title: Login Response
        description: Initial response upon WebSocket connection (rid=0)
        example: |-
          {
            "rid": 0,
            "res": {
              "li": "user@example.com",
              "o": [
                {
                  "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
                  "u": "550e8400-e29b-41d4-a716-446655440000",
                  "s": "XAU-PERP",
                  "p": "50000.00",
                  "q": 100,
                  "xq": 0,
                  "rq": 100,
                  "o": "ACCEPTED",
                  "d": "B",
                  "tif": "GTC",
                  "ts": 1609459200,
                  "tn": 0
                }
              ],
              "cod": false
            },
            "err": null
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: loginResponse
      - &ref_11
        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-71>
              res:
                type: object
                required:
                  - oid
                properties:
                  oid:
                    type: string
                    description: Order ID of the placed order
                    x-parser-schema-id: <anonymous-schema-73>
                x-parser-schema-id: <anonymous-schema-72>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-75>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-76>
                x-parser-schema-id: <anonymous-schema-74>
            x-parser-schema-id: <anonymous-schema-70>
        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_12
        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-78>
              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-80>
                x-parser-schema-id: <anonymous-schema-79>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-82>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-83>
                x-parser-schema-id: <anonymous-schema-81>
            x-parser-schema-id: <anonymous-schema-77>
        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_13
        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-85>
              res:
                type: object
                required:
                  - oid
                properties:
                  oid:
                    type: string
                    description: Order ID of the new replacement order
                    x-parser-schema-id: <anonymous-schema-87>
                x-parser-schema-id: <anonymous-schema-86>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-89>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-90>
                x-parser-schema-id: <anonymous-schema-88>
            x-parser-schema-id: <anonymous-schema-84>
        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_14
        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-92>
              res:
                type: object
                description: Empty object on success
                x-parser-schema-id: <anonymous-schema-93>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-95>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-96>
                x-parser-schema-id: <anonymous-schema-94>
            x-parser-schema-id: <anonymous-schema-91>
        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_15
        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: User ID
                        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: tag
                        type: string
                        description: Optional order tag (max 10 alphanumeric characters)
                        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
                          - UNKNOWN
                        required: false
                      - name: txt
                        type: string
                        description: Optional reject message
                        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-113>
              res:
                type: object
                required:
                  - orders
                properties:
                  orders:
                    type: array
                    description: List of open orders
                    items:
                      type: object
                      description: Order details
                      required:
                        - oid
                        - u
                        - s
                        - p
                        - q
                        - xq
                        - rq
                        - o
                        - d
                        - tif
                        - ts
                        - tn
                      properties:
                        oid:
                          type: string
                          description: Order ID
                          x-parser-schema-id: <anonymous-schema-117>
                        u:
                          type: string
                          format: uuid
                          description: User ID
                          x-parser-schema-id: <anonymous-schema-118>
                        s:
                          type: string
                          description: Symbol (e.g. XAU-PERP)
                          x-parser-schema-id: <anonymous-schema-119>
                        p:
                          type: string
                          pattern: ^-?\d+(\.\d+)?$
                          description: Order price as decimal string
                          x-parser-schema-id: <anonymous-schema-120>
                        q:
                          type: integer
                          format: uint64
                          description: Order quantity in contracts
                          x-parser-schema-id: <anonymous-schema-121>
                        xq:
                          type: integer
                          format: uint64
                          description: Filled quantity
                          x-parser-schema-id: <anonymous-schema-122>
                        rq:
                          type: integer
                          format: uint64
                          description: Remaining quantity
                          x-parser-schema-id: <anonymous-schema-123>
                        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-124>
                        d:
                          type: string
                          enum:
                            - B
                            - S
                          description: Side (B=Buy, S=Sell)
                          x-parser-schema-id: <anonymous-schema-125>
                        tif:
                          type: string
                          description: Time in force (e.g. GTC, IOC, DAY)
                          x-parser-schema-id: <anonymous-schema-126>
                        tag:
                          type: string
                          description: Optional order tag (max 10 alphanumeric characters)
                          x-parser-schema-id: <anonymous-schema-127>
                        cid:
                          type: integer
                          format: uint64
                          description: Optional client order ID
                          x-parser-schema-id: <anonymous-schema-128>
                        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
                            - UNKNOWN
                          description: Reason for order rejection
                          x-parser-schema-id: <anonymous-schema-129>
                        txt:
                          type: string
                          description: Optional reject message
                          x-parser-schema-id: <anonymous-schema-130>
                        ts:
                          type: integer
                          format: int32
                          description: Order timestamp seconds since epoch
                          x-parser-schema-id: <anonymous-schema-131>
                        tn:
                          type: integer
                          format: uint32
                          minimum: 0
                          description: Order timestamp nanoseconds
                          x-parser-schema-id: <anonymous-schema-132>
                      x-parser-schema-id: <anonymous-schema-116>
                    x-parser-schema-id: <anonymous-schema-115>
                x-parser-schema-id: <anonymous-schema-114>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-134>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-135>
                x-parser-schema-id: <anonymous-schema-133>
            x-parser-schema-id: <anonymous-schema-112>
        title: Get Open Orders Response
        description: Response to get open orders request
        example: |-
          {
            "rid": 3,
            "res": {
              "orders": [
                {
                  "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
                  "u": "550e8400-e29b-41d4-a716-446655440000",
                  "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": "550e8400-e29b-41d4-a716-446655440000",
                  "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_16
        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-137>
              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-139>
                  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-140>
                  reason:
                    type: string
                    description: >-
                      Human-readable explanation, present when no estimate is
                      available
                    x-parser-schema-id: <anonymous-schema-141>
                  funding_rate:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Estimated funding rate
                    x-parser-schema-id: <anonymous-schema-142>
                  funding_amount:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Estimated funding amount per contract in USD
                    x-parser-schema-id: <anonymous-schema-143>
                  benchmark_price:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Benchmark (index) price used for the estimate in USD
                    x-parser-schema-id: <anonymous-schema-144>
                  settlement_price:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Settlement (mark) price used for the estimate in USD
                    x-parser-schema-id: <anonymous-schema-145>
                  timestamp:
                    type: string
                    format: date-time
                    description: Time the estimate was computed (RFC 3339)
                    x-parser-schema-id: <anonymous-schema-146>
                x-parser-schema-id: <anonymous-schema-138>
              err:
                type: object
                description: Error information if request failed
                properties:
                  code:
                    type: integer
                    description: Error code
                    x-parser-schema-id: <anonymous-schema-148>
                  msg:
                    type: string
                    description: Error message
                    x-parser-schema-id: <anonymous-schema-149>
                x-parser-schema-id: <anonymous-schema-147>
            x-parser-schema-id: <anonymous-schema-136>
        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_0
  - &ref_3
    id: serverEvent
    title: Server event
    type: send
    messages:
      - &ref_17
        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-151>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-152>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-153>
            x-parser-schema-id: <anonymous-schema-150>
        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_18
        id: cancelRejectedEvent
        contentType: application/json
        payload:
          - name: Cancel Rejected Event
            description: Order cancel request was rejected (t="e")
            type: object
            properties:
              - name: t
                type: string
                description: Message type (cancel 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 cancel's target order
                  (present when the original order carried a cid).
                required: false
              - name: r
                type: string
                description: Reject reason
                required: true
              - name: txt
                type: string
                description: Reject message
                required: true
              - name: o
                type: object
                description: Order details
                required: false
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: User ID
                    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: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    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
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    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 rejected)
                x-parser-schema-id: <anonymous-schema-155>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-156>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-157>
              oid:
                type: string
                description: Order ID
                x-parser-schema-id: <anonymous-schema-158>
              cid:
                type: integer
                format: uint64
                description: >-
                  Optional client order ID of the rejected cancel's target order
                  (present when the original order carried a cid).
                x-parser-schema-id: <anonymous-schema-159>
              r:
                type: string
                description: Reject reason
                x-parser-schema-id: <anonymous-schema-160>
              txt:
                type: string
                description: Reject message
                x-parser-schema-id: <anonymous-schema-161>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-163>
                  u:
                    type: string
                    format: uuid
                    description: User ID
                    x-parser-schema-id: <anonymous-schema-164>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-165>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-166>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-167>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-168>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-169>
                  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-170>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-171>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-172>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-173>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-174>
                  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
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-175>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-176>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-177>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-178>
                x-parser-schema-id: <anonymous-schema-162>
            x-parser-schema-id: <anonymous-schema-154>
        title: Cancel Rejected Event
        description: Order cancel request was rejected (t="e")
        example: |-
          {
            "t": "e",
            "ts": 1609459200,
            "tn": 123456789,
            "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "cid": 12345,
            "r": "ORDER_NOT_FOUND",
            "txt": "Order not found or already canceled",
            "o": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "u": "550e8400-e29b-41d4-a716-446655440000",
              "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_19
        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: User ID
                    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: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    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
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    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-180>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-181>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-182>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-183>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-185>
                  u:
                    type: string
                    format: uuid
                    description: User ID
                    x-parser-schema-id: <anonymous-schema-186>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-187>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-188>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-189>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-190>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-191>
                  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-192>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-193>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-194>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-195>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-196>
                  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
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-197>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-198>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-199>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-200>
                x-parser-schema-id: <anonymous-schema-184>
            x-parser-schema-id: <anonymous-schema-179>
        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": "550e8400-e29b-41d4-a716-446655440000",
              "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_20
        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: User ID
                    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: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    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
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    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
                required: true
              - name: txt
                type: string
                description: Cancel message
                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-202>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-203>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-204>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-205>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-207>
                  u:
                    type: string
                    format: uuid
                    description: User ID
                    x-parser-schema-id: <anonymous-schema-208>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-209>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-210>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-211>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-212>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-213>
                  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-214>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-215>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-216>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-217>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-218>
                  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
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-219>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-220>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-221>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-222>
                x-parser-schema-id: <anonymous-schema-206>
              xr:
                type: string
                description: Cancel reason
                x-parser-schema-id: <anonymous-schema-223>
              txt:
                type: string
                description: Cancel message
                x-parser-schema-id: <anonymous-schema-224>
            x-parser-schema-id: <anonymous-schema-201>
        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": "550e8400-e29b-41d4-a716-446655440000",
              "s": "XAU-PERP",
              "p": "50000.00",
              "q": 100,
              "xq": 0,
              "rq": 100,
              "o": "CANCELED",
              "d": "B",
              "tif": "GTC",
              "ts": 1609459200,
              "tn": 0
            },
            "xr": "USER_REQUESTED",
            "txt": "Canceled by user"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderCanceledEvent
      - &ref_21
        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 order that replaced the original order
                required: true
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: User ID
                    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: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    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
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    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
                required: true
              - name: ro
                type: object
                description: The original order that was replaced
                required: true
                properties:
                  - name: oid
                    type: string
                    description: Order ID
                    required: true
                  - name: u
                    type: string
                    description: User ID
                    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: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    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
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    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
              - 'no'
              - noid
            properties:
              t:
                type: string
                const: r
                description: Message type (order replaced/amended)
                x-parser-schema-id: <anonymous-schema-226>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-227>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-228>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-229>
              'no':
                type: object
                description: The new order that replaced the original order
                required:
                  - oid
                  - u
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-231>
                  u:
                    type: string
                    format: uuid
                    description: User ID
                    x-parser-schema-id: <anonymous-schema-232>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-233>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-234>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-235>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-236>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-237>
                  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-238>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-239>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-240>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-241>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-242>
                  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
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-243>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-244>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-245>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-246>
                x-parser-schema-id: <anonymous-schema-230>
              noid:
                type: string
                description: The order ID of the new replacement order
                x-parser-schema-id: <anonymous-schema-247>
              ro:
                type: object
                description: The original order that was replaced
                required:
                  - oid
                  - u
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-249>
                  u:
                    type: string
                    format: uuid
                    description: User ID
                    x-parser-schema-id: <anonymous-schema-250>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-251>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-252>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-253>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-254>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-255>
                  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-256>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-257>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-258>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-259>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-260>
                  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
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-261>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-262>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-263>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-264>
                x-parser-schema-id: <anonymous-schema-248>
            x-parser-schema-id: <anonymous-schema-225>
        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": "550e8400-e29b-41d4-a716-446655440000",
              "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": "550e8400-e29b-41d4-a716-446655440000",
              "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_22
        id: orderRejectedEvent
        contentType: application/json
        payload:
          - name: Order Rejected Event
            description: 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: User ID
                    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: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    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
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    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
                  - 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-266>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-267>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-268>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-269>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-271>
                  u:
                    type: string
                    format: uuid
                    description: User ID
                    x-parser-schema-id: <anonymous-schema-272>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-273>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-274>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-275>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-276>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-277>
                  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-278>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-279>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-280>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-281>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-282>
                  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
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-283>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-284>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-285>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-286>
                x-parser-schema-id: <anonymous-schema-270>
              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
                  - UNKNOWN
                description: Reason for order rejection
                x-parser-schema-id: <anonymous-schema-287>
              txt:
                type: string
                description: Reject message
                x-parser-schema-id: <anonymous-schema-288>
            x-parser-schema-id: <anonymous-schema-265>
        title: Order Rejected Event
        description: Order has been rejected (t="j")
        example: |-
          {
            "t": "j",
            "ts": 1609459200,
            "tn": 123456789,
            "eid": "E-01ARZ3NDEKTSV4RRFFQ69G5FAV",
            "o": {
              "oid": "O-01ARZ3NDEKTSV4RRFFQ69G5FAV",
              "u": "550e8400-e29b-41d4-a716-446655440000",
              "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_23
        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: User ID
                    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: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    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
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    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-290>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-291>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-292>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-293>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-295>
                  u:
                    type: string
                    format: uuid
                    description: User ID
                    x-parser-schema-id: <anonymous-schema-296>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-297>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-298>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-299>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-300>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-301>
                  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-302>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-303>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-304>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-305>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-306>
                  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
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-307>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-308>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-309>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-310>
                x-parser-schema-id: <anonymous-schema-294>
            x-parser-schema-id: <anonymous-schema-289>
        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": "550e8400-e29b-41d4-a716-446655440000",
              "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_24
        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: User ID
                    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: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    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
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    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-312>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-313>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-314>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-315>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-317>
                  u:
                    type: string
                    format: uuid
                    description: User ID
                    x-parser-schema-id: <anonymous-schema-318>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-319>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-320>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-321>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-322>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-323>
                  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-324>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-325>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-326>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-327>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-328>
                  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
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-329>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-330>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-331>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-332>
                x-parser-schema-id: <anonymous-schema-316>
            x-parser-schema-id: <anonymous-schema-311>
        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": "550e8400-e29b-41d4-a716-446655440000",
              "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_25
        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: User ID
                    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: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    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
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    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: 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-334>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-335>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-336>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-337>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-339>
                  u:
                    type: string
                    format: uuid
                    description: User ID
                    x-parser-schema-id: <anonymous-schema-340>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-341>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-342>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-343>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-344>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-345>
                  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-346>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-347>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-348>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-349>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-350>
                  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
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-351>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-352>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-353>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-354>
                x-parser-schema-id: <anonymous-schema-338>
              xs:
                type: object
                description: Fill details
                required:
                  - tid
                  - s
                  - q
                  - p
                  - d
                  - agg
                properties:
                  tid:
                    type: string
                    description: Trade ID
                    x-parser-schema-id: <anonymous-schema-356>
                  s:
                    type: string
                    description: Symbol
                    x-parser-schema-id: <anonymous-schema-357>
                  q:
                    type: integer
                    format: uint64
                    description: Fill quantity in contracts
                    x-parser-schema-id: <anonymous-schema-358>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Fill price as decimal string
                    x-parser-schema-id: <anonymous-schema-359>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-360>
                  agg:
                    type: boolean
                    description: Whether this fill was the aggressor (taker)
                    x-parser-schema-id: <anonymous-schema-361>
                x-parser-schema-id: <anonymous-schema-355>
            x-parser-schema-id: <anonymous-schema-333>
        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": "550e8400-e29b-41d4-a716-446655440000",
              "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",
              "s": "XAU-PERP",
              "q": 50,
              "p": "50000.00",
              "d": "B",
              "agg": false
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderPartiallyFilledEvent
      - &ref_26
        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: User ID
                    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: tag
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    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
                      - UNKNOWN
                    required: false
                  - name: txt
                    type: string
                    description: Optional reject message
                    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: 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-363>
              ts:
                type: integer
                format: int32
                description: Timestamp seconds since epoch
                x-parser-schema-id: <anonymous-schema-364>
              tn:
                type: integer
                format: uint32
                minimum: 0
                description: Timestamp nanoseconds
                x-parser-schema-id: <anonymous-schema-365>
              eid:
                type: string
                description: Execution ID
                x-parser-schema-id: <anonymous-schema-366>
              o:
                type: object
                description: Order details
                required:
                  - oid
                  - u
                  - s
                  - p
                  - q
                  - xq
                  - rq
                  - o
                  - d
                  - tif
                  - ts
                  - tn
                properties:
                  oid:
                    type: string
                    description: Order ID
                    x-parser-schema-id: <anonymous-schema-368>
                  u:
                    type: string
                    format: uuid
                    description: User ID
                    x-parser-schema-id: <anonymous-schema-369>
                  s:
                    type: string
                    description: Symbol (e.g. XAU-PERP)
                    x-parser-schema-id: <anonymous-schema-370>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Order price as decimal string
                    x-parser-schema-id: <anonymous-schema-371>
                  q:
                    type: integer
                    format: uint64
                    description: Order quantity in contracts
                    x-parser-schema-id: <anonymous-schema-372>
                  xq:
                    type: integer
                    format: uint64
                    description: Filled quantity
                    x-parser-schema-id: <anonymous-schema-373>
                  rq:
                    type: integer
                    format: uint64
                    description: Remaining quantity
                    x-parser-schema-id: <anonymous-schema-374>
                  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-375>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-376>
                  tif:
                    type: string
                    description: Time in force (e.g. GTC, IOC, DAY)
                    x-parser-schema-id: <anonymous-schema-377>
                  tag:
                    type: string
                    description: Optional order tag (max 10 alphanumeric characters)
                    x-parser-schema-id: <anonymous-schema-378>
                  cid:
                    type: integer
                    format: uint64
                    description: Optional client order ID
                    x-parser-schema-id: <anonymous-schema-379>
                  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
                      - UNKNOWN
                    description: Reason for order rejection
                    x-parser-schema-id: <anonymous-schema-380>
                  txt:
                    type: string
                    description: Optional reject message
                    x-parser-schema-id: <anonymous-schema-381>
                  ts:
                    type: integer
                    format: int32
                    description: Order timestamp seconds since epoch
                    x-parser-schema-id: <anonymous-schema-382>
                  tn:
                    type: integer
                    format: uint32
                    minimum: 0
                    description: Order timestamp nanoseconds
                    x-parser-schema-id: <anonymous-schema-383>
                x-parser-schema-id: <anonymous-schema-367>
              xs:
                type: object
                description: Fill details
                required:
                  - tid
                  - s
                  - q
                  - p
                  - d
                  - agg
                properties:
                  tid:
                    type: string
                    description: Trade ID
                    x-parser-schema-id: <anonymous-schema-385>
                  s:
                    type: string
                    description: Symbol
                    x-parser-schema-id: <anonymous-schema-386>
                  q:
                    type: integer
                    format: uint64
                    description: Fill quantity in contracts
                    x-parser-schema-id: <anonymous-schema-387>
                  p:
                    type: string
                    pattern: ^-?\d+(\.\d+)?$
                    description: Fill price as decimal string
                    x-parser-schema-id: <anonymous-schema-388>
                  d:
                    type: string
                    enum:
                      - B
                      - S
                    description: Side (B=Buy, S=Sell)
                    x-parser-schema-id: <anonymous-schema-389>
                  agg:
                    type: boolean
                    description: Whether this fill was the aggressor (taker)
                    x-parser-schema-id: <anonymous-schema-390>
                x-parser-schema-id: <anonymous-schema-384>
            x-parser-schema-id: <anonymous-schema-362>
        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": "550e8400-e29b-41d4-a716-446655440000",
              "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",
              "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_0
sendOperations:
  - *ref_1
receiveOperations:
  - *ref_2
  - *ref_3
sendMessages:
  - *ref_4
  - *ref_5
  - *ref_6
  - *ref_7
  - *ref_8
  - *ref_9
receiveMessages:
  - *ref_10
  - *ref_11
  - *ref_12
  - *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
extensions:
  - id: x-parser-unique-object-id
    value: orders
securitySchemes:
  - id: token
    name: token
    type: http
    description: >
      Bearer token authentication using user/session tokens from
      `/api/get_user_token`.


      To connect to the WebSocket, include the Authorization header:

      ```

      Authorization: Bearer <token>

      ```
    scheme: bearer
    extensions: []

````