apy_withFee (apy × 0.9, 10% performance fee). Gross apy is unchanged.
Show
apy_withFee as the primary per-position APY in your product UI. Gross apy remains available for debugging or advanced transparency.Signature
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 averagesReturn Type
// 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
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
);