Skip to content

Architecture

System Overview

                            ┌─────────────────────────┐
                            │     Operator Casino      │
                            │  ┌───────────────────┐   │
                            │  │   Player Wallet    │   │
                            │  └────────┬──────────┘   │
                            └───────────┼──────────────┘
                                        │ Seamless Wallet API
                                        │ (HMAC-SHA256 signed)
                            ┌───────────┼──────────────┐
                            │       Velo RGS           │
                            │  ┌────────┴──────────┐   │
                            │  │   Round Manager    │   │
                            │  │   ┌────────────┐   │   │
                            │  │   │ Pricing    │   │   │
                            │  │   │ Engine     │   │   │
                            │  │   │ (BS+Cal)   │   │   │
                            │  │   └────────────┘   │   │
                            │  └───────────────────┘   │
                            └───────────┬──────────────┘

                    ┌───────────────────┼───────────────────┐
                    │                   │                   │
            ┌───────┴───────┐  ┌───────┴───────┐  ┌───────┴───────┐
            │  Binance WS   │  │  Chainlink    │  │  BigQuery     │
            │  (Live Prices)│  │  (Settlement) │  │  (Audit Log)  │
            └───────────────┘  └───────────────┘  └───────────────┘

Components

Velo RGS (Remote Game Server)

The core game server, built in Rust with the Axum framework and Tokio async runtime.

ComponentTechnologyPurpose
HTTP/gRPC ServerAxum + tonicAPI endpoints and game communication
Pricing EngineCustom RustBlack-Scholes + isotonic calibration pipeline
Round ManagerTokio tasksRound lifecycle (start → active → locked → settled)
Oracle ClientWebSocketReal-time price feeds from Binance
SettlementPyth NetworkDecentralized settlement with on-chain proof
Wallet Providervelo-wallet crateAbstraction layer for all money operations

Wallet Integration

The RGS uses a WalletProvider trait that abstracts all balance operations. Two implementations ship out of the box:

ModeImplementationWhen Used
DemoDemoWalletDevelopment/demo — operates against local demo_players DB table
B2B ProductionSeamlessWalletClientLive — sends HMAC-signed HTTP requests to your wallet API

Both implementations write every transaction to the wallet_transactions audit table for GLI-19 compliant reconciliation. The mode is selected automatically:

  • OPERATOR_WALLET_URL set → SeamlessWalletClient (B2B mode)
  • Otherwise → DemoWallet (demo mode)

Pricing Pipeline

Each price tick flows through this pipeline:

  1. Volatility Estimation — 360-candle rolling window, 10s subsampling
  2. Black-Scholes — Base probability calculation
  3. Drifted Brownian Bridge — Path-conditioned probability adjustment
  4. Isotonic Calibration — Smoothed probability mapping
  5. Trend Persistence — Momentum-conditioned adjustment
  6. Vig Application — 5-10% house edge, probability-scaled

Round Lifecycle

  WAITING ──► ACTIVE ──► LOCKED ──► SETTLING ──► SETTLED
   (3s)       (4m50s)    (10s)      (<1s)         (3s)
                │                      │
                │ Bets accepted        │ Chainlink
                │ Odds updating        │ settlement
  • Active: Bets accepted, odds update every tick
  • Locked (buffer zone): Last 10 seconds, no new bets
  • Settling: Chainlink price fetched and verified
  • Settled: Results published, wallet credits/debits executed

Infrastructure

Hosted on Google Cloud Platform:

ServiceGCP ComponentPurpose
ComputeCloud RunAuto-scaling containers, warm instances
DatabaseCloud SQL (PostgreSQL)Transaction history, round records
CacheMemorystore (Redis)Real-time round state, session data
AnalyticsBigQueryAudit trail, long-term analytics
SecurityCloud Armor + VPCDDoS protection, network isolation

B2B Integration Documentation