import { type Address } from "viem"; import type { OracleInfo, OraclePrice, OracleRoute } from "../utils/oracle.js"; import type { InterestRateModelType } from "../services/vaults/eVaultService/adapters/eVaultOnchainAdapter/eVaultLensTypes.js"; import type { Token } from "../utils/types.js"; import type { AdaptiveCurveIRMInfo, FixedCyclicalBinaryIRMInfo, FixedCyclicalBinaryMonthlyIRMInfo, KinkIRMInfo, KinkyIRMInfo, LinearKinkIRMParams } from "../utils/irm.js"; import { ERC4626Vault, type ERC4626VaultPopulated, type IERC4626Vault, type IERC4626VaultConversion, type PriceUsd } from "./ERC4626Vault.js"; import type { IPriceService } from "../services/priceService/index.js"; import type { VaultEntity } from "../services/vaults/vaultMetaService/index.js"; import type { IVaultMetaService } from "../services/vaults/vaultMetaService/index.js"; import { type DataIssue } from "../utils/entityDiagnostics.js"; export type EVaultHookedOperations = { deposit: boolean; mint: boolean; withdraw: boolean; redeem: boolean; transfer: boolean; skim: boolean; borrow: boolean; repay: boolean; repayWithShares: boolean; pullDebt: boolean; convertFees: boolean; liquidate: boolean; flashloan: boolean; touch: boolean; vaultStatusCheck: boolean; }; export interface EVaultFees { interestFee: number; accumulatedFeesShares: bigint; accumulatedFeesAssets: bigint; governorFeeReceiver: Address; protocolFeeReceiver: Address; protocolFeeShare: number; } export interface EVaultHooks { hookedOperations: EVaultHookedOperations; hookTarget: Address; } export interface EVaultCaps { supplyCap: bigint; borrowCap: bigint; } export interface EVaultCapsComputed extends EVaultCaps { readonly supplyCapUtilization: number; readonly borrowCapUtilization: number; } export interface EVaultLiquidation { maxLiquidationDiscount: number; liquidationCoolOffTime: number; socializeDebt: boolean; } export interface InterestRates { /** Percentage points, e.g. 5 = 5%. */ borrowSPY: number; /** Percentage points, e.g. 5 = 5%. */ borrowAPY: number; /** Percentage points, e.g. 5 = 5%. */ supplyAPY: number; } export type InterestRateModel = { address: Address; type: InterestRateModelType.KINK; data: KinkIRMInfo | null; params: LinearKinkIRMParams | null; } | { address: Address; type: InterestRateModelType.ADAPTIVE_CURVE; data: AdaptiveCurveIRMInfo | null; params: null; } | { address: Address; type: InterestRateModelType.KINKY; data: KinkyIRMInfo | null; params: null; } | { address: Address; type: InterestRateModelType.FIXED_CYCLICAL_BINARY; data: FixedCyclicalBinaryIRMInfo | null; params: null; } | { address: Address; type: InterestRateModelType.FIXED_CYCLICAL_BINARY_MONTHLY; data: FixedCyclicalBinaryMonthlyIRMInfo | null; params: null; } | { address: Address; type: InterestRateModelType.UNKNOWN; data: null; params: null; }; export interface IEVaultCollateral { address: Address; borrowLTV: number; liquidationLTV: number; ramping?: EVaultCollateralRamping; oraclePriceRaw: OraclePrice; vault?: VaultEntity; oracleRoute?: OracleRoute; marketPriceUsd?: PriceUsd; } export interface EVaultCollateral extends IEVaultCollateral { readonly currentLiquidationLTV: number; readonly isLiquidationLTVRamping: boolean; readonly rampTimeRemaining: bigint; } export interface EVaultCollateralRamping { initialLiquidationLTV: number; targetTimestamp: number; rampDuration: bigint; } export type RiskPrice = { priceLiquidation: bigint; priceBorrowing: bigint; }; export interface IEVault extends IERC4626Vault { unitOfAccount?: Token; /** * Whether the vault is escrowed collateral, as reported by the data source: * V3's `vaultType` on the V3 path, `EscrowedCollateralPerspective` * membership on the on-chain path. `null` when the source has no answer. * The SDK never derives one of its own, so it cannot contradict the source * a consumer is reading alongside it. */ isEscrow?: boolean | null; totalCash: bigint; totalBorrowed: bigint; creator: Address; governorAdmin: Address; dToken: Address; balanceTracker: Address; fees: EVaultFees; hooks: EVaultHooks; caps: EVaultCaps; liquidation: EVaultLiquidation; oracle: OracleInfo; interestRates: InterestRates; interestRateModel: InterestRateModel; collaterals: IEVaultCollateral[]; debtPricingOracleRoute?: OracleRoute; evcCompatibleAsset: boolean; oraclePriceRaw: OraclePrice; timestamp: number; populated?: Partial; } export interface EVaultPopulated extends ERC4626VaultPopulated { collaterals: boolean; } export declare function hasActiveBorrowableLtv(collaterals: (EVaultCollateral | IEVaultCollateral)[], vaultTimestamp: number): boolean; export declare class EVault extends ERC4626Vault implements IEVault, IERC4626VaultConversion { unitOfAccount?: Token; isEscrow: boolean | null; totalCash: bigint; totalBorrowed: bigint; creator: Address; governorAdmin: Address; dToken: Address; balanceTracker: Address; fees: EVaultFees; hooks: EVaultHooks; caps: EVaultCapsComputed; liquidation: EVaultLiquidation; oracle: OracleInfo; debtPricingOracleRoute?: OracleRoute; interestRates: InterestRates; interestRateModel: InterestRateModel; collaterals: EVaultCollateral[]; evcCompatibleAsset: boolean; oraclePriceRaw: OraclePrice; timestamp: number; populated: EVaultPopulated; constructor(args: IEVault); get isBorrowable(): boolean; get availableLiquidity(): bigint; get utilization(): number; private buildCaps; /** Conversion using VIRTUAL_DEPOSIT (matches EVault contract). */ convertToAssets(shares: bigint): bigint; /** Conversion using VIRTUAL_DEPOSIT (matches EVault contract). */ convertToShares(assets: bigint): bigint; /** * Shares required to withdraw `assets` of underlying, rounded UP. * Mirrors EVault's `previewWithdraw(uint256)` (Math.mulDiv with Rounding.Ceil) * including the VIRTUAL_DEPOSIT_AMOUNT offset. */ previewWithdraw(assets: bigint): bigint; get availableToBorrow(): bigint; get assetRiskPrice(): RiskPrice | undefined; getCollateralRiskPrice(collateralVault: ERC4626Vault): RiskPrice | undefined; fetchUnitOfAccountMarketPriceUsd(priceService: IPriceService): Promise; fetchCollateralMarketPriceUsd(collateralVault: ERC4626Vault, priceService: IPriceService): Promise; fetchCollateralMarketValueUsd(amount: bigint, collateralVault: ERC4626Vault, priceService: IPriceService): Promise; populateCollaterals(vaultMetaService: IVaultMetaService): Promise; populateMarketPrices(priceService: IPriceService): Promise; } //# sourceMappingURL=EVault.d.ts.map