Expand description
On-chain events (sol_log_data via Steel event! / .log()).
§Indexer contract
The off-chain indexer must subscribe to these events to reconstruct daily and weekly leaderboard state. Accounts alone are insufficient for daily rank snapshots because the on-chain Ledger only maintains rolling weekly aggregates, not per-day history.
§Daily leaderboard reconstruction
For each UTC day the indexer:
- Groups
WinRecordedevents by(player, UTC_day(period))→ daily wins + daily best streak. - Groups
BetRecordedevents by(player, UTC_day(period))→ daily bet count. - Excludes periods matching any
MarketVoidedevent from accuracy calculations. - Uses
StreakBrokenevents to confirm streak resets (optional — can also derive from missing consecutiveWinRecordedrun). - At UTC midnight, snapshots rank order for each player → feeds into weekly scoring.
The period field maps to a UTC day via the Market::open_ts / Market::close_ts stored
on the Market PDA (288 periods per day for 5-minute rounds).
§Weekly score inputs (all on-chain, readable from events or Ledger state)
| Component | Weight | Source |
|---|---|---|
| Best streak of the week | 50% | WinRecorded.win_streak peak per week |
| Daily leaderboard placement | 30% | Off-chain daily rank snapshots |
| Total correct calls | 10% | WinRecorded.total_wins at week end |
| Accuracy rate | 10% | total_wins / total_bets (min ~50 bets enforced off-chain) |
Structs§
- BetRecorded
- Emitted by
PlaceBetwhen tickets are actually debited (both commit and live windows). - Initialized
- Emitted after successful
Initialize. - Market
Voided - Emitted by
AdminVoidMarketwhen a market is voided. - Streak
Broken - Emitted by
PlaceBetwhen a player’s streak is broken (previous period settled as a loss). - Void
Refunded - Emitted by
AdminRefundVoidPositionfor each refunded position. - WinRecorded
- Emitted by
ExecutorTreasuryDISTRIBUTE when a win is confirmed for a player.