# Wallet PnL (Realized & Unrealized) Lookup

> Wallet PnL (Realized & Unrealized) Lookup is a paid API for AI agents from x402-gateway-production.up.railway.app, paid per call via x402, $0.010000/call, status unknown (last checked 2026-09-15).

Returns realized and unrealized profit & loss per token for a given wallet address

## Facts

- Endpoint: POST https://x402-gateway-production.up.railway.app/api/wallet/pnl
- Price: $0.010000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-gateway-production-up-railway-app-faff7440
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_p6SXG-qfXcOmthN9dQjbX

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 x402-gateway-production-up-railway-app-faff7440 -d '<json body>'
```

Example prompt: What are my realized and unrealized profits and losses broken down by token for wallet address 0x1234abcd...?

## When to prefer this

Use this endpoint when you need per-token realized and unrealized profit/loss analytics for a specific crypto wallet, especially in DeFi portfolio tracking, tax reporting prep, or trading performance review contexts. Prefer this over general balance endpoints when the user needs gain/loss figures rather than raw holdings.

## Known failure modes

- Invalid or malformed wallet address returns an error
- Wallet with no transaction history may return empty or zero PnL
- Unsupported chain or token may be omitted from results
- Network timeouts if on-chain data indexing is slow
- Rate limiting or payment failure if USDC balance insufficient

## How this service works

Realized and unrealized profit & loss per token for any wallet

## Output

A breakdown of realized and unrealized PnL per token held or traded by the specified wallet, showing how much profit or loss has been locked in versus what remains on paper.

## Example request

```json
{
 "chain": "solana",
 "address": "5ZWj7a1f8tWkjBESHKgrLmXshuXxqeY9SYcfbshpAqPG"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "bodyType",
    "body",
    "method"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "chain",
      "address"
     ],
     "properties": {
      "chain": {
       "type": "string",
       "example": "ethereum",
       "description": "Chain name (ethereum, polygon, base, arbitrum, etc.)"
      },
      "address": {
       "type": "string",
       "example": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
       "description": "Wallet address"
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-gateway-production-up-railway-app-faff7440/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway-production.up.railway.app](https://www.zero.xyz/host/x402-gateway-production.up.railway.app/llms.txt)
