> ## 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.

# Positions

> > **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 positions for a single sub-account. Snapshot on subscribe uses the same schema as REST `GET /positions`. Updates carry one `PositionUpdate` event per frame.

`cumulativeFunding` is absent from streaming events — use the snapshot for funding horizons. On close (size drops to 0), the row is emitted in `FLAT` form with zeroed financials.

`leverage` reflects the user's per-(account, market) override (set via REST `POST /v1/setLeverage`) when present, otherwise the market default. A `PositionUpdate` is also emitted when the user adjusts leverage on a market they already hold a position in.




## AsyncAPI

````yaml api-reference/asyncapi.yaml positions
id: positions
title: Positions
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 positions for a single sub-account. Snapshot on subscribe uses the same
  schema as REST `GET /positions`. Updates carry one `PositionUpdate` event per
  frame.


  `cumulativeFunding` is absent from streaming events — use the snapshot for
  funding horizons. On close (size drops to 0), the row is emitted in `FLAT`
  form with zeroed financials.


  `leverage` reflects the user's per-(account, market) override (set via REST
  `POST /v1/setLeverage`) when present, otherwise the market default. A
  `PositionUpdate` is also emitted when the user adjusts leverage on a market
  they already hold a position in.
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=positions
parameters: []
bindings: []
operations:
  - &ref_2
    id: subscribePositions
    title: Subscribe positions
    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: positions
  - &ref_3
    id: receivePositions
    title: Receive positions
    type: send
    messages:
      - &ref_5
        id: snapshot
        contentType: application/json
        payload:
          - name: Positions Snapshot
            description: >
              Same schema as REST `GET /positions` (`GetPositionsResponse`) with
              `isSnapshot: true`. Sent once on subscribe.
            type: object
            properties:
              - name: type
                type: string
                description: >-
                  `subscribed` for the initial snapshot; `channel_data` for
                  updates.
                enumValues:
                  - subscribed
                  - channel_data
                required: true
              - name: channel
                type: string
                description: Channel name.
                required: true
              - name: id
                type: string
                description: Channel id (market or address). Absent for global channels.
                required: false
              - name: contents
                type: object
                description: Channel-specific payload. Schema varies by channel.
                required: false
                properties: []
        headers: []
        jsonPayloadSchema: &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
        title: Positions Snapshot
        description: >
          Same schema as REST `GET /positions` (`GetPositionsResponse`) with
          `isSnapshot: true`. Sent once on subscribe.
        example: |-
          {
            "type": "<string>",
            "channel": "<string>",
            "id": "<string>",
            "contents": {}
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: snapshot
      - &ref_6
        id: update
        contentType: application/json
        payload:
          - name: Position Update
            description: >
              One position delta per frame (one `PositionUpdate` from go-core
              per SBE `wire.PositionUpdateMsg`). `cumulativeFunding` is absent;
              use the snapshot for funding horizons. On close, emitted in `FLAT`
              form with zeroed financials.
            type: object
            properties:
              - name: type
                type: string
                description: >-
                  `subscribed` for the initial snapshot; `channel_data` for
                  updates.
                enumValues:
                  - subscribed
                  - channel_data
                required: true
              - name: channel
                type: string
                description: Channel name.
                required: true
              - name: id
                type: string
                description: Channel id (market or address). Absent for global channels.
                required: false
              - name: contents
                type: object
                description: Channel-specific payload. Schema varies by channel.
                required: false
                properties: []
        headers: []
        jsonPayloadSchema: *ref_0
        title: Position Update
        description: >
          One position delta per frame (one `PositionUpdate` from go-core per
          SBE `wire.PositionUpdateMsg`). `cumulativeFunding` is absent; use the
          snapshot for funding horizons. On close, emitted in `FLAT` form with
          zeroed financials.
        example: |-
          {
            "type": "<string>",
            "channel": "<string>",
            "id": "<string>",
            "contents": {}
          }
        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
  - *ref_6
extensions:
  - id: x-parser-unique-object-id
    value: positions
securitySchemes: []

````