Collateral Withdrawal 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
Collateral Withdrawal Executor is a DeFi tool that lets you withdraw collateral from an existing lending position while maintaining a safe health factor. It reads your current debt, collateral balance, and health factor, then simulates the impact of withdrawing a specified amount. The tool calculates the maximum amount you can safely withdraw without dropping below a minimum health factor you define (default: 1.3). This helps you avoid accidentally putting your position at risk of liquidation when you want to free up collateral for other uses. The tool handles the withdrawal in a single transaction, providing a transaction hash for tracking.
HOW TO USE
Connect your EVM wallet via the BGWallet bridge. Enter your lending pool address, collateral token, and debt token. Specify the amount of collateral you want to withdraw. Set your minimum acceptable health factor after withdrawal — 1.3 is a safe default, but you can adjust based on your risk tolerance. Click "Simulate Withdrawal" to see your current health factor, collateral balance, projected health factor after withdrawal, and the maximum amount you can safely withdraw. Review the simulation carefully — if the projected health factor falls below your minimum, the tool will warn you. Click "Withdraw Collateral" to sign and broadcast the transaction. The tool handles the withdrawal in a single transaction, providing a transaction hash for tracking.
TECHNICAL MECHANISM
The tool computes your health factor using the formula: (collateral_value * liquidation_threshold) / debt_value. It fetches token prices from the lending pool's oracle or a fallback price feed. To calculate the maximum safe withdrawal, the tool solves for the collateral amount that would leave your health factor exactly at the minimum threshold: max_collateral = (min_health_factor * debt_value) / liquidation_threshold. The safe withdrawal amount is then current_collateral - max_collateral. When you execute a withdrawal, the tool calls the pool's `withdraw` function to remove the specified collateral. The entire operation is atomic — if the withdrawal would drop your health factor below the minimum, the transaction reverts, leaving your position unchanged.
WHAT IT CANNOT SEE
This tool cannot guarantee that the withdrawal will be safe if collateral prices drop or health factor changes before execution. The health factor displayed is based on current prices and may be outdated by the time your transaction confirms. The tool also cannot predict oracle updates, protocol changes, or sudden market movements that could affect your position. Always monitor market conditions and consider adding a safety buffer — a health factor of 1.3 or higher is generally recommended. This tool is an aid for managing your position, not a guarantee against liquidation.
PLEASE NOTE
EVM chains only. This tool relies on the BGWallet connector and will not function on Solana, Tron, Starknet, SUI, TON, Aptos, Bitcoin, Cosmos, or XRP. The user is responsible for ensuring the supplied contract addresses are correct and that the lending protocol supports the specified operations. Always double-check the simulation results and consider leaving extra collateral as a buffer before executing the transaction.