Documentation Index Fetch the complete documentation index at: https://docs.avnu.fi/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Get TVL (Total Value Locked) data for a token across different exchanges. Two functions are available: TVL snapshot by exchange at a specific date and historical TVL feed.
SDK Methods
getTVLByExchange
Get TVL snapshot distribution across exchanges at a specific date.
getTVLByExchange (
tokenAddress : string ,
simpleDateProps : SimpleDateProps ,
options ?: AvnuOptions
): Promise < ExchangeDataPoint [] >
getExchangeTVLFeed
Get historical TVL data over time with configurable resolution.
getExchangeTVLFeed (
tokenAddress : string ,
feedProps : FeedProps ,
options ?: AvnuOptions
): Promise < ExchangeDataPoint [] >
Parameters
Date configuration for snapshot Optional date for snapshot (defaults to current date). Can be ISO 8601 string or Date object.
Feed configuration with resolution ONE_HOUR, ONE_DAY, ONE_WEEK, ONE_MONTH, ONE_YEAR
ONE_MIN, FIVE_MIN, FIFTEEN_MIN, HOURLY, FOUR_HOUR, DAILY, WEEKLY
Returns
interface ExchangeDataPoint {
date : string ;
value : number ;
valueUsd : number ;
exchange : string ;
}
Examples
TVL Snapshot by Exchange
Historical TVL Snapshot
Historical TVL Feed
import { getTVLByExchange } from '@avnu/avnu-sdk' ;
const USDC = '0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8' ;
// Get current TVL snapshot (no date = now)
const tvlData = await getTVLByExchange ( USDC , {});
// Calculate total TVL and display distribution
const totalTvl = tvlData . reduce (( sum , item ) => sum + item . valueUsd , 0 );
tvlData
. sort (( a , b ) => b . valueUsd - a . valueUsd )
. forEach ( item => {
const share = ( item . valueUsd / totalTvl ) * 100 ;
console . log ( ` ${ item . exchange } : $ ${ item . valueUsd . toLocaleString () } ( ${ share . toFixed ( 1 ) } %)` );
});
Get Volume Data Get trading volume by exchange
API Reference REST API endpoint