# 08: Dynamic Weights ## Source - **Protocol**: Balancer - **Files**: `GradualValueChange.sol`, `LBPool.sol` (V3), `quantamm_math.py` - **Repos**: `balancer/balancer-v2-monorepo`, `balancer/balancer-v3-monorepo`, `balancer/balancer-maths` ## Rationale for MYCO Static bonding curves have fixed geometry — the price surface never adapts. Dynamic weights allow the MYCO bonding surface to evolve over time: 1. **Token launch**: LBP-style weight schedule for initial distribution (start 95/5 MYCO/USDC, gradually shift to 50/50) 2. **Adaptive pricing**: Oracle-driven multipliers let the surface respond to market conditions 3. **Governance updates**: Smooth transitions between parameter sets (no discontinuities) 4. **Reserve rebalancing**: As target allocations change, weights interpolate smoothly Two mechanisms: - **GradualValueChange**: Linear interpolation on a schedule (deterministic) - **QuantAMM multiplier**: Oracle sets a velocity, weight drifts linearly until next update (reactive) ## Formulas **GradualValueChange:** ``` progress = (t - t_start) / (t_end - t_start) value(t) = start_value + progress * (end_value - start_value) ``` Clamped: before start → start_value, after end → end_value. **QuantAMM multiplier:** ``` weight(t) = base_weight + multiplier * (t - last_update_time) ``` Oracle updates `(base_weight, multiplier)` at each block/epoch. ## Parameters | Parameter | Effect | |-----------|--------| | start/end values | What the weight changes between | | start/end times | Duration of the transition | | multiplier | Rate of change per time unit (oracle-driven) | | min/max weight | Bounds to prevent extreme allocations | ## Implementation See `src/primitives/dynamic_weights.py`