Token ATH API method reference
The two JSON-RPC methods of the Token ATH API —
triport_getTokenATH(submit a job) andtriport_getTokenATHResult(poll for the result) — with their parameters, the result schema, the job states and the errors.
Both methods are JSON-RPC 2.0 calls, POSTed to https://triport.io/rpc/{chain} where {chain} is one of eth, bsc, base, polygon, robinhood. Authenticate with the x-token header (or Authorization: Bearer). See the Token ATH API overview for how the computation works, access and timing.
The pair is asynchronous: submit once with triport_getTokenATH, keep the returned job_id, then poll triport_getTokenATHResult until the job is no longer pending.
Submit a job: triport_getTokenATH
Starts an ATH computation and returns immediately with a job handle. Counts against the ath_compute rate category.
Request parameters
A single object as params[0]:
| Field | Type | Required | Description |
|---|---|---|---|
chain | string | yes | EVM chain id: eth, bsc, base, polygon or robinhood. Must match the chain in the URL path. |
token | string | one of token / pool | Token contract address (0x + 40 hex). Token mode — the API picks the token's most-liquid pool automatically (see below). |
pool | object | one of token / pool | Pool mode — {"address":"0x…"}, the specific AMM pool to measure. The reliable path; use it when you know the pool. |
budget | integer | no | RPC-call budget for the search, 100–400. Default 400. Higher spends more work and is more likely to return status: exact; lower returns sooner. |
quote | string | no | Optional quote-asset hint (address or symbol) when a pool trades against more than one quote. Omit to let the API resolve it. |
Supply exactly one of token or pool. The ATH is always computed in the resolved pool's quote asset; the API does not convert to USD.
What submit returns
{
"job_id": "ath_01JBRK8Q0C7E3M9W2ZP",
"status": "pending",
"poll_after_s": 5
}| Field | Type | Description |
|---|---|---|
job_id | string | Opaque handle to poll with. |
status | string | pending at submit (a recently computed token may return a terminal status immediately). |
poll_after_s | integer | Seconds to wait before the first poll. |
Poll for the result: triport_getTokenATHResult
Returns the current state of a job, and the ATH once it is ready. Counts against the ath_poll rate category. Poll no sooner than poll_after_s, then at a steady interval — not in a tight loop.
Poll parameters
The job_id, either positionally or as an object:
params: ["ath_01JBRK8Q0C7E3M9W2ZP"]
params: [{ "job_id": "ath_01JBRK8Q0C7E3M9W2ZP" }]Result states
The status field is the first thing to read:
status | Meaning | Next step |
|---|---|---|
pending | Still computing. | Poll again after a short wait. |
estimated | Done. The peak comes from the sampled / TWAP search, not a direct log read — a heuristic, not a calibrated probability. | Use it; check warnings. |
exact | Done. The peak trade was read directly from swap logs in the narrowed window. | Use it. |
A terminal result (estimated or exact) carries the full payload below. A failed job returns an error instead (see Errors).
Result schema
Illustrative shape of a terminal result (values differ per token; long fields shortened):
{
"job_id": "ath_01JBRK8Q0C7E3M9W2ZP",
"status": "exact",
"chain": "eth",
"scope": "configured factories; configured wrapped-native/stable quotes; gross token Swap volume creation to head",
"pool": {
"address": "0x…",
"dex": "uniswap-v3",
"factory": "0x…",
"quote": "0x…"
},
"ath_trade": {
"price": { "numerator": "…", "denominator": "…" },
"block": 18650000,
"timestamp": "2026-03-14T08:21:47Z",
"tx": "0x…"
},
"snapshot": { "head_block": 21000000, "budget": 400, "total_calls": 318 },
"warnings": ["not_token_global_ATH"]
}| Field | Type | Description |
|---|---|---|
status | string | estimated or exact (see Result states). |
scope | string | Plain-text statement of what was searched: which factories, which quote assets, and the volume basis. The peak is within this scope, not token-global. |
pool | object | The resolved pool: its address, dex family, factory and the quote asset the price is denominated in. In token mode this is the pool the API selected. |
ath_trade.price | object | The peak price as an exact rational: numerator / denominator (strings). Keep them as strings and divide with arbitrary precision; a pre-divided float would lose precision. |
ath_trade.block | integer | Block of the peak trade. |
ath_trade.timestamp | string | UTC timestamp of that block. |
ath_trade.tx | string | Transaction hash of the peak trade. |
snapshot | object | Context for the run: the head_block the search ended at, the budget used and the total_calls spent. |
warnings | array | Zero or more honesty flags, e.g. not_token_global_ATH (peak is per-pool, not cross-venue) and uncalibrated_sampling_estimate (present on estimated results). |
Prices are strings/rationals, not numbers. Parse them with arbitrary precision.
Errors
JSON-RPC errors (in the error object) and the conditions that produce them:
| Condition | error | Meaning | What to do |
|---|---|---|---|
| Token-mode pool selection | pool_selection_incomplete | The API found no pool it can identify on a supported DEX for this token. | Retry in pool mode with an explicit pool.address. |
| Service busy | ath_busy | ATH compute capacity is saturated right now; the job was not accepted. | Back off and retry later. |
| Chain unavailable | ath_chain_unavailable | The backing for this chain is temporarily unavailable. | Retry later; try another supported chain if appropriate. |
| Bad input | invalid_request | Missing/!EVM chain, both or neither of token/pool, budget out of 100–400, malformed address. | Fix the request. |
| Auth | unauthorized | Missing or invalid API key. | Send a valid x-token. |
| Plan | tier_insufficient | The plan does not include the Token ATH API. | Upgrade; see pricing. |
| Rate | rate_limited | Over the ath_compute or ath_poll per-second limit. | Wait and retry; see rate limits and tiers. |
| Unknown job | not_found | The job_id is unknown or has expired. | Submit a new job. |
A job that fails after it was accepted reports its error through triport_getTokenATHResult rather than at submit. See code examples for a submit-then-poll loop that branches on these.
Terms on this page: JSON-RPC.