SimpleFunctions

OpenClaw.

The skill the agent reads. The engine the runtime fires.

For MCP-compatible OpenClaw hosts, a 101-tool adapter exposes Kalshi + Polymarket. Read context, surface edges, write a thesis tree, arm intents with full kill chain, attribute fills. Read tools are free; execution is BYOK + metered. Add it once; the agent gets the same loop a human runs from the CLI.

16453 markets trackedKalshi 3000Polymarket 13453· May 28, 06:06 AM
Ada Lovelace and Charles Babbage in 1843 demonstrating the Analytical Engine — Lovelace pointing at the brass cogwheels with notebook in hand, Babbage gesturing at the punched-card paper tape printing market quotes onto the polished mahogany floor

Lovelace + Babbage · 1843 — the human writes the skill, the machine executes. The first agent loop.

What the agent connects to

One MCP adapter endpoint. 101 tools. Portfolio ledger review.

The skill manifest is human-readable Markdown with tool schemas. The agent reads context, walks the orderbook, decomposes a thesis, declares an intent, and pulls recorded fill/ledger rows — all through one normalized surface.

mcpEndpoint

https://simplefunctions.dev/api/mcp/mcp — adapter endpoint for MCP hosts.

skillManifest

/api/mcp/skill.md — Markdown skill description with tool schemas, kept in sync with code.

readTools

context, edges, market, book, search, calibration public; portfolio ledger/fills/attribution require an authenticated SimpleFunctions key.

writeTools

thesis.create, intent.create, intent.cancel — BYOK + metered when execution can fire.

sessionId

Per-agent identifier; intents and fills tag back to the originating agent.

killChain

Kill conditions declared on intent fire automatically; agent gets the cancel reason.

portfolioLedger

/api/portfolio/ledger and /api/portfolio/activity — authenticated intent/fill review surface.

Edges your agent sees right now

60¢Will the silver close price be above 77.99 USD/t.oz on May
15¢kalshi
60¢Will average **gas prices** be above or below $2.30 by Dec 3
21¢kalshi
59¢Bitcoin price on May 29, 2026?
17¢kalshi
59¢Will average **gas prices** be above or below $4.70 by Dec 3
33¢kalshi
59¢Strait of Hormuz traffic returns to normal by December 31?
84¢polymarket
59¢Will average **gas prices** be above $5.60 by Dec 31, 2026?
17¢kalshi
58¢Will average **gas prices** be above or below $5.20 by Dec 3
30¢kalshi
58¢Will average **gas prices** be above or below $2.60 by Dec 3
22¢kalshi
57¢Will the gold close price be above 4551.99 USD/t.oz on May
19¢kalshi
56¢Will average **gas prices** be below $3.60 by Dec 31, 2026?
71¢kalshi

Updated every 15 minutes · data from Kalshi and Polymarket

Why MCP over raw venue SDKs

ApproachWhat it gives youWhere it breaks

Hand-coded Polymarket SDK

Lowest-level control

No thesis loop, no cross-venue, no edge math, no kill chain, no agent path

Generic LLM with web tools

Familiar tooling, fast to start

No depth math, no settlement awareness, no audit trail, no BYOK signing

Single-venue agent kit

Tight on one exchange

Hard-coded to one venue; agent cannot reason across Kalshi + Polymarket

OpenClaw + SimpleFunctions

Thesis tree + edges + intents across both venues

Surfaces only post-slippage survivors; ledger-backed review for recorded events

Six agent shapes

Same MCP surface, different responsibilities. Multi-agent setups share the ledger review surface through source tags.

Research agents

Read context + edges, draft a thesis tree, surface candidates — no execution path needed.

Scanner agents

Continuous edge monitoring across themes, push to Slack / Telegram / your IC pack.

Executor agents

BYOK + signed-off candidate list → intents armed with full kill chain.

Multi-agent fund desks

Research / scanner / executor split; shared audit trail per session.

Backtest agents

Daily HF dump (CC-BY-4.0) + thesis primitives = reproducible historical edge replay.

Compliance agents

Pull portfolio ledger, fills, and grouped attribution; preserve unknown attribution for weekly review.

Wire-up

Add the skill once. Tool schemas live in the manifest. Pull context, feed it to the agent, declare intents from the response.

Agent guide

A first agent loop

Five tool calls. Read → think → write. The agent prompt fits on one page.

1 · add skill
$ openclaw mcp add simplefunctions \
    --url https://simplefunctions.dev/api/mcp/mcp

✓ skill added · 101 tools loaded
  read:  context, edges, market, book, search, ...
  write: thesis.create, intent.create, intent.cancel
  byok:  configure --kalshi-key, --poly-key
