Case study
Platform (iGaming)
Wallet, identity and contracts shared by every game
Exactly oncesettlement in tests, with Core stopped mid-roundat-least-once delivery with idempotent consumers (single effect)
Live demo
Core is a backend service: you can see it working through Ronin Rush and SpotKick, which reserve and settle against it.
What it is and what it solves
The shared backbone of the games: Platform Core handles identity, a double-entry wallet with holds, settlement and responsible gaming; platform-contracts defines versioned events and the wallet API; platform-infra runs it all. Games reserve and settle against Core instead of each one keeping its own money logic.
Architecture
- Ronin Rush → Platform Core (hold · settle)
- SpotKick → Platform Core (batched settle)
- SkyBiz Payouts → Platform Core (money in / out)
- Platform Core → Kafka (events)
- Ronin Rush → Kafka
- SpotKick → Kafka
- SkyBiz Payouts → Kafka
- platform-contracts → Platform Core
Three technical decisions
Holds before settlement
Games reserve funds first and settle later (individually or batched) with a settlement grace period: 1,800 s from the hold's expiry, as long as the settlement intent was recorded before it. If a game fails between bet and result, balances stayed reconciled in failure tests.
Contracts as a published package
Versioned events, the wallet OpenAPI and a contract-test kit ship as @danigil/platform-contracts, so games and Core evolve without breaking each other.
JWT RS256 with JWKS
Core signs tokens and publishes its keys, so each game verifies identity on its own without calling Core on every request.
Tests, with numbers
- 200 concurrent operations.
- Idempotent retries and settle/expiry races.
- 11 mutations detected.
- End-to-end tests with Kafka.
- Accepted E2E: Core down during a Ronin round, settled exactly once when it came back (at-least-once delivery with idempotent consumers, single effect); 16 transactions and 33 ledger entries reconciled, with no open holds.
Verified
- Core v0.2.0: payouts from house with fees, per-player grants, responsible gaming. EUR only.
- platform-contracts 0.3.0 is public on npm; platform-infra is public.
- GitOps: Core v0.2.0 (pinned by digest) and Ronin deployed on local k3s with Helm and ArgoCD; a change and a rollback through Git applied automatically; secrets kept out of Git and migrations run as Jobs.
Not claimed
- Only EUR is supported today.
- Not verified yet: Kafka, workers and web apps running on Kubernetes; a staging environment on the NAS.
- Figures come from test runs, not from production traffic.