import { GenericCurrency } from '../../types/general';
import type { VaultClassificationFields } from '../classification';
/**
 * Yearn V3 vault kind, as reported by yDaemon.
 *   - `Single Strategy` — a TokenizedStrategy (single allocation)
 *   - `Multi Strategy`  — a VaultV3 allocating across strategies
 * Kept as a string union with a fallback so an unseen value doesn't
 * break parsing.
 */
export type YearnVaultKind = 'Single Strategy' | 'Multi Strategy' | (string & {});
/**
 * Parsed Yearn V3 vault entry.
 *
 * Yearn V3 vaults (VaultV3 + TokenizedStrategy) are standard ERC-4626
 * yield vaults — `deposit`/`redeem`/`convertToAssets`, monotonic NAV.
 * Discovery + all public data (USD TVL, realized APR, price-per-share)
 * come from Yearn's yDaemon API in one batched call per chain — no
 * multicall, no archival RPC (parity with the Lagoon fetcher).
 *
 * Share decimals usually equal the underlying's, but yDaemon reports
 * both, so `assetDecimals` is carried through to `VaultLookupEntry` for
 * correct share→asset formatting. Mirrors the cross-provider
 * load-bearing fields (`address`, `underlying`, `symbol`, `name`,
 * `decimals`, `totalAssets`, `totalSupply`) so `buildVaultLookup` picks
 * it up without branching.
 */
export interface YearnVault extends VaultClassificationFields {
    /** Vault (share token) contract address, lowercased. */
    address: string;
    /** Underlying ERC-20 address, lowercased. */
    underlying: string;
    /** Share-token symbol, e.g. `yvUSDC-1`, `yvWETH-2`. */
    symbol: string;
    /** Share-token name as returned by the API / `name()`. */
    name: string;
    /** Cross-provider UI label — `${curatorName ?? 'Yearn'} ${asset.symbol}`. */
    displayName: string;
    /** Curator label — always `'Yearn'` (Yearn-curated product). */
    curatorName: string;
    /** Share-token decimals. */
    decimals: number;
    /** Underlying asset decimals — carried explicitly (usually equals
     *  `decimals`, but kept for correct share→asset math). */
    assetDecimals: number;
    /** Total underlying held, raw integer as string (asset-decimal scaled).
     *  From `tvl.totalAssets`. */
    totalAssets: string;
    /** Total shares minted, raw integer as string. Derived from
     *  `totalAssets * 10**decimals / pricePerShare` (yDaemon doesn't
     *  report supply directly). */
    totalSupply: string;
    /** Raw `pricePerShare` — `convertToAssets(10**decimals)`, asset-scaled. */
    pricePerShare: string;
    /** Supply APR in percent (e.g. `5.12` = 5.12 %). Yearn's realized net
     *  APR (`apr.netAPR`), falling back to the forward APR for vaults with
     *  no realized history yet. Net of the performance fee. */
    supplyRate: number;
    /** Extra staking-rewards APR in percent (`apr.extra.stakingRewardsAPR`),
     *  0 when none. */
    rewardsRate: number;
    /** Sum of `supplyRate + rewardsRate` — what a depositor earns. */
    depositRate: number;
    /** Performance fee in percent (e.g. `10` = 10 %). From
     *  `apr.fees.performance`. */
    fee: number;
    /** True when `supplyRate` came from the forward (expected) APR rather
     *  than realized history — i.e. the vault is too new to have a TWRR. */
    isForwardApr: boolean;
    /** Vault kind — see {@link YearnVaultKind}. */
    kind: YearnVaultKind;
    /** yDaemon semver, e.g. `3.0.4`. */
    version: string;
    /** Yearn product category, e.g. `Pendle`, `Curve`. Undefined when the
     *  API doesn't classify it. */
    category?: string;
    /** Hydrated asset metadata from the provided token list, if any. */
    asset?: GenericCurrency;
    /** USD price of one underlying unit (`tvl.price`, or our price map). */
    priceUsd?: number;
    /** Human-formatted total assets (`totalAssets / 10**assetDecimals`). */
    totalAssetsFormatted: number;
    /** Human-formatted total assets in USD (`tvl.tvl`, or formatted×price). */
    totalAssetsUsd: number;
    /** Currently-withdrawable underlying, raw integer as string. Read
     *  on-chain (best-effort): for single-strategy (TokenizedStrategy)
     *  vaults from `availableWithdrawLimit`; for multi-strategy (VaultV3)
     *  from `totalIdle + Σ strategy.maxWithdraw(vault)` over the default
     *  queue. Clamped to `totalAssets`. **Absent** when the on-chain read
     *  failed (no multicall, chain RPC down) — treat absent as "unknown",
     *  not zero. */
    liquidity?: string;
    /** Human-formatted withdrawable liquidity (`liquidity / 10**assetDecimals`). */
    liquidityFormatted?: number;
    /** Withdrawable liquidity in USD (`liquidityFormatted × priceUsd`). */
    liquidityUsd?: number;
}
/**
 * Full parsed payload: per-vault-address map (parity with Morpho / Silo
 * / Euler-Earn / Lagoon / LST). Keyed by lowercased vault address.
 */
export type YearnVaults = {
    [vaultAddress: string]: YearnVault;
};
//# sourceMappingURL=types.d.ts.map