Skip to main content

getVolume

Get total trading volume across all Zyfai accounts, optionally filtered by asset type.

Signature

getVolume(assetType?: "usdc" | "eth"): Promise<VolumeResponse>

Parameters

ParameterTypeRequiredDescription
assetTypestringAsset to get volume for: "usdc" or "eth" (default: "usdc")

Returns

Total volume in USD for the specified asset

Return Type

interface VolumeResponse {
success: boolean;
volumeInUSD: string;
}

Example

// Get USDC volume (default)
const usdcVolume = await sdk.getVolume();
console.log("USDC Volume:", usdcVolume.volumeInUSD);

// Get ETH/WETH volume
const ethVolume = await sdk.getVolume("eth");
console.log("ETH Volume:", ethVolume.volumeInUSD);