Add README.md
Browse files
README.md
CHANGED
|
@@ -2,165 +2,212 @@
|
|
| 2 |
|
| 3 |
> **Mantle Turing Test Hackathon 2026 β Phase 2 "AI Awakening" β AI Γ RWA Track**
|
| 4 |
|
| 5 |
-
An autonomous AI agent that dynamically allocates capital across Mantle's Real World Asset (RWA) stack using reinforcement learning, with all decisions recorded on-chain via ERC-8004 agent identity NFTs.
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
| Asset | Type | Target APY | Risk
|
| 12 |
-
|-------|------|-----------|--------------|
|
| 13 |
-
| **USDY**
|
| 14 |
-
| **mETH**
|
| 15 |
-
| **MI4**
|
| 16 |
|
| 17 |
-
The agent
|
|
|
|
|
|
|
| 18 |
|
| 19 |
## ποΈ Architecture
|
| 20 |
|
| 21 |
```
|
| 22 |
-
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 23 |
-
β
|
| 24 |
-
β
|
| 25 |
-
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
|
| 26 |
-
β β
|
| 27 |
-
β β
|
| 28 |
-
β βDeFiLlamaβ β
|
| 29 |
-
β βCoinGeckoβ β
|
| 30 |
-
β βMantle
|
| 31 |
-
β β
|
| 32 |
-
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
|
| 33 |
-
β β
|
| 34 |
-
β ββββββββββββ
|
| 35 |
-
β β
|
| 36 |
-
β β
|
| 37 |
-
β β
|
| 38 |
-
β β
|
| 39 |
-
β
|
| 40 |
-
β
|
| 41 |
-
β
|
| 42 |
-
β β
|
| 43 |
-
β β
|
| 44 |
-
β β
|
| 45 |
-
β
|
| 46 |
-
β
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
```
|
| 49 |
|
| 50 |
-
###
|
| 51 |
|
| 52 |
-
1. **OBSERVE** β Fetch real-time yield
|
| 53 |
-
2. **
|
| 54 |
-
3. **
|
| 55 |
-
4. **
|
| 56 |
-
5. **
|
| 57 |
-
6. **
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
|
| 60 |
|
| 61 |
-
|
| 62 |
|
| 63 |
-
|
| 64 |
-
-
|
| 65 |
-
-
|
| 66 |
-
-
|
| 67 |
-
-
|
| 68 |
-
- Portfolio: current weights [USDY, mETH, MI4]
|
| 69 |
|
| 70 |
-
|
| 71 |
-
-
|
| 72 |
-
-
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
|
|
|
| 81 |
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
|
|
|
| 86 |
| Layer | Description | Trigger |
|
| 87 |
|-------|-------------|---------|
|
| 88 |
-
|
|
| 89 |
-
|
|
| 90 |
-
|
|
| 91 |
-
|
|
| 92 |
-
|
|
| 93 |
-
|
|
| 94 |
|
| 95 |
-
|
| 96 |
|
| 97 |
-
##
|
| 98 |
-
- Records allocation decisions on-chain (audit trail)
|
| 99 |
-
- Enforces position limits and rebalance intervals
|
| 100 |
-
- Circuit breaker mechanism (OPEN/CLOSED/HALF_OPEN)
|
| 101 |
-
- Operator authorization for ERC-4337 wallets
|
| 102 |
|
| 103 |
-
|
| 104 |
-
- **Soulbound** agent identity NFT (non-transferable)
|
| 105 |
-
- Capability registration and verification
|
| 106 |
-
- Attestation system (performance audits, security reviews)
|
| 107 |
-
- On-chain reputation scoring (0-10000 bps)
|
| 108 |
-
- Decision history references with outcome scoring
|
| 109 |
|
| 110 |
-
#
|
| 111 |
-
-
|
| 112 |
-
-
|
| 113 |
-
-
|
| 114 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
|
| 116 |
## π Quick Start
|
| 117 |
|
| 118 |
```bash
|
| 119 |
-
# Clone
|
| 120 |
git clone https://huggingface.co/muthuk1/mantle-rwa-yield-router
|
| 121 |
cd mantle-rwa-yield-router
|
| 122 |
|
| 123 |
-
# Install dependencies
|
| 124 |
pip install -r requirements.txt
|
| 125 |
|
| 126 |
-
# Run demo (3 cycles
|
| 127 |
python scripts/demo.py
|
| 128 |
|
| 129 |
-
# Train RL agent
|
| 130 |
python scripts/train.py
|
| 131 |
|
| 132 |
# Run continuous agent
|
| 133 |
python -m agent.main --mode run --interval 3600 --capital 100000
|
| 134 |
|
| 135 |
-
# Run tests
|
| 136 |
pytest tests/ -v
|
| 137 |
-
```
|
| 138 |
|
| 139 |
-
#
|
| 140 |
-
|
| 141 |
-
cp .env.example .env
|
| 142 |
-
# Edit .env with your configuration
|
| 143 |
```
|
| 144 |
|
|
|
|
|
|
|
| 145 |
## π Project Structure
|
| 146 |
|
| 147 |
```
|
| 148 |
mantle-rwa-yield-router/
|
| 149 |
βββ agent/
|
| 150 |
-
β βββ main.py #
|
| 151 |
-
β βββ data_pipeline.py # Real-time
|
| 152 |
β βββ rl_optimizer.py # PPO agent + Gymnasium environment
|
| 153 |
-
β βββ risk_manager.py #
|
| 154 |
-
β βββ executor.py #
|
| 155 |
-
β
|
|
|
|
| 156 |
βββ contracts/
|
| 157 |
β βββ YieldRouterAgent.sol # On-chain allocation router
|
| 158 |
-
β βββ AgentIdentity8004.sol # ERC-8004 agent identity
|
| 159 |
β βββ RiskRegistry.sol # On-chain risk parameters
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
βββ telegram_bot/
|
| 161 |
β βββ bot.py # Telegram UI (/status, /yields, /risk)
|
| 162 |
βββ config/
|
| 163 |
-
β βββ constants.py #
|
| 164 |
βββ scripts/
|
| 165 |
β βββ demo.py # Demo runner
|
| 166 |
β βββ train.py # RL training script
|
|
@@ -171,21 +218,22 @@ mantle-rwa-yield-router/
|
|
| 171 |
βββ README.md
|
| 172 |
```
|
| 173 |
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
1. **Construct-Only Safety** β The agent constructs unsigned transaction payloads but NEVER holds private keys. Execution requires external signing via ERC-4337 wallet or multisig.
|
| 177 |
|
| 178 |
-
|
| 179 |
|
| 180 |
-
|
|
|
|
| 181 |
|
| 182 |
-
|
|
|
|
| 183 |
|
| 184 |
-
|
|
|
|
| 185 |
|
| 186 |
-
|
| 187 |
|
| 188 |
-
## π Contract Addresses (Mantle Mainnet)
|
| 189 |
|
| 190 |
| Contract | Address |
|
| 191 |
|----------|---------|
|
|
@@ -197,12 +245,25 @@ mantle-rwa-yield-router/
|
|
| 197 |
| Agni Router | `0x319B69888b0d11cEC22caA5034e25FfFBDc88421` |
|
| 198 |
| Aave V3 Pool | `0x458F293454fE0d67EC0655f3672301301DD51422` |
|
| 199 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 200 |
## π Hackathon Track
|
| 201 |
|
| 202 |
**Mantle Turing Test Hackathon 2026 β Phase 2 "AI Awakening"**
|
| 203 |
-
- Track: AI Γ RWA
|
| 204 |
-
- Focus: Autonomous AI agents managing tokenized real-world assets
|
| 205 |
-
- Key
|
| 206 |
|
| 207 |
## π License
|
| 208 |
|
|
|
|
| 2 |
|
| 3 |
> **Mantle Turing Test Hackathon 2026 β Phase 2 "AI Awakening" β AI Γ RWA Track**
|
| 4 |
|
| 5 |
+
An autonomous AI agent that dynamically allocates capital across Mantle's Real World Asset (RWA) stack using reinforcement learning + LSTM yield prediction, with MEV-protected execution, auto-compounding, social sentiment analysis, and all decisions recorded on-chain via ERC-8004 agent identity NFTs. Ships with a **Binance-grade Next.js dashboard**.
|
| 6 |
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
## π₯ What Makes This 10x Different
|
| 10 |
+
|
| 11 |
+
| Innovation | Description | Status |
|
| 12 |
+
|-----------|-------------|--------|
|
| 13 |
+
| **Ensemble AI Engine** | PPO RL optimizer + LSTM yield predictor + sentiment analyzer working in concert | β
Active |
|
| 14 |
+
| **MEV Protection Layer** | Sandwich detection, trade splitting, private mempool routing, optimal slippage | β
Active |
|
| 15 |
+
| **Auto-Compounding** | Gas-optimized yield restaking with mathematically optimal compound frequency | β
Active |
|
| 16 |
+
| **LSTM Yield Predictor** | 7-day yield forecasting with MC Dropout confidence intervals & regime detection | β
Active |
|
| 17 |
+
| **Social Sentiment** | Real-time crypto sentiment aggregation (Fear & Greed, social volume, news) | β
Active |
|
| 18 |
+
| **ERC-8004 Agent Identity** | Soulbound NFT with capabilities, attestations, reputation scoring, decision history | β
On-chain |
|
| 19 |
+
| **zkML-Ready Architecture** | Verifiable inference proofs for on-chain AI transparency (EZKL/Giza compatible) | π Planned |
|
| 20 |
+
| **Binance-Grade Dashboard** | Next.js + Tailwind + Recharts with full Binance design system (dark theme, trading UI) | β
Built |
|
| 21 |
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
## π Portfolio Assets
|
| 25 |
|
| 26 |
+
| Asset | Type | Target APY | Risk | Protocol |
|
| 27 |
+
|-------|------|-----------|------|----------|
|
| 28 |
+
| **USDY** | Tokenized US T-Bills | ~4.25% + lending | Low | Ondo Finance |
|
| 29 |
+
| **mETH** | Liquid Staked ETH | ~3.9% + lending | Medium | Mantle LSP |
|
| 30 |
+
| **MI4** | Tokenized Index Fund | ~5.4% + lending | Medium | Securitize |
|
| 31 |
|
| 32 |
+
The agent captures **base yield + lending yield** (Aave V3 supply) for each asset, achieving total APYs of 4.7-6.2%.
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
|
| 36 |
## ποΈ Architecture
|
| 37 |
|
| 38 |
```
|
| 39 |
+
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 40 |
+
β DYNAMIC RWA YIELD ROUTER v2.0 β
|
| 41 |
+
β β
|
| 42 |
+
β ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ β
|
| 43 |
+
β β OBSERVE βββ PREDICT βββ REASON βββ PLAN β β
|
| 44 |
+
β β β β β β β β β β
|
| 45 |
+
β β DeFiLlama β β LSTM Yield β β PPO Policy β β Rebalance β β
|
| 46 |
+
β β CoinGecko β β Predictor β β + Ensembleβ β + MEV Opt β β
|
| 47 |
+
β β Mantle RPCβ β + Sentimentβ β β β + Splitter β β
|
| 48 |
+
β β FRED/News β β + Regime β β β β β β
|
| 49 |
+
β ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ β
|
| 50 |
+
β β β β
|
| 51 |
+
β ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ β
|
| 52 |
+
β β AUTHORIZE βββ EXECUTE βββAUTOCOMPOUNDβββ VERIFY β β
|
| 53 |
+
β β β β β β β β β β
|
| 54 |
+
β β 6-Layer β β Unsigned Txβ β Gas-Optimalβ β On-chain β β
|
| 55 |
+
β β Risk Mgr β β + MEV Prot β β Restaking β β + ERC-8004 β β
|
| 56 |
+
β β + Sentimentβ β + Whitelistβ β Automation β β Attestationβ β
|
| 57 |
+
β ββββββββββββββ ββββββββββββββ ββββββββββββββ ββββββββββββββ β
|
| 58 |
+
β β
|
| 59 |
+
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
|
| 60 |
+
β β ON-CHAIN CONTRACTS β β
|
| 61 |
+
β β YieldRouterAgent.sol β AgentIdentity8004.sol β RiskRegistry.solβ β
|
| 62 |
+
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
|
| 63 |
+
β β
|
| 64 |
+
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
|
| 65 |
+
β β BINANCE-STYLE NEXT.JS DASHBOARD β β
|
| 66 |
+
β β Portfolio β Markets β AI Optimizer β Risk β Agent Identity β β
|
| 67 |
+
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
|
| 68 |
+
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 69 |
```
|
| 70 |
|
| 71 |
+
### 8-Stage Agent Pipeline (v2.0)
|
| 72 |
|
| 73 |
+
1. **OBSERVE** β Fetch real-time yield, price, macro, and sentiment data
|
| 74 |
+
2. **PREDICT** β LSTM yield forecasting with MC Dropout confidence + regime detection
|
| 75 |
+
3. **REASON** β PPO policy + ensemble (combine RL action with LSTM prediction + sentiment)
|
| 76 |
+
4. **PLAN** β Compute trades with MEV analysis (sandwich detection, trade splitting)
|
| 77 |
+
5. **AUTHORIZE** β 6-layer risk manager (depeg, volatility, concentration, drawdown, circuit breaker, sentiment)
|
| 78 |
+
6. **EXECUTE** β Construct MEV-protected unsigned transactions (private mempool, optimal deadline)
|
| 79 |
+
7. **AUTO-COMPOUND** β Gas-optimized yield restaking at mathematically optimal frequency
|
| 80 |
+
8. **VERIFY** β Confirm on-chain, update ERC-8004 reputation, generate strategy report
|
| 81 |
|
| 82 |
+
---
|
| 83 |
|
| 84 |
+
## π§ AI/ML Stack
|
| 85 |
|
| 86 |
+
### PPO Reinforcement Learning
|
| 87 |
+
- **Algorithm:** Proximal Policy Optimization with Actor-Critic MLP
|
| 88 |
+
- **State Space:** 18-dimensional (yields, prices, macro, risk signals, portfolio weights)
|
| 89 |
+
- **Action Space:** 3-dimensional continuous β softmax β weights [USDY, mETH, MI4]
|
| 90 |
+
- **Reward:** Risk-adjusted Sharpe ratio - drawdown penalty - depeg penalty - gas costs
|
|
|
|
| 91 |
|
| 92 |
+
### LSTM Yield Predictor *(Novel)*
|
| 93 |
+
- **Architecture:** 2-layer LSTM with attention mechanism
|
| 94 |
+
- **Input:** Yield history, price momentum, fed rate, volatility, sentiment
|
| 95 |
+
- **MC Dropout:** 50 forward passes for uncertainty estimation (confidence intervals)
|
| 96 |
+
- **Regime Detection:** Bull/Bear/Sideways classification head
|
| 97 |
+
- **Feature Importance:** Attention weights reveal which features drove the prediction
|
| 98 |
|
| 99 |
+
### Social Sentiment Analyzer *(Novel)*
|
| 100 |
+
- **Sources:** Fear & Greed Index, social volume, news sentiment
|
| 101 |
+
- **Integration:** Sentiment score feeds into both LSTM predictor and risk manager
|
| 102 |
+
- **Impact:** High fear β increase USDY (safe haven), High greed β lean into mETH/MI4
|
| 103 |
+
|
| 104 |
+
---
|
| 105 |
+
|
| 106 |
+
## π‘οΈ Novel Risk & Execution Features
|
| 107 |
|
| 108 |
+
### MEV Protection Layer *(Novel)*
|
| 109 |
+
- **Sandwich Attack Detection:** Estimates price impact per trade
|
| 110 |
+
- **Trade Splitting:** Automatically splits large trades to reduce MEV exposure
|
| 111 |
+
- **Private Mempool:** Routes high-impact trades through private channels
|
| 112 |
+
- **Optimal Deadlines:** Shorter deadlines for high-risk trades, longer for low-risk
|
| 113 |
|
| 114 |
+
### Auto-Compounding Engine *(Novel)*
|
| 115 |
+
- **Optimal Frequency:** Calculates gas-optimal compound interval using calculus optimization
|
| 116 |
+
- **Formula:** `n* = β(APY Γ Principal / (2 Γ GasCost))` compounds per year
|
| 117 |
+
- **Break-even:** Computes minimum principal where compounding beats simple yield
|
| 118 |
+
- **Smart Triggers:** Only compounds when accumulated yield > 3Γ gas cost
|
| 119 |
|
| 120 |
+
### 6-Layer Risk Management
|
| 121 |
| Layer | Description | Trigger |
|
| 122 |
|-------|-------------|---------|
|
| 123 |
+
| Depeg Detection | USDY/USD and mETH/ETH peg monitoring | >0.5% / >2% |
|
| 124 |
+
| Volatility Guard | Dynamic exposure reduction in high-vol regimes | ETH 30d vol >80% |
|
| 125 |
+
| Concentration Limits | Position size enforcement | >60% or <5% |
|
| 126 |
+
| Smart Contract Risk | Protocol-weighted risk scoring | Per-protocol scores |
|
| 127 |
+
| Drawdown Protection | Circuit breaker on portfolio losses | DD >10% |
|
| 128 |
+
| Sentiment Guard *(Novel)* | Reduces risky exposure on extreme fear | Score <20 |
|
| 129 |
|
| 130 |
+
---
|
| 131 |
|
| 132 |
+
## π¨ Dashboard (Next.js + Binance Design)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
|
| 134 |
+
Full-featured financial dashboard built with the **Binance Design System**:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
|
| 136 |
+
- **Dark canvas** (#0b0e11) with card surfaces (#1e2329)
|
| 137 |
+
- **Binance Yellow** (#FCD535) accent for CTAs and brand elements
|
| 138 |
+
- **Trading green/red** (#0ecb81/#f6465d) for price direction semantics
|
| 139 |
+
- **BinancePlex substitute** (JetBrains Mono) for all financial numbers
|
| 140 |
+
- **6 dashboard sections:** Portfolio, Markets, AI Optimizer, Risk Monitor, Reports, Agent Identity
|
| 141 |
+
|
| 142 |
+
### Dashboard Features
|
| 143 |
+
- π Real-time portfolio value chart with timeframe selector
|
| 144 |
+
- π₯§ Live allocation pie chart + weight history area chart
|
| 145 |
+
- π RWA markets table with yield comparison bar chart
|
| 146 |
+
- π§ LSTM yield predictions with confidence bars + AI recommendations
|
| 147 |
+
- π‘οΈ Social sentiment gauge with source breakdown
|
| 148 |
+
- π‘οΈ Risk score ring, protection layer status, activity log
|
| 149 |
+
- π€ ERC-8004 agent identity card with reputation, capabilities, attestations
|
| 150 |
+
- π± Fully responsive (mobile hamburger, tablet 2-up, desktop full layout)
|
| 151 |
+
|
| 152 |
+
```bash
|
| 153 |
+
# Run the dashboard
|
| 154 |
+
cd dashboard && npm install && npm run dev
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
---
|
| 158 |
|
| 159 |
## π Quick Start
|
| 160 |
|
| 161 |
```bash
|
| 162 |
+
# Clone from HuggingFace
|
| 163 |
git clone https://huggingface.co/muthuk1/mantle-rwa-yield-router
|
| 164 |
cd mantle-rwa-yield-router
|
| 165 |
|
| 166 |
+
# Install Python dependencies
|
| 167 |
pip install -r requirements.txt
|
| 168 |
|
| 169 |
+
# Run demo (3 cycles with live data)
|
| 170 |
python scripts/demo.py
|
| 171 |
|
| 172 |
+
# Train RL agent
|
| 173 |
python scripts/train.py
|
| 174 |
|
| 175 |
# Run continuous agent
|
| 176 |
python -m agent.main --mode run --interval 3600 --capital 100000
|
| 177 |
|
| 178 |
+
# Run tests (25 passing)
|
| 179 |
pytest tests/ -v
|
|
|
|
| 180 |
|
| 181 |
+
# Run dashboard
|
| 182 |
+
cd dashboard && npm install && npm run dev
|
|
|
|
|
|
|
| 183 |
```
|
| 184 |
|
| 185 |
+
---
|
| 186 |
+
|
| 187 |
## π Project Structure
|
| 188 |
|
| 189 |
```
|
| 190 |
mantle-rwa-yield-router/
|
| 191 |
βββ agent/
|
| 192 |
+
β βββ main.py # 8-stage orchestrator pipeline
|
| 193 |
+
β βββ data_pipeline.py # Real-time data aggregation (8 sources)
|
| 194 |
β βββ rl_optimizer.py # PPO agent + Gymnasium environment
|
| 195 |
+
β βββ risk_manager.py # 6-layer risk management
|
| 196 |
+
β βββ executor.py # MEV-protected unsigned tx builder
|
| 197 |
+
β βββ strategy_reporter.py # LLM strategy letter generator
|
| 198 |
+
β βββ novel_features.py # LSTM predictor, MEV shield, auto-compound, sentiment
|
| 199 |
βββ contracts/
|
| 200 |
β βββ YieldRouterAgent.sol # On-chain allocation router
|
| 201 |
+
β βββ AgentIdentity8004.sol # ERC-8004 soulbound agent identity
|
| 202 |
β βββ RiskRegistry.sol # On-chain risk parameters
|
| 203 |
+
βββ dashboard/ # Next.js Binance-style UI
|
| 204 |
+
β βββ src/app/page.tsx # Main dashboard page
|
| 205 |
+
β βββ src/components/ # TopNav, Charts, RiskMonitor, AIOptimizer, AgentIdentity
|
| 206 |
+
β βββ src/lib/data.ts # Data generators and mock data
|
| 207 |
βββ telegram_bot/
|
| 208 |
β βββ bot.py # Telegram UI (/status, /yields, /risk)
|
| 209 |
βββ config/
|
| 210 |
+
β βββ constants.py # All contract addresses, ABIs, parameters
|
| 211 |
βββ scripts/
|
| 212 |
β βββ demo.py # Demo runner
|
| 213 |
β βββ train.py # RL training script
|
|
|
|
| 218 |
βββ README.md
|
| 219 |
```
|
| 220 |
|
| 221 |
+
---
|
|
|
|
|
|
|
| 222 |
|
| 223 |
+
## π Smart Contracts
|
| 224 |
|
| 225 |
+
### `YieldRouterAgent.sol`
|
| 226 |
+
On-chain allocation records, position limits, circuit breaker, operator authorization.
|
| 227 |
|
| 228 |
+
### `AgentIdentity8004.sol` (ERC-8004)
|
| 229 |
+
Soulbound agent identity NFT: capabilities, attestations, reputation (0-10000), decision history.
|
| 230 |
|
| 231 |
+
### `RiskRegistry.sol`
|
| 232 |
+
On-chain risk parameters, depeg event tracking, allocation validation.
|
| 233 |
|
| 234 |
+
---
|
| 235 |
|
| 236 |
+
## π Contract Addresses (Mantle Mainnet, Chain ID 5000)
|
| 237 |
|
| 238 |
| Contract | Address |
|
| 239 |
|----------|---------|
|
|
|
|
| 245 |
| Agni Router | `0x319B69888b0d11cEC22caA5034e25FfFBDc88421` |
|
| 246 |
| Aave V3 Pool | `0x458F293454fE0d67EC0655f3672301301DD51422` |
|
| 247 |
|
| 248 |
+
---
|
| 249 |
+
|
| 250 |
+
## π Key Design Decisions
|
| 251 |
+
|
| 252 |
+
1. **Construct-Only Safety** β Never holds private keys. All outputs are unsigned tx payloads.
|
| 253 |
+
2. **Ensemble Intelligence** β PPO + LSTM + Sentiment provide richer signals than any single model.
|
| 254 |
+
3. **MEV-Aware** β Every trade goes through sandwich detection + optimal splitting.
|
| 255 |
+
4. **Gas-Optimized Compounding** β Mathematical optimization of compound frequency vs gas costs.
|
| 256 |
+
5. **On-Chain Audit Trail** β ERC-8004 records every decision with content hashes.
|
| 257 |
+
6. **Binance-Grade UI** β Production dashboard, not a demo. Full dark theme, live charts, responsive.
|
| 258 |
+
|
| 259 |
+
---
|
| 260 |
+
|
| 261 |
## π Hackathon Track
|
| 262 |
|
| 263 |
**Mantle Turing Test Hackathon 2026 β Phase 2 "AI Awakening"**
|
| 264 |
+
- **Track:** AI Γ RWA ($100K prize pool)
|
| 265 |
+
- **Focus:** Autonomous AI agents managing tokenized real-world assets
|
| 266 |
+
- **Key Tech:** RL optimization, LSTM prediction, ERC-8004, MEV protection, Mantle L2
|
| 267 |
|
| 268 |
## π License
|
| 269 |
|