Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.simplefunctions.dev/llms.txt

Use this file to discover all available pages before exploring further.

This is the organized reference for SimpleFunctions APIs, CLI commands, real-time data, and agent integration surfaces. Use the main technical guide for the full one-page reference. Use this Developer Hub when you need to browse by topic, copy commands, inspect response shapes, or hand a precise surface map to an agent.

I am an agent

Start with sf describe --all --json, pull world state, inspect markets, then decide whether to monitor, query, or act.

I am a developer

Call REST endpoints for query, world state, market detail, gov/econ context, portfolio state, and tool discovery.

I am evaluating the product

Understand the world model: what it returns, why it is different from a venue API, and how agents consume it.

The contract

Human prose is optional. The structured contract is the product. Every CLI command that supports --json returns one valid JSON document on stdout. Every API page documents the shape that downstream systems should rely on. Agents should not scrape terminal text or rendered UI.
sf query "Fed rate cut" --json --limit 3
sf world --delta --json --since 1h
sf portfolio history --json --ticks 20 --trades 10 --since 2026-04-23
sf describe --all --json

Core surfaces at a glance

SurfaceStart hereWhat it gives you
Agentic CLIsf describe --all --jsonMachine-readable local command surface for agents and scripts
Query APIGET /api/public/query?q=Event questions mapped to Kalshi, Polymarket, context, and next actions
World State APIGET /api/agent/worldCompact prediction-market world model for an agent context window
Market Detail APIGET /api/public/market/{ticker}One market with price, liquidity, indicators, regime, and follow-up URLs
Portfolio APIGET /api/portfolio/stateUser-scoped state, ticks, trades, views, strategies, and portfolio memory
Tool ManifestGET /api/toolsPublic tool discovery for agent runtimes

How to think about SimpleFunctions

Venue APIs expose markets. Search APIs expose documents. SimpleFunctions returns event probability state:
  • normalized venue objects
  • market-implied probabilities
  • source context kept separate from prose
  • world-state snapshots and deltas
  • account and portfolio memory for authenticated agents
  • follow-up actions that point to inspect, screen, monitor, or execution workflows
1

Get oriented

Read the Quickstart and run one public query.
2

Give an agent context

Read World Model and decide when to call full state, delta, and inspect.
3

Choose your interface

Use the CLI for local agent workflows or the API for direct HTTP integration.

Base URLs

SurfaceURLUse
APIhttps://simplefunctions.devPublic query, world state, market detail, portfolio, and execution endpoints
Real-time datahttps://data.simplefunctions.dev/v1Raw market data, search, snapshots, movers, candles, trades, and orderbooks
WebSocketwss://app.simplefunctions.dev/wsLive ticker, orderbook, trade, candle, and featured-market frames
Terminalhttps://app.simplefunctions.devBrowser workspace for market search, charts, contracts, and operator workflows

First calls

sf query "Fed rate cut" --json --limit 3
sf world --delta --json --since 1h
sf inspect KXRATECUT-26DEC31 --json
sf describe --all --json

Where to go next

NeedPage
Agent-readable command surfaceAgentic CLI
HTTP endpoints and response shapesREST API
Compact world context for agentsWorld Model
Raw market-data feedReal-Time Data API
User-scoped portfolio statePortfolio CLI

Agent handoff checklist

Before giving SimpleFunctions to an agent, give it these rules:
  1. Use sf describe --all --json before choosing commands.
  2. Prefer --json whenever a command supports it.
  3. Use sf world --json once at session start.
  4. Use sf world --delta --json --since 1h inside long-running loops.
  5. Inspect a market before acting on a ticker.
  6. Treat nextActions URLs as follow-up surfaces, not prose to scrape.
sf describe --all --json
sf world --json
sf query "Fed rate cut" --json --limit 3
sf inspect KXRATECUT-26DEC31 --json

Production checklist

For a service, dashboard, or agent runtime:
StepUse
Cache discoveryStore sf describe --all --json or GET /api/tools at boot.
Start broadPull GET /api/agent/world or sf world --json.
Narrow contextUse query, inspect, market detail, and portfolio endpoints only when needed.
Stream raw dataUse wss://app.simplefunctions.dev/ws for ticker, orderbook, trade, candle, and featured frames.
Keep state compactUse deltas instead of polling full world state repeatedly.

Launch surfaces

Open the terminal

Use the browser workspace for market search, charts, contract context, and operator handoff.

Read the API overview

Use HTTP endpoints when you need stable response shapes for services, agents, and dashboards.