chore: gardener housekeeping 2026-03-23

- Update all AGENTS.md watermarks to HEAD (224edcc)
- onchain/AGENTS.md: document VWAPTracker _hasRecenterTick guard (#609),
  overflow guard for slots 0-7 (#997), Floor Ratchet defeated (#1067),
  fee-income delta_bps audit trail (#1084)
- landing/AGENTS.md: document SecurityInfo.vue component (#147)

Issues actioned via API:
- Unblocked #1099, #1100, #1101 (all prereqs 1031/997/1067/1054 closed)
- Created #1134 bundled backlog: onchain source quality cleanup (4 dust items)
- Closed dust #601, #627, #739, #741 → bundled into #1134
This commit is contained in:
johba 2026-03-23 07:04:19 +00:00
parent 224edcc6d3
commit b276392e7a
9 changed files with 14 additions and 10 deletions

View file

@ -1,4 +1,4 @@
<!-- last-reviewed: 5f01d55cc7ce0f3499967536971878ef968d59ba -->
<!-- last-reviewed: 224edcc6d3a61aa5a61b2816061f253584791cfd -->
# Agent Brief: Kraiken Protocol
## Protocol Philosophy & Business Logic
@ -43,7 +43,7 @@ The staking system traces a triangle in (staking%, avgTax) space:
## System Snapshot
- Kraiken ERC20 with mint/burn via LiquidityManager. VERSION=2.
- LiquidityManager.sol: ANCHOR + DISCOVERY + FLOOR positions with asymmetric slippage.
- VWAPTracker.sol: squared price in X96, compression, directional recording (price-fall / ETH-outflow events only — buy-only cycles must NOT update VWAP or the floor tracks the inflated price, crystallising IL; see issue #543).
- VWAPTracker.sol: squared price in X96, compression, directional recording (price-fall / ETH-outflow events only — buy-only cycles must NOT update VWAP or the floor tracks the inflated price, crystallising IL; see issue #543). Uses `_hasRecenterTick` boolean guard to decouple bootstrap detection from VWAP recording — prevents tick-0 ambiguity when `lastRecenterTick==0` after bootstrap (#609).
- OptimizerV3.sol: UUPS upgradeable, direct 2D binary mapping.
- Stake.sol: self-assessed tax, snatching auctions, discrete brackets, UBI redistribution.
@ -71,3 +71,6 @@ The staking system traces a triangle in (staking%, avgTax) space:
- Outstanding supply excludes LM position balances and KRK held by `feeDestination` (only when `feeDestination != address(0) && feeDestination != address(this)`) and `stakingPool` (only when `stakingPoolAddr != address(0) && stakingPoolAddr != feeDestination`).
- `recenterAccess` is removed — `recenter()` always enforces cooldown and TWAP stability. No bypass path exists.
- `feeDestinationLocked` prevents CREATE2 bypass: once `feeDestination` is set to a contract address, it cannot be changed. `setFeeDestination` checks `.code.length > 0` to detect contract addresses.
- Optimizer input slots 0-7 all require `<= 1e18` — the overflow guard previously only applied to slot 0 (`percentageStaked`); slots 1-7 (including `averageTaxRate`) are now also validated (#997).
- Floor Ratchet attack (buy→stake→recenter oscillation) is defeated — evidence in `evidence/red-team/2026-03-22-floor-ratchet-oscillation.json` shows floor holds under 2000-trade oscillation (#1067).
- Fee-income delta_bps calculation is documented in `evidence/README.md`; `LmTotalEth.s.sol` now captures the auditable snapshot methodology (#1084).