Token ATH API: on-demand all-time-high price, no stored history
Last updated:
Finding the peak by centering
Triport computes a token’s all-time high on demand, without storing full history: a coarse point-price scan, then a window that narrows round by round onto the exact peak trade.
What teams use it for
- Pricing and valuation. Anchor a mark, a position or a report to a token's real peak instead of a guessed round number.
- Analytics and dashboards. Add an all-time-high column to a token list without running your own archive indexer or history store.
- Risk and drawdown. Measure how far a token sits below its all-time high, or flag a new peak.
How it works
Scanning every historical trade is expensive, so the API centers on the peak: it reads pool state at a spread of historical blocks, scores intervals with v2-style cumulative-price (TWAP) and v3-style fee-growth signals, narrows onto the likely peak, and reads the exact peak trade from a short swap-log pass. The computation is Triport's own, on top of our EVM archive reads — there is no third-party history feed behind it. The budget parameter (100–400, default 400) trades accuracy against work.
Submit, then poll
# 1) submit (pool mode = the reliable path)
curl -X POST https://triport.io/rpc/eth \
-H "x-token: $TRIPORT_API_KEY" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"triport_getTokenATH",
"params":[{"chain":"eth","pool":{"address":"0x…"},"budget":400}]}'
# -> {"result":{"job_id":"ath_01J…","status":"pending","poll_after_s":5}}
# 2) poll until status is "estimated" or "exact"
curl -X POST https://triport.io/rpc/eth \
-H "x-token: $TRIPORT_API_KEY" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"triport_getTokenATHResult","params":["ath_01J…"]}'The full parameters, result schema and errors are in the method reference; copy-paste curl, JavaScript and Python are in the code examples.
What it does not do
- EVM only. Ethereum, BNB Smart Chain, Base, Polygon and Robinhood Chain. Non-EVM chains are not supported.
- Per pool, not token-global. The peak is the highest trade in the resolved pool and its quote asset, not a cross-venue, cross-quote maximum; the result says so in its scope and warnings.
- Token mode picks the deepest pool. It measures the token's most-liquid pool, which may not be the venue you meant; name the pool with
pool.addressto measure a specific one. A token with no identifiable pool returnspool_selection_incomplete. - Estimated unless marked exact — we store no history. Triport keeps no price database; every ATH is reconstructed on demand with the vector centering method, so an
estimatedresult can carry a small margin of error (the true peak may sit between samples).exactmeans the peak trade was read directly from swap logs. A higherbudgettightens the estimate. Readstatusandwarnings. - No quote conversion. The price is in the pool's quote asset as an exact rational (numerator / denominator), not pre-converted to USD.
Plans
The Token ATH API is a paid-plan feature. It is gated by plan tier and two per-second rate categories, ath_compute (submit) and ath_poll (poll) — no daily quota, no credits, no per-call weight. Plan prices are on Triport pricing.
FAQ
- What is the Token ATH API?
- A JSON-RPC pair on https://triport.io/rpc/{chain} — triport_getTokenATH submits a job, triport_getTokenATHResult polls for it — that computes a token's all-time-high price on demand, straight from the chain. Triport stores no price history: every answer is computed when you ask, using the same API key as Triport RPC.
- How is the all-time high computed without stored history?
- By 'centering' on the peak instead of scanning every trade. The API reads pool state at a spread of historical blocks, uses v2-style cumulative-price (TWAP) and v3-style fee-growth accumulators to score intervals, narrows onto the likely peak, then reads the exact peak trade from a short swap-log pass. The budget parameter (100–400, default 400) caps how hard it searches.
- Which chains are supported?
- EVM chains only: Ethereum, BNB Smart Chain, Base, Polygon and Robinhood Chain. Non-EVM chains are not supported. A chain whose backing is temporarily unavailable returns ath_chain_unavailable.
- Should I use pool mode or token mode?
- Token mode (pass token) picks the token's most-liquid pool for you and is the usual path. Pool mode (pass pool.address) measures one specific venue — use it when you want a particular pool rather than the deepest one, or for the rare token where the API finds no identifiable pool and returns pool_selection_incomplete.
- Is the result exact?
- The result's status says so: 'exact' means the peak trade was read directly from swap logs; 'estimated' means it comes from the sampled search and is a heuristic, not a calibrated probability. The peak is the highest trade in the resolved pool and its quote asset — per pool, not a token-global figure across every venue.
- How long does a job take, and what does it cost?
- The job runs in the background; a recently computed token returns quickly, while a cold token with long history can take up to about 15 minutes. Access is a paid-plan feature gated by two per-second rate categories, ath_compute (submit) and ath_poll (poll). There is no daily quota and no credits.