Skip to main content
This page is an archive. Prefer focused current pages from the navigation, especially Quickstart, CLI command reference, REST API, and MCP server.
This is an archived migration page. It is not the canonical reference for new integrations, tool counts, auth policy, or endpoint shapes. Use the focused pages in the CLI, HTTP API, data, and workflow sections for current contracts.

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

Public market reads work without an API key. User-owned theses, portfolio state, intents, watchlists, alerts, webhooks, keys, and trading surfaces require auth.

2. Explore — ask questions (no thesis needed)

Ask anything: “what’s happening with Iran?”, “show me gold contracts”, “any new markets today?”. The agent has full access to scan, query, watch, and explore — no thesis required. When you form a view, say it: “I think oil stays above $100” — the agent creates a thesis automatically.

3. Create a thesis (optional — makes context richer)

Pass a testable claim — a statement that can be true or false at a future date. Use single quotes (not double) so $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

That’s it. The system runs 24/7. See the Agent Guide for full integration reference.

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:
  1. Scans news (3 queries including one adversarial — never filters out contradictory evidence)
  2. Refreshes prices from Kalshi API + Polymarket CLOB
  3. Enriches orderbooks (bid/ask depth for edges > 5 cents)
  4. Evaluates signals against causal tree (checks kill conditions first)
  5. Computes track record (hit rate: % of edges that moved toward thesis)
  6. 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:
See the current MCP tools reference and Tool Manifest for the live tool catalog. Tool counts change as the surface evolves.

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 at data.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.
Full integration page: Real-Time Data API. Agent-specific patterns: Build Agents.

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.
See the Agent Runtime guide for architecture, config, and operational patterns.

Telegram Bot

Runs locally. Slash commands + natural language. Auto-pushes confidence alerts.

Webhook

Add webhookUrl when creating a thesis. The engine POSTs on confidence changes >= 5%.

Authentication

Get an API key from the Dashboard.
For CLI: 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:
  1. Each evaluation can suggest new causal factors (suggestedNodes)
  2. Weekly (Monday 6 UTC), the augment agent reviews suggestions
  3. LLM decides which to accept (must be genuinely new, not duplicates)
  4. Accepted nodes are appended (never removed — append-only tree)
  5. Importance weights are rebalanced among siblings

Kill Conditions

Before every evaluation, the system asks: “Does any event fundamentally break a core assumption of this thesis?” If yes, it flags the threat prominently before any other analysis.

Pricing

Free during beta. Pay by token after 15M tokens consumed.

Full Reference

See the focused CLI, HTTP API, data, and MCP adapter pages for current machine-readable contracts, response shapes, and integration rules. This archived page is not authoritative for live tool counts.