Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.55 KB

File metadata and controls

38 lines (26 loc) · 1.55 KB

Infrastructure & Security

Core systems that ensure the platform's stability, reliability, and automated integrity.

⚡ Circuit Breaker

The Circuit Breaker is the "Emergency Stop" for the platform's economy, protecting against infinite-money glitches or coordinated bot attacks.

Triggers (Velocity Checks)

The system monitors the Total Faucet Payout over rolling windows:

  • 1 Minute: Max 5,000 Tokens.
  • 5 Minutes: Max 20,000 Tokens.
  • 15 Minutes: Max 50,000 Tokens.

Action

  • If a limit is exceeded:
    1. Lockdown: System enters EMERGENCY_LOCKDOWN mode.
    2. Deny: All Faucet claims are rejected immediately.
    3. Alert: Admins are notified (Console/Database Flag).
    4. Broadcast: Real-time Socket.io event system:lockdown sent to all clients to disable UI.

Manual Override

Admins can manually trigger or reset the lockdown via the Admin Panel Settings.

📡 Price Service

Centralized oracle for cryptocurrency prices.

  • Sources: CoinGecko, Binance API (Failover).
  • Caching: Prices are cached (e.g., for 5-10 minutes) to prevent rate-limit bans and improve performance.
  • Usage: Used by Swap, Withdrawal Estimations, and Deposit Valuations.

📊 Platform Stats

Aggregates global metrics for the landing page and admin dashboard.

  • Metrics: Total Users, Total Claims, Total Earned, Online Users.
  • Optimization: Uses cached aggregates or approximate counts (Postgres reltuples) for large tables to ensure instant page loads.