Lab wrapper
L2 — Trade the class bowl (due end of Week 4)
In one sentence. Run our AMM notebook on the class lemonade bowl, then plug in your A4 piles. Show the arithmetic (the prints count).
Stuck? Handbook → Session 8. Quiz 2 was 100/100, buy 10. This lab is 200 TEAM / 100 CLASSUSD, buy until 160 remain. Same shape, different numbers.
You will actually do this
- Open
notebooks/labs/L2_amm.ipynbin Jupyter (same GitHub repo as the course site). - Run All. Read each print before you write.
- Edit the Q5 cell to your A4 reserves and the stranger’s swap (or intended piles if wallets failed — say so).
- Write Q1–Q5 in the PDF. Attach
L2-bowl.png.
No fees in this bowl. Optional extra: Naranjo Decentralized Exchanges and AMMs.
Class pool (no fees)
Start: x = 200 TEAM, y = 100 CLASSUSD, k = x \times y = 20{,}000.
Spot = y / x = CLASSUSD per one TEAM.
Q1 (3). Spot price at the start? One sentence: what that number means in the cafeteria picture.
Q2 (5). A classmate buys TEAM until 160 TEAM remain.
(a) New CLASSUSD in the bowl? (b) CLASSUSD they paid? (c) Average price (paid ÷ TEAM bought)? (d) New spot? (e) One sentence: what is slippage here?
Q3 (4). An arb bot wants the old 0.50 price back. Does it add TEAM or add CLASSUSD? The notebook runs the reverse trade. Four sentences on what that trade is doing.
Q4 (4). LPs had put in the original 200 + 100. After Q2 they withdraw (they are 100% of the bowl). What basket do they get vs if they had held 200 TEAM and 100 CLASSUSD outside the bowl, valued at the new spot? Name that gap. There were no fees — do not call it a fee.
Q5 (4). Your A4 pool: real (or intended) piles, implied start price, one external swap. If wallets failed, say so and still run Q5 with intended numbers.
You will not
- treat spot and average as the same number
- skip Q5 and resubmit the 200/100 demo as “our pool”
- invent fees this notebook did not charge