Skip to content
clusters: prooflayer · edgemarket · edgefinance · synthforge · mediakit · wordmint · webprobe · locale · comppoint
$ man wallet-pnl

/wallet-pnl(1)

agentutility / edge-market / wallet-pnl
PRICE / CALL
$0.05
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
edgemarket
CATEGORY
uncategorized
STATUS
live
NAME
wallet-pnl wallet token p&l / fifo cost basis / realized + unrealized profit / evm portfolio analytics
SYNOPSIS
POST https://x402.org/v1/wallet-pnl
     Content-Type: application/json
     X-PAYMENT:    <signed-transferWithAuthorization>

     { ... }
↳ first call → 402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.
DESCRIPTION

Wallet token P&L / FIFO cost basis / realized + unrealized profit / EVM portfolio analytics. For any (wallet, ERC-20, chain) triple, pulls all transfers from Etherscan v2, prices each one at the historical USD spot via CoinGecko, runs FIFO accounting and reports cost basis, realized gain, unrealized gain, current balance, and tx count. Capped at the most recent 500 transfers.

INPUTrequest schema
propertytypedescriptionreq?
walletstring0x-prefixed 20-byte wallet address.required
token_addressstring0x-prefixed 20-byte ERC-20 contract.required
chainstringEVM chain. Default 'ethereum'.
enum: base · ethereum · polygon · arbitrum · optimism
optional
OUTPUTresponse shape
fieldtypedescription
walletstringEVM wallet address whose token P&L was computed.
tokenstringERC-20 contract address of the token analyzed.
chainstringEVM chain the wallet and token live on (e.g. ethereum, base, polygon).
symbolstringTicker symbol of the ERC-20 token (e.g. USDC, WETH).
decimalsstringNumber of decimal places the ERC-20 contract uses to format balances.
tx_countstringTotal transfer count for this wallet/token pair included in the FIFO calculation.
transfers_instringCount of inbound transfers credited to the wallet's FIFO inventory.
transfers_outstringCount of outbound transfers consumed against FIFO inventory to realize gains.
current_balancestringWallet's current token balance after applying all in/out transfers, in human units.
current_price_usdstringLatest USD spot price per token from CoinGecko at query time.
cost_basis_usdstringFIFO cost basis in USD for the wallet's remaining token balance.
realized_pnl_usdstringUSD profit/loss already locked in by outbound transfers under FIFO accounting.
unrealized_pnl_usdstringUSD profit/loss on the current balance at current price vs remaining cost basis.
total_pnl_usdstringSum of realized and unrealized USD P&L for this wallet/token/chain triple.
capped_atstringMax transfer count the calculation considered (500 if the wallet exceeded the cap).
coingecko_idstringCoinGecko asset ID used to fetch historical and current USD prices for the token.
sourcestringOrigin of the underlying transfer + price data (e.g. etherscan_v2+coingecko).
EXAMPLEStwo ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.org/v1/wallet-pnl \
  -H 'Content-Type: application/json' \
  -d '{ }'
first response = 402 Payment Required with payment requirements; sign + retry with X-PAYMENT.
EXAMPLE 2 · mcp
# install once
claude mcp add x402 --command "npx x402-deployer-mcp"

# then ask Claude Code:
# "use the wallet-pnl tool to ..."
MCP server handles payment automatically — your coding agent just calls the tool by name.
METADATA
tags
edge-marketwallet-analyticsportfolio-trackingcost-basisfifo-accountingrealized-pnlerc-20wallet-pnl
methods
POST
cluster
edgemarket
price
$0.05 USDC per call
ADJACENTother endpoints in edgemarket
endpointdescriptionprice
honeypot-checkHoneypot.is buy/sell simulation for any Base or Ethereum ERC-20.$0.05
token-honeypotEVM token honeypot detection / can-i-sell check / rug-pull scanner / sell-tax simulator / buy-tax simulator / scam token detector / Base…$0.05
crypto-tx-explainerEthereum/Base/Arbitrum/Optimism/Polygon transaction explainer.$0.04
bridge-ratesCross-chain bridge rate aggregator.$0.03
dao-proposal-monitorSnapshot.org DAO proposal monitor.$0.03
ens-resolveENS resolver / Ethereum Name Service lookup.$0.03
defi-llama-protocolDefiLlama protocol lookup — TVL, chain breakdown, current TVL, 24h/7d/30d changes, audits, parent protocol, categories.$0.02
gas-now-baseGas oracle / EIP-1559 fee estimator.$0.02
SEE ALSO
agentutility(7) · edgemarket(7) · x402(7) · mcp(7) · llms.txt · registry.json · bazaar.x402.org