Floor 2: Exchanges and orders
AMM Swap
AMM Swap is a game about trading in an automated market maker pool. You predict the price impact of a swap in a constant-product pool, where x times y stays equal to k. Then you set the slippage tolerance. Too tight and the swap reverts; too loose and a bot sandwiches it. Decrypt shows the safe range.
Free, with a verified email address. An account saves your progress, and floors and tiers open as you level up.
What it teaches
How automated market makers price a trade, and why tolerance matters.
- How the constant-product formula sets the price from the reserves.
- How to work out price impact: a(1 - f) / (reserve in + a(1 - f)).
- Why slippage tolerance trades failed swaps against sandwich attacks.
How a round plays
- Each round is one swap in a constant-product pool of a coin and USDT, with a 0.05%, 0.30% or 1% fee.
- First predict your swap's price impact, in percent.
- Then set the slippage tolerance. A trade from another user lands ahead of yours and moves the price, and a bot watches for room to sandwich you.
- Check, and Decrypt shows the safe range of tolerances, your minimum received, and what the bot would take at your setting.
How it is graded
The pool, the trade ahead and the bot are simulated exactly on integer units. The impact is graded within a tolerance that tightens with the level. The tolerance is graded against the exact safe window: from the smallest setting that does not revert, up to one basis point below the smallest setting a profitable bot can sandwich. Both edges are found by exact search. Impact counts 40% and the tolerance 60%.
The honest note
Real pools can hold worthless tokens, and anyone can create one. Smart contracts can have bugs. The bot here follows one fixed strategy; real bots compete and vary. A low price impact says nothing about whether the token is worth anything.