All projects

Chainlink Guardian: Privacy Preserving DeFi Liquidation Protection

Automated DeFi liquidation protection using Chainlink Automation + Data Feeds on Aave V3

Risk & Compliance Privacy

What it is

DeFi users who borrow against collateral (e.g., deposit ETH, borrow USDC on Aave) face liquidation risk when ETH price drops.

Manual monitoring is error-prone: users miss the critical window and lose their collateral. Very sad for users.I found best product market fit.

BuiltChainlink Guardian provides automated, 24/7 liquidation prevention:

  1. User deposits ETH → wraps to WETH via Aave WETH Gateway → receives aWETH collateral
  2. User borrows USDC against their aWETH on Aave V3 Sepolia
  3. User registers their position with Guardian contract, sets health factor threshold (e.g., 1.5) and pre-deposits emergency WETH reserve
  4. Chainlink Automation continuously calls checkUpkeep(), when health factor drops below threshold, performUpkeep() fires automatically
  5. Guardian contract calls Aave to supply additional WETH collateral, restoring the health factor above liquidation level
  6. Dashboard shows real-time health factor, collateral/debt values, LTV gauge, and Guardian status, all pulled live from Aave V3 + Chainlink ETH/USD feed

How it Works

Smart Contracts (Solidity + Hardhat):

Guardian.sol - core contract implementing Chainlink Automation's checkUpkeep/performUpkeep interface. Reads ETH/USD price from Chainlink Data Feed, checks all registered user positions, and supplies WETH collateral to Aave V3 when health factor drops below threshold.
Integrated with Aave V3 Pool on Sepolia for position data and collateral supply.
Uses OpenZeppelin contracts for security primitives.
31 unit tests passing.

Chainlink:

Data Feeds: ETH/USD feed (0x694AA1769357215DE4FAC081bf1f309aDC325306) for real-time price inside the contract
Automation: Registered upkeep on Sepolia - checkUpkeep scans all positions, performUpkeep executes protective collateral top-upFrontend (Next.js 14 + TypeScript)
wagmi + viem for on-chain reads and wallet transactions
RainbowKit for wallet connection (MetaMask + WalletConnect)
Reads live Aave position data (collateral, debt, health factor) directly from Aave V3 Pool contract
ConfigPanel wizard: deposit ETH via WETH Gateway -> approve WETH -> register position> Real-time health factor gauge, LTV bar, and Guardian status Deployed on Ethereum Sepolia testnet.

Links

Created by

  • Rakesh Kumawat