get https://api.syve.ai/v1/market-api/historical-pool-tvl
Return historical DEX Pool Total Value Locked (TVL) and Liquidity Information.
Method: GET
Endpoint: https://api.syve.ai/v1/market-api/historical-pool-tvl
Request Parameters
Name | Type(s) | Description |
---|---|---|
pool_address | string , required | The DEX pool address or list addresses for which to return TVL and liquidity information for. If making a GET request use a comma separated list to provide the list of addresses. If POST use a list in the request body.This is a required parameter. |
price_type | string , required | This parameter determines what price type to use when calculating dollar values in the response. The default is price_token_usd_robust_tick_1 . All possible options for price_type are given in the table below. |
interval | string | Determines the granularity of the data. The format should be <value><freq> , where freq can be, "m" (minutes), "h" (hours), or "d" (days).For example, "10m" would represent a 10-minute interval, and "1d" would represent a 1-day interval. The default value is "1d" (1 day). |
from_timestamp | integer | Return results whose timestamp are greater than or equal to the provided value.Default: 0 . |
until_timestamp | integer | Return results whose timestamp are less than or equal to the provided value.Default: The current timestamp (at the time the request is made). |
max_size | integer | The maximum number of records to return. Must be between 1 and 2500 . Default is 100 . |
order | string | The order in which data is returned. Valid options are desc and asc .If desc more recent data is returned first. If asc older data is returned first.Default: desc . |
Possible Price Types
The possible price types correspond to the prices returned by our DEX Trades table. Each price type corresponds to a different method of calculating price.
Price Type | Description |
---|---|
price_token_usd_tick_1 | The price at which a token was traded based on the most recent swap. |
price_token_usd_robust_tick_1 | The same as price_token_usd_tick_1 but with significant outliers removed. |
price_token_usd_robust_total_{1h|24h} | This provides the total price, in USD, based on both buy and sell trades executed in the last 1 or 24 hour(s). |
price_token_usd_robust_buy_{1h|24h} | This metric gives the total price, in USD, based solely on buy trades that have occurred in the last 1 or 24 hour(s). |
price_token_usd_robust_sell_{1h|24} | This shows the total price, in USD, accumulated from all sell trades in the last 1 or 24 hour(s). |
price_token_usd_robust_mid_{1h|24h} | The mid price is the average of the buy price and the sell price. |
Response Fields
Name | Type | Description |
---|---|---|
pool_address | integer | The block number (i.e. height) of the event log. |
token_0_address | string | The address of the first token that makes up the pool. |
token_1_address | string | The address of the second token that makes up the pool. |
timestamp | string | The time in Unix timestamp format. |
date | string | The time in ISO 8601 format. |
token_0_balance | double | The total amount of the first token in the pool. |
token_1_balance | double | The total amount of the second token in the pool. |
token_0_balance_usd | double | The value (in dollars) of the total amount of the first token in the pool. |
token_1_balance_usd | double | The value (in dollars) of the total amount of the second token in the pool. |
liquidity_usd | double | The USD value of the amount of WETH or stable coin that is in the pool. |
tvl_usd | double | The total dollar value locked in the pool. This equals to the token_0_balance_usd plus token_1_balance_usd . |
Example: Hourly TVL and liquidity of $WBTC
Try it out
In the Live Example section you can try out the request with different arguments.
Query
In the request below 0x4585fe77225b41b697c938b018e2ac67ac5a20c0
is the $WETH
DEX pool address of $WBTC
.
Example GET Request
Response
{
"pool_address": "0x4585fe77225b41b697c938b018e2ac67ac5a20c0",
"token_0_address": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
"token_1_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"data": [
{
"timestamp": 1704823200,
"date": "2024-01-09T18:00:00Z",
"token_0_balance": 108.455988,
"token_1_balance": 25902.525828178852,
"token_0_balance_usd": 5066969.015229834,
"token_1_balance_usd": 58679943.07389786,
"liquidity_usd": 58679943.07389786,
"tvl_usd": 63746912.0891277
},
{
"timestamp": 1704819600,
"date": "2024-01-09T17:00:00Z",
"token_0_balance": 102.07143072,
"token_1_balance": 26031.447794555592,
"token_0_balance_usd": 4790895.769629918,
"token_1_balance_usd": 58967636.98637878,
"liquidity_usd": 58967636.98637878,
"tvl_usd": 63758532.7560087
}
]
}
Live Example
Press Try It to make a request and see what the response looks like. Feel free to try different query parameters.