import { type BigIntish } from "@morpho-org/blue-sdk"; export interface PoolIndexesParams { /** The current pool supply index (in ray). */ liquidityIndex: bigint; /** The current pool borrow index (in ray). */ variableBorrowIndex: bigint; /** The current pool supply rate (in ray). */ liquidityRate: bigint; /** The current pool borrow rate (in ray). */ variableBorrowRate: bigint; /** The last update timestamp (in seconds). */ lastUpdateTimestamp: BigIntish; /** The current timestamp (in seconds). */ currentTimestamp: bigint; } export declare namespace PoolInterestRates { /** * Recompute the exact same logic as the Aave V3 protocol. * For supply index: https://github.com/aave/aave-v3-core/blob/9630ab77a8ec77b39432ce0a4ff4816384fd4cbf/contracts/protocol/libraries/logic/ReserveLogic.sol#L47 * For borrow index: https://github.com/aave/aave-v3-core/blob/9630ab77a8ec77b39432ce0a4ff4816384fd4cbf/contracts/protocol/libraries/logic/ReserveLogic.sol#L73 */ function computePoolIndexes({ liquidityIndex, variableBorrowIndex, liquidityRate, variableBorrowRate, lastUpdateTimestamp, currentTimestamp, }: PoolIndexesParams): { newPoolSupplyIndex: bigint; newPoolBorrowIndex: bigint; }; } export interface MarketSizeIndexes { /** The pool index (in ray). */ poolIndex: bigint; /** The peer-to-peer index (in ray). */ p2pIndex: bigint; } export interface GrowthFactors { /** The pool's supply index growth factor (in ray). */ poolSupplyGrowthFactor: bigint; /** Peer-to-peer supply index growth factor (in ray). */ p2pSupplyGrowthFactor: bigint; /** The pool's borrow index growth factor (in ray). */ poolBorrowGrowthFactor: bigint; /** Peer-to-peer borrow index growth factor (in ray). */ p2pBorrowGrowthFactor: bigint; } export interface MarketSizeDelta { /** The delta amount in pool unit.*/ scaledDelta: bigint; /** The total peer-to-peer amount in peer-to-peer unit. */ scaledP2PTotal: bigint; } export interface Deltas { /** The `MarketSideDelta` related to the supply side. */ supply: MarketSizeDelta; /** The `MarketSideDelta` related to the borrow side. */ borrow: MarketSizeDelta; } export interface IndexesParams { /** The last stored pool supply index (in ray). */ lastSupplyIndexes: MarketSizeIndexes; /** The last stored pool borrow index (in ray). */ lastBorrowIndexes: MarketSizeIndexes; /** The current pool supply index (in ray). */ poolSupplyIndex: bigint; /** The current pool borrow index (in ray). */ poolBorrowIndex: bigint; /** The reserve factor percentage (10 000 = 100%). */ reserveFactor: BigIntish; /** The peer-to-peer index cursor (10 000 = 100%). */ p2pIndexCursor: BigIntish; /** The deltas and peer-to-peer amounts. */ deltas: Deltas; /** The amount of proportion idle (in underlying). */ proportionIdle: bigint; } export interface RateParams { /** The pool supply rate per year (in ray). */ poolSupplyRatePerYear: bigint; /** The pool borrow rate per year (in ray). */ poolBorrowRatePerYear: bigint; /** The last stored pool index (in ray). */ poolIndex: bigint; /** The last stored peer-to-peer index (in ray). */ p2pIndex: bigint; /** The delta and peer-to-peer amount. */ delta: MarketSizeDelta; /** The index cursor of the given market (in bps). */ p2pIndexCursor: bigint; /** The reserve factor of the given market (in bps). */ reserveFactor: bigint; /** The proportion idle of the given market (in underlying). */ proportionIdle: bigint; } export declare namespace P2PInterestRates { function computeP2PIndexes({ p2pIndexCursor, lastBorrowIndexes, lastSupplyIndexes, poolBorrowIndex, poolSupplyIndex, deltas, reserveFactor, proportionIdle, }: IndexesParams): { newP2PSupplyIndex: bigint; newP2PBorrowIndex: bigint; }; function computeP2PSupplyRatePerYear({ poolSupplyRatePerYear, poolBorrowRatePerYear, poolIndex, p2pIndex, p2pIndexCursor, reserveFactor, proportionIdle, delta, }: RateParams): bigint; function computeP2PBorrowRatePerYear({ poolSupplyRatePerYear, poolBorrowRatePerYear, poolIndex, p2pIndex, p2pIndexCursor, reserveFactor, proportionIdle, delta, }: RateParams): bigint; }