2 · agent reads context
agent: mcp.simplefunctions.context({
  topics: ["macro", "crypto"]
})

→ {
    macro: {
      hot:  ["WTI ladder", "FOMC", "recession"],
      regime: "trending oil up",
      moves: [...]
    },
    crypto: {...}
  }
3 · surface edges
agent: mcp.simplefunctions.edges({
  min_edge: 8,
  depth: "high",
  classes: ["consensus","timing"]
})

→ [
    { ticker:"KXWTIMAX-T150", edge:+18,
      class:"consensus", kelly:280, ... },
    { ticker:"KXFEDDEC-25",   edge:+13,
      class:"timing",    kelly:150, ... }
  ]
4 · arm intent
agent: mcp.simplefunctions.intent.create({
  ticker: "KXWTIMAX-26DEC31-T150",
  side: "buy", size: 280, max_price: 40,
  trigger: { below: 38 },
  kills: [
    { above: 60 },
    { news: "iran ceasefire signed" }
  ]
})

→ { intent_id: "i_8a2f4c", state: "armed",
    review: "/api/portfolio/activity?source=intent" }

FAQ

What is OpenClaw and why pair it with SimpleFunctions?

OpenClaw is the open-source agent framework for tool-using AI assistants. SimpleFunctions ships an MCP adapter for OpenClaw-style hosts, while the canonical local surface remains the `sf` CLI and the canonical network surface remains HTTP/Data API. The adapter gives OpenClaw market context, edges, thesis workflows, intents, and authenticated portfolio ledger reads without wiring rate-limit handlers, key rotation, or cross-venue normalization.

How do I add the SimpleFunctions skill to OpenClaw?

Three lines: openclaw mcp add simplefunctions --url https://simplefunctions.dev/api/mcp/mcp. The agent immediately gets the current MCP adapter catalog — context, market, orderbook, search, edges, thesis, intent, and authenticated portfolio read tools. BYOK on Kalshi + Polymarket if you want execution; public read-only research works without venue keys.

What are the most useful tools for a first agent loop?

sf.context (live world state, ~few hundred tokens), sf.edges (mispricing feed), sf.book (per-ticker orderbook + depth), sf.thesis.create (decompose a sentence into a causal tree), sf.intent.create (arm an action with kill chain), and authenticated portfolio read tools for ledger/fill review. A working agent loop fits in a single prompt with those surfaces.

Does the agent need keys to do anything useful?

No for public research: context, edges, book, search, and calibration are public and free. User-owned portfolio fills, ledger rows, positions, and attribution require an authenticated SimpleFunctions key. BYOK Kalshi + Polymarket keys are only needed when you arm an intent that can fire execution.

How does the audit trail work for agent trades?

Every intent the agent declares logs thesis context, risk gates, kill conditions, and status transitions. Recorded execution events and fills read back through /api/portfolio/ledger, /api/portfolio/fills, and attribution endpoints with explicit confidence. Fund-admin export is integration-specific; venue statements remain the capital source of truth.

Latency for an OpenClaw agent vs a human?

Tool-call round-trip is ~80-150ms (cached context + edge feed). Heartbeat-driven thesis updates flow through every 15 minutes. Critical-event out-of-band ticks (FOMC, CPI, geopolitical break) reach the agent within 30 seconds. Sub-second is reserved for orderbook depth via WebSocket; agents typically pull on a schedule rather than streaming.

Multi-agent setups?

Supported. Each agent can carry its own session or source tag; intents and recorded ledger events preserve the available source evidence. Common patterns: a "research" agent that writes theses, a "scanner" agent that surfaces edges, an "executor" agent that arms intents only on signed-off candidates. All three share the same CLI/API surface, with MCP available as the adapter when the host requires it.

How does this differ from a Polymarket SDK or Kalshi REST wrapper?

A venue SDK exposes endpoints; we expose a thesis loop + edge surface + intent layer + portfolio ledger reads across both venues, normalized. The agent does not deal with RSA-PSS for Kalshi or EIP-712 for Polymarket — it calls sf.intent.create with a unified intent shape and the runtime handles signing and routing.

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 MCP adapter is the compatibility surface for OpenClaw-style hosts. Skills (Markdown + tool schemas) are versioned at /api/mcp/skill.md. The runtime engine that powers heartbeat, routing, and execution remains hosted.

Cost?

Public MCP tools (context, edges, market, book, search, calibration) are free CC-BY-4.0. Authenticated execution tools (intent, fill, BYOK signing) are metered. Heartbeat ticks are bundled into the metered quota. No subscription floor; per-call billing only.

Related surfaces