--- name: sf-rebalance description: Refresh the deployed bot roster — pause decaying bots AND propose fresh top picks to replace them on the same exchanges with the same sizing. Use when the user asks "rebalance my bots / swap losers for winners / refresh the roster / clean up and replace / optimize my deployed strategies". Writes state (pauses) only with --apply; never auto-deploys. --- # 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 1. Audit every ACTIVE bot's underlying strategy for edge decay. 2. For each `decaying` or `dead` bot, propose a replacement from the current top-N composite-score picks (filtered to bots NOT already in your roster, to avoid duplicates). 3. Optionally `--apply` the pauses. 4. NEVER auto-creates new bots — that's `sf-deploy`'s job. Replacements are surfaced as ready-to-run `sf-deploy` commands. ## 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`.