IAaveFunctionsModule

Git Source

This interface defines the essential structures and functions for the AaveFunctionsModule contract.

Functions

VERSION

function VERSION() external pure returns (string memory version);

aavePMProxyAddress

function aavePMProxyAddress() external view returns (address aavePMProxyAddress);

aaveSupply

function aaveSupply(address aavePoolAddress, address tokenAddress, uint256 tokenBalance) external;

aaveWithdrawCollateral

function aaveWithdrawCollateral(address aavePoolAddress, address tokenAddress, uint256 withdrawAmount) external;

aaveBorrow

function aaveBorrow(address aavePoolAddress, address tokenAddress, uint256 borrowAmount) external;

aaveRepayDebt

function aaveRepayDebt(address aavePoolAddress, address tokenAddress, uint256 repayAmount) external;

getCurrentPositionValues

function getCurrentPositionValues(IAavePM aavePM)
    external
    view
    returns (
        uint256 initialCollateralBase,
        uint256 totalDebtBase,
        uint256 currentLiquidationThreshold,
        uint256 initialHealthFactorScaled,
        uint16 healthFactorTarget,
        address aavePoolAddress,
        address wstETHAddress,
        address usdcAddress
    );

checkHealthFactorAboveMinimum

function checkHealthFactorAboveMinimum()
    external
    view
    returns (
        uint256 totalCollateralBase,
        uint256 totalDebtBase,
        uint256 availableBorrowsBase,
        uint256 currentLiquidationThreshold,
        uint256 ltv,
        uint256 healthFactor
    );

getTotalCollateralDelta

function getTotalCollateralDelta(
    uint256 totalCollateralBase,
    uint256 reinvestedDebtTotal,
    uint256 suppliedCollateralTotal
) external pure returns (uint256 delta, bool isPositive);

convertExistingBalanceToWstETHAndSupplyToAave

function convertExistingBalanceToWstETHAndSupplyToAave() external returns (uint256 suppliedCollateral);

calculateMaxBorrowUSDC

function calculateMaxBorrowUSDC(
    uint256 totalCollateralBase,
    uint256 totalDebtBase,
    uint256 currentLiquidationThreshold,
    uint16 healthFactorTarget
) external pure returns (uint256 maxBorrowUSDC);

Errors

AaveFunctionsModule__InvalidAavePMProxyAddress

error AaveFunctionsModule__InvalidAavePMProxyAddress();