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.