Calculate a Polymarket wallet's P&L

Reconcile wallet trades with resolved outcomes, including losing positions absent from closed positions.

GET /wallets/{id}/pnl

Use this endpoint to inspect the evidence behind a wallet's profits. Read coverage before comparing wallets. The estimate covers observed trades; missing opening inventory, transfers, merges and fees can limit the result.

Authentication

Send your key in the X-API-Key header. Keep the key out of URLs and shared logs.

Parameters

NameLocationTypeRequiredDetails
idpathstringYes minLength: 1. maxLength: 160. pattern: ^[A-Za-z0-9_.-]+$.

Example request

curl --fail-with-body -X GET \
  "https://polymarket.omray.dev/wallets/YOUR_WALLET_OR_MARKET_ID/pnl" \
  -H "X-API-Key: $PM_API_KEY"

Responses

StatusMeaning
200Successful Response
422Validation Error

Authenticated requests can return 401 for an invalid key or 429 when a plan limit is reached. Upstream failures may return a server error; do not treat an error as an empty dataset.

OpenAPI operation schema
{
  "tags": [
    "Wallets"
  ],
  "summary": "Polymarket wallet P&L including hidden losses",
  "description": "Reconcile visible buys and sells with market resolutions. Coverage flags explain missing history, transfers, and unresolved positions.",
  "operationId": "wallet_pnl",
  "security": [
    {
      "APIKeyHeader": []
    }
  ],
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 160,
        "pattern": "^[A-Za-z0-9_.-]+$",
        "title": "Id"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Successful Response",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/WalletPnl"
          }
        }
      }
    },
    "422": {
      "description": "Validation Error",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/HTTPValidationError"
          }
        }
      }
    }
  }
}