Advanced
AMMs Deep Dive — Check your understanding
Build a minimal x·y=k AMM.
Developer Advanced
8/8 — AMMs Deep Dive — Check your understanding
Explain itWalk a teammate through how your swap computes amountOut, where the fee goes, and how you prove k stays monotonic.
Cryptography is about how to maintain control over information.
Edge casesCan you handle tiny trades, asymmetrical liquidity, or zero liquidity without breaking? How do you signal failure?
Audit stanceHave events and view helpers ready so reviewers can reproduce your math.
Key points
- Show k before/after a:Swap and prove it never shrinks.
- Describe how you compute:Price impact and enforce minOut.
- Explain IL in one:Paragraph and when LPs should expect it.
- Point to the event/logs:That confirm reserve updates.
- State how your cumulative:Price math would feed a TWAP.