Skip to main content
GET
/
v1
/
assets
/
{symbol}
/
history
Get an asset's discount history
curl --request GET \
  --url https://api.pegana.xyz/v1/assets/{symbol}/history
[
  {
    "discount": "<string>",
    "ts": "2023-11-07T05:31:56Z",
    "discount_raw": "<string>"
  }
]

Path Parameters

symbol
string
required

Asset symbol — case-insensitive

Query Parameters

bucket
string

raw (default) samples directly from discount_snapshots; 1m reads the 1-minute continuous aggregate so longer ranges stay cheap. Any other value is rejected with 400 rather than silently falling back to raw (QA B-020).

from
string<date-time>

Inclusive lower bound on ts. Defaults to now − 24 hours.

to
string<date-time>

Inclusive upper bound on ts. Defaults to now.

limit
integer<int64>

Page size, clamped to [1, 5000]. Default 500.

Response

Time series of discount values, newest first

discount
string
required

EWMA-smoothed discount (the value the state machine uses).

state
enum<string>
required

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.

Available options:
PEGGED,
DRIFT,
DEPEG,
CRITICAL,
BLACK_SWAN,
UNKNOWN
ts
string<date-time>
required
discount_raw
string | null

Raw discount sample (1 - market/intrinsic) before EWMA smoothing. None for bucket=1m because the continuous aggregate discount_1m only stores avg(discount_smooth). For bucket=raw, populated from discount_snapshots.discount_raw.