flashLoan()

Borrow an indicated amount from the liquidity pool

Function flashLoan()

    function flashLoan(
        Token token,
        uint256 amount,
        IFlashLoanRecipient recipient,
        bytes calldata data
    )
        external

Triggers a flashloan where the indicated amount is borrowed from the pool to execute the calldata and returned within an atomic transaction.

NameTypeDescription

token

Token

The address of the token deposited into the pool

amount

unit256

The amount to borrow from the pool

recipient

IFlashloanRecipient

The address of the flash loan recipient

bytes

calldata

This parameter is included for the caller to pass arbitrary information to the receiver, without impacting the utility of the flashLoan standard

Flash loans must be returned in the same transaction they are borrowed.

Last updated