Why SimpleFunctions

Prediction markets are the most accurate forecasting mechanism humans have built. But the infrastructure to trade them programmatically is fragmented, incomplete, and hostile to agents. SimpleFunctions is the missing layer.


The problem: five disconnected systems

To trade prediction markets intelligently, you need five things working together. Today, each one is a separate problem:

1. Perception

What's the current state? Prices on Kalshi, Polymarket, and traditional markets. Orderbook depth. Social sentiment. News flow. You need all of it, cross-referenced, every 15 minutes. No single API gives you this.

2. Judgment

What does it mean? Not just "price went up" but "this price movement is inconsistent with what the bond market is saying." Requires causal reasoning, not just data. Web search gives you articles, not structured analysis.

3. Decision

What should I do? Not "buy" — but "buy 100 contracts of KXFEDDEC YES at 42c because the executable edge is 14c after spread, with CPI as catalyst in 3 days, and a stop at 30c." This requires synthesis across all data sources.

4. Execution

How do I act on it? Conditional orders, price triggers, TWAP spreading, cross-venue arbitrage. And the system must hold the intent even when your agent isn't running.

5. Monitoring

What changed since I last looked? New signals, price moves, orderbook shifts, news. Your agent finished its research — but the world kept moving. Without continuous monitoring, your edge decays.

Today, building this requires stitching together Kalshi API, Polymarket CLOB, a news aggregator, an LLM, a scheduler, a database, and custom execution logic. SimpleFunctions is all five in one system.


What SimpleFunctions does

Perception   get_context()         → live prices, edges, orderbook, macro, signals
             get_trade_ideas()     → S&T-style pitches: conviction, catalyst, risk
             watch "fed" orderbook → real-time depth tracking

Judgment      create_thesis()       → causal tree decomposition, edge detection
             what_if()             → scenario analysis (zero LLM cost)
             heartbeat engine      → 24/7 news + price + eval loop

Execution     create_intent()       → "buy if price < 40c, expire in 3 days"
             runtime start --smart → daemon with LLM: soft conditions, smart scans
             set_wake_condition()  → "alert if bid depth collapses"

Monitoring    watch "fed" flow      → momentum detection, volume spikes
             watch "fed" cross-venue → Kalshi vs Polymarket spread
             webhook               → push on confidence change >= 5%

What makes this different

Thesis-anchored context, not one-shot research

Most agents search the web, form a view, trade, and forget. SimpleFunctions anchors context to a thesis. Every 15 minutes, the heartbeat engine scans news, refreshes prices, enriches orderbooks, and re-evaluates. Context accumulates. Your agent never re-searches — it reads the latest state in one API call.

Edges, not just prices

Knowing that KXFEDDEC trades at 42c is data. Knowing that your causal model implies 60c — a 14c executable edge after spread — is alpha. SimpleFunctions computes thesis-implied prices, compares them to market prices, and tracks whether edges move toward or away from your predictions. Track record feeds back into evaluation quality.

Declarative execution, not imperative orders

Instead of "place this order now," say "buy if price drops below 40c, but only if oil stays above $95." The intent system holds your conditions. The smart runtime evaluates hard triggers every 30 seconds and LLM-gates soft conditions before executing. Your agent declares intent; the daemon handles timing, reasoning, and execution via your local API keys.

Trade ideas that are actually tradeable

The ideas endpoint synthesizes market changes, thesis edges, and macro context into actionable pitches — like an S&T desk morning note. Each idea includes: conviction level, specific markets with current prices, upcoming catalysts with dates, and what kills the trade. Not generic commentary — structured, timestamped, with entry points.

Adversarial by design

Before every evaluation, the system asks: "Does any signal fundamentally break a core assumption?" News scans include adversarial queries that actively seek contradictory evidence. Kill conditions are checked first, not last. The system tries to kill your thesis before you trade on it.


The agent workflow

Without SimpleFunctions

  • 1. Search the web for articles
  • 2. Get generic, stale information
  • 3. No structured market data
  • 4. Form a shallow view
  • 5. Place a trade and forget
  • 6. Miss every signal after that
  • 7. No execution logic beyond "buy now"
  • 8. Wake up to losses

With SimpleFunctions

  • 1. Call get_trade_ideas() or get_context()
  • 2. Get structured, live market data
  • 3. See edges with orderbook depth
  • 4. Create thesis with causal reasoning
  • 5. Declare intent with trigger conditions
  • 6. Runtime executes when conditions met
  • 7. Heartbeat monitors 24/7, pushes updates
  • 8. Wake up to alpha

The full loop in 60 seconds

# 1. What should I trade?
$ curl simplefunctions.dev/api/public/ideas
→ "Fed Pricing Disconnected from Bond Rally" — high conviction, 14c edge

# 2. I agree — set up monitoring
$ sf thesis create "Fed will cut rates in December"
→ Causal tree: 6 nodes, 8 edges detected, 24/7 monitoring started

# 3. Declare intent — execute when ready
$ sf intent buy KXFEDDEC-25DEC31-T100 100 --price 42 --trigger below:40 --expire 3d
→ Intent created. Runtime will execute when price <= 40c.

# 4. Start the smart daemon
$ sf runtime start --smart --daemon
→ Polling every 30s [smart]. Watching 1 intent.

# 5. Meanwhile, monitor in real-time
$ sf watch "fed" orderbook
→ KXFEDDEC  bid 41c (1.2k) | ask 43c (800)  spread 2c  [HIGH]
→ depth shift: bids +400 (buyers accumulating)

# The system handles the rest:
# - News scanning every 15 min
# - Price rescan + edge recalculation
# - Kill condition checking
# - Order execution when trigger hits
# - Fill logging + journal entry

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