Architecture & Scaffold

High-level overview of the Alluria lending protocol architecture and contract interactions.

System Diagram

┌───────────────────────────────────────────────────────────┐
│                     React Frontend                         │
│  (Vite + TypeScript + Tailwind + Wagmi + Recharts)         │
│                                                            │
│  Dashboard │ Deposit │ Repay │ Stability │ Staking │ ...   │
└───┬────────────────────────────────────┬───────────────────┘
    │                                    │
    │  Contract Reads/Writes             │  Price Feeds
    │  (Wagmi / Viem)                    │  (Chainlink + Eloqura)
    ▼                                    ▼
┌────────────────────────┐    ┌──────────────────────────┐
│  Sepolia RPC (Alchemy) │    │  Price Oracles           │
│                        │    │                          │
│  ┌──────────────────┐  │    │  Chainlink Sepolia       │
│  │ TroveManager     │  │    │  - WETH/USD              │
│  │ 0x90CC...        │  │    │  - WBTC/USD              │
│  └──────────────────┘  │    │  - LINK/USD              │
│  ┌──────────────────┐  │    │                          │
│  │ StabilityPool    │  │    │  Eloqura DEX Pool        │
│  │ 0xB61a...        │  │    │  - ALUR/USDC reserves    │
│  └──────────────────┘  │    └──────────────────────────┘
│  ┌──────────────────┐  │
│  │ CollateralManager│  │
│  │ 0x6423...        │  │
│  └──────────────────┘  │
│  ┌──────────────────┐  │
│  │ AluriaLens       │  │
│  │ 0x1504...        │  │
│  └──────────────────┘  │
│  ┌──────────────────┐  │
│  │ ALUD Token       │  │
│  │ 0x41B0...        │  │
│  └──────────────────┘  │
└────────────────────────┘

Lending Flow

Frontend Structure

Key Design Decisions

  • Liquity-style CDP model: Collateralized debt positions with 110% minimum ratio

  • Multi-collateral: WBTC, WETH, and LINK supported (unlike Liquity's ETH-only)

  • AluriaLens contract: Single read-only contract aggregates all protocol stats to minimize RPC calls

  • 15-second polling: use-alluria.ts hook refreshes all protocol state every 15 seconds

  • Chainlink + Eloqura oracles: Collateral priced via Chainlink, ALUR priced via Eloqura DEX pool

Last updated