🧬
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

Was this helpful?

  1. Under the Hood of the DeFi Lego
  2. What's Really Going on When Processing Liquidity in a Uniswap Pool?

Let's Match the Bank Branch to a Uniswap Pool.

PreviousPretend You Are One of the Shareholders of a Bank Branch.NextAdding Liquidity.

Last updated 1 year ago

Was this helpful?

A Uniswap Pool is like a bank branch. We have a table like this showing an Unsiwap V3 pool trading WBTC and USDC.

In this table:

  • The number 350101 is the liquidity provider's identification number.

  • "UNI-V3-POS" is the NFT contract used by Uniswap. When a liquidity provider adds WBTC and USDC to the pool, the contract will mint an NFT and send it to the liquidity provider. This is an actual contract that was deployed by the Uniswap team. EigenTx uses this contract to represent the internal records of liquidity providers' contributions.

  • "UNI-V3-POS-350101" is the actual NFT issued by the aforementioned NFT contract. EigenTx uses it to represent the external records of the liquidity providers' contributions.

  • Besides the two above, the left contracts are virtual contracts introduced by EigenTx to demonstrate the internal accounting procedure, following the double-entre bookkeeping rules.

  • EigenTx also uses virtual assets for internal accounting, which can be found in the following example.

You can put on the Liquidity Provider hat now.

  • "virtualOwed0WBTC" and "virtualOwed1USDC" are virtual contracts storing your WBTC and USDC contribution to the pool for internal uses.

  • "virtualOwed0WBTC-350101" and "virtualOwed1USDC--350101" are virtual contracts storing your WBTC and USDC contribution to the pool for your use.

  • The pool has the data of the total shares of this pool, marked as "virtualLiquidity."

  • Your exclusive shares of the pool are recorded in "virtualLiquidity-350101."

  • EigenTx uses "mint" to show a record of adding one kind of asset or shares, which could be actual or virtual, to a contract.

  • EigenTx uses "burn" to show a record of removing one kind of asset or shares, which could be actual or virtual, from a contract.

We can also match the assets and shares between the bank branch analogy and the pool.