{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pmwallets-com/json-schema/pmwallets-com-entity-schema.json",
  "title": "Entity",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pmwallets-com-openapi.json#/components/schemas/Entity",
  "type": "object",
  "properties": {
    "periodId": {
      "type": "string"
    },
    "entityId": {
      "type": "string",
      "description": "Handle, or the address if you hold it."
    },
    "label": {
      "type": "string"
    },
    "tier": {
      "type": "string",
      "enum": [
        "free",
        "subscriber"
      ]
    },
    "revealed": {
      "type": "boolean"
    },
    "revealCents": {
      "type": "integer",
      "description": "Unlock price now (0 = free band)."
    },
    "viaPlan": {
      "type": "boolean"
    },
    "plan": {
      "$ref": "#/$defs/PlanUsage"
    },
    "subscribed": {
      "type": "boolean"
    },
    "badges": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "two-sided-maker",
          "high-win-rate",
          "pnl-1k",
          "short-term",
          "swing",
          "holds-to-settlement"
        ]
      }
    },
    "tagVersion": {
      "type": "integer"
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "share": {
            "type": "number"
          }
        }
      }
    },
    "stats": {
      "description": "The window figures (same fields as a board row, plus wr/lo/hi).",
      "allOf": [
        {
          "$ref": "#/$defs/LeaderboardRow"
        }
      ]
    },
    "history": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "partialPct": {
          "type": "number"
        },
        "since": {
          "type": "string"
        }
      },
      "description": "Set when a notable share of markets were opened before the ledger begins."
    },
    "dataSource": {
      "type": "string",
      "enum": [
        "live",
        "frozen"
      ]
    },
    "dataPeriodId": {
      "type": "string"
    },
    "dataAsOf": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "quiet",
        "dormant"
      ]
    },
    "statusAsOf": {
      "type": [
        "string",
        "null"
      ]
    },
    "pnlCurve": {
      "type": "object",
      "description": "PnL from genesis to the end of each day.",
      "properties": {
        "locked": {
          "type": "boolean"
        },
        "since": {
          "type": [
            "string",
            "null"
          ]
        },
        "through": {
          "type": [
            "string",
            "null"
          ]
        },
        "fromGenesis": {
          "type": "boolean"
        },
        "points": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string"
              },
              "pnl": {
                "type": "number"
              }
            }
          }
        }
      }
    },
    "wallets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "wallet": {
            "type": "string",
            "description": "Masked unless you subscribe to the entity."
          },
          "kind": {
            "type": "string"
          },
          "method": {
            "type": "string"
          }
        }
      }
    },
    "fills": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EntityFill"
      }
    },
    "tags": {
      "type": "object",
      "additionalProperties": true
    },
    "fillSample": {
      "type": "integer",
      "description": "Row cap applied to `fills` (100 subscribed, else 10)."
    },
    "fillsDelayedMs": {
      "type": "integer",
      "description": "0 when subscribed, else 900000 (15 min)."
    },
    "views": {
      "type": "object",
      "properties": {
        "usedToday": {
          "type": "integer"
        },
        "cap": {
          "type": "integer"
        }
      },
      "description": "Subscriber tier: the distinct-entity budget after this call."
    }
  },
  "$defs": {
    "Activity": {
      "type": "object",
      "properties": {
        "nFills": {
          "type": "integer"
        },
        "firstFillTs": {
          "type": [
            "string",
            "null"
          ]
        },
        "lastFillTs": {
          "type": [
            "string",
            "null"
          ]
        },
        "lastFillBlock": {
          "type": "integer"
        },
        "activeDays": {
          "type": "integer"
        },
        "fills24h": {
          "type": "integer"
        },
        "fills7d": {
          "type": "integer"
        },
        "windowEndTs": {
          "type": [
            "string",
            "null"
          ]
        },
        "makerFills": {
          "type": [
            "number",
            "null"
          ]
        },
        "makerUsdc": {
          "type": [
            "number",
            "null"
          ]
        },
        "usdc": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    },
    "EntityFill": {
      "type": "object",
      "description": "A recent fill on the entity page. For readers who do not subscribe to the entity, `wallet`, `txHash` and `blockHash` are masked and the list is delayed 15 minutes.",
      "properties": {
        "block": {
          "type": "integer"
        },
        "logIndex": {
          "type": "integer"
        },
        "blockHash": {
          "type": "string"
        },
        "ts": {
          "type": "string"
        },
        "txHash": {
          "type": "string"
        },
        "wallet": {
          "type": "string"
        },
        "role": {
          "type": "string"
        },
        "side": {
          "type": "string"
        },
        "tokenId": {
          "type": "string"
        },
        "price": {
          "type": "string"
        },
        "shares": {
          "type": "string",
          "description": "1e-6 units."
        },
        "usdc": {
          "type": "string",
          "description": "1e-6 units."
        },
        "fee": {
          "type": "string",
          "description": "1e-6 units."
        },
        "exchange": {
          "type": "string"
        },
        "conditionId": {
          "type": "string"
        },
        "marketTitle": {
          "type": "string"
        },
        "marketSlug": {
          "type": "string"
        },
        "eventSlug": {
          "type": "string"
        }
      }
    },
    "LeaderboardRow": {
      "type": "object",
      "properties": {
        "entityId": {
          "type": "string",
          "description": "Handle until you hold the address, then the 0x address. Pass it back to other endpoints as-is."
        },
        "label": {
          "type": "string",
          "description": "Masked address (0x4b96…984e) until you hold it, then the full address."
        },
        "revealed": {
          "type": "boolean",
          "description": "You hold the address (paid unlock, a still-free free unlock, or an active plan unlock)."
        },
        "revealCents": {
          "type": "integer",
          "description": "What unlocking this address costs now (0 = free band). Absent when not for sale (prices not published for the window)."
        },
        "subscribed": {
          "type": "boolean",
          "description": "You have an active push subscription to it."
        },
        "subscriptionId": {
          "type": "string",
          "description": "Present when subscribed."
        },
        "viaPlan": {
          "type": "boolean",
          "description": "Held only through your plan; masked again when the plan ends."
        },
        "unlockedBy": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "paid",
            "free",
            "plan",
            null
          ],
          "description": "mine=1 only: how you hold it; null = lapsed (masked again)."
        },
        "pausedReason": {
          "type": "string",
          "description": "mine=1 only: your subscription to it is paused for this reason."
        },
        "wallets": {
          "type": "integer",
          "description": "Addresses of the entity that traded in the window."
        },
        "conditions": {
          "type": "integer",
          "description": "Markets traded in the window."
        },
        "eligible": {
          "type": "integer",
          "description": "Settled markets counted (wins + losses + breakevens)."
        },
        "wins": {
          "type": "integer"
        },
        "losses": {
          "type": "integer"
        },
        "breakevens": {
          "type": "integer"
        },
        "excludedConditions": {
          "type": "integer"
        },
        "realizedPnl": {
          "type": "number",
          "description": "Dollars."
        },
        "unrealizedPnl": {
          "type": "number",
          "description": "Dollars."
        },
        "totalPnl": {
          "type": "number",
          "description": "Dollars."
        },
        "grossBuyUsdc": {
          "type": "number",
          "description": "Dollars spent buying in the window."
        },
        "feeUsdc": {
          "type": "number"
        },
        "roiOnBuys": {
          "type": "number",
          "description": "realizedPnl / grossBuyUsdc (0.2 = 20%)."
        },
        "nFills": {
          "type": "integer"
        },
        "pnlExTop": {
          "type": "number",
          "description": "Realised PnL minus its single best settled market; decides the price band."
        },
        "pricePnlExTop": {
          "type": [
            "number",
            "null"
          ]
        },
        "wr": {
          "type": [
            "number",
            "null"
          ]
        },
        "lo": {
          "type": [
            "number",
            "null"
          ]
        },
        "hi": {
          "type": [
            "number",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "quiet",
            "dormant"
          ],
          "description": "Last fill <24h / <7d / older."
        },
        "statusAsOf": {
          "type": [
            "string",
            "null"
          ]
        },
        "style": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "maker",
            "taker",
            "two-sided",
            null
          ],
          "description": "By share of traded value made as maker (>=0.8 maker, <=0.2 taker)."
        },
        "makerShare": {
          "type": [
            "number",
            "null"
          ]
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "category": {
                "type": "string",
                "enum": [
                  "crypto-updown",
                  "crypto",
                  "esports",
                  "sports",
                  "politics",
                  "economy",
                  "geopolitics",
                  "science-tech",
                  "culture",
                  "other",
                  "unknown"
                ]
              },
              "share": {
                "type": "number"
              }
            }
          }
        },
        "activity": {
          "$ref": "#/$defs/Activity"
        },
        "dataSource": {
          "type": "string",
          "enum": [
            "live",
            "frozen"
          ]
        },
        "dataPeriodId": {
          "type": "string"
        },
        "dataAsOf": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "PlanUsage": {
      "type": "object",
      "description": "The caller's plan and what is left of its unlock allowance (present when signed in).",
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "active",
            "grace",
            "none"
          ]
        },
        "tier": {
          "type": [
            "string",
            "null"
          ]
        },
        "graceUntil": {
          "type": [
            "string",
            "null"
          ]
        },
        "daily": {
          "type": "integer"
        },
        "dailyUsed": {
          "type": "integer"
        },
        "monthly": {
          "type": "integer"
        },
        "monthlyUsed": {
          "type": "integer"
        },
        "pushSlots": {
          "type": "integer"
        },
        "pushActive": {
          "type": "integer"
        }
      }
    }
  }
}