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 trading volume data for a token across different exchanges. Three functions are available: aggregated volume by exchange, historical volume feed per exchange, and transfer volume.
SDK Methods
getVolumeByExchange
Get aggregated volume distribution across exchanges for a date range.
getVolumeByExchange (
tokenAddress : string ,
simpleProps : SimpleFeedProps ,
options ?: AvnuOptions
): Promise < ExchangeRangeDataPoint [] >
getExchangeVolumeFeed
Get historical volume data over time with configurable resolution, broken down by exchange.
getExchangeVolumeFeed (
tokenAddress : string ,
feedProps : FeedProps ,
options ?: AvnuOptions
): Promise < ExchangeDataPoint [] >
getTransferVolumeFeed
Get historical transfer volume (all on-chain transfers, not just DEX trades).
getTransferVolumeFeed (
tokenAddress : string ,
feedProps : FeedProps ,
options ?: AvnuOptions
): Promise < DataPointWithUsd [] >
Parameters
Date range configuration ONE_HOUR, ONE_DAY, ONE_WEEK, ONE_MONTH, ONE_YEAR
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
// getVolumeByExchange response
interface ExchangeRangeDataPoint {
value : number ;
valueUsd : number ;
exchange : string ;
startDate : string ;
endDate : string ;
}
// getExchangeVolumeFeed response
interface ExchangeDataPoint {
date : string ;
value : number ;
valueUsd : number ;
exchange : string ;
}
// getTransferVolumeFeed response
interface DataPointWithUsd {
date : string ;
value : number ;
valueUsd : number ;
}
Examples
Volume by Exchange
Historical Volume Feed
Transfer Volume
import { getVolumeByExchange , FeedDateRange } from '@avnu/avnu-sdk' ;
const ETH = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7' ;
const volumeData = await getVolumeByExchange (
ETH ,
{ dateRange: FeedDateRange . ONE_WEEK }
);
// Each entry represents an exchange's volume for the period
volumeData . forEach ( item => {
console . log ( ` ${ item . exchange } : $ ${ item . valueUsd . toLocaleString () } ` );
console . log ( ` Period: ${ item . startDate } to ${ item . endDate } ` );
});
// Calculate total volume
const totalVolume = volumeData . reduce (( sum , item ) => sum + item . valueUsd , 0 );
console . log ( `Total Volume: $ ${ totalVolume . toLocaleString () } ` );
Get TVL Data Get liquidity data by exchange
API Reference REST API endpoint