Reference

Conversion rate between two coins as of a past moment

How many units of to_coin_iso one unit of from_coin_iso was worth on the UTC day of timestamp.

The figure comes from PublicAML's own daily price series (the one the risk engine values transfers with): one USD quote per token per day derived from on-chain swaps, and exchange closes for BTC. No vendor ticker is involved, so a transfer priced with this endpoint carries the same value the screening endpoints report.

Granularity is a day, never a minute. rate is a float; rate_e8 is the same number scaled by 10^8 as an integer string for callers that keep rates as integers. fallback is null when both sides had a quote for that exact day, otherwise it names what was done instead: nearest_day (a quote from up to 7 days earlier; the leg's day_gap says how many), stable_peg (a stablecoin with no quote in reach, pinned at 1 USD), or both joined with +. legs.from / legs.to show the USD value, the day and the source series of each side.

Symbols are coin tickers (BTC, ETH, USDT, USDC, TRX, BNB, LINK, …), not networks; USD is accepted as the fiat unit. An unknown symbol answers 400 with the supported list; a day before any market answers 404.

Served at https://intelapi.publicaml.org/v1/rate-at and available only with an API key (X-API-Key) or a signed request; without one the answer is 401.

post/v1/rate-at

Request

  • Base URL: https://intelapi.publicaml.org
  • URL: https://intelapi.publicaml.org/v1/rate-at
  • Auth: one of:
    • API key in header X-API-Key
    • none

Request body

from_coin_isostring required

Coin ticker, case-insensitive, e.g. BTC.

to_coin_isostring required

Coin ticker or USD.

Response

The rate for that day.

from_coin_isostring
to_coin_isostring
requested_atinteger

The timestamp as unix seconds.

requested_at_isostring
daystring

UTC day the rate is for, YYYY-MM-DD.

ratenumber

Units of to_coin_iso per one from_coin_iso.

rate_e8string

rate × 10^8, integer as a string.

inverse_ratenumber
granularity'day'
fallbackstring nullable

null, nearest_day, stable_peg or nearest_day+stable_peg.

legsobject

from and to, each {coin, usd, basis (market | pinned | stable_peg | usd), day, day_gap, source {chain, token, kind, quote_asset, swap_txs}}. basis pinned is a stablecoin the price series itself anchors at 1 USD; unlike stable_peg it is a stored row, not a fallback.

source'publicaml:token_price'

Changes

No recorded changes to this operation across all 1 revision of this API.