Appearance
Data Sources
This section describes the source-specific ingestion plan for the SQLite backend.
The shared rule is:
text
external source
-> source-specific ingestor
-> normalized SQLite rows
-> deterministic context resolver
-> trading promptMarket data is global. Clones do not fetch source data independently; they select assets and data streams from the shared SQLite market memory.
Source Roles
| Source | Primary role | Trading prompt use |
|---|---|---|
| Hyperliquid | Trade universe and asset-level market state | OHLCV, RSI, Bollinger Bands, MA/EMA, MACD, funding rates |
| Polymarket | Event and prediction-market context | Live/upcoming market discovery, immediate market, and later market signals |
| DefiLlama | Macro and DeFi regime context | TVL/base capital, flow changes, DEX volume, fees, revenue, open interest |
DefiLlama context is macro-first. The resolver links global DeFi rows to every enabled asset and only adds chain/stablecoin rows when the subject can be matched to that asset symbol.
Runtime Shape
Run the backend API and ingestion worker as separate Node processes against the same SQLite database.
bash
cd backend
# Terminal 1
npm run api
# Terminal 2
npm run ingestFor capped local testing:
bash
npm run ingest:localSource Summary
| Source | Channels | Main cadence |
|---|---|---|
| Hyperliquid | OHLCV, RSI, Bollinger Bands, MA/EMA, MACD, funding rates | 1m source candles, 5m derived indicators/funding, 1h rollups |
| Polymarket | Market discovery, immediate market, later market | 5m to 1h depending on channel |
| DefiLlama | TVL/base capital, flow changes, DEX volume/fees/revenue/OI | 1h |
External API Summary
| Source | Transport | Default endpoint config | Main requests |
|---|---|---|---|
| Hyperliquid | WebSocket + HTTP POST | HYPERLIQUID_WS_URL=wss://api.hyperliquid.xyz/ws, HYPERLIQUID_INFO_URL=https://api.hyperliquid.xyz/info | candle, meta, spotMeta, metaAndAssetCtxs, predictedFundings |
| Polymarket | HTTP GET | POLYMARKET_GAMMA_URL=https://gamma-api.polymarket.com | /events, /public-search |
| DefiLlama | HTTP GET | DEFILLAMA_API_URL=https://api.llama.fi, DEFILLAMA_STABLECOINS_URL=https://stablecoins.llama.fi | /v2/chains, /protocols, /stablecoins, /overview/* |