import type { Address } from 'viem'; import * as z from 'zod/mini'; import * as Store from './Store.js'; import type * as Tidx from './Tidx.js'; import type * as Viem from './Viem.js'; /** * Selectable measurement windows. A closed set bounds both the rate cache and * the historical read volume: every distinct window is its own cache entry and * its own pair of boundary reads. */ declare const windows: readonly ['1h', '1d', '7d', '30d']; /** Zod schemas owned by the Earn rate resolver. */ export declare namespace schema { /** Annualized share-price growth over one measurement window. */ const Apy: z.ZodMiniObject<{ asOf: z.ZodMiniISODateTime; methodology: z.ZodMiniLiteral<"share-price-growth-annualized:v1">; net: z.ZodMiniString; window: z.ZodMiniEnum<{ "1d": "1d"; "1h": "1h"; "30d": "30d"; "7d": "7d"; }>; }, z.core.$strict>; /** * Measurement window selected by a request. Stays absent when omitted so a * caller who never asked for a rate is distinguishable from one who selected * the default window. */ const Window: z.ZodMiniOptional>; } /** Annualized share-price growth over one measurement window. */ export type Apy = z.output; /** Selectable rate measurement window. */ export type Window = (typeof windows)[number]; /** Returns the confirmed 15-minute UTC bucket rates are measured to. */ export declare function asOf(): string; /** * Resolves the annualized rate of every vault on a page, keyed by lowercase * vault address. A vault maps to `null` when its rate cannot be measured. */ export declare function resolve(options: resolve.Options): Promise>; export declare namespace resolve { /** Options for resolving a page of Earn vault rates. */ type Options = { /** Chain containing the vaults. */ chainId: number; /** Resolves the RPC client used for historical share-price quotes. */ getClient: Viem.GetClient; /** Resolves the indexer client used for block and migration history. */ getTidx: Tidx.GetClient; /** Cache backing measured rates. */ store: Store.Store; /** Vault addresses appearing on the page. */ vaults: readonly Address[]; /** Canonical measurement window, defaulting to `7d`. */ window?: Window | undefined; }; } /** * Annualizes share-price growth between two measured boundaries. Returns `null` * for a degenerate window, a zero starting price, or growth too extreme to * express as a decimal ratio. */ export declare function annualize(options: annualize.Options): string | null; export declare namespace annualize { /** One measured boundary of the window. */ type Boundary = { /** Assets quoted for the shared share amount, in asset base units. */ price: bigint; /** Block timestamp, in seconds. */ timestamp: number; }; /** Options for annualizing measured share-price growth. */ type Options = { /** Newer boundary of the window. */ end: Boundary; /** Older boundary of the window. */ start: Boundary; }; } export {}; //# sourceMappingURL=EarnRates.d.ts.map