# Base Wallet FIFO Realized Gains & Tax Lot Estimator

> Base Wallet FIFO Realized Gains & Tax Lot Estimator is a paid API for AI agents from x402-services-production.up.railway.app, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-14).

Calculates FIFO-based realized gains and losses in USD for a Base wallet's ERC-20 trade history, returning per-token and total profit/loss estimates priced at historical closes.

## Facts

- Endpoint: POST https://x402-services-production.up.railway.app/api/portfolio/taxlots
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/base-wallet-fifo-realized-gains-tax-lot-estimator-ab199528
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_aQL8lqPeSBo-NzHOemdhx

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability base-wallet-fifo-realized-gains-tax-lot-estimator-ab199528 -d '<json body>'
```

Example prompt: Can you estimate the realized gains and losses on my Base wallet 0x4f3B...aD92 — I want to see per-token FIFO profit/loss in USD based on historical prices?

## When to prefer this

Use this endpoint when you need a quick FIFO realized-gains estimate for a Base wallet's ERC-20 trading history, especially for tax estimation or portfolio review purposes. Prefer this over on-chain raw data endpoints when you need pre-computed USD P&L rather than raw transaction logs. Not suitable for tax filing — use only for fast estimates.

## Known failure modes

- Invalid or non-Base wallet address returns an error or empty result
- Wallet with no trade history returns zero gains/losses
- Historical price data unavailable for obscure tokens may result in incomplete P&L
- Rate limiting or payment failure (x402) blocks the request
- Very large trade histories may timeout or return partial results

## How this service works

FIFO realized-gains estimate for a wallet: per-token and total realized profit/loss in USD from its Base ERC-20 trade history, priced at historical closes. Send { address }. Fast cost-basis/tax estimate (not filing-grade — see notes).

## Output

Returns a breakdown of realized gains and losses per ERC-20 token traded from the given Base wallet, calculated using FIFO cost-basis methodology and historical close prices, plus a total realized P&L figure in USD. Intended as a fast tax estimate, not filing-grade output.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "address"
 ],
 "properties": {
  "address": {
   "type": "string",
   "description": "0x wallet address (Base)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/base-wallet-fifo-realized-gains-tax-lot-estimator-ab199528/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-services-production.up.railway.app](https://www.zero.xyz/host/x402-services-production.up.railway.app/llms.txt)
