DEV Community

ohmygod
ohmygod

Posted on

Collateral Manipulation in DeFi Lending: How Venus Protocol Lost $3.7M to an Illiquid Token Exploit

Yesterday — March 15, 2026 — Venus Protocol on BNB Chain lost $3.7 million to a textbook collateral manipulation attack. The attacker exploited the low-liquidity THENA ($THE) token, inflating its price from $0.27 to nearly $5, then borrowing BTCB, CAKE, and WBNB against an artificially inflated position. The collateral was liquidated, THE crashed 17%, and Venus is left holding $1.7–2M in bad debt.

Three days earlier, a trader lost $50 million in a single Aave swap due to catastrophic slippage through an illiquid SushiSwap pool — receiving $36,000 worth of AAVE tokens for $50M in USDT.

Both incidents share a root cause: DeFi protocols continue to underestimate the weaponization of illiquidity.

The Venus Attack: Step by Step

Phase 1: Supply Cap Bypass

The attacker (wallet 0x1a35…6231) discovered a critical flaw: by directly transferring THE tokens to the Venus contract instead of using the standard supply() function, they could bypass the protocol's supply cap entirely.

Normal flow:  User → supply(THE, amount) → Cap check → vTHE minted
Attack flow:  User → transfer(THE, contract) → No cap check → Position inflated
Enter fullscreen mode Exit fullscreen mode

This let them build a 53.2 million THE collateral position — 3.7x the allowed cap. The supply cap existed specifically to limit exposure to low-liquidity assets, but the direct transfer bypass made it decorative.

Phase 2: Price Manipulation

With THE trading at ~$0.27 and having minimal DEX liquidity, the attacker manipulated the price to nearly $5 — an 18.5x increase. On an illiquid token, this doesn't require massive capital.

The math:

  • Collateral: 53.2M THE at manipulated price of ~$5 = ~$266M collateral value
  • Borrowed: 20 BTCB ($1.43M) + 1.5M CAKE ($2.18M) + 200 WBNB ($132K) = ~$3.7M
  • Collateral ratio needed: ~1.4% of manipulated value — trivially met

Phase 3: Extraction and Collapse

Once borrowed assets were in the attacker's wallet, the inflated THE collateral was left for the protocol. As the price manipulation unwound:

  1. THE price crashed back toward reality
  2. Positions became massively undercollateralized
  3. Liquidators attempted to clear the bad debt
  4. But liquidating 53M THE tokens on a low-liquidity market only drove the price further down
  5. Venus is stuck with $1.7–2M in unrecoverable bad debt

This is the classic liquidation death spiral for illiquid collateral — the very act of liquidating destroys the collateral's remaining value.

Why This Keeps Happening

Venus has been here before:

  • 2021: XVS token manipulation → $95M bad debt
  • 2022: Terra/LUNA collapse → $14M bad debt
  • 2026: THE token exploit → $3.7M loss

The pattern is always the same: protocol lists a low-liquidity asset as collateral, attacker manipulates the price, borrows real assets, and walks away.

The Technical Defenses That Would Have Prevented This

1. Bulletproof Supply Cap Enforcement

// ❌ VULNERABLE: Only checks cap on explicit supply() calls
function supply(address asset, uint256 amount) external {
    require(
        totalSupply[asset] + amount <= supplyCap[asset],
        "Supply cap exceeded"
    );
    IERC20(asset).transferFrom(msg.sender, address(this), amount);
    _mint(msg.sender, amount);
}
// Direct ERC20.transfer() to contract bypasses this entirely
Enter fullscreen mode Exit fullscreen mode
// ✅ SECURE: Internal accounting, never rely on balanceOf()
function _updateCollateralBalance(address asset) internal {
    uint256 actualBalance = IERC20(asset).balanceOf(address(this));
    uint256 expectedBalance = totalDeposited[asset];

    if (actualBalance > expectedBalance) {
        require(
            actualBalance <= supplyCap[asset],
            "Balance exceeds supply cap"
        );
    }
}
Enter fullscreen mode Exit fullscreen mode

2. Liquidity-Aware Collateral Factors

