# DeFi Shield Wallet PnL Calculator

> DeFi Shield Wallet PnL Calculator is a paid API for AI agents from defi-shield-hazel.vercel.app, paid per call via x402, $1/call, status unknown (last checked 2026-09-16).

Calculates profit and loss breakdown per token for a given wallet address

## Facts

- Endpoint: POST https://defi-shield-hazel.vercel.app/api/wallet/pnl
- Price: $1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/defi-shield-hazel-vercel-app-97a63aa5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Q7c5h8_PwheEWMgmCj_e8

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 defi-shield-hazel-vercel-app-97a63aa5 -d '<json body>'
```

Example prompt: What's the profit and loss breakdown per token for wallet 0xAbc123...? I want to see exactly which tokens I've made money on and which I've lost money on.

## When to prefer this

Use this endpoint when you need a detailed, per-token profit and loss breakdown for a specific wallet address — particularly useful for DeFi portfolio auditing, tax reporting prep, or performance analysis. Prefer this over generic portfolio trackers when you need structured PnL data programmatically per token.

## Known failure modes

- Invalid or malformed wallet address returns an error
- Wallet with no transaction history may return empty or zero PnL
- Network errors or blockchain RPC timeouts may cause failures
- Payment of $1 USDC required per call — failure to pay returns 402
- Unsupported chain or token may result in incomplete data

## Output

Returns a per-token breakdown of profit and loss for the specified wallet, including realized and unrealized gains/losses for each token held or traded.

## Example request

```json
{
 "input": {
  "body": {
   "address": "0x1234567890123456789012345678901234567890"
  },
  "type": "http",
  "method": "POST",
  "bodyType": "json"
 }
}
```

## 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": {
     "properties": {
      "address": {
       "type": "string",
       "description": "Wallet address for PnL analysis (0x + 40 hex chars)"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/defi-shield-hazel-vercel-app-97a63aa5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from defi-shield-hazel.vercel.app](https://www.zero.xyz/host/defi-shield-hazel.vercel.app/llms.txt)
