ARCHITECTURE
SYSTEM LAYERS // SECURITY BOUNDARIES // MODULE MAP
[ SYSTEM DIAGRAM ]
LLM TUNER
Claude HaikuHourly recalibrationadjusts drift & vol thresholds
FRONTEND
Next.js Dashboard
API
FastAPI / src/dashboard/
AGENT CORE
DiscoveryScorerDecision EngineRisk GuardPosition Manager
EXECUTION
Node Helper (Meteora SDK)Hot Wallet Signer
INFRASTRUCTURE
Solana RPC (Helius)Postgres
FRONTEND
API
AGENT CORE
EXECUTION
INFRASTRUCTURE
LLM TUNER
LIVE DATA FLOW
[ SYSTEM LAYERS ]
FRONTEND
Next.js Dashboard
API
FastAPI (src/dashboard/)
AGENT CORE
DiscoveryScorerDecision EngineRisk GuardPosition Manager
EXECUTION
Node Helper (Meteora SDK)Hot Wallet Signer
INFRASTRUCTURE
Solana RPC (Helius)Postgres
[ SECURITY & TRUST BOUNDARIES ]
Q: What signs transactions?
The hot wallet keypair loaded by node-helper. The Python orchestrator never touches private keys — it calls node-helper over stdio with unsigned transaction data.
Q: Where do funds live?
On-chain, in the LP position. The agent holds no funds. The hot wallet holds only enough SOL for gas fees. Liquidity is deposited directly into Meteora DLMM bins.
Q: What blocks unsafe execution?
Four layers: DRY_RUN flag (no tx sent), kill switch file (immediate halt), position cap check (hard limit before open), and daily loss guard (halt if loss exceeds threshold).
[ MODULE MAP ]
Two AI layers differentiate this agent: adaptive range sizing scales bin width from realized volatility on every open, and the LLM tuner calls Claude Haiku hourly to recalibrate drift and exit thresholds based on the current market regime.
| src/discovery/ | Pull pools from Meteora API, score and rank by fee yield |
| src/rebalance/decision.py | Core decision tree: HOLD / CLAIM / REBALANCE / EXIT |
| src/rebalance/adaptive.py | Volatility-driven bin-width — tight in low vol, wide in high vol |
| src/rebalance/tuner.py | LLM parameter tuner — Claude Haiku adjusts thresholds hourly |
| src/rebalance/memo.py | On-chain receipts via SPL Memo — every action verifiable on explorer |
| src/rebalance/guards.py | Safety rails — size, deployed, daily loss, kill switch |
| src/position/ | Read position state, open/close via node-helper |
| src/db/ | Postgres persistence — asyncpg pool, full CRUD + fee accumulation |
| src/dashboard/ | FastAPI — positions, actions, vault, LLM tuner state |
| node-helper/ | Signs and broadcasts Meteora DLMM SDK transactions on Solana |
| sql/ | Schema migrations |