Shadow Arena/Shadow Arena #015: QuickSwap + StellaSwap (Algebra)
DEX/AMMIntermediate

Shadow Arena #015: QuickSwap + StellaSwap (Algebra)

You built Uniswap V3 from scratch: slot0, the tick-crossing swap loop, fee-growth accounting, the observation oracle, flash loans. Algebra is what QuickSwap and StellaSwap shipped instead of it — a V3 reimplementation that rips out the fixed fee tiers and replaces them with a volatility-based dynamic fee computed from the oracle, adds a per-position liquidity-add cooldown, and pushes protocol fees to an external vault on every swap and flash. Every one of those deltas is where the bugs live: the cooldown can be weaponized against other LPs, the adaptive fee mis-measures volume and volatility, the flash fee floats with block activity, and the vault push has no zero-address guard. 6 representative findings (1 H + 5 M).

Scope (1487 SLOC)

FileSLOC
src/core/contracts/AlgebraPool.sol789
src/core/contracts/AlgebraFactory.sol83
src/core/contracts/DataStorageOperator.sol127
src/core/contracts/libraries/DataStorage.sol271
src/core/contracts/libraries/AdaptiveFee.sol74
src/core/contracts/libraries/PriceMovementMath.sol143

Documentation

Part of the Uniswap V3 Path

This shadow audit connects to the Uniswap V3 Build module. Students who built the concentrated-liquidity pool have an advantage because they understand tick accounting, the swap loop, fee growth, the observation oracle, and callback-based payment.

View Build Module
Duration4 days
Total Findings6
Scope1487 SLOC
PriceFree