ERC-4626 Vault & Liquid Staking (LST/LRT) Depeg Arbitrage: Atomic Mint/Redeem vs. DEX Liquidity

Most entry-level DeFi trading and MEV bots focus on the same token pair across two pools: buy WETH on Uniswap V2, for example, and sell it for USDC on Aerodrome. As professional market makers enter these trades, spreads between identical assets have narrowed until they cannot even cover Ethereum gas costs.

Larger excess returns remain in pricing differences between the primary and secondary markets for yield-bearing assets, ERC-4626 vaults, and liquid staking/restaking tokens (LST/LRT), such as wstETH, cbETH, sUSDe, and weETH.

These differences arise from liquidity mismatches in the underlying assets:

  • Primary market: ERC-4626 vault contracts provide deterministic minting and redemption rates based on the net asset value (NAV) of underlying collateral, through IERC4626.previewRedeem or previewDeposit. At this contract entry point, each share equals its corresponding collateral claim.
  • Secondary market: AMM liquidity pools reflect immediate supply and demand. During market crashes, leveraged liquidations, or panic selling, whales may sell tens of millions of dollars of yield-bearing tokens into DEX pools regardless of slippage to obtain ETH or USDC. Spot prices can fall below vault NAV, creating discounts of 1%–5%.

An engine that combines AMM interactions with atomic ERC-4626 primary-market minting/redemption and flash loans can execute a no-capital sequence within one Ethereum transaction block: Borrow WETH from Uniswap V3 → buy panic-sold vault shares on a DEX at 0.98 → call the vault’s redeem at full 1.00 NAV to receive underlying WETH → repay flash-loan principal and fees, earning an entirely risk-free 2% net profit.

Using the production multihop executor (evm-arbitrage/src/FlashMultiHopArb.sol), this article examines primary/secondary market depeg mathematics, mixed DEX_ERC4626_DEPOSIT and DEX_ERC4626_REDEEM routing, vault liquidity limits (maxRedeem), and exit-fee controls.


Primary/Secondary Market Depeg Execution Topology

ERC-4626 Vault & Liquid Staking (LST/LRT) Depeg Arbitrage: Atomic Mint/Redeem vs. DEX Liquidity

Unlike a conventional DEX cycle, mixed ERC-4626 arbitrage connects internal vault minting/redemption with external pool trading in both directions:

+-----------------------------------------------------------------------------------+
|                ERC-4626 / LST Atomic Flash-Loan Depeg Arbitrage (discount redemption) |
+-----------------------------------------------------------------------------------+
|  [Stage 1: Flash-loan funding]                                                      |
|  Borrow 100 WETH from Uniswap V3 (0.05% fee = 0.05 WETH)                            |
|  -------------------------------------------------------------------------------- |
|  [Stage 2: Buy at a discount on the secondary market (DEX Swap Leg)]                 |
|  Whale selling pushes DEX wstETH/WETH to 1:1.10 (official NAV is 1:1.15)              |
|  -> _swapV3 / _swapV2 exchanges 100 WETH for 90.909 wstETH                            |
|  -------------------------------------------------------------------------------- |
|  [Stage 3: Redeem at NAV (ERC-4626 Primary Market Leg)]                              |
|  Call IERC4626.redeem(90.909 wstETH shares)                                          |
|  -> Vault settles at NAV 1.15: 90.909 * 1.15 = 104.545 WETH underlying assets        |
|  -------------------------------------------------------------------------------- |
|  [Stage 4: Flash Repayment & Settlement]                                            |
|  Repay 100.05 WETH principal and fees                                               |
|  -> Lock risk-free net profit: 104.545 - 100.05 = 4.495 WETH!                         |
|  -> Assert netProfit >= minProfit; pay miner Bribe for top-of-block inclusion        |
+-----------------------------------------------------------------------------------+

If the opposite extreme occurs, such as demand for a new high-APY farm driving yield-token premiums, reverse the sequence: borrow underlying assets → call deposit to mint shares at NAV → sell shares at a premium on the secondary market → repay and settle.


