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

# Lending rates

> > **Endpoint:** `wss://api.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.

Global channel (no `id`) that streams the exchange-wide borrow rate and cumulative borrow index — the lending analog of `oraclePrices`. Frames are pushed as the borrow index accrues, carrying the current annual borrow rate (`ratePpm`) and the global borrow index (`borrowIndex`, stringified integer at 1e12 scale).

A borrower's live accrued interest = `loanBalance` × (`borrowIndex` − the account's `lastBorrowIndex`) / 1e12, using the `account` channel's lending fields.

On subscribe the last observed tick is replayed as a snapshot (`isSnapshot: true`); when no tick has been observed since server start the subscribe ack carries empty contents (`{}`) and the client picks up state from the first streaming frame.




## AsyncAPI

````yaml api-reference/asyncapi.yaml lendingRates
id: lendingRates
title: Lending rates
description: >
  > **Endpoint:** `wss://api.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.


  Global channel (no `id`) that streams the exchange-wide borrow rate and
  cumulative borrow index — the lending analog of `oraclePrices`. Frames are
  pushed as the borrow index accrues, carrying the current annual borrow rate
  (`ratePpm`) and the global borrow index (`borrowIndex`, stringified integer at
  1e12 scale).


  A borrower's live accrued interest = `loanBalance` × (`borrowIndex` − the
  account's `lastBorrowIndex`) / 1e12, using the `account` channel's lending
  fields.


  On subscribe the last observed tick is replayed as a snapshot (`isSnapshot:
  true`); when no tick has been observed since server start the subscribe ack
  carries empty contents (`{}`) and the client picks up state from the first
  streaming frame.
servers:
  - id: mainnet
    protocol: wss
    host: api.arcus.xyz
    bindings: []
    variables: []
  - id: testnet
    protocol: wss
    host: api.testnet.arcus.xyz
    bindings: []
    variables: []
