{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket and Kalshi Arbitrage Verifier",
    "description": "Verify Polymarket and Kalshi contract matches with execution-sized order-book VWAPs, current fee math, one-tick stress, semantic conflict flags, and explicit non-atomic execution warnings. Built for agents, analysts, and trading dashboards that need evidence beyond headline price gaps.",
    "version": "0.1",
    "x-build-id": "ekpzyq50yDru7LqmP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/redfoxxie~polymarket-kalshi-arbitrage-verifier/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-redfoxxie-polymarket-kalshi-arbitrage-verifier",
        "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/redfoxxie~polymarket-kalshi-arbitrage-verifier/runs": {
      "post": {
        "operationId": "runs-sync-redfoxxie-polymarket-kalshi-arbitrage-verifier",
        "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/redfoxxie~polymarket-kalshi-arbitrage-verifier/run-sync": {
      "post": {
        "operationId": "run-sync-redfoxxie-polymarket-kalshi-arbitrage-verifier",
        "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",
        "properties": {
          "explicitPairs": {
            "title": "Explicit contract pairs",
            "maxItems": 100,
            "type": "array",
            "description": "Pairs to verify directly. Each object needs polymarketMarketId and kalshiTicker. Explicit pairs are evaluated even when semantic conflicts are found.",
            "items": {
              "type": "object",
              "properties": {
                "polymarketMarketId": {
                  "title": "Polymarket market ID",
                  "type": "string",
                  "description": "Gamma market ID for the Polymarket contract to compare.",
                  "editor": "textfield",
                  "maxLength": 100
                },
                "kalshiTicker": {
                  "title": "Kalshi market ticker",
                  "type": "string",
                  "description": "Exact Kalshi market ticker for the comparison contract.",
                  "editor": "textfield",
                  "maxLength": 128
                }
              },
              "required": [
                "polymarketMarketId",
                "kalshiTicker"
              ],
              "additionalProperties": false
            },
            "default": []
          },
          "discoveryEnabled": {
            "title": "Discover additional pairs",
            "type": "boolean",
            "description": "Search the active public universes in addition to verifying explicit pairs. Disable for a faster deterministic audit run.",
            "default": true
          },
          "queries": {
            "title": "Topic filters",
            "maxItems": 20,
            "type": "array",
            "description": "Optional topic phrases. Every phrase token must occur in the Polymarket title. Leave empty to scan the fetched universe.",
            "items": {
              "type": "string",
              "maxLength": 100
            },
            "default": []
          },
          "contracts": {
            "title": "Contracts per leg",
            "minimum": 5,
            "maximum": 1000,
            "type": "number",
            "description": "Equal position size used to walk each platform's executable order book. The Polymarket five-share minimum is enforced.",
            "default": 5
          },
          "maxCandidates": {
            "title": "Maximum candidate pairs",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum matched pairs to verify. The first three dataset records per run are free.",
            "default": 25
          },
          "universeLimitPerPlatform": {
            "title": "Markets fetched per platform",
            "minimum": 100,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum active markets fetched independently from Polymarket and Kalshi before semantic candidate matching.",
            "default": 1000
          },
          "minSemanticScore": {
            "title": "Minimum semantic candidate score",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Minimum automated title/date/numeric compatibility score. This score never proves resolution-rule equivalence.",
            "default": 0.68
          },
          "maxCloseDifferenceHours": {
            "title": "Maximum close-time difference",
            "minimum": 0,
            "maximum": 720,
            "type": "number",
            "description": "Maximum hours between platform close or expected-expiration timestamps before the pair receives a hard conflict.",
            "default": 48
          },
          "kalshiTakerFeeRate": {
            "title": "Kalshi taker fee coefficient",
            "minimum": 0,
            "maximum": 0.25,
            "type": "number",
            "description": "Fee coefficient used with ceil(rate x contracts x price x (1-price)). Defaults to the current general schedule; market exceptions must be reviewed.",
            "default": 0.07
          },
          "positiveAfterStressOnly": {
            "title": "Only positive one-tick candidates",
            "type": "boolean",
            "description": "Return only pairs whose best route remains positive after moving both entry prices one tick adversely, assuming equivalent rules.",
            "default": false
          },
          "includeSummary": {
            "title": "Include free run summary",
            "type": "boolean",
            "description": "Emit an always-free summary with universe, lookup, candidate and returned-record counts, including when no pair qualifies.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}