Skip to main content
Glama

get_hip3_trades

Read-onlyIdempotent

Get HIP-3 trade history for over 125 markets. Specify a case-sensitive coin symbol, time range, and limit, then paginate to access trade data with price, size, side, and timestamps.

Instructions

Get HIP-3 trade history. Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns trades with price, size, side, and timestamps over a time range. Supports cursor pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
coinYesHIP-3 coin symbol (CASE-SENSITIVE). 125+ markets across 6 builders: xyz, flx, hyna, km, vntl, cash. Examples: 'km:US500', 'xyz:GOLD', 'hyna:BTC', 'vntl:SPACEX', 'flx:TSLA', 'cash:NVDA'. Use get_hip3_instruments 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:672-680 (registration)
    Registration of the get_hip3_trades tool via registerHistoryTool helper. Calls api().hyperliquid.hip3.trades.list(coin, params) for HIP-3 trade history with cursor pagination.
    // 18. HIP-3 Trades
    registerHistoryTool(
      "get_hip3_trades",
      "Get HIP-3 trade history. Symbols are CASE-SENSITIVE (e.g. 'km:US500'). Returns trades with price, size, side, and timestamps over a time range. Supports cursor pagination.",
      (coin, params) =>
        api().hyperliquid.hip3.trades.list(coin, params as any),
      Hip3CoinParam,
      normalizeHip3Coin
    );
  • Zod schema for HIP-3 coin parameter (CASE-SENSITIVE). Used as input validation for get_hip3_trades.
    const Hip3CoinParam = z
      .string()
      .describe(
        "HIP-3 coin symbol (CASE-SENSITIVE). 125+ markets across 6 builders: xyz, flx, hyna, km, vntl, cash. Examples: 'km:US500', 'xyz:GOLD', 'hyna:BTC', 'vntl:SPACEX', 'flx:TSLA', 'cash:NVDA'. Use get_hip3_instruments to list all."
      );
  • registerHistoryTool helper function that wraps generic registerTool. Used by get_hip3_trades to add coin, time range, limit, and cursor parameters, then call the SDK with normalized coin symbol.
    // Pattern 4: History with cursor pagination (coin + time range)
    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);
      });
    }
  • Normalization function for HIP-3 coins. Keeps the symbol case-sensitive as-is (no upper-casing), since HIP-3 symbols are case-sensitive.
    function normalizeHip3Coin(coin: string): string {
      return coin; // Case-sensitive
    }
    
    // HIP-4 path encoding: the canonical form is the bare numeric `0`, `1`, `42`.
    // The legacy `#0` / `%230` forms are still accepted by the API. We normalize to
    // the bare form when possible (avoids URL-fragment ambiguity entirely).
    function normalizeHip4Coin(coin: string): string {
      const trimmed = String(coin).trim();
      if (/^\d+$/.test(trimmed)) return trimmed;
      const stripped = trimmed.replace(/^(#|%23)/i, "");
      if (/^\d+$/.test(stripped)) return stripped;
      // Unknown shape — fall back to URL-encoding the original.
      return encodeURIComponent(trimmed);
    }
    
    function normalizeLighterCoin(coin: string): string {
      return coin.toUpperCase();
    }
    
    function normalizeSpotCoin(coin: string): string {
      return coin.toUpperCase();
    }
  • Generic registerTool helper that wraps server.registerTool with API key guard, error handling, and annotation setup. Called by registerHistoryTool (which is used by get_hip3_trades).
    function registerTool(
      name: string,
      description: string,
      inputSchema: ZodRawShape,
      outputSchema: ZodRawShape,
      handler: (params: any) => Promise<McpContent>
    ): void {
      server.registerTool(
        name,
        {
          description,
          inputSchema,
          outputSchema,
          annotations: TOOL_ANNOTATIONS,
        },
        async (params: any) => {
          if (!client) {
            return {
              content: [{ type: "text" as const, text: MISSING_KEY_MESSAGE }],
              isError: true,
            };
          }
          try {
            return await handler(params);
          } catch (err) {
            const error = err instanceof OxArchiveError ? err : new OxArchiveError(String(err), 500);
            return formatError(error);
          }
        }
      );
    }
Behavior4/5

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

Adds important behavior beyond annotations: symbols are case-sensitive, and pagination is supported. Annotations already convey safety and idempotency, so the description adds useful context.

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, front-loaded with purpose, efficient. No extraneous information.

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

Completeness5/5

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

With output schema present and description covering return fields, time range, and pagination, the tool is fully specified for an agent to use correctly.

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?

Schema coverage is 100% and description adds little new meaning beyond restating case-sensitivity and pagination, which are already in the schema.

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?

Clearly states 'Get HIP-3 trade history', specifying the resource (HIP-3 trades) and action. Distinguishes from sibling tools like get_hip3_trades_recent by mentioning 'over a time range'.

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?

Implies usage for historical trade data over a range, but does not explicitly contrast with alternatives like get_hip3_trades_recent or get_trades.

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