FlashAnglecontract that allows to take flash-loans on top of some of Angle Protocol stablecoins (like agEUR).
flashLoanimplementation in Angle: it allows borrowers to get liquidity of a single stablecoin. Different stablecoins may be supported by the same
FlashAnglecontract requesting a certain
tokento be sent to a
receiveraddress of your choice.
FlashAnglecontract transfers the tokens to the
receivercontract address and then calls the
onFlashLoanmethod of this contract.
amountexecutes any arbitrary operation in its code. These operations can be specified directly in the call to the
flashLoanfunction through the
FlashAnglecontract on the token for the flash-loaned amount plus the fee and then return
maxFlashLoanfunction for your token of interest in the
amountyou 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
flashLoanmethod on the
FlashAngle, you need to pass the relevant parameters. In all cases, you need to make sure that the
receiveraddress passed respects all the criteria from step 1.
receivercontract: If you want to use the same contract as in step 1, use
receiveraddress 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.
FlashAnglecontract. The funds will be automatically pulled at the conclusion of your operation.
FlashAnglecontract, then the whole operation will fail and the transaction will revert meaning you would have paid gas for nothing.