🧬
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. Under the Hood of the DeFi Lego

Liquidity Rebalancing: Moving Around $9.4 Million for More Fee Revenues.

PreviousA Cross-Chain Arbitrage: The Art of Arbitraging BANANA Cross BSC and Polygon ChainsNextRebalancing loan positions utilizing AAVE Flash loan

Last updated 10 months ago

Was this helpful?

Strategy One Liner

The market maker rebalanced his liquidity in a Uniswap V3 pool trading USDC & USDT by swapping 4.15 million USDC for USDT via the 1inch aggregator to maximize fee revenues.

Big Picture

Key Steps

  • Steps 4 and 5: Remove liquidity. 1,626 USDT and 9,409,921 USDC were removed from the Uniswap V3 pool.

  • Steps 10-31: Rebalance the existing liquidity. 4,150,507 USDC was used to swap for 4,149,601 USDT via 1inch.

  • Steps 32-35: Add liquidity. 4,148,799 USDT and 5,256,909 USDC were added to the Uniswap V3 pool.

Key Protocols

  • Uniswap V3: The largest DEX.

  • Balancer, Curve, DODO: Other DEXes.

  • 1inch: An exchange aggregator that scans decentralized exchanges to find the lowest cryptocurrency prices for traders.

  • MakerDAO: A decentralized organization responsible for creating and managing the DAI stablecoin. In this transaction, it acts as a DEX swapping USDC for DAI.

The DAI uses a synthetic algorithm to peg to USD. This is different from custodial stablecoins such as USDT and USDC.

Key Addresses

  • The pentagon "from" is the market maker, a.k.a., liquidity provider(LP)'s EOA.

  • The oval "to" is LP's contract address.

  • The addresses in the right-bottom box are the addresses of Uniswap V3. You will see their usage in the following Step-by-Step Decoding. So as the addresses in the "Balancer v2" box and the "MakerDAO" box.

  • The oval "DLP", "DODO", and "Curve Pool" are different DEXes.The oval "0xa45...cba3e" is a contract created by the LP.

Key Assets

USDT, USDC, DAI

Simplified Illustration

Step-by-step Decoding

Steps 1-3: The user was going to remove liquidity. The corresponding virtual liquidities were burned.

Steps 4 and 5: Remove liquidity. 1,626 USDT and 9,409,921 USDC were removed.

Steps 6 and 7: The virtual USDT corresponding to the 1,626 USDT was removed.

Steps 8 and 9: The LP sent 4,150,507 USDC to his own contract. Then, the USDC was sent to 1inch to swap for USDT.

Steps 10 and 11: 415,050 USDC were sent to MakerDAO to swap for DAI.

Steps 12-15: The DAI was swapped for USDT at DLP and Curve.

Step 16: The swap fee was stored at their fund collection address, marked as a leaf node in the figure.

Steps 17-29: 2,988,365 USDC were swapped for USDT at Balancer, another DEX.

Steps 30 and 31: All the USDTs were aggregated at 1inch Router and then sent to the LP (user).

Steps 32-35: Add liquidity. 4,148,799 USDT and 5,256,909 USDC were added into Uniswap V3.

More Details

The concentrated liquidity of Uniswap V3 comes with a range of benefits that allow liquidity providers and users to manage their liquidity more efficiently. Market makers need to rebalance their positions regularly, and the quality of their rebalancing strategy reflects their level of expertise.

Keywords

Liquidity Rebalancing, UniswapV3, Concentrated Liquidity, Liquidity Provider

Adding and removing liquidity from the Uniswap V3 pool involves a lot of internal accounting operations. Please read to understand how EigenTx can help you get to the bottom of it.

For more details about virtual liquidity, please see

What's Really Going on When Processing Liquidity in a Uniswap Pool?
What's really going on when processing liquidity in a Uniswap Pool?
Transaction Flow Chart | EigenTx:0xc0c37f30ef0ebb0606affbd784bf17416250f49179370feb90dc7ff919b2cd86EigenPhi
Logo