Skip to content
LogoLogo

IFlashloanAggregator

Git Source

Functions

requestFlashloan

The function to request a flash loan.

function requestFlashloan(FlashloanRequest calldata request) external;

Parameters

NameTypeDescription
requestFlashloanRequestThe request for the flash loan.

balancerV3FlashloanCallback

Callback handler for Balancer V3 flashloan.

function balancerV3FlashloanCallback(
        address caliber,
        ICaliber.Instruction calldata instruction,
        address token,
        uint256 amount
    ) external;

Parameters

NameTypeDescription
caliberaddressThe address of the Caliber contract that initiated the flashloan.
instructionICaliber.InstructionThe instruction to execute.
tokenaddressThe token borrowed.
amountuint256The amount borrowed.

Errors

NotCaliber

Error thrown when the caller is not a Caliber.

error NotCaliber();

NotRequested

Error thrown when the initiator is not the requested contract.

error NotRequested();

InvalidToken

Error thrown when the token is invalid.

error InvalidToken();

InvalidParamsLength

Error thrown when params length is invalid.

error InvalidParamsLength();

InvalidFeeAmount

Error thrown when the fee amount is invalid.

error InvalidFeeAmount();

NotBalancerV2Pool

Error thrown when the caller is not the Balancer V2 pool.

error NotBalancerV2Pool();

NotBalancerV3Pool

Error thrown when the caller is not the Balancer V3 pool.

error NotBalancerV3Pool();

NotMorpho

Error thrown when the caller is not the Morpho pool.

error NotMorpho();

NotDssFlash

Error thrown when the caller is not the Maker DSS Flash.

error NotDssFlash();

NotAaveV3Pool

Error thrown when the caller is not the Aave V3 pool.

error NotAaveV3Pool();

BalancerV2PoolNotSet

Error thrown when the Balancer V2 pool is not set.

error BalancerV2PoolNotSet();

BalancerV3PoolNotSet

Error thrown when the Balancer V3 pool is not set.

error BalancerV3PoolNotSet();

MorphoPoolNotSet

Error thrown when the Morpho pool is not set.

error MorphoPoolNotSet();

DaiNotSet

Error thrown when the DAI token is not set.

error DaiNotSet();

DssFlashNotSet

Error thrown when the Maker DSS Flash is not set.

error DssFlashNotSet();

AaveV3PoolNotSet

Error thrown when the Aave V3 pool is not set.

error AaveV3PoolNotSet();

InvalidUserDataHash

Error thrown when the user data hash is invalid.

error InvalidUserDataHash();

Structs

FlashloanRequest

The struct for requesting a flash loan.

struct FlashloanRequest {
        FlashloanProvider provider;
        ICaliber.Instruction instruction;
        address token;
        uint256 amount;
    }

Properties

NameTypeDescription
providerFlashloanProviderThe provider of the flash loan.
instructionICaliber.InstructionThe instruction to execute.
tokenaddressThe token to borrow.
amountuint256The amount to borrow.

Enums

FlashloanProvider

The enum for the flash loan providers.

enum FlashloanProvider {
        /// Aave V3
        AAVE_V3,
        /// Balancer V2
        BALANCER_V2,
        /// Balancer V3
        BALANCER_V3,
        /// Morpho
        MORPHO,
        /// Maker DSS Flash
        DSS_FLASH
    }

Variants

NameDescription
AAVE_V3
BALANCER_V2
BALANCER_V3
MORPHO
DSS_FLASH