Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
getDailyEarnings(walletAddress: string, startDate?: string, endDate?: string): Promise<DailyEarningsResponse>
walletAddress
string
startDate
endDate
// Token-keyed earnings — amounts as decimal strings: { "USDC": "324.313028" } type TokenEarnings = Record<string, string>; interface DailyEarning { wallet_address?: string; snapshot_date: string; total_earnings_by_token: TokenEarnings; daily_total_delta_by_token: TokenEarnings; created_at?: string; } interface DailyEarningsResponse { success: boolean; walletAddress: string; data: DailyEarning[]; count: number; filters: { startDate: string | null; endDate: string | null; }; }
parseFloat()
const daily = await sdk.getDailyEarnings( "0x...", "2024-01-01", "2024-01-31" ); daily.data.forEach(d => { const totalUsdc = parseFloat(d.total_earnings_by_token["USDC"] ?? "0"); const dailyDelta = parseFloat(d.daily_total_delta_by_token["USDC"] ?? "0"); console.log(`Date: ${d.snapshot_date}`); console.log(` Cumulative USDC: $${totalUsdc.toFixed(6)}`); console.log(` Daily USDC delta: $${dailyDelta.toFixed(6)}`); });