import type { Address } from "viem"; import type { StrategyCreditManagerView } from "../../common-utils/utils/strategies/types.js"; import type { IOnchainSDKPlugin } from "../../sdk/index.js"; import { AddressMap, BasePlugin } from "../../sdk/index.js"; import type { GetPoolsAPYResult } from "./pool-apy-types.js"; import type { ApySnapshotState, GetStrategyInfoSnapshotArgs, Pool7DAgoState, Pools7DAgoStateHuman, StrategyInfoSnapshot } from "./types.js"; export interface ApyPluginState { pools7DAgo: Record; apySnapshot: ApySnapshotState; } export interface ApyPluginConstructorOptions { apyUrl?: string; /** TTL for the shared HTTP cache in milliseconds (default: 10 minutes, see `DEFAULT_APY_INTERVAL_MS`) */ cacheTtlMs?: number; } export interface ApyPluginLoadOptions { /** * When `false` and the plugin is already loaded, skips the multicall that loads * pool diesel rates at the ~7d-ago block; only the APY snapshot is refreshed. * Ignored on the first load (both datasets are always fetched initially). */ loadPools7DAgo?: boolean; } export declare class ApyPlugin extends BasePlugin implements IOnchainSDKPlugin { #private; constructor(loadOnAttach?: boolean, options?: ApyPluginConstructorOptions); load(force?: boolean, loadOptions?: ApyPluginLoadOptions): Promise; get loaded(): boolean; /** * @throws if plugin is not loaded */ get pools7DAgo(): AddressMap; /** * @throws if plugin is not loaded */ get apySnapshot(): ApySnapshotState; /** * Computes per-pool APY (current + 7d-ago) and points for all markets. * * @throws if plugin is not loaded */ getPoolsAPY(): GetPoolsAPYResult; /** * Computes a strategy-info snapshot from the current SDK and APY state. * * @throws if plugin is not loaded */ getStrategyInfoSnapshot({ slippage, quotaReserve, curatorFilter, strategyPayloadsList, showHiddenStrategies, }: GetStrategyInfoSnapshotArgs): StrategyInfoSnapshot; syncState(): Promise; stateHuman(_?: boolean): Pools7DAgoStateHuman[]; get state(): ApyPluginState; hydrate(state: ApyPluginState): void; }