SimpleFunctions

Features.

Perception. Analysis. Execution. One engine for prediction markets.

SimpleFunctions watches the world, reasons about what matters, and acts when the post-slippage edge clears the floor. Twelve feature groups, a CLI-first command catalog, HTTP/Data APIs, WebSocket streams, MCP adapter for compatible hosts, and web workflows, all normalized across Kalshi and Polymarket.

37,046 indicator-scored markets224 CLI commands92 HTTP tools15 min refresh
Denis Diderot at the editor's desk of the Encyclopédie circa 1760, surrounded by copperplate engraving plates of horloger tools, astronomical quadrants, printing presses, looms, alembics — a goose-quill correcting proofs

Diderot · Encyclopédie 1760 — every tool, every plate, every craft, gathered into one volume. The original feature catalog.

Seven pillars

One engine. Many surfaces. Same shape on every one.

Perception → Analysis → Execution is the loop. Memory, calibration, coverage, and surfaces are the foundation that makes the loop reproducible and auditable.

Perception

Live world state. News ingestion. Orderbook depth on every tick. Regime label per topic group.

Analysis

Causal thesis tree. Depth-adjusted edge. Adversarial search loop. Regime + flow toxicity overlay.

Execution

Intent + trigger + kill chain. BYOK on both venues. Audit trail per session. Same shape across CLI / REST / MCP adapter.

Memory

Heartbeat ticks persisted; orderbook snapshots; thesis-state time series; HF + Kaggle daily dumps.

Calibration

Live Brier scores per venue / category / price bucket; realized vs predicted, fully auditable.

Coverage

~210 macro contracts · ~50 crypto contracts · 18 topic groups · all Kalshi + Polymarket markets.

Surfaces

CLI (@spfunctions/cli), REST/Data API (/api/* and /v1/*), WebSocket (/v1/ws), MCP adapter for compatible hosts, Web UI.

Three layers, side by side

Perception feeds analysis; analysis feeds execution; execution feeds the audit trail and back into perception on the next tick.

1 · Perception

What is happening in the world right now?

Live prediction-market state, news scan, orderbook depth, regime label per topic group, calibration overlay.

2 · Analysis

What does it mean for my book?

Causal thesis tree, depth-adjusted edge, adversarial search, regime + flow toxicity overlay, what-if cascade.

3 · Execution

When is the right moment to act?

Intent + trigger + kill chain, BYOK on both venues, audit trail per session, same shape across CLI / REST / MCP adapter.

Reach the engine from anywhere

Same context shape, same intent shape. CLI first for operators and local agents, REST/Data API second for remote systems, WebSocket for tick streams, MCP last for compatible hosts.

CLI
$ npm i -g @spfunctions/cli
$ sf scan macro                # live tape
$ sf book KXFEDDEC-25DEC31     # full ladder
$ sf edges --json --depth high # piped to jq
$ sf intent buy ... --kill ... # BYOK exec
$ sf agent --tool portfolio.fills.list --json
HTTP / Data API
GET  /api/public/context        (free CC-BY)
GET  /api/public/edges          (free)
GET  /v1/orderbook/{ticker}     (free)
GET  /v1/candles/{ticker}       (free)
POST /api/intents               (BYOK + meter)
GET  /api/portfolio/ledger      (auth)
WebSocket
wss://data.simplefunctions.dev/v1/ws

> {"action":"subscribe",
>  "channel":"orderbook",
>  "ticker":"KXFEDDEC-25DEC31"}

< {"ticker":"...","bid":[...],"ask":[...],
   "regime":"trending","ts": 1714... }
MCP adapter
claude mcp add simplefunctions \
  --url https://simplefunctions
  .dev/api/mcp/mcp

mcp call simplefunctions.context  { topics }
mcp call simplefunctions.edges    { min_edge }
mcp call simplefunctions.intent.create { ... }

FAQ

What does SimpleFunctions actually do?

It is an intelligence engine for prediction markets. Three layers: perception (live world state distilled to agent-readable tokens), analysis (causal thesis trees, depth-adjusted edges, regime detection, adversarial search), execution (taker, maker, autonomous portfolio, BYOK on Kalshi and Polymarket). The CLI is the primary operator surface; APIs are the network surface; MCP is the host adapter.

How is this different from a Bloomberg / FactSet / venue SDK?

Bloomberg ships data + analytics. Venue SDKs ship endpoints. SimpleFunctions ships a thesis loop tied to executable orderbooks: every 15 minutes it scans news, refreshes prices on both venues, walks orderbooks, computes edges, runs adversarial search, fires triggers, logs the audit trail. The output is decision-shaped, not screen-shaped.

Is it human-driven or agent-driven?

Both, by design. The CLI is the first-class human and agent surface; remote agents use the HTTP APIs; MCP hosts can use the adapter. A human reads briefings and arms intents from the CLI; an agent can run `sf ... --json`, call REST, or use MCP only when the host expects it.

Which venues does it cover?

Kalshi (CFTC-regulated US event contracts) and Polymarket (USDC-settled). Cross-venue match is built in: same event prices on both venues are tracked as matched pairs with depth scored on each book; matched-pair intents fire two legs simultaneously when post-slippage spread clears your floor.

What thesis topics does it cover?

Eighteen topic groups across macro (oil, Fed, CPI, recession, treasury yields, geopolitics, tariffs, elections, govt shutdowns, central banks), crypto (BTC/ETH/SOL ladders + ETF flow + halving), policy (legislation, executive actions, regulatory), and sports (EPL, NBA, UCL, CS2, IPL, NFL). New topics wire by configuring contract patterns; the engine is topic-agnostic.

What is the audit trail?

Intents log thesis context, risk gates, kill conditions, and status transitions. Recorded execution and fill events read back through /api/portfolio/ledger, /api/portfolio/fills, and portfolio attribution endpoints with explicit confidence; unknown attribution is preserved for review.

BYOK execution — what does that mean?

You hold the venue credentials. SimpleFunctions stores nothing custodial; orders are signed with your Kalshi RSA private key or your Polymarket Ethereum key, executed directly against the venues. Custody and KYC stay at the venue level. SimpleFunctions is not a broker, custodian, FCM, or investment adviser.

Cost?

Public endpoints free, no auth, CC-BY-4.0. Authenticated execution endpoints (intents, orders, BYOK) are metered by call. Heartbeat ticks bundled into metered quota. WebSocket /v1/ws free for read; authenticated writes metered. No subscription floor.

Open source?

The canonical local interface is the npm package @spfunctions/cli; its public GitHub repo is a reference and issue mirror, not the full private operator runtime. The HTTP/Data APIs are the canonical network interface. MCP is a compatibility adapter for MCP-only hosts. Some examples, datasets, and bots are public packages; the hosted runtime is the part you call into rather than run.

Backtest?

Daily Hugging Face dump under SimpleFunctions/* (CC-BY-4.0). Per-tick orderbook history via /v1/candles?tf=1m. Markets, edges, regime, thesis state — drop straight into pandas / vectorbt / Polars. Calibration page shows realized vs predicted at /calibration.

Related surfaces