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

# Order update

> Perp and spot order update for a specific user. The nested order carries `asset_type`. Spot order rows use `time_in_force`, report `order_direction` as `Buy` or `Sell` (spot has no position to open or close, so perp's `Open Long` / `Close Short` vocabulary does not apply), and leave perp-only fields such as `client_order_id`, reduce-only, and TP/SL empty, false, or null.



## AsyncAPI

````yaml api-reference/asyncapi.json orderUpdate
id: orderUpdate
title: Order update
description: >-
  Perp and spot order update for a specific user. The nested order carries
  `asset_type`. Spot order rows use `time_in_force`, report `order_direction` as
  `Buy` or `Sell` (spot has no position to open or close, so perp's `Open Long`
  / `Close Short` vocabulary does not apply), and leave perp-only fields such as
  `client_order_id`, reduce-only, and TP/SL empty, false, or null.
servers:
  - id: testnet
    protocol: wss
    host: api.testnet.aptoslabs.com/decibel/ws
    bindings: []
    variables: []
address: order_updates:{userAddr}
parameters:
  - id: userAddr
    jsonSchema:
      type: string
      description: User wallet address (Aptos address format, e.g. 0x123...)
    description: User wallet address (Aptos address format, e.g. 0x123...)
    type: string
    required: true
    deprecated: false
bindings: []
operations:
  - &ref_8
    id: receiveorderUpdate
    title: Receiveorder update
    description: >-
      Receive updates for perp and spot order update for a specific user. the
      nested order carries `asset_type`. spot order rows use `time_in_force`,
      report `order_direction` as `buy` or `sell` (spot has no position to open
      or close, so perp's `open long` / `close short` vocabulary does not
      apply), and leave perp-only fields such as `client_order_id`, reduce-only,
      and tp/sl empty, false, or null.
    type: receive
    messages:
      - &ref_9
        id: OrderUpdateMessage
        payload:
          - name: OrderUpdateMessage
            description: >-
              Perp and spot order update for a specific user. The nested order
              carries `asset_type`. Spot order rows use `time_in_force`, report
              `order_direction` as `Buy` or `Sell` (spot has no position to open
              or close, so perp's `Open Long` / `Close Short` vocabulary does
              not apply), and leave perp-only fields such as `client_order_id`,
              reduce-only, and TP/SL empty, false, or null.
            type: object
            properties:
              - name: order
                type: object
                required: true
                properties:
                  - name: details
                    type: string
                    required: true
                  - name: order
                    type: object
                    required: true
                    properties:
                      - name: asset_type
                        type: string
                        description: >-
                          Discriminator carried on DTOs that can mix perp and
                          spot rows (markets,

                          orders, trades, bulk orders, bulk order fills, and
                          WebSocket payloads).

                          Also accepted as a query parameter on REST endpoints
                          that can filter to one

                          product.


                          Wire format is lowercase (`"perp"` / `"spot"`) and
                          accepted

                          case-insensitively on the request side via
                          [`impl_case_insensitive_deserialize`].
                        enumValues:
                          - perp
                          - spot
                        required: true
                      - name: cancellation_reason
                        type: string
                        required: true
                      - name: client_order_id
                        type: string
                        description: >-
                          Client-supplied order ID. Empty when the order was
                          placed without one

                          (both perp and spot carry this on the shared
                          `OrderEvent`).
                        required: true
                      - name: details
                        type: string
                        required: true
                      - name: is_buy
                        type: boolean
                        required: true
                      - name: is_reduce_only
                        type: boolean
                        description: Perp reduce-only flag. Always false for spot orders.
                        required: true
                      - name: is_tpsl
                        type: boolean
                        description: Perp TP/SL marker. Always false for spot orders.
                        required: true
                      - name: market
                        type: string
                        required: true
                      - name: order_direction
                        type: string
                        description: >-
                          Direction, in the vocabulary of this row's product.
                          Perp is

                          position-centric (`"Open Long"` / `"Close Long"` /
                          `"Open Short"` /

                          `"Close Short"`). Spot has no position to open or
                          close, so it is

                          simply `"Buy"` / `"Sell"`, the same values
                          `TradeDto::action` uses for

                          spot fills. Demux on `asset_type`.
                        required: true
                      - name: order_id
                        type: string
                        required: true
                      - name: order_type
                        type: string
                        description: >-
                          Perp order type. Empty for spot orders; use
                          `time_in_force` for spot.
                        required: true
                      - name: orig_size
                        type: &ref_0
                          - number
                          - 'null'
                        required: false
                      - name: parent
                        type: string
                        description: >-
                          Perp parent order ID. Empty for spot orders, which are
                          always top-level.
                        required: true
                      - name: price
                        type: &ref_1
                          - number
                          - 'null'
                        required: false
                      - name: remaining_size
                        type: &ref_2
                          - number
                          - 'null'
                        required: false
                      - name: size_delta
                        type: &ref_3
                          - number
                          - 'null'
                        required: false
                      - name: sl_limit_price
                        type: &ref_4
                          - number
                          - 'null'
                        description: Perp TP/SL field. Null for spot orders.
                        required: false
                      - name: sl_trigger_price
                        type: &ref_5
                          - number
                          - 'null'
                        description: Perp TP/SL field. Null for spot orders.
                        required: false
                      - name: status
                        type: string
                        required: true
                      - name: time_in_force
                        type: string
                        description: >-
                          Time-in-force tag for spot orders (`"GTC"` /
                          `"POST_ONLY"` / `"IOC"`).

                          Empty string for perp orders, which carry this signal
                          in `order_type`

                          instead. Surfaced separately because the spot engine
                          reports it as a

                          first-class field on every `OrderEvent`.
                        required: false
                      - name: tp_limit_price
                        type: &ref_6
                          - number
                          - 'null'
                        description: Perp TP/SL field. Null for spot orders.
                        required: false
                      - name: tp_trigger_price
                        type: &ref_7
                          - number
                          - 'null'
                        description: Perp TP/SL field. Null for spot orders.
                        required: false
                      - name: transaction_version
                        type: integer
                        required: true
                      - name: trigger_condition
                        type: string
                        description: Perp trigger condition. Empty for spot orders.
                        required: true
                      - name: unix_ms
                        type: integer
                        required: true
                  - name: status
                    type: string
                    required: true
              - name: topic
                type: string
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - topic
            - order
          properties:
            order:
              type: object
              required:
                - status
                - details
                - order
              properties:
                details:
                  type: string
                  x-parser-schema-id: <anonymous-schema-236>
                order:
                  type: object
                  required:
                    - asset_type
                    - parent
                    - market
                    - client_order_id
                    - order_id
                    - status
                    - order_type
                    - trigger_condition
                    - order_direction
                    - is_buy
                    - is_reduce_only
                    - details
                    - is_tpsl
                    - cancellation_reason
                    - transaction_version
                    - unix_ms
                  properties:
                    asset_type:
                      type: string
                      description: >-
                        Discriminator carried on DTOs that can mix perp and spot
                        rows (markets,

                        orders, trades, bulk orders, bulk order fills, and
                        WebSocket payloads).

                        Also accepted as a query parameter on REST endpoints
                        that can filter to one

                        product.


                        Wire format is lowercase (`"perp"` / `"spot"`) and
                        accepted

                        case-insensitively on the request side via
                        [`impl_case_insensitive_deserialize`].
                      enum:
                        - perp
                        - spot
                      x-parser-schema-id: AssetType
                    cancellation_reason:
                      type: string
                      x-parser-schema-id: <anonymous-schema-3>
                    client_order_id:
                      type: string
                      description: >-
                        Client-supplied order ID. Empty when the order was
                        placed without one

                        (both perp and spot carry this on the shared
                        `OrderEvent`).
                      x-parser-schema-id: <anonymous-schema-4>
                    details:
                      type: string
                      x-parser-schema-id: <anonymous-schema-5>
                    is_buy:
                      type: boolean
                      x-parser-schema-id: <anonymous-schema-6>
                    is_reduce_only:
                      type: boolean
                      description: Perp reduce-only flag. Always false for spot orders.
                      x-parser-schema-id: <anonymous-schema-7>
                    is_tpsl:
                      type: boolean
                      description: Perp TP/SL marker. Always false for spot orders.
                      x-parser-schema-id: <anonymous-schema-8>
                    market:
                      type: string
                      x-parser-schema-id: <anonymous-schema-9>
                    order_direction:
                      type: string
                      description: >-
                        Direction, in the vocabulary of this row's product. Perp
                        is

                        position-centric (`"Open Long"` / `"Close Long"` /
                        `"Open Short"` /

                        `"Close Short"`). Spot has no position to open or close,
                        so it is

                        simply `"Buy"` / `"Sell"`, the same values
                        `TradeDto::action` uses for

                        spot fills. Demux on `asset_type`.
                      x-parser-schema-id: <anonymous-schema-10>
                    order_id:
                      type: string
                      x-parser-schema-id: <anonymous-schema-11>
                    order_type:
                      type: string
                      description: >-
                        Perp order type. Empty for spot orders; use
                        `time_in_force` for spot.
                      x-parser-schema-id: <anonymous-schema-12>
                    orig_size:
                      type: *ref_0
                      format: double
                      x-parser-schema-id: <anonymous-schema-13>
                    parent:
                      type: string
                      description: >-
                        Perp parent order ID. Empty for spot orders, which are
                        always top-level.
                      x-parser-schema-id: <anonymous-schema-14>
                    price:
                      type: *ref_1
                      format: double
                      x-parser-schema-id: <anonymous-schema-15>
                    remaining_size:
                      type: *ref_2
                      format: double
                      x-parser-schema-id: <anonymous-schema-16>
                    size_delta:
                      type: *ref_3
                      format: double
                      x-parser-schema-id: <anonymous-schema-17>
                    sl_limit_price:
                      type: *ref_4
                      format: double
                      description: Perp TP/SL field. Null for spot orders.
                      x-parser-schema-id: <anonymous-schema-18>
                    sl_trigger_price:
                      type: *ref_5
                      format: double
                      description: Perp TP/SL field. Null for spot orders.
                      x-parser-schema-id: <anonymous-schema-19>
                    status:
                      type: string
                      x-parser-schema-id: <anonymous-schema-20>
                    time_in_force:
                      type: string
                      description: >-
                        Time-in-force tag for spot orders (`"GTC"` /
                        `"POST_ONLY"` / `"IOC"`).

                        Empty string for perp orders, which carry this signal in
                        `order_type`

                        instead. Surfaced separately because the spot engine
                        reports it as a

                        first-class field on every `OrderEvent`.
                      x-parser-schema-id: <anonymous-schema-21>
                    tp_limit_price:
                      type: *ref_6
                      format: double
                      description: Perp TP/SL field. Null for spot orders.
                      x-parser-schema-id: <anonymous-schema-22>
                    tp_trigger_price:
                      type: *ref_7
                      format: double
                      description: Perp TP/SL field. Null for spot orders.
                      x-parser-schema-id: <anonymous-schema-23>
                    transaction_version:
                      type: integer
                      format: int64
                      minimum: 0
                      x-parser-schema-id: <anonymous-schema-24>
                    trigger_condition:
                      type: string
                      description: Perp trigger condition. Empty for spot orders.
                      x-parser-schema-id: <anonymous-schema-25>
                    unix_ms:
                      type: integer
                      format: int64
                      minimum: 0
                      x-parser-schema-id: <anonymous-schema-26>
                  x-parser-schema-id: OrderDto
                status:
                  type: string
                  x-parser-schema-id: <anonymous-schema-237>
              x-parser-schema-id: OrderUpdate
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-238>
          x-parser-schema-id: OrderUpdateResponse
        title: Order update message
        description: >-
          Perp and spot order update for a specific user. The nested order
          carries `asset_type`. Spot order rows use `time_in_force`, report
          `order_direction` as `Buy` or `Sell` (spot has no position to open or
          close, so perp's `Open Long` / `Close Short` vocabulary does not
          apply), and leave perp-only fields such as `client_order_id`,
          reduce-only, and TP/SL empty, false, or null.
        example: |-
          {
            "topic": "order_updates:0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
            "order": {
              "status": "Filled",
              "details": "",
              "order": {
                "asset_type": "perp",
                "parent": "0x0000000000000000000000000000000000000000000000000000000000000000",
                "market": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
                "client_order_id": "historical_order_456",
                "order_id": "45679",
                "status": "Filled",
                "order_type": "Market",
                "trigger_condition": "None",
                "order_direction": "Close Short",
                "orig_size": 2,
                "remaining_size": 0,
                "size_delta": null,
                "price": 49500,
                "is_buy": false,
                "is_reduce_only": false,
                "details": "",
                "is_tpsl": false,
                "tp_trigger_price": null,
                "tp_limit_price": null,
                "sl_trigger_price": null,
                "sl_limit_price": null,
                "cancellation_reason": "",
                "transaction_version": 12345680,
                "unix_ms": 1699565000000,
                "time_in_force": ""
              }
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: OrderUpdateMessage
          - id: x-parser-message-name
            value: OrderUpdateMessage
    bindings: []
    extensions:
      - id: x-parser-unique-object-id
        value: orderUpdate
sendOperations:
  - *ref_8
receiveOperations: []
sendMessages:
  - *ref_9
receiveMessages: []
extensions:
  - id: x-parser-unique-object-id
    value: orderUpdate
securitySchemes: []

````