DeFi Position Monitoring System with Alerts

Health factor 1.05 in Aave means 5% until liquidation. During high volatility, it takes minutes to go from 1.05 to losing the position. Without a monitoring system, the user learns about the problem after the fact: the position is liquidated, and the 8–15% liquidation bonus goes to the liquidator. O

Blockchain Development Services

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1310
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1270
  • image_logo-advance_0.webp
    B2B Advance company logo design
    719
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    1012
  • image_logo-aider_0.webp
    AIDER company logo development
    955
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1063

Health factor 1.05 in Aave means 5% until liquidation. During high volatility, it takes minutes to go from 1.05 to losing the position. Without a monitoring system, the user learns about the problem after the fact: the position is liquidated, and the 8–15% liquidation bonus goes to the liquidator. On large volumes, this amounts to thousands of dollars that could have been saved by adding collateral in time. In recent years, liquidations due to slow reaction have become more frequent — even a couple of minutes of delay can cost tens of thousands. We develop turnkey DeFi position monitoring systems that track health factor, LP positions, liquidations, and other metrics in real time. The system works with Aave, Compound, Uniswap v3, and custom protocols, supports multi-chain (Ethereum, Arbitrum, Optimism, Polygon, BNB Chain), and sends alerts via Telegram, Email, Webhook, or Push.

How does DeFi position monitoring work?

Monitoring health factor in Aave uses the formula: HF = (sum(collateral_i * liquidationThreshold_i * price_i)) / (sum(debt_j * price_j)). Calling the contract IPool.getUserAccountData(address) returns healthFactor in 1e18 = 1.0 format. A value below 1e18 means the position is being liquidated. For efficient mass polling, we use Multicall via the Multicall3 contract (0xcA11bde05977b3631167028862bE2a173976CA11). One eth_call retrieves HF for 100 addresses — 100 times more efficient than individual requests.

Alert thresholds:

Level Health factor Action
Green > 1.5 Normal, monitoring every 30 s
Yellow 1.2 – 1.5 Recommend adding collateral
Red 1.05 – 1.2 Immediate action required
Critical < 1.05 Liquidation imminent, alert every 5 s

Why Uniswap v3 LP positions require a separate approach?

For Uniswap v3, we monitor three metrics:

  • Current USD value of the position — via NonfungiblePositionManager.positions(tokenId) + calculation of amounts based on the current pool tick.
  • Accumulated fees — simulation of collect via eth_call (no real transaction) or calculation based on feeGrowthInside.
  • In/out-of-range status — subscribe to the pool Swap event, compare currentTick with position bounds.

To reduce RPC load, we use The Graph subgraph (1–5 min delay), and for real-time we use WebSocket subscriptions. Comparison: subgraph provides the "past" with minute-level precision; WebSocket gives the current state.

How to set up health factor alerts?

The alert engine allows creating flexible rules for each protocol and chain. For example, a rule: if health factor <= 1.2 on Ethereum for Aave, send a Telegram notification with the text "Time to add collateral!". Thresholds can be set with 0.01 precision, and channels can be combined: Telegram for urgent, Email for daily summary. For large portfolios, we configure alerts on multiple conditions: critical HF for one asset may not indicate a problem if there is cross-collateral. The system supports logical operators (AND/OR) to avoid false positives.

System architecture

Components:

  1. Indexer — reads on-chain data (polling via multicall + WebSocket subscriptions), stores in a database.
  2. Alert engine — applies user-defined rules (thresholds, channels, chains).
  3. Notification dispatcher — sends via Telegram Bot, Email, Webhook, Push.
  4. Dashboard — React + wagmi, wallet login, HF graphs.

Storage: PostgreSQL + TimescaleDB for time-series data. Schema:

CREATE TABLE position_snapshots ( id BIGSERIAL PRIMARY KEY, address VARCHAR(42) NOT NULL, protocol VARCHAR(20) NOT NULL, chain_id INTEGER NOT NULL, health_factor NUMERIC, collateral_usd NUMERIC, debt_usd NUMERIC, snapshot_at TIMESTAMPTZ NOT NULL ); CREATE INDEX ON position_snapshots (address, protocol, snapshot_at DESC); 

Multi-chain aggregation: separate connection to each network, unified under a single dashboard. Additionally, we monitor gas price — notification when base fee is below 10 gwei (a rare event for economical rebalancing).

Work process

  1. Analysis — audit your positions and identify critical metrics.
  2. Design — architecture of indexer, alert engine, channel selection.
  3. Development — implement protocol connections, configure polling/WebSocket.
  4. Testing — simulate liquidations on forked network (Hardhat anvil) to verify alerts.
  5. Deployment — deploy to your infrastructure or cloud, set up uptime monitoring.

What is included in the work

  • Analysis: list of protocols and metrics specific to your portfolio.
  • Development of indexer and alert engine with custom rules.
  • Integration of notifications (Telegram, Email, Webhooks).
  • Web dashboard with history and configuration.
  • Documentation for operation and deployment.
  • Technical support for the first month.

Timeline estimates

Version Scope Timeline
Basic Aave, Compound, Telegram alerts 7 days
Extended + Uniswap v3 LP, multi-chain, dashboard, custom rules 2–3 weeks

Cost is calculated individually. Contact us — we will evaluate your project and offer the optimal solution. Order a monitoring system to avoid losing funds to liquidations. Guaranteed uptime 99.9% (own service monitoring via Uptime Robot). Team experience — 30+ DeFi projects. Don't wait for liquidation — get a consultation on monitoring setup today.

Formulas and contracts from official Aave documentation and Uniswap v3 whitepaper.