A peer to peer flash loan protocol. Any EOA (or contract) can now lend liquidity with his own chosen fees to anyone during a tx just by doing a token approval.
In the emerging world of decentralized financial protocols (DeFi), the use of flash loans has revolutionized the way users can access liquidity. Flash loans are instant, collateral-free loans that allow borrowers to take and repay a sum of money in a single transaction. Initially limited to developers and DeFi experts, flash loans quickly gained popularity and became a crucial financing option for a variety of users worldwide.
The Flash Market peer-to-peer flash loans protocol marks a significant milestone in the evolution of the DeFi sector. Unlike traditional protocols that rely on their single liquidity to facilitate flash loans and force their users to deposit on their platform to lend the liquidity, this new protocol enables users to interact directly with each other in a decentralized way.
This means that any Ethereum Address (EOA) or contract can now provide liquidity as a lender and charge customized fees, all in a single transaction.
The advantages of this peer-to-peer flash loans protocol are many and significant:
The Flash Loans Peer-to-Peer protocol is a decentralized financial system built on the EVM blockchains. It allows lenders to approve a specific smart contract, set their preferred fees (ranging from 0% to 100%), and store this information in a mapping (address => fees). Additionally, the lenders' addresses are stored in an array for easy reference.
Lenders who wish to participate in the Flash Loans Peer-to-Peer protocol must first approve a designated smart contract. This approval is typically done through a transaction that interacts with the smart contract's approval function. Along with the approval, lenders have the option to set their fees, determining the amount they wish to charge borrowers for flash loans. The fees are also provided as a parameter in the transaction and are stored in the contract's mapping.
When a borrower wants to initiate a flash loan, they interact with the smart contract through a separate transaction. The borrower provides parameters to the smart contract, specifically the asset it wants to borrow, the amount, and sources of liquidity it wants to use in order to reach this amount.
The flash loan process begins by accessing liquidity from the first lender's address, followed by the second, and so on, as per the specified indices in the array. The protocol works in a sequential manner, starting with the lenders who have set 0% fees. This prioritization aims to minimize borrowing costs for the borrower, as they can take advantage of lenders offering loans without any additional fees.
During the process of accessing liquidity, the protocol may encounter situations where lenders have lower available amount than the approved one. Or the contrary, a bigger amount available but a lower approved. The protocol do the intersection between these two case and take the available approved liquidity.
The documentation also mentions the possibility of utilizing layer 2 solutions to mitigate the high transaction costs associated with numerous transfer operations on the Ethereum blockchain. Layer 2 solutions are off-chain scaling mechanisms that can optimize the speed and cost efficiency of flash loans.