Skip to main content
Glama

Wallet profit and loss

wallet_pnl
Read-onlyIdempotent

Calculates realized and unrealized PnL per token from a Solana wallet's DEX swaps in USD, helping assess rug profits, insider gains, and overall trading results.

Instructions

Realized and unrealized PnL per token from a wallet's DEX swaps, valued in USD at the time of each swap (average-cost basis). Answers "did this wallet profit from the rug" (pass mint), sniper/insider profit, and overall trading results. Sales of tokens never bought in the sample (airdropped, sent by a dev wallet, bought before the sample) are reported as unmatchedProceedsUsd and realizedPnlIfUnboughtFreeUsd instead of realized PnL — check those for insiders. With mint set, receivedWithoutSwap lists who sent the wallet that token for free.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNo
mintNoOnly swaps that touch this token
addressYesBase58 Solana address
swapLimitNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.0-development

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, but the description adds real behavioral depth the annotations cannot: average-cost basis, USD valuation at swap time, and the special handling of unmatched sales. It does not disclose sampling limits or what swapLimit/top actually bound, so it is not exhaustive.

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 core definition is front-loaded in the first clause, with edge-case behavior and field names following in order of importance. Dense but every sentence carries information; only the final 'check those for insiders' aside borders on redundant.

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?

With no output schema, the description does the work of naming key return fields (unmatchedProceedsUsd, realizedPnlIfUnboughtFreeUsd, receivedWithoutSwap) and their interpretation, which is exactly what an agent needs. It leaves the meaning of top and swapLimit unexplained, a minor gap for a 4-parameter tool.

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 50%: mint and address are documented in the schema, while top and swapLimit are not. The description usefully explains mint's downstream effect (receivedWithoutSwap), but says nothing about top or swapLimit, so it only partially compensates for the coverage gap.

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?

States a specific verb+resource ('Realized and unrealized PnL per token from a wallet's DEX swaps') plus the valuation basis and the concrete questions it answers. It is clearly distinguishable from siblings like get_swaps (raw swaps) or analyze_wallet (broader profiling).

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?

Gives clear use contexts ('did this wallet profit from the rug', sniper/insider profit, overall trading results) and directs the agent to check unmatchedProceedsUsd for insiders when sales have no matching buy. It never names an alternative tool or states when not to use this one, so it stops short of full routing guidance.

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