System Architecture
Component Diagram:
User Interface (UI): React‑based frontend that communicates via JSON‑RPC and REST endpoints.
API Gateway: Middleware layer handling authentication, rate limiting, and request routing to backend services.
Order Matching Engine: Off‑chain engine responsible for order book maintenance, matching logic, and trade settlement orders.
Blockchain Node: Custom EVM‑compatible node that executes smart‑contract transactions and maintains ledger state.
Smart Contracts: On‑chain modules for order book management, token escrow, and settlement finality.
Persistence Layer: Database (e.g., PostgreSQL) storing historical order book snapshots, trade history, and analytics data.
Monitoring & Analytics: Prometheus and Grafana stack for real‑time metrics, alerts, and dashboard visualization.
Data Flow:
User submits an order via the UI.
API Gateway validates and forwards the order to the Matching Engine.
Matching Engine matches orders off‑chain and generates signed settlement transactions.
Settlement transactions are batched and submitted on‑chain to the DexerEVM node.
Smart Contracts finalize the trade, update on‑chain state, and emit events.
Event listeners update the Persistence Layer and trigger UI updates.
Last updated