Comparing Conventional Arbitrage with Primary/Secondary Depeg Arbitrage

Dimension Two-DEX arbitrage (Uniswap vs Aerodrome) Third-party aggregators (1inch / Paraswap) Fone native ERC-4626 flash-loan engine
Spread and competition Highly competitive; typically 0.05%–0.2% High commissions, heavy call stack, prone to front-running 1%–5% spreads from liquidity panic; fewer competitors
Capital requirements Substantial own collateral Uses wallet-owned assets 0 own principal (atomic unsecured flash loans of millions of dollars)
Gas About 150,000–200,000 Over 450,000 with many routing layers About 180,000 through direct redeem/deposit calls
Failure safety Partial execution can leave stuck trades Depends on external contract logic Atomic revert if the spread cannot cover borrowing fees
Transfer taxes and nonstandard tokens Vault exit fees can break execution Often assumes standard 18-decimal tokens Before/after balance accounting (balanceOf - balBefore)

Core Contract Implementation: FlashMultiHopArb.sol

In evm-arbitrage/src/FlashMultiHopArb.sol, four executor types cover V2, V3, and the ERC-4626 primary market:

// From evm-arbitrage/src/FlashMultiHopArb.sol
    // Route executor types
    uint8 public constant DEX_V2 = 0;             // Uniswap V2 / Aerodrome Volatile
    uint8 public constant DEX_V3 = 1;             // Uniswap V3 / Slipstream concentrated liquidity
    uint8 public constant DEX_ERC4626_DEPOSIT = 2; // ERC-4626 primary minting (underlying -> shares)
    uint8 public constant DEX_ERC4626_REDEEM = 3;  // ERC-4626 primary redemption (shares -> underlying)

    struct SwapStep {
        uint8 dexType;      // 0: V2, 1: V3, 2: ERC4626 Deposit, 3: ERC4626 Redeem
        address pool;       // Target Pair / Pool / ERC4626 Vault address
        address tokenIn;    // Input token for this hop
        address tokenOut;   // Output token for this hop
        uint256 feeBps;     // Fee configuration
    }

1. ERC-4626 Deposit Logic (_depositERC4626)

When shares trade at a premium, the route calls _depositERC4626. The contract approves input tokens for the vault, invokes standard deposit, and measures received shares through the actual before/after token-balance difference, preventing hidden truncation:

// From evm-arbitrage/src/FlashMultiHopArb.sol
    function _depositERC4626(
        SwapStep memory step,
        uint256 amountIn,
        uint256 hopIndex
    ) internal returns (uint256 amountOut) {
        // 1. Approve the vault to transfer underlying assets
        IERC20(step.tokenIn).approve(step.pool, amountIn);
        
        // 2. Record current vault-share balance
        uint256 balBefore = IERC20(step.tokenOut).balanceOf(address(this));
        
        // 3. Call standard ERC-4626 deposit (underlying -> shares)
        IERC4626(step.pool).deposit(amountIn, address(this));
        
        // 4. Calculate actual shares received (handles internal vault fees)
        amountOut = IERC20(step.tokenOut).balanceOf(address(this)) - balBefore;
        if (amountOut == 0) revert ZeroOutputOnHop(hopIndex);
    }

2. ERC-4626 NAV Redemption (_redeemERC4626)

During a panic-driven secondary-market discount, the engine calls _redeemERC4626. The contract burns shares and immediately receives underlying assets within the same call frame:

// From evm-arbitrage/src/FlashMultiHopArb.sol
    function _redeemERC4626(
        SwapStep memory step,
        uint256 amountIn,
        uint256 hopIndex
    ) internal returns (uint256 amountOut) {
        uint256 balBefore = IERC20(step.tokenOut).balanceOf(address(this));
        
        // Call standard ERC-4626 redeem (shares -> underlying)
        // Arguments: share amount, receiver, share owner
        IERC4626(step.pool).redeem(amountIn, address(this), address(this));
        
        // Measure underlying assets actually received
        amountOut = IERC20(step.tokenOut).balanceOf(address(this)) - balBefore;
        if (amountOut == 0) revert ZeroOutputOnHop(hopIndex);
    }

