FlashAngle
contract that allows to take flash-loans on top of some of Angle Protocol stablecoins (like agEUR).FlashAngle
contract has not yet been deployed and will soon be open-sourced.flashLoan
implementation in Angle: it allows borrowers to get liquidity of a single stablecoin. Different stablecoins may be supported by the same FlashAngle
contract.FlashAngle
contract requesting a certain amount
of token
to be sent to a receiver
address of your choice.FlashAngle
contract transfers the tokens to the receiver
contract address and then calls the onFlashLoan
method of this contract.amount
executes any arbitrary operation in its code. These operations can be specified directly in the call to the flashLoan
function through the data
parameter.FlashAngle
contract on the token for the flash-loaned amount plus the fee and then return keccak256("ERC3156FlashBorrower.onFlashLoan")
.flashFee
and maxFlashLoan
function for your token of interest in the FlashAngle
contract.receiver
contract which must conform to the IERC3156FlashBorrower
interface.amount
you want to take is inferior to the maximum amount allowed. These fees should change very rarely as only veANGLE can vote to change this. The functions to call are flashFee()
and maxFlashLoan
.flashLoan()
flashLoan
method on the FlashAngle
, you need to pass the relevant parameters. In all cases, you need to make sure that the receiver
address passed respects all the criteria from step 1.FlashAngle
calling the flashLoan
function.receiver
contract: If you want to use the same contract as in step 1, use address(this)
for the receiver
address parameter in the flash-loan method.onFlashLoan()
function), you will need to pay back the flash loaned amount of tokens plus the eventual fees associated to the operation.FlashAngle
contract. The funds will be automatically pulled at the conclusion of your operation.FlashAngle
contract, then the whole operation will fail and the transaction will revert meaning you would have paid gas for nothing.