Two AI agents debate whether an Injective market is a good trade right now. Watch the fight, read the verdict.
Built for the Injective Solo AI Builder Sprint (May 7–31 2026)
iClash turns trade analysis into a watchable fight:
- Connect wallet (Keplr/Leap) — read-only, no signing
- Pick a market — any Injective perp or spot market
- Watch the debate — two AI agents argue long/short/skip using live on-chain data
- See the damage — a neutral Judge scores each argument, HP drains
- Get the verdict — Strong Long / Moderate Long / Neutral Wait / Caution Short + confidence %
The debate is the explanation. You watch evidence accumulate as HP swings, instead of reading a verdict you have to take on faith.
iClash uses three separate LLMs via OpenRouter:
| Role | Model | What it does |
|---|---|---|
| The Chartist | Kimi K2.6 | Technical analyst — price action, funding, OI, orderbook |
| The Floor | Gemini 2.0 Flash | Sentiment analyst — crowd positioning, flow, squeeze detection |
| Judge | MiniMax M2.5 | Neutral referee — scores arguments on 4 axes (0–25 each) |
Different models reason differently. Using the same model for both agents produces repetitive arguments. With different models, the Chartist and The Floor disagree in ways that are worth watching — and the verdict carries more weight.
Every argument must cite specific on-chain metrics. The Judge validates which metrics are real. If an agent cites no valid data, their attack takes a 60% damage penalty. This mechanically forces the AI to ground its reasoning in actual Injective data — not hallucination.
The score → damage → HP → verdict pipeline is 100% deterministic code (no LLM). Every number is reproducible. "Why did Bull win?" has a math answer.
Every round, iClash fetches live data from Injective mainnet:
| Metric | Source |
|---|---|
| Price / 24h change | IQ API |
| Funding rate | @injectivelabs/sdk-ts (derivatives API) |
| Open interest | SDK (derivatives API) |
| Orderbook depth + imbalance | SDK (orderbook v2) |
| 24h volume | IQ API |
- Keplr + Leap via
@injectivelabs/wallet-ts - Used for: connecting, reading balances/portfolio
- Never signs transactions — no trades, no transfers
iClash does NOT execute trades in-app. The verdict shows a "Trade on Helix ↗" link (Injective's DEX) with a DYOR disclaimer. Safe demo, clear loop for traders.
- Node.js 22+
- pnpm
- An OpenRouter API key
git clone https://github.com/dante4rt/iclash.git
cd iclash
pnpm install
cp .env.example .env.localEdit .env.local:
OPENROUTER_API_KEY=sk-or-v1-your-key-here
AGENT_MODEL_ID=moonshotai/kimi-k2.6:free
FLOOR_MODEL_ID=google/gemini-2.0-flash-001
JUDGE_MODEL_ID=minimax/minimax-m2.5:freepnpm devOpen http://localhost:3000.
pnpm build
pnpm start| Variable | Required | Default | Description |
|---|---|---|---|
OPENROUTER_API_KEY |
Yes | — | Your OpenRouter API key |
INJECTIVE_NETWORK |
No | mainnet |
mainnet or testnet |
AGENT_MODEL_ID |
No | moonshotai/kimi-k2.6:free |
Model for The Chartist (technical agent) |
FLOOR_MODEL_ID |
No | google/gemini-2.0-flash-001 |
Model for The Floor (sentiment agent) |
JUDGE_MODEL_ID |
No | minimax/minimax-m2.5:free |
Model for the Judge (scorer) |
iclash/
├── app/ # Next.js App Router
│ ├── page.tsx # Landing page (public)
│ ├── arena/page.tsx # Debate arena (wallet-gated)
│ ├── demo/page.tsx # Pre-recorded demo (public)
│ ├── how-it-works/page.tsx # Explainer (public)
│ ├── portfolio/page.tsx # Wallet balances (gated)
│ ├── history/page.tsx # Past clashes (gated)
│ └── api/
│ ├── markets/route.ts # GET Injective market roster
│ ├── snapshot/route.ts # GET live market data
│ └── clash/route.ts # POST → SSE debate stream
├── lib/
│ ├── injective/ # Data layer — chain access
│ │ ├── client.ts # SDK clients (mainnet)
│ │ ├── markets.ts # Market roster (IQ API + SDK)
│ │ ├── snapshot.ts # Live data → DataContext
│ │ └── helix.ts # External Helix DEX URLs
│ ├── agents/ # Brain layer — LLM integration
│ │ ├── technical.ts # The Chartist persona
│ │ ├── sentiment.ts # The Floor persona
│ │ ├── judge.ts # Scoring rubric
│ │ ├── orchestrator.ts # Round loop + SSE events
│ │ └── openrouter.ts # OpenRouter client wrapper
│ └── clash/ # Pure math (no I/O)
│ ├── types.ts # Shared type contract
│ ├── damage.ts # Score → damage → HP → verdict
│ └── damage.test.ts # 27 unit tests
├── components/ # UI components
├── fixtures/ # Demo clash data
├── wallet/ # Keplr + Leap integration
└── DESIGN.md # Visual spec (Stitch ground truth)
Three logical layers that never bleed into each other:
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Data Layer │────▶│ Brain Layer │────▶│ View Layer │
│ (Injective) │ │ (LLMs) │ │ (React) │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
▼ ▼ ▼
DataContext Argument/Score SSE Events
(plain objects) (plain objects) (JSON stream)
- Data layer imports
@injectivelabs/sdk-ts, exposes typed objects. No LLM, no React. - Brain layer imports OpenRouter + data layer. Produces
ArgumentandScore. Never touches React. lib/clash/damage.tsis pure — no I/O, no network, no LLM. Fully unit-testable.- View layer renders SSE events. Knows nothing about Injective or OpenRouter.
| Route | Page | Access |
|---|---|---|
/ |
Landing page (hero, features, agents, mechanics) | Public |
/arena |
Market picker + live debate + HP bars + verdict | Wallet required |
/portfolio |
Wallet balances | Wallet required |
/history |
Past clashes | Wallet required |
/how-it-works |
System Protocol explainer | Public |
/demo |
Pre-recorded 3-round clash replay | Public |
| Decision | Rationale |
|---|---|
| Three separate LLMs | Different models = different reasoning styles = more interesting debates |
| Data-gate (60% penalty) | Forces AI to cite real on-chain data, not hallucinate |
| Pure damage math | Reproducible verdicts — every number has a code answer |
| No in-app trading | Safe demo — verdict links to Helix with DYOR disclaimer |
| SSE streaming | One-way server→client, no WebSocket complexity |
| Wallet read-only | No signing, no funds at risk |
# Unit tests (damage math)
pnpm vitest run lib/clash/damage.test.ts
# Full pipeline test (requires API key)
npx tsx scripts/test-wave2.tsMIT
- GitHub: github.com/dante4rt/iclash
- Injective: injective.com
- Helix DEX: helixapp.com
- OpenRouter: openrouter.ai