Skip to content

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 prompt

Market data is global. Clones do not fetch source data independently; they select assets and data streams from the shared SQLite market memory.

Data source ingestion overview

Source Roles ​

SourcePrimary roleTrading prompt use
HyperliquidTrade universe and asset-level market stateOHLCV, RSI, Bollinger Bands, MA/EMA, MACD, funding rates
PolymarketEvent and prediction-market contextLive/upcoming market discovery, immediate market, and later market signals
DefiLlamaMacro and DeFi regime contextTVL/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 ingest

For capped local testing:

bash
npm run ingest:local

Source Summary ​

SourceChannelsMain cadence
HyperliquidOHLCV, RSI, Bollinger Bands, MA/EMA, MACD, funding rates1m source candles, 5m derived indicators/funding, 1h rollups
PolymarketMarket discovery, immediate market, later market5m to 1h depending on channel
DefiLlamaTVL/base capital, flow changes, DEX volume/fees/revenue/OI1h

External API Summary ​

SourceTransportDefault endpoint configMain requests
HyperliquidWebSocket + HTTP POSTHYPERLIQUID_WS_URL=wss://api.hyperliquid.xyz/ws, HYPERLIQUID_INFO_URL=https://api.hyperliquid.xyz/infocandle, meta, spotMeta, metaAndAssetCtxs, predictedFundings
PolymarketHTTP GETPOLYMARKET_GAMMA_URL=https://gamma-api.polymarket.com/events, /public-search
DefiLlamaHTTP GETDEFILLAMA_API_URL=https://api.llama.fi, DEFILLAMA_STABLECOINS_URL=https://stablecoins.llama.fi/v2/chains, /protocols, /stablecoins, /overview/*