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

# Subscribe: Spot Fills

> Subscribe to the `fillsSpot` channel. Requires authentication (login first).

Optional `markets` to filter.

Send this subscription over the shared /ws connection; /ws/fillsSpot is a documentation route, not a separate socket URL. See the [Spot API guide](/api-reference/spot-api-guide). Events do not include a complete history at subscription. Initialize and reconcile through REST after reconnects.



## OpenAPI

````yaml /api-reference/ws-spec.json post /ws/fillsSpot
openapi: 3.0.3
info:
  title: Ondo Perps WebSocket API
  version: '1.0'
  description: >-
    WebSocket API for Ondo Perps: real-time market data, order updates,
    positions, balance, funding, and more.


    ## Connection


    Connect via `wss://api.ondoperps.xyz/ws`. The server enforces a 32 KB max
    message size and a rate limit of 25 requests/second (burst 50).


    ## Authentication


    Public channels (market data) require no authentication. Private channels
    (orders, fills, positions, balance, etc.) require a `login` message first.


    ### JWT Login

    ```json

    {"op": "login", "args": {"token": "<JWT>"}}

    ```


    ### API Key Login

    ```json

    {"op": "login", "args": {"key": "<api_key_id>", "time": "<unix_ms>", "sign":
    "<hex_hmac>"}}

    ```


    Signature: `HMAC-SHA256(api_secret, time + "ondo_perps_ws_login" )`


    ## Heartbeat


    Send `{"op": "ping"}` periodically. The server responds with `{"type":
    "pong"}`. Connections idle for 180 seconds are closed.


    ## Message Format


    ### Client → Server

    All client messages use the `op` field: `ping`, `login`, `subscribe`,
    `unsubscribe`, `sendMessage`.


    ### Server → Client

    All server messages use the `type` field: `pong`, `loggedIn`, `subscribed`,
    `unsubscribed`, `update`, `error`.

    Channel data updates arrive as `{"type": "update", "channel": "<name>",
    "data": <payload>}`.
servers:
  - url: wss://api.ondoperps.xyz
    description: Production
security: []
paths:
  /ws/fillsSpot:
    post:
      tags:
        - Spot private channels
      summary: 'Subscribe: Spot Fills'
      description: >-
        Subscribe to the `fillsSpot` channel. Requires authentication (login
        first).


        Optional `markets` to filter.


        Send this subscription over the shared /ws connection; /ws/fillsSpot is
        a documentation route, not a separate socket URL. See the [Spot API
        guide](/api-reference/spot-api-guide). Events do not include a complete
        history at subscription. Initialize and reconcile through REST after
        reconnects.
      operationId: subscribe_fillsSpot
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - op
                - channel
              properties:
                op:
                  type: string
                  enum:
                    - subscribe
                    - unsubscribe
                  example: subscribe
                  description: Operation type.
                channel:
                  type: string
                  enum:
                    - fillsSpot
                  example: fillsSpot
                  description: Channel for this subscription.
                markets:
                  type: array
                  items:
                    type: string
                  example:
                    - NVDA-USDC
                  description: >-
                    Markets to filter by. Optional; if omitted, all available
                    markets are used.
            example:
              op: subscribe
              channel: fillsSpot
              markets:
                - NVDA-USDC
      responses:
        '200':
          description: Channel update for `fillsSpot`
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - update
                  channel:
                    type: string
                    enum:
                      - fillsSpot
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/SpotFill'
components:
  schemas:
    SpotFill:
      type: object
      required:
        - id
        - orderId
        - market
        - price
        - size
        - side
        - filledCost
        - fee
        - time
        - isMaker
      properties:
        id:
          type: string
          description: Fill ID
          example: 70a37d8f972f2494837f9dba8364cbb4
        orderId:
          type: string
          description: Order ID this fill belongs to
          example: 197ec08e001658690721be129e7fa595
        clientOrderId:
          type: string
          description: Client order ID (if set on the order)
          example: order123
        market:
          type: string
          description: Trading market
          example: SPY-USDC
        price:
          type: string
          description: Fill price
          example: '1.55'
        size:
          type: string
          description: Fill quantity in base currency
          example: '5.403'
        side:
          type: string
          description: buy or sell
          enum:
            - buy
            - sell
          example: buy
        filledCost:
          type: string
          description: Total cost of the fill in quote currency
          example: '8.37465'
        fee:
          type: string
          description: >-
            Fee in the asset received: base equivalent quantity for buys, USDC
            for sells. Zero during the launch promotion.
          example: '0.0837'
        time:
          type: string
          format: date-time
          description: Time the fill occurred
          example: '2022-06-16T12:35:11.123456Z'
        isMaker:
          type: boolean
          description: True if this was a maker (resting) fill
          example: false

````

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