PnLSaver

Docs

PnL and cost basis

PnL is reconstructed from the wallet's own trade history — average cost, per token, per chain — and every token tells you how complete that reconstruction is.

The model

  • Average cost, tracked separately for each token contract on each chain.
  • Driven by trades. Swaps create and consume basis; plain transfers do not.
  • One global ledger across chains, so a bridge hands the source's average cost to the destination instead of looking like a sale followed by a purchase.
  • Realized PnL comes from disposals that recorded basis covers. Unrealized PnL is computed in the browser from your live balance and price against that basis, so the two surfaces cannot disagree.

Three rules that keep it honest

An unvalued acquisition is not a free coin

When an acquisition cannot be priced, it increases your quantity but not your basis, and the token is flagged. Treating it as zero cost would fabricate profit the moment you sell.

Selling more than basis covers books only the covered part

If history accounts for less than you sold, PnL is booked on the covered share and the uncovered proceeds are dropped rather than counted as pure profit. The token is marked incomplete.

A bridge moves basis, it does not realize PnL

The known-cost fraction of what was sent is carried to the destination chain, so bridge fees shrink the amount without distorting average cost.

Confidence badges

BadgeWhat it means
HighEvery acquisition could be valued, every disposal is covered by basis, and no price used was low confidence.
EstimatedSome acquisitions or disposals could not be valued, a historical price came back low confidence, or a material amount arrived by untraced transfer.
IncompleteNo acquisition could be valued at all, or the wallet sold more than its history accounts for.

The badge always carries a readable reason. The rule is to show the limit rather than hide the token.

How historical prices are found

  • Each leg of a swap is valued at the time it happened, using hourly price buckets that are cached on disk between requests.
  • Native coin legs are valued through the chain's wrapped native token.
  • When the price provider reports low confidence, the token drops to the estimated badge instead of silently accepting the number.
  • On very large histories, remote lookups are bounded per chain, so a heavily traded wallet degrades to partial coverage rather than losing cost basis entirely.

Transfers, airdrops, and protocol round-trips

Plain transfers are netted, not booked as trades. Supplying and withdrawing from a lending market moves the same tokens in and out repeatedly; booking those as buys and sells would collapse average cost toward zero. A material untraced inflow only lowers the confidence badge.

Tokens that genuinely arrived by transfer can be valued on demand at their arrival price, lot by lot, and the result is capped by the quantity the ledger could not trace, so the same units are never counted twice.

What PnL does not do

  • Gas and protocol fees are not deducted anywhere.
  • Multi-hop swaps keep only their largest leg, so split routes are partial.
  • Average cost only: there is no FIFO, LIFO, or HIFO option and no tax-lot export.
  • Bridges that no resolver can match land as untraced, which lowers confidence instead of inventing a destination.
  • Only Aave has protocol-aware inventory conversions; other supply, withdraw, and wrap round-trips are netted as plain transfers.
  • Realized PnL has no time dimension yet — there is no per-period or year-to-date view.

Try it

Start with a public wallet address.

No connection, signature, approval, or transaction required.

Open PnLSaver