function getEffectiveCollateralValue(
    address asset, uint256 amount, uint256 priceUSD
) public view returns (uint256) {
    AssetConfig memory config = assetConfigs[asset];
    uint256 rawValue = (amount * priceUSD * config.baseCollateralFactor) / 1e18 / 100;
    uint256 positionUSD = (amount * priceUSD) / 1e18;

    if (positionUSD > config.liquidityDepthUSD) {
        uint256 liquidityRatio = (config.liquidityDepthUSD * 1e18) / positionUSD;
        rawValue = (rawValue * liquidityRatio) / 1e18;
    }

    return rawValue > config.maxBorrowableUSD ? config.maxBorrowableUSD : rawValue;
}
Enter fullscreen mode Exit fullscreen mode

3. Oracle Price Sanity Checks

function getValidatedPrice(address asset) public view returns (uint256) {
    PriceHistory memory history = priceHistories[asset];
    uint256 currentPrice = _fetchOraclePrice(asset);

    if (history.lastPrice > 0) {
        uint256 deviation = _calculateDeviation(currentPrice, history.lastPrice);
        uint256 timePassed = block.timestamp - history.lastUpdateTime;
        uint256 maxAllowedDeviation = (MAX_PRICE_DEVIATION * timePassed) / DEVIATION_WINDOW;

        if (deviation > maxAllowedDeviation) {
            return history.lastPrice; // Use conservative price
        }
    }

    if (history.twapPrice > 0) {
        uint256 twapDeviation = _calculateDeviation(currentPrice, history.twapPrice);
        if (twapDeviation > 50) {
            revert("Price deviation exceeds TWAP threshold");
        }
    }

    return currentPrice;
}
Enter fullscreen mode Exit fullscreen mode

4. Borrow-Side Circuit Breakers

modifier checkBorrowRate(address collateralAsset, uint256 borrowAmountUSD) {
    BorrowWindow storage window = borrowWindows[collateralAsset];

    if (block.timestamp > window.windowStart + WINDOW_DURATION) {
        window.borrowedInWindow = 0;
        window.windowStart = block.timestamp;
    }

    window.borrowedInWindow += borrowAmountUSD;
    require(
        window.borrowedInWindow <= MAX_BORROW_PER_WINDOW,
        "Borrow rate limit exceeded for this collateral"
    );
    _;
}
Enter fullscreen mode Exit fullscreen mode

The Aave $50M Slippage Disaster

Three days earlier, a user swapped 50.4M aEthUSDT for AAVE tokens via CoW Protocol, routed through a SushiSwap pool with minimal liquidity. Result: $50M in → $36K out. Over 99.9% loss.

Aave's interface showed "extraordinary slippage" warnings. The user confirmed anyway on mobile. The protocol allowed it to execute. Aave founder Stani Kulechov offered to refund ~$600K in fees.

Not an exploit — but a design gap. Protocols should enforce maximum price impact limits regardless of user-set slippage tolerance.

The Illiquid Token Listing Playbook

Before listing any token as collateral:

  1. DEX Liquidity Depth: Can you liquidate max position with <5% impact?
  2. Oracle Manipulation Cost: Cost to 2x the price < potential bad debt? Don't list it.
  3. Supply Cap < 30% of DEX liquidity
  4. Separate borrow caps per collateral asset
  5. Time-weighted position limits — new deposits ramp up over 24-48h

Auditor Checklist

  • [ ] Can tokens be sent directly to inflate positions?
  • [ ] Does balanceOf() determine protocol-critical accounting?
  • [ ] Supply caps enforced on ALL deposit paths?
  • [ ] What happens if collateral price 10x in one block?
  • [ ] Price impact of liquidating largest possible position?
  • [ ] Can attacker borrow > DEX liquidity of collateral?
  • [ ] Rate limits on borrows per collateral type?
  • [ ] Oracle deviation bounds and staleness checks?
  • [ ] Flash loan collateral inflation possible?

Conclusion

Venus Protocol's $3.7M loss was entirely preventable. Supply cap bypass is a basic accounting flaw. Lack of liquidity-aware collateral valuation is a known design gap. The pattern repeats because protocols list low-liquidity assets with inadequate safeguards.

If your lending protocol lists any token with less than $10M in DEX liquidity as borrowable collateral, you're not running a lending market — you're running a buffet for exploiters.


DreamWork Security publishes daily DeFi security analysis. Follow for exploit breakdowns, audit checklists, and defense patterns across EVM and Solana.

Top comments (0)