Skip to main content
Glama

get_liquidations_by_user

Read-onlyIdempotent

Get liquidation history for a Hyperliquid user. Returns events where the user was liquidated or acted as liquidator, with optional coin filter.

Instructions

Get Hyperliquid liquidation history for a specific user address. Returns liquidations where the user was either liquidated or was the liquidator. Filter by coin optionally.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesUser's wallet address (e.g., '0x1234...')
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
coinNoOptional coin filter

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

  • The handler function for get_liquidations_by_user. It extracts params (address, start, end, limit, cursor, coin), resolves time range, builds SDK params, optionally normalizes the coin filter, and calls api().hyperliquid.liquidations.byUser().
    registerTool(
      "get_liquidations_by_user",
      "Get Hyperliquid liquidation history for a specific user address. Returns liquidations where the user was either liquidated or was the liquidator. Filter by coin optionally.",
      {
        address: z.string().describe("User's wallet address (e.g., '0x1234...')"),
        ...HistoryParams,
        coin: CoinParam.optional().describe("Optional coin filter"),
      },
      ListOutputSchema,
      async (params) => {
        const { address, start, end, limit, cursor, coin } = params;
        const timeRange = resolveTimeRange(start, end);
        const sdkParams: Record<string, unknown> = {
          ...timeRange,
          limit: resolveLimit(limit),
        };
        if (cursor) sdkParams.cursor = cursor;
        if (coin) sdkParams.coin = coin.toUpperCase();
        const result = await api().hyperliquid.liquidations.byUser(address, sdkParams as any);
        return formatCursorResponse(result);
      }
    );
  • src/index.ts:569-590 (registration)
    The tool registration for get_liquidations_by_user using the registerTool helper (not one of the standard patterns like registerHistoryTool, since this has a custom address parameter). Registers name, description, input schema (address + HistoryParams + optional coin), and output schema (ListOutputSchema).
    registerTool(
      "get_liquidations_by_user",
      "Get Hyperliquid liquidation history for a specific user address. Returns liquidations where the user was either liquidated or was the liquidator. Filter by coin optionally.",
      {
        address: z.string().describe("User's wallet address (e.g., '0x1234...')"),
        ...HistoryParams,
        coin: CoinParam.optional().describe("Optional coin filter"),
      },
      ListOutputSchema,
      async (params) => {
        const { address, start, end, limit, cursor, coin } = params;
        const timeRange = resolveTimeRange(start, end);
        const sdkParams: Record<string, unknown> = {
          ...timeRange,
          limit: resolveLimit(limit),
        };
        if (cursor) sdkParams.cursor = cursor;
        if (coin) sdkParams.coin = coin.toUpperCase();
        const result = await api().hyperliquid.liquidations.byUser(address, sdkParams as any);
        return formatCursorResponse(result);
      }
    );
  • Input schema for get_liquidations_by_user: address (required string), plus HistoryParams (start, end, limit, cursor), plus optional coin filter.
    {
      address: z.string().describe("User's wallet address (e.g., '0x1234...')"),
      ...HistoryParams,
      coin: CoinParam.optional().describe("Optional coin filter"),
    },
  • Output schema is ListOutputSchema: records array, count, and optional nextCursor.
    ListOutputSchema,
Behavior3/5

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

Annotations already declare read-only, non-destructive, idempotent, and open-world hints. The description adds that results include both user-as-victim and user-as-liquidator, which is useful but not extensive beyond annotations.

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 the core action, no fluff. Every sentence adds value.

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?

Given the simple read-only retrieval nature, rich annotations, and full schema coverage, the description is complete. It covers user filtering and optional coin filter, which is sufficient.

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?

All 6 parameters are described in the input schema (100% coverage). The description only mentions the optional coin filter, adding no significant new meaning beyond 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?

The description clearly states the tool retrieves liquidation history for a specific user address, distinguishing it from general liquidation tools like get_liquidations. It also specifies that results include both sides (liquidated or liquidator) and optional coin filtering.

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?

The description indicates use for a specific user address, but does not explicitly compare to siblings like get_liquidations or get_liquidation_volume. However, the context is clear enough for an agent to infer appropriate usage.

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