No description
Find a file
johba f3047072f6 feat: Dynamic anchorWidth based on staking metrics
Replace hardcoded anchorWidth=100 with dynamic calculation that uses staking data as a decentralized oracle.

Changes:
- Add _calculateAnchorWidth() function to Optimizer.sol
- Base width 40% with adjustments based on staking percentage and average tax rate
- Staking adjustment: -20% to +20% (inverse relationship)
- Tax rate adjustment: -10% to +30% (direct relationship)
- Final range clamped to 10-80% for safety

Rationale:
- High staking % = bullish sentiment → narrower anchor (20-35%) for fee optimization
- Low staking % = bearish/uncertain → wider anchor (60-80%) for defensive positioning
- High tax rates = volatility expected → wider anchor to reduce rebalancing
- Low tax rates = stability expected → narrower anchor for fee collection

The Harberger tax mechanism acts as a prediction market where stakers' self-assessed valuations reveal market expectations.

Tests:
- Add comprehensive unit tests in test/Optimizer.t.sol
- Add mock contracts for testing (MockStake.sol, MockKraiken.sol)
- Manual verification confirms all scenarios calculate correctly

Documentation:
- Add detailed analysis of anchorWidth price ranges
- Add staking-based strategy recommendations
- Add verification of calculation logic

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 11:41:02 +02:00
kraiken-lib added web and split CLAUDs 2025-07-24 16:08:17 +02:00
lib don't know 2024-10-18 09:31:25 +02:00
onchain feat: Dynamic anchorWidth based on staking metrics 2025-08-19 11:41:02 +02:00
services/txnBot added web and split CLAUDs 2025-07-24 16:08:17 +02:00
subgraph/base_sepolia added web and split CLAUDs 2025-07-24 16:08:17 +02:00
web added web and split CLAUDs 2025-07-24 16:08:17 +02:00
.gitignore price multipliers instead of ticks 2025-08-16 18:22:32 +02:00
.gitmodules don't know 2024-10-18 09:31:25 +02:00
CLAUDE.md more docs 2025-08-18 00:16:09 +02:00
README.md Complete project rename from HARB/Harberg to KRAIKEN with KRK token symbol 2025-07-11 13:47:42 +02:00
TECHNICAL_APPENDIX.md Update documentation structure and add technical appendix 2025-07-18 20:40:42 +02:00