get_lighter_candles
Retrieve OHLCV candle data for any coin from Lighter.xyz, with intervals from 1 minute to 1 week. Includes open, high, low, close, and volume.
Instructions
Get Lighter.xyz OHLCV candle data for a coin. Intervals: 1m to 1w (default 1h). Returns open, high, low, close, volume.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | Lighter.xyz coin symbol, e.g. 'BTC', 'ETH' | |
| start | No | Start timestamp (Unix ms or ISO). Defaults to 24h ago. | |
| end | No | End timestamp (Unix ms or ISO). Defaults to now. | |
| limit | No | Max records to return (default 100, max 1000) | |
| cursor | No | Pagination cursor from previous response's nextCursor | |
| interval | No | Candle interval (default '1h') |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| records | Yes | Array of result records | |
| count | Yes | Total number of records in the full result set | |
| nextCursor | No | Cursor for next page, if more results available |
Implementation Reference
- src/index.ts:846-853 (registration)Registration of the 'get_lighter_candles' tool using the registerCandleTool helper. It delegates to api().lighter.candles.history() for the actual SDK call.
registerCandleTool( "get_lighter_candles", "Get Lighter.xyz OHLCV candle data for a coin. Intervals: 1m to 1w (default 1h). Returns open, high, low, close, volume.", (coin, params) => api().lighter.candles.history(coin, params as any), LighterCoinParam, normalizeLighterCoin ); - src/index.ts:73-75 (schema)The LighterCoinParam Zod schema used for the coin input parameter of get_lighter_candles.
const LighterCoinParam = z .string() .describe("Lighter.xyz coin symbol, e.g. 'BTC', 'ETH'"); - src/index.ts:103-106 (schema)The IntervalParam Zod schema used for the optional interval parameter of get_lighter_candles.
const IntervalParam = z .enum(["1m", "5m", "15m", "30m", "1h", "4h", "1d", "1w"]) .optional() .describe("Candle interval (default '1h')"); - src/index.ts:316-318 (helper)The normalizeLighterCoin helper function that normalizes coin symbols to uppercase for the Lighter.xyz tools.
function normalizeLighterCoin(coin: string): string { return coin.toUpperCase(); } - src/index.ts:441-456 (helper)The registerCandleTool helper function that wraps registerHistoryTool with an IntervalParam for candle-based tools like get_lighter_candles.
function registerCandleTool( name: string, description: string, sdkCall: (coin: string, params: Record<string, unknown>) => Promise<{ data: unknown; nextCursor?: string }>, coinSchema: z.ZodString, normFn: (coin: string) => string ): void { registerHistoryTool( name, description, sdkCall, coinSchema, normFn, { interval: IntervalParam } ); }