> ## Documentation Index
> Fetch the complete documentation index at: https://zyfai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# getDailyEarnings

Get daily earnings for a wallet within a date range (YYYY-MM-DD format).

## Signature

```typescript theme={null}
getDailyEarnings(walletAddress: string, startDate?: string, endDate?: string): Promise<DailyEarningsResponse>
```

## Parameters

| Parameter       | Type     | Required | Description                    |
| --------------- | -------- | -------- | ------------------------------ |
| `walletAddress` | `string` | ✅        | Smart wallet address           |
| `startDate`     | `string` | ❌        | Start date (YYYY-MM-DD format) |
| `endDate`       | `string` | ❌        | End date (YYYY-MM-DD format)   |

## Returns

Daily earnings breakdown

## Return Type

```typescript theme={null}
// 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;
  };
}
```

<Note title="Amounts are strings">
  All earnings values are decimal strings. Parse them with `parseFloat()` when doing arithmetic or display formatting.
</Note>

## Example

```typescript theme={null}
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)}`);
});
```
