HackerPapers

arXiv:2003.03810cs.CR

Attacking the DeFi Ecosystem with Flash Loans for Fun and Profit

Kaihua Qin, Liyi Zhou, Benjamin Livshits, Arthur Gervais

Abstract

Credit allows a lender to loan out surplus capital to a borrower. In the traditional economy, credit bears the risk that the borrower may default on its debt, the lender hence requires upfront collateral from the borrower, plus interest fee payments. Due to the atomicity of blockchain transactions, lenders can offer flash loans, i.e., loans that are only valid within one transaction and must be repaid by the end of that transaction. This concept has lead to a number of interesting attack possibilities, some of which were exploited in February 2020. This paper is the first to explore the implication of transaction atomicity and flash loans for the nascent decentralized finance (DeFi) ecosystem. We show quantitatively how transaction atomicity increases the arbitrage revenue. We moreover analyze two existing attacks with ROIs beyond 500k%. We formulate finding the attack parameters as an optimization problem over the state of the underlying Ethereum blockchain and the state of the DeFi ecosystem. We show how malicious adversaries can efficiently maximize an attack profit and hence damage the DeFi ecosystem further. Specifically, we present how two previously executed attacks can be "boosted" to result in a profit of 829.5k USD and 1.1M USD, respectively, which is a boost of 2.37x and 1.73x, respectively.

arXiv comments
Journal reference
DOI
Subjects
cs.CRCryptography and Security cs.DCDistributed, Parallel, and Cluster Computing

On Hacker News

Linked by 3 identifiable commenters in 5 comments across 3 threads, from Jan 2021 to Feb 2024. Found in 1 HN submission from Jan 2023 to Jan 2023. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments3 threads

    • Marginally related (this paper explains the mechanisms of a DeFi exploit which are the same mechanisms used generally in this 'strategy'): https://arxiv.org/abs/2003.03810

      _gmax0View on HNParent context

    • [0] identifies four use cases for flash loans: (1) arbitrage, (2) wash trading, (3) collateral swapping, and (4) flash minting. [0] Attacking the DeFi Ecosystem with Flash Loans for Fun and Profit. https://arxiv.org/abs/2003.03810

      laserlightView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.