Shadow Arena/Shadow Arena #012: Lybra Finance V2
CDP / StablecoinIntermediate-hard

Shadow Arena #012: Lybra Finance V2

Lybra V2 is a Liquity-architecture-adjacent CDP, but the collateral is stETH and the rebase makes everything harder. The protocol issues eUSD against LSD collateral (stETH, wstETH, rETH, wbETH) with CR-gated mint/burn/liquidate/redeem flows that mirror Liquity invariants, plus a non-rebasing peUSD twin for cross-chain use. The Code4rena audit found 31 unique High and Medium vulnerabilities in 1,762 SLOC — the densest finding-per-LoC ratio of any of the Liquity-family forks. The lesson: you built single-collateral ETH Liquity V1. What happens when you swap in stETH and the collateral itself silently rebases under you? Every assumption the Stability Pool's P/S decay made about a non-rebasing balance breaks, every share-vs-supply invariant gets a new attacker path, and the rigidRedemption primitive (Lybra's redeemCollateral analogue) ends up using a different collateral ratio formula than liquidate. (License footnote: the Code4rena snapshot does not contain a top-level LICENSE file. Upstream LybraV2 must be checked before publishing the Shadow Arena fork — the public audit grants reproduction rights for educational use of the findings themselves.)

Scope (1762 SLOC)

FileSLOC
contracts/lybra/pools/LybraStETHVault.sol63
contracts/lybra/pools/LybraWstETHVault.sol60
contracts/lybra/pools/LybraRETHVault.sol65
contracts/lybra/pools/LybraWbETHVault.sol60
contracts/lybra/pools/base/LybraEUSDVaultBase.sol180
contracts/lybra/pools/base/LybraPeUSDVaultBase.sol185
contracts/lybra/token/EUSD.sol174
contracts/lybra/token/PeUSDMainnetStableVision.sol118
contracts/lybra/configuration/LybraConfigurator.sol183
contracts/lybra/pools/ProtocolRewardsPool.sol155
contracts/lybra/miner/EUSDMiningIncentives.sol193
contracts/lybra/governance/LybraGovernance.sol111

Documentation

Part of the Liquity V1 Path

This shadow audit connects to the Liquity V1 Build module. Students who built the CDP protocol have an advantage because they understand Trove accounting, Stability Pool P/S decay, redistribution liquidations, and redemption-driven peg mechanics.

View Build Module
Duration14 days
Total Findings13
Scope1762 SLOC
PriceFree