Real-time stability analytics and risk management dashboard for the Djed Protocol on Ergo Blockchain
Features β’ Quick Start β’ Architecture β’ Documentation β’ Contributing
- Overview
- Features
- Architecture
- Tech Stack
- Quick Start
- Testing
- Project Structure
- Design System
- API Integration
- Documentation
- Contributing
- License
- Acknowledgments
DjedOPS is a mission-critical monitoring platform providing operators and traders with real-time visibility into the Djed algorithmic stablecoin protocol on the Ergo blockchain. Built with a "Financial Brutalism" design philosophy, it combines live blockchain data, 3D visualizations, and automated risk management tools.
β
Prototype β β
MVP β β
Alpha β β³ Beta β π― Production β π Audited
Current Status: Alpha (v0.1.0) - Production-ready features with 41 passing tests
- Live DSI Monitor - Real-time Djed Stability Index tracking with dynamic reserve ratio calculation
- Transaction Feed - Live blockchain monitoring for MINT/REDEEM operations (SigUSD & SigRSV)
- Oracle Consensus - Real-time ERG/USD price from Ergo blockchain oracles1
- Reactive 3D Visualization - Dynamic Reserve Sun that transforms based on system health
- Arbitrage Sniper - Live DEX price monitoring from Spectrum Finance2 with automated opportunity detection (Β±0.5% threshold)
- Sentinel Mode - Automated guardian with configurable triggers for reserve ratio alerts and volatility warnings
- Risk Scenarios - One-click stress tests: Flash Crash, Oracle Freeze, Bank Run
- Nautilus Wallet - Full dApp connector integration3 with auto-reconnect and balance polling
- Real-Time Balance - Live ERG balance display with 30-second refresh
- React Native App - Complete mobile companion app with Expo/EAS build support
- Responsive Design - Mobile-first web dashboard with touch-optimized controls
β
Live DEX Price Integration β
Nautilus Wallet Support
β
Transaction Feed β
Reactive Reserve Sun
β
Performance Mode β
Sentinel Mode
β
Risk Scenarios β
Mobile App
β
41 Tests Passing β
Responsive Design
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js 14) β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β React β β Zustand β β SWR β β
β β Components ββββ Store ββββ Data Hooks β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
ββββββββββββββ¬βββββββββββββββββββββββββββββββββββ¬ββββββββββ
β β
βΌ βΌ
ββββββββββββββββββββββββββ ββββββββββββββββββββββββββ
β API Routes (Proxy) β β 3D Visualization β
β β’ /api/djed β β React Three Fiber β
β β’ /api/dex β β (WebGL) β
β β’ /api/feed β ββββββββββββββββββββββββββ
ββββββββββββββ¬ββββββββββββ
β
ββββββββββ΄βββββββββ
βΌ βΌ
βββββββββββββββ ββββββββββββββββββββ
βErgo Explorerβ βSpectrum Finance β
β API β β DEX API β
βββββββββββββββ ββββββββββββββββββββ
- External APIs β Ergo Explorer, Spectrum Finance DEX
- API Routes β Next.js proxy endpoints (CORS handling, data transformation)
- Custom Hooks β SWR for caching + business logic (useDjedData, useDexPrice, useWallet)
- Global State β Zustand store (protocol data, wallet, sentinel config, simulations)
- React Components β 50+ components consuming state and rendering UI
- Client-Side Rendering - All data fetching client-side via SWR
- API Proxy Pattern - Next.js API routes prevent CORS issues
- Optimistic Updates - Immediate UI feedback with background revalidation
- Error Boundaries - Graceful degradation with fallback UI
- Performance Mode - Conditional rendering based on device capabilities
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 14.2.33 | React framework with App Router |
| TypeScript | 5.0 | Type-safe development |
| React | 18.2 | UI library |
| Tailwind CSS | 3.4.1 | Utility-first styling |
| Framer Motion | 12.23.25 | Advanced animations |
| React Three Fiber | 8.15.0 | 3D graphics (WebGL) |
| Technology | Purpose |
|---|---|
| Zustand | Lightweight state management |
| SWR | Data fetching & caching |
| Technology | Purpose |
|---|---|
| Jest | Unit testing framework |
| Testing Library | Component testing |
| fast-check | Property-based testing |
| Technology | Purpose |
|---|---|
| React Native | Native mobile framework |
| Expo | Development & build platform |
| Reanimated | Native animations |
- Ergo Explorer API - Blockchain data & oracle prices
- Spectrum Finance API - DEX pool data & liquidity
- Nautilus Wallet - Ergo dApp connector
Node.js 18+ or 20+
npm 9+ or yarn
Git# 1. Clone the repository
git clone https://github.com/yourusername/djedops.git
cd djedops
# 2. Install dependencies
npm install
# 3. Start development server
npm run dev
# 4. Open browser
# Navigate to http://localhost:3000# Build for production
npm run build
# Start production server
npm start# 1. Navigate to mobile directory
cd mobile
# 2. Install dependencies
npm install
# 3. Start Expo development server
npm start
# 4. Run on specific platform
npm run ios # iOS simulator (Mac only)
npm run android # Android emulator
npm run web # Web browser
# 5. Build for production (requires EAS CLI)
npm install -g eas-cli
eas login
npm run build:android # or build:iosFor testing without external API access:
http://localhost:3000?demo=true
Uses static mock data from public/mock-data.json
# Run all tests
npm test
# Watch mode
npm test -- --watch
# Coverage report
npm test -- --coverage| Test Suite | Tests | Status | Coverage |
|---|---|---|---|
calculations.test.ts |
12 | β | Unit tests for DSI & reserve ratio |
simulation.test.ts |
15 | β | Scenario & price simulation logic |
wallet.test.ts |
8 | β | Nautilus wallet integration |
TerminalFeed.test.ts |
6 | β | Transaction feed component |
| Total | 41 | β | Comprehensive coverage |
- Unit Tests - Pure functions, calculations, utilities
- Component Tests - React component rendering & interactions
- Integration Tests - Multi-component workflows
- Property-Based Tests - Using fast-check for edge cases
Status: All 41 tests passing β
For detailed testing guide, see NEW_FEATURES_TESTING.md
djedops/
βββ app/ # Next.js App Router
β βββ layout.tsx # Root layout with fonts & error boundary
β βββ page.tsx # Main dashboard
β βββ globals.css # Financial Brutalism theme
β βββ api/ # API routes (CORS proxy)
β βββ djed/route.ts # Ergo Explorer proxy
β βββ dex/route.ts # Spectrum Finance proxy
β βββ feed/route.ts # Transaction feed proxy
βββ components/ # React components (50+)
β βββ HeroSection.tsx # Main dashboard section
β βββ ReserveSunWithVisibility.tsx # 3D visualization wrapper
β βββ MarketOpportunityCard.tsx # Arbitrage signals
β βββ SentinelPanel.tsx # Automated monitoring
β βββ TerminalFeed.tsx # Transaction log
β βββ WalletConnect.tsx # Nautilus integration
β βββ ErrorBoundary.tsx # Global error handling
β βββ isolated/ # Reusable components
β βββ ReserveSun.tsx # 3D sphere visualization
β βββ DataGrid.tsx # Metrics display
βββ lib/ # Business logic & utilities
β βββ calculations.ts # DSI & reserve ratio formulas
β βββ store.ts # Zustand global state
β βββ types.ts # TypeScript interfaces
β βββ constants.ts # Configuration constants
β βββ demo-service.ts # Mock data service
β βββ hooks/ # Custom React hooks
β β βββ useDjedData.ts # Protocol data fetching
β β βββ useDexPrice.ts # DEX price & arbitrage
β β βββ useTransactionFeed.ts # Blockchain transactions
β β βββ useWallet.ts # Nautilus wallet logic
β β βββ usePageVisibility.ts # Tab visibility detection
β βββ utils/
β β βββ dsiCalculator.ts # DSI calculation logic
β βββ __tests__/ # Unit tests
β βββ calculations.test.ts
β βββ simulation.test.ts
β βββ wallet.test.ts
βββ mobile/ # React Native app
β βββ app/ # Expo Router
β βββ components/ # Mobile components
β βββ utils/ # Mobile utilities
β βββ package.json # Mobile dependencies
βββ public/ # Static assets
β βββ mock-data.json # Demo mode data
β βββ manifest.json # PWA manifest
βββ stories/ # Storybook stories
βββ tailwind.config.ts # Tailwind + theme config
βββ jest.config.js # Jest configuration
βββ package.json # Dependencies & scripts
High-contrast, terminal-inspired aesthetics with zero fluff. Designed for rapid data interpretation in high-stress trading scenarios.
| Color | Hex | Usage |
|---|---|---|
| Deep Void Black | #050505 |
Background |
| Obsidian | #080808 |
Surface |
| Terminal Green | #39FF14 |
SAFE/NORMAL state, primary actions |
| Alert Red | #FF2A2A |
CRITICAL state, warnings |
| Off-white | #E5E5E5 |
Primary text |
| Steel Grey | #888888 |
Secondary text |
- Display: Unbounded (700, 900) - Headers and emphasis
- Body: Inter (400, 700, 900) - General text
- Monospace: JetBrains Mono, Space Mono - All numeric data
- β¨ CRT scanline overlay (nostalgic terminal aesthetic)
- π Green glow on positive signals (
text-shadow: 0 0 10px rgba(57, 255, 20, 0.6)) - β€οΈ Red glow on alerts (
text-shadow: 0 0 10px rgba(255, 42, 42, 0.6)) - π Corner L-brackets on all containers (brutalist decoration)
- π² Hollow text effect (stroke with transparent fill)
- β WCAG AA compliant (4.5:1 text contrast)
- β Keyboard navigation with visible focus indicators
- β
prefers-reduced-motionsupport - β ARIA labels and live regions
- β Semantic HTML structure
Base URL: https://api.ergoplatform.com/api/v1
// Oracle price data
GET /oracle/poolBox
Response: { price: number, datapoints: OracleData[] }
// Protocol metrics
GET /addresses/{address}/balance/total
Response: { nanoErgs: number }Polling: 15 seconds
Cache: SWR with 10s revalidation
Error Handling: Exponential backoff, fallback to demo data
Base URL: https://api.spectrum.fi/v1
// DEX pool data
GET /amm/pools
Response: SpectrumPool[]
// Price calculation
price = (reserveY / 10^decimalsY) / (reserveX / 10^decimalsX)Polling: 15 seconds
Arbitrage Detection: Β±0.5% spread threshold
dApp Connector: EIP-0012 standard3
// Connection flow
ergo.request({ method: "wallet_connect" })
β User approves in Nautilus
β ergo.get_balance() for ERG balance
β localStorage persistence for auto-reconnectBalance Polling: 30 seconds
Reconnection: Automatic on page load
- SETUP.md - Development environment setup
- IMPLEMENTATION_SUMMARY.md - Complete implementation details
- CODE_QUALITY.md - Architecture & code standards
- NEW_FEATURES_TESTING.md - Testing guide for all features
- LIVE_DEX_PRICE.md - DEX integration technical docs
- LIVE_TRANSACTION_FEED.md - Transaction monitoring implementation
- WALLET_INTEGRATION.md - Nautilus wallet integration
- REACTIVE_RESERVE_SUN.md - 3D visualization details
- PERFORMANCE_MODE.md - Performance optimization guide
- MOBILE_APP_SUMMARY.md - Mobile app documentation
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Make changes following our code style
- Write/update tests
- Run test suite:
npm test - Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open Pull Request
- TypeScript: Strict mode enabled
- Components: Functional components with hooks
- Styling: Tailwind utility classes (no CSS modules)
- Testing: Jest + Testing Library
- Commits: Conventional Commits format
All contributions must maintain Financial Brutalism aesthetic:
- β High contrast (3:1 minimum)
- β Monospace fonts for all numeric data
- β Terminal green (#39FF14) and alert red (#FF2A2A)
- β No gradients
- β No rounded corners (except functional elements)
- β No decorative shadows (only functional glows)
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 The Stable Order
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
- Next.js Team - React framework
- Vercel - Deployment platform
- Pmndrs - React Three Fiber & Zustand
- Ergo Platform - Blockchain infrastructure
- Djed Protocol - Algorithmic stablecoin design4
- Spectrum Finance - Decentralized exchange on Ergo2
- Nautilus Wallet - Ergo wallet with dApp connector3
- Ergo Explorer API - Blockchain data provider
- Ergo Oracle Pools - Decentralized price feeds1
- Financial Brutalism - Design philosophy inspiration
Built with AI-assisted development tools while maintaining human-driven architecture and design decisions.
Built with β€οΈ for the Ergo community
Report Bug β’ Request Feature β’ Documentation
Footnotes
-
Ergo Oracle Pools Documentation - Decentralized oracle design β© β©2
-
Spectrum Finance Documentation - AMM protocol on Ergo β© β©2
-
EIP-0012: dApp Connector Standard - Wallet integration standard β© β©2 β©3
-
Djed: A Formally Verified Crypto-Backed Stablecoin - Academic whitepaper β©