Flash loans on the Algofi Lending V2.
Flash loans are a way for users to get instant uncollateralized loans on the Algofi Lending V2. Functionally, a flash loan is a group transaction that fronts a payment to the user. The loan must be repaid within the same transaction group, with a small fee, to ensure that there is no risk to the lender.
This works as follows - a user constructs a group transaction wherein the first transaction borrows assets from a specified market on Algofi. The user then embeds desired transactions within the group, e.g. a liquidation and a trade on the Algofi DEX. Finally, the last transaction of the constructed group must repay the loan from the first transaction, with interest.
This source of capital allows for much greater market efficiency, as traders have near unrestricted access to funds for arbitrage. Moreover, these flash loans can be deployed across the Algorand ecosystem as the source of trading opportunities grows.
There is currently no support for flash loans in the Algofi UI - the feature primarily exists for algorithmic programmers. Developers can find more information on how to implement a flash loan by visiting https://github.com/Algofiorg/algofi-python-sdk