3 ms·
But the only legitimate use of a flash loan is to do some arbitrage - and there’s plenty of that in existing financial systems. All the other uses are for lever
by joosters 6y ago
But the only legitimate use of a flash loan is to do some arbitrage - and there’s plenty of that in existing financial systems. All the other uses are for leveraging up theft and manipulation of markets. Well done cryptocurrencies, you’ve made a new cesspool of villainy!
Anyway, it’s not clear to me why flash loan providers are still a thing, as they seem to be open to a second layer of abuse: transaction copying / sniping:
All flash loan borrowing transactions are profitable (otherwise they wouldn’t be able to pay back the loan) - but why let the originator of the transaction keep that profit? What a sensible attacker should do is: 1) watch for flash loan transactions to be submitted by someone, then 2) quickly submit a duplicate transaction with a larger fee, but change the destination wallets to your own. That way, you get all the proceeds of a theft, and not just the loan interest rate.
Given this possibility, flash loan pools could be considered as ‘bait’ or a trap for the unwary thief...
- v64 6y ago> But the only legitimate use of a flash loan is to do some arbitrage - and there’s plenty of that in existing financial systems. There are two main differences: 1) The atomic nature of a flash loan makes flash loan arbitrage much less risky than performing arbitrage traditionally. Doing the same type of arbitrage non-atomically may mean that you miss the arbitrage opportunity, resulting in a loss from having to pay back the loan you took out plus interest without having made any money with it. 2) Because the debt must be repaid in the same transaction, the loan is uncollateralized. As far as I know, one cannot borrow millions of dollars in the traditional financial system without putting up some kind of collateral. > What a sensible attacker should do is: 1) watch for flash loan transactions to be submitted by someone, then 2) quickly submit a duplicate transaction with a larger fee, but change the destination wallets to your own. This has been observed on the blockchain in practice. The paper I linked to describes the mechanics of how this plays out and what strategies competing arbitrageurs use to win these opportunities.
- fbrusch 6y agoHere's a story about that (it's called "frontrunning"): https://medium.com/@danrobinson/ethereum-is-a-dark-forest-ecc5f0505dff https://medium.com/@danrobinson/ethereum-is-a-dark-forest-ec...
- tracedddd 6y agoFlash loans can totally be (and are) attacked like you describe. In fact much of DeFi can be frontrun. Most commonly it’s large trades to AMMs, where the original buyer ends up getting significantly more slippage than they expected. The future is likely private smart contracts like Secret (https://scrt.network/)in https://scrt.network/)in which the contract’s internal state and the function calls are entirely obscured using sMPC or by leveraging SGX enclaves. This makes it impossible to frontrun in most cases. Whether an unauditable financial system is a good thing or bad thing is still up for debate.
- gge 6y agoI'm late to this thread, but this is incorrect. Flash loans are used for many things other than arbitrage/attacks. 2 examples include the ability to swap collateral/debt and the ability to migrate assets between defi protocols (migrate from aave v1 to aave v2 etc). Many of Defisavers and Instadapps features are powered by flash loans.