JIDOUCHINOU (自動知能) TECHNICAL MANUAL
Architecture, Mathematical Foundations, and Implementation of an Autonomous 12-Agent Trading Desk on Robinhood Chain (Chain ID: 4663).
01. SYSTEM OVERVIEW & CORE PHILOSOPHY
JidouChinou (自動知能) addresses the catastrophic failure rate of AI trading agents in adversarial cryptocurrency markets. In liquid decentralized finance, more than 99.4% of retail autonomous trading bots suffer terminal drawdown to zero within their first 60 days of operation.
In a dark forest PvP market dominated by dev snipers, coordinated wash-trading syndicates, and honeypot opcodes, affirmation is financial suicide. Survival requires an architecture engineered to seek reasons not to trade.
The Pessimistic Fallback Theorem
JidouChinou is constructed around a single non-negotiable axiom:
Formally, let $\mathcal{M}$ be any sensory, contextual, or adversarial sub-module in the trading pipeline, and let $x \in \mathcal{X}$ be an input market state. If $\mathcal{M}(x)$ results in any computational anomaly—including HTTP connection timeout ($t > 300\text{ms}$), JSON validation schema failure, missing data fields, or runtime exception—the fallback operator $\Phi$ enforces an immediate rejection:
The system never fails open. Under zero circumstances will a network degradation or API timeout allow an unverified order to be executed on-chain.
02. THE 4-TIER MULTI-AGENT ARCHITECTURE
Rather than placing entire trading authority into a monolithic agent, JidouChinou enforces strict Separation of Concerns across four compartmentalized tiers operated by 12 independent bots:
Asyncio Multi-Loop Orchestrator
The runtime engine executes 4 parallel asynchronous event loops managed by src/desk_orchestrator.py:
pons_loop (24/7 continuous): Subscribes to Robinhood Chain WebSocket logs forTokenCreatedevents onpons.family.stock_loop (NYSE Market Hours + 24/7 OffHours): Ingests Alpaca closing marks and computes real-time basis spreads on tokenized equities.context_loop (15-minute intervals): Updates macroeconomic regimes, FCFS sequencer queue depth, and global desk drawdown budgets.exit_loop (5-second tick): Re-marks all open positions mark-to-market, manages dynamic trailing stop pegs, and executes front-exits.
03. 12-AGENT SWARM SPECIFICATIONS
Every bot in the swarm possesses a typed contract, defined latency budget, explicit telemetry inputs, and deterministic failure rules.
Layer 1: Sensory Intelligence (Bots 1 to 5)
| Bot Name | Engine / Model | Latency Budget | Primary Sensory Task | Rejection Criteria |
|---|---|---|---|---|
| #1 PonsScout | Pure Python (Async w3) | < 15ms | EVM log sniffer on pons.family router. Observes 90s liquidity window. |
Unique buyers < 5 or bonding curve > 40% filled at detection. |
| #2 BytecodeAuditor | Grok Fast (JSON Mode) | < 60ms | Decompiles EVM opcodes against 120k historical exploit vector templates. | Opcode exploit similarity > 35%, hidden transfer fees, unrenounced owner. |
| #3 NarrativeScorer | NLP Sentiment Pipeline | < 100ms | Computes 1st and 2nd derivatives of mention velocity on Telegram and X. | Zero organic retweets, synthetic bot cashtag clusters ($dN/dt < 0.25$). |
| #4 StockScreener | OffHours Feed Client | < 30ms | Calculates overnight basis spread between tokenized stocks and 4PM NYSE marks. | Spread deviation > 4.5% driven by stale oracle; liquidity pool < $50k depth. |
| #5 InsiderTracker | Shannon Entropy DAG | < 45ms | Traces wallet funding co-ancestry across early buyer clusters. | Shannon Entropy $H(W_{\text{top20}}) < 1.65$ or mixer links within 30 days. |
Layer 2: Context & Capital Allocation (Bots 6 to 8)
- Bot #6 (RHChainPulse): Continuous telemetry probe measuring block inclusion latency on Robinhood Chain Arbitrum Orbit. If queue depth $\Delta t_{\text{FCFS}} > 180\text{ms}$, freezes new buy orders.
- Bot #7 (MarketPulse): Evaluates market-wide volatility ($\sigma_{\text{market}}$) and stablecoin reserves. Switches desk regime between
RISK-ONandRISK-OFF. - Bot #8 (CapitalAllocator): Solves fractional Kelly allocation: $$\text{PositionSize} = \min\left(\text{Budget} \times 0.15 \times \text{Score}, \; (\text{DailyLossLimit} - \text{CurrentLoss}) \times 0.25\right)$$
Layer 3: Adversarial Veto Gatekeeper (Bots 9 & 10)
Bot #9 (PonsChecker) runs on a specialized Grok-4 Reasoning instance under an adversarial system prompt. It is evaluated solely on trade kills. Bot #10 (StockChecker) runs on Claude 3.5 Sonnet, auditing SEC disclosures and NYSE trading halts.
Layer 4: Execution & Risk Management (Bots 11 & 12)
- Bot #11 (FrontExitEngine): Submits pre-signed ERC-7579 execution bundles directly to the Orbit sequencer. Continuously polls deployer address transactions to execute front-exits in block 0 if dev dump signals arise.
- Bot #12 (PortfolioRiskManager): Enforces the -4.5% trailing stop-loss peg and triggers the 2-layer Emergency Kill-Switch upon any systemic breach.
04. ADVERSARIAL VETO ENGINE & MATHEMATICAL INVARIANTS
Trade clearance in JidouChinou is not a probabilistic recommendation. It is governed by a strict boolean indicator product:
Where $\mathbb{I}(\cdot) \in \{0, 1\}$. If any single invariant evaluates to FALSE, $\mathcal{V}(T) = 0$ and the trade is aborted immediately.
The 6 Formal Safety Invariants
1. Bytecode Opcode Purity Invariant
The contract bytecode must not share more than 35% Jaccard opcode token similarity with our curated vector repository $\mathcal{D}_{\text{rug}}$ containing 120,000 verified EVM exploit templates.
2. Holder Cluster Shannon Entropy
Measures the funding origin distribution of the top 20 token holders. A cabal using 15 burner wallets funded by a single root account exhibits $H < 1.0$, resulting in an automatic veto.
3. Sequencer Queue Congestion Bound
Orders will only dispatch if the underlying Arbitrum Orbit sequencer is operating under healthy sub-block parameters.
4. Zero Dev Supply Invariant
On pons.family fair launches, creator pre-allocation must be exactly zero. Any initial supply held by deployer wallet triggers instant veto.
5. Volatility-Damped Kelly Allocation
Fractional Kelly multiplier ($\gamma = 0.35$) scaled down exponentially by prevailing regime volatility $\sigma_{\text{regime}}$.
6. Strict Trailing Stop Peg
If mark-to-market price drops 4.5% below its highest peak, an automated swap transaction is injected into the sequencer within a single block.
05. ROBINHOOD CHAIN (CHAIN ID: 4663) & FCFS SEQUENCER
Robinhood Chain is an EVM-compatible Arbitrum Orbit L2/L3 Rollup utilizing a private First-Come, First-Served (FCFS) sequencer.
- Block Latency: 100ms – 250ms sub-block production
- Mempool Topology: Private Sequencer Ingestion (Zero public mempool)
- Priority Gas Auction (PGA): Disabled. Transactions are ordered strictly by arrival timestamp
- Settlement Gas: USDC / Native Robinhood Gas (< 0.0001 USDC/tx)
Human Motor Latency vs Automated Session Keys
The physical dynamics of manual trading make human execution mathematically unviable on a 100ms FCFS rollup:
[HUMAN USER EXECUTION TRACE]
1. Visual perception & neural optic nerve delay: ~180ms - 220ms
2. Motor nerve conduction (brain to thumb): ~220ms - 300ms
3. Smartphone capacitive screen touch registration: ~60ms - 90ms
4. Mobile WebSocket transmission to RPC node: ~120ms - 200ms
───────────────────────────────────────────────────────────────────
TOTAL HUMAN TRANSACTION DISPATCH TIME: 580ms - 810ms
RESULT: Included in Block #N + 4 to Block #N + 8 (CRUSHED BY SLIPPAGE)
[JIDOUCHINOU AUTOMATED SESSION KEY PIPELINE]
1. EVM WebSocket event sniffed in block 0: ~8ms - 12ms
2. Layer 1-3 Invariant validation & Kelly sizing: ~68ms - 95ms
3. ERC-7579 pre-signed Session Key dispatch: ~14ms - 22ms
───────────────────────────────────────────────────────────────────
TOTAL PIPELINE EXECUTION TIME: 90ms - 129ms
RESULT: Included in Block #N (FIRST-IN-QUEUE 100ms FCFS EXECUTION)
06. UNIVERSAL DATA ENGINE INTEGRATION (GmgnDataHub :8800)
JidouChinou integrates directly with GmgnDataHub, a universal background daemon running at http://localhost:8800 that extracts real-time token, pool, and security telemetry from GMGN.ai bypassing Cloudflare protections via DrissionPage.
import aiohttp import json class GmgnDataStream: """Consumes real-time SSE token events from GmgnDataHub (:8800).""" def __init__(self, hub_url="http://localhost:8800"): self.stream_url = f"{hub_url}/api/v1/stream/sse" async def listen(self): async with aiohttp.ClientSession() as session: async with session.get(self.stream_url) as response: async for line in response.content: if line.startswith(b"data: "): payload = json.loads(line[6:].decode('utf-8')) if payload.get("event") == "token_new": yield payload["data"]
Real-time Order Flow Tape & Security Audits
For every candidate token, JidouChinou pulls tick-by-tick swaps and contract security metrics:
GET /api/v1/tokens/robinhood/{ca}/security: Honeypot checks, renounced status, dev holding percentage, top 10 concentration.GET /api/v1/tokens/robinhood/{ca}/trades: Raw trade ticks to detect wash-trading loops and volume spoofing.
07. SMART ACCOUNT & SESSION KEY DELEGATION (ERC-7579 KERNEL v3.1)
Running an autonomous high-speed trading desk on a raw EOA (Externally Owned Account) with an exposed private key is an extreme security liability. JidouChinou utilizes ERC-7579 Modular Smart Accounts (ZeroDev Kernel v3.1) with scoped session key validators.
- Whitelisted Target Contracts: Session key can ONLY call the verified
pons.familybonding curve router or OffHours exchange contract. - Spending Allowance Cap: Maximum $500 USDC per 24-hour cycle. Hard-enforced in smart contract bytecode.
- Slippage Limit: Maximum 2.0% price impact allowed. Transactions with higher slippage revert on-chain.
- Temporal Expiry: Session keys auto-expire after 7 days, requiring re-authorization from cold wallet.
2-Layer Emergency Kill-Switch
If Bot #12 (PortfolioRiskManager) detects anomalous market behavior or a systemic drawdown breach:
- Layer 1 (Off-chain Redis lock - < 5ms): Immediately drops all incoming buy signals and shuts down order dispatch.
- Layer 2 (On-chain revocation - 1 block): Executes
revokeSessionKey(sessionKeyId)on the Kernel v3.1 account contract, permanently invalidating the session key's cryptographic permissions on Robinhood Chain.
08. SOCIAL ARBITRAGE & TRADER QUALITY SCORE (TQS)
On social memecoin launchpads such as fomo.family and pons.family, JidouChinou does not compete in raw microsecond gas wars. Instead, it exploits Social Latency Arbitrage by calculating the Trader Quality Score (TQS) of early callers:
Where $\text{Penalty}_{\text{WhaleConcentration}} = 0.50$ if more than 70% of a trader's lifetime PnL originated from a single statistical outlier trade.
Front-Exit Engine vs KOL Dumps
Social copy-traders are invariably used as exit liquidity by influencers and deployers. Bot #11 (FrontExitEngine) monitors the mempool for:
- Dev wallet approval transactions (
approve(router, maxUint256)) - Sharp deceleration in copy-trading flow ($d^2N/dt^2 < 0$)
- Abnormal liquidity removal attempts
When triggered, FrontExitEngine injects an immediate sell swap, liquidating the position before the KOL sell order executes in the FCFS queue.
09. UNIT ECONOMICS & API BUDGETING
The system's multi-tier architecture optimizes API expenditures by reserving expensive frontier reasoning models strictly for candidate tokens that pass all prior filters.
| Tier | Token Throughput | Model / Technology | Cost per 1M Tokens | Estimated Daily Cost |
|---|---|---|---|---|
| Layer 1 (Sensory) | 10,000+ launches/day | Pure Python Async Code | $0.00 | $0.00 |
| Layer 1 (Auditor) | ~500 filtered tokens | Grok Fast (xAI) | $0.05 | $0.45 |
| Layer 2 (Context) | 96 queries/day (15m) | Grok Fast (Cached) | $0.05 | $0.15 |
| Layer 3 (Veto) | ~30 candidate tokens | Grok-4 / Claude 3.5 Sonnet | $2.50 | $6.60 |
| TOTAL ESTIMATED DAILY OPERATING COST: | ~$7.20 / day (~$216 / month) | |||
• On a $10,000 USD institutional allocation, API overhead shrinks to just ~2.1% per month, creating substantial financial safety margin.
10. DEVELOPER API REFERENCE & PYDANTIC SCHEMAS
All inter-agent communication messages are serialized into strictly typed Pydantic models.
from pydantic import BaseModel, Field from typing import List, Optional class AuditReport(BaseModel): token_address: str bytecode_similarity: float = Field(..., ge=0.0, le=1.0) shannon_entropy: float = Field(..., ge=0.0) unique_buyers_90s: int ownership_renounced: bool cabal_cluster_detected: bool organic_score: float = Field(..., ge=0.0, le=1.0) class VetoDecision(BaseModel): token_address: str approve: bool unary_veto_triggered: bool violated_invariants: List[str] adversarial_reasoning: str confidence_score: float class ExecutionOrder(BaseModel): token_address: str position_size_usdc: float max_slippage_pct: float = 2.0 trailing_stop_peg_pct: float = 4.5 session_key_id: str sequencer_priority_timestamp: int
CLI Quick Start & Dry-Run Commands
# 1. Clone repository & install dependencies pip install -r requirements.txt # 2. Launch Universal GmgnDataHub daemon (Port 8800) python -m gmgn_datahub.main --port 8800 # 3. Launch JidouChinou Trading Desk in Paper-Trading Mode python -m src.desk_orchestrator --mode paper --chain 4663 --budget 2000 # 4. Launch Live Swarm Web TUI python -m http.server 8080 --directory terminal