Attempts to Find Flash Loan Arbitrage

Flash loans became a popular idea for taking advantage of arbitrage opportunities without needing to risk (or even have other access to) capital. They allow market participants to take out a loan with no collateral, perform any series of transactions, and pay back the loan, as long as this is all completed in the same transaction. If the series of transactions cannot be completed in the same transaction, the whole series is canceled, including the loan, and the borrower walks away risk free. In practice, a successful arbitrage can be quite difficult to achieve (although free to try!) via flash loan, due to the requirement of successfully executing all desired transactions in the same transaction, and the higher gas fees for flash loans. I present a potential arbitrage trade involving a flash loan, a collateralized loan, and an option risk reversal, inspired by the strategy of Aetienne Sardon, Section 4.4.1, followed by some market implications of more complicated flash loan arbitrage strategies.

Why not a simpler arbitrage approach?

Arbitrage can involve as few as two assets. If ETH/USD, for example, is priced at 1600 on one venue, and USD/ETH is priced at 0.00062 on another venue, which is less than , then an arbitrage opportunity exists. In this case, since USD/ETH is lower than it should be, the arbitrage would be:

  • Buy 1 ETH with 1600 USD on the first venue.
  • Convert 1 ETH back to USD on the second venue to get USD.
  • Pocket 12.90 USD from arbitrage!

This arbitrage ignores gas fees, which will be true for all transactions described in this document. To execute any of these in reality, one would have to make sure the profit was higher than the gas fees. The calculations above also assume 0 slippage on either of the trade executions, and that I have 1600 USD worth of capital to invest in the series of transactions. To solve the last two issues, enter flash loans. With flash loans, zero capital is required, which is particularly relevant if I am not satisfied with 12.90 USD profit, and would like to execute this trade many many times until I am satisfied. In that case, I would need that many times the capital, which is both harder to come by, and more painful to risk even if I had it. Instead, I can take out a flash loan, ensure that my trade is either fully successful or canceled, and not worry about slippage beyond an instantaneous time horizon, since everything happens in the same transaction. Flash loans do, however, impose higher gas fees, so one would have to make sure the profit was enough to counteract the fees.

Simple arbitrage is quite difficult to achieve via flash loans, even when bringing more than two assets into the picture. In fact, one can make any length cycle of arbitrage. For example, a triangular arbitrage involves three assets, and could, for instance, take advantage of an inefficiency in the three pairs ETH/USD, USD/BTC, and BTC/ETH to make a profit. Based on this article, however, as of late March this year, the PancakeSwap market was already too efficient to present any triangular arbitrage opportunities. A glance at EigenPhi shows that there are still a handful of flash loan arbitrage opportunities every day. Not all of them are necessarily worthwhile, however. For example, this arbitrage borrowed over 42,000 USD worth of agEUR, and performed arbitrage using EUROC and USDC, for a net profit of less than 6 USD (159 USD revenue, 153 USD cost).

While the hope for relatively simple flash loan arbitrage opportunities seems slim, the opportunity to borrow assets with no risk is so good that it seems impossible that there is no way to exploit it. “Exploiting,” here, means doing so in a harmless manner, i.e.: taking advantage of market inefficiencies, not manipulating prices with a flash loan attack. I will explore what an astute trader, not an expert hacker, would do with flash loans (with no disrespect to expert hackers, as, whether right or wrong, flash loan attacks are quite impressive when pulled off).

Types of Loans

I will describe two other types of loans: collateralized loans and zero-liquidation loans. Collateralized loans are readily available via venues such as AAVE. They involve leaving a collateral in one currency, and taking out a loan in a different currency for some value up to a maximum loan-to-value ratio (LTV). For example, if ETH/USDC’s fair value is 1600 (I use USDC because AAVE doesn’t allow borrowing USD, though I generally treat USD and USDC as interchangeable throughout this document), I can look up in this table that the LTV for USDC is 75%. So I can deposit 1 ETH of collateral, and borrow 1200 USDC. With this USDC, I can do what I please, while remaining long 1 ETH via my collateral. I can even buy more ETH, for leverage, or trade ETH options, to create option combo strategies.

