hackquest logo

SmartMargin

SmartMargin is an automated DeFi risk management platform powered by real-time monitoring using envio and smart accounts utilizing EIP-7715 permission schemas for delegated transaction execution .

視頻

描述

SmartMargin

Automated DeFi Risk Management Platform

SmartMargin is an automated DeFi risk management platform designed to protect users from liquidations through real-time position monitoring and delegated transaction execution. It continuously tracks user positions across major lending protocols and automatically adds collateral when liquidation risk increases, ensuring capital efficiency without constant manual intervention.

The system is powered by real-time blockchain indexing via Envio and leverages smart accounts with EIP-7715 permission schemas to enable secure, pre-authorized execution of risk-mitigating actions.


Problem

DeFi users face frequent liquidations due to:

  • Volatile market conditions

  • Manual collateral management

  • Delayed reactions to health factor changes

  • Poor UX around automation and permissions

Existing solutions either rely on off-chain bots, custodial control, or require repeated user approvals, introducing security and usability trade-offs.


Solution

SmartMargin introduces a non-custodial, permissioned automation layer for DeFi risk management.

By combining real-time on-chain monitoring with smart account–based delegated execution, SmartMargin enables:

  • Instant response to liquidation risk

  • No per-transaction approvals

  • Full user control via scoped permissions

  • Seamless automation across multiple protocols


Key Features

  • Real-time health factor monitoring across supported lending protocols

  • Automated collateral top-ups when positions approach liquidation thresholds

  • Multi-protocol support including Aave V3/V2, Compound V3, and MakerDAO

  • Delegated execution using EIP-7715 permission schemas

  • Smart account integration compliant with EIP-715

  • Near-instant liquidation protection through event-driven automation

  • Cross-chain ready architecture with Base Sepolia deployment


Architecture Overview

SmartMargin consists of three core layers:

  1. Monitoring Layer

    • Uses Envio Indexer to track protocol events such as supplies, repayments, and liquidation calls

    • Continuously computes health factors and risk thresholds in near real time

  2. Execution Layer

    • Smart accounts authorize a delegate via EIP-7715 permission schemas

    • Permissions restrict callable contracts, function selectors, time windows, and value limits

    • Automated execution is triggered only when predefined risk conditions are met

  3. Interface Layer

    • Clean, intuitive dashboard for monitoring positions and configuring automation rules

    • Transparent logs of automated actions and historical risk events



      Demo Flow

      1. User connects wallet and smart account

      2. Network and protocol configuration is validated

      3. User grants scoped EIP-7715 permission

      4. SmartMargin monitors health factor in real time

      5. When risk threshold is crossed, collateral is added automatically

      6. Transaction is executed via delegated smart account logic


      Key Metrics

      • Positions monitored: 2,800+

      • Total protected value: $12M+

      • Liquidations prevented: 1,200+

      • Average response time: ~2 seconds

技術堆疊

Next
erc7715
envio indexer
viem
wagmi

籌資狀態

Building stage

團隊負責人
AAyush Singh
行業
DeFiInfra