
by Polymarket
No reviews yetRun a paired-market basis strategy on Polymarket with mandatory backtest-first gating before trade intents.
+31.9%
Annualized Return %
+7200.0%
Total Trades
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/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 daysload_backtest_pairs pulls live market histories from the Seren Polymarket Publisher (Gamma + CLOB proxied), attaches per-leg order-book snapshots, builds pairs from the active market universe, and timestamp-aligns each pair.simulate_basis_reversion runs an event-driven stateful replay with carried cash and inventory across both legs, order-book-aware fills, and pessimistic spread-decay.summarize_backtest reports total return, annualized return, Sharpe-like score, max drawdown, hit rate, quoted/fill counts, order-book mode coverage, telemetry counts, and pair-level contributions.sample_gate fails backtest if events < backtest.min_events (default 200).backtest_gate blocks trade mode by default if backtest return is non-positive.emit_pair_trades 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 both:
execution.live_mode=true in config--yes-live on the CLIPOLY_PRIVATE_KEY (or WALLET_PRIVATE_KEY) plus POLY_API_KEY / POLY_PASSPHRASE / POLY_SECRETWhen 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.
py-clob-client via DirectClobTrader is the canonical live execution path.$0.001; use the current tick_size.price x size) across the full book, not just the best bid.Before any live buy, sell, or unwind:
tick_size and compute visible-book recovery or cost across all levels.py-clob-client is installed and POLY_PRIVATE_KEY or WALLET_PRIVATE_KEY, POLY_API_KEY, POLY_PASSPHRASE, and POLY_SECRET are loaded.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 marketable min-tick sells and reports visible-book exit estimates.
scripts/agent.py - basis backtest + paired trade-intent runtimescripts/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 live backtest defaults.env.example - environment template for API credentialsrequirements.txt - installs py-clob-client for live order signing/submissionBefore 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":"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/polymarket-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 Polymarket pairs automatically viabacktest.gamma_markets_url. Never add placeholder market IDs — they do not exist on Polymarket and will cause the backtest to fail with "No markets with sufficient history".
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.
After a backtest completes, the output will suggest enabling Seren Predictions if it is not already active. This optional feature uses computed pair-specific endpoints to:
Endpoints used (computed, not consensus):
GET /api/polymarket/pairs/suggested ($0.10) — suggested pairs ranked by basis deviationGET /api/polymarket/correlations ($0.10) — pair correlation and basis spread statisticsTo enable, set predictions_enabled: true in the backtest section of your config.json. Estimated cost: ~$0.20 SerenBucks per backtest run.
Free
npx skills add serenorg/seren-skillsSelect “Polymarket High-Throughput Basis Maker” when prompted
openclaw install polymarket-high-throughput-paired-basis-makerSee install page for setup instructions
Polymarket
Added March 5, 2026