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

# Get BFF-computed greeks, PoP and model price

> Consolidated per-instrument option greeks computed by the platform BFF:
Black-Scholes (r = 0, forward = spot) model price, delta, gamma, theta,
vega, probability-of-profit, and the BlockScholes-derived `mark_iv`
passthrough. Served entirely from an in-process cache refreshed by a
background poller — no upstream call is made per request.

**Breaking change (declared):** this public path previously routed to
the legacy risk-engine, which served a bare JSON array
(`InstrumentGreeks[]`). That contract is REPLACED by the
`{ "data": [...] }` envelope documented here; only dormant-era
consumers existed and no compatibility shim is provided.

Conventions:
- All numeric fields are fixed-8 decimal **strings**.
- `null` means unknown/stale — `"0.00000000"` is never emitted for an
  unknown value. Rows whose source inputs (quote `as_of_ms` / oracle
  spot publish time) are older than the staleness window (default 30s)
  serve null fields while retaining their last timestamps.
- `model_price` is a display-only theoretical value. It is NOT the
  margin/liquidation-authoritative mark and must never be used as a
  PnL/margin/liquidation price source.
- `rho` is intentionally omitted (convention-dependent, unrendered).
- Rows are sorted by `symbol`. Staleness never yields a 5xx — the
  endpoint returns 200 with null fields.
- Adding response fields is backward-compatible; removing or renaming
  fields is a breaking change gated by the shared contract fixture.




## OpenAPI

````yaml /_generated/openapi.yaml get /v1/greeks
openapi: 3.1.0
info:
  title: Joyride Exchange REST API
  version: 1.0.0
  description: >
    REST API for the Joyride 0DTE Options Exchange.


    ## Authentication


    **Public endpoints** (`/health`, `/v1/market/*`, `/v1/spot/*`,
    `/v1/oracle/*`) require no authentication.


    **Competition prize claims** (`/v1/competition/claim`) are
    self-authenticated

    by a Solana ed25519 signature over the wallet, Discord handle, and payout

    destination in the request body. No JWT is required for that endpoint.


    **Account endpoints** (`/v1/account/*`, `/v1/orders/*`,
    `/v1/social/profile`, `/v1/social/avatar`) require JWT authentication via
    one of:

    1. `Authorization: Bearer <jwt>` header (primary — native clients)

    2. `Cookie: joyride_session=<jwt>` (web clients, set automatically by
    `/v1/auth/verify`)


    **Withdrawal endpoints** (`/withdrawals`, `/v1/withdrawals`) require the

    `Authorization: Bearer <jwt>` header. A session cookie alone is not
    accepted.


    Obtain a JWT by completing the SIWS (Sign In With Solana) flow:

    1. `POST /v1/auth/nonce` with your wallet address to get a nonce

    2. Sign the canonical SIWS message with your wallet

    3. `POST /v1/auth/verify` with wallet, signature, and message to receive a
    JWT


    **Mutating admin endpoints** require a bearer token:

    ```

    Authorization: Bearer <ADMIN_TOKEN>

    ```


    ## Data Conventions


    - **Prices**: Integer values in USDC micros (1 USDC = 1,000,000 micros).
      Example: `1500000` = $1.50
    - **Sizes**: Integer values in millicontracts (1 contract = 1000
    millicontracts).
      Example: `1000` = 1 contract
    - **Balances**: USDC micros. Example: `10_000_000_000` = $10,000

    - **Timestamps**: Unix microseconds (µs since epoch)

    - **Instrument IDs**: Format `{ASSET}_USDC-{DMMMYY}-{STRIKE}-{C|P}`.
      Example: `SOL_USDC-28FEB26-150-C`

    ## Trading


    **Trading is WebSocket-only.** The HTTP API has no order placement
    endpoints.

    See the AsyncAPI spec for WebSocket trading methods.
  contact:
    name: Joyride Engineering
    email: engineering@joyride.exchange
  license:
    name: Proprietary
servers:
  - url: https://joyride.exchange/api
    description: Production
security: []
tags:
  - name: Authentication
    description: |
      SIWS (Sign In With Solana) authentication flow. Obtain a JWT for use
      with all authenticated endpoints. No prior authentication required.
  - name: Health
    description: Service health check.
  - name: Market Data
    description: Publicly accessible market data. No authentication required.
  - name: Account
    description: User-specific account data. Requires user identification.
  - name: Orders
    description: User order history. Requires user identification.
  - name: Withdrawals
    description: Request signed withdrawal authorizations and list withdrawal history.
  - name: Social
    description: Social features — profiles, leaderboard, and activity.
  - name: Referrals
    description: Referral-code validation and attribution surfaces.
  - name: Competition
    description: Competition-specific collection flows.
  - name: Spot
    description: Spot prices and volatility data.
  - name: Oracle
    description: Oracle data — prices, TWAP previews, and settlement timing.
  - 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).
  - name: Admin
    description: Administrative operations. Requires admin bearer token.
