🧬
Head First DeFi: TX & Strategies
  • Decoding the DNA of DeFi Transactions & Strategies
    • From Arbitrage, Sandwich to JIT and Oracle Manipulation
    • Be Prepared To Explore the DeFi World
    • Case Study Format
  • MEV Transaction & Strategy 101
    • A $3.2 Million Profit Arbitrage, the Most Lucrative MEV of 2022
    • Understand Back-Run Arbitrages and Their Signals and Join the MEV Game.
    • Wallchain's MEV Arbitrage Redistribution
    • MEV Blocker, the multi-transaction MEV redistribution system that refunds 90% of builder rewards
    • With NFT arbitrage, someone was snipping your Baby Doge.
    • The Hidden Tax That You Should Know About
    • MEV-Share, Flashbots' MEV Redistribution Solution
  • Don't Let Your Trading Become the Recipe of Someone's Sandwich
    • The Notorious Jaredfromsubway.eth's Sandwich Attack
    • Combined with Flash Loan, This Leveraged Sandwich Launched the Attack with Millions of Volumes
    • Sandwich Targeting Liquidity Providers
    • The Flash-Loan-Enabled Sandwich Attack against Ethereum Foundation
  • Under the Hood of the DeFi Lego
    • What's Really Going on When Processing Liquidity in a Uniswap Pool?
      • Pretend You Are One of the Shareholders of a Bank Branch.
      • Let's Match the Bank Branch to a Uniswap Pool.
      • Adding Liquidity.
      • Removing Liquidity.
      • Conclusion
    • Liquidation: A Good Entry Point to Comprehend Internal Accounting Used by Many DeFi Protocols.
    • A Cross-Chain Arbitrage: The Art of Arbitraging BANANA Cross BSC and Polygon Chains
    • Liquidity Rebalancing: Moving Around $9.4 Million for More Fee Revenues.
    • Rebalancing loan positions utilizing AAVE Flash loan
    • How Does the Grok Token Exploiter Exploit the X Token By Baking His Own Cake And Eating it?
  • Unlocking the Power of Advanced DeFi Transactions and Becoming a DeFi Sleuth
    • Just-in-Time, an MEV Type That Benefits Traders in the Same Trading Venue
    • A Bot Devised Arbitrage Strategies Centered on Autonomous Minting and Burning of Synthetic Tokens
    • The Defect in a Lending Protocol's Oracle Module Was Exploited by a Bot to Generate a $110K Profit
    • A $296K-Profit Arbitrage Done by the Lightning Reflex Bot After the Vyper-Curve Exploit
    • Coffeebabe.eth Utilized Curve's CRV/WETH Pool's Price Deviation for a $5.4 Million Profit Arbitrage.
    • An Attacker Baited MEV Arbitrage Bots and Emptied Their Wallets
    • How Enso Solves 73.5ETH in 116 Steps in One Transaction
Powered by GitBook
On this page
  • Strategy One Liner
  • Big Picture
  • Key Steps
  • Key Protocols
  • Key Addresses
  • Key Assets
  • Simplified Illustration
  • Step-by-step Decoding
  • More Details
  • Keywords

Was this helpful?

  1. Unlocking the Power of Advanced DeFi Transactions and Becoming a DeFi Sleuth

Coffeebabe.eth Utilized Curve's CRV/WETH Pool's Price Deviation for a $5.4 Million Profit Arbitrage.

PreviousA $296K-Profit Arbitrage Done by the Lightning Reflex Bot After the Vyper-Curve ExploitNextAn Attacker Baited MEV Arbitrage Bots and Emptied Their Wallets

Last updated 1 year ago

Was this helpful?

Strategy One Liner

After the , Coffeebabe.eth utilized the Vyper-based Curve CRV/WETH pool's significant price deviation from the market price and made an arbitrage with a $5.4 million profit.

Big Picture

Key Steps

  1. Step 0: Borrow 100 WETH from Balancer Vault using Flash Loan.

  2. Steps 2-3: Sell 70 WETH on UniswapV3Pool to obtain 190,388 CRV at an average exchange rate of 2719 CRV/WETH.

  3. Steps 4-5: Directly transfer and trigger claim_admin_fees operation by sending 30,000 CRV to the Curve Pool. This operation will update parameters such as pool balance and total supply.

  4. Steps 6-9: Call the exchange method of the Curve Pool to convert and exchange a total of 160,388 CRV for approximately ETH equivalent to be converted back into WETH at an average exchange rate of approximately 54.375 CRV/WETH.

  5. Step 13: Return the borrowed amount of 100WETH through Flash Loan.

  6. Steps 14-16: Convert the remaining 2879WETH into ETH and send it back to the 'from' address.

Step 5, claim_admin_fees operation, is crucial. Due to the exploitation of Vyper-related contracts, there has been a significant deviation between the actual balances of the pool created using Vyper and their internal accounting values. The purpose of claim_admin_fees() is to align the internal accounting amount with the actual balance, similar to Uniswap V2's skim() method

Key Protocols

UniswapV3: the largest decentralized exchange (DEX)

Balancer, Curve: other major DEXes

Key Addresses

The pentagon "from" is Coffeebabe's EOA address.

The oval "to" is Coffeebabe's contract address.

The solid oval "WETH" is the WETH token's address.

The oval "UniswapV3Pool", "Balancer Vault", and "Curve Pool" are the pool addresses for DEXes.

Key Assets

ETH, WETH, CRV

Simplified Illustration

Step-by-step Decoding

  1. Step 0: Borrow 100 WETH from Balancer Vault using Flash Loan.

  2. Steps 2-3: Sell 70 WETH on UniswapV3Pool to obtain 190,388 CRV at an average exchange rate of 2719 CRV/WETH.

  3. Step 4: Directly transfer and trigger claim_admin_fees operation by sending 30,000 CRV to the Curve Pool. This operation will update parameters such as pool balance and total supply.

  4. Step 5: Internal operation of Curve.

  5. Steps 6-9: Call the exchange method of the Curve Pool to convert and exchange a total of 160,388 CRV for approximately ETH equivalent to be converted back into WETH at an average exchange rate of approximately 54.375 CRV/WETH.

  6. Step 10: Internal operation of Curve corresponding to steps 6-9.

  7. Steps 11-12: The 'to' transfers ETH to itself for unknown reasons.

  8. Step 13: Return the borrowed amount of 100WETH through Flash Loan.

  9. Steps 14-16: Convert the remaining 2879WETH into ETH and send it back to the 'from' address.

More Details

By simulating execution, we find that without executing claim_admin_fees() before calling exchange() for conversion, according to the internal accounting of this contract, 190,388 CRV can only swap for 9.337 ETH at an average price of 20390 CRV/ETH. The valuation of CRV is much lower than what actually occurs in arbitrage trading.

However, after executing claim_admin_fees() before calling exchange(), based on the actual balances of this pool, the exchange rate becomes very favorable for Searcher.In Step 4, directly transferring 30000 CRV to Vyper_contract is a prerequisite for successfully calling claim_admin_fees(). If the value is significantly less than 30000 (e.g., 25000), a rollback will occur during the claiming process.

In essence, this arbitrage is not something that anyone can easily do. The white hat understands the intricate operations within smart contracts.

That being said, there are still questions that remain unanswered, such as: why did the "to" address transfer to itself 3 times? And what's the connection between this TX and other large amount arbitrages?

Keywords

White Hat, Arbitrage, Price Manipulation

The arbitrage profit of 2879 ETH ($5,364,863) all flowed into the address c0ffeebabe.eth's pocket, without paying a priority fee or builder tip to the builder, and paid a base fee of approximately $32.3. After nearly two hours, c0ffeebabe.eth to Curve.fi: Deployer.

transferred the transaction proceeds
Vyper-Curve Exploit
Transaction Flow Chart | EigenTx:0xcd99fadd7e28a42a063e07d9d86f67c88e10a7afe5921bd28cd1124924ae2052EigenPhi
Logo