import type { MorphoTypeVaultEntry } from '@1delta/data-sdk';
import { GenericTokenList, MulticallRetryFunction } from '../../types';
import type { VaultMarketExposure } from './types';
/**
 * Context for deriving an exposure's `marketUid` — the join key shared with
 * the lending/markets API. The uid mirrors that path:
 * `createMarketUid(chainId, `${protocol}_${MARKETID}`, underlying)`, where
 * `underlying` is the vault's loan asset (its supply side).
 */
export interface MarketUidContext {
    chainId: string;
    underlying: string;
    /** Market lender prefix, e.g. `MORPHO_BLUE` or `LISTA_DAO`. */
    protocol: string;
}
/**
 * Per-market supply rate + share/asset totals, keyed by lower-cased market id.
 * Supply APR is net of the market-level protocol fee (not the vault
 * performance fee). Shared by the Lista (Moolah) and standard MetaMorpho
 * on-chain fetchers — only the rate *source* differs, the allocation math is
 * identical.
 */
export interface MarketRate {
    supplyApr: number;
    totalSupplyAssets: bigint;
    totalSupplyShares: bigint;
    /** Lowercased collateral token backing the market, '' if unknown. */
    collateralAddress: string;
    /** Currently-withdrawable assets in the market — `totalSupplyAssets −
     *  totalBorrowAssets`, raw integer. Drives the vault's real withdrawable
     *  liquidity; omit/0 when the borrow side is unknown (degrades to
     *  treating the allocation as fully liquid). */
    liquidity?: bigint;
}
/**
 * Read `<core>.position(marketId, vault).supplyShares` for every
 * (vault, market) pair the vaults actually queue. Keyed by
 * `${vaultLower}:${marketIdLower}`. Empty when the core is unknown.
 *
 * The Morpho Blue and Moolah (Lista) cores share the `position` ABI, so this
 * is protocol-agnostic.
 */
export declare function fetchVaultSupplyShares(chainId: string, core: string | undefined, entries: MorphoTypeVaultEntry[], marketIdsByVault: string[][], multicallRetry: MulticallRetryFunction): Promise<Map<string, bigint>>;
/**
 * Allocation walk: for each market the vault lends into, convert its supply
 * shares to assets and record the exposure. Returns:
 *  - `depositRate`: allocation-weighted market supply APR over *total*
 *    assets (idle balances dilute it), net of the vault performance fee —
 *    matching how MetaMorpho-style `netApy` is derived.
 *  - `exposures`: per-market breakdown, ordered by weight descending.
 *  - `liquidityFormatted`: real withdrawable underlying — idle deposits plus,
 *    from each allocation, at most the market's liquid cash
 *    (`min(allocation, market.liquidity)`), clamped to `totalAssets`. When no
 *    market exposes a `liquidity`, this equals `totalAssets` (the previous
 *    optimistic ceiling).
 */
export declare function computeVaultAllocation(vaultAddress: string, decimals: number, totalAssetsFormatted: number, feePercent: number, priceUsd: number, marketIds: string[], rateMap: Map<string, MarketRate>, positionMap: Map<string, bigint>, tokenList: GenericTokenList, uidCtx?: MarketUidContext): {
    depositRate: number;
    exposures: VaultMarketExposure[];
    liquidityFormatted: number;
};
/**
 * Allocation walk for **Morpho Vaults V2** (adapter-based). Unlike V1, the
 * per-market assets come **directly** from the adapter's
 * `expectedSupplyAssets(marketId)` (no share→asset conversion), so this takes a
 * pre-resolved `marketAssetsRaw` map (marketId → raw underlying) instead of
 * `positionMap` + a share/asset ratio. Everything else mirrors
 * {@link computeVaultAllocation}: market supply APR + liquidity come from the
 * same lens-sourced `rateMap`, the result is allocation-weighted over total
 * assets and net of the vault's performance fee, and `liquidity` is
 * `idle + Σ min(allocation, market liquid)` clamped to total assets.
 */
export declare function computeV2Allocation(decimals: number, totalAssetsFormatted: number, feePercent: number, priceUsd: number, marketAssetsRaw: Map<string, bigint>, rateMap: Map<string, MarketRate>, tokenList: GenericTokenList, uidCtx?: MarketUidContext): {
    depositRate: number;
    exposures: VaultMarketExposure[];
    liquidityFormatted: number;
};
//# sourceMappingURL=allocationWalk.d.ts.map