get_lighter_funding_current
Retrieve the current funding rate for any coin on Lighter.xyz. Returns the latest rate and timestamp.
Instructions
Get the current Lighter.xyz funding rate for a coin. Returns the latest funding rate and timestamp.
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:855-862 (registration)Registration of the 'get_lighter_funding_current' tool using the 'registerCurrentTool' helper. It passes a lambda that calls api().lighter.funding.current(coin), the LighterCoinParam schema, and the normalizeLighterCoin normalization function.
// Lighter Funding Current registerCurrentTool( "get_lighter_funding_current", "Get the current Lighter.xyz funding rate for a coin. Returns the latest funding rate and timestamp.", (coin) => api().lighter.funding.current(coin), LighterCoinParam, normalizeLighterCoin ); - src/index.ts:372-383 (handler)The 'registerCurrentTool' helper used by get_lighter_funding_current. This generates the actual handler: it normalizes the coin parameter, calls the SDK function, and formats 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); }); - src/index.ts:73-75 (schema)Input schema for the 'coin' parameter of get_lighter_funding_current — a simple string describing a Lighter.xyz coin symbol.
const LighterCoinParam = z .string() .describe("Lighter.xyz coin symbol, e.g. 'BTC', 'ETH'"); - src/index.ts:139-141 (schema)Output schema for get_lighter_funding_current — returns a single data object (the current funding snapshot).
const ObjectOutputSchema: ZodRawShape = { data: z.record(z.unknown()).describe("Result data object"), }; - src/index.ts:316-318 (helper)Coin normalization helper that uppercases the Lighter.xyz symbol before passing it to the SDK.
function normalizeLighterCoin(coin: string): string { return coin.toUpperCase(); }