The settleVaultsDebt
function relies on IDexAdapter.getExpectedOutput()
to determine how much of an asset to swap for USDC when covering a vault's debt.
However, it does not enforce a minimum expected output (i.e., slippage protection). This creates a MEV attack vector where a front-runner could manipulate the price before execution.
The function calculates swap amounts dynamically using IDexAdapter.getExpectedOutput()
.
This does not protect against front-running or price manipulation, meaning that:
Attackers could manipulate swap prices before execution.
The system could receive less USDC than expected for an asset.
Sandwich Attacks on Vault Asset Swaps
The vault is swapping a large amount of its assets (e.g., WETH) to USDC using a DEX (e.g., Uniswap).
MEV bots detect this large order in the mempool.
They execute a buy (front-run) → force a price increase → let your swap go through at a worse rate → sell (back-run).
Impact: The vault gets fewer USDC than expected.
Oracle Price Lag & Manipulation
If the vault relies on on-chain oracles for pricing, an attacker could manipulate the price moments before execution.
Example: If the price of WETH/USDC is determined using Uniswap TWAP, an attacker could manipulate the pool price for a few blocks before settlement.
Impact: The vault swaps at a manipulated, unfavorable rate.
Arbitrage Using Market Inefficiencies
If the contract blindly accepts the DEX price, arbitrageurs could drain the vault by taking advantage of price discrepancies between:
DEX (e.g., Uniswap, SushiSwap)
CEX (e.g., Binance, Coinbase)
Off-chain data sources (Chainlink, Pyth, etc.)
Impact: The vault executes swaps at an outdated price, losing value.
Manual Review
Introduce randomized execution delays so that bots cannot predict swap timing.
Example:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.