Threshold-Triggered Rebalance Executor
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
The Threshold-Triggered Rebalance Executor enables automated portfolio rebalancing when token allocations deviate beyond predefined thresholds. This tool is essential for DeFi portfolio managers and automated strategy providers who need to maintain target allocations as market prices fluctuate. When any token's allocation deviates above the upper threshold or below the lower threshold, the tool triggers a rebalance transaction to restore the portfolio to its target allocation.
The tool reads portfolio state including token balances, current prices from price feeds/oracles, threshold levels (upper and lower), rebalance parameters, target allocations, current allocations, deviation percentages, and rebalance history. It supports multiple rebalance execution method variants (rebalancePortfolio, executeRebalance, performRebalance) to ensure compatibility with various rebalance contract implementations. The tool displays comprehensive portfolio details including current allocations versus target allocations, maximum deviation, rebalance status, and whether a rebalance is currently needed.
HOW TO USE
1. Connect your wallet using the Connect button. The tool automatically detects your connected address and network.
2. Select the network where your rebalance contract is deployed using the network dropdown.
3. Enter the rebalance contract address and the portfolio ID you want to monitor.
4. Enter the token addresses (comma-separated) and target allocations (comma-separated percentages, e.g., 50,50).
5. Configure upper and lower threshold deviation percentages (e.g., 10% means rebalance when any allocation deviates by more than 10%).
6. Set your slippage tolerance percentage for swap execution.
7. Click "Load rebalance state" to verify the portfolio exists, is active, and check if a rebalance is needed.
8. Review the portfolio details in the preview panel including current allocations, target allocations, maximum deviation, status, and whether a rebalance is needed.
9. Click "Execute rebalance" to submit the rebalance transaction through your wallet.
10. Use "Execute" or "Perform" as fallback methods if the primary method fails.
11. After successful rebalance, the tool reloads portfolio state to update current allocations and rebalance status.
TECHNICAL MECHANISM
The tool dynamically discovers the correct rebalance function by attempting multiple common ABI variants (rebalancePortfolio, executeRebalance, performRebalance) and performing gas estimation to verify the function exists. When a rebalance is triggered, the tool calls the rebalance contract with the portfolio ID as the parameter. The contract then calculates the required trades based on current and target allocations, executes swaps through the configured swap path/protocol, and updates the portfolio state. The tool reads portfolio state via the portfolios view function, which returns token addresses, target allocations, current allocations, last rebalance timestamp, and active status. The needsRebalance view function checks if any token allocation deviates beyond the configured thresholds, while maxDeviation returns the current maximum deviation percentage across all tokens.
WHAT IT CANNOT SEE
This tool cannot verify that the price feed is accurate or reliable; it relies entirely on the oracle configured in the contract. It cannot detect if the oracle has been compromised, manipulated, or provides stale data. It cannot ensure that the rebalance will execute at the exact threshold due to slippage, market volatility, and block timing. It cannot guarantee that the rebalance will result in the exact target allocation due to slippage and swap execution constraints. It cannot verify that the portfolio contracts have not been upgraded or modified after deployment. It cannot detect if the swap path is optimal or if the transaction is being front-run by malicious actors. It cannot recover funds if execution fails due to contract bugs, insufficient token approvals, out-of-gas errors, or blockchain reorgs. It cannot verify that tokens being traded are legitimate or not honeypot contracts. It cannot predict market movements, price gaps, or flash crashes that may affect rebalance execution. It cannot guarantee execution during extreme network congestion, high gas prices, or volatile market conditions. It cannot detect if the underlying swap protocol has been compromised or is returning manipulated prices. It cannot prevent the user from canceling or modifying rebalance parameters through other interfaces.
PLEASE NOTE
This tool is designed for EVM-compatible blockchains only (Ethereum, Polygon, Arbitrum, Optimism, Base, BSC, Avalanche, Fantom, Linea, Scroll). It requires an active wallet connection and sufficient native currency for gas fees. Always verify your rebalance contract address, portfolio ID, token addresses, and target allocations before executing. The tool attempts multiple ABI variants but may not support all rebalance contract implementations - verify your contract's functions match the expected interfaces. Threshold values should be configured carefully - too narrow may trigger frequent rebalances with high gas costs, too wide may allow significant drift from target allocations. The tool is provided as-is with no warranty; users assume full responsibility for their transactions and should exercise caution when automating portfolio rebalancing. For mainnet usage, ensure your rebalance contract has been audited and you understand the risks of automated portfolio management including impermanent loss, slippage, gas costs, and smart contract risks.