← HOME

System Architecture & Alpha Engine

ROBINDUDES operates on a hybrid architecture combining high-throughput off-chain simulation with immutable on-chain settlement. This architecture delivers zero-latency trading without gas overhead during the week, while maintaining verifiable, trust-minimized reward distributions.

1. Component Architecture

[1. CLIENT LAYER]
Next.js Web ApplicationWallet integration (wagmi/viem), live trading terminal, real-time WebSocket charts, and TBA backpack inspection.
[2. CORE API / BFF]
Backend-for-Frontend (NestJS)Read-optimized API gateway serving cached indexer data, leaderboard snapshots, and authenticated trading actions.
[3. ALPHA ENGINE]
Institutional Flow Abstraction MicroserviceThe isolated proxy responsible for ingesting smart money analytics, transforming them into generic schemas, and serving cached signals.
[4. SIMULATION ENGINE]
Trading & Portfolio EngineProcesses instant market fills, monitors 25% maintenance margin thresholds, and computes real-time mark-to-market equity.
[5. SETTLEMENT KEEPER]
Automated Settlement WorkerMonitors on-chain epoch end timestamps, compiles audited ranking proofs, and signs settlement transactions.
[6. ON-CHAIN INDEXER]
EVM Event SynchronizerListens to smart contract events (WeeklySettlementSubmitted, PrizePaid, SkillLevelUp) and updates PostgreSQL & Redis.

2. The Alpha Engine (Vendor Abstraction Layer)

The Signal Layer skill provides players with institutional-grade intelligence on smart-money accumulation. To protect proprietary internal data flows and vendor ToS:

Security RuleImplementation Strategy
Single Point of ContactThe Alpha Engine is the only service with network access and API keys to external analytics providers. No client or external worker can reach upstream vendors directly.
Ingestion GenericizationData is sanitized upon arrival into generic internal schemas (e.g. SignalStrength: LOW | MEDIUM | HIGH, FlowDirection: ACCUMULATION | DISTRIBUTION) before caching.
Cache-First ModelData is refreshed on scheduled cron intervals (every 15–30 minutes) for watched asset pools, serving thousands of concurrent players from Redis with zero vendor rate-limit pressure.
Zero Data LeakageVendor identities, raw payloads, exact timestamps, and error traces are strictly filtered from public APIs, UI bundles, and on-chain metadata.

3. Trust-Minimized Settlement & Proofs

ROBINDUDES implements an off-chain compute, on-chain settle model:

  1. Epoch Completion: When block.timestamp >= epochEndTime(weekId), the backend finalizes the leaderboard ranking using the multi-sample snapshot average.
  2. Audit Root Creation: The complete weekly result dataset (all participant scores, trades, and valuations) is compiled and serialized into a JSON artifact.
  3. Cryptographic Hashing:
    resultsHash = keccak256(canonicalResultsJSON)
  4. On-Chain Submission: The Settlement Keeper calls WeeklySettlement.submitWeeklyRewards, passing the winner tokenIds, the resultsHash, and a public resultsURI (e.g. IPFS/Arweave).
  5. Public Verifiability: Anyone can fetch the off-chain dataset, calculate the Keccak256 hash independently, and verify it against the immutable on-chain record.

4. State Synchronization Flow

The indexer service maintains real-time parity between on-chain contract events and the database:

  • Minted: Creates a new NFT record and registers its counterfactual TBA address.
  • CompetitionEntered: Updates active tier participants and adjusts current prize pool balances.
  • WeeklySettlementSubmitted: Marks the competition epoch as settled and enables reward claims for tier champions.
  • WeeklyPrizePoolSettled: Records winner payout distributions and updates wallet prize histories.
  • SkillRerolled: Updates the NFT's active abilities in indexer caches.
Next: REST & WebSocket Developer API ReferenceExplore public endpoints, schemas, headers, and real-time streaming sockets.
VIEW API REFERENCE →