address: /v1/ws?channel=lendingRates
parameters: []
bindings: []
operations:
  - &ref_3
    id: subscribeLendingRates
    title: Subscribe lending rates
    type: receive
    messages:
      - &ref_5
        id: subscribe
        contentType: application/json
        payload:
          - name: Subscribe to the lending rates channel
            type: object
            properties:
              - name: type
                type: string
                description: subscribe
                required: true
              - name: channel
                type: string
                description: lendingRates
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - type
            - channel
          properties:
            type:
              type: string
              const: subscribe
              x-parser-schema-id: <anonymous-schema-148>
            channel:
              type: string
              const: lendingRates
              x-parser-schema-id: <anonymous-schema-149>
          x-parser-schema-id: SubscribeLendingRatesPayload
        title: Subscribe to the lending rates channel
        example: |-
          {
            "type": "subscribe",
            "channel": "lendingRates"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
    bindings: []
    extensions: &ref_2
      - id: x-parser-unique-object-id
        value: lendingRates
  - &ref_4
    id: receiveLendingRates
    title: Receive lending rates
    type: send
    messages:
      - &ref_6
        id: snapshot
        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-7>
                  channel:
                    type: string
                    description: Channel name.
                    x-parser-schema-id: <anonymous-schema-8>
                  id:
                    type: string
                    description: >
                      Channel id (market, or the lowercase master Ethereum
                      address on account-scoped channels). Absent for global
                      channels. Always lowercase for addresses regardless of the
                      spelling used to subscribe, so compare it
                      case-insensitively.
                    x-parser-schema-id: <anonymous-schema-9>
                  accountIndex:
                    type: integer
                    description: >
                      Subaccount this frame belongs to. Present on EVERY frame
                      of an account-scoped channel — `subscribed`,
                      `unsubscribed`, `degraded`, and `channel_data` alike —
                      including when it is 0, so a frame names its subaccount
                      outright and no client needs a "missing means 0" rule.
                      Omitted on every other channel. This is what makes several
                      subaccounts of one address demuxable on a single
                      connection: `id` alone is the master address and is
                      identical across all of them.
                    minimum: 0
                    maximum: 9
                    example: 3
                    x-parser-schema-id: <anonymous-schema-10>
                  sigFigs:
                    type: integer
                    description: >
                      Echo of the l2Orderbook aggregation this frame belongs to.
                      Omitted on full-precision views and on every other
                      channel. Lets a client holding several aggregations of the
                      same market demux snapshots.
                    enum:
                      - 2
                      - 3
                      - 4
                      - 5
                    x-parser-schema-id: <anonymous-schema-11>
                  roundStep:
                    type: integer
                    description: >-
                      Echo of the l2Orderbook roundStep for this view. Omitted
                      unless sigFigs is 5 and roundStep was 2 or 5.
                    enum:
                      - 1
                      - 2
                      - 5
                    x-parser-schema-id: <anonymous-schema-12>
                  throttleMs:
                    type: integer
                    enum:
                      - 100
                      - 250
                      - 500
                      - 1000
                      - 2000
                    description: >
                      Echo of the throttleMs cadence requested on subscribe.
                      Present on the `subscribed` ack for `bbo` and
                      `oraclePrices` when throttling was requested; absent
                      otherwise and absent on `channel_data` frames (it is not
                      part of subscription identity, so there is nothing to
                      demux).
                    x-parser-schema-id: <anonymous-schema-13>
                  market:
                    type: string
                    example: BTC-USD
                    description: >
                      Display ticker of the market this frame belongs to, always
                      the resolved ticker even when the client subscribed by
                      numeric id. Present only on `positions` / `orders` /
                      `userFills`; omitted on every other channel. Its meaning
                      differs slightly by frame type. On `subscribed` /
                      `unsubscribed` it echoes the market filter the
                      subscription was created with, and is omitted for an
                      unfiltered subscription. On `channel_data` it is the
                      market of the frame itself, so an UNFILTERED subscriber
                      sees it too — those channels emit one frame per market, so
                      every frame has one. This is what lets a client demux,
                      exactly as `sigFigs` / `roundStep` do for l2Orderbook: a
                      connection holding several market-filtered views of one
                      account matches each frame to the right view by this
                      field. Clients that hold a single unfiltered view can
                      ignore it.
                    x-parser-schema-id: <anonymous-schema-14>
                  contents:
                    type: object
                    additionalProperties: true
                    description: Channel-specific payload. Schema varies by channel.
                    properties: {}
                    x-parser-schema-id: <anonymous-schema-15>
                x-parser-schema-id: ChannelDataEnvelope
              - type: object
                properties:
                  contents:
                    type: object
                    required:
                      - isSnapshot
                      - ratePpm
                      - borrowIndex
                      - timestamp
                      - globalSequenceId
                    properties:
                      isSnapshot:
                        type: boolean
                        description: >-
                          True for the subscribe-time replay of the last tick;
                          false for streaming frames.
                        x-parser-schema-id: <anonymous-schema-152>
                      ratePpm:
                        type: integer
                        format: int64
                        description: >
                          Annual borrow rate the new segment opens at, in
                          parts-per-million per year (e.g. 80000 = 8%/yr).
                        example: 80000
                        x-parser-schema-id: <anonymous-schema-153>
                      borrowIndex:
                        type: string
                        description: >
                          Global cumulative borrow index after the segment
                          close, stringified integer at 1e12 scale. The single
                          cursor all loans accrue against.
                        example: '1002500000000'
                        x-parser-schema-id: <anonymous-schema-154>
                      utilizationPpm:
                        type: integer
                        format: int64
                        nullable: true
                        description: >
                          Exchange-wide lending utilization (Σ `loanBalance` /
                          vault capital) the borrow-rate curve was evaluated at
                          for this segment, in parts-per-million (1000000 =
                          100%, clamped to `[0, 1000000]`). `null` on a tick
                          emitted before the field existed on the wire, which
                          lets clients tell "unknown" apart from a genuine 0%
                          utilization.
                        example: 673400
                        x-parser-schema-id: <anonymous-schema-155>
                      timestamp:
                        type: integer
                        format: int64
                        description: Engine event time in Unix nanoseconds.
                        example: 1780410803123456800
                        x-parser-schema-id: <anonymous-schema-156>
                      globalSequenceId:
                        type: integer
                        format: int64
                        description: Strict ordering across all engine events.
                        example: 9600000001
                        x-parser-schema-id: <anonymous-schema-157>
                    x-parser-schema-id: <anonymous-schema-151>
                x-parser-schema-id: <anonymous-schema-150>
            x-parser-schema-id: LendingRatesPayload
            name: Lending Rate Tick Snapshot
            description: >
              The last observed lending rate tick, replayed once on subscribe
              (`isSnapshot: true`). When no tick has been observed since server
              start, the subscribe ack carries empty contents (`{}`) instead.
        headers: []
        jsonPayloadSchema: &ref_1
          allOf: *ref_0
          x-parser-schema-id: LendingRatesPayload
        title: Lending Rate Tick Snapshot
        description: >
          The last observed lending rate tick, replayed once on subscribe
          (`isSnapshot: true`). When no tick has been observed since server
          start, the subscribe ack carries empty contents (`{}`) instead.
        example: |-
          {
            "type": "subscribed",
            "channel": "lendingRates",
            "contents": {
              "isSnapshot": true,
              "ratePpm": 80000,
              "borrowIndex": "1002500000000",
              "utilizationPpm": 673400,
              "timestamp": 1780410803123456800,
              "globalSequenceId": 9600000001
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: snapshot
      - &ref_7
        id: update
        contentType: application/json
        payload:
          - allOf: *ref_0
            x-parser-schema-id: LendingRatesPayload
            name: Lending Rate Tick
            description: >
              Each frame carries the current annual borrow rate and the global
              cumulative borrow index. A borrower's live accrued interest =
              `loanBalance` × (`borrowIndex` − the account's `lastBorrowIndex`)
              / 1e12.
        headers: []
        jsonPayloadSchema: *ref_1
        title: Lending Rate Tick
        description: >
          Each frame carries the current annual borrow rate and the global
          cumulative borrow index. A borrower's live accrued interest =
          `loanBalance` × (`borrowIndex` − the account's `lastBorrowIndex`) /
          1e12.
        example: |-
          {
            "type": "channel_data",
            "channel": "lendingRates",
            "contents": {
              "isSnapshot": false,
              "ratePpm": 82000,
              "borrowIndex": "1002600000000",
              "utilizationPpm": 681200,
              "timestamp": 1780414403123456800,
              "globalSequenceId": 9600000123
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: update
    bindings: []
    extensions: *ref_2
sendOperations:
  - *ref_3
receiveOperations:
  - *ref_4
sendMessages:
  - *ref_5
receiveMessages:
  - *ref_6
  - *ref_7
extensions:
  - id: x-parser-unique-object-id
    value: lendingRates
securitySchemes: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.