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

# Ensure the caller's RFQ subaccount exists (Joyride pays the rent once)

> Asks core to make sure the authenticated wallet's margin-vault
`Subaccount` PDA exists, with Joyride paying its rent at most once per
wallet. The owner is always the bearer's wallet — the request has no
body fields and cannot provision another wallet. Idempotent and safe
to retry: `exists` costs nothing, `submitted` reports the in-flight
`init_subaccount` signature (concurrent callers share one send), and
`refused` is an answer, not an error. Paced at one call per minute
per wallet. On-chain presence is visible within seconds; the RFQ
desk's `RFQ_NOT_READY` gate clears once the vault watcher attributes
the new subaccount, up to about a minute later.




## OpenAPI

````yaml /_generated/openapi.yaml post /v1/rfq/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:
  /v1/rfq/subaccount:
    post:
      tags:
        - Account
      summary: Ensure the caller's RFQ subaccount exists (Joyride pays the rent once)
      description: |
        Asks core to make sure the authenticated wallet's margin-vault
        `Subaccount` PDA exists, with Joyride paying its rent at most once per
        wallet. The owner is always the bearer's wallet — the request has no
        body fields and cannot provision another wallet. Idempotent and safe
        to retry: `exists` costs nothing, `submitted` reports the in-flight
        `init_subaccount` signature (concurrent callers share one send), and
        `refused` is an answer, not an error. Paced at one call per minute
        per wallet. On-chain presence is visible within seconds; the RFQ
        desk's `RFQ_NOT_READY` gate clears once the vault watcher attributes
        the new subaccount, up to about a minute later.
      operationId: ensureRfqSubaccount
      responses:
        '200':
          description: Provisioning outcome
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformRfqSubaccountResponse'
        '401':
          $ref: '#/components/responses/PlatformUnauthorized'
        '404':
          $ref: '#/components/responses/PlatformNotFound'
        '429':
          description: >-
            More than one call per minute for this wallet; `retry-after` carries
            the wait in seconds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformError'
        '502':
          description: Core or the provisioner is temporarily unavailable; retry shortly
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformError'
        '503':
          description: Provisioning is not configured on this deployment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformError'
      security:
        - aiAuth: []
components:
  schemas:
    PlatformRfqSubaccountResponse:
      type: object
      required:
        - status
      properties:
        status:
          type: string
          enum:
            - exists
            - submitted
            - refused
          description: >-
            `exists`: the subaccount is on chain (nothing sent). `submitted`: an
            `init_subaccount` is in flight. `refused`: see `reason`.
        signature:
          type: string
          description: >-
            Base58 signature of the in-flight `init_subaccount`; present on
            `submitted` when known.
        reason:
          type: string
          enum:
            - provisioner_disabled
            - invalid_owner
            - already_provisioned
            - payer_unavailable
            - vault_paused
          description: >-
            Present on `refused`. `provisioner_disabled` and `payer_unavailable`
            mean "fund the subaccount from a wallet, or try again shortly";
            `vault_paused` means RFQ is paused; `already_provisioned` is the
            per-wallet spend bound (unreachable while the program has no close
            path).
      example:
        status: submitted
        signature: >-
          5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uZ6YpUDkH5Gy8dn3sq8tuDdBhCPq8tAgeKxb7hW
    PlatformError:
      type: object
      properties:
        error:
          type: string
          description: >-
            Human-readable error message (auth failures may include an `auth_*`
            code prefix)
          example: Instrument not found
      required:
        - error
  responses:
    PlatformUnauthorized:
      description: >
        Authentication required or the bearer token is invalid.

        For JWT-protected endpoints, `error` is prefixed with an auth code:

        `auth_missing`, `auth_missing_or_wallet_query`, `auth_malformed`,
        `auth_expired`, or `auth_signature_invalid`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlatformError'
    PlatformNotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlatformError'
  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.
    aiAuth:
      type: http
      scheme: bearer
      description: |
        Joyride Core session JWT obtained from the SIWS flow
        (`public/get_nonce` + `public/auth` on the Core trading WebSocket).
        Include as: `Authorization: Bearer <jwt>`

````