Token ATH API
Compute a token's all-time-high price on demand, over JSON-RPC, without Triport storing any price history. A vector-based "centering" method narrows from coarse on-chain samples to the exact peak trade and returns its price, block, timestamp and transaction. Because nothing is stored and the peak is reconstructed live, a result can carry a small margin of error unless it is marked
exact— see Accuracy. EVM chains only (Ethereum, BNB Smart Chain, Base, Polygon, Robinhood Chain); submit a job, then poll for the result.
- Method / Endpoint
- JSON-RPC on
https://triport.io/rpc/{chain}:triport_getTokenATH(submit),triport_getTokenATHResult(poll) - Network
- EVM only:
eth,bsc,base,polygon,robinhood - Authentication
x-token: $TRIPORT_API_KEYheader (orAuthorization: Bearer); see Authentication- Access
- A paid plan; two rate categories,
ath_compute(submit) andath_poll(poll). No daily quota, no credits, no per-call weight - Default budget
- 400 (range 100–400)
What it is for
The Token ATH API answers one question: what was the highest price a token ever traded at, and when. It computes the answer when you ask, straight from the chain, and keeps nothing — there is no history database behind it and no backfill to wait on. Give it a token (or a specific pool) on an EVM chain and it returns the peak trade: its price in the pool's quote asset, the block, the timestamp and the transaction hash.
Typical uses:
- Pricing and valuation. Anchor a position, a portfolio mark or a report to a token's real peak instead of a guessed round number.
- Analytics and dashboards. Add an ATH column to a token list without running your own archive indexer.
- Risk and drawdown. Measure how far a token sits below its all-time high, or flag a fresh peak.
Because the answer is computed per request, the call is asynchronous: triport_getTokenATH submits a job and returns a job_id; triport_getTokenATHResult returns the result once it is ready. The full method shapes, parameters, result schema, states and errors are in the method reference; runnable curl is in code examples.
How it computes an all-time high
Scanning every historical trade of a token is expensive — on some chains deep log history is served only in very small block windows — so the API does not do that unless it has to. Instead it centers on the peak:
- Coarse point prices. Read the pool's state (reserves for v2-style constant-product pools, the active tick for v3-style concentrated-liquidity pools) at a spread of historical blocks — one call per sample.
- Interval signals. Between two blocks, a v2-style pool's cumulative-price accumulators give the time-weighted average price (TWAP) for that interval, and a v3-style pool's fee-growth accumulators are proportional to the volume traded in it. These catch intervals where the price was high even when no sample landed on them.
- Narrowing. The best-looking intervals are split and re-sampled, concentrating work where the peak is likely to be.
- Exact window. In the final narrow windows, a short
eth_getLogspass over the swap events reads the exact price of each trade and finds the peak trade precisely.
If a token has few trades, the API skips straight to an exact pass over its whole life. The budget parameter caps how many RPC calls the search may spend: a higher budget looks harder and is more likely to resolve the peak exactly, a lower budget returns sooner. The result's status tells you which you got — exact (the peak trade was read directly from logs) or estimated (the peak comes from the sampled/TWAP search).
Pool mode and token mode
You can target the computation two ways:
- Pool mode. Pass
pool.addresswith the address of a specific AMM pool to measure. The API computes the ATH for that pool directly. Use this when you want one particular venue. - Token mode. Pass
tokenand let the API pick the pool: it enumerates the token's pools across the known DEX factories and measures the one with the greatest liquidity (depth). The pool it resolved to is reported back in the result. If a token has no pool the API can identify on a supported DEX, it returnspool_selection_incomplete— use pool mode with an explicitpool.addressfor that token, or whenever you want a specific pool rather than the deepest one.
Either way, the resolved pool is reported back in the result (its DEX, factory and quote asset), and the ATH is the peak in that pool's quote asset — the API does not silently convert to USD. The reported peak is a real observed trade in the measured pool, not a token-global figure across every venue; the result carries warnings (such as not_token_global_ATH) that say so.
Timing
The job runs in the background. A token that was computed recently comes back quickly; a cold token with a long, busy history can take up to about 15 minutes to resolve, though most finish well before that. triport_getTokenATH returns a poll_after_s hint telling you how long to wait before the first poll; keep polling triport_getTokenATHResult with the job_id until status is no longer pending, and set a generous client timeout. Do not poll in a tight loop — each poll counts against the ath_poll rate category.
Access and limits
- Plan. The Token ATH API is a paid-plan feature. Plan prices are on Triport pricing.
- Rate categories. Two per-second categories gate it:
ath_computefor submitting a job withtriport_getTokenATH, andath_pollfortriport_getTokenATHResult. Over a category's limit you get the standard rate-limit response; see rate limits and tiers. - No quota or credits. There is no daily or monthly job quota and no compute-unit accounting — the only limits are the two per-second rate categories.
- Chains. EVM chains only:
eth,bsc,base,polygon,robinhood. A non-EVM or unknown chain is rejected; a chain whose backing is temporarily unavailable returnsath_chain_unavailable.
Honest limits
- It is a computed estimate unless marked
exact. Anestimatedresult is a heuristic from sampling, not a calibrated probability. Readstatusand thewarnings. - It is per pool, not token-global. The peak is the highest trade in the resolved pool and quote asset, not a cross-venue, cross-quote global maximum.
- Token mode picks the deepest pool. It measures the token's most-liquid pool, which may not be the venue you had in mind; name the pool with
pool.addressto measure a specific one. - Short-lived spikes. A one-block wick can be real or noise (a sandwich, a single trade in a thin pool). The exact-window pass reports the peak trade as it happened; judge thin-pool spikes with care.
Accuracy
Triport stores no price history. There is no database of past prices behind this API — every answer is reconstructed on demand, from the chain, using the vector-based centering method above. That design is what keeps it instant to query on any token without a backfill, and it is also why accuracy depends on how the result was reached:
exactresults are read, not estimated. Whenstatusisexact, the peak price comes from the actual swap events in the final narrow window (eth_getLogs), so it is the real trade — subject only to normal chain/reorg caveats.estimatedresults can carry a margin of error. Whenstatusisestimated, the peak comes from the coarse point-price and TWAP/fee-growth sampling without a direct read of every trade. The true peak may sit between samples, so the figure can be slightly off — it is a close reconstruction, not a guaranteed maximum. Thewarningsfield flags what reduced confidence.- The
budgetis your accuracy knob. A higher budget (up to 400) spends more RPC calls, samples more finely and is more likely to resolve the peakexact; a lower budget returns faster with a looserestimatedfigure. For the tightest answer, use the full budget, and use pool mode to pin the exact pool.
Do not treat an estimated ATH as a settlement-grade or audited number. It is built for pricing, analytics and risk signals, where a small, disclosed margin is acceptable; when you need the exact peak trade, check that status is exact.
Related
- Method reference: the two methods, parameters, result schema, states and errors.
- Code examples: submit a job and poll for the result in curl.
- Ethereum JSON-RPC: the canonical chain reads the ATH computation is built on.
- Token ATH API product page: use cases, plans and FAQ.
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.
Terms on this page: JSON-RPC.