DEV Community

Кирилл
Кирилл

Posted on

I Built a Real-Time DeFi Governance Monitor — Here Is What Compound and Aave Do When You Are Not Watching

Most DeFi users check governance proposals on Snapshot or Tally. But what happens between the vote and the execution? That window — the timelock delay — is where the real action happens. And nobody is watching.

The Problem

DeFi protocols use timelocks to delay governance actions: parameter changes, new collateral listings, fee adjustments, even emergency pauses. Compound uses a 48-hour delay. Aave uses a 24-hour timelock for most operations. MakerDAO has its own spell system.

The idea is simple: give users time to react before changes go live. But who is actually monitoring these timelocks?

Most users find out about governance changes from Twitter threads, days after they happened. By then, the damage is done. A collateral parameter change could shift your liquidation threshold. A reserve freeze could lock your funds. A fee receiver change could redirect protocol revenue.

What We Built

Governance Shield — a real-time on-chain monitor that watches governance contracts across major DeFi protocols and sends instant alerts via Telegram.

It monitors 7 contracts across Ethereum mainnet, scanning every 10 minutes:

  • Compound Timelock — queued and executed transactions
  • Aave PoolConfigurator — collateral parameters, borrow caps, rate strategy changes
  • MakerDAO — rely/deny authorizations, parameter file changes
  • Role changes — granted and revoked roles across all monitored protocols

Every event gets a risk classification:

  • CRITICAL: reserve dropped, role granted, new address authorized
  • HIGH: collateral config changed, rate strategy changed, reserve frozen
  • MEDIUM: cap adjustments, fee changes

Real Data

Yesterday, Compound Timelock queued 5 transactions in a single block (25159492). Five governance actions batched together — parameter updates going through the standard 48-hour delay pipeline.

This is normal Compound governance in action. But if you had funds in Compound and those transactions changed something that affected your position, you had exactly 48 hours to react. Without a monitor like this, you would find out from a tweet three days later.

We have been running Governance Shield continuously for several weeks. Most days are quiet — the system checks every 10 minutes across all 7 contracts and reports zero events. But when something happens, it hits your Telegram instantly.

Why This Matters

Beanstalk governance attack — $182M. Tornado Cash governance takeover. These did not happen overnight. There were on-chain signals before the damage. A queued timelock transaction, a role grant to an unknown address, a sudden parameter change — these are the early warnings.

Real-time governance monitoring is not optional for serious DeFi participants. It is basic operational security.

Architecture (High Level)

The monitor runs as a Node.js service watching Ethereum via ethers.js. It maintains a state file tracking the last scanned block, so it never misses events even after restarts. Each governance contract has its own event signature map with risk classifications. When an event matches, it formats an alert with block number, contract name, and risk level, then sends it to Telegram.

No external APIs. No third-party services. Just a node connection, a contract list, and event filters.

What Is Next

  • L2 governance: Arbitrum, Optimism, Base
  • Historical analysis: how often does each protocol make governance changes
  • Subscription service: for DAOs and institutional DeFi users who need to know the moment something changes on-chain
  • Multi-chain: BSC, Polygon, Avalanche

Get In Touch

We offer DeFi governance monitoring as a service. If your protocol, DAO, or fund needs real-time on-chain governance alerts — reach out.

Governance changes should never catch you off guard.

Top comments (0)