{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pmwallets-com/json-schema/pmwallets-com-fill-schema.json",
  "title": "Fill",
  "description": "One fill of an entity you subscribe to, as GET /v1/account/fills returns it (and the stream carries it).",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pmwallets-com-openapi.json#/components/schemas/Fill",
  "type": "object",
  "properties": {
    "eventId": {
      "type": "string",
      "description": "`chain:block:blockHash:txHash:logIndex`; stable across retries and replays. Deduplicate on it."
    },
    "chain": {
      "type": "integer",
      "description": "137 (Polygon)."
    },
    "entityId": {
      "type": "string",
      "description": "The subscribed entity (0x address)."
    },
    "wallet": {
      "type": "string",
      "description": "The address inside the entity that traded (0x)."
    },
    "ts": {
      "type": "string",
      "description": "Block time, UTC, `YYYY-MM-DD HH:MM:SS`."
    },
    "block": {
      "type": "integer"
    },
    "blockHash": {
      "type": "string"
    },
    "txHash": {
      "type": "string"
    },
    "logIndex": {
      "type": "integer"
    },
    "exchange": {
      "type": "string",
      "description": "Which exchange contract matched it, e.g. pm_ctf_v2."
    },
    "side": {
      "type": "string",
      "enum": [
        "BUY",
        "SELL"
      ]
    },
    "role": {
      "type": "string",
      "enum": [
        "maker",
        "taker"
      ]
    },
    "tokenId": {
      "type": "string",
      "description": "Polymarket outcome token id (uint256 as a decimal string)."
    },
    "price": {
      "type": "string",
      "description": "Decimal string, e.g. \"0.570000\"."
    },
    "shares": {
      "type": "string",
      "description": "Integer string, 1e-6 share units (\"3200000000\" = 3,200 shares)."
    },
    "usdc": {
      "type": "string",
      "description": "Integer string, 1e-6 USDC units (\"1824000000\" = $1,824)."
    },
    "fee": {
      "type": "string",
      "description": "Integer string, 1e-6 USDC units."
    }
  },
  "required": [
    "eventId",
    "chain",
    "entityId",
    "wallet",
    "ts",
    "block",
    "blockHash",
    "txHash",
    "logIndex",
    "exchange",
    "side",
    "role",
    "tokenId",
    "price",
    "shares",
    "usdc",
    "fee"
  ]
}