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.

A trade intent is a server-owned object that says “I want to buy/sell X at price Y, conditional on conditions Z”. Once submitted, the autopilot or terminal executes when conditions are met, subject to risk gates.

Lifecycle

create  →  pending  →  active  →  filled | cancelled | expired

Create

sf intent buy KXRATECUT-26DEC31 100 --price 65 --thesis <id>
sf intent sell KXBTC100K 50 --price 30 --json
Or via API:
POST /api/intents
Authorization: Bearer sf_live_...
Content-Type: application/json

{
  "ticker": "KXRATECUT-26DEC31",
  "side": "yes",
  "action": "buy",
  "qty": 100,
  "priceCents": 65,
  "thesisId": "th_..."
}

List

sf intent list --json
sf intents --json --status active

Cancel

sf intent cancel <intent-id>

Reasons an intent can be rejected

The server runs a gate evaluator on every intent before persisting:
  • RISK_GATE_FAIL — exceeds per-market or per-day risk limits.
  • STALE_PRICE — the price you specified is no longer reachable.
  • INSUFFICIENT_BALANCE — Kalshi/Polymarket balance below what the order would require.
  • CATEGORY_BLOCKED — your config excludes the market’s category (e.g., sports).
  • THESIS_MISMATCH — the intent’s edge doesn’t match the linked thesis’s direction.
See Errors for the full code list.

Execution

Once pending, intents are picked up by:
  • portfolio-autopilot ticks if execution_mode = 'live'.
  • manual execution via the web terminal trade ticket.
  • direct CLI via sf buy / sf sell, which bypass the intent layer entirely.

Next steps

Intents API

Endpoint shapes for create / list / cancel.

Risk gates

The pre-trade checks every intent runs through.

Thesis lifecycle

Link intents to theses for automated edge tracking.