Shadow Arena/Shadow Arena #001: Basin
DEX/AMMintermediate

Shadow Arena #001: Basin

Basin is a composable DEX architecture built by Beanstalk Farms. It decouples the AMM into pluggable components: Wells (liquidity pools), Well Functions (pricing invariants), Pumps (oracles), and Aquifers (factories). The core ConstantProduct2 implements x * y = k, the same CFAMM as Uniswap V2.

Scope (1145 SLOC)

FileSLOC
src/Well.sol486
src/pumps/MultiFlowPump.sol231
src/Aquifer.sol58
src/functions/ConstantProduct2.sol47
src/functions/ProportionalLPToken2.sol14
src/libraries/LibLastReserveBytes.sol92
src/libraries/LibBytes.sol73
src/libraries/LibBytes16.sol58
src/libraries/LibWellConstructor.sol57
src/libraries/LibContractInfo.sol29

Documentation

Part of the Uniswap V2 Path

This shadow audit connects to the Uniswap V2 Build module. Students who completed the CFAMM build have an advantage because they understand the core architecture.

View Build Module
Duration7 days
Total Findings14
Scope1145 SLOC
PriceFree