Skip to main content
GET
Get an asset's discount history

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. A window holding more rows than this comes back newest-first with truncated: true and next_from / next_to cursors for the next, older page (raw samples arrive every few seconds, so the default 24h window usually needs several pages, or bucket=1m with limit=1440).

Response

Time series of discount values, newest first (empty when the asset has no samples in the window)

List envelope: { ok, generated_at, count, data: [...] }.

count
integer
required

Number of items in data.

Required range: x >= 0
data
object[]
required
generated_at
string
required

RFC3339 (UTC, millisecond, Z) build time of this response.

ok
boolean
required

Always true on a 2xx; errors use the {error, message} envelope instead.

history_start
string | null

Time-series lists only (/v1/assets/{symbol}/history): RFC3339 of the earliest snapshot Pegana has stored for the asset. Nothing exists before it, so an empty or short window ending earlier is a data floor, not an absence of events. Omitted elsewhere.

next_from
string | null

Present only when truncated is true: the EFFECTIVE lower bound of this window (RFC3339, microsecond, Z), i.e. the from the request sent or the default it got (now minus 24h). Pass it back as from with next_to: the default from is Utc::now() - 24h, not to - 24h, so paging without from keeps from at now-24h and, once next_to is older than 24h, the request returns 400 invalid_range.

next_to
string | null

Present only when truncated is true: RFC3339 (microsecond, Z) instant just before the oldest row returned. Repeat the request with from=<next_from>&to=<next_to> (same bucket, limit) to get the next, older page; no row is skipped or repeated.

truncated
boolean | null

Time-series lists only (/v1/assets/{symbol}/history): true when the window holds more rows than limit, so data stops before from. Always present there (false when the window fit). Omitted elsewhere.