Specs / Casino Trust Score Page Specification

Casino Trust Score Page Specification

Status: Draft (2025-11-20)

Casino Trust Score Page Specification

Status: Draft (2025-11-20)

Owner: jmenichole / TiltCheck Agent

Purpose: Provide a fast, transparent, anti-tilt single page that surfaces per-casino trust health, recent bonus adjustments, volatility, and actionable context for degens.

---

1. Objectives

2. Event Inputs

| Event | Fields Used | Purpose |

|-------|-------------|---------|

| trust.casino.updated | casinoName, previousScore, newScore, delta, severity, reason, source | Core trust timeline & deltas |

| bonus.updated | casinoName, newAmount, oldAmount | Detect positive or neutral changes, feed value trend |

| bonus.nerf.detected | casinoName, previousAmount, newAmount, percentDrop | Negative impact, increase risk score |

| bonus.logged (optional) | amount | Volume / activity context |

Optional Future Events

3. Data Model (Page-level Aggregation)


interface CasinoTrustSnapshot {
  casinoName: string;
  currentScore: number;         // last trust.casino.updated newScore
  previousScore?: number;       // before last update
  scoreDelta?: number;          // currentScore - previousScore
  lastUpdated: number;          // timestamp
  severity?: number;            // last event severity (1-5)
  volatility24h: number;        // computed metric (0-1) scaled
  events24h: number;            // count trust updates in last 24h
  nerfs24h: number;             // count bonus.nerf.detected in last 24h
  avgBonusChange24h?: number;   // mean of (new - old) from bonus.updated
  percentNerfMax24h?: number;   // worst nerf percent in window
  activityScore?: number;       // composite (events24h weighted)
  riskLevel: 'low' | 'watch' | 'elevated' | 'high' | 'critical';
  lastReasons: string[];        // up to last N reason strings
  sources: Set<string>;         // modules contributing (collectclock, trust-engine-casino,...)
}

Volatility Computation

Risk Level Mapping

| Condition | Risk Level |

|-----------|-----------|

| volatility24h < 0.15 and nerfs24h = 0 | low |

| volatility24h < 0.3 and nerfs24h <= 1 | watch |

| volatility24h < 0.5 and nerfs24h <= 2 | elevated |

| volatility24h < 0.7 or nerfs24h <= 3 | high |

| volatility24h >= 0.7 or nerfs24h > 3 | critical |

4. Aggregation Service

Location: services/dashboard (or dedicated services/trust-rollup) extension.

Responsibilities:

1. Subscribe to relevant events via eventRouter.subscribe.

2. Maintain in-memory window (deque) per casino of last 24h events.

3. Recompute snapshot on each incoming event; publish synthetic trust.casino.rollup event with snapshot payload for any listeners (UI SSE/WebSocket).

4. Persist periodic JSON (every 5 min) for reload resilience.

5. Delivery to Front-End

Transport Options:

API Sketch

GET /api/trust/casinos -> array of CasinoTrustSnapshot sorted by risk then score.

GET /api/trust/casinos/:name/history?limit=50 -> chronological trust + bonus events merged.

GET /api/trust/casinos/metrics -> aggregated stats (mean volatility, global nerf count, top movers).

6. UI Components

1. Scoreboard Grid

- Columns: Casino, Score (progress bar), Δ, Risk Badge, Volatility Sparkline, Last Reason Tooltip, Actions.

2. Volatility Sparkline

- Mini line or area chart of last N score values.

3. Nerf Indicator

- Icon (⚠) with count in last 24h; colored by severity.

4. Reason Tooltip

- Hover shows lastReasons joined; highlight sources.

5. Action Suggestions

- If riskLevel ≥ high: show "Consider Vault Lock" CTA linking to /vault command guidance (LockVault synergy).

6. Filter Bar

- Risk filter, min score, show only high volatility.

7. Event Feed Panel

- Live scrolling list: timestamp, eventType, short reason, delta.

8. Accessibility Considerations

- All color-coded risk statuses must have shape + text label.

- High contrast palette (no green/red only; include icons).

7. Styling & A11y

8. Performance & Limits

9. Persistence Strategy

10. Anti-Tilt Integration Hooks

11. Security / Abuse Considerations

12. Future Extensions

13. Implementation Checklist

---

Update this spec as modules evolve (pricing oracle integration for USD normalization, promo integrity, cross-module trust fusion).