Files
casino/cmd/arcade/static/costs.html
drjones ca39e8bad9 feat(ops): costs page, 5-minute backups, warm standby, kernel tuning
The costs page states both deductions and, for each game, the maths
return alongside what players actually receive. It is rendered from
/api/fees, which the server generates from the same schedule it charges,
so the published terms cannot drift from the behaviour.

Backups every five minutes with a rolling 24 hours. Each dump is checked
for size and format before replacing the previous one — a backup script
that reports success on a truncated file is worse than none, because it
turns a recoverable outage into silent loss found only when needed. A
nightly job restores the newest snapshot and asserts the ledger balances.

The standby continuously restores into a shadow database and swaps only
after verifying the books, so it is never mid-restore when needed and
never promotes a corrupt copy. Promotion does not contact the dead
machine, and it refuses to start if the ledger does not balance.

Kernel tuning is tied to measured limits, not copied defaults. Alby Hub
is explicitly excluded from snapshot restore: publishing a stale channel
state can lose the channel balance outright.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 23:40:27 +00:00

139 lines
4.8 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>WHAT THIS COSTS :: QUANTUM ARCADE</title>
<link rel="stylesheet" href="/style.css">
</head>
<body>
<svg class="filigree" aria-hidden="true">
<defs>
<pattern id="orn" width="60" height="52" patternUnits="userSpaceOnUse">
<g fill="none" stroke="currentColor" stroke-width="0.7">
<path d="M15 0 L45 0 L60 26 L45 52 L15 52 L0 26 Z"/>
<path d="M30 26 L60 26 M30 26 L15 0 M30 26 L15 52"/>
<circle cx="30" cy="26" r="1.6"/>
</g>
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#orn)"/>
</svg>
<header class="topbar">
<div class="brand">QUANTUM<span>ARCADE</span></div>
</header>
<main class="view costs">
<h1>WHAT THIS COSTS</h1>
<p class="lede">
Running this takes electricity, a machine, and a Lightning node with money
parked in it. Two small deductions cover that. Both are listed here, both
appear as their own line in your transaction history, and both are computed
by the same code that generated this page.
</p>
<!-- Filled from /api/fees, so this page cannot state terms different from
the ones the server applies. -->
<div class="kvgrid" id="schedule"></div>
<h2>The two deductions</h2>
<div class="card">
<h3>1. A percentage of winnings</h3>
<p class="muted small">
Taken only when you win. If you lose a round, nothing extra is taken —
you simply lost the round. This is the house's actual revenue.
</p>
</div>
<div class="card">
<h3>2. Rounding down to whole satoshis</h3>
<p class="muted small">
Balances are tracked in millisatoshis — thousandths of a satoshi — because
the maths needs that resolution. Payouts are floored to whole satoshis and
the fraction stays with the house.
</p>
<p class="muted small">
The most this can ever cost you on a single payout is
<strong id="worst"></strong>. It is a rounding, not a second fee, and it
is bounded by that amount every time.
</p>
</div>
<h2>What that does to your odds</h2>
<p class="muted small">
A rake changes the real return, so quoting the game's raw figure would be
misleading. Both numbers are below: what the game's maths return before the
deduction, and what you actually receive after it.
</p>
<div class="tablewrap">
<table class="odds" id="rtp-table">
<tr><th>game</th><th>maths return</th><th>you receive</th></tr>
</table>
</div>
<h2>How you can check all of this</h2>
<ul class="checks">
<li>
<strong>Your history itemises it.</strong> Open the Wallet tab. A win
shows as a <code>payout</code> line for the full amount, followed by an
<code>operating_fee</code> line for the deduction. Nothing is folded into
a quietly smaller number.
</li>
<li>
<strong>The books must sum to zero.</strong> Every millisatoshi in this
system is a double-entry posting.
<code>/api/health</code> adds up every account in the system; it returns
zero or the platform is telling you it is broken. A fee that vanished
instead of being posted would show up there.
</li>
<li>
<strong>The odds are the generator.</strong> The scratch odds tables come
from the same data structure that produces outcomes — they cannot drift
apart. A test runs two million plays and fails the build if the observed
frequencies disagree with the published ones.
</li>
<li>
<strong>Outcomes are sealed before you bet.</strong> The crash point comes
from a seed committed before betting opens, combined with the keys of
everyone who joined. Check any round yourself in the Verify tab; it
recomputes on your device and asks the server only for published values.
</li>
<li>
<strong>The code is open.</strong> AGPL-3.0. Every line of this,
including the two deductions described above, is readable and auditable.
</li>
</ul>
<h2>What is not taken</h2>
<ul class="checks">
<li>No fee to deposit.</li>
<li>No fee to send sats to another player.</li>
<li>No fee on losing rounds beyond the loss itself.</li>
<li>No account fee, inactivity fee, or minimum balance.</li>
<li>Withdrawals cost only the Lightning routing fee, which is real network
cost and is capped.</li>
</ul>
<p class="muted small closing">
The aim is for this to feel free, which means being exact about the places
it is not. If you find a number on this page that does not match what your
history shows, that is a bug worth reporting, and the ledger will settle
the argument.
</p>
<p class="center"><a class="backlink" href="/">← back to the arcade</a></p>
</main>
<script type="module" src="/costs.js"></script>
</body>
</html>