EigenPhi: How to Earn Substantial Profits in 4 Months Using Stablecoin Arbitrage Strategies?
Author: EigenPhi
Original Title: 《How One Stablecoins Arbitrage Strategy Quietly Making US$113 Million Profit in 4 Months without Capital?》
Compiled by: Linqi, Chain Catcher
Chain Catcher Note (20:28): After multiple confirmations, there are issues with the statistical methods used for the arbitrage profits in this article; the actual profit is significantly less than $113 million, but the arbitrage mechanism does exist. This article is for reference only and does not represent any investment advice.
Key Points
The MIM-UST arbitrage strategy has generated over $113 million in the past four months.
Essentially a sophisticated form of flash loans that requires no capital investment, it only pays gas fees while achieving a 650x return, without the high miner fees associated with sandwich arbitrage or the need for smart contract coding skills.
This strategy has been utilized in relatively low-profile liquidity pools, thus remaining hidden from public view, especially from sandwich strategy users.
The flash loan strategy supports this arbitrage method by not holding positions during trades to avoid risk exposure. Involving two stablecoins can reduce the uncertainty brought by the collapse of a single stablecoin.
Tools like EigenPhi can provide insights into the increasing liquidity of flash loans, offering nearly unlimited free leverage, which requires special attention.
"Work quietly, let success speak for itself" --- Frank Ocean
MEV has been ongoing for months in NFTs, Sandwich, and Flashbots. To leverage these strategies, one needs to know how to write complex operations into smart contracts. Development, updates, and debugging of code are necessary to adapt to constantly evolving protocols. Not to mention the skyrocketing costs associated with sandwich arbitrage, especially when stablecoins are involved.
However, since November 14, 2021, the arbitrage strategy between MIM and UST, which does not require developing smart contracts, has made a profit of $113 million. During these four months up to March 23, 2022, it operated discreetly 1,419 times, with an average profit of $80,096 and a cost of $122.5 per transaction. The highest net profit was 6,001,912 dollars. Overall, the return rate of the MIM-UST arbitrage strategy is 650 times.
This is the first in-depth report on it.
Lingering on a lending platform that serves everyday cryptocurrency investors, the whole thing feels like sneaking into the back kitchen of McDonald's unnoticed, discovering a secret menu, and creating a Kobe beef meal at the cost of a small fry. In contrast, others have to wait in line to order some sausage, eggs, and burgers.
The four pillars of this arbitrage success:
- Using only two stablecoins is sufficient to generate abnormally high profits.
- Utilizing two stablecoins minimizes the risk of a single stablecoin collapsing.
- Executing this strategy does not require programming, is highly efficient, and has low operational costs.
- No positions held during execution means no risk, while taking advantage of the ample arbitrage opportunities brought by the decoupling of algorithmic stablecoins.
How the Miracle Happened
First, this arbitrage is essentially a flash loan strategy, which means borrowing tokens, earning profits, and instantly repaying the loan in a single transaction. If any issues arise during the transaction, the lender incurs no loss, as the entire process will be rolled back. (More details 1;2).
We learn how it works through a transaction disclosed by eigenphi.io.
This arbitrage made over $100,000 in profit, while the gas and swap costs in the liquidity pool were less than $30.1. We classify this type of arbitrage as "spatial." Typically, spatial arbitrage requires understanding the exchange rate differences of specific tokens between different liquidity pools, usually Uniswap and Sushiswap. Trading based on price differences benefits the trader. But the example below is a completely different beast.
Open the transaction details overview on the Ethereum block explorer; five transactions create miracles.
- ++Contract++ starting with 0x59e: ++MIM CauldronV2 Lending Protocol++ deployed by the money team. It: "supports users to borrow, lend MIM, use leverage, and repay. Abracadabra.money is a lending platform that uses interest-bearing tokens (ibTKN) as collateral to borrow stablecoins pegged to the dollar (Magic Internet Money---MIM)."
- The ++address++ starting with 0xd96, displayed as money's ++Degenbox++, deployed by Abracadabra.money, allows for the creation of strategies for internal assets. Degenbox is a vault for lending, specifically ++UST++ in this example. The previously mentioned Cauldron is built on top of Degenbox.
- The address starting with 0xff4 is the ++USTSwapper++ deployed by money.
- The address starting with 0x55a is a ++liquidity pool++ based on Curve Plain Pool, used for MIM-UST transfers. An external oracle sets the exchange rate here.
- The address starting with 0xb98 is the trader who initiated the transaction.
The following diagram illustrates the token arbitrage process.
- The trader borrows 243,098.235492 UST from Degenbox and calls USTSwapper.
- The trader instructs USTSwapper to exchange 243,098.235492 UST for 244,132.700775 MIM in the MIM-UST-f curve pool using the current exchange rate.
- The trader returns 244,132.700775 MIM to Degenbox to repay the borrowed asset.
- The trader uses Degenbox to convert 244,132.700775 MIM back to UST, paying off the loan incurred in step 1. According to the public exchange rate, Degenbox converts out 344,119.620672 UST, of which 243,098.235492 UST is used for repayment, leaving 101,021.385180 UST for profit. The trader withdraws 101,021.385180 UST, completing the transaction.
However, what spell did the trader use to make all this happen on a well-known DeFi lending platform without attracting attention? We must delve into the code level to understand how the trader turned fries into Kobe beef with the "secret menu."
Finding the Golden Ticket in the Code
If you are interested in the specific technical details, please continue reading. Otherwise, we suggest skipping the following steps.
- The trader uses the cook() of the Cauldron V2 protocol, incorporating a set of executable instructions as parameters for this method into a single transaction, which is a prerequisite for flash loans. Meanwhile, the cook() method can be executed without being on-chain.
- The trader calls ACTIONUPDATEEXCHANGE_RATE, which invokes the contract's internal accrue() to obtain borrowable assets.
- The trader calls the internal _removeCollateral() of Cauldron V2 to exchange for UST.
- The trader calls USTSwapper to convert UST to MIM.
- The trader uses the internal _repay() of Cauldron V2 to return MIM to Degenbox to secure the arbitrage position.
- The trader calls _removeCollateral() again to release the collateral.
- The trader calls withdraw() and withdraws the UST position.
Upon further exploration, it was found that the code of Degenbox is a fork of the SushiSwap vault: BentoBox, which is the cornerstone of the lending and margin trading platform Kashi.
In summary, the following two points are essential.
- Master the cook() of the Cauldron V2 protocol to avoid cumbersome coding, debugging, and deployment.
- Continuously monitor exchange rate differences to determine the best timing.
Of course, ETH is also needed for gas fees.
List of Participating Addresses
From November 14, 2021, to March 23, 2022, 1,086 trading addresses executed this strategy 1,419 times, as shown in the figure below. The blue bars represent the number of transactions on that day.
To make the trend easier to read, the following chart presents the profit data processed logarithmically.
Profits and transaction numbers peaked on January 27 and 28, during the 0xSifu incident. He was the CFO of "Frog Nation," a loose project conglomerate that includes Popsicle Finance, Wonderland, and Abracadabra. The news at that time severely impacted MIM, triggering speculation about MIM decoupling from the dollar. The low point for MIM on the 27th was $0.9735, and on the 28th it was $0.9776. The volatility of MIM triggered an astonishing arbitrage margin.
During those two days, 555 transactions generated over $50 million in profits from the total of $113 million across 1,419 transactions.
The table below shows the ten most profitable trades using the MIM-UST arbitrage strategy throughout the entire period. We share trader and trading address data, including all 1,419 transactions. So feel free to DYOR, and we look forward to your discoveries.
Conclusion: Stablecoins Take You Over the Rainbow
Stablecoins are seen as the anchor of blockchain. Stability means lower volatility, which implies lower returns. However, the 650x return from the MIM-UST arbitrage strategy challenges this general view, which is due to its nature: flash loans. Over the past two years, flash loans have become the monetary multiplier of DeFi, introducing unrestricted, nearly free liquidity leverage. EigenPhi data shows that 100% of arbitrage on DEX is either flash loans or flash swaps. Therefore, similar strategies require special attention.
Currently, flash loans have taken stablecoins into the wild west. With newly created protocols, the right knowledge of tools like EigenPhi, and an unrestricted mindset and imagination, stablecoin arbitrage is not out of reach. On the contrary, it will take you above the rainbow, to greater heights.