Portfolio Drift Correction 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 Portfolio Drift Correction Executor enables automated portfolio rebalancing when allocations drift beyond configured thresholds. Unlike standard rebalancing which executes immediately when thresholds are breached, this tool incorporates correction frequency parameters to prevent excessive trading and gas costs from rapid price fluctuations. This is essential for DeFi portfolio managers who need to maintain target allocations while optimizing for gas efficiency and minimizing unnecessary trades.
The tool reads portfolio state including token balances, current prices from price feeds/oracles, drift thresholds, correction parameters, target allocations, current allocations, drift percentages, correction history, and correction frequency settings. It supports multiple drift correction execution method variants (correctDrift, executeCorrection, performCorrection) to ensure compatibility with various portfolio management contract implementations. The tool displays comprehensive portfolio details including current allocations versus target allocations, maximum drift, correction status, last correction timestamp, and whether a correction is currently needed based on both drift 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 drift correction contract is deployed using the network dropdown.
3. Enter the drift correction 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 the drift threshold percentage (e.g., 5% means correct when any allocation drifts by more than 5%).
6. Set the correction frequency in seconds (e.g., 86400 for daily, 3600 for hourly) to prevent excessive rebalancing.
7. Set your slippage tolerance percentage for swap execution.
8. Click "Load correction state" to verify the portfolio exists, is active, and check if a correction is needed.
9. Review the portfolio details in the preview panel including current allocations, target allocations, maximum drift, status, and whether a correction is needed.
10. Click "Execute drift correction" to submit the correction transaction through your wallet.
11. Use "Execute" or "Perform" as fallback methods if the primary method fails.
12. After successful correction, the tool reloads portfolio state to update current allocations and correction status.
TECHNICAL MECHANISM
The tool dynamically discovers the correct drift correction function by attempting multiple common ABI variants (correctDrift, executeCorrection, performCorrection) and performing gas estimation to verify the function exists. When a correction is triggered, the tool calls the drift correction contract with the portfolio ID as the parameter. The contract then calculates the required trades based on current and target allocations, checks that sufficient time has elapsed since the last correction based on the frequency parameter, 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 correction timestamp, correction frequency, and active status. The needsCorrection view function checks if any token allocation drifts beyond the configured threshold AND if the frequency constraint is satisfied, while maxDrift returns the current maximum drift 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 drift correction will execute at the exact threshold due to slippage, market volatility, and block timing. It cannot guarantee that the correction 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 correction 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 drift correction parameters through other interfaces. It cannot ensure that the configured correction frequency is appropriate for current market conditions or trading volumes.
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 drift correction contract address, portfolio ID, token addresses, and target allocations before executing. The tool attempts multiple ABI variants but may not support all drift correction contract implementations - verify your contract's functions match the expected interfaces. The correction frequency parameter is critical - too frequent may result in high gas costs, too infrequent 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 drift correction. For mainnet usage, ensure your drift correction contract has been audited and you understand the risks of automated portfolio management including impermanent loss, slippage, gas costs, and smart contract risks.