Perpetual Position Auto-Deleverage Opt-In Tool
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
Perpetual Position Auto-Deleverage Opt-In Tool allows traders to opt-in or opt-out of a protocol's automatic deleveraging mechanism for their perpetual positions. When enabled, the protocol is authorized to partially close or reduce the user's position when certain risk thresholds are met—such as when the position's leverage exceeds a target level or when the distance to liquidation falls below a defined safety margin. This proactive risk reduction helps lower the user's liquidation risk during volatile market conditions and reduces systemic risk for the protocol by decreasing the likelihood of cascading liquidations.
The tool reads the user's current position data—including position size, margin, leverage, liquidation price, and current oracle price—along with the protocol's risk parameters such as the deleverage threshold and target leverage ratio. It then displays the current auto-deleverage status and allows the user to submit a transaction to update their preference on-chain.
HOW TO USE
1. Connect your EVM wallet to the network where your perpetual protocol is deployed.
2. Enter the perpetual protocol contract address.
3. Optionally enter your position ID (if you have multiple positions; default is 0).
4. Select your desired action: "Opt-In" to enable auto-deleverage, or "Opt-Out" to disable it.
5. Click "Check Status" to read your current position data and auto-deleverage preference.
6. Review the displayed information: position size, leverage, liquidation price, distance to liquidation, and your current opt-in status.
7. If the selected action differs from your current status, click "Submit" to sign and broadcast the transaction updating your preference.
8. Confirm the transaction in your wallet.
TECHNICAL MECHANISM
The tool interfaces with the perpetual protocol contract using a variety of function signatures to maximize compatibility: setAutoDeleverage(uint256 positionId, bool enabled), optInAutoDeleverage(uint256 positionId), optOutAutoDeleverage(uint256 positionId), and toggleAutoDeleverage(uint256 positionId). The tool reads position data via view functions that return position size, margin, leverage, liquidation price, and current price. It calculates the distance to liquidation as a percentage and presents it with a color-coded status badge. Gas estimation uses a 20% buffer to handle network variability, and actual gas costs are calculated from receipt.effectiveGasPrice. All transactions are submitted sequentially with a progress bar and status updates.
WHAT IT CANNOT SEE
This tool cannot guarantee that auto-deleverage will trigger at the optimal time or price—market volatility may cause deleveraging to occur at less favorable prices than anticipated. It cannot prevent liquidation if the market moves too quickly for the protocol to respond, or if the deleverage threshold is set too low. It cannot account for off-chain market conditions, funding rate changes, or external factors that may affect position health. It cannot recover losses if deleverage occurs at an unfavorable price; the user bears the risk of the reduced position. It cannot predict whether the user would have been better off without auto-deleverage—in some market scenarios, holding the position without reduction may have been more profitable. It cannot manage positions across multiple protocols simultaneously; each protocol requires separate configuration.
PLEASE NOTE
EVM chains only. This tool requires that the perpetual protocol supports auto-deleverage functionality. Not all perpetual exchanges offer this feature. Always review the protocol's risk parameters before opting in—understanding the deleverage threshold and target leverage is critical. The tool is a preference manager; it does not execute the actual deleveraging, only enables or disables the protocol's ability to do so. Test on testnet before using with real funds.