> ## 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.

# getDailyApyHistory

Get daily APY history with weighted average for a wallet over a specified period.

## Signature

```typescript theme={null}
getDailyApyHistory(walletAddress: string, days?: '7D' | '14D' | '30D'): Promise<DailyApyHistoryResponse>
```

## Parameters

| Parameter       | Type                     | Required | Description            |
| --------------- | ------------------------ | -------- | ---------------------- |
| `walletAddress` | `string`                 | ✅        | Smart wallet address   |
| `days`          | `'7D' \| '14D' \| '30D'` | ❌        | Period (default: '7D') |

## Returns

Daily APY history with weighted averages

## Return Type

```typescript theme={null}
// TokenApy is a record of token symbols to APY values
type TokenApy = Record<string, number>;  // e.g., { "USDC": 5.05, "WETH": 1.58 }

interface ApyPosition {
  apy: number;
  balance: number;
  chainId: number;
  protocol: string;
  pool: string;
  strategy: string;
  tokenSymbol?: string;
}

interface DailyApyEntry {
  positions: ApyPosition[];
  weighted_apy: TokenApy;
  fee: TokenApy;
  weighted_apy_after_fee: TokenApy;
  rzfi_merkl_apr: TokenApy;
  final_weighted_apy: TokenApy;
}

interface DailyApyHistoryResponse {
  success: boolean;
  walletAddress: string;
  history: Record<string, DailyApyEntry>;
  totalDays: number;
  requestedDays?: number;
  weightedApyWithRzfiAfterFee?: TokenApy;
  weightedApyAfterFee?: TokenApy;
  averageRzfiMerklApr?: TokenApy;
  weightedApyAfterFeeByChain?: ChainTokenApy;
  weightedApyWithRzfiAfterFeeByChain?: ChainTokenApy;
}
```

## Example

```typescript theme={null}
const response = await sdk.getDailyApyHistory(smartWallet, period);

console.log("apy history response:", response);
console.log("  totalDays:", response.totalDays);
console.log("  weightedApyAfterFee:", response.weightedApyAfterFee);
console.log("  weightedApyWithRzfiAfterFee:", response.weightedApyWithRzfiAfterFee);
console.log("  averageRzfiMerklApr:", response.averageRzfiMerklApr);
console.log("  weightedApyAfterFeeByChain:", response.weightedApyAfterFeeByChain);
console.log(
  "  weightedApyWithRzfiAfterFeeByChain:",
  response.weightedApyWithRzfiAfterFeeByChain
);
```
