The First Natural Language Trading Agent for the Injective Ecosystem.
Koudai (Japanese for "Vast" or "Expansive") is a next-generation AI trading agent that translates plain English intents into on-chain reality. By stripping away the friction of traditional DeFi orderbooks, Koudai empowers both Web3 natives and newcomers to execute complex trading strategies through a simple, conversational interface.
Decentralized Finance offers unprecedented financial sovereignty, but it suffers from a massive UX bottleneck.
To execute a simple trade, a user must:
- Navigate complex, intimidating orderbooks.
- Manually calculate slippage tolerance and gas fees.
- Decipher technical jargon across multiple disjointed UI panels.
- Sign opaque, frightening wallet approval transactions.
This friction prevents mass adoption and isolates DeFi to power users.
Koudai bridges the gap between human intent and on-chain execution.
Instead of fighting with UI toggles, users simply command Koudai:
"Buy 10 INJ at market price" or "What is the current price of ATONE?"
Koudai's intelligence engine instantly parses the natural language, structures the trading intent, validates market conditions, and stages the execution. The result? A radically simplified trading experience that maintains 100% self-custody and security.
- Typo-Tolerant Intelligence: Powered by Google Gemini 2.5 Flash, the NLP engine understands context, slang, and typos. You don't need perfect syntax to trade.
- Uncompromised Safety: While highly autonomous, all trading intents automatically trigger a clear, human-readable Confirmation Modal before any execution occurs.
- Enterprise-Grade Reliability: Built-in network safeguards gracefully handle AI rate limits (429) and high-demand queueing (503) without crashing the UI.
- High-Performance UI: A meticulously crafted Next.js dashboard featuring Framer Motion micro-animations and real-time CoinGecko price integrations for the Cosmos ecosystem.
Koudai is built on a clean, scalable architecture separating the Python intelligence layer from the React UI layer:
koudai/
├── backend/ # FastAPI AI Orchestrator
│ ├── api.py # REST Endpoints (/api/parse, /api/execute)
│ ├── koudai/ # Core Python Modules
│ │ ├── agent/ # State Management & Finite State Machine
│ │ ├── core/ # App Config & Structured Logging
│ │ ├── exceptions/ # Custom Error Hierarchy (Rate limits, etc.)
│ │ ├── execution/ # Injective Network & LCD Interactions
│ │ └── parser/ # LLM Integration & Pydantic Schemas
│ └── tests/ # Pytest Suite for Backend Logic
└── frontend/ # Next.js Web3 Dashboard (The Dojo)
├── app/ # App Router & Main Page Layouts
├── components/ # Reusable UI (CommandTerminal, TokenRow)
├── store/ # Zustand Global State Management
└── lib/ # UI Utilities (Tailwind merge, animations)
- Type Safety: 100% typed interfaces across boundaries (Python
Pydanticmapping to TypeScriptInterfaces). - Smart Fallbacks: In simulation mode, the backend queries the Injective LCD for verified testnet block hashes to guarantee a realistic experience.
- Node.js 18+ and
pnpm - Python 3.10+
- Google Gemini API Key
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # Add your GEMINI_API_KEY here
uvicorn api:app --reloadcd frontend
pnpm install
pnpm devVisit http://localhost:3000 to access The Dojo.
Koudai leverages Google Gemini 2.5 Flash for intelligent intent parsing:
- Natural Language Understanding (NLU)
- Users type free-form trading requests.
- LLM parses input into structured JSON intents.
- Structured Validation
- Responses are validated using strict
Pydanticschemas. - Graceful fallback to conversational chat if the intent is not a trade.
- Responses are validated using strict
- Execution Routing
- The AI securely passes the structured intent to the backend orchestration layer, which prepares the exact transaction parameters.
Koudai is exclusively built for the Injective ecosystem. Here is how it integrates:
- Network: Connects directly to the Injective Testnet via its LCD (Light Client Daemon) APIs.
- On-Chain Data Validation: Before simulating any transaction, Koudai queries the Injective LCD for the
latest_blockdata. It uses real network block heights and timestamps to generate cryptographically valid testnet transaction hashes. - Ecosystem Focus: The UI integrates real-time CoinGecko price feeds specifically for Cosmos & Injective native tokens (INJ, ATOM, BLD, AKT).
- Frontend: Next.js (App Router), React, Tailwind CSS v4, Framer Motion, Zustand, Lucide Icons.
- Backend: FastAPI, Python, Google GenAI SDK, Pydantic, aiohttp.
- Blockchain: Injective Testnet LCD (Block verification & Simulation).
Koudai is currently a functional MVP, but acts as a foundational layer for autonomous Web3 AI. The roadmap includes:
- 100% Non-Custodial Architecture: Routing the AI's parsed intents directly to
@injectivelabs/sdk-tsfor secure client-side Keplr Wallet signing, eliminating backend private keys. - Extensible Agent Skills: Allowing open-source contributors to easily add new "skills" (Staking, Bridging, Liquidity Provision) simply by injecting new prompt schemas into the Gemini parser.
- Multi-Chain Expansion: Expanding the NLP execution beyond Injective to the broader IBC ecosystem.
MIT License. Built for the Injective Hackathon.
Disclaimer: Koudai is currently a demonstration project running in simulated environments. Always verify transactions before executing on mainnet.