Autonomous Trading Intelligence — A deterministic, multi-timeframe execution engine designed for the OKX Ecosystem.
The current landscape of AI-driven trading is plagued by a massive lack of transparency. Users are expected to blindly trust "black box" models that execute trades based on hidden parameters, obscure logic, and unseen data. When a trade goes wrong, there is no trail of accountability, no way to audit the AI’s reasoning, and no hard-coded risk management to protect the user's capital.
This creates an environment where institutional and retail traders alike are sidelined by the sheer risk of adopting AI financial copilots.
Kyma is a fully transparent Agent Service Provider (ASP). We eliminate black-box AI trading by visually auditing our agent's logic on live charts before executing any governed strategies.
Kyma bridges the gap between autonomous AI capabilities and institutional-grade risk management. It combines a deterministic policy engine with real-time streaming market data, ensuring that every AI decision is strictly governed by user-defined constraints.
- Glass-Box Transparency: Watch the AI analyze the market in real-time. The Reasoning Terminal streams the agent's internal thought process—perceiving liquidity sweeps, order block formations, and volatility expansions.
- Deterministic Risk Validation: Before the agent can route a trade or calculate lot sizing, the decision is forced through a rigid Policy Engine. If an LLM's recommendation violates your max drawdown or position size limits, it is instantly rejected.
- Multi-Timeframe Structural Analysis: Kyma evaluates market structure across simultaneous intervals, autonomously analyzing 5-minute charts for liquidity sweeps and 4-hour charts for macro trends to confirm setup validity.
- Live Visual Audit: An integrated TradingView-style Smart Money Concepts (SMC) chart bounds directly to the AI's WebSocket data stream, rendering the agent's identified order blocks and patterns natively on the UI.
Kyma consists of two heavily synchronized layers:
Built on Python FastAPI and CCXT Pro, the backend serves as the brain of the ASP.
- Dynamic Market Router: Pulls live, streaming tick updates for the Top 10 crypto assets (BTC, ETH, SOL, etc.) using async WebSockets.
- Structural Analyzer: Continuously scores market setups and momentum.
- Policy Engine: The uncompromising risk validator that enforces capital allocation and hard stop-loss limits.
- ASP Endpoints: Pre-configured REST endpoints matching standard OKX ASP schema inputs and outputs for seamless deployment.
Built on Next.js 16, React 19, and React Three Fiber, the frontend provides a breathtaking institutional dark-mode terminal.
- Split-Plane Interface: Effortlessly toggle between the top 10 crypto markets.
- Reasoning Terminal: A live readout of the AI's processing and decision logs.
- SMC Chart: Built with
lightweight-charts, the graph reflects the live tick data and dynamically draws support/resistance boundaries based on the AI's WebSocket broadcasts.
The Python engine needs to be running to stream live market data and evaluate risk.
cd backend
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt
uvicorn main:app --reload --port 8000The backend is now listening on ws://localhost:8000/ws for frontend connections.
Boot up the cinematic Next.js interface.
# In the root directory
npm install
npm run dev- Open http://localhost:3000 for the immersive 3D landing page experience, or jump straight to the cockpit at http://localhost:3000/dashboard.
- In the Config Sidebar, select your Collateral Asset (ETH or USDC).
- Select your desired market from the Top 10 Crypto Market Selector (e.g., BTC/USDT).
- Set your Allocated Capital, Risk Per Trade, and Max Drawdown.
- Click DEPLOY AGENT.
- Watch as the WebSocket connection engages and the Reasoning Terminal and SMC Chart spring to life, rendering the AI's autonomous trading intelligence in real-time.
The repository is fully split to allow seamless deployments of the frontend to Vercel and the backend to Railway.
- Push the repository to GitHub and import it into Vercel.
- In the Vercel Project Settings > General, change the Root Directory to
frontend. - Under Environment Variables, add:
NEXT_PUBLIC_WS_URL: Set this to your Railway WebSocket URL (e.g.,wss://kyma-backend.up.railway.app/ws).
- Click Deploy. Vercel will automatically build the Next.js app inside the
frontendfolder while entirely ignoring the Python backend.
- In your Railway dashboard, create a new project and select Deploy from GitHub repo.
- Select this repository.
- Railway will automatically detect the Python environment. Go to Settings > Service > Root Directory and change it to
/backend. - The
Procfileis already included to spin up the FastAPI server and dynamically bind to Railway's$PORT. - Once deployed, grab the public domain (e.g.,
kyma-backend.up.railway.app) and prefix it withwss://to plug into your Vercel environment variables.
| Layer | Technology |
|---|---|
| Frontend | Next.js 16, React 19, Tailwind CSS |
| Backend | Python, FastAPI, CCXT, Pydantic |
| Websockets | FastAPI WebSockets -> React useRef bindings |
| Charts | Lightweight-Charts (TradingView) |
| 3D / Motion | React Three Fiber, Drei, Framer Motion |
Built for the OKX Hackathon (Finance Copilot / Best Product).