Token Aggregates (Bars)
Get token aggregates returns real-time or historical candlestick bars for a token.
Get Token Aggregates (Bars)
GEThttps://api.adesic.com/v2/dex/{exchange}/{blockchain}/token/{token}/aggregate?timeframe={interval}
Returns an object of real-time or historical candlesticks (bars) for a token on a decentralized exchange.
Path Parameters
| Name | Type | Description |
|---|---|---|
| exchange* | string | Decentralized exchange Id. |
| blockchain* | string | Blockchain that supports the decentralized exchange. |
| token | string | Token contract address. |
Query Parameters
| Name | Type | Description |
|---|---|---|
| apiKey* | string | Your Adesic API Key. |
| interval* | string | Aggregate bar size. hour or day. |
| limit | int | Number of results per request. Maximum 1,0000 (default 100). |
| orderBy | string | Sort the returned data by any field in the API response, such as id, name, symbol, volumeUSD and more. |
| orderDirection | string | asc or desc return the results sorted by that field in either ascending or descending order. |
| skip | int | Number of results to skip per request. |
| from | int | The start of the aggregate time window for historical data. Unix timestamp in milliseconds. |
| to | int | The end of the aggregate time window for historical data. Unix timestamp in milliseconds. |
200: OK Success
success-response.json
{
"timeframe": "day",
"id": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"TokenAggregates": [
{
"id": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2-19457",
"timestamp": 1681084800,
"priceUSD": "1861.812948948509109388355192853743",
"o": "1863.160356657281537768066137359126",
"h": "1863.160356657281537768066137359126",
"l": "1854.198335514748181373337243056372",
"c": "1861.812948948509109388355192853743",
"volume": "45669.177692851802160815",
"volumeUSD": "84911506.50161917605934414103318911",
"untrackedVolumeUSD": "84911506.50161917605934414103318911",
"totalValueLocked": "631521.957032934821587711",
"totalValueLockedUSD": "1175775757.14922204229657038017616",
"feesUSD": "136802.7673893035106587395801362141"
},
{
"id": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2-19456",
"timestamp": 1680998400,
"priceUSD": "1863.160356657281537768066137359126",
"o": "1853.838633116650036787389059651635",
"h": "1869.100132810398674639493628800632",
"l": "1832.845247207196123319380992497196",
"c": "1863.160356657281537768066137359126",
"volume": "183377.010533141634178776",
"volumeUSD": "338844982.527842179017489089242307",
"untrackedVolumeUSD": "338844982.527842179017489089242307",
"totalValueLocked": "630787.710476643156442134",
"totalValueLockedUSD": "1175258655.626692509388975773585923",
"feesUSD": "462630.7204260430184761393488914015"
}
]
}Copy & Paste Code
cURL
curl-example.sh
curl -H "api-key: API KEY" https://api.adesic.com/v2/dex/uniswap/ethereum/token/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/aggregate?timeframe=dayResponse Object
response-example.json
{
"timeframe": "day",
"id": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether",
"symbol": "WETH",
"TokenAggregates": [
{
"id": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2-19457",
"timestamp": 1681084800,
"priceUSD": "1861.812948948509109388355192853743",
"o": "1863.160356657281537768066137359126",
"h": "1863.160356657281537768066137359126",
"l": "1854.198335514748181373337243056372",
"c": "1861.812948948509109388355192853743",
"volume": "45669.177692851802160815",
"volumeUSD": "84911506.50161917605934414103318911",
"untrackedVolumeUSD": "84911506.50161917605934414103318911",
"totalValueLocked": "631521.957032934821587711",
"totalValueLockedUSD": "1175775757.14922204229657038017616",
"feesUSD": "136802.7673893035106587395801362141"
},
{
"id": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2-19456",
"timestamp": 1680998400,
"priceUSD": "1863.160356657281537768066137359126",
"o": "1853.838633116650036787389059651635",
"h": "1869.100132810398674639493628800632",
"l": "1832.845247207196123319380992497196",
"c": "1863.160356657281537768066137359126",
"volume": "183377.010533141634178776",
"volumeUSD": "338844982.527842179017489089242307",
"untrackedVolumeUSD": "338844982.527842179017489089242307",
"totalValueLocked": "630787.710476643156442134",
"totalValueLockedUSD": "1175258655.626692509388975773585923",
"feesUSD": "462630.7204260430184761393488914015"
}
]
}Response Attributes
| Attribute Name | Data Type | Description |
|---|---|---|
| timeframe | string | The Timeframe of the Aggregate bar (Hour or Day) |
| id | string | Token contact address |
| name | string | Token name |
| symbol | string | Token symbol |
| id | string | Id of the candlestick. |
| timestamp | int | Unix timestamp of the aggregate bar. |
| priceUSD | string | The price at the end of the period in USD |
| o | string | The opening price USD |
| h | string | The high price USD |
| l | string | The low price USD |
| c | string | The close price USD |
| volume | string | The volume in token units |
| volumeUSD | string | The volume in derived USD |
| untrackedVolumeUSD | string | The volume in USD even on pools with less reliable USD values |
| totalValueLocked | string | The liquidity across all pools in token units |
| totalValueLockedUSD | string | The liquidity across all pools in derived USD |
| feesUSD | string | The fees in USD |