# Flash Loans **Published by:** [web3 library](https://paragraph.com/@tool3/) **Published on:** 2022-10-16 **URL:** https://paragraph.com/@tool3/flash-loans ## Content What are flash loans?Users can borrow funds without any upfront collateral for a short period of timeThe catch is you must pay the flash loan back in the same Ethereum transaction you bought it withCan be up to millions of dollars borrowedMust be paid back in the same cryptocurrency block that it was borrowed inAn innovative approach made possible by the DeFi space, flash loans come with risks. Flash loans have been used in the past to attack the lending protocols that issue them.Flash Loans work like this:A borrower requests funds in the form of a flash loan.They instantly use the funds to take advantage of an arbitrage opportunity between two decentralized exchanges.Once the transaction is complete, the flash loan is returned with charged feesThe borrower keeps whatever profits were accumulated from the arbitrage.Why would you want a loan that you would have to pay back almost immediately? What’s the purpose? Trading ArbitrageEx: If you bought BAT at Binance for $1,000,000 and sold it on Coinbase for $1,100,000 you would make $100,000 profitBe aware that you do have to pay fees (Aave is 0.09%)Easier Ex: If you bought an apple from your mom for $1 and sold it to your dad for $2, you would easily double your moneyCollateral SwapUsers can exchange current collateral assets for other assets, making it easier for users to manage their risks and avoid getting liquidated.Collateral, deposited before borrowing funds, can now be swapped for another cryptocurrency inside Aave.Essentially you can change out your collateral without touching the initial amount of money you borrowedWhen locking up cryptocurrencies as collateral there is a risk that the asset can devalue in price. If this occurs, a user could swap their cryptocurrency into a stablecoin to avoid price fluctuations.Ex: Users collateralize ETH to borrow DAI. For some reason, they know that ETH price will decrease. Users transfer all ETH to YFI, and YFI then has good news so that the price increases. Therefore, users both avoid liquidation and can borrow more DAI due to the increase in YFI price. Self-LiquidationIf you deposited 100 ETH into Aave and it was worth $200 each ($20k total), giving you interest over timeAt the time, you needed money. So you took a loan worth $16k worth of Tether (stablecoin) to pay bills, of which you spent it allFast-forward and now 1 ETH = $2,000, so you now how $200k worth of ETH locked up as collateral from your depositTo get immediate access to it, you take out a flash loan worth $16k of Tether to repay your loan and get access to your initial 100 ETHYou would then use that initial 100 ETH, convert it to Tether, and use it to repay back your original loanNow you have withdrawn $184,000 ETH (fees included) without putting any of your own money upfront, essentially liquidating yourselfSources ## Publication Information - [web3 library](https://paragraph.com/@tool3/): Publication homepage - [All Posts](https://paragraph.com/@tool3/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@tool3): Subscribe to updates