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

Each position includes **`apy_withFee`** (`apy × 0.9`, 10% performance fee). Gross `apy` is unchanged.

<Tip title="User-facing display">
  Show `apy_withFee` as the primary per-position APY in your product UI. Gross `apy` remains available for debugging or advanced transparency.
</Tip>

## Signature

```typescript theme={null}
type DailyApyHistoryPeriod = "7D" | "14D" | "30D" | "60D" | "120D" | "180D";

getDailyApyHistory(walletAddress: string, days?: DailyApyHistoryPeriod): Promise<DailyApyHistoryResponse>
```

## Parameters

| Parameter       | Type                    | Required | Description                                                                                 |
| --------------- | ----------------------- | -------- | ------------------------------------------------------------------------------------------- |
| `walletAddress` | `string`                | ✅        | Smart wallet address                                                                        |
| `days`          | `DailyApyHistoryPeriod` | ❌        | Lookback window: `"7D"`, `"14D"`, `"30D"`, `"60D"`, `"120D"`, or `"180D"` (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;
  apy_withFee?: number; // SHOW THIS — apy × 0.9
  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);
const firstDay = Object.values(response.history)[0];
console.log("  first position APY (net):", firstDay?.positions[0]?.apy_withFee);
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
);
```
