# 07: P-AMM Redemption Curve ## Source - **Protocol**: Gyroscope GYD - **Files**: `PrimaryAMMV1.sol`, `IPAMM.sol`, `Flow.sol` - **Paper**: `gyrostable/technical-papers/P-AMM/P-AMM technical paper.pdf` ## Rationale for MYCO Every bonding curve needs a redemption mechanism. The P-AMM provides a sophisticated, bank-run-resistant approach: 1. **Piecewise pricing**: Full redemption at par when fully backed, smooth degradation when underbacked 2. **No cliff**: Unlike simple bonding curves where selling drains the reserve linearly, the parabolic discount protects remaining holders 3. **Floor guarantee**: Even deeply underbacked, there's a minimum redemption rate (θ̄) 4. **Outflow memory**: Tracks recent redemptions, dampening cascade effects 5. **Separating redemption from swap pricing**: The bonding surface determines minting price; the P-AMM independently determines redemption price For MYCO: this is the "exit" side of the bonding curve. It determines how much a $MYCO holder gets back when selling, ensuring the system degrades gracefully rather than catastrophically. ## Invariant / Pricing Function Three regions by backing ratio ba = reserve / supply: **Region I: Fully backed (ba ≥ 1)** ``` rate = 1.0 (redeem at par) ``` **Region II: Parabolic discount (xu < x ≤ xl)** ``` b(x) = ba - x + α(x - xu)² / 2 ``` where x = cumulative recent redemptions as fraction of supply. **Region III: Linear floor (x > xl)** ``` rate = θ̄ (minimum guaranteed) ``` ## Parameters | Parameter | Symbol | Range | Effect | |-----------|--------|-------|--------| | Curvature | ᾱ | > 0 | Steepness of discount. Higher = sharper drop | | No-discount threshold | x̄_U | [0, 1] | Fraction of supply that can redeem at par | | Floor rate | θ̄ | [0, 1] | Minimum redemption rate | | Outflow memory | | (0, 1) | Decay rate for flow tracking. Higher = longer memory | ## Properties - **Monotonically decreasing**: More redemption → worse rate (protects remaining holders) - **Continuous**: No jumps between regions (smooth transitions) - **Bounded**: Rate always in [θ̄, 1.0] - **Path-dependent**: Rate depends on recent history (outflow memory), not just current state ## Implementation See `src/primitives/redemption_curve.py`