Realized profit and loss and cost basis for an ERC20 token in a wallet on Base, ...
Realized profit and loss and cost basis for an ERC20 token in a wallet on Base, computed from on-chain DEX trades against a quote asset (USDC by default). Returns average buy and sell price, realized PnL, remaining position and cost basis. Search terms: wallet PnL, realized gains, cost basis, token profit, crypto tax accounting, trade history.
Start with a quote-only recipe. Payment signing stays in your project.
const response = await fetch("https://api.x402node.dev/wallet/pnl", {
method: "GET",
});
console.log(response.status);
console.log(Object.fromEntries(response.headers));
console.log((await response.text()).slice(0, 1000));
// A valid 402 is a quote, not a completed paid call.This sends no payment. Inspect the 402 response before adding a wallet-enabled client.
- Live 402 quote confirmed
GET returned a protocol-valid 402 quote (402). No payment was made.
- Origin reachable
HEAD https://api.x402node.dev/ returned 404.
- Observed in cdp-bazaar
The registry record was observed and retained with provenance.
- Observed in 402-index
Discovered through bazaar.
- Registry record checked
Registry health: healthy.
EVIDENCE
Each record has an exact-route quote outcome. Unresolved templates and potentially mutating methods are labeled instead of being invoked without provider-specific test input. A quote is still separate from a settled paid call.