Skip to content

Stage 3: live-money reliability

The open pull requests #138 (crashgame) and #168 (bot-stats-server) are reworked in this stage. Frank merges them only after this stage passes.

Loader 18.8.0, branch phase-1b-bcg-nokeeper; test tests/nobet1800.js.

  1. Fast sources first: the platform’s own answer to the bet, then the end-of-round list.
  2. Fallback, balance reconciliation: compare the platform balance before and after the bet, and the crash against the target, then do the normal bookkeeping.
  3. If still undecidable before the next round:
    • hold exactly one round;
    • log the reason and send the alert;
    • resume on the following round, as a betting round if one was due, or let the modules vote on resumption once the outcome is known.
  4. Removed: pauseLive / livePaused and every pause until flat.

Tests:

  • a win and a loss confirmed by balance alone;
  • a contradicting answer;
  • the one-round hold, then resumption;
  • that no second round is ever held.
  1. Two independent sources:
    • the page’s round strip (today);
    • the page’s own socket messages (pr, st; Appendix A), read only.
  2. First wins: the loader takes whichever delivers first. A disagreement on game id or crash value is an alert, never a silent choice.
  3. Folded in from doc 64:
    • a “no rounds received” BLIND state on the card, with a Telegram alert within a minute;
    • a feed self-heal that reconnects or reloads the source when no round arrives in time.
  4. Last resort: the 60-second alert.
  5. Measuring delay: the loader records how late each round arrived, against the round’s own timestamps from pr.
  • The open round’s id comes from pr, so “counted N, platform bet in N+1” cannot recur.
  • Every settlement is keyed by that id.
  • Pushed every round. The dashboard is connected in realtime and the counter is always in sync.

Late-bet guard (doc 64 section 4) — resolved by A2 (O3)

Section titled “Late-bet guard (doc 64 section 4) — resolved by A2 (O3)”
  • Doc 64’s idea: skip a bet that would be placed on a result too old for the platform’s window.
  • Resolution: there is no separate skip. The only skip is A2’s single-round hold, and it applies only when the outcome of the previous bet cannot be decided.
  • If the newest crash is missing but the previous outcome is known (both feed sources down), the bot still bets, using its last known history. A missing crash alone never causes a skip, in line with D-3.
  • Alerts: both situations raise an immediate alert.