get_lighter_summary
Retrieve combined Lighter.xyz market summary for any coin, including mark price, oracle price, funding rate, and open interest.
Instructions
Get combined Lighter.xyz market summary for a coin in a single call. Returns mark price, oracle price, funding rate, and open interest.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | Lighter.xyz coin symbol, e.g. 'BTC', 'ETH' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Result data object |
Implementation Reference
- src/index.ts:904-911 (registration)Registration of the 'get_lighter_summary' tool using the registerCurrentTool helper. It calls api().lighter.summary(coin) with a normalized Lighter coin symbol and returns the combined market summary.
// Lighter Summary registerCurrentTool( "get_lighter_summary", "Get combined Lighter.xyz market summary for a coin in a single call. Returns mark price, oracle price, funding rate, and open interest.", (coin) => api().lighter.summary(coin), LighterCoinParam, normalizeLighterCoin ); - src/index.ts:73-75 (schema)Input schema for the Lighter coin parameter used by get_lighter_summary.
const LighterCoinParam = z .string() .describe("Lighter.xyz coin symbol, e.g. 'BTC', 'ETH'"); - src/index.ts:138-141 (schema)Output schema used by get_lighter_summary, wrapping the result in a data object.
// For tools that return a single object (current snapshots, orderbooks, data quality) const ObjectOutputSchema: ZodRawShape = { data: z.record(z.unknown()).describe("Result data object"), }; - src/index.ts:316-322 (helper)Normalization helper for Lighter coin symbols used by get_lighter_summary.
function normalizeLighterCoin(coin: string): string { return coin.toUpperCase(); } function normalizeSpotCoin(coin: string): string { return coin.toUpperCase(); } - src/index.ts:372-384 (helper)The registerCurrentTool helper function that registers the get_lighter_summary tool. It handles the handler logic: normalizing the coin parameter, calling the SDK, and formatting the response.
// Pattern 2: Current snapshot (coin only) function registerCurrentTool( name: string, description: string, sdkCall: (coin: string) => Promise<unknown>, coinSchema: z.ZodString, normFn: (coin: string) => string ): void { registerTool(name, description, { coin: coinSchema }, ObjectOutputSchema, async (params) => { const data = await sdkCall(normFn(params.coin)); return formatResponse(data); }); }