Architecture & Scaffold

High-level overview of the Eloqura DEX architecture and swap routing.

System Diagram

┌───────────────────────────────────────────────────────────┐
│                     React Frontend                         │
│  (Vite + TypeScript + Tailwind + Wagmi + Recharts)         │
│                                                            │
│  Swap │ Liquidity │ Dashboard │ Examine │ Buy/Sell │ Bridge│
└───┬───────────────────────────────┬────────────────────────┘
    │                               │
    │  Contract Reads/Writes        │  Market Data
    │  (Wagmi / Viem)               │  (Netlify Functions)
    ▼                               ▼
┌────────────────────┐   ┌──────────────────────────────────┐
│  Sepolia RPC       │   │  Netlify Serverless Functions     │
│  (Alchemy)         │   │  (26 endpoints)                   │
│                    │   │                                   │
│  Eloqura V2 AMM    │   │  - Token data & history           │
│  ┌──────────────┐  │   │  - Live Coin Watch sync           │
│  │ Factory      │  │   │  - Volume analytics               │
│  │ 0x1a4C...    │  │   │  - Portfolio tracking             │
│  └──────────────┘  │   └──────────┬────────────────────────┘
│  ┌──────────────┐  │              │
│  │ Router       │  │              ▼
│  │ 0x3f42...    │  │   ┌──────────────────────┐
│  └──────────────┘  │   │  PostgreSQL (Neon)    │
│                    │   │  Drizzle ORM          │
│  Uniswap V3       │   │                      │
│  ┌──────────────┐  │   │  - Token snapshots    │
│  │ QuoterV2     │  │   │  - Price history      │
│  │ 0xEd1f...    │  │   │  - LCW coin cache     │
│  └──────────────┘  │   └──────────────────────┘
│  ┌──────────────┐  │
│  │ SwapRouter02 │  │
│  │ 0x3bFA...    │  │
│  └──────────────┘  │
└────────────────────┘

Multi-Tier Quote System

circle-exclamation

Frontend Structure

Backend Structure

Key Design Decisions

  • Dual DEX routing: Eloqura V2 for ecosystem tokens, Uniswap V3 for broader market via Quoter

  • Two WETH addresses: Eloqura WETH (0x34b1...) ≠ Uniswap WETH (0xfFf9...) — must use correct one per router

  • Serverless production: 26 Netlify functions handle all API traffic

  • Custom token import: Any ERC-20 can be imported by pasting contract address

  • Transaction tracking: All swaps/LP ops tracked via OECsplorer API integration

Last updated