Skip to main content
Glama

Calculating token performance

wallet_pnl_for_token
Read-onlyIdempotent

Get PnL stats for a specific token traded by the input address during a specific date range. Use this tool for analysing the performance of the wallet for the specific token over a time period. Provide exactly one of walletAddress or trader_id. For a trader, send trader_id: the result adds up all wallets of the trader and lists the newest buys and sells of the token.

Chain: pass 'hyperliquid' for a perp coin — there tokenAddress is the perp SYMBOL (e.g. 'BTC', 'HYPE', 'xyz:CL'), not a contract address. Every other chain expects a token contract address.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "request": "<request>"
    },
    "name": "wallet_pnl_for_token"
  }
}

Input Schema

NameRequiredDescriptionDefault
requestYesComplete request for wallet PnL for token (flattened).

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • addedInput schema / properties / request / properties / trader_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Trader ID from the Traders results of general_search. Covers all wallets of the trader. Use it instead of address or entity_id. The result adds up all wallets of the trader on the chain over their full history, with realized and unrealized PnL together (showRealized is not used), and lists the 20 newest buys and sells in dateRange. Set chain to the chain of the token (an EVM token can be on several chains). On chain='hyperliquid' it shows one row for each wallet and a sum."
      +}
    • addedInput schema / properties / request / properties / walletAddress / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / request / properties / walletAddress / default
      Added value: +null
    • changedInput schema / properties / request / properties / walletAddress / description
      Previous value: -"The wallet address to analyze"New value: +"The wallet address to analyze. REQUIRED if trader_id is not provided. Cannot be used together with trader_id."
    • removedInput schema / properties / request / properties / walletAddress / type
      Removed value: -"string"
    • changedInput schema / properties / request / required
      Previous value: -[
      -  "walletAddress",
      -  "tokenAddress",
      -  "dateRange",
      -  "showRealized"
      -]New value: +[
      +  "tokenAddress",
      +  "dateRange",
      +  "showRealized"
      +]
  2. Changed6 schema fields changed
    • addedInput schema / properties / request / additionalProperties
      Added value: +false
    • removedInput schema / properties / request / anyOf
      Removed value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "description": "Complete request for wallet PnL for token (flattened).",
      -    "properties": {
      -      "chain": {
      -        "default": "evm",
      -        "description": "Blockchain to query. Use 'hyperliquid' for a Hyperliquid perp coin — then tokenAddress is the perp SYMBOL (e.g. 'BTC', 'HYPE', 'xyz:CL'), not a contract address, and the wallet must be an EVM address. Every other chain expects a token contract address.",
      -        "type": "string"
      -      },
      -      "dateRange": {
      -        "description": "Date range for PnL analysis",
      -        "properties": {
      -          "from": {
      -            "description": "Start token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps; dates and calendar tokens start at midnight.",
      -            "type": "string"
      -          },
      -          "to": {
      -            "description": "End token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps without an extra day. Dates and calendar tokens include the final date; TODAY_START stays at midnight.",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "from",
      -          "to"
      -        ],
      -        "type": "object"
      -      },
      -      "showRealized": {
      -        "description": "Set to true for realized PnL (completed/closed trades), false for current position analysis (unrealized PnL + active holdings). Ignored on chain='hyperliquid', which always reports both.",
      -        "type": "boolean"
      -      },
      -      "tokenAddress": {
      -        "description": "Token address to generate PnL stats for",
      -        "type": "string"
      -      },
      -      "walletAddress": {
      -        "description": "The wallet address to analyze",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "walletAddress",
      -      "tokenAddress",
      -      "dateRange",
      -      "showRealized"
      -    ],
      -    "type": "object"
      -  }
      -]
    • addedInput schema / properties / request / description
      Added value: +"Complete request for wallet PnL for token (flattened)."
    • addedInput schema / properties / request / properties
      Added value: +{
      +  "chain": {
      +    "default": "evm",
      +    "description": "Blockchain to query. Use 'hyperliquid' for a Hyperliquid perp coin — then tokenAddress is the perp SYMBOL (e.g. 'BTC', 'HYPE', 'xyz:CL'), not a contract address, and the wallet must be an EVM address. Every other chain expects a token contract address.",
      +    "type": "string"
      +  },
      +  "dateRange": {
      +    "additionalProperties": false,
      +    "description": "Date range for PnL analysis",
      +    "properties": {
      +      "from": {
      +        "description": "Start token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps; dates and calendar tokens start at midnight.",
      +        "type": "string"
      +      },
      +      "to": {
      +        "description": "End token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps without an extra day. Dates and calendar tokens include the final date; TODAY_START stays at midnight.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "from",
      +      "to"
      +    ],
      +    "type": "object"
      +  },
      +  "showRealized": {
      +    "description": "Set to true for realized PnL (completed/closed trades), false for current position analysis (unrealized PnL + active holdings). Ignored on chain='hyperliquid', which always reports both.",
      +    "type": "boolean"
      +  },
      +  "tokenAddress": {
      +    "description": "Token address to generate PnL stats for",
      +    "type": "string"
      +  },
      +  "walletAddress": {
      +    "description": "The wallet address to analyze",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / request / required
      Added value: +[
      +  "walletAddress",
      +  "tokenAddress",
      +  "dateRange",
      +  "showRealized"
      +]
    • addedInput schema / properties / request / type
      Added value: +"object"
  3. Changed1 schema field changed
    • changedInput schema / properties / request / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "description": "Complete request for wallet PnL for token (flattened).",
      -    "properties": {
      -      "chain": {
      -        "default": "evm",
      -        "description": "Blockchain to query. Use 'hyperliquid' for a Hyperliquid perp coin — then tokenAddress is the perp SYMBOL (e.g. 'BTC', 'HYPE', 'xyz:CL'), not a contract address, and the wallet must be an EVM address. Every other chain expects a token contract address.",
      -        "type": "string"
      -      },
      -      "dateRange": {
      -        "description": "Date range for PnL analysis",
      -        "properties": {
      -          "from": {
      -            "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -            "type": "string"
      -          },
      -          "to": {
      -            "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "from",
      -          "to"
      -        ],
      -        "type": "object"
      -      },
      -      "showRealized": {
      -        "description": "Set to true for realized PnL (completed/closed trades), false for current position analysis (unrealized PnL + active holdings). Ignored on chain='hyperliquid', which always reports both.",
      -        "type": "boolean"
      -      },
      -      "tokenAddress": {
      -        "description": "Token address to generate PnL stats for",
      -        "type": "string"
      -      },
      -      "walletAddress": {
      -        "description": "The wallet address to analyze",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "walletAddress",
      -      "tokenAddress",
      -      "dateRange",
      -      "showRealized"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "description": "Complete request for wallet PnL for token (flattened).",
      +    "properties": {
      +      "chain": {
      +        "default": "evm",
      +        "description": "Blockchain to query. Use 'hyperliquid' for a Hyperliquid perp coin — then tokenAddress is the perp SYMBOL (e.g. 'BTC', 'HYPE', 'xyz:CL'), not a contract address, and the wallet must be an EVM address. Every other chain expects a token contract address.",
      +        "type": "string"
      +      },
      +      "dateRange": {
      +        "description": "Date range for PnL analysis",
      +        "properties": {
      +          "from": {
      +            "description": "Start token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps; dates and calendar tokens start at midnight.",
      +            "type": "string"
      +          },
      +          "to": {
      +            "description": "End token or date (YYYY-MM-DD or ___-MM-DD). Durations use exact rolling UTC timestamps without an extra day. Dates and calendar tokens include the final date; TODAY_START stays at midnight.",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "from",
      +          "to"
      +        ],
      +        "type": "object"
      +      },
      +      "showRealized": {
      +        "description": "Set to true for realized PnL (completed/closed trades), false for current position analysis (unrealized PnL + active holdings). Ignored on chain='hyperliquid', which always reports both.",
      +        "type": "boolean"
      +      },
      +      "tokenAddress": {
      +        "description": "Token address to generate PnL stats for",
      +        "type": "string"
      +      },
      +      "walletAddress": {
      +        "description": "The wallet address to analyze",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "walletAddress",
      +      "tokenAddress",
      +      "dateRange",
      +      "showRealized"
      +    ],
      +    "type": "object"
      +  }
      +]
  4. Changed1 schema field changed
    • changedInput schema / properties / request / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "description": "Complete request for wallet PnL for token (flattened).",
      -    "properties": {
      -      "chain": {
      -        "default": "evm",
      -        "type": "string"
      -      },
      -      "dateRange": {
      -        "description": "Date range for PnL analysis",
      -        "properties": {
      -          "from": {
      -            "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -            "type": "string"
      -          },
      -          "to": {
      -            "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "from",
      -          "to"
      -        ],
      -        "type": "object"
      -      },
      -      "showRealized": {
      -        "description": "Set to true for realized PnL (completed/closed trades), false for current position analysis (unrealized PnL + active holdings)",
      -        "type": "boolean"
      -      },
      -      "tokenAddress": {
      -        "description": "Token address to generate PnL stats for",
      -        "type": "string"
      -      },
      -      "walletAddress": {
      -        "description": "The wallet address to analyze",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "walletAddress",
      -      "tokenAddress",
      -      "dateRange",
      -      "showRealized"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "description": "Complete request for wallet PnL for token (flattened).",
      +    "properties": {
      +      "chain": {
      +        "default": "evm",
      +        "description": "Blockchain to query. Use 'hyperliquid' for a Hyperliquid perp coin — then tokenAddress is the perp SYMBOL (e.g. 'BTC', 'HYPE', 'xyz:CL'), not a contract address, and the wallet must be an EVM address. Every other chain expects a token contract address.",
      +        "type": "string"
      +      },
      +      "dateRange": {
      +        "description": "Date range for PnL analysis",
      +        "properties": {
      +          "from": {
      +            "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      +            "type": "string"
      +          },
      +          "to": {
      +            "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "from",
      +          "to"
      +        ],
      +        "type": "object"
      +      },
      +      "showRealized": {
      +        "description": "Set to true for realized PnL (completed/closed trades), false for current position analysis (unrealized PnL + active holdings). Ignored on chain='hyperliquid', which always reports both.",
      +        "type": "boolean"
      +      },
      +      "tokenAddress": {
      +        "description": "Token address to generate PnL stats for",
      +        "type": "string"
      +      },
      +      "walletAddress": {
      +        "description": "The wallet address to analyze",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "walletAddress",
      +      "tokenAddress",
      +      "dateRange",
      +      "showRealized"
      +    ],
      +    "type": "object"
      +  }
      +]
  5. Changed3 schema fields changed
    • removedInput schema / $defs
      Removed value: -{
      -  "DateRange": {
      -    "description": "Date range via tokens or dates.\nTokens: NOW, XMIN_AGO, XD_AGO, XH_AGO; THIS_YEAR_START, THIS_QUARTER_START, THIS_MONTH_START, THIS_WEEK_START, TODAY_START; LAST_WEEK_START/END, LAST_MONTH_START/END, LAST_QUARTER_START/END, LAST_YEAR_START/END.\nWeek starts Monday. Quarters are calendar. Dates: YYYY-MM-DD or ___-MM-DD (year omitted).\nPlease check detailed system instructions for more information.",
      -    "properties": {
      -      "from": {
      -        "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -        "type": "string"
      -      },
      -      "to": {
      -        "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "from",
      -      "to"
      -    ],
      -    "type": "object"
      -  },
      -  "WalletPnlForTokenRequest": {
      -    "description": "Complete request for wallet PnL for token (flattened).",
      -    "properties": {
      -      "chain": {
      -        "default": "evm",
      -        "type": "string"
      -      },
      -      "dateRange": {
      -        "$ref": "#/$defs/DateRange",
      -        "description": "Date range for PnL analysis"
      -      },
      -      "showRealized": {
      -        "description": "Set to true for realized PnL (completed/closed trades), false for current position analysis (unrealized PnL + active holdings)",
      -        "type": "boolean"
      -      },
      -      "tokenAddress": {
      -        "description": "Token address to generate PnL stats for",
      -        "type": "string"
      -      },
      -      "walletAddress": {
      -        "description": "The wallet address to analyze",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "walletAddress",
      -      "tokenAddress",
      -      "dateRange",
      -      "showRealized"
      -    ],
      -    "type": "object"
      -  }
      -}
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / request / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  {
      -    "$ref": "#/$defs/WalletPnlForTokenRequest"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "description": "Complete request for wallet PnL for token (flattened).",
      +    "properties": {
      +      "chain": {
      +        "default": "evm",
      +        "type": "string"
      +      },
      +      "dateRange": {
      +        "description": "Date range for PnL analysis",
      +        "properties": {
      +          "from": {
      +            "description": "Start value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      +            "type": "string"
      +          },
      +          "to": {
      +            "description": "End value: token (see above) or date (YYYY-MM-DD or ___-MM-DD).",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "from",
      +          "to"
      +        ],
      +        "type": "object"
      +      },
      +      "showRealized": {
      +        "description": "Set to true for realized PnL (completed/closed trades), false for current position analysis (unrealized PnL + active holdings)",
      +        "type": "boolean"
      +      },
      +      "tokenAddress": {
      +        "description": "Token address to generate PnL stats for",
      +        "type": "string"
      +      },
      +      "walletAddress": {
      +        "description": "The wallet address to analyze",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "walletAddress",
      +      "tokenAddress",
      +      "dateRange",
      +      "showRealized"
      +    ],
      +    "type": "object"
      +  }
      +]
  6. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Beyond the readOnly/idempotent annotations, it discloses meaningful behavior: the trader_id path aggregates all of a trader's wallets over full history, forces realized and unrealized together (showRealized is ignored), and returns the 20 newest buys and sells in the range; on hyperliquid it returns one row per wallet plus a sum. That is substantive disclosure of what the output looks like. It stops short of covering rate limits, error cases, or response size.

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

Conciseness4/5

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

The first two sentences front-load purpose and usage, then the parameter and chain rules follow in a logical order. The chain paragraph partly duplicates the schema's chain description, which is a small redundancy, but the text is tight and readable.

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?

For a single nested object containing many fields, an output schema, and full annotations, the description covers the main decision points and chain-specific quirks. The main gap is that it never places itself against the other PnL tools, and it says nothing about failure modes or limits, though neither is essential given the rich schema.

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 description coverage is 100%, so the nested request fields are already documented in detail, including the hyperliquid tokenAddress-as-symbol rule and the walletAddress/trader_id mutual exclusion. The description largely restates those constraints rather than adding new parameter meaning, so the baseline of 3 applies.

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

Purpose4/5

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

States a specific verb and resource (PnL stats for a specific token) plus the three scoping axes: address, token, and date range. It is clearly narrower than an aggregate wallet PnL tool, though it never names that sibling, so the differentiation is inferred from scope rather than stated.

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

Usage Guidelines3/5

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

"Use this tool for analysing the performance of the wallet for the specific token over a time period" restates the purpose rather than giving when/when-not guidance. It does add real routing rules for walletAddress versus trader_id and for hyperliquid versus other chains, but never says when to prefer a different tool such as a wallet-level PnL summary.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources