# HyperD Wallet P&L Calculator

> HyperD Wallet P&L Calculator is a paid API for AI agents from api.hyperd.ai, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-15).

Computes realized and unrealized profit/loss for an EVM wallet over a configurable time window, with per-token breakdown and multiple cost-basis methods

## Facts

- Endpoint: GET https://api.hyperd.ai/api/wallet/pnl
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-hyperd-ai-555813c7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_T_JKppzfis41w7bQvZH7L

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 api-hyperd-ai-555813c7
```

Example prompt: What's the realized and unrealized P&L for wallet 0xAbC...123 on Ethereum over the last 30 days using FIFO cost basis — break it down by token?

## When to prefer this

Use this endpoint when you need detailed profit/loss accounting for an EVM wallet with configurable cost-basis methods (FIFO, LIFO, HCFO), especially when you need per-token breakdown with mark-to-market valuation. Prefer this over generic balance endpoints when trading performance analysis or tax-relevant P&L computation is the goal. Best suited for single-chain analysis per call on Base, Ethereum, Polygon, Arbitrum, Optimism, Avalanche, or BNB.

## Known failure modes

- Invalid or malformed wallet address returns 400 error
- Unsupported chain value returns validation error
- 'from' timestamp after 'to' timestamp returns invalid range error
- Network timeout or upstream data source failure returns 5xx
- Wallet with no transaction history returns zero P&L with empty token breakdown
- x402 payment failure or insufficient USDC returns 402 Payment Required

## How this service works

Returns wallet profit and loss analytics for a given address.

## Output

Returns total realized P&L, total unrealized P&L, and a per-token breakdown including each token's weighted-average cost basis, current mark-to-market value, and individual realized/unrealized gains. Any trades that could not be priced are surfaced separately under coverage.unpricedTrades. Gas fee USD attribution is not included in v1.0.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "chain": "base",
   "method": "fifo",
   "address": "0x1234567890123456789012345678901234567890"
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "to": {
       "type": "integer",
       "description": "Window end, unix seconds. Default = now."
      },
      "from": {
       "type": "integer",
       "description": "Window start, unix seconds. Default = to - 30 days."
      },
      "chain": {
       "enum": [
        "base",
        "ethereum",
        "polygon",
        "arbitrum",
        "optimism",
        "avalanche",
        "bnb"
       ],
       "type": "string",
       "description": "Chain to compute P&L on. Default 'base'."
      },
      "method": {
       "enum": [
        "fifo",
        "lifo",
        "hcfo"
       ],
       "type": "string",
       "description": "Cost-basis method. Default 'fifo'."
      },
      "address": {
       "type": "string",
       "description": "0x EVM wallet address"
      }
     }
    }
   },
   "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/api-hyperd-ai-555813c7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.hyperd.ai](https://www.zero.xyz/host/api.hyperd.ai/llms.txt)
