Price of a token at a given timestamp.
This endpoint returns the price of a token at or before a given timestamp. If the token doesn’t have a price at the given timestamp (because there weren’t any trades at that time), the price will be the price at the closest timestamp before the given timestamp. UseDocumentation Index
Fetch the complete documentation index at: https://docs.allium.so/llms.txt
Use this file to discover all available pages before exploring further.
staleness_tolerance to specify the max lookback time for a price.
time_granularity is the size of the aggregation window over which we aggregate the price. It can be one of the following values: 15s, 1m, 5m, 1h, 1d.
Examples:
1h granularity, we will return the price at 3:00. Note that the price at 3:00 is the volume-weighted price of the token between 3:00 and 4:00.
5m granularity, we will return the price at 3:10 (aggregating the price of the token between 3:10 and 3:15).
| Granularity | Retention |
|---|---|
| 15s | 5 days |
| 1m | 30 days |
| 5m | 30 days |
| 1h | All |
| 1d | All |
staleness_tolerance is an optional string containing a number of seconds, minutes, hours, or days. Use this value to define the max lookback time for a price. For example: 60s, 5m, 2h, 2d.
Some lower volume tokens are often not traded for hours or days before trading starts again. In these instances, we do not return a price for periods of inactivity to prevent returning a stale price that doesn’t represent the actual value of a token.
To customize this behavior, you can use staleness_tolerance to define the max lookback time for a price.
| Time Granularity | Default Staleness Tolerance |
|---|---|
| 15s | 60s |
| 1m | 5m |
| 5m | 10m |
| 1h | 2h |
| 1d | 2d |
input_timestamp: The requested timestamp in the payloadprice_timestamp: The timestamp of the latest price found for the tokenList of token address+chain pairs
1 - 200 elementsTarget timestamp (UTC ISO 8601)
Candle granularity (15s, 1m, 5m, 1h, 1d)
15s, 1m, 5m, 1h, 1d Max lookback for price data (e.g. 1h, 30m)