> ## 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.

# How It Works

> The SimpleFunctions loop from thesis, to market state, to monitoring, to action — the conceptual model.

SimpleFunctions is built around a simple loop: turn real-world questions into structured market state, keep that state fresh, and hand it to agents or operators without losing provenance.

## The loop

<Steps>
  <Step title="Ask for an event">
    Start with a natural-language question or a ticker. The query layer maps it to Kalshi, Polymarket, source context, related markets, and follow-up actions.
  </Step>

  <Step title="Normalize the market">
    Venue-specific contracts become stable objects with identifiers, prices, liquidity, status, history, regime state, and links back to the source.
  </Step>

  <Step title="Attach context">
    Government, economic, traditional-market, and topic-level evidence stay in separate fields. Agents do not need to reverse-engineer prose.
  </Step>

  <Step title="Watch changes">
    World-state and delta endpoints let an agent wake on market movement, source changes, or monitored thesis conditions instead of running broad search loops.
  </Step>

  <Step title="Act through workflows">
    Responses point to inspect, screen, monitor, portfolio, and execution-intent surfaces. SimpleFunctions exposes software workflow state; it is not a broker, exchange, custodian, FCM, or investment adviser.
  </Step>
</Steps>

## Core objects

| Object            | What it represents                                                            | Start here                                         |
| ----------------- | ----------------------------------------------------------------------------- | -------------------------------------------------- |
| Event probability | A real-world question mapped to market-implied odds and related contracts     | [Query API](/api-reference/query)                  |
| Market detail     | One contract with price, liquidity, identifiers, indicators, and next actions | [Market Detail](/api-reference/market-detail)      |
| World state       | Compact market-aware context for an agent loop                                | [World Model](/guides/world-model)                 |
| Portfolio memory  | User-scoped ticks, trades, strategy, views, and risk state                    | [Portfolio Autopilot](/guides/portfolio-autopilot) |
| Tool manifest     | Machine-readable command and tool discovery                                   | [Tool Manifest](/cli/tool-manifest)                |

## Why this is different from a venue API

Venue APIs expose markets. SimpleFunctions returns event probability state:

* cross-venue contracts
* source context
* world-state snapshots and deltas
* market screens and inspection links
* user-scoped portfolio state when authenticated
* next actions for agents and operator workflows

Use venue APIs when you only need raw venue access. Use SimpleFunctions when an agent, research workflow, or institutional system needs a stable object it can reconcile.
