{
  "openapi": "3.1.0",
  "info": {
    "title": "wallstreet.wiki canon",
    "version": "1.0.0",
    "description": "Lookup across the .wiki finance canon and deterministic compute with verifiable receipts.",
    "license": {
      "name": "Content CC BY 4.0 from source sites; compute outputs unrestricted"
    }
  },
  "servers": [
    {
      "url": "https://canon.wallstreet.wiki"
    }
  ],
  "paths": {
    "/v1/health": {
      "get": {
        "summary": "Service health",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/sites": {
      "get": {
        "summary": "Sites in the canon with live entry counts",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/search": {
      "get": {
        "summary": "Search entries across all canon sites",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "wallstreet.wiki",
                "hedgefund.wiki",
                "options.wiki",
                "fixed-income.wiki",
                "quants.wiki",
                "pe-finance.wiki",
                "m-a.wiki",
                "privatecredit.wiki",
                "venture-capital.wiki"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/entry/{site}/{id}": {
      "get": {
        "summary": "One entry by site and id",
        "parameters": [
          {
            "name": "site",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          },
          "404": {
            "description": "not found"
          }
        }
      }
    },
    "/v1/changes": {
      "get": {
        "summary": "Aggregated change feed across the verticals",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/formulas": {
      "get": {
        "summary": "Formula registry",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/formulas/{id}": {
      "get": {
        "summary": "Formula schema, convention, citations and test vectors",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "options.bsm.price",
                "options.bsm.greeks",
                "options.implied_vol",
                "options.put_call_parity",
                "options.vertical_spread",
                "options.kelly",
                "options.expected_move",
                "bonds.price",
                "bonds.ytm",
                "bonds.risk",
                "hf.sharpe",
                "hf.sortino",
                "hf.max_drawdown",
                "hf.fee_net",
                "quant.annualize",
                "quant.var_parametric",
                "pe.irr",
                "pe.multiples",
                "vc.round",
                "ma.accretion_dilution",
                "ma.lbo_returns",
                "credit.all_in_yield",
                "credit.coverage",
                "cal.is_trading_day",
                "cal.holidays",
                "cal.trading_days_between",
                "cal.add_trading_days",
                "cal.settlement",
                "cal.next_expiration",
                "cal.year_fraction"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/vectors/{id}": {
      "get": {
        "summary": "Test vectors with receipts, for conformance testing",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/compute/{id}": {
      "post": {
        "summary": "Compute a formula and return outputs with a receipt",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "options.bsm.price",
                "options.bsm.greeks",
                "options.implied_vol",
                "options.put_call_parity",
                "options.vertical_spread",
                "options.kelly",
                "options.expected_move",
                "bonds.price",
                "bonds.ytm",
                "bonds.risk",
                "hf.sharpe",
                "hf.sortino",
                "hf.max_drawdown",
                "hf.fee_net",
                "quant.annualize",
                "quant.var_parametric",
                "pe.irr",
                "pe.multiples",
                "vc.round",
                "ma.accretion_dilution",
                "ma.lbo_returns",
                "credit.all_in_yield",
                "credit.coverage",
                "cal.is_trading_day",
                "cal.holidays",
                "cal.trading_days_between",
                "cal.add_trading_days",
                "cal.settlement",
                "cal.next_expiration",
                "cal.year_fraction"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Formula inputs; see /v1/formulas/{id}"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ok"
          },
          "400": {
            "description": "invalid input, with problems listed"
          },
          "422": {
            "description": "inputs valid but no solution"
          }
        }
      }
    },
    "/v1/batch": {
      "post": {
        "summary": "Compute formulas in one call under a batch receipt; up to 50 items free, 51 to 1000 paid (x402)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "formula": {
                          "type": "string"
                        },
                        "inputs": {
                          "type": "object"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "per-item results and a batch receipt"
          }
        }
      }
    },
    "/v1/cite/{site}/{id}": {
      "get": {
        "summary": "Citation strings (markdown, plain, apa, bibtex) for one entry",
        "parameters": [
          {
            "name": "site",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "markdown",
                "plain",
                "apa",
                "bibtex"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/batch/large": {
      "post": {
        "summary": "Paid batch (x402): up to 1000 formulas in one call under a batch receipt",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "maxItems": 1000,
                    "items": {
                      "type": "object",
                      "properties": {
                        "formula": {
                          "type": "string"
                        },
                        "inputs": {
                          "type": "object"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "per-item results and a batch receipt"
          },
          "402": {
            "description": "payment required; body is x402 PaymentRequired"
          }
        }
      }
    },
    "/v1/entity": {
      "get": {
        "summary": "Resolve a ticker, CIK or company name to one US issuer id with all tickers, exchanges and EDGAR locations (SEC public data)",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/entity/bulk": {
      "post": {
        "summary": "Resolve up to 1000 identifiers in one call (paid, x402)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "queries": {
                    "type": "array",
                    "maxItems": 1000,
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "queries"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "ok"
          },
          "402": {
            "description": "payment required; body is x402 PaymentRequired"
          }
        }
      }
    },
    "/v1/thresholds": {
      "get": {
        "summary": "Regulatory thresholds (13F, 13D, Form PF, 3(c)(1), 3(c)(7), accredited investor, qualified client, ERISA 25 percent, AIFMD, HSR, Reg T) with rule, authority, effective date, primary source and confidence",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "authority",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/contracts/{venue}/{id}": {
      "get": {
        "summary": "One prediction-market contract (kalshi ticker or polymarket slug/condition id) normalised to a common shape: rules, close time, resolution source, status",
        "parameters": [
          {
            "name": "venue",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "kalshi",
                "polymarket"
              ]
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          },
          "404": {
            "description": "not found"
          }
        }
      }
    },
    "/v1/contracts/compare": {
      "get": {
        "summary": "Contract identity check across venues (paid, x402): do two prediction-market contracts settle on the same terms? Flags close-time, numeric, date and resolution-source divergence with a snapshot receipt",
        "parameters": [
          {
            "name": "kalshi",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "polymarket",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok"
          },
          "402": {
            "description": "payment required; body is x402 PaymentRequired"
          }
        }
      }
    },
    "/v1/attest/key": {
      "get": {
        "summary": "The Ed25519 public key and key id that sign attestations",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/attest": {
      "post": {
        "summary": "Signed attestation over a verified receipt (paid, x402): Ed25519 signature a third party can check offline",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "A receipt object, or { receipt }"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "attestation"
          },
          "402": {
            "description": "payment required"
          },
          "422": {
            "description": "receipt does not verify"
          }
        }
      }
    },
    "/v1/attest/check": {
      "post": {
        "summary": "Check an attestation against this server's public key",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "{ signed, signature }"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "result"
          }
        }
      }
    },
    "/v1/pricing": {
      "get": {
        "summary": "What is free, what is paid, and how to pay (x402)",
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/v1/corpus": {
      "get": {
        "summary": "Every entry and table across the wiki-platform sites in one call (paid, x402)",
        "responses": {
          "200": {
            "description": "ok"
          },
          "402": {
            "description": "payment required; body is x402 PaymentRequired"
          }
        }
      }
    },
    "/v1/verify": {
      "post": {
        "summary": "Verify a receipt by recomputing it",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "A receipt object with spec canon-receipt/1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "verification result"
          }
        }
      }
    }
  },
  "x-mcp": {
    "transport": "streamable-http",
    "url": "https://canon.wallstreet.wiki/mcp"
  }
}