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

# Get peg state by mint address



## OpenAPI

````yaml https://api.pegana.xyz/openapi.json get /v1/assets/by-mint/{mint}/state
openapi: 3.1.0
info:
  title: Pegana API
  description: >-
    The peg-risk oracle for Solana. Read real-time peg state, history, alerts,
    and delivery health across the live mainnet asset universe spanning 6
    classes — LSTs, fiat / CDP / delta-neutral / yield-bearing / FX stables, and
    a leveraged synthetic. Some assets are flagged `monitoring_only` (beta):
    their alerts are live but the calibration is provisional. Public read
    endpoints require no API key but ARE rate-limited per IP (300/min global,
    10/min on /v1/audit.csv); exceeding the limit returns 429 with a Retry-After
    header. User-scoped /v1/me/* routes require a JWT obtained via Telegram
    Login. Every state transition emits a public receipt at /v1/audit/{id} with
    the methodology version, frozen inputs, and an on-chain SPL Memo commit (SAS
    deferred per ADR-0004 — SPL Memo gives 90% of the value). EVERY error
    response across the API is JSON — the envelope is `{error, message, asset?}`
    (the `ApiError` schema); branch on the stable `error` code, never on
    `message`. Malformed request bodies surface as `{error:"invalid_body"}`. Any
    endpoint may also return 500 `{error:"internal"}` on an unexpected server
    error. Value conventions: monetary and ratio amounts are exact decimal
    STRINGS (parse with a decimal library, never a float) with trailing zeros
    trimmed; USD aggregate fields (e.g. `market_cap`, `loop_exposure_usd`,
    `liquidatable_usd`) are rounded to the cent while price/discount signal
    fields keep full precision. All timestamps are RFC3339 UTC with millisecond
    precision and a `Z` suffix (`2026-07-24T15:33:14.545Z`). Every response
    carries an `x-request-id` header (quote it when reporting an issue) and the
    rate-limit budget as `RateLimit-Limit` / `RateLimit-Remaining` /
    `RateLimit-Reset` (mirrored as `X-RateLimit-*`); a 429 also sets
    `Retry-After`.
  contact:
    name: Rafael Souza
    email: rafael@pegana.xyz
  license:
    name: MIT
    identifier: MIT
  version: 1.0.0
servers:
  - url: https://api.pegana.xyz
    description: Production
security: []
tags:
  - name: Health
    description: Liveness and readiness probes
  - name: Assets
    description: Public read access to asset state, history, and metadata
  - name: Alerts
    description: Global feed of state transitions
  - name: Stats
    description: Aggregate counters and delivery health
  - name: Auth
    description: Telegram Login Widget → JWT
  - name: Me
    description: Authenticated user profile and preferences
  - name: Subscriptions
    description: User alert subscriptions
  - name: Webhooks
    description: User-managed Ed25519-signed webhooks
  - name: WebSocket
    description: Live state stream
  - name: audit
    description: >-
      Public receipts for alerts — methodology version, inputs frozen, replay
      bundles. All endpoints public, no auth, cacheable. ADR-0006 four-state
      response on /v1/audit/:id (200/202/404/410); ADR-0014 bounds (90-day max,
      100-row max, 50k-row cap).
  - name: methodology
    description: >-
      Public lifecycle status of the active methodology — version + status
      (active/deprecated/broken) + optional fix_url when broken. Consumed by
      web/app/api/methodology to power the home-page trust strip.
  - name: peg
    description: >-
      Peg-signal feed for tokens.xyz / aggregator consumption — a `data` array
      of per-asset signals (each carries its own `mint`). Public, no auth,
      cacheable. Honest beta status via `calibration` + `monitoring_only`;
      freshness via `updated_at` + `stale`.
paths:
  /v1/assets/by-mint/{mint}/state:
    get:
      tags:
        - Assets
      summary: Get peg state by mint address
      operationId: state_by_mint
      parameters:
        - name: mint
          in: path
          description: >-
            SPL mint address (base58). Resolved to the asset's symbol, then
            identical to /v1/assets/{symbol}/state.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Current state + transition timestamp
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StateResp'
        '404':
          description: >-
            unknown_asset (mint not tracked) or no_data (tracked, no snapshot
            yet)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    StateResp:
      type: object
      required:
        - asset
        - state
        - since
        - discount
        - intrinsic_usd
        - market_usd
        - updated_at
        - stale
      properties:
        asset:
          type: string
        confidence:
          type:
            - string
            - 'null'
          description: >-
            Pyth oracle confidence bucket: `high` | `medium` | `low` |
            `unknown`.

            The PRICE-ORACLE confidence-interval signal (conf/price ratio) — the
            field

            integrators should gate automation on alongside `state`. Mirrors the
            list

            endpoint's `confidence`. Collapses to `unknown` when the feed is
            stale (same

            as `state`), so a frozen feed cannot read as confidently pegged.
            Omitted only

            when no snapshot carries a confidence value (non-Pyth-dependent
            assets).
        discount:
          type: string
        intrinsic_usd:
          type: string
        market_usd:
          type: string
        since:
          type: string
          format: date-time
          description: |-
            Timestamp of the most recent transition into the current state.
            Equals the current snapshot timestamp if the engine has only ever
            observed one state for this asset.
        stale:
          type: boolean
          description: >-
            `true` when `updated_at` is older than the 15-minute freshness bound
            the

            list/detail endpoints enforce — i.e. the feed has likely frozen.
            Unlike

            list/detail, `/state` still returns the last value rather than
            404-hiding

            it; read this flag to fail safe. Consumers needing a tighter bound
            can

            derive their own from `updated_at`.
        state:
          $ref: '#/components/schemas/PegState'
        state_reason:
          type:
            - string
            - 'null'
          description: >-
            Advisory machine-readable reason for the current state (mirrors

            `discount_snapshots.state_reason` and `Receipt.state_reason`).


            **Emitted today:**

            - `premium_sanity` — engine NAV-sanity override: smoothed discount
            exceeded
              the premium-sanity bound, state forced to UNKNOWN (intrinsic anchor
              suspect).
            - `stale_source` — API layer: feed is >15 min stale, state collapsed
            to
              UNKNOWN; no fresh discount snapshot exists.

            **Reserved — not yet emitted (planned for depth-gate /
            oracle-crosscheck

            work):** `no_oracle_crosscheck | intrinsic_unavailable |
            shallow_market |

            nominal`.


            Omitted when null.
        updated_at:
          type: string
          format: date-time
          description: >-
            Timestamp the current snapshot was computed (the latest

            `discount_snapshots.ts`). Distinct from `since` (state-transition
            time):

            this is the FRESHNESS signal. The engine stops writing snapshots
            when a

            feed goes stale ("missing data is not confirming data" — H8), so a
            frozen

            `updated_at` is exactly how a stale/frozen feed surfaces on this
            endpoint.
    ApiError:
      type: object
      required:
        - error
        - message
      properties:
        asset:
          type:
            - string
            - 'null'
          description: The offending asset symbol, present only for asset-scoped errors.
        error:
          type: string
          description: Stable, machine-readable code. Branch on this, never on `message`.
        message:
          type: string
          description: >-
            Human-readable explanation. NOT stable — for humans/logs; do not
            parse.
    PegState:
      type: string
      description: >-
        Class-aware peg state. Mirrors the engine `PegState` enum and the

        `peg_state` Postgres enum. Used for `state`, `from_state`, and
        `to_state`

        fields across the API.


        The state is CLASS-AWARE: an LST reading a −1.4% discount (normal
        unstaking

        spread) is `PEGGED`, while a fiat stable at far less would be `DRIFT`.
        Trust

        this value directly rather than imposing a naive discount cut.
      enum:
        - PEGGED
        - DRIFT
        - DEPEG
        - CRITICAL
        - BLACK_SWAN
        - UNKNOWN

````