Logo: Simmer Preflight

Simmer Preflight

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

Iwwersiicht

EditeurSpartanLabsXyz
Repositorysimmer-sdk
Skill-Nummsimmer-preflight
Stären
56
Forks
18
Matgeliwwert Dateien
4
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 4 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    SpartanLabsXyz huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Simmer Preflight an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/SpartanLabsXyz/simmer-sdk/tree/main/mcp/bundled-skills/preflight
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Simmer Preflight an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Simmer Preflight automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Simmer Preflight net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill 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.

Firwat Simmer Preflight op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Simmer Preflight besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Simmer Preflight an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/SpartanLabsXyz/simmer-sdk/tree/main/mcp/bundled-skills/preflight an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Simmer Preflight benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Simmer Preflight benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Simmer Preflight domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Simmer Preflight gratis?

Jo. SpartanLabsXyz huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