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

# Subaccount orders

> Channel name: `{subaccount_id}.orders`. Private channel (requires authentication) that streams live order updates (opens, fills, cancels, and status changes) for your subaccount, where {subaccount_id} is the numeric subaccount identifier.



## AsyncAPI

````yaml subscriptions.asyncapi.json subaccountOrders
id: subaccountOrders
title: Subaccount orders
description: >-
  Channel name: `{subaccount_id}.orders`. Private channel (requires
  authentication) that streams live order updates (opens, fills, cancels, and
  status changes) for your subaccount, where {subaccount_id} is the numeric
  subaccount identifier.
servers:
  - id: production
    protocol: wss
    host: api.derive.xyz
    bindings: []
    variables: []
  - id: testnet
    protocol: wss
    host: testnet.api.derive.xyz
    bindings: []
    variables: []
address: /v3/ws
parameters: []
bindings: []
operations:
  - &ref_14
    id: receive_subaccountOrders
    title: Receive_subaccount orders
    type: send
    messages:
      - &ref_17
        id: subaccountOrdersNotification
        payload:
          - name: subaccountOrdersNotification
            description: Pushed as a JSON array; each element has the fields below.
            type: object
            properties:
              - name: algo_duration_sec
                type: &ref_0
                  - integer
                  - 'null'
                required: false
              - name: algo_num_slices
                type: &ref_1
                  - integer
                  - 'null'
                required: false
              - name: algo_slices_completed
                type: &ref_2
                  - integer
                  - 'null'
                required: false
              - name: algo_type
                type: string
                required: false
              - name: amount
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: average_price
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: cancel_reason
                type: string
                enumValues:
                  - ''
                  - user_request
                  - mmp_trigger
                  - insufficient_margin
                  - signed_max_fee_too_low
                  - cancel_on_disconnect
                  - ioc_or_market_partial_fill
                  - session_key_deregistered
                  - subaccount_withdrawn
                  - compliance
                  - trigger_failed
                  - validation_failed
                  - algo_completed
                required: false
              - name: creation_timestamp
                type: integer
                required: true
              - name: direction
                type: string
                enumValues:
                  - buy
                  - sell
                required: true
              - name: extra_fee
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: filled_amount
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: instrument_name
                type: string
                required: true
              - name: is_transfer
                type: boolean
                required: true
              - name: label
                type: string
                required: false
              - name: last_update_timestamp
                type: integer
                required: true
              - name: limit_price
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: max_fee
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: mmp
                type: boolean
                required: true
              - name: nonce
                type: string
                required: true
              - name: order_fee
                type: string
                description: >-
                  Decimal string of the human value (e.g. `"1.5"`), up to 12
                  fractional digits; a string or JSON number is accepted
                required: true
              - name: order_id
                type: string
                required: true
              - name: order_status
                type: string
                enumValues:
                  - open
                  - filled
                  - rejected
                  - cancelled
                  - expired
                  - untriggered
                  - algo_active
                required: true
              - name: order_type
                type: string
                enumValues:
                  - limit
                  - market
                required: true
              - name: quote_id
                type: &ref_3
                  - string
                  - 'null'
                description: Optional UUID v4 string
                required: true
              - name: replaced_order_id
                type: &ref_4
                  - string
                  - 'null'
                description: Optional UUID v4 string
                required: true
              - name: signature
                type: string
                required: true
              - name: signature_expiry_sec
                type: integer
                required: true
              - name: signed_limit_price
                type: &ref_5
                  - string
                  - 'null'
                description: >-
                  Optional decimal string of the human value (e.g. `"1.5"`), up
                  to 12 fractional digits, or null; a string or JSON number is
                  accepted
                required: true
              - name: signer
                type: string
                required: true
              - name: subaccount_id
                type: integer
                required: true
              - name: time_in_force
                type: string
                enumValues:
                  - gtc
                  - post_only
                  - fok
                  - ioc
                required: true
              - name: trigger_price
                type: &ref_6
                  - string
                  - 'null'
                description: >-
                  Optional decimal string of the human value (e.g. `"1.5"`), up
                  to 12 fractional digits, or null; a string or JSON number is
                  accepted
                required: true
              - name: trigger_price_type
                type: string
                required: false
              - name: trigger_reject_message
                type: &ref_7
                  - string
                  - 'null'
                required: false
              - name: trigger_type
                type: string
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - amount
            - average_price
            - creation_timestamp
            - direction
            - extra_fee
            - filled_amount
            - instrument_name
            - is_transfer
            - last_update_timestamp
            - limit_price
            - max_fee
            - mmp
            - nonce
            - order_fee
            - order_id
            - order_status
            - order_type
            - quote_id
            - replaced_order_id
            - signature
            - signature_expiry_sec
            - signed_limit_price
            - signer
            - subaccount_id
            - time_in_force
            - trigger_price
          properties:
            algo_duration_sec:
              type: *ref_0
              format: int32
              x-parser-schema-id: <anonymous-schema-89>
            algo_num_slices:
              type: *ref_1
              format: int32
              x-parser-schema-id: <anonymous-schema-90>
            algo_slices_completed:
              type: *ref_2
              format: int32
              x-parser-schema-id: <anonymous-schema-91>
            algo_type:
              anyOf:
                - type: string
                  enum:
                    - twap
                  x-parser-schema-id: AlgoType
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-93>
              x-parser-schema-id: <anonymous-schema-92>
            amount:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-94>
            average_price:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-95>
            cancel_reason:
              type: string
              enum:
                - ''
                - user_request
                - mmp_trigger
                - insufficient_margin
                - signed_max_fee_too_low
                - cancel_on_disconnect
                - ioc_or_market_partial_fill
                - session_key_deregistered
                - subaccount_withdrawn
                - compliance
                - trigger_failed
                - validation_failed
                - algo_completed
              x-parser-schema-id: CancelReason
            creation_timestamp:
              type: integer
              format: int64
              x-parser-schema-id: <anonymous-schema-96>
            direction:
              type: string
              enum:
                - buy
                - sell
              x-parser-schema-id: Direction
            extra_fee:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-97>
            filled_amount:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-98>
            instrument_name:
              type: string
              x-parser-schema-id: <anonymous-schema-99>
            is_transfer:
              type: boolean
              x-parser-schema-id: <anonymous-schema-100>
            label:
              default: ''
              type: string
              x-parser-schema-id: <anonymous-schema-101>
            last_update_timestamp:
              type: integer
              format: int64
              x-parser-schema-id: <anonymous-schema-102>
            limit_price:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-103>
            max_fee:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-104>
            mmp:
              type: boolean
              x-parser-schema-id: <anonymous-schema-105>
            nonce:
              type: string
              x-parser-schema-id: <anonymous-schema-106>
            order_fee:
              description: >-
                Decimal string of the human value (e.g. `"1.5"`), up to 12
                fractional digits; a string or JSON number is accepted
              type: string
              format: decimal
              x-parser-schema-id: <anonymous-schema-107>
            order_id:
              type: string
              x-parser-schema-id: <anonymous-schema-108>
            order_status:
              type: string
              enum:
                - open
                - filled
                - rejected
                - cancelled
                - expired
                - untriggered
                - algo_active
              x-parser-schema-id: OrderStatus
            order_type:
              type: string
              enum:
                - limit
                - market
              x-parser-schema-id: OrderType
            quote_id:
              description: Optional UUID v4 string
              type: *ref_3
              format: uuid
              x-parser-schema-id: <anonymous-schema-109>
            replaced_order_id:
              description: Optional UUID v4 string
              type: *ref_4
              format: uuid
              x-parser-schema-id: <anonymous-schema-110>
            signature:
              type: string
              x-parser-schema-id: <anonymous-schema-111>
            signature_expiry_sec:
              type: integer
              format: int64
              x-parser-schema-id: <anonymous-schema-112>
            signed_limit_price:
              description: >-
                Optional decimal string of the human value (e.g. `"1.5"`), up to
                12 fractional digits, or null; a string or JSON number is
                accepted
              type: *ref_5
              format: decimal
              x-parser-schema-id: <anonymous-schema-113>
            signer:
              type: string
              x-parser-schema-id: <anonymous-schema-114>
            subaccount_id:
              type: integer
              format: int64
              x-parser-schema-id: <anonymous-schema-115>
            time_in_force:
              type: string
              enum:
                - gtc
                - post_only
                - fok
                - ioc
              x-parser-schema-id: TimeInForce
            trigger_price:
              description: >-
                Optional decimal string of the human value (e.g. `"1.5"`), up to
                12 fractional digits, or null; a string or JSON number is
                accepted
              type: *ref_6
              format: decimal
              x-parser-schema-id: <anonymous-schema-116>
            trigger_price_type:
              anyOf:
                - type: string
                  enum:
                    - mark
                    - index
                  x-parser-schema-id: TriggerPriceType
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-118>
              x-parser-schema-id: <anonymous-schema-117>
            trigger_reject_message:
              type: *ref_7
              x-parser-schema-id: <anonymous-schema-119>
            trigger_type:
              anyOf:
                - type: string
                  enum:
                    - stoploss
                    - takeprofit
                  x-parser-schema-id: TriggerType
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-121>
              x-parser-schema-id: <anonymous-schema-120>
          x-parser-schema-id: Order
        title: Subaccount orders notification
        description: Pushed as a JSON array; each element has the fields below.
        example: |-
          {
            "algo_type": "<string>",
            "amount": "<string>",
            "average_price": "<string>",
            "cancel_reason": "<string>",
            "creation_timestamp": 123,
            "direction": "<string>",
            "extra_fee": "<string>",
            "filled_amount": "<string>",
            "instrument_name": "<string>",
            "is_transfer": true,
            "label": "<string>",
            "last_update_timestamp": 123,
            "limit_price": "<string>",
            "max_fee": "<string>",
            "mmp": true,
            "nonce": "<string>",
            "order_fee": "<string>",
            "order_id": "<string>",
            "order_status": "<string>",
            "order_type": "<string>",
            "signature": "<string>",
            "signature_expiry_sec": 123,
            "signer": "<string>",
            "subaccount_id": 123,
            "time_in_force": "<string>",
            "trigger_price_type": "<string>",
            "trigger_type": "<string>"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subaccountOrdersNotification
    bindings: []
    extensions: &ref_12
      - id: x-parser-unique-object-id
        value: subaccountOrders
  - &ref_13
    id: send_subscribe_subaccountOrders
    title: Send_subscribe_subaccount orders
    type: receive
    messages:
      - &ref_15
        id: subscribeRequest
        payload:
          - name: subscribeRequest
            description: >-
              Send to subscribe: list this channel's address (with the {param}
              segments filled, e.g. orderbook.ETH-PERP.10.20) in
              params.channels.
            type: object
            properties:
              - name: headers
                type: &ref_8
                  - object
                  - 'null'
                description: Non-standard; used by `auth/login`.
                required: false
              - name: id
                type: anyOf
                required: true
              - name: method
                type: string
                description: subscribe
                required: true
              - name: params
                type: object
                description: >-
                  Params for `subscribe`. `channels` is the required list of
                  channel names to subscribe to.
                required: true
                properties:
                  - name: channels
                    type: array
                    required: true
                    properties:
                      - name: item
                        type: string
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - id
            - method
            - params
          properties:
            headers:
              description: Non-standard; used by `auth/login`.
              type: *ref_8
              additionalProperties: true
              x-parser-schema-id: <anonymous-schema-16>
            id: &ref_10
              anyOf:
                - type: string
                  x-parser-schema-id: <anonymous-schema-17>
                - type: number
                  x-parser-schema-id: <anonymous-schema-18>
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-19>
              x-parser-schema-id: JsonRpcId
            method:
              type: string
              const: subscribe
              x-parser-schema-id: <anonymous-schema-20>
            params:
              description: >-
                Params for `subscribe`. `channels` is the required list of
                channel names to subscribe to.
              type: object
              required:
                - channels
              properties:
                channels:
                  type: array
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-22>
                  x-parser-schema-id: <anonymous-schema-21>
              x-parser-schema-id: SubscribeParams
          x-parser-schema-id: <anonymous-schema-15>
        title: Subscribe request
        description: >-
          Send to subscribe: list this channel's address (with the {param}
          segments filled, e.g. orderbook.ETH-PERP.10.20) in params.channels.
        example: |-
          {
            "id": 1,
            "method": "subscribe",
            "params": {
              "channels": [
                "orderbook.ETH-PERP.10.20"
              ]
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribeRequest
      - &ref_16
        id: unsubscribeRequest
        payload:
          - name: unsubscribeRequest
            description: >-
              Send to unsubscribe: list the channel addresses to drop in
              params.channels, or omit it to unsubscribe from everything.
            type: object
            properties:
              - name: headers
                type: &ref_9
                  - object
                  - 'null'
                description: Non-standard; used by `auth/login`.
                required: false
              - name: id
                type: anyOf
                required: true
              - name: method
                type: string
                description: unsubscribe
                required: true
              - name: params
                type: object
                description: >-
                  Params for `unsubscribe`. `channels` is optional.


                  When omitted (or null) the connection unsubscribes from all
                  channels.
                required: true
                properties:
                  - name: channels
                    type: &ref_11
                      - array
                      - 'null'
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - id
            - method
            - params
          properties:
            headers:
              description: Non-standard; used by `auth/login`.
              type: *ref_9
              additionalProperties: true
              x-parser-schema-id: <anonymous-schema-24>
            id: *ref_10
            method:
              type: string
              const: unsubscribe
              x-parser-schema-id: <anonymous-schema-25>
            params:
              description: >-
                Params for `unsubscribe`. `channels` is optional.


                When omitted (or null) the connection unsubscribes from all
                channels.
              type: object
              properties:
                channels:
                  default: null
                  type: *ref_11
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-27>
                  x-parser-schema-id: <anonymous-schema-26>
              x-parser-schema-id: UnsubscribeParams
          x-parser-schema-id: <anonymous-schema-23>
        title: Unsubscribe request
        description: >-
          Send to unsubscribe: list the channel addresses to drop in
          params.channels, or omit it to unsubscribe from everything.
        example: |-
          {
            "method": "<string>",
            "params": {}
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: unsubscribeRequest
    bindings: []
    extensions: *ref_12
sendOperations:
  - *ref_13
receiveOperations:
  - *ref_14
sendMessages:
  - *ref_15
  - *ref_16
receiveMessages:
  - *ref_17
extensions:
  - id: x-parser-unique-object-id
    value: subaccountOrders
securitySchemes: []

````

## Related topics

- [List trigger orders for a subaccount](/api-reference/orderbook/list-trigger-orders-for-a-subaccount.md)
- [List open orders for a subaccount](/api-reference/orderbook/list-open-orders-for-a-subaccount.md)
- [Get historical orders for a subaccount](/api-reference/history/get-historical-orders-for-a-subaccount.md)
