Skip to content

FlashLoanFacet

This facet contract contains functions for flash loan operations

Executes a flashLoan operation with the requested assets

function executeFlashLoan(
address payable onBehalf,
address payable receiver,
VToken[] memory vTokens,
uint256[] memory underlyingAmounts,
bytes memory param
) external

Transfers the specified assets to the receiver contract and handles repayment. Supports both full repayment and partial repayment where unpaid amounts become ongoing debt positions.

NameTypeDescription
onBehalfaddress payableThe address of the user whose debt position will be created in case of partial repayment
receiveraddress payableThe address of the contract that will receive the flashLoan amount and execute the operation
vTokensVToken[]The addresses of the vToken assets to be loaned
underlyingAmountsuint256[]The amounts of each underlying assets to be loaned
parambytesThe bytes passed in the executeOperation call