EigenPhi HQ 🎯 Wisdom of DeFi (🔭, 🎙) 🦇🔊 Profile picture
Wanna understand DeFi transactions and trading strategies? 👉 https://t.co/W0ztF7lH8v 🌐 https://t.co/1IKwOLYJYS

Aug 16, 2022, 10 tweets

1/9 How to use flash loans to capitalize from an #arbitrage? Let's take a look at this transaction, where #MEV 🤖 earned 1,180 $USDC.
etherscan.io/tx/0x38f9508ce…

2/9 Let's start with the roles involved in the transaction:
• From: an EOA account, 0xffFf14106945bCB267B34711c416AA3085B8865F.
• To: MEV 🤖, 0xEdE2faFBa9e23418485f49f052D0e1d332853E0F.
• 0x1ce9: an EOA account, 0x1ce943e573041463202090cf662490c95585a046.

3/9 And protocols:
@dYdX Solo Margin: a decentralized trading platform.
• 1inch/1inch V4 Router: DeFi exchange aggregator.
• Uniswap V3: a DEX/AMM.
• MakerDAO PSM/DssPsm: Maker's Peg Stability Module.
• Curve Pool: an exchange liquidity pool on Ethereum.

4/9 Then, let's see how the #MEV 🤖 made 1,180 $USDC from the following transaction actions:

1) First, the #MEV 🤖 0xEdE2 ("to" in the figure) borrowed 1.5M $USDC from dYdX (Step "1" in the figure)

5/9
2) Then, the #MEV 🤖 0xEdE2 sent the borrowed 1.5M $USDC to 1inch (Step 2), and swapped the 💰 to 1.5M $DAI through the MakerDAO PSM (Step 3,4,5).
3) Subsequently, the #MEV 🤖 0xEdE2 sent 1.5M $DAI again to 1inch (Step 6), which helped carry out two swaps.

6/9
a. 450,000 $DAI.
With the help of 1inch, the #MEV 🤖 swapped 450,000 $DAI for 449,826 $USDT in Curve Pool (Step 7,8). Then the 449,826 $USDT were swapped for 18.97 $WBTC with 0x1ce9 (Step 9,10), which were soon used to buy 451,242 $USDC in Uniswap V3 (Step 11,12).

7/9
b. 1,050,000 $DAI.
The #MEV 🤖 swapped 1,050,000 $DAI to 1,050,000 $USDC through MakerDAO (Step 13,14,15).

8/9
4) The total 1,501,242 $USDC were sent back to the #MEV 🤖 through 1inch V4 Router (Step 16,17).
5) The #MEV 🤖 repaid the 1.5M $USDC flash loan to dYdX (Step 18).
6) The #MEV 🤖 earned 1,180 $USDC in total (Step 19), with paying 0.4883 $ETH to the miner 🔨 (Step 0,20).

9/9 I hope you've found this thread helpful.

Follow me @Eigenphi for more.

Like/Retweet the first tweet below if you can:

Enjoy the article? Visit eigenphi.substack.com
to read more like it and discover the wisdom of #DeFi. And you can download the data to #DYOR: docs.google.com/spreadsheets/d…

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling