kalshi/high-throughput-paired-basis-maker/SKILL.md
Run a paired-market basis strategy on Kalshi with mandatory backtest-first gating before trade intents.
npx skillsauth add serenorg/seren-skills high-throughput-paired-basis-makerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Skill instructions are preloaded in context when this skill is active. Do not perform filesystem searches or tool-driven exploration to rediscover them; use the guidance below directly.
Immediately run the default paired-market backtest without asking. Do not present a menu of modes. Execute:
cd ~/.config/seren/skills/kalshi-high-throughput-paired-basis-maker && source .venv/bin/activate && python3 scripts/agent.py --config config.json
Display the full backtest results to the user. Only after results are displayed, present available next steps (trade mode). If the user explicitly requests a specific mode in their invocation message, run that mode instead.
270 days90 to 540 days_fetch_live_backtest_pairs discovers Kalshi events via /events API, finds grouped markets within each event, builds correlated pairs, fetches price history for each leg via /markets/{ticker}/history, and attaches synthetic orderbook snapshots.simulate_pair_backtest runs an event-driven stateful replay with carried cash and inventory across both legs, order-book-aware fills, and pessimistic spread-decay.run_backtest aggregates results and reports total return, annualized return, Sharpe-like score, max drawdown, hit rate, fill counts, order-book mode coverage, and pair-level contributions.events < backtest.min_events (default 200).run_trade outputs two-leg trade intents (primary + pair) with risk caps.backtest (default): paired historical simulation only.trade: always runs backtest first, then emits paired trade intents if gate passes.Live execution requires all of:
execution.live_mode=true in config--yes-live on the CLIKALSHI_API_KEY and KALSHI_PRIVATE_KEY_PATH (or KALSHI_PRIVATE_KEY) environment variablesWhen the user gives a direct exit instruction (sell, close, exit, unwind, flatten), execute the exit path immediately.
Do not editorialize or argue against recovering remaining funds.
If the user request is ambiguous, ask only the minimum clarifying question needed to identify the positions to exit.
Before any live buy, sell, or unwind:
/markets/{ticker}/orderbook.KALSHI_API_KEY and KALSHI_PRIVATE_KEY_PATH are loaded and the RSA signing produces valid auth headers.Immediately liquidate held inventory with:
python3 scripts/agent.py --config config.json --unwind-all --yes-live
The unwind path cancels open orders first, then submits market sells for all positions.
scripts/agent.py - basis backtest + paired trade-intent runtimescripts/kalshi_client.py - Kalshi REST API client with RSA key signingscripts/pair_stateful_replay.py - event-driven stateful pair replay enginescripts/risk_guards.py - drawdown, position aging, and cron auto-pause guardsscripts/seren_client.py - Seren publisher gateway clientscripts/setup_cron.py - create/update the skill-local seren-cron local-pull runner and jobscripts/run_local_pull_runner.py - poll seren-cron and execute due local jobs on this machineconfig.example.json - strategy parameters and backtest defaults.env.example - environment template for API credentialsrequirements.txt - Python dependenciesBefore running this skill, check for an existing Seren API key in this order:
API_KEY automatically. Check: echo $API_KEY. If set, no further action is needed..env file -- check if SEREN_API_KEY is already set in the skill's .env file. If set, no further action is needed.SEREN_API_KEY is exported in the current shell. If set, no further action is needed.Only if none of the above are set, register a new agent account:
curl -sS -X POST "https://api.serendb.com/auth/agent" \
-H "Content-Type: application/json" \
-d '{"name":"kalshi-high-throughput-paired-basis-maker"}'
Extract the API key from the response at .data.agent.api_key -- this key is shown only once. Write it to the skill's .env file:
SEREN_API_KEY=<the-returned-key>
Verify:
curl -sS "https://api.serendb.com/auth/me" \
-H "Authorization: Bearer $SEREN_API_KEY"
Do not create a new account if a key already exists. Creating a duplicate account results in a $0-balance key that overrides the user's funded account.
Reference: https://docs.serendb.com/skills.md
cd ~/.config/seren/skills/kalshi-high-throughput-paired-basis-maker
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
cp .env.example .env
cp config.example.json config.json
python3 scripts/agent.py --config config.json
If you are already running inside Seren Desktop, the runtime can use injected auth automatically.
Live market data only. Always leave
"markets": []and"state": {"leg_exposure": {}}empty in your config.json. The skill discovers and fetches live Kalshi pairs automatically via the/eventsAPI. Never add placeholder market tickers -- they do not exist on Kalshi and will cause the backtest to fail.
python3 scripts/agent.py --config config.json --run-type trade
python3 scripts/agent.py --config config.json --backtest-file tests/fixtures/backtest_pairs.json
Set backtest.telemetry_path to capture JSONL replay telemetry for each decision step.
/events which groups logically related markets (e.g., "Will inflation exceed 3%?" and "Will CPI beat expectations?").KALSHI-ACCESS-KEY, KALSHI-ACCESS-SIGNATURE, and KALSHI-ACCESS-TIMESTAMP headers.This skill can lose money. Basis spreads can persist or widen, hedge legs can slip, and liquidity can fail during volatility. Backtests are hypothetical and do not guarantee future results. This skill is software tooling and not financial advice. Use dry-run first and only trade with risk capital.
Use the skill-local seren-cron local-pull runner for scheduling. The schedule lives in Seren, but a local polling process must stay online on the machine that will execute the strategy.
Requirements: Seren Desktop login or a valid SEREN_API_KEY. Live schedules also require Kalshi credentials plus funded SerenBucks.
Current Seren funding flow:
https://serendb.com/serenbucks or https://console.serendb.com$5POST /wallet/depositpublisher: seren-cron
path: /api/health
method: GET
Create or upsert the runner plus the local-pull job:
python3 scripts/setup_cron.py create --config config.json --schedule "*/30 * * * *"
For live mode, include --yes-live after you have set execution.live_mode=true in config.json.
Start the polling process that claims due work and runs scripts/agent.py locally:
python3 scripts/run_local_pull_runner.py --config config.json
Leave this process running on the machine that should execute the strategy.
python3 scripts/setup_cron.py list
python3 scripts/setup_cron.py list-runners
python3 scripts/setup_cron.py pause --job-id <job_id>
python3 scripts/setup_cron.py resume --job-id <job_id>
python3 scripts/setup_cron.py delete --job-id <job_id>
python3 scripts/setup_cron.py delete-runner --runner-id <runner_id>
Pause the job immediately if live execution fails because trading funds or SerenBucks are exhausted.
testing
Review-first outreach skill for the default Seren Bucks affiliate program. It bootstraps affiliate context via /programs/discover, mines sent-mail history and address books for candidates, persists them into a skill-owned CRM, proposes an editable daily top-10, drafts outbound and reply batches for approval, reconciles affiliate and reply signals, enforces hard DNC, and returns a manual daily digest.
data-ai
Lean partner-link distribution skill for the seren-affiliates publisher program portfolio. Operates one publisher program per run. Bootstraps the affiliate profile (registering on first run), caches joined programs in serendb, ingests contacts from a pasted list or from Gmail/Outlook address books, drafts a pitch once per run via seren-models for operator approval, sends approved copy through Gmail (preferred) or Microsoft Outlook, enforces per-program dedupe plus a global unsubscribe list, and reports local plus live conversion and commission stats from seren-affiliates.
development
Family office: Process an incoming GP capital call notice end-to-end — confirm, fund, log, reconcile.
development
Work with Seren Bounty affiliate bounties: customers create and fund verifier-backed bounties; agents join to receive a referral_code and accrue earnings as qualifying events are verified; a release sweep pays matured earnings out of escrow.