Cambrian V2 - Pool Volume API

By Cambrian Network evm

GET /api/v1/evm/aero/v2/pool-volume

Aerodrome Pool Volume

Retrieves comprehensive trading volume metrics for a specific Aerodrome V2 pool, including 24-hour volume data, hourly breakdown, swap statistics, and detailed transaction information.

Business Value

  • Real-time Trading Analytics: Monitor pool activity and trading patterns in real-time for informed decision making
  • Volume Trend Analysis: Track hourly volume patterns to identify peak trading times and market activity cycles
  • Liquidity Pool Performance: Assess pool health through swap counts, average transaction sizes, and volume changes
  • Large Transaction Monitoring: Identify significant trades and their impact on pool dynamics
  • Cross-Token Volume Insights: Understand directional trading flows between token pairs within the pool

Endpoint Details

URL:

https://opabinia.cambrian.network/api/v1/evm/aero/v2/pool-volume

Method: GET
Authentication: Required via X-API-Key header

Query Parameters

Parameter Type Required Default Description
pool_address String Yes - Pool address with 0x prefix (pattern: ^0x[a-fA-F0-9]{40}$)

Response Field Descriptions

Response Field Type Description
poolId String The pool contract address identifier
timeframeAt String Time period for the volume calculation (e.g., "24h")
volumeUSD Float64 Total trading volume in USD over the timeframe
volumeToken0 String Trading volume for the first token in the pair
volumeToken1 String Trading volume for the second token in the pair
volumeChange Float64 Percentage change in volume compared to previous period
swapCount UInt64 Total number of swaps/trades executed in the timeframe
averageSwapSize Float64 Average transaction size in USD
volumeByHour Array Hourly breakdown of volume and swap counts with timestamps
volumeByToken Map Volume distribution by trading direction (token0 to token1 vs token1 to token0)
largestSwaps Array Details of the largest transactions including amounts and transaction hashes
updatedAt UInt32 Unix timestamp of when the data was last updated

Examples

1. Get Aerodrome Pool Volume Metrics

Retrieve comprehensive volume data for a specific Aerodrome V2 pool including trading activity and swap statistics.

curl -X GET "https://opabinia.cambrian.network/api/v1/evm/aero/v2/pool-volume?pool_address=0x6cdcb1c4a4d1c3c6d054b27ac5b77e89eafb971d" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response:

[
  {
    "columns": [
      {"name": "poolId", "type": "String"},
      {"name": "timeframeAt", "type": "String"},
      {"name": "volumeUSD", "type": "Float64"},
      {"name": "volumeToken0", "type": "String"},
      {"name": "volumeToken1", "type": "String"},
      {"name": "volumeChange", "type": "Nullable(Float64)"},
      {"name": "swapCount", "type": "UInt64"},
      {"name": "averageSwapSize", "type": "Float64"},
      {"name": "volumeByHour", "type": "Array(Map(String,String))"},
      {"name": "volumeByToken", "type": "Map(String,String)"},
      {"name": "largestSwaps", "type": "Array(Map(String,String))"},
      {"name": "updatedAt", "type": "UInt32"}
    ],
    "data": [
      [
        "0x6cdcb1c4a4d1c3c6d054b27ac5b77e89eafb971d",
        "24h",
        1240702.5463123259,
        "1856192.314127",
        "2688284.381664269",
        19.45,
        4459,
        278.25,
        [
          {"'swapCount'": "241", "'timestamp'": "1769522400", "'volumeUSD'": "86848.69268581805"},
          {"'swapCount'": "158", "'timestamp'": "1769526000", "'volumeUSD'": "51189.32608759285"},
          {"'swapCount'": "283", "'timestamp'": "1769529600", "'volumeUSD'": "72085.8799191756"}
        ],
        {"'token0Percentage'": "0", "'token0ToToken1'": "0", "'token1Percentage'": "100", "'token1ToToken0'": "1240702.5463123259"},
        [
          {"'amountToken0'": "0", "'amountToken1'": "52911.52598719457", "'amountUSD'": "24419.836483572435", "'timestamp'": "1769533929", "'txHash'": "0x663fad7cf103b64e451e070196be13a73013daba546fb70da0a568f8f2d1321c", "'type'": "token1ToToken0"},
          {"'amountToken0'": "0", "'amountToken1'": "45013.35126704318", "'amountUSD'": "20774.654614664316", "'timestamp'": "1769563287", "'txHash'": "0x9afdde5b71d556359ad3b1e24bda9c87a501f34c76d36dfcc3994be3b30cea40", "'type'": "token1ToToken0"}
        ],
        1769608778
      ]
    ],
    "rows": 1
  }
]

The response shows comprehensive volume metrics for the specified Aerodrome pool, including $1.24M in 24-hour USD volume across 4,459 swaps, with detailed hourly breakdowns and information about the largest transactions.

x402 Payment Option

This endpoint supports pay-per-use access via the x402 payment protocol (v2) — pay $0.05 USDC per request using blockchain micropayments. No API key required.

Quick Start (TypeScript)

npm install @x402/fetch @x402/evm viem
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));

const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const response = await fetchWithPayment(
  "https://deep42.cambrian.network/api/v1/evm/aero/v2/pool-volume"
);
const data = await response.json();

Quick Start (Python)

pip install "x402[httpx]"
import asyncio, os
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

async def main():
    client = x402Client()
    account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
    register_exact_evm_client(client, EthAccountSigner(account))

    async with x402HttpxClient(client) as http:
        response = await http.get("https://deep42.cambrian.network/api/v1/evm/aero/v2/pool-volume")
        print(response.json())

asyncio.run(main())

Payment Flow

  1. Send a normal request to the endpoint (no API key needed)
  2. Server returns 402 Payment Required with payment details
  3. The x402 SDK automatically signs a payment authorization with your wallet
  4. The SDK resubmits the request with the signed payment
  5. Server verifies payment and returns the API response

The x402 SDK handles steps 2–5 automatically.

Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request