Overview
SimpleFunctions is prediction market data, indicators, and autonomous trading infrastructure. Structured, decision-ready data from Kalshi, Polymarket, X/Twitter, and traditional markets — monitored 24/7. CLI first, REST/API second, MCP adapter last, plus an interactive agent with cognitive guardrails.Quick Start
0. No install needed — try it now
1. Install the CLI
2. Explore — ask questions (no thesis needed)
3. Create a thesis (optional — makes context richer)
$100 isn’t swallowed by your shell. Takes ~60s; system builds a causal tree, scans Kalshi + Polymarket for related contracts, identifies edges, and starts 24/7 monitoring.
4. Focused context
How It Works
Thesis → Causal Tree
Your plain-text thesis is decomposed into a tree of verifiable assumptions. Each node has a probability (0-1) and importance weight. The overall confidence is the weighted product.Edge Detection
The system maps causal nodes to prediction market contracts and compares:- Market price: what Kalshi/Polymarket traders think (e.g. 34 cents)
- Thesis price: what your causal model implies (e.g. 55 cents)
- Edge: the difference (21 cents)
- Executable edge: edge minus half the spread (real edge after crossing)
24/7 Monitoring
Every 15 minutes, the heartbeat engine:- Scans news (3 queries including one adversarial — never filters out contradictory evidence)
- Refreshes prices from Kalshi API + Polymarket CLOB
- Enriches orderbooks (bid/ask depth for edges > 5 cents)
- Evaluates signals against causal tree (checks kill conditions first)
- Computes track record (hit rate: % of edges that moved toward thesis)
- Discovers new edges (daily) and augments the causal tree with new nodes (weekly)
Integration Options
MCP Server
One-line setup for Claude Code, Cursor, Cline, or Roo Code:CLI
Every command supports--json. Key commands support --share for shareable URLs.
Explore (no auth):
Thesis + analysis:
Knowledge + community:
Intents + Execution:
Portfolio + trading:
X / Twitter:
Flags:
--json on all commands · --share on scan, query, context, edges, markets, explore
Full reference in the Agent Guide.
Agent Contract
The CLI is designed for agent consumption. Behaviors agents can rely on:Agent Harness
Tools for testing, backtesting, and constraining agent behavior.Event Subscription
Long-lived structured event streams for reactive agents. Replaces polling.
Event types: market (price_cross, volume_spike, spread_widen, regime_flip), thesis (confidence_drop, confidence_rise, new_signal), position (drawdown, fill, close), portfolio (drawdown, tick_complete, halt), system (runtime.started, runtime.stopped).
Cloud Runtime
Run your agent runtime in the cloud. Always-on, no local laptop required. BYOK: your keys, encrypted client-side.
Key encryption: Your API keys are encrypted client-side (Argon2id key derivation) before upload. SimpleFunctions never sees plaintext credentials.
REST API
No auth needed:
Auth required (
Authorization: Bearer sf_live_xxx):
X / Twitter (no auth):
Auth required (
Authorization: Bearer sf_live_xxx):
Full endpoint reference in the Agent Guide.
Real-Time Data API
Sub-second WebSocket and REST data feed atdata.simplefunctions.dev/v1/ — a separate
surface from the agent / public APIs above. Built for trading agents, dashboards, quants,
and risk engines that need tick-level state across Kalshi and Polymarket.
REST (no auth required at the edge — rate-limited):
WebSocket (
wss://app.simplefunctions.dev/ws, JSON envelopes):
Heat score (0-100 per market):
0.40 × log-vol + 0.35 × spread-tightness + 0.15 × close-to-coin-flip + 0.10 × recent-volatility. Use to filter the long tail — only subscribe to markets above a heat threshold.
Agent Skills
Cognitive guardrails for prediction market agents. Skills are prompts that make agents disciplined.
Skills are markdown files. Create your own in
~/.sf/skills/. See the Agent Guide for agent-facing usage patterns.
Agent Runtime
Multi-daemon architecture. Your agent orchestrates background daemons that monitor, reason, and execute autonomously. Smart mode (--smart) adds LLM intelligence: soft condition gating, periodic scans, wake conditions.
Telegram Bot
Webhook
AddwebhookUrl when creating a thesis. The engine POSTs on confidence changes >= 5%.
Authentication
Get an API key from the Dashboard.sf setup stores the key in ~/.config/simplefunctions/config.json. Config priority: env vars > config file > defaults.
Key Concepts
Signals
Events that feed into evaluations. Five types:Edge Types
The system classifies each edge by WHY the mispricing exists:- consensus_gap — market and thesis disagree on fundamental probability
- attention_gap — market hasn’t reacted to recent information yet
- timing_gap — market prices short-term risk, thesis prices long-term outcome
- risk_premium — market embeds fear/greed premium that thesis doesn’t
Track Record
Feedback loop that computes how well past edges predicted market movement:- Hit rate: % of edges where market moved toward the thesis-implied price
- Average movement: mean price change in cents since edge detection
- Track record is injected into evaluation prompts so the system learns from its accuracy
Tree Augmentation
The causal tree evolves over time:- Each evaluation can suggest new causal factors (
suggestedNodes) - Weekly (Monday 6 UTC), the augment agent reviews suggestions
- LLM decides which to accept (must be genuinely new, not duplicates)
- Accepted nodes are appended (never removed — append-only tree)
- Importance weights are rebalanced among siblings