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

# Funding

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

Funding payment stream for an account. Snapshot on subscribe contains up to 100 most recent funding payments from the last 30 days; for older history query REST `GET /v1/funding` with an explicit `from`. Live updates deliver one event per (market, account) at each funding payment time.

Sign convention on `payment`: positive = received, negative = paid. `time` is the Unix-microsecond funding payment time.




## AsyncAPI

````yaml api-reference/asyncapi.yaml funding
id: funding
title: Funding
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.


  Funding payment stream for an account. Snapshot on subscribe contains up to
  100 most recent funding payments from the last 30 days; for older history
  query REST `GET /v1/funding` with an explicit `from`. Live updates deliver one
  event per (market, account) at each funding payment time.


  Sign convention on `payment`: positive = received, negative = paid. `time` is
  the Unix-microsecond funding payment time.
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=funding
parameters: []
bindings: []
operations:
  - &ref_5
    id: subscribeFunding
    title: Subscribe funding
    type: receive
    messages:
      - &ref_7
        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_4
      - id: x-parser-unique-object-id
        value: funding
  - &ref_6
    id: receiveFunding
    title: Receive funding
    type: send
    messages:
      - &ref_8
        id: snapshot
        contentType: application/json
        payload:
          - allOf: &ref_0
              - &ref_1
                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:
                  type:
                    const: subscribed
                    x-parser-schema-id: <anonymous-schema-136>
                  contents:
                    type: object
                    required:
                      - isSnapshot
                      - fundingPayments
                    properties:
                      isSnapshot:
                        type: boolean
                        example: true
                        x-parser-schema-id: <anonymous-schema-138>
                      fundingPayments:
                        type: array
                        description: Up to 100 most recent funding payments.
                        items: &ref_2
                          type: object
                          description: >
                            One applied funding payment for an (account, market)
                            at a single funding payment time. Same shape as REST
                            `GET /v1/funding` `FundingPayment`.
                          required:
                            - marketId
                            - marketDisplayName
                            - fundingRate
                            - size
                            - payment
                            - time
                          properties:
                            marketId:
                              type: integer
                              minimum: 0
                              maximum: 65535
                              x-parser-schema-id: <anonymous-schema-140>
                            marketDisplayName:
                              type: string
                              example: BTC-USD
                              x-parser-schema-id: <anonymous-schema-141>
                            fundingRate:
                              type: string
                              description: Hourly funding rate (decimal string).
                              example: '0.00001234'
                              x-parser-schema-id: <anonymous-schema-142>
                            size:
                              type: string
                              description: >-
                                Signed position size when the payment was
                                computed.
                              example: '0.5'
                              x-parser-schema-id: <anonymous-schema-143>
                            payment:
                              type: string
                              description: >
                                Quote-currency amount applied. Positive = trader
                                received, negative = trader paid.
                              example: '-3.21'
                              x-parser-schema-id: <anonymous-schema-144>
                            time:
                              type: integer
                              format: int64
                              description: Funding payment time (Unix microseconds).
                              example: 1700003600000000
                              x-parser-schema-id: <anonymous-schema-145>
                          x-parser-schema-id: FundingPayment
                        x-parser-schema-id: <anonymous-schema-139>
                    x-parser-schema-id: <anonymous-schema-137>
                x-parser-schema-id: <anonymous-schema-135>
            x-parser-schema-id: FundingPaymentsSnapshotPayload
            name: Funding Payments Snapshot
            description: >
              Recent funding payments for the account, sent once on subscribe.
              Same item shape as REST `GET /v1/funding`. Up to 100 entries from
              the last 30 days; for older history query REST `GET /v1/funding`
              with `from`.
        headers: []
        jsonPayloadSchema:
          allOf: *ref_0
          x-parser-schema-id: FundingPaymentsSnapshotPayload
        title: Funding Payments Snapshot
        description: >
          Recent funding payments for the account, sent once on subscribe. Same
          item shape as REST `GET /v1/funding`. Up to 100 entries from the last
          30 days; for older history query REST `GET /v1/funding` with `from`.
        example: |-
          {
            "type": "subscribed",
            "channel": "funding",
            "id": "0xAbCd...1234",
            "contents": {
              "isSnapshot": true,
              "fundingPayments": [
                {
                  "marketId": 1,
                  "marketDisplayName": "BTC-USD",
                  "fundingRate": "0.00001234",
                  "size": "0.5",
                  "payment": "-3.21",
                  "time": 1700000000000000
                },
                {
                  "marketId": 2,
                  "marketDisplayName": "ETH-USD",
                  "fundingRate": "-0.00000567",
                  "size": "-2.0",
                  "payment": "1.05",
                  "time": 1700000000000000
                }
              ]
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: snapshot
      - &ref_9
        id: update
        contentType: application/json
        payload:
          - allOf: &ref_3
              - *ref_1
              - type: object
                properties:
                  type:
                    const: channel_data
                    x-parser-schema-id: <anonymous-schema-147>
                  contents: *ref_2
                x-parser-schema-id: <anonymous-schema-146>
            x-parser-schema-id: FundingPaymentUpdatePayload
            name: Funding Payment Update
            description: >
              One applied funding payment per frame, emitted at each funding
              payment time. One frame per (market, account) where the position
              held a non-zero size when the payment was computed.
        headers: []
        jsonPayloadSchema:
          allOf: *ref_3
          x-parser-schema-id: FundingPaymentUpdatePayload
        title: Funding Payment Update
        description: >
          One applied funding payment per frame, emitted at each funding payment
          time. One frame per (market, account) where the position held a
          non-zero size when the payment was computed.
        example: |-
          {
            "type": "channel_data",
            "channel": "funding",
            "id": "0xAbCd...1234",
            "contents": {
              "marketId": 1,
              "marketDisplayName": "BTC-USD",
              "fundingRate": "0.00001234",
              "size": "0.5",
              "payment": "-3.21",
              "time": 1700003600000000
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: update
    bindings: []
    extensions: *ref_4
sendOperations:
  - *ref_5
receiveOperations:
  - *ref_6
sendMessages:
  - *ref_7
receiveMessages:
  - *ref_8
  - *ref_9
extensions:
  - id: x-parser-unique-object-id
    value: funding
securitySchemes: []

````