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

# The caller's RFQ collateral, as the vault-watcher last projected it

> Zero or one row. A wallet that has never funded the RFQ side has no subaccount, and an empty `rows` array means exactly that: a real zero, not an error and not an outage. `free_balance` and `locked_total` are NULLABLE: a subaccount row can exist before its first projected balance, and a null there means UNKNOWN, never zero. Cursor pagination is not supported on this endpoint (`after` returns 400). The app reads the same account straight off the chain; this projection exists so a server-side consumer can see where a user's money is without an RPC round trip, and it lags the chain by the vault-watcher's projection delay.



## OpenAPI

````yaml /_generated/openapi.yaml get /query/vault-subaccount
openapi: 3.1.0
info:
  title: Joyride Core HTTP API
  version: 0.1.0
  description: |
    HTTP endpoints served by joyride-core v8 components. Decimal money,
    price, and quantity fields are strings with up to 8 decimal places unless
    noted otherwise.
servers:
  - url: https://joyride.exchange/api
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Public
  - name: Query
  - name: Withdrawals
  - name: Market Data
    description: Publicly accessible market data. No authentication required.
  - name: Account
    description: Account-scoped history and provisioning. Requires a bearer JWT.
  - name: Referrals
    description: Referral-code validation and attribution surfaces.
  - name: AI Chat
    description: >
      AI-powered trading assistant. Uses SIWS (Sign In With Solana)
      authentication

      and JWT sessions. Returns responses as Server-Sent Events (SSE).
paths:
  /query/vault-subaccount:
    get:
      tags:
        - Query
      summary: The caller's RFQ collateral, as the vault-watcher last projected it
      description: >-
        Zero or one row. A wallet that has never funded the RFQ side has no
        subaccount, and an empty `rows` array means exactly that: a real zero,
        not an error and not an outage. `free_balance` and `locked_total` are
        NULLABLE: a subaccount row can exist before its first projected balance,
        and a null there means UNKNOWN, never zero. Cursor pagination is not
        supported on this endpoint (`after` returns 400). The app reads the same
        account straight off the chain; this projection exists so a server-side
        consumer can see where a user's money is without an RPC round trip, and
        it lags the chain by the vault-watcher's projection delay.
      operationId: listVaultSubaccount
      parameters:
        - $ref: '#/components/parameters/AccountId'
        - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: Zero or one vault-subaccount row
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VaultSubaccountRows'
        '400':
          $ref: '#/components/responses/QueryError'
        '401':
          $ref: '#/components/responses/QueryError'
components:
  parameters:
    AccountId:
      name: account_id
      in: query
      schema:
        type: integer
        minimum: 0
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 1
  schemas:
    VaultSubaccountRows:
      type: object
      required:
        - rows
      properties:
        rows:
          type: array
          description: >-
            Zero or one row for a user-scoped caller. An admin token without
            `account_id` is not narrowed, so it reads every subaccount up to the
            page limit.
          items:
            $ref: '#/components/schemas/VaultSubaccountRow'
    VaultSubaccountRow:
      type: object
      required:
        - account_id
      properties:
        account_id:
          type: integer
        subaccount:
          type:
            - string
            - 'null'
          description: >-
            Hex-encoded subaccount address. Null on every row today: no
            projector write path populates the column.
        free_balance:
          oneOf:
            - $ref: '#/components/schemas/VaultDecimalString'
            - type: 'null'
          description: >-
            Collateral free to back a new fill, vault-decimal (6 dp), as
            finalized on chain. Null means not yet projected, which is UNKNOWN,
            not zero: a subaccount row can exist before its first balance
            effect. Open quote fills are not debited here until settlement, so
            this can read higher than the risk state does.
        locked_total:
          oneOf:
            - $ref: '#/components/schemas/VaultDecimalString'
            - type: 'null'
          description: Collateral locked under open positions, vault-decimal (6 dp).
        open_position_counter:
          type:
            - string
            - 'null'
        finalized_slot:
          type:
            - integer
            - 'null'
    QueryErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    VaultDecimalString:
      type: string
      description: Unsigned margin-vault USDC amount with at most 6 decimal places.
      pattern: ^[0-9]+(\.[0-9]{1,6})?$
  responses:
    QueryError:
      description: Query API error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/QueryErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        SIWS-issued JWT. Admin commands require the `admin` role, `admin:*`, or
        the exact `admin:<type>` scope; admin reads use their documented read
        scope.

````