{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket vs Kalshi Disagreement Monitor",
    "description": "Detect explainable cross-market and related-market probability inconsistencies as research signals, with persistent monitoring and alerts.",
    "version": "0.1",
    "x-build-id": "Ilzt7y0i1oHlXnsks"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fetchfinch~prediction-market-disagreement-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fetchfinch-prediction-market-disagreement-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/fetchfinch~prediction-market-disagreement-monitor/runs": {
      "post": {
        "operationId": "runs-sync-fetchfinch-prediction-market-disagreement-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/fetchfinch~prediction-market-disagreement-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-fetchfinch-prediction-market-disagreement-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "mode",
          "signalTypes"
        ],
        "properties": {
          "mode": {
            "title": "Run mode",
            "enum": [
              "snapshot",
              "monitor"
            ],
            "type": "string",
            "description": "Snapshot returns every current qualifying signal. Monitor remembers state and returns only lifecycle changes after its first baseline run.",
            "default": "snapshot"
          },
          "topics": {
            "title": "Topics (optional)",
            "maxItems": 30,
            "type": "array",
            "description": "Keep markets mentioning at least one topic, such as Bitcoin, Federal Reserve, election, or government shutdown. Empty scans the bounded fetched universe.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "signalTypes": {
            "title": "Relationship checks",
            "type": "array",
            "description": "Equivalent compares likely identical cross-venue contracts. Threshold and deadline checks test logical probability ordering.",
            "items": {
              "type": "string",
              "enum": [
                "equivalent",
                "threshold_subset",
                "deadline_subset"
              ],
              "enumTitles": [
                "Equivalent cross-venue markets",
                "Threshold monotonicity",
                "Deadline monotonicity"
              ]
            },
            "default": [
              "equivalent",
              "threshold_subset",
              "deadline_subset"
            ]
          },
          "minDisagreementPctPoints": {
            "title": "Minimum equivalent-market disagreement (pp)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Minimum absolute YES-probability difference for likely equivalent markets.",
            "default": 5
          },
          "minViolationPctPoints": {
            "title": "Minimum logical violation (pp)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Minimum amount by which a narrower threshold/deadline market may exceed its broader parent before a signal is emitted.",
            "default": 3
          },
          "minMatchConfidence": {
            "title": "Minimum automatic relationship confidence",
            "minimum": 0.5,
            "maximum": 1,
            "type": "number",
            "description": "Higher values favor precision over coverage. Hard numeric, direction, and timing conflicts are rejected independently.",
            "default": 0.82
          },
          "maxCloseDifferenceHours": {
            "title": "Maximum equivalent-market close-time difference",
            "minimum": 0,
            "maximum": 720,
            "type": "number",
            "description": "Likely equivalent markets farther apart than this are rejected unless explicitly supplied.",
            "default": 72
          },
          "maxQuoteSpreadPctPoints": {
            "title": "Maximum spread for midpoint signals (pp)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Suppress midpoint-based signals when either YES bid/ask spread exceeds this limit. Separated executable quotes can still qualify.",
            "default": 15
          },
          "minimumVolume24h": {
            "title": "Minimum 24-hour volume",
            "minimum": 0,
            "type": "number",
            "description": "Filter on each venue's source-reported 24-hour volume. Polymarket reports USD; Kalshi reports contracts.",
            "default": 0
          },
          "maxMarketsPerVenue": {
            "title": "Maximum markets fetched per venue",
            "minimum": 100,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety cap for each active public market universe. Larger values improve coverage and increase requests.",
            "default": 2000
          },
          "maxSignals": {
            "title": "Maximum signal records",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum current or changed signals written in one run, ranked by severity.",
            "default": 100
          },
          "excludeSports": {
            "title": "Exclude sports markets",
            "type": "boolean",
            "description": "Recommended for the initial research workflow because live-game and cancellation rules create noisy matches.",
            "default": true
          },
          "excludeKalshiMultivariate": {
            "title": "Exclude Kalshi multivariate combinations",
            "type": "boolean",
            "description": "Excludes combo/parlay-style markets from automatic discovery.",
            "default": true
          },
          "executionContracts": {
            "title": "Optional order-book audit size (contracts)",
            "minimum": 0,
            "maximum": 1000,
            "type": "number",
            "description": "For equivalent signals, walk both public order books at this equal contract quantity. Use 0 to skip depth requests.",
            "default": 0
          },
          "kalshiFeeRate": {
            "title": "Kalshi research fee coefficient",
            "minimum": 0,
            "maximum": 0.25,
            "type": "number",
            "description": "Used only for optional hypothetical execution math. Product-specific fee exceptions may differ.",
            "default": 0.07
          },
          "explicitRelationships": {
            "title": "Explicit relationships (optional)",
            "maxItems": 100,
            "type": "array",
            "description": "Audit exact market IDs/tickers. A subset relationship means P(left) must be less than or equal to P(right).",
            "items": {
              "type": "object",
              "properties": {
                "leftVenue": {
                  "title": "Left venue",
                  "description": "Venue containing the left proposition.",
                  "type": "string",
                  "enum": [
                    "polymarket",
                    "kalshi"
                  ]
                },
                "leftId": {
                  "title": "Left market ID",
                  "description": "Polymarket numeric ID, condition ID, slug, or Kalshi ticker.",
                  "type": "string"
                },
                "rightVenue": {
                  "title": "Right venue",
                  "description": "Venue containing the right proposition.",
                  "type": "string",
                  "enum": [
                    "polymarket",
                    "kalshi"
                  ]
                },
                "rightId": {
                  "title": "Right market ID",
                  "description": "Polymarket numeric ID, condition ID, slug, or Kalshi ticker.",
                  "type": "string"
                },
                "type": {
                  "title": "Relationship type",
                  "description": "Expected semantic relationship between the markets.",
                  "type": "string",
                  "enum": [
                    "equivalent",
                    "threshold_subset",
                    "deadline_subset"
                  ]
                },
                "note": {
                  "title": "Research note",
                  "description": "Optional user provenance or review note.",
                  "type": "string"
                }
              },
              "required": [
                "leftVenue",
                "leftId",
                "rightVenue",
                "rightId",
                "type"
              ]
            },
            "default": []
          },
          "excludedRelationshipIds": {
            "title": "Excluded relationship IDs",
            "maxItems": 500,
            "type": "array",
            "description": "Suppress known-bad automatic relationships using IDs from the relationship audit output.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "materialChangePctPoints": {
            "title": "Monitor material-change threshold (pp)",
            "minimum": 0.1,
            "maximum": 100,
            "type": "number",
            "description": "Emit widened/narrowed only when magnitude changes by at least this amount.",
            "default": 1
          },
          "minimumPersistenceRuns": {
            "title": "Consecutive runs before opening a signal",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Use 2 or more to suppress one-scan noise in monitor mode.",
            "default": 1
          },
          "alertOnFirstRun": {
            "title": "Alert on the first monitor run",
            "type": "boolean",
            "description": "Normally monitor mode creates a quiet baseline. Enable to emit and deliver current qualifying signals immediately.",
            "default": false
          },
          "stateStoreName": {
            "title": "Persistent state store",
            "minLength": 1,
            "maxLength": 63,
            "type": "string",
            "description": "Named key-value store shared across scheduled runs. Configuration fingerprints isolate different monitors.",
            "default": "prediction-market-disagreement-state"
          },
          "resetState": {
            "title": "Reset monitor baseline",
            "type": "boolean",
            "description": "Delete saved state for this configuration before the run.",
            "default": false
          },
          "webhookUrls": {
            "title": "Alert webhook URLs",
            "maxItems": 10,
            "type": "array",
            "description": "Optional HTTPS Slack, Discord, Make, Zapier, or generic endpoints. Secrets are redacted from logs and outputs.",
            "items": {
              "type": "string"
            }
          },
          "webhookFormat": {
            "title": "Webhook payload format",
            "enum": [
              "auto",
              "generic",
              "slack",
              "discord"
            ],
            "type": "string",
            "description": "Auto-detect Slack and Discord by hostname, or force a supported payload shape.",
            "default": "auto"
          },
          "webhookHeaders": {
            "title": "Additional webhook headers",
            "type": "object",
            "description": "Optional string headers such as Authorization for generic endpoints."
          },
          "failOnWebhookError": {
            "title": "Fail run when alert delivery fails",
            "type": "boolean",
            "description": "Enable when an external scheduler should retry failed notification delivery.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}