Skip to main content

Token Volume API

What you'll learn
  • How to fetch volume data for any token
  • Analyzing buy/sell ratios and volume trends
  • Calculate volume deltas and momentum
  • Convert lamports to SOL for better readability

Introduction

The Token Volume API enables you to retrieve and analyze trading volume data for any token. You can track buy/sell patterns, analyze volume trends across multiple timeframes, and monitor trading activity. All volume values are denominated in SOL and formatted in lamports (1 SOL = 1,000,000,000 lamports).

Access Requirements

Authentication

All requests require a Bearer token in UUID format:

Authorization: Bearer your-api-key-here

Base URL

https://api.callstaticrpc.com/pumpfun/v1

Data Structure

The API returns volume data with multiple time windows:

{
"success": true,
"data": {
"token": "BbB3bB7bB2bB9bB4bB8bB1bBb5bB2bB6bB3bB9bB4bB",
"name": "Sample Token",
"symbol": "STKN",
// Short-term volumes
"buy_volume_1m": "1000000000", // 1 SOL in buys last minute
"buy_volume_5m": "5000000000",
"buy_volume_15m": "15000000000",
"buy_volume_30m": "30000000000",
// Medium-term volumes
"buy_volume_1h": "60000000000",
"buy_volume_4h": "240000000000",
// Long-term volumes
"buy_volume_24h": "1440000000000",
"buy_volume_1w": "10080000000000",
// Sell volumes follow same pattern
"sell_volume_1m": "900000000",
"sell_volume_5m": "4500000000",
"sell_volume_15m": "13500000000",
"sell_volume_30m": "27000000000",
"sell_volume_1h": "54000000000",
"sell_volume_4h": "216000000000",
"sell_volume_24h": "1296000000000",
"sell_volume_1w": "9072000000000",
// Last trade timestamps
"last_buy_timestamp": 1679529600000,
"last_sell_timestamp": 1679529600000
}
}

Implementation

Here's how to implement volume analysis in your application:

import axios from 'axios';

interface TokenVolume {
token: string;
name: string;
symbol: string;
buy_volume_1m: string;
buy_volume_5m: string;
buy_volume_15m: string;
buy_volume_30m: string;
buy_volume_1h: string;
buy_volume_4h: string;
buy_volume_24h: string;
buy_volume_1w: string;
sell_volume_1m: string;
sell_volume_5m: string;
sell_volume_15m: string;
sell_volume_30m: string;
sell_volume_1h: string;
sell_volume_4h: string;
sell_volume_24h: string;
sell_volume_1w: string;
last_buy_timestamp: number;
last_sell_timestamp: number;
}

class VolumeAnalyzer {
private readonly LAMPORTS_PER_SOL = 1_000_000_000;

// Convert lamports string to SOL number
private lamportsToSol(lamports: string): number {
return parseInt(lamports) / this.LAMPORTS_PER_SOL;
}

// Calculate buy/sell ratio for a timeframe
calculateBuySellRatio(volume: TokenVolume, timeframe: string): number {
const buyKey = `buy_volume_${timeframe}` as keyof TokenVolume;
const sellKey = `sell_volume_${timeframe}` as keyof TokenVolume;

const buyVolume = this.lamportsToSol(volume[buyKey] as string);
const sellVolume = this.lamportsToSol(volume[sellKey] as string);

return sellVolume === 0 ? buyVolume : buyVolume / sellVolume;
}

// Calculate volume deltas between timeframes
calculateVolumeTrend(volume: TokenVolume): {
shortTerm: number; // 5m vs 1h
mediumTerm: number; // 1h vs 4h
longTerm: number; // 4h vs 24h
} {
return {
shortTerm: this.lamportsToSol(volume.buy_volume_5m) / 12 -
this.lamportsToSol(volume.buy_volume_1h) / 12,
mediumTerm: this.lamportsToSol(volume.buy_volume_1h) / 4 -
this.lamportsToSol(volume.buy_volume_4h) / 4,
longTerm: this.lamportsToSol(volume.buy_volume_4h) / 6 -
this.lamportsToSol(volume.buy_volume_24h) / 6
};
}

// Analyze overall volume momentum
analyzeVolumeMomentum(volume: TokenVolume): {
momentum: 'increasing' | 'decreasing' | 'stable';
strength: number;
} {
const trends = this.calculateVolumeTrend(volume);
const avgTrend = (trends.shortTerm + trends.mediumTerm + trends.longTerm) / 3;

return {
momentum: avgTrend > 0.1 ? 'increasing' :
avgTrend < -0.1 ? 'decreasing' : 'stable',
strength: Math.abs(avgTrend)
};
}

// Get time since last trade
getTimeSinceLastTrade(volume: TokenVolume): {
lastBuy: number;
lastSell: number;
} {
const now = Date.now();
return {
lastBuy: now - volume.last_buy_timestamp,
lastSell: now - volume.last_sell_timestamp
};
}

}

Analysis Techniques

1. Volume Ratios

Compare buy and sell volumes to identify trading patterns:

  • Buy/Sell ratio > 1: More buying pressure
  • Buy/Sell ratio < 1: More selling pressure
  • Track ratios across timeframes to spot trends

2. Volume Deltas

Calculate volume changes between timeframes:

  • Short-term: 5m vs 1h (normalized)
  • Medium-term: 1h vs 4h (normalized)
  • Long-term: 4h vs 24h (normalized)

3. Volume Momentum

Analyze volume trends to determine market momentum:

  • Increasing: Higher recent volume
  • Decreasing: Lower recent volume
  • Stable: Consistent volume

4. Trade Timing

Monitor time since last trades:

  • Recent trades indicate active trading
  • Long gaps may indicate low liquidity
  • Compare buy vs sell timing patterns

Error Handling

The API returns standard HTTP status codes:

Status CodeDescription
200Successful response
400Bad request
401Unauthorized - Invalid or missing bearer token
500Internal server error
Real-time Updates

For real-time volume updates, check out our WebSocket Streams API documentation.

Need Help?

For additional support: