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

# Orders

> > **Endpoint:** `wss://api.testnet.arcus.xyz/v1/ws` — one socket multiplexes every channel and RPC request. Click **Connect**, then send the example subscribe message below to start receiving data.

Open and recently closed order updates for an account. Snapshot on subscribe includes all open orders and up to 100 recently closed orders. Streaming updates use a unified shape for both status changes and fill events. Snapshot is sent once on connect only.

Subscribe to this channel alongside `userFills` to observe the full order lifecycle after placing an order via the `orderOperations` channel.




## AsyncAPI

````yaml api-reference/asyncapi.yaml orders
id: orders
title: Orders
description: >
  > **Endpoint:** `wss://api.testnet.arcus.xyz/v1/ws` — one socket multiplexes
  every channel and RPC request. Click **Connect**, then send the example
  subscribe message below to start receiving data.


  Open and recently closed order updates for an account. Snapshot on subscribe
  includes all open orders and up to 100 recently closed orders. Streaming
  updates use a unified shape for both status changes and fill events. Snapshot
  is sent once on connect only.


  Subscribe to this channel alongside `userFills` to observe the full order
  lifecycle after placing an order via the `orderOperations` channel.
servers:
  - id: testnet
    protocol: wss
    host: api.testnet.arcus.xyz
    bindings: []
    variables: []
  - id: mainnet
    protocol: wss
    host: api.arcus.xyz
    bindings: []
    variables: []
