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

Collateral Ratio Overlay

DeFi · All
0 installs · Verified BotGentz app
Launch App
Opens in BotSurf — try it free, no account needed.
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

Collateral Ratio Overlay watches any DeFi page for a user's position, fetches the collateral value and debt amount directly from the blockchain for the connected wallet, calculates the current collateral ratio in real time, and displays a clear overlay with the ratio, liquidation threshold, and health status. It helps you monitor your position's safety and avoid liquidation with constant visibility.

WHERE IT RUNS

This tool operates as a userscript within the BotGentz extension framework, running directly in your browser on any website. It works on any EVM-compatible blockchain page—Ethereum, Polygon, Arbitrum, Optimism, and more—where DeFi positions are managed. The tool integrates seamlessly into your workflow, appearing as a draggable panel that stays accessible as you interact with DeFi protocols.

HOW TO USE

Enter your collateral and debt contract addresses in the "Contract Setup" section. Configure your liquidation threshold, alert threshold, and refresh interval in the "Ratio Settings" section. Toggle the liquidation price display on or off. Click "Connect Wallet & Start" to connect your real wallet extension, which will begin monitoring your position and updating the ratio automatically. Use "Refresh Now" for an immediate update, or "Disconnect" to stop monitoring. The panel displays your current collateral ratio, liquidation price, and health status with color-coded indicators.

TECHNICAL OPERATION

Collateral Ratio Overlay uses raw JSON-RPC calls via window.ethereum.request() to interact with the blockchain—no external library required for basic operations. It loads ethers at runtime using a simple script tag injection for ABI encoding and contract interactions. The tool calls the collateral and debt contracts' balanceOf functions to fetch the user's balances, and optionally calls a price oracle contract to get the collateral asset price. It calculates the ratio as (collateral value × price) / debt value × 100%. The health status is determined by comparing the ratio to the liquidation threshold, with color-coded indicators: green (healthy, above threshold + 50% buffer), yellow (warning, 20-50% buffer), orange (caution, less than 20% buffer), and red (danger, at or below threshold). The liquidation price is calculated as (threshold / 100) × (debt value / collateral value) × price. The tool uses setInterval for automatic refreshes based on the user-defined interval, and fires alerts when the ratio falls below the alert threshold.

THE PANEL

The Collateral Ratio Overlay panel is fully draggable and remembers its position between sessions using GM_setValue. It snaps to the edge of the viewport for a clean interface and can be collapsed to a small icon when not in use. The panel is resizable to accommodate longer content. Press Escape to quickly close or collapse the panel. The design is optimized for productivity with a dark theme, clear visual hierarchy, and responsive controls that adapt to your workflow.

PLEASE NOTE

This tool requires the free BotGentz extension installed in your browser and a real EVM wallet extension (MetaMask, Rabby, etc.) already installed. EVM chains only—this does not work on non-EVM blockchains. The tool cannot read collateral or debt data if the contract does not expose the required view functions, cannot fetch price data if the protocol uses an oracle that is not accessible via eth_call, and cannot detect off-chain positions or cross-protocol interactions. No private keys are stored or transmitted—all data is read-only from the blockchain.

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.