Simmer Preflight logo

Simmer Preflight

Organization
SpartanLabsXyz
simmer-preflight

Pre-trade readiness check for autonomous agents. One call returns wallet identity, venue status, spendable balance, open exposure, and a structured ok_to_trade verdict. Live real-venue trades auto-run this check and refuse when ok_to_trade is False.

Overview

PublisherSpartanLabsXyz
Repositorysimmer-sdk
Skill namesimmer-preflight
Stars
56
Forks
18
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by SpartanLabsXyz on GitHub. Read the source before you install it.

Installation

Install the Simmer Preflight AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/SpartanLabsXyz/simmer-sdk/tree/main/mcp/bundled-skills/preflight
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/SpartanLabsXyz/simmer-sdk.git /tmp/simmer-sdk
mkdir -p .claude/skills
cp -r /tmp/simmer-sdk/mcp/bundled-skills/preflight .claude/skills/simmer-preflight
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Simmer Preflight in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Simmer Preflight on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Simmer Preflight is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Simmer Preflight

Live real-money trades now enforce this check. client.trade(..., dry_run=False) and client.place_combo(..., dry_run=False) on a live=True client against a real venue (polymarket / kalshi) auto-run preflight() and refuse if ok_to_trade is False, surfacing the blocker codes. The auto-gate's exposure cap is opt-in (EXPOSURE_CAP_USD set → enforced; unset → cap disabled) and sells are exempt from cap math so an over-cap book can still reduce exposure. Wallet / venue / gas blockers still run. Paper, venue="sim", and dry_run=True are unchanged. One-release migrate valve: skip_preflight=True or SIMMER_SKIP_PREFLIGHT=1 (deprecation warning). MCP simmer_trade uses the same live gate; SIMMER_MCP_ALLOW_LIVE is still required and is not a replacement.

Call client.preflight() yourself when you want the full result (wallet, exposure, client_preflight_id) before you size or submit. One call returns:

  • Who you are: agent ID, tier, venue resolved from your API key context
  • Which wallet will sign: execution wallet, deposit wallet, signer mode (OWS / external key / managed)
  • Spendable balance: venue-specific USDC or $SIM balance from the briefing
  • Open exposure: sum of current_value across your existing positions (real venues only for USD cap)
  • Cap check: whether planned_amount + open_exposure_total exceeds your exposure_cap_usd
  • Risk alerts: any briefing risk signals (concentration, expiry, reliability)
  • ok_to_trade: a single boolean — True if no blockers

When to use

Call preflight before every automated trade, especially:

  • Before the first real-money order of a run
  • Before scaling into a position beyond your initial size
  • When your heartbeat wakes up after a long sleep (state may have changed)

Do not call it on every polling tick — it makes 3 API calls. Once per trade intent is correct.

Call it

These examples prepare real-money trades, so opt in explicitly with live=True.

python
from simmer_sdk import SimmerClient

client = SimmerClient.from_env(venue="polymarket", live=True)

result = client.preflight(
    venue="polymarket",       # venue to check (defaults to client.venue)
    planned_amount=5.0,       # USDC you plan to spend on this trade
    exposure_cap_usd=100.0,   # your total cross-venue exposure limit
)

if not result.ok_to_trade:
    print(f"Preflight blocked: {result.blockers}")
    # e.g. ["EXPOSURE_CAP_EXCEEDED"]
    return

# Log for audit
ledger.record({
    "preflight_id": result.client_preflight_id,
    "ok": result.ok_to_trade,
    "exposure_before": result.open_exposure_total,
    "planned": result.planned_amount,
})

Result fields

FieldTypeDescription
client_preflight_idstrUUID for your trade ledger — log before every order
agent_idstr | NoneAgent UUID from /api/sdk/agents/me
tierstr | NoneAccount tier: "free" / "pro" / "elite"
resolved_venuestrNormalised venue: "sim" / "polymarket" / "kalshi"
execution_walletstr | NoneEOA that signs trades (per-agent OWS wallet for Elite per-agent callers)
deposit_walletstr | NoneDeposit wallet address (DW cohort only; None for Cohort A)
signer_statusstr"ows" / "external_key" / "managed"
spendable_balancefloat | NoneVenue balance: pUSD/USDC (real) or $SIM (sim)
gas_balancefloat | NonePOL / SOL for gas — None in v0 (deferred to v1)
open_exposure_totalfloatSum of current_value across open positions (real venues only when cap is USD)
exposure_cap_usdfloatThe cap you passed in
planned_amountfloatThe planned trade size you passed in
would_exceed_capboolTrue if open_exposure_total + planned_amount > exposure_cap_usd
pending_alertslist[dict]Risk alerts from briefing (normalised to {message: str})
ok_to_tradeboolTrue if no blockers
blockerslist[str]Blocker codes (see below)
warningslist[str]Non-blocking advisories (fetch failures, skipped checks)

Blocker codes (v0)

