market.candles is the SDK and Agent SDK contract for trader-style OHLCV bars. It is read-only, but it may lazy-load venue candle history, so SDK callers need SF_API_KEY.
Supported timeframes:
Read one chart
0..1. Convert to cents with price * 100 when you want venue-style cent display. Omit venue for server-side auto-resolution, or pass kalshi or polymarket when the market id is ambiguous.
Screen multiple timeframes
UsescreenCandles() when you already have a watchlist and want a trader-style scan for movement, range, volatility, and volume.
screenCandles() is a client-side SDK helper. It calls market.candles for each ticker and timeframe, then computes:
returnPctabsReturnPctrangePctrealizedVolatilityPctvolumetrendbreakoutscore
screenCandles() runs with bounded concurrency. Use concurrency to tune watchlist scans and continueOnError: true when one stale or unsupported market should not stop the whole scan.
Agent SDK
Direct Agent SDK callers can use the same canonical tool:API mapping
https://simplefunctions.dev, the Vercel API surface. That route proxies candle reads to the terminal/Fly data service at TERMINAL_BASE or https://app.simplefunctions.dev. Set baseUrl or SF_API_URL only when you want to target a local or self-hosted SimpleFunctions API.