API Reference

Return DEX Pool Total Value Locked (TVL) and Liquidity Information for up to 1,000 pools in a single request.

Log in to see full request history

Method: GET or POST

Endpoint: https://api.syve.ai/v1/market-api/batch-latest-pool-tvl

📘

Fetching 1,000 tokens in a single request

You have to use a POSTrequest. GET requests are limited to 25 addresses per request. Look at the example at the bottom of this page for how to construct a POST request.

Request Parameters

NameType(s)Description
pool_addressstringThe 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_typestringThe type of price to use to calculate TVL and liquidity.

The default is price_token_usd_tick_1. All possible options for price_type are given in the table below.
timestampintegerThe time (Unix timestamp format) at which to return TVL and liquidity information for.

The default is the current time.

📘

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 TypeDescription
price_token_usd_tick_1The price at which a token was traded based on the most recent swap.
price_token_usd_robust_tick_1The 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

NameTypeDescription
pool_addressintegerThe block number (i.e. height) of the event log.
block_numberintegerThe block number of the most recent swap in the pool.
timestampstringThe time (in Unix timestamp format) of the most recent swap in the pool.
token_0_addressstringThe address of the first token that makes up the pool.
token_1_addressstringThe address of the second token that makes up the pool.
token_0_balancedoubleThe total amount of the first token in the pool.
token_1_balancedoubleThe total amount of the second token in the pool.
token_0_price_usddoubleThe dollar price at timestamp of the first token in the pool used to calculate token_0_balance_usd. Note: This depends on the providedprice_type.
token_1_price_usddoubleThe dollar price at timestamp of the second token in the pool used to calculate token_1_balance_usd. Note: This depends on the provided price_type.
token_0_balance_usddoubleThe value (in dollars) of the total amount of the first token in the pool.
token_1_balance_usddoubleThe value (in dollars) of the total amount of the second token in the pool.
tvl_usddoubleThe total dollar value locked in the pool. This equals to the token_0_balance_usd plus token_1_balance_usd.
liquidity_usddoubleThe USD value of the amount of WETH or stable coin that is in the pool.

Example: Latest TVL and liquidity for the $UNIBOT and $PEPE pools

📘

Try it out

In the Live Example section you can try out the request with different arguments.

Query

In the requests below 0x8dbee21e8586ee356130074aaa789c33159921ca is the DEX pool address of $UNIBOT and 0x11950d141ecb863f01007add7d1a342041227b58 of $PEPE.

Example GET Request

Request: https://api.syve.ai/v1/market-api/batch-latest-pool-tvl?pool_address=0x8dbee21e8586ee356130074aaa789c33159921ca,0x11950d141ecb863f01007add7d1a342041227b58

Example POST Request

curl --location --request POST 'https://api.syve.ai/v1/market-api/batch-latest-pool-tvl' \ --header 'Content-Type: application/json' \ --data '{ "pool_address": [ "0x8dbee21e8586ee356130074aaa789c33159921ca", "0x11950d141ecb863f01007add7d1a342041227b58" ] }'

Try in Postman: https://www.postman.com/dark-equinox-191074/workspace/syve-examples/request/11895150-1f34530a-b626-40aa-b631-49706120a272?ctx=documentation

Response

{ "data": [ { "pool_address": "0x8dbee21e8586ee356130074aaa789c33159921ca", "block_number": 18920667, "timestamp": 1704210287, "token_0_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "token_1_address": "0xf819d9cb1c2a819fd991781a822de3ca8607c3c9", "token_0_balance": 1420.1199337347089, "token_1_balance": 50603.903837071055, "token_0_price_usd": 2366.0138813173976, "token_1_price_usd": 66.45279087555019, "token_0_balance_usd": 3360023.476351864, "token_1_balance_usd": 3362770.639171335, "tvl_usd": 6722794.115523199, "liquidity_usd": 3360023.476351864 }, { "pool_address": "0x11950d141ecb863f01007add7d1a342041227b58", "block_number": 18920625, "timestamp": 1704209783, "token_0_address": "0x6982508145454ce325ddbe47a25d4ec3d2311933", "token_1_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "token_0_balance": 1724367966429.7976, "token_1_balance": 415.95220456812643, "token_0_price_usd": 1.369113911645586e-06, "token_1_price_usd": 2366.0138813173976, "token_0_balance_usd": 2360856.1716350447, "token_1_balance_usd": 984148.689972761, "tvl_usd": 3345004.861607806, "liquidity_usd": 984148.689972761 } ] }

Live Example

Press Try It to make a request and see what the response looks like. Feel free to try different query parameters.

Query Params
string
Defaults to 0xf819d9cb1c2a819fd991781a822de3ca8607c3c9,0x6982508145454ce325ddbe47a25d4ec3d2311933
string
Defaults to price_token_usd_tick_1
Language
Click Try It! to start a request and see the response here!