Debt Position Migrator
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
Debt Position Migrator is a DeFi tool that enables you to move your entire lending position — including both debt and collateral — from one protocol to another in a single atomic transaction. This is useful when you want to switch to a lending pool with better interest rates, different collateral factors, or enhanced features without needing to manually close your position and reopen it across multiple steps. The tool reads your current debt and collateral balances from the source pool, computes the equivalent amounts needed for the target pool, and constructs a transaction sequence that withdraws collateral, repays debt, and then deposits the collateral and borrows the debt in the new pool — all while maintaining your desired health factor and leverage.
HOW TO USE
Connect your EVM wallet via the BGWallet bridge. Enter the address of your source lending pool (the one you want to close), the target lending pool (where you want to open the new position), and the addresses of your debt and collateral tokens. Optionally, provide a swap router address if you need to convert tokens between pools (e.g., if the target pool uses a different debt token). Set your slippage tolerance, then click "Simulate Migration" to preview the resulting debt, collateral, and health factor in the target pool. Review the estimated gas cost and ensure the migration is economically beneficial. If satisfied, click "Execute Migration" to sign and broadcast the transaction. The tool will show progress updates for each step and provide a transaction hash for tracking.
TECHNICAL MECHANISM
The tool performs a multi-step atomic sequence using a combination of lending pool and router interactions. It first calls the source pool's `withdraw` function to retrieve the collateral, then `repay` to clear the debt. If the target pool uses a different token standard or the collateral token differs, it routes the funds through a swap router (e.g., Uniswap) using the provided path. The tool then calls the target pool's `deposit` function to supply collateral and `borrow` to take the new debt. All operations are encoded and sent as a single batch using multicall or sequential calls with proper nonce management, ensuring atomicity — if any step fails, the entire transaction reverts, leaving your position untouched. The tool simulates the health factor in the target pool based on its specific liquidation threshold and warns you if it falls below a safe level.
WHAT IT CANNOT SEE
This tool cannot verify that the target lending pool supports the exact same collateral/debt configuration or that the migration is economically beneficial when gas costs and slippage are factored in. It also cannot predict changes in interest rates or oracle prices between the simulation and execution that could make the migration unfavorable. The health factor displayed is based on current on-chain data and may differ at the time of execution. Always compare the expected target position with your current one and consider gas costs before proceeding.
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 both lending pools support the specified operations. Always double-check the simulation results before signing any transaction.