address: /v1/ws?channel=orders
parameters: []
bindings: []
operations:
  - &ref_2
    id: subscribeOrders
    title: Subscribe orders
    type: receive
    messages:
      - &ref_4
        id: subscribe
        contentType: application/json
        payload:
          - name: Subscribe to an account channel
            type: object
            properties:
              - name: type
                type: string
                description: subscribe
                required: true
              - name: channel
                type: string
                enumValues:
                  - account
                  - positions
                  - userFills
                  - orders
                  - funding
                  - accountAttributeUpdates
                required: true
              - name: id
                type: string
                description: Master Ethereum address (0x-prefixed) or core account id.
                required: true
              - name: snapshot
                type: boolean
                description: >-
                  When false, suppress the initial state snapshot on subscribe
                  and stream only live updates (e.g. userFills, orders).
                  Defaults to true.
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - channel
            - id
          properties:
            type:
              type: string
              const: subscribe
              x-parser-schema-id: <anonymous-schema-111>
            channel:
              type: string
              enum:
                - account
                - positions
                - userFills
                - orders
                - funding
                - accountAttributeUpdates
              x-parser-schema-id: <anonymous-schema-112>
            id:
              type: string
              description: Master Ethereum address (0x-prefixed) or core account id.
              example: 0xAbCd...1234
              x-parser-schema-id: <anonymous-schema-113>
            snapshot:
              type: boolean
              description: >-
                When false, suppress the initial state snapshot on subscribe and
                stream only live updates (e.g. userFills, orders). Defaults to
                true.
              default: true
              x-parser-schema-id: <anonymous-schema-114>
          x-parser-schema-id: SubscribeByAddressPayload
        title: Subscribe to an account channel
        example: |-
          {
            "type": "subscribe",
            "channel": "account",
            "id": "0xAbCd...1234"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
    bindings: []
    extensions: &ref_1
      - id: x-parser-unique-object-id
        value: orders
  - &ref_3
    id: receiveOrders
    title: Receive orders
    type: send
    messages:
      - &ref_5
        id: update
        contentType: application/json
        payload:
          - allOf: &ref_0
              - type: object
                description: Common envelope for all server-pushed channel messages.
                required:
                  - type
                  - channel
                properties:
                  type:
                    type: string
                    enum:
                      - subscribed
                      - channel_data
                    description: >-
                      `subscribed` for the initial snapshot; `channel_data` for
                      updates.
                    x-parser-schema-id: <anonymous-schema-5>
                  channel:
                    type: string
                    description: Channel name.
                    x-parser-schema-id: <anonymous-schema-6>
                  id:
                    type: string
                    description: >-
                      Channel id (market or address). Absent for global
                      channels.
                    x-parser-schema-id: <anonymous-schema-7>
                  contents:
                    type: object
                    additionalProperties: true
                    description: Channel-specific payload. Schema varies by channel.
                    properties: {}
                    x-parser-schema-id: <anonymous-schema-8>
                x-parser-schema-id: ChannelDataEnvelope
              - type: object
                properties:
                  contents:
                    type: object
                    properties:
                      orderId:
                        type: string
                        x-parser-schema-id: <anonymous-schema-117>
                      clientId:
                        type: string
                        x-parser-schema-id: <anonymous-schema-118>
                      marketId:
                        type: integer
                        minimum: 0
                        maximum: 65535
                        description: >-
                          Perpetual market identifier (uint16). Map to display
                          name via `GET /markets`.
                        x-parser-schema-id: <anonymous-schema-119>
                      marketDisplayName:
                        type: string
                        example: BTC-USD
                        x-parser-schema-id: <anonymous-schema-120>
                      side:
                        type: string
                        enum:
                          - BUY
                          - SELL
                        x-parser-schema-id: <anonymous-schema-121>
                      status:
                        type: string
                        enum:
                          - OPEN
                          - FILLED
                          - CANCELED
                          - MARGIN_CANCELED
                          - REJECTED
                          - TPSL_PLACED
                          - TPSL_CANCELED
                          - TPSL_TRIGGERED
                        x-parser-schema-id: <anonymous-schema-122>
                      price:
                        type: string
                        description: >-
                          Limit price. All TPSL lifecycle events (TPSL_PLACED,
                          TPSL_TRIGGERED, TPSL_CANCELED, trigger-time REJECTED)
                          carry the leg's limit price here; market-type TPSLs
                          placed without a price report "0" — use triggerPrice
                          for the trigger level.
                        example: '94000.00'
                        x-parser-schema-id: <anonymous-schema-123>
                      originalSize:
                        type: string
                        example: '1.0'
                        x-parser-schema-id: <anonymous-schema-124>
                      remainingSize:
                        type: string
                        description: '"0.0" means fully filled.'
                        example: '0.5'
                        x-parser-schema-id: <anonymous-schema-125>
                      avgFillPrice:
                        type: string
                        description: >
                          Cumulative average fill price across all fills of this
                          order. Present whenever the order has any filled
                          quantity; absent when nothing has filled. Matches the
                          REST / snapshot `avgFillPrice`.
                        example: '94000.00'
                        x-parser-schema-id: <anonymous-schema-126>
                      triggerPrice:
                        type: string
                        description: >-
                          Set for TP/SL orders only — on TP/SL events and on a
                          REJECTED event for a TP/SL order rejected at placement
                          or at trigger time (e.g. a triggered reduce-only TP/SL
                          whose position flipped, or a triggered FOK that cannot
                          fully fill). A TP/SL that converted to a regular order
                          and was rejected after conversion does not carry TP/SL
                          fields.
                        x-parser-schema-id: <anonymous-schema-127>
                      tpslType:
                        type: string
                        enum:
                          - TAKE_PROFIT
                          - STOP_LOSS
                        description: Set for TP/SL orders only.
                        x-parser-schema-id: <anonymous-schema-128>
                      rejectionReason:
                        type: string
                        description: Non-empty when status is REJECTED.
                        x-parser-schema-id: <anonymous-schema-129>
                      state:
                        type: string
                        enum:
                          - OPEN
                          - PARTIALLY_FILLED
                          - FILLED
                          - CANCELED
                          - REJECTED
                        description: >
                          Order lifecycle state after this event.
                          `PARTIALLY_FILLED` is terminal for IOC orders. Any
                          explicit cancel produces `CANCELED` even when prior
                          fills had already partially filled the order.
                        x-parser-schema-id: <anonymous-schema-130>
                      positionEffect:
                        type: string
                        enum:
                          - OPEN_LONG
                          - OPEN_SHORT
                          - ADD_LONG
                          - ADD_SHORT
                          - CLOSE_LONG
                          - CLOSE_SHORT
                          - FLIP_LONG_TO_SHORT
                          - FLIP_SHORT_TO_LONG
                        description: >
                          How this fill changed the account's position. Only set
                          on fill events; absent on placements/cancels/rejects.
                          `FLIP_*` covers a position that closed and reopened on
                          the opposite side within one user order.
                        x-parser-schema-id: <anonymous-schema-131>
                      createdAt:
                        type: integer
                        format: int64
                        description: >-
                          Order placement time (epoch microseconds); stable
                          across updates.
                        x-parser-schema-id: <anonymous-schema-132>
                      updatedAt:
                        type: integer
                        format: int64
                        description: Time of this update event (epoch microseconds).
                        x-parser-schema-id: <anonymous-schema-133>
                      sequenceNumber:
                        type: integer
                        x-parser-schema-id: <anonymous-schema-134>
                    x-parser-schema-id: <anonymous-schema-116>
                x-parser-schema-id: <anonymous-schema-115>
            x-parser-schema-id: OrderUpdatePayload
            name: Order Update
        headers: []
        jsonPayloadSchema:
          allOf: *ref_0
          x-parser-schema-id: OrderUpdatePayload
        title: Order Update
        example: |-
          {
            "type": "channel_data",
            "channel": "orders",
            "id": "0xAbCd...1234",
            "contents": {
              "orderId": "ord-abc123",
              "clientId": "42",
              "marketId": 1,
              "marketDisplayName": "BTC-USD",
              "side": "BUY",
              "status": "FILLED",
              "price": "94000.00",
              "originalSize": "1.0",
              "remainingSize": "0.0",
              "avgFillPrice": "94000.00",
              "state": "FILLED",
              "positionEffect": "OPEN_LONG",
              "sequenceNumber": 5001
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: update
    bindings: []
    extensions: *ref_1
sendOperations:
  - *ref_2
receiveOperations:
  - *ref_3
sendMessages:
  - *ref_4
receiveMessages:
  - *ref_5
extensions:
  - id: x-parser-unique-object-id
    value: orders
securitySchemes: []

````