This app runs inside the BotSurf browser. Don't have it yet? Get the app or extension now!

Multi-Protocol Health Factor Aggregator-and-Rebalancer

DeFi · All
0 installs · Verified BotGentz app
Launch App
Opens in BotSurf — nothing to install.
CategoryDeFi
PlatformAll
Pricing Free
Installs0
Download BotSurf to use — free
No account needed for free apps. Once BotSurf is open, find this app in Apps from the + menu.

About this app

WHAT IT DOES

Multi-Protocol Health Factor Aggregator-and-Rebalancer is a specialized DeFi tool that reads position states across multiple lending protocols to calculate and optimize health factors. It fetches user position balances, collateral amounts, debt positions, interest rates, and liquidation thresholds from each protocol. The tool computes individual health factors for each position, then aggregates them into a combined risk score using weighted calculations based on position sizes and protocol-specific risk parameters. It reads oracle price feeds, volatility metrics, and current liquidation prices to assess real-time risk exposure. The tool identifies rebalancing triggers when health factors fall below configurable thresholds and recommends actions to restore healthy levels. It supports three rebalancing actions: adding collateral to improve the health factor, repaying debt to reduce leverage, or executing a full rebalance that optimally combines both actions to reach a target health factor.

HOW TO USE

Connect your wallet and select your network from the dropdown. Paste the addresses of the two lending protocols you want to monitor (e.g., Aave, Compound) and optionally a position ID. Click "Aggregate Health Factors" to read your position data from both protocols. The tool displays each protocol's health factor, collateral, debt, an aggregated risk score, rebalancing triggers, target health factor, and current liquidation prices. Review the rebalancing configuration: set a target health factor, maximum slippage tolerance, and the amount to adjust. Choose from three actions: "Add Collateral" to deposit more assets into the position, "Repay Debt" to reduce outstanding borrowings, or "Full Rebalance" to execute the optimal combination of actions. The rebalance preview shows current and target health factors, recommended action, and slippage tolerance before execution.

HEALTH FACTOR AGGREGATION AND REBALANCING ENGINE

The tool implements a sophisticated risk aggregation engine that combines position data from multiple protocols into a unified risk assessment. It queries each protocol's getUserAccountData function to obtain total collateral, total debt, liquidation threshold, loan-to-value ratio, and health factor. For each position, the tool calculates the margin ratio (collateral/debt) and liquidation distance (health factor minus one). It then computes weighted risk scores based on position size relative to the user's total exposure, with higher weights assigned to larger positions. The tool monitors rebalancing triggers by comparing current health factors against user-defined thresholds—when a position's health factor drops below the trigger level, the tool flags it for rebalancing. For the rebalancing action engine, the tool calculates the required adjustment amount to reach the target health factor using the formula: adjustment = (debt * targetHF - collateral) / (targetHF - 1) for collateral additions, or debt adjustment = (collateral / targetHF) - debt for debt repayments. The tool applies slippage tolerance to the adjustment amount to ensure successful execution under price volatility. It constructs the transaction calldata for each action, handles token approvals automatically, and supports batched execution for full rebalances across multiple protocols. The tool also validates that the rebalanced position will meet the protocol's minimum health factor requirements before submitting transactions.

WHAT IT CANNOT SEE

This tool cannot verify that the rebalancing will result in improved health factor due to market volatility or sudden price movements. It cannot detect if the oracle price feed has been manipulated or if the protocol uses a compromised price source. It cannot guarantee that the rebalancing transaction will succeed if protocol state changes between analysis and execution. It cannot recover funds if rebalancing fails mid-execution due to reverts or gas issues. It cannot predict future liquidation prices or guarantee that the position will remain solvent after rebalancing. It cannot provide financial, investment, or trading advice. It cannot detect if the source protocol has withdrawal restrictions, timelocks, or cooldown periods. It cannot guarantee that the rebalanced position will outperform the original or produce higher yields. It cannot verify that the risk parameters are optimal for current market conditions. It cannot predict interest rate changes or reward rate fluctuations.

PLEASE NOTE

This tool supports EVM-compatible chains only. It requires an active RPC connection and a wallet with signing capabilities. The tool does not custodial funds or private keys. Always verify position details and protocol addresses before executing rebalancing. Rebalancing transactions may be complex and require sufficient gas. The tool is for informational and experimental use; you bear full responsibility for rebalancing decisions. Some protocols have withdrawal cooldowns—check eligibility before proceeding.

Similar Apps

Log in to BotGentz

Suggest an App

Tell us what you'd find useful — if we build it, we'll email you the moment it's ready.