3.6 KiB
3.6 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Core Innovation
KRAIKEN is a token with a dominant liquidity manager that creates an unfair advantage in trading through:
- Asymmetric Slippage Strategy: Three-position liquidity structure prevents profitable arbitrage against the protocol
- Sentiment Oracle: Harberger tax-based staking creates a prediction market for token value
- Dormant Whale Protection: VWAP-based price memory prevents historical price manipulation
Critical Success Factor: The liquidity manager must maintain its dominant position (trading most of the supply) - if it loses this, the project fails.
User Journey
- Buy: Purchase KRAIKEN on Uniswap → Benefit from growing protocol-owned liquidity
- Stake: Visit kraiken.org → Stake tokens → Set tax rate → Earn from protocol growth
- Compete: Monitor staking positions → Snatch undervalued positions → Optimize tax rates
Project Structure
onchain/- Smart contracts (Solidity/Foundry) - See onchain/CLAUDE.mdweb/- Vue 3/Vite staking interface - See web/CLAUDE.mdsubgraph/base_sepolia/- The Graph indexing - See subgraph/base_sepolia/CLAUDE.mdkraiken-lib/- TypeScript helper library - See kraiken-lib/CLAUDE.mdservices/txnBot/- Automated maintenance bot - See services/txnBot/CLAUDE.mdonchain/analysis/- Growth mechanism analysis tools
Quick Start
# 1. Install dependencies for all projects
cd onchain && forge install
cd ../web && npm install
cd ../kraiken-lib && npm install --legacy-peer-deps
cd ../subgraph/base_sepolia && npm install
cd ../services/txnBot && npm install
# 2. Build smart contracts
cd onchain && forge build && forge test
# 3. Start web interface
cd web && npm run dev
Key Concepts
Liquidity Management
- Three-position strategy (ANCHOR, DISCOVERY, FLOOR)
- Asymmetric slippage prevents arbitrage
- VWAP tracking for price memory
Harberger Tax Staking
- Self-assessed tax rates on positions
- Positions can be "snatched" by higher bidders
- Creates prediction market for token value
- Limited to 20% of total supply
Protocol Growth
- Liquidity manager mints tokens when positions grow
- Stakers benefit from supply expansion
- Tax revenue redistributed to active participants
Global Code Quality Guidelines
DRY Principle
- Search for existing implementations before creating new functions
- Check libraries (uni-v3-lib, test helpers) for common utilities
- Refactor duplicated code into shared modules
Testing
- Run tests after every change
- Never comment out failing tests
- Add tests for new functionality
Repository Hygiene
- Remove unused files immediately
- Clean up temporary files
- Check
git statusbefore commits
Communication Style
Direct & Technical
- Challenge suboptimal requests
- Highlight risks early and clearly
- Suggest better alternatives
- Refuse technically unsound solutions
Priority Order
- Technical correctness
- Code quality
- User satisfaction
Remember: Build the best possible system. Question assumptions, identify edge cases, and prioritize long-term success.
Additional Resources
- Technical Deep Dive: See TECHNICAL_APPENDIX.md
- Contract Details: See onchain/CLAUDE.md
- Frontend Architecture: See web/CLAUDE.md
- Data Indexing: See subgraph/base_sepolia/CLAUDE.md