# Nansen Prediction Market PnL by Market

> Nansen Prediction Market PnL by Market is a paid API for AI agents from api.nansen.ai, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-13).

Returns profit and loss (PnL) data broken down by prediction market for a given address or market identifier

## Facts

- Endpoint: GET https://api.nansen.ai/api/v1/prediction-market/pnl-by-market
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-nansen-ai-7fcac59a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_f5qol3Ph3j2A5vR2_tuY9

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-nansen-ai-7fcac59a
```

Example prompt: Pull up the PnL breakdown by market for wallet 0xABC123 on Nansen's prediction market analytics — I want to see which markets were profitable and which were losses.

## When to prefer this

Use this endpoint when you need to understand financial performance (profit/loss) segmented by individual prediction market, rather than aggregate address-level PnL or raw trade data. Ideal for portfolio analysis, smart money tracking, and evaluating which specific prediction markets generated gains or losses.

## Known failure modes

- Invalid or missing market/wallet identifier returns 400 error
- No trading history for the given address in prediction markets returns empty results
- Rate limiting or quota exceeded returns 429
- Unsupported market identifier returns 404 or empty response
- Payment not processed correctly via x402 returns 402

## How this service works

Get Prediction Market PnL by Market

## Output

Returns structured PnL data organized by individual prediction market, including profit/loss figures, trade performance metrics, and net outcomes per market for the queried wallet or market scope.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "title": "PnlByMarketRequest",
 "required": [
  "market_id"
 ],
 "properties": {
  "order_by": {
   "anyOf": [
    {
     "type": "array",
     "items": {
      "type": "object",
      "title": "SortOrder[PnlByMarketSortField]",
      "required": [
       "field",
       "direction"
      ],
      "properties": {
       "field": {
        "enum": [
         "total_pnl_usd"
        ],
        "type": "string",
        "title": "PnlByMarketSortField",
        "description": "Sortable fields for PnL by market endpoint."
       },
       "direction": {
        "enum": [
         "ASC",
         "DESC"
        ],
        "type": "string",
        "title": "SortDirection",
        "description": "Enum for sort directions."
       }
      }
     }
    }
   ],
   "title": "Order By",
   "examples": [
    [
     {
      "field": "total_pnl_usd",
      "direction": "DESC"
     }
    ]
   ],
   "description": "Sort order"
  },
  "market_id": {
   "type": "string",
   "title": "Market Id",
   "examples": [
    "654412"
   ],
   "maxLength": 100,
   "minLength": 1,
   "description": "Polymarket market ID"
  },
  "pagination": {
   "type": "object",
   "title": "PaginationRequest",
   "properties": {
    "page": {
     "type": "integer",
     "title": "Page",
     "default": 1,
     "minimum": 1,
     "description": "Page number (1-based)"
    },
    "per_page": {
     "type": "integer",
     "title": "Per Page",
     "default": 10,
     "maximum": 1000,
     "minimum": 1,
     "description": "Number of records per page (max 1000)"
    }
   },
   "description": "Pagination parameters for API requests."
  }
 },
 "description": "Request for PnL by market endpoint.",
 "additionalProperties": false
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "title": "PnlByMarketResponse",
 "required": [
  "data"
 ],
 "properties": {
  "data": {
   "type": "array",
   "items": {
    "type": "object",
    "title": "PnlByMarketItem",
    "required": [
     "market_id"
    ],
    "properties": {
     "address": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Address",
      "description": "Trader address (hex)"
     },
     "event_id": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Event Id",
      "description": "Parent event ID"
     },
     "question": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Question",
      "description": "Market question"
     },
     "market_id": {
      "type": "string",
      "title": "Market Id",
      "examples": [
       "654412"
      ],
      "description": "Market ID"
     },
     "side_held": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Side Held",
      "examples": [
       "Yes"
      ],
      "description": "Side held: Yes, No, or Both. Reflects last known position even if fully exited (unrealized_value_usd = 0). Null only if no buy activity on record."
     },
     "event_title": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Event Title",
      "description": "Parent event title"
     },
     "owner_address": {
      "anyOf": [
       {
        "type": "string"
       }
      ],
      "title": "Owner Address",
      "description": "SAFE proxy owner address (hex)"
     },
     "total_pnl_usd": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Total Pnl Usd",
      "description": "Total PnL in USD"
     },
     "market_resolved": {
      "anyOf": [
       {
        "type": "boolean"
       }
      ],
      "title": "Market Resolved",
      "description": "Whether market is resolved"
     },
     "net_buy_cost_usd": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Net Buy Cost Usd",
      "description": "Net buy cost in USD"
     },
     "redemption_value_usd": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Redemption Value Usd",
      "description": "Redemption value in USD"
     },
     "unrealized_value_usd": {
      "anyOf": [
       {
        "type": "number"
       }
      ],
      "title": "Unrealized Value Usd",
      "description": 
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-nansen-ai-7fcac59a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.nansen.ai](https://www.zero.xyz/host/api.nansen.ai/llms.txt)
