Multi-Asset Basket Rebalance Trigger
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 Multi-Asset Basket Rebalance Trigger enables automated rebalancing of diversified token baskets when the composition deviates from target weights. This tool is essential for DeFi portfolio managers, index providers, and automated strategy operators who manage baskets of multiple assets and need to maintain target weightings as market prices fluctuate. The tool handles any number of assets in the basket, calculates current weights based on real-time oracle prices, and triggers rebalancing when deviations exceed configured thresholds.
The tool reads basket state including token balances, current prices from price feeds/oracles, basket composition (tokens and weights), rebalance thresholds, target weights, current weights, deviation percentages, rebalance history, and rebalance frequency settings. It supports multiple rebalance execution method variants (rebalanceBasket, triggerRebalance, executeRebalance) to ensure compatibility with various basket management contract implementations. The tool displays comprehensive basket details including current weights versus target weights, maximum deviation, rebalance status, last rebalance timestamp, and whether a rebalance is currently needed based on both deviation thresholds and frequency constraints.
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 basket rebalance contract is deployed using the network dropdown.
3. Enter the basket rebalance contract address and the basket ID you want to monitor.
4. Enter the token addresses (comma-separated) and target weights (comma-separated percentages, e.g., 30,30,40 for a 3-asset basket).
5. Configure the rebalance threshold percentage (e.g., 5% means rebalance when any asset's weight deviates by more than 5%).
6. Set the rebalance frequency in seconds (e.g., 86400 for daily) to prevent excessive rebalancing and gas costs.
7. Set your slippage tolerance percentage for swap execution.
8. Click "Load basket state" to verify the basket exists, is active, and check if a rebalance is needed.
9. Review the basket details in the preview panel including current weights, target weights, maximum deviation, status, and whether a rebalance is needed.
10. Click "Execute basket rebalance" to submit the rebalance transaction through your wallet.
11. Use "Trigger" or "Execute" as fallback methods if the primary method fails.
12. After successful rebalance, the tool reloads basket state to update current weights and rebalance status.
TECHNICAL MECHANISM
The tool dynamically discovers the correct rebalance function by attempting multiple common ABI variants (rebalanceBasket, triggerRebalance, executeRebalance) and performing gas estimation to verify the function exists. When a rebalance is triggered, the tool calls the basket rebalance contract with the basket ID as the parameter. The contract then calculates the required trades based on current and target weights for all tokens in the basket, checks that sufficient time has elapsed since the last rebalance based on the frequency parameter, executes swaps through the configured swap path/protocol for each token that needs adjustment, and updates the basket state. The tool reads basket state via the baskets view function, which returns token addresses, target weights, current weights, last rebalance timestamp, rebalance frequency, and active status. The needsRebalance view function checks if any token weight deviates beyond the configured threshold AND if the frequency constraint is satisfied, while maxDeviation returns the current maximum deviation percentage across all tokens in the basket.
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 basket 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 weights due to slippage and swap execution constraints across multiple tokens. It cannot verify that the basket 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 basket parameters through other interfaces. It cannot ensure that the configured rebalance frequency is appropriate for the volatility of the basket's constituent assets.
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 basket rebalance contract address, basket ID, token addresses, and target weights before executing. The tool attempts multiple ABI variants but may not support all basket rebalance contract implementations - verify your contract's functions match the expected interfaces. The rebalance frequency parameter is critical - too frequent may result in high gas costs and unnecessary trading, too infrequent may allow significant deviation from target weights. For baskets with many tokens, rebalancing may involve multiple swaps and higher gas costs. The tool is provided as-is with no warranty; users assume full responsibility for their transactions and should exercise caution when automating basket rebalancing. For mainnet usage, ensure your basket rebalance contract has been audited and you understand the risks of automated portfolio management including impermanent loss, slippage, gas costs, and smart contract risks.