A Next.js dashboard for live crypto market data and TypeSafe-powered trading.
The system streams live market data from Yahoo Finance through yfinance (default), calculates technical indicators across multiple timeframes, sends explicitly enabled trading states to TypeSafe, and applies the returned decisions to a portfolio powered by a local SQLite database. It features both autonomous trading by the Jev agent and a fully-featured manual trade desk with automatic Take Profit and Stop Loss execution.
Default mode: paper trading (no real money, no exchange keys required). For Bybit live/testnet execution see LIVE.md.
The dashboard combines live market data, technical indicators, TypeSafe decisions, and a paper-trading portfolio in one workspace.
![]() |
![]() |
| Trading UI | Portfolio position |
- Live Market Data & Dynamic Timeframes: Streams live market data via Yahoo Finance websockets. The chart and technical indicators dynamically update based on the selected timeframe (1m, 5m, 15m, 1h, 4h).
- Autonomous Agent (Jev): Powered by TypeSafe, the Jev autonomous decision engine analyzes the market on every incoming tick across all active timeframes simultaneously, providing structured judgments for trading.
- Paper Trading Portfolio: Simulated trading environment with a persistent SQLite database. Capital can be dynamically adjusted through the UI, accurately updating the account ledger and portfolio equity on the fly.
- Automated Risk Management: Automatic calculation and execution of Take Profit and Stop Loss triggers, determined by Jev's analysis, volatility (ATR), and user risk appetite.
- Manual Trade Execution: A complete manual trading desk allowing users to execute buys and sells, set custom TP/SL targets, or exit active positions directly from the dashboard.
- Robust Data Handling: Built-in safeguards to filter out delayed or out-of-order market ticks, preventing data corruption and chart crashes.
- Interactive UI: Dynamic chart overlays, selectable indicator panels, and detailed historical logs for both agent decisions and executed trades.
ADA-USDXRP-USDETH-USDBTC-USDSOL-USDBNB-USDTRX-USD
The Python feed subscribes to all supported assets. The dashboard lets you select which asset to inspect and trade.
- Node.js 20 or newer
- Python 3.12 recommended
- A TypeSafe API key for agent decisions
From the repository root:
cd "C:\Users\Local User\OneDrive\Desktop\jev-trades"
.venv\Scripts\python.exe -m pip install -r pipeline\requirements.txt
npm installThe project uses the root .venv. Do not use the older pipeline\venv environment.
Create pipeline/.env and add your TypeSafe key. Both names are accepted:
TYPESAFE_AI_API_KEY=your_key_here
or:
TYPESAFE_API_KEY=your_key_here
Keep this file server-side and never expose the key through NEXT_PUBLIC_* variables.
The dashboard also has an optional TYPESAFE KEY field. A visitor can enter their own key and click Apply portfolio; the key is sent to the Python feed over its configuration endpoint and kept in that process memory only. It is not stored in the browser or written to agent logs. Do not use this pattern for a shared public trading account: the current Python service has one shared in-memory paper portfolio and one active key for all connected dashboard users.
Vercel can host the Next.js dashboard, but it cannot host this whole application by itself. The Python collector is a long-running process that owns the Yahoo websocket, SSE stream, paper portfolio, and local JSONL files. Run that service on a separate always-on host such as Railway, Render, Fly.io, or a VPS, then set this Vercel environment variable to its public base URL:
NEXT_PUBLIC_MARKET_FEED_URL=https://your-feed.example.com
The feed must allow the Vercel origin through CORS and expose /stream and /config over HTTPS. The current local JSONL storage and in-memory portfolio are not suitable for a multi-instance production deployment; use a database or a single pinned worker if that state needs to persist.
Contributions are welcome. Open an issue for bugs or ideas, or fork the repository and open a pull request:
https://github.com/zadescoxp/Jev-Trades
Before opening a pull request, run:
npm run lint
npm run build
python3 -m py_compile pipeline/data_collector.py pipeline/paper_trader.py pipeline/schema.pyJev Trades is released under the Apache License 2.0. See LICENSE for the full license text.
Use two terminals.
cd "C:\Users\Local User\OneDrive\Desktop\jev-trades"
.venv\Scripts\python.exe pipeline\data_collector.pyThe Python service listens on:
- Stream:
http://127.0.0.1:8765/stream - Health:
http://127.0.0.1:8765/health - Configuration:
http://127.0.0.1:8765/config
cd "C:\Users\Local User\OneDrive\Desktop\jev-trades"
npm run devOpen http://localhost:3000.
Only run one Python feed process at a time. Multiple collectors create duplicate websocket subscriptions and duplicate agent decisions.
- Select an asset.
- Enter the paper-trading capital.
- Set the maximum wallet position percentage.
- Choose a risk profile:
Conservative: higher confidence threshold and smaller allocation multiplier.Balanced: standard confidence and allocation behavior.Aggressive: lower confidence threshold and larger allocation multiplier.
- Click
Apply portfolio. - Click
Start trading <asset>.
Changing the selected asset automatically stops trading. The new asset must be started explicitly.
Market data continues to stream while trading is stopped, but TypeSafe decisions are not submitted and no paper positions are changed.
The account is simulated and starts with the capital entered in the dashboard. The portfolio supports multiple simultaneous positions across supported assets.
Python enforces the hard limits:
- Shared available cash
- Maximum wallet position percentage
- Risk-profile allocation multiplier
- Confidence threshold for buy and sell actions
TypeSafe returns structured judgments. It does not directly execute orders or choose arbitrary capital amounts.
The feed calculates the configured moving averages and oscillators from completed OHLCV candles, including:
- EMA and SMA periods 10, 20, 30, 50, 100, and 200
- Ichimoku base line
- VWMA 20
- Hull MA 9
- RSI 14
- Stochastic %K
- CCI 20
- ADX 14
- Awesome Oscillator
- Momentum 10
- MACD 12/26
- Stochastic RSI
- Williams %R
- Bull/Bear Power
- Ultimate Oscillator
The dashboard provides selectable indicator values and EMA/SMA chart overlays.
Historical one-minute candles are warmed from yfinance and merged with local completed-candle storage under:
pipeline/market_data/
Agent request/response events are written to:
pipeline/agent_log.jsonl
The dashboard's Agent logs tab shows the request sent to TypeSafe and the response received. The Positions tab shows executed paper buys and sells with price, quantity, entry price, realized P&L, and cash after the trade.
npm run lint
npm run build
.venv\Scripts\python.exe -m py_compile pipeline\data_collector.py pipeline\paper_trader.py pipeline\schema.pyapp/
page.tsx Dashboard and portfolio controls
market-chart.tsx Lightweight Charts client component
globals.css Dashboard styling
pipeline/
data_collector.py yfinance history, websockets, indicators, SSE, configuration
paper_trader.py TypeSafe decisions and paper portfolio ledger
schema.py TypeSafe state questions
requirements.txt Python dependencies
market_data/ Local per-asset candle history


