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

Health-Factor-Triggered Top-Up Tool

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

Health-Factor-Triggered Top-Up Tool is a specialized DeFi tool that monitors position health factors and automatically triggers collateral top-ups or debt repayments when thresholds are breached. It reads the user's position state, including health factor, liquidation threshold, collateral balance, debt balance, collateral asset price, and debt asset price from oracle price feeds. The tool evaluates the target health factor, top-up trigger threshold, user wallet balance, and allowance to determine if a top-up is needed and feasible. It reads gas price, block timestamp, and chain ID to validate transaction timing. The tool also reads position composition, collateral ratios, protocol adapter state, top-up history, and trigger configuration. It supports three key actions: topping up collateral, repaying debt, and batch top-up for multiple positions.

HOW TO USE

Connect your wallet and select your network from the dropdown. Paste the lending protocol address, top-up trigger contract address, collateral asset address, and debt asset address. Click "Read Position Health" to fetch your current health factor, liquidation threshold, balances, asset prices, trigger threshold, eligibility, wallet balance, and top-up history. Review the action preview showing current and target health factors, top-up amount, and recommended action. To add collateral to improve your health factor, enter the top-up amount and click "Top Up Collateral". To reduce debt, enter the repayment amount and click "Repay Debt". To top up multiple positions simultaneously, click "Batch Top-Up". The tool checks that the top-up amount is within the configured minimum and maximum limits before submission.

HEALTH FACTOR MONITORING AND TRIGGER ENGINE

The tool implements a comprehensive health factor monitoring engine that evaluates position risk in real-time. It reads the health factor from the lending protocol's getUserAccountData function, where health factor is calculated as (collateralValue * liquidationThreshold) / debtValue. The tool compares the current health factor against the configured trigger threshold—when the health factor falls below this value, the tool flags the position for top-up. It reads the triggerThreshold from the trigger contract to determine the alert level. The tool calculates the required top-up amount to reach the target health factor using the formula: requiredCollateral = (debtValue * targetHealthFactor / liquidationThreshold) - collateralValue. It validates the user's wallet balance and allowance against the required amount, and checks that the top-up amount is within the configured minTopUp and maxTopUp limits. For debt repayment, the tool calculates the amount needed to reduce debt to achieve the target health factor: repaymentAmount = debtValue - (collateralValue * liquidationThreshold / targetHealthFactor). When triggering a top-up, the tool constructs a topUpCollateral transaction with the asset address and amount—the trigger contract then executes the deposit via protocol adapters. For batch operations, the tool calls batchTopUp with arrays of asset addresses and amounts. Gas estimation uses the provider's fee data with a safety multiplier, and the tool validates that the user has sufficient balance for both the top-up and gas costs. The tool also reads topUpHistory to provide an audit trail of past top-up events.

WHAT IT CANNOT SEE

This tool cannot guarantee that the top-up transaction will execute before the position is liquidated due to network congestion or block timing. It cannot predict sudden price movements that could affect health factor between monitoring and execution. It cannot verify that the collateral assets have sufficient liquidity or that the protocol can accept the top-up. It cannot recover funds if the top-up transaction fails due to reverts or gas issues. It cannot ensure that the top-up amount is sufficient for current market conditions. It cannot provide financial, investment, or trading advice. It cannot detect if the protocol has been compromised, paused, or upgraded. It cannot guarantee that the position will remain safe after top-up. It cannot predict future liquidation prices or health factor changes. It cannot verify off-chain collateral valuations or risk assessments.

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 health factor thresholds and top-up amounts before executing. Top-up transactions may require approval of collateral tokens. The tool is for informational and experimental use; you bear full responsibility for position management decisions.

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.