paths:
  /v1/greeks:
    get:
      tags:
        - Market Data
      summary: Get BFF-computed greeks, PoP and model price
      description: |
        Consolidated per-instrument option greeks computed by the platform BFF:
        Black-Scholes (r = 0, forward = spot) model price, delta, gamma, theta,
        vega, probability-of-profit, and the BlockScholes-derived `mark_iv`
        passthrough. Served entirely from an in-process cache refreshed by a
        background poller — no upstream call is made per request.

        **Breaking change (declared):** this public path previously routed to
        the legacy risk-engine, which served a bare JSON array
        (`InstrumentGreeks[]`). That contract is REPLACED by the
        `{ "data": [...] }` envelope documented here; only dormant-era
        consumers existed and no compatibility shim is provided.

        Conventions:
        - All numeric fields are fixed-8 decimal **strings**.
        - `null` means unknown/stale — `"0.00000000"` is never emitted for an
          unknown value. Rows whose source inputs (quote `as_of_ms` / oracle
          spot publish time) are older than the staleness window (default 30s)
          serve null fields while retaining their last timestamps.
        - `model_price` is a display-only theoretical value. It is NOT the
          margin/liquidation-authoritative mark and must never be used as a
          PnL/margin/liquidation price source.
        - `rho` is intentionally omitted (convention-dependent, unrendered).
        - Rows are sorted by `symbol`. Staleness never yields a 5xx — the
          endpoint returns 200 with null fields.
        - Adding response fields is backward-compatible; removing or renaming
          fields is a breaking change gated by the shared contract fixture.
      operationId: getBffGreeks
      parameters:
        - name: asset
          in: query
          required: false
          description: |
            Optional base-asset filter. Validated against the canonical
            configured asset set (`BTC`, `ETH`, `SOL`), case-insensitively;
            values longer than 64 bytes or outside the set yield 400
            `INVALID_ASSET`. A valid asset with no cached rows returns an
            empty `data` array.
          schema:
            type: string
            maxLength: 64
            enum:
              - BTC
              - ETH
              - SOL
      responses:
        '200':
          description: Cached greeks rows (empty array when the cache is empty)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                          description: Instrument symbol (quote-pair format)
                          examples:
                            - BTC_USDC-25JUL26-120000-C
                        model_price:
                          type:
                            - string
                            - 'null'
                          description: |
                            BS(spot, K, T, r=0, mark_iv) theoretical price,
                            fixed-8 decimal string. Display-only — never a
                            margin/liquidation price source.
                        mark_iv:
                          type:
                            - string
                            - 'null'
                          description: >-
                            BlockScholes-derived mark IV passthrough (fixed-8
                            string)
                        delta:
                          type:
                            - string
                            - 'null'
                          description: >-
                            In [-1, 1], sign-consistent with option type
                            (fixed-8 string)
                        gamma:
                          type:
                            - string
                            - 'null'
                          description: Non-negative (fixed-8 string)
                        theta:
                          type:
                            - string
                            - 'null'
                          description: Per-day, non-positive at r = 0 (fixed-8 string)
                        vega:
                          type:
                            - string
                            - 'null'
                          description: Per 1% IV change, non-negative (fixed-8 string)
                        pop:
                          type:
                            - string
                            - 'null'
                          description: >-
                            Long-side probability of profit at expiry, in [0, 1]
                            (fixed-8 string)
                        as_of:
                          type:
                            - integer
                            - 'null'
                          description: >-
                            Unix ms of the OLDEST source input (never request
                            time)
                        computed_at:
                          type:
                            - integer
                            - 'null'
                          description: >-
                            Unix ms the row was last computed; null only when
                            never computed
                      required:
                        - symbol
                        - model_price
                        - mark_iv
                        - delta
                        - gamma
                        - theta
                        - vega
                        - pop
                        - as_of
                        - computed_at
                required:
                  - data
              example:
                data:
                  - symbol: BTC_USDC-25JUL26-120000-C
                    model_price: '1588.21000000'
                    mark_iv: '0.43210000'
                    delta: '0.45120000'
                    gamma: '0.00001200'
                    theta: '-42.10000000'
                    vega: '88.40000000'
                    pop: '0.38000000'
                    as_of: 1753100000123
                    computed_at: 1753100000500
        '400':
          description: Invalid `asset` filter (the input is never reflected back)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    const: INVALID_ASSET
                  message:
                    type: string
                    const: asset must be one of the listed base assets
                required:
                  - error
                  - message
      security: []

````