The Making of an Automated Market Maker: The Pool on Ethereum
A Haskell model of a constant-product pool, rebuilt in Solidity, and the bug feature that six Foundry property tests let through.
19 min read
3 entries
A Haskell model of a constant-product pool, rebuilt in Solidity, and the bug feature that six Foundry property tests let through.
How arbitrage drains a fixed-price pool, the constant-product pool that limits the loss, and the properties that measure both.
The simplest automated market maker, how to read its code, and tests that say “for every pool and every swap” instead of listing examples.