CodeMeaningFix
EXPOSURE_CAP_EXCEEDEDopen_exposure_total + planned_amount > exposure_cap_usdWait for existing positions to resolve, or raise your cap
WALLET_UNVERIFIEDReal venue requested but real_trading_enabled is False, or no wallet configuredClaim agent + link wallet in dashboard
VENUE_UNSUPPORTEDVenue string not recognisedUse "sim", "polymarket", or "kalshi"
INSUFFICIENT_GASStructured risk_alert code is INSUFFICIENT_GAS (v0 proxy; no on-chain query)Fund wallet with POL / SOL
EXPOSURE_UNKNOWNReal venue + active cap, but positions fetch failed — fail-closedCheck connectivity or set exposure_cap_usd=0 to disable cap temporarily

Blockers are additive — all blocking conditions are reported, not just the first.

Per-agent caller (Elite OWS)

For per-agent API keys, execution_wallet returns the per-agent OWS EOA — not the parent user's wallet. This is the SIM-2130 identity guarantee: the preflight returns the wallet that will actually sign the trade.

python
result = client.preflight(venue="polymarket", planned_amount=5, exposure_cap_usd=100)
print(result.execution_wallet)   # 0xYourAgentOWS... (not parent user's wallet)
print(result.deposit_wallet)     # 0xYourAgentDW... (per-agent DW if activated)

Exposure calculation

open_exposure_total sums current_value from /api/sdk/positions:

  • For real venues (polymarket, kalshi): sums non-sim positions in USDC.
  • For sim venue: sums sim positions in $SIM.
  • Positions with venue: null / missing venue count as sim (virtual), not real USDC.

For Kalshi, real_trading_enabled is a client-side claim check (WALLET_UNVERIFIED if false). The server gates only Polymarket on this flag — unclaimed Kalshi agents are blocked in the SDK/MCP preflight, not by the Kalshi place path.

$SIM positions are never included in a USD cap check — they use virtual currency.

warnings[] vs blockers[]

blockers stop trading. warnings are informational — common examples:

  • briefing_fetch_failed: <error> — balance / alerts unknown; check connectivity
  • positions_fetch_failed: <error> — exposure may be understated; check rate limits
  • identity_fetch_failed: <error> — agent ID / tier unknown; API key may be invalid

If you see warnings, log them. Fetch failures on individual endpoints are gracefully handled — preflight returns best-effort data rather than throwing.

Pre-trade pattern (cookbook)

python
import os
from simmer_sdk import SimmerClient

client = SimmerClient.from_env(venue="polymarket", live=True)

def safe_trade(market_id: str, side: str, amount: float):
    # Live auto-gate: EXPOSURE_CAP_USD is opt-in (unset = no cap, no $100 default).
    # Manual preflight() still accepts an explicit exposure_cap_usd.
    cap_raw = os.environ.get("EXPOSURE_CAP_USD")
    if cap_raw:
        pf = client.preflight(
            venue="polymarket",
            planned_amount=amount,
            exposure_cap_usd=float(cap_raw),
        )
    else:
        # No env cap: live trade() will not enforce one. This explicit
        # preflight() call still uses the method default (exposure_cap_usd=100).
        pf = client.preflight(
            venue="polymarket",
            planned_amount=amount,
        )
    if not pf.ok_to_trade:
        print(f"Preflight blocked ({pf.blockers}), skipping trade")
        return None
    if pf.warnings:
        print(f"Preflight warnings: {pf.warnings}")

    # Log preflight before order submission
    print(f"Preflight OK — id={pf.client_preflight_id} "
          f"exposure={pf.open_exposure_total:.2f}+{amount:.2f}/{pf.exposure_cap_usd}")

    return client.trade(market_id=market_id, side=side, amount=amount)

Cadence

Call once per trade intent — not on every poll cycle. The preflight makes 3 API calls (/agents/me, /briefing, /positions), each counting toward your rate limits.

Scope

Preflight is read-only. It never signs, trades, redeems, or mutates settings. It is safe to call in any context including paper-trading mode (positions will reflect simulated holdings).

v0 limitations

  • gas_balance is always None — on-chain RPC not available in the SDK client. Use the dashboard to verify POL / SOL balance.
  • INSUFFICIENT_GAS is only detected from a structured risk_alert code of INSUFFICIENT_GAS — not from free-text gas / pol substrings, and not from an on-chain query.
  • Server-side preflight_id (stable, storable) deferred to v1.
  • MCP simmer_preflight is available; live simmer_trade now enforces the same ok_to_trade gate.

Links

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Simmer Preflight AI skill do?

Pre-trade readiness check for autonomous agents. One call returns wallet identity, venue status, spendable balance, open exposure, and a structured ok_to_trade verdict. Live real-venue trades auto-run this check and refuse when ok_to_trade is False.

Why use Simmer Preflight on TypingMind?

Because you install it once and use it with any model. Simmer Preflight is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Simmer Preflight in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/SpartanLabsXyz/simmer-sdk/tree/main/mcp/bundled-skills/preflight. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Simmer Preflight?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Simmer Preflight?

As many as you like. As long as a model supports skills, you can use Simmer Preflight with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Simmer Preflight AI skill free?

Yes. It is published on GitHub by SpartanLabsXyz under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