Simmer Autoresearch
Autonomous experiment loop for trading skill optimization: try ideas, keep what works, discard what doesn't, never stop.
Fork of pi-autoresearch adapted for prediction market trading.
Tools
init_experiment— configure session (name, metric, unit, direction). Call again to re-initialize with a new baseline.run_experiment— runs skill command, times it, captures output.log_experiment— records result.keepauto-commits.discard/crash→git checkout -- .to revert. Always include secondarymetricsdict.
Setup
- Ask (or infer): Skill (which skill to optimize), Goal (maximize P&L? find more trades? reduce drawdown?), Constraints (budget, venues, markets).
git checkout -b autoresearch/<skill>-<date>- Read the skill source files deeply. Understand the strategy before changing anything.
- Write
autoresearch.mdandautoresearch.sh(see below). Commit both. init_experiment→ run baseline →log_experiment→ start looping immediately.
autoresearch.md
This is the heart of the session. A fresh agent with no context should be able to read this file and run the loop effectively.
# Autoresearch: Optimizing <skill-name> for <goal>
## Objective
<What we're optimizing. E.g. "Maximize P&L on polymarket-fast-loop by tuning
entry thresholds, momentum signals, and position sizing.">
## Metrics
- **Primary**: pnl ($, higher is better)
- **Secondary**: trades, win_rate, max_drawdown
## How to Run
`./autoresearch.sh` — runs the skill once, outputs METRIC lines.
## Skill Overview
<Brief description of what the skill does, its strategy, signal sources.>
## Files in Scope
<Every file the agent may modify, with a brief note on what it does.>
- `fastloop_trader.py` — main strategy logic, config schema, entry/exit rules
- `SKILL.md` — skill metadata (update version on significant changes)
## Off Limits
- `simmer-sdk/` core — don't modify the SDK itself
- Other skills — only optimize the target skill
- API keys, secrets, wallet addresses
## Constraints
- Skill must still pass: `python3 <skill>.py --live` exits 0
- Don't remove safety guards (max position size, daily budget caps)
- Config env vars must stay compatible with clawhub.json tunables
- Don't break the `load_config()` / `get_client()` patterns from simmer-sdk
## Market Conditions
<Current market state that affects strategy. E.g. "Low volatility week,
few new markets, existing markets trading near consensus.">
## What's Been Tried
<Update as experiments accumulate. Key wins, dead ends, insights.>
autoresearch.sh
#!/bin/bash
set -euo pipefail
# Run the skill and capture output
SKILL_DIR="skills/polymarket-fast-loop"
OUTPUT=$(python3 "$SKILL_DIR/fastloop_trader.py" --live 2>&1) || {
echo "METRIC pnl=0"
echo "METRIC trades=0"
echo "STATUS crash"
exit 1
}
# Extract metrics from skill output
# Skills print trade summaries — parse them
echo "$OUTPUT"
# TODO: Query Simmer API for actual P&L since experiment start
# For now, extract from skill stdout
echo "METRIC pnl=0"
echo "METRIC trades=0"
Loop Rules
LOOP FOREVER. Never ask "should I continue?" — the user expects autonomous work.
- Primary metric is king. P&L improved →
keep. Worse/equal →discard. Crash →crash. - Trades > 0 is the gate. A config that produces 0 trades is
discardregardless of everything else. The whole point is to find opportunities. - Quality gates (all must pass to
keep):trades >= 3— enough data to be meaningfulprofit_factor >= 1.0— not losing money overall- P&L improved vs baseline
- If any gate fails,
discardeven if P&L looks better (could be one lucky trade)
- One parameter at a time. Change one thing, measure, keep or revert. Don't change 3 things and guess which one helped. Reference clawhub.json tunables for parameter bounds (min/max/step).
- Simpler is better. Removing code for equal P&L = keep. Complex hack for tiny gain = discard.
- Don't thrash. Repeatedly reverting the same idea? Try something structurally different.
- Crashes: fix if trivial (typo, missing import), otherwise log and move on.
- Think longer when stuck. Re-read the skill source, study market data, understand what the strategy is actually doing. The best improvements come from understanding, not random parameter sweeps.
- Resuming: if
autoresearch.mdexists, read it + git log, continue looping.
Trading-Specific Guidelines
- Start with config tuning (thresholds, filters, sizing). Low risk, fast iterations.
- Graduate to strategy changes once config space is explored. Signal logic, market selection, timing.
- Watch for overfitting. A change that works on today's markets may not generalize. Prefer robust improvements.
- Respect position limits. Never remove max_position_size or daily_budget caps — these are safety rails.
- Market conditions change. What works in high-volatility weeks may fail in quiet periods. Note conditions in autoresearch.md.
Ideas Backlog
When you discover promising optimizations you won't pursue right now, append them to autoresearch.ideas.md. Don't let good ideas get lost.
On resume, check the ideas file — prune stale entries, experiment with promising ones.
NEVER STOP. The user may be away for hours. Keep going until interrupted.
