Project Documentation
Technical architecture and design decisions for Deriverse Analytics.
1. High-Level Architecture
Server-Side "BFF" (Backend-for-Frontend) architecture using Next.js 15.
- Frontend: React (Client Components) + Shadcn/UI (Visuals).
- Backend: Next.js API Routes (
app/api/deriverse/...). - Blockchain: Server-Side Deriverse SDK instance.
2. Key Technical Decisions
🅰️ Running the SDK on the Server
Moved all SDK logic to API routes.
Why? The Deriverse SDK relies on Node.js libraries (Buffer, stream) that don't exist in the browser. Polyfilling creates bloat and fragility.
🅱️ The "Hybrid" Data Engine
Gracefully falls back to Realistic Mock Data if live fetch fails.
Why? Resilience. A dashboard showing demo data is a sales tool; an empty dashboard is a failure.
3. The SDK Compatibility Issue
Diagnosis of the current blocker using on-chain inspection.
The MismatchSDK expects 336 bytes.
On-Chain Program returns 344 bytes.
On-Chain Program returns 344 bytes.
The ResultSDK throws
RangeError during initialization because it tries to read data at offsets that don't match the version.Fix Required: Needs either an SDK update or a program update from the Deriverse team.
4. Feature Recap
PnL AnalysisWin RateVolumeDrawdown ChartHeatmap AnalysisTrading Health ScorePDF Export