Page cover image

AF2.0 Flashloan Guide

Calling flashloan()

To initiate flash loan from Money Market, call the flashloan function using below function selector to

Money Market Diamond: 0x7389aaf2e32872cABD766D0CEB384220e8F2A590

Params
Description

_token

The address of the token to flashloan

_amount

The amount of token that will be sent to the receiver (the address that initiated the call)

_data

Data represented in bytes that will be forwarded to the receiver contract

Implementing Callback function

In order to receive the token, the caller, which needed to be a contract, needs to implement the following function

Params
Description

_token

The address of the token that has been transferred as a flashloan

_repay

The total amount of token that need to be sent back to MM contract including flashloan fee

_data

Forwarded data from flashloan call

Last updated

Was this helpful?