Cross-Margin Account Isolation Toggle 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
This tool enables DeFi traders and margin account users to toggle isolation mode on their accounts. Isolation mode separates collateral and positions from other accounts, protecting them from cross-contamination. Cross-margin mode allows sharing collateral across multiple positions, increasing capital efficiency but also increasing risk. The tool supports configurable risk parameters such as maximum leverage and liquidation threshold. It connects to your wallet and reads the margin account contract address, account ID, current isolation mode, collateral balance, position size, risk parameters, toggle history, and timestamps. The tool signs and submits transactions to toggle margin account isolation mode, update risk parameters, record toggle metadata, and emit toggle events.
HOW TO USE
1. Connect your wallet using the wallet bridge (supports MetaMask, WalletConnect, and other EVM-compatible wallets).
2. Select the target network that matches your margin account contract deployment.
3. Enter the margin account contract address and the account ID, then click "load contract" to initialize the connection.
4. Click "fetch status" to retrieve the current isolation mode, collateral balance, position size, risk parameters, and toggle history.
5. Review the current mode — isolated (🔒) or cross (🔗) — and the associated risk parameters.
6. Optionally enter new risk parameters as JSON (e.g., max leverage and liquidation threshold) to apply when toggling.
7. Click "validate toggle" to verify that the toggle is valid and the risk parameters are acceptable.
8. Click "check history" to view the toggle history for this account.
9. Review the current mode, new mode, collateral balance, and risk parameters before executing.
10. Click "toggle isolation" to sign and submit the transaction that switches the account's isolation mode.
TECHNICAL MECHANISM
The tool uses ethers.js v5.7.2 to interact with any EVM-compatible margin account contract that implements a standard interface (isIsolated(uint256) view returns (bool), getCollateral(uint256) view returns (uint256), getPositionSize(uint256) view returns (uint256), getRiskParams(uint256) view returns (uint256, uint256), toggleIsolation(uint256, uint256, uint256) external, getToggleHistory(uint256) view). The toggleIsolation function updates the account's isolation mode and risk parameters, including max leverage and liquidation threshold. The contract validates that the account is in a safe state to toggle (e.g., no active liquidation, sufficient collateral) before applying the changes. The getRiskParams view returns the current max leverage and liquidation threshold, allowing users to review them before toggling. The contract maintains a history of toggles, storing timestamps and the new mode for audit purposes. Transaction handling follows EIP-1559 gas price calculations using receipt.effectiveGasPrice for accurate cost reporting. Toggle metadata is recorded both in the contract's history and locally for the user's reference.
WHAT IT CANNOT SEE
This tool operates purely on-chain and cannot verify off-chain risk assessment — it does not evaluate the user's risk tolerance, portfolio diversification, or trading strategy. It cannot validate isolation benefits — the tool cannot confirm whether isolating the account will actually protect the user's positions. It cannot detect liquidation risk — the tool cannot predict whether the account will be liquidated after toggling. It cannot ensure proper collateralization — the tool does not verify that the collateral is sufficient for the new mode. The tool also cannot guarantee that isolation prevents losses — isolation protects against cross-contamination but does not prevent losses from market movements.
PLEASE NOTE
This tool works exclusively with EVM-compatible blockchain networks (Ethereum, Polygon, Arbitrum, Optimism, Base, etc.). It requires the margin account contract to implement the interface described above. All transactions incur gas fees paid by the connected wallet. The tool maintains no persistent storage — all state is refreshed from the blockchain on each session. Toggling isolation mode is a significant risk management decision — ensure you understand the implications of switching between isolated and cross-margin modes. Isolated mode provides better protection against cascading liquidations but may limit leverage. Cross-margin mode increases capital efficiency but also increases risk. Always review your collateral balance and position size before toggling. Consider your risk tolerance and trading strategy when choosing the mode and configuring risk parameters.