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)
| File | SLOC |
|---|---|
| src/Well.sol | 486 |
| src/pumps/MultiFlowPump.sol | 231 |
| src/Aquifer.sol | 58 |
| src/functions/ConstantProduct2.sol | 47 |
| src/functions/ProportionalLPToken2.sol | 14 |
| src/libraries/LibLastReserveBytes.sol | 92 |
| src/libraries/LibBytes.sol | 73 |
| src/libraries/LibBytes16.sol | 58 |
| src/libraries/LibWellConstructor.sol | 57 |
| src/libraries/LibContractInfo.sol | 29 |
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 ModuleDuration7 days
Total Findings14
Scope1145 SLOC
PriceFree