sf-rebalance
The two-step roster refresh. Combines sf-prune (find decaying bots) and
sf-best-pick (find replacement strategies) into a single proposal you
can scan on stream and execute in one shot.
What it does
- Audit every ACTIVE bot's underlying strategy for edge decay.
- For each
decayingordeadbot, propose a replacement from the current top-N composite-score picks (filtered to bots NOT already in your roster, to avoid duplicates). - Optionally
--applythe pauses. - NEVER auto-creates new bots — that's
sf-deploy's job. Replacements are surfaced as ready-to-runsf-deploycommands.
Why not auto-deploy?
Pausing a bot is reversible. Creating one isn't quite — you'd have to pause-then-delete (which isn't an endpoint). So this skill stays on the careful side: prune now, propose replacement, let the operator pull the trigger on the new deploy.
When to use
- "Rebalance my bots"
- "Swap the losers for winners"
- "Refresh the roster — kill what's dead, suggest replacements"
How to run
# Pure proposal mode — no changes
python sf-rebalance/rebalance.py [--top-picks N] [--json]
# Pause the dying ones; still only PROPOSES replacements
python sf-rebalance/rebalance.py --apply [--top-picks N]
Output
Two sections:
TO PAUSE
[decaying] BotName strategy=X flags=...
[dead] BotName strategy=Y flags=...
REPLACEMENT CANDIDATES (run sf-deploy to actually create)
--strategy slug-a --exchange EX_ID --position percentage --amount 3 --leverage 10
--strategy slug-b --exchange EX_ID --position percentage --amount 3 --dynamic-leverage
Replacements inherit the pruned bot's exchangeId, position, amount,
and leverage mode so the agent can copy-paste straight into sf-deploy.