Stage 3: live-money reliability
5. Stage 3 — Live-money reliability
Section titled “5. 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.
A1. Loader never bets — DONE
Section titled “A1. Loader never bets — DONE”Loader 18.8.0, branch phase-1b-bcg-nokeeper; test tests/nobet1800.js.
A2. Settlement of an unconfirmed live bet
Section titled “A2. Settlement of an unconfirmed live bet”- Fast sources first: the platform’s own answer to the bet, then the end-of-round list.
- Fallback, balance reconciliation: compare the platform balance before and after the bet, and the crash against the target, then do the normal bookkeeping.
- 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.
- Removed:
pauseLive/livePausedand 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.
A3. Always-on crash feed
Section titled “A3. Always-on crash feed”- Two independent sources:
- the page’s round strip (today);
- the page’s own socket messages (
pr,st; Appendix A), read only.
- First wins: the loader takes whichever delivers first. A disagreement on game id or crash value is an alert, never a silent choice.
- 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.
- Last resort: the 60-second alert.
- Measuring delay: the loader records how late each round arrived, against the round’s own timestamps from
pr.
A4. Exact game id for bets (bcgame)
Section titled “A4. Exact game id for bets (bcgame)”- 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.
A6. Live round counter and feed age
Section titled “A6. Live round counter and feed age”- 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.