Add pool-level enabled flag to pause trading#86
Merged
Conversation
When enabled is false (default true), the bot keeps polling prices, updating the health dashboard, recording history and tracking the portfolio, but skips: - token wrapping at startup (cBTC→WCBTC, JUSD→svJUSD) - NFT manager and swap router token approvals - depeg detection, initial band minting and band rebalances Set enabled: false for svjusd-wcbtc-citrea in pools.dev.yaml so the DEV bot stops attempting transactions on a wallet that ran out of gas.
The RESET_BANDS env-triggered emergency withdraw was the last remaining code path that could send transactions when a pool is configured with enabled: false. Gate it so a disabled pool stays inactive regardless of env vars.
This was referenced May 16, 2026
TaprootFreak
added a commit
that referenced
this pull request
May 16, 2026
The PRD config was missing the `enabled` flag (introduced in #86), defaulting to true. The bot has been failing to initialize on every restart because the configured wallet 0x8325b27d4Ca7d8a8bF2864b2BC7cc697BfA4A67F has zero cBTC on Citrea Mainnet, causing `eth_estimateGas` to revert with `gas required exceeds allowance (0)` during ERC20 approvals. Set `enabled: false` to match the DEV config and stop the restart-loop until the wallet is funded.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
enabledflag at pool config root (defaulttrue); when set tofalse, the bot keeps polling prices, updating the dashboard, persisting history and tracking the portfolio, but skips every on-chain write (token wrapping, NFT/SwapRouter approvals, depeg-driven emergency withdraw, initial band mint, band rebalances).pools.dev.yamlsetsenabled: falseforsvjusd-wcbtc-citreaso the DEV bot stops theINSUFFICIENT_FUNDSerror loop after the wallet ran out of gas.enabled: true).Motivation
The DEV wallet for the
svjusd-wcbtc-citreapool ran out of cBTC for gas and produced ~16 Rebalance errors + 48 retry warnings + Telegram alert failures per hour. We want the container to keep running (Grafana dashboard, price history, portfolio tracking) but stop hammering on-chain calls until the wallet is refilled or the DEV deployment is repurposed.Test plan
npm run lintcleannpm run buildcleannpm test— all 114 tests passdocker compose logs rangekeepershows "Trading disabled" warnings, no moreRebalance error/INSUFFICIENT_FUNDSlineshttps://rangekeeper-devdashboard still updates with current price and portfolio