Skip to main content
Glama

get_spot_l4_diffs

Read-onlyIdempotent

Retrieve raw order-level changes for Hyperliquid Spot pairs including new orders, modifications, cancellations, and fills. Uses Pro+ data tier for precise market analysis.

Instructions

Get Hyperliquid Spot L4 orderbook diffs (Pro+ tier). Symbols are dashed canonical (e.g. 'HYPE-USDC'). Returns raw order-level changes (new orders, modifications, cancellations, fills) over a time range. Live from 2026-05-05.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesHyperliquid Spot dashed canonical pair symbol (e.g. 'HYPE-USDC', 'PURR-USDC'). 294 pairs available. The server resolves the dashed form to Hyperliquid's wire format ('PURR/USDC', '@107') internally. Use get_spot_pairs to list all.
startNoStart timestamp (Unix ms or ISO). Defaults to 24h ago.
endNoEnd timestamp (Unix ms or ISO). Defaults to now.
limitNoMax records to return (default 100, max 1000)
cursorNoPagination cursor from previous response's nextCursor

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
recordsYesArray of result records
countYesTotal number of records in the full result set
nextCursorNoCursor for next page, if more results available

Implementation Reference

  • src/index.ts:1417-1425 (registration)
    Registration of the 'get_spot_l4_diffs' tool via the registerHistoryTool helper. It calls api().spot.l4Orderbook.diffs(coin, params) and uses SpotCoinParam schema with normalizeSpotCoin normalization.
    // Spot L4 Orderbook Diffs (Pro+)
    registerHistoryTool(
      "get_spot_l4_diffs",
      "Get Hyperliquid Spot L4 orderbook diffs (Pro+ tier). Symbols are dashed canonical (e.g. 'HYPE-USDC'). Returns raw order-level changes (new orders, modifications, cancellations, fills) over a time range. Live from 2026-05-05.",
      (coin, params) =>
        api().spot.l4Orderbook.diffs(coin, params as any),
      SpotCoinParam,
      normalizeSpotCoin
    );
  • The registerHistoryTool helper function that powers the tool registration. It builds the input schema (coin + HistoryParams), resolves time ranges, and calls the provided SDK function with cursor pagination support.
    function registerHistoryTool(
      name: string,
      description: string,
      sdkCall: (coin: string, params: Record<string, unknown>) => Promise<{ data: unknown; nextCursor?: string }>,
      coinSchema: z.ZodString,
      normFn: (coin: string) => string,
      extraSchema?: ZodRawShape
    ): void {
      const schema: ZodRawShape = { coin: coinSchema, ...HistoryParams };
      if (extraSchema) Object.assign(schema, extraSchema);
    
      registerTool(name, description, schema, ListOutputSchema, async (params) => {
        const { coin, start, end, limit, cursor, ...extra } = params;
    
        const timeRange = resolveTimeRange(start, end);
        const sdkParams: Record<string, unknown> = {
          ...timeRange,
          limit: resolveLimit(limit),
        };
    
        if (cursor) sdkParams.cursor = cursor;
    
        // Pass through extra params (interval, side, etc.)
        for (const [k, v] of Object.entries(extra)) {
          if (v !== undefined) sdkParams[k] = v;
        }
    
        const result = await sdkCall(normFn(coin), sdkParams);
        return formatCursorResponse(result);
      });
    }
  • Input schema for the coin parameter used by get_spot_l4_diffs (SpotCoinParam - dashed canonical pair symbol like 'HYPE-USDC').
    const SpotCoinParam = z
      .string()
      .describe(
        "Hyperliquid Spot dashed canonical pair symbol (e.g. 'HYPE-USDC', 'PURR-USDC'). 294 pairs available. The server resolves the dashed form to Hyperliquid's wire format ('PURR/USDC', '@107') internally. Use get_spot_pairs to list all."
      );
  • Output schema used by get_spot_l4_diffs (ListOutputSchema - returns records array with count and optional cursor).
    const ListOutputSchema: ZodRawShape = {
      records: z.array(z.record(z.unknown())).describe("Array of result records"),
      count: z.number().describe("Total number of records in the full result set"),
      nextCursor: z
        .string()
        .optional()
        .describe("Cursor for next page, if more results available"),
    };
  • Normalization function that uppercases the spot coin symbol before passing to the SDK.
    function normalizeSpotCoin(coin: string): string {
      return coin.toUpperCase();
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark it as read-only, idempotent, and non-destructive. Description adds that it is live from a specific date (2026-05-05) and returns 'raw order-level changes', which is useful behavioral context beyond annotations. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences: first states purpose and tier, second explains symbol format and return content, third notes data availability. Zero wasted words, front-loaded with key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema exists, the description covers purpose, data type, and availability. It does not explain pagination or defaults beyond schema, but these are in parameters. The tool's complexity is moderate and description is sufficient alongside schema and annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 100% coverage with detailed parameter descriptions, including examples and defaults. The description does not add significant meaning beyond the schema; it merely echoes the symbol format. Baseline 3 is appropriate since schema carries the burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Explicitly states it gets Hyperliquid Spot L4 orderbook diffs, distinguishes from siblings like get_spot_l4_orderbook (snapshot) and get_l4_diffs (futures) by specifying 'Spot' and 'diffs'. The description also clarifies that it returns raw order-level changes over a time range, making its function unique.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Mentions Pro+ tier tier requirement, providing context for eligibility. Does not explicitly state when not to use alternatives, but the distinction from siblings is clear via naming and description. The description implies it is for diff-based queries rather than snapshots or historical records.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/0xArchiveIO/0xarchive-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server