> ## 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 greeks, model price, and probability of profit

> Per-instrument option greeks computed by Joyride:
Black-76 (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.

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.




## OpenAPI

````yaml /_generated/openapi.yaml get /v1/greeks
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/greeks:
    get:
      tags:
        - Market Data
      summary: Get greeks, model price, and probability of profit
      description: |
        Per-instrument option greeks computed by Joyride:
        Black-76 (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.

        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.
      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: []
components:
  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.

````