For the borrower, the downside to a collateralized loan is the potential for liquidation. In this example, if I borrowed the maximum 1200 USDC allow by the 75% LTV, and then 1 ETH became worth 1500 USDC, I am now borrowing more than 80% of the value of my collateral, which is more than the maximum allowed 75%. AAVE will then allow others to liquidate some of my collateral. The liquidator can pay off up to 50% of my loan, while receiving the corresponding value in ETH plus a bonus, which the AAVE table shows to be 5% for USDC. The liquidator is paid out of my collateral. Usually, the liquidator will liquidate the maximum allowed amount, in order to maximize the bonus.

In this case, they would pay back 600 USDC to cover 50% of my loan. This is worth ETH. With the 5% bonus, that is 0.42 ETH that they receive from my collateral. So post-liquidation, I have 0.58 ETH, and I owe 600 USDC for my loan. My LTV is , which is now below 75%, so my loan is considered “healthy” again. Note that I am still holding 1200 USDC, and only need to pay back 600 USDC plus interest, but I will withdraw only 0.58 ETH when I pay it back, when I initially put in 1 ETH.

Zero-liquidation loans, which I was made aware of by Sardon, offer an alternative to these messy liquidations (Sardon’s graphs show how messy they are). They offer lower LTV ratios, give a fixed payment amount to receive the collateral back, and give the option of walking away with your borrowed amount and currency instead of paying your loan back.

Giving a similar example to above, I still pledge 1 ETH of collateral when ETH/USDC is valued at 1600. The liquidity pool determines (based on supply and demand), for example, that I can borrow 800 USDC, and in 90 days, I am due to pay back 820 USDC to receive my collateral back. If I am holding at least 820 USDC at the end of 90 days, and ETH/USDC is valued at 820 or higher, I should pay off my loan and receive my 1 ETH collateral back. However, if either I have gambled away my 820 USDC on worthless options (i.e.: unable to pay back my loan), or ETH/USDC has dropped below 820 by the end of 90 days, I can walk away from my loan scot-free. The liquidity provider keeps the 1 ETH, and I keep whatever USDC (or other assets) I currently have.

Enter Options

Sardon observes that a zero-liquidation loan is much like a call option. An option gives the right but not the obligation to buy or sell an underlying asset. An option has a strike price and a maturity. A call option gives the right to buy the underlying asset at the strike price. A put option gives the right to sell the underlying asset at the strike price.

For example, an 820 strike ETH call gives the right but not the obligation to buy 1 ETH for 820 (usually USD, but could be priced based on another asset). An 820 strike ETH put gives the right but not the obligation to sell 1 ETH for 820. In order to exercise (take advantage of the right) a put option, I need to already own 1 ETH, though many market participants can quickly procure 1 ETH from the market if it is profitable to do so. For example, if I own this 820 ETH put when ETH/USD is valued at 600, I can buy 1 ETH for 600 USD, and exercise my put option to immediately sell it for 820 USD, making a profit of 220 USD (assuming no fees, no slippage, and that I obtained the put option for free).

The maturity of the option, and also the settlement type, determines when you can exercise your option. An option always expires if not exercised by maturity. The possible settlement types in cryptocurrency options are American, European, and Bermuda. American options can be exercised any time from the purchase of the option till its maturity. European options can only be exercised at maturity. Bermuda options can be exercised up to one day before maturity.

The example at the end of the previous section describes an American ETH call with 820 strike and 90 day maturity. This similarity between zero-liquidation loans and call options inspired Sardon’s arbitrage strategy (in Section 4.4.1 of his paper), involving a flash loan, a zero-liquidation loan, and a call option.

A Quick Note on Options Pricing

Before diving into Sardon’s strategy, and modifying it to use collateralized loans, because zero-liquidation loans aren’t widely available currently, I will describe some basics of options pricing. An option’s price as two components: intrinsic and time value. The intrinsic price is the amount the option would be worth if it expired right now. For example, if ETH/USD is valued at 1600, a 1500 strike ETH call has an intrinsic value of 100 USD, an 1800 strike ETH put has an intrinsic value of 200 USD, and a 1500 strike ETH put has an intrinsic value of 0 (it is worthless).

The time value is the price of the optionality. Because the minimum payout of any option is 0 (there is always the option to let it expire worthless if it is not profitable to exercise it), that optionality is inherently worth something. When ETH/USD is valued at 1600, we might see a 90 day maturity 1500 strike ETH call trading for much more than 100 USD, especially in a market that is bullish on ETH. In fact, we will likely also see a 1500 strike ETH put trading for at least 10 (and up to quite a lot more, depending on the volatility and bearishness of the market) USD, because there is a chance ETH/USD will dip below (perhaps substantially below) 1500, making a 1500 strike ETH put worth something by time of expiry, even though its current intrinsic value is 0. Options with non-zero intrinsic value are called in-the-money, and options with zero intrinsic value are call out-of-the-money.

American options have more time value than European options, because there is more optionality. Bermuda options (theoretically) have time value between American and European options. Markets can be inefficient, and these inequalities may not always hold.

Sardon’s Arbitrage Strategy

Finally, I can describe Sardon’s arbitrage strategy. I will do so via example, where, again ETH/USD is valued at 1600.

  • Take out a flash loan for 1600 USD.
  • Buy 1 ETH.
  • Take out a zero-liquidation loan, with 1 ETH as collateral, for 800 USD. The condition for repayment is to pay back 820 USD in 90 days.
  • Check if there is an 820 strike 90 day maturity ETH call option that I can sell for at least 800 USD. If there is not, there is no arbitrage opportunity, and we cancel the whole transaction. Let’s say there is one that I can sell for 810 USD (intrinsic value is 780 USD). Then I sell it.
  • Now I am holding 810 + 800 = 1610 USD. I pay back the flash loan and pocket 10 USD. I can do this at scale for as many calls as I can sell for 810 USD, and pocket that many times 10 USD.

Observe that my ending position is risk-free. If the buyer of the call option wishes to exercise the option, they will pay me 820 USD to buy 1 ETH. I can use the 820 USD to pay back my loan and collect the 1 ETH collateral to give to the option buyer. If they do not wish to exercise the option, I leave the 1 ETH collateral with the liquidity provider, and walk away from the loan.

Modifying the Strategy for Collateralized Loans

Since zero-liquidation loans are not very common currently, it is not practical to implement Sardon’s strategy in the market. If I replace zero-liquidation loans with collateralized loans, Sardon’s strategy is viable to execute, as ETH options can be traded on-chain via Hegic. I first try to copy-and-paste the exact strategy, and then replace the zero-liquidation loan with a collateralized loan. (Suppose the interest rate of the collateralized loan works out that I would owe 820 USD in 90 days.) There are two massive problems with this strategy. The first is that if ETH/USD prices change dramatically, I might get liquidated. The second is that I cannot just walk away from a collateralized loan like I can from a zero-liquidation loan. If the option buyer does not exercise their call, I am stuck with this loan that I owe money for, and I have zero capital to pay it back.

I solve these problems by also buying a put at a higher strike that will protect me from liquidation. I calculate that, with maximum LTV 75%, I am at risk of being liquidated when ETH/USD falls below
. So I buy the 1100 strike ETH put at the same time as I sell the 820 strike ETH call. For extra safety, make sure the put is American and the call is European. That way, my position is much more flexible than that of the market participant who buys the call from me. Note that the 1100 strike ETH put is far out of the money when ETH/USD is 1600, so I can likely buy it for very little (quite possibly under 1 USD). However, I do need to add the value of this put to my fees, to make sure I still turn a profit at the end of the transaction.

Now, if ETH/USD dips below 1100, say it is 1080, I do the following:

  • Take out a flash loan for 1 ETH.
  • Exercise my put option, selling the ETH for 1100 USD.
  • Pay back my loan using 820 USD.
  • Buy an 820 strike ETH call with the same maturity as the one I sold. I am holding 280 USD, and the intrinsic value of the call is now 260 USD. If I need to use some of the 10 USD I made from the initial arbitrage, I can do that. Since time has passed since the initial transaction, it is unlikely that the time value of the call has increased (it was originally 30 USD, which I took as arbitrage because it was overpriced).
  • Get 1 ETH back from my collateral.
  • Pay off the flash loan.

What I have done in step 4 is flatten my position. After buying an 820 strike ETH call, I am flat in ETH options. It is important to be flat, because I returned my collateral to the flash loan, so I would not have wanted to worry about the initial option buyer exercising their call, as I would not have been able to deliver them 1 ETH. There is some risk of losing the 10 USD, or perhaps more, in this second transaction, but it is fairly low, for the reasons described in step 4. The best case scenario is to never get to this point. If ETH/USD is somewhat stable or rising, I will never worry about liquidation, the option buyer will exercise their option, and I will keep my initial arbitrage profit as desired. The second transaction only acts as insurance for my collateralized loan, since the loan is not as clean as a zero-liquidation loan.

An option trader calls a long call short put position a risk reversal. So in this strategy, I am short a risk reversal. The name is not important, but it is one of many option combos that can be traded. Others include flys, straddles, strangles, calendars, and boxes. I share these because there might be more (and perhaps better!) option combos that can be used with collateralized loans for flash loan arbitrage. Many cryptocurrency markets are becoming efficient, but a quick glance at Deribit showed that this is not currently the case for crypto options markets, thus giving opportunities for arbitrage. The inefficiency may be due to some major players dropping out of the crypto options markets following the FTX incident and other regulatory pressures.

Market Microstructure Implications of Arbitrage with Flash Loans and ETH Options

There are several potential consequences of arbitrage using flash loans and ETH options. The first is that if zero-liquidation loans become more popular, the ETH options market would become more efficient, as zero-liquidation loans would essentially be fungible with ETH options via Sardon’s strategy. This essentially creates ETH options market liquidity, and thus efficiency, and so the arbitrage opportunities described in this document would mostly disappear.

Along the same lines, if my collateralized loan version of Sardon’s strategy were adopted by multiple market participants, this would also force the ETH options market to become more efficient. However, due to the potential required step of exercising of the put option using a second flash loan, my strategy is less attractive than Sardon’s, and may not be widely adopted, even if it is probably profitable after fees. If the second step fails for any reason, liquidation risk cannot be avoided, and the strategy will fail.

More interestingly, I believe that even if flash loan ETH options arbitrage strategies were to become popular, the same fate would befall these strategies as befell triangular arbitrage opportunities. If multiple market participants were interested in these strategies, there may be a race to these arbitrage opportunities, resulting in more users bidding higher fees to block builders to win the arbitrage trades. In this case, market participants trading with their own liquidity (instead of via flash loan) would win, as their gas fees are lower, so they can pay more to the block builder. However, flash loan arbitrage is less risky, as the entire transaction will be cancelled if one of the legs fail. Thus, the juiciest opportunities, which are worth the risk, would likely go to market participants trading with their own liquidity. The opportunities left to flash loans might be, as with triangle arbitrage opportunities, largely ones like the EigenPhi example I linked earlier in the document, with 6 USD profit resulting from borrowing over 42,000 USD.

In fact, this fate would likely befall any flash loan arbitrage strategy, due to the higher gas fees associated with flash loans. The “risk-free money” is thwarted by fees, like many other market opportunities that seem too good to be true. Therefore, successful attempts to find juicy flash loan arbitrage opportunities would likely only work for a short time, before being eroded away by those who can take advantage of these opportunities with their own capital.