3. Chaining Hops and Repaying the Flash Loan

Within uniswapV3FlashCallback, DEX_ERC4626_DEPOSIT and DEX_ERC4626_REDEEM can appear at any route position and mix freely with V2/V3:

// From evm-arbitrage/src/FlashMultiHopArb.sol
        for (uint256 i = 0; i < stepsLen; ) {
            SwapStep memory step = decoded.steps[i];

            if (step.dexType == DEX_V2) {
                currentAmountIn = _swapV2(step, currentAmountIn, i);
            } else if (step.dexType == DEX_V3) {
                currentAmountIn = _swapV3(step, currentAmountIn, i);
            } else if (step.dexType == DEX_ERC4626_DEPOSIT) {
                currentAmountIn = _depositERC4626(step, currentAmountIn, i);
            } else if (step.dexType == DEX_ERC4626_REDEEM) {
                currentAmountIn = _redeemERC4626(step, currentAmountIn, i);
            } else {
                revert UnsupportedDexType(step.dexType);
            }

            unchecked { ++i; }
        }

        // Repay flash-loan principal + fee
        uint256 amountToRepay = decoded.amountBorrowed + flashPoolFee;
        safeTransfer(decoded.borrowToken, msg.sender, amountToRepay);

Production Risk Controls: Four Vault-Arbitrage Pitfalls

Before trading LSTs, LRTs, or yield vaults live, hardcode checks for these four specific risks into the off-chain scanner and simulator:

1. Withdrawal Queues and Exhausted Immediate Liquidity

Standard ERC-4626 requires redeem to settle immediately. Some tokens claiming ERC-4626 compatibility, or asynchronous ERC-7540-based vaults such as the native Lido stETH redemption route, instead return a withdrawal NFT and require days of waiting.

Required defense: before constructing a route, call maxRedeem(address(arb)) and maxWithdraw(address(arb)). If the vault lacks enough underlying cash for immediate settlement or returns 0, discard the route rather than broadcasting blindly.

2. Vault Exit Fees and Slippage

Some vaults charge 0.1%–0.5% management or exit fees on redemption. NAV calculated only from convertToAssets, the nominal theoretical asset value, overstates the amount actually received after fees.

Required defense: call previewRedeem(shares) instead of convertToAssets(shares). ERC-4626 requires previewRedeem to estimate the actual received amount after all fees and slippage.

3. Emergency Vault Pauses

Some DeFi vaults support emergency pausing. During market panic, operators may already have called pause() on-chain.

Required defense: before broadcasting, run a full eth_call against the same node’s pending state. A paused vault raises ContractFunctionRevertedError during simulation, letting the outer logic skip safely without spending real on-chain gas.


Four Production Rules for ERC-4626 Depeg Arbitrage

  1. Never call redeem without probing liquidity: check available underlying cash through maxRedeem before entering, preventing forced reverts when vault cash is exhausted.
  2. Use previewRedeem as the NAV reference: nominal NAV alone is insufficient. Off-chain closed-form solving and profit predictions must use net redemption rates after protocol exit fees.
  3. Keep the entire sequence atomic: borrowing, DEX purchase, vault share burning, and repayment must occur in one indivisible transaction. If any leg’s spread cannot cover fees, revert everything and leave no on-chain exposure.
  4. Keep 1 wei of dust to reduce gas: retain 1 wei in every involved vault-share and underlying-asset balance slot, avoiding cold-write penalties across repeated trades and preserving the profit advantage in millisecond competition.

Enterprise DeFi Trading and Arbitrage Architecture Consulting

Fone specializes in low-level EVM mechanics, multihop flash-loan execution, LST/LRT arbitrage, and white-label DEX delivery. Our FlashMultiHopArb execution architecture and scanning gateway have passed extensive production and mainnet-fork verification: