get_lighter_l3_orderbook
Get order-level L3 orderbook data from Lighter.xyz for a specified coin. Returns individual orders with order IDs, user addresses, prices, and sizes.
Instructions
Get Lighter L3 order-level orderbook (Pro+ tier). Returns individual orders with order IDs, user addresses, prices, and sizes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | Lighter.xyz coin symbol, e.g. 'BTC', 'ETH' | |
| depth | No | Orderbook depth — number of price levels per side |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Result data object |
Implementation Reference
- src/index.ts:958-974 (registration)Registration of the get_lighter_l3_orderbook tool via the registerTool helper. Defines input schema (coin + optional depth), output schema (ObjectOutputSchema), and the handler that calls api().lighter.l3Orderbook.get().
registerTool( "get_lighter_l3_orderbook", "Get Lighter L3 order-level orderbook (Pro+ tier). Returns individual orders with order IDs, user addresses, prices, and sizes.", { coin: LighterCoinParam, depth: DepthParam, }, ObjectOutputSchema, async (params) => { const sdkParams = params.depth ? { depth: params.depth } : undefined; const data = await api().lighter.l3Orderbook.get( normalizeLighterCoin(params.coin), sdkParams ); return formatResponse(data); } ); - src/index.ts:966-973 (handler)Handler function for get_lighter_l3_orderbook. Calls the SDK's lighter.l3Orderbook.get method, normalizing the coin symbol via normalizeLighterCoin (uppercase) and passing an optional depth parameter. Returns formatted response.
async (params) => { const sdkParams = params.depth ? { depth: params.depth } : undefined; const data = await api().lighter.l3Orderbook.get( normalizeLighterCoin(params.coin), sdkParams ); return formatResponse(data); } - src/index.ts:73-75 (schema)Input schema for the coin parameter used in get_lighter_l3_orderbook (and all Lighter tools). A simple string describing the coin symbol.
const LighterCoinParam = z .string() .describe("Lighter.xyz coin symbol, e.g. 'BTC', 'ETH'"); - src/index.ts:98-101 (schema)Input schema for the optional depth parameter used in get_lighter_l3_orderbook.
const DepthParam = z .number() .optional() .describe("Orderbook depth — number of price levels per side"); - src/index.ts:139-141 (schema)Output schema for get_lighter_l3_orderbook — returns a single data object (the orderbook).
const ObjectOutputSchema: ZodRawShape = { data: z.record(z.unknown()).describe("Result data object"), }; - src/index.ts:316-318 (helper)Helper function to normalize Lighter.xyz coin symbols to uppercase (used by the handler).
function normalizeLighterCoin(coin: string): string { return coin.toUpperCase(); }