Skip to main content
Execution intents are the software workflow layer between analysis and venue order routing. The SDK and Agent SDK execution surfaces support Kalshi and Polymarket through the runtime-backed intent path.

Create an intent

POST /api/intents
Required fields:
FieldMeaning
actionbuy or sell
venuekalshi or polymarket
marketIdKalshi ticker or Polymarket CLOB token id
marketTitleHuman-readable title
directionyes or no
targetQuantityContract quantity
Optional fields include maxPrice, executionStyle, triggerType, triggerPrice, triggerAt, softCondition, source, sourceId, and autoExecute. SDK and Agent wrappers:
await sf.intents.create({ venue: "kalshi", action: "buy", marketId, marketTitle, direction: "yes", targetQuantity: 1, maxPrice: 32 })
await sf.intents.create({ venue: "polymarket", action: "buy", marketId: tokenId, marketTitle, direction: "yes", targetQuantity: 1, maxPrice: 32 })
await sf.intents.get("intent-id")
await sf.intents.cancel("intent-id")
await sf.execution.place({ ticker: marketId, action: "buy", quantity: 1, limitPrice: 32 })
await sf.execution.place({ venue: "polymarket", tokenId, action: "buy", quantity: 1, limitPrice: 32 })
await sf.runtime.status()
await sf.runtime.ensure()
autoExecute defaults to false on raw intent creation. sf.execution.place defaults to autoExecute: true and first ensures a runtime by checking cloud and configured SDK runtime candidates. If no runtime is running, it starts or wakes one when allowed. Polymarket execution requires a CLOB token id and explicit limit price. Use runtime: { mode: "none" } for an explicit intent-only workflow. This is a governed workflow path, not the fastest possible venue client. Use raw Kalshi or Polymarket APIs for high-frequency market making, direct orderbook subscription, venue-native order lifecycle handling, and immediate replace/cancel loops. Use SimpleFunctions SDK/Agent execution when you need policy gates, runtime readiness checks, trace, intent state, monitoring, and reconciliation.

List intents

GET /api/intents
GET /api/intents?active=true
GET /api/intents?status=pending
Intent statuses:
StatusMeaning
pendingCreated and waiting for the runtime to arm it
armedRuntime has accepted it and is evaluating triggers
triggeredHard trigger fired; waiting for confirmation or execution
executingRuntime has submitted or is submitting an order
partialSome quantity filled; remaining quantity is still active
filledTarget quantity filled
expiredTrigger window expired before completion
cancelledUser or runtime cancelled the intent
rejectedRuntime rejected execution due to a permanent local/config/risk failure

Detail/update/cancel

GET /api/intents/{id}
PATCH /api/intents/{id}
DELETE /api/intents/{id}
PATCH accepts controlled status transitions (armed, triggered, executing, expired, cancelled, rejected) and positive fill reports. Invalid lifecycle transitions return 409 with the current and requested status.

Runtime

POST /api/runtime/exec
GET /api/runtime/exec
Runtime endpoints are for execution workers and should be treated as side-effecting unless a route is explicitly read-only. The SDK package does not depend on the CLI package. Hosted runtime orchestration goes through /api/runtime/exec; local or self-hosted runtime integrations use SDK runtimeControllers. Hosted status checks the runtime daemon, not just the cloud machine state, before treating execution as usable. Hosted runtime exec forwards the authenticated SF_API_KEY into the runtime process. Live Kalshi and Polymarket order routing still requires exchange credentials in that runtime context, such as encrypted cloud secrets or a local/self-hosted runtime controller. Polymarket global CLOB access is subject to Polymarket’s current geographic and terms restrictions; applications should set Agent policy guardrails such as allowedVenues, blockedJurisdictions, requireJurisdiction, max quantity, max cost, required limit prices, and confirmation tokens.