# Introduction to Overtime Casino

## Welcome to [Overtime Casino](https://overtimemarkets.xyz/casino):link:

Overtime Casino is a fully onchain casino built on the same architecture that powers the Overtime sportsbook. Twelve games, **Roulette, Blackjack, Dice, Baccarat, Slots, Plinko, Keno, HI-LO and 4 types of Poker** each implemented as a separate, audited smart contract, each using **Chainlink VRF v2.5** as the source of randomness, and each playable directly from any wallet on Base, Optimism and Arbitrum.

There is no "casino backend." There is no operator-controlled RNG. There is no admin function that can void a winning bet. The contract code is the casino.

***

### Why we built it

Overtime began with a single position: **betting infrastructure should not depend on trust in the operator.**

Sportsbooks shouldn't be allowed to limit, ban or shadow-cap winners. Casinos shouldn't be allowed to run RNGs nobody can audit. Liquidity shouldn't sit in a black box. Withdrawals shouldn't be stalled when the books look bad that month. Affiliate payouts shouldn't be subject to retroactive "review."

Over the past four-plus years, Overtime has shown that this works for sports. The existing Overtime sportsbook offers:

* Onchain parlays, system bets, SGPs and live betting
* Onchain digital options on ETH/BTC price (1-minute markets)
* No registration, no KYC choke point, no ability to limit or ban a winning user - the contracts simply don't have those functions

Overtime Casino extends the same architecture to the casino floor. The same wallet, the same collateral balance ($USDC, $WETH, $OVER), the same free-bet system, and the same referrals registry - now exposed to all  game contracts.

> *Sunlight is the best disinfectant.*

The casino industry has had a hundred years to live up to that idea and chose not to. Provably fair sites publish hashes nobody verifies. Streamers play on house accounts and pretend the variance is real. Withdrawal queues stretch to weeks. Affiliate earnings get clawed back. The entire model relies on the assumption that the player can't see inside the box.

Overtime Casino removes the box.

***

### What "fully onchain" actually means here

Every Overtime Casino game follows the same lifecycle. It's worth walking through it once, because this is where most "crypto casinos" quietly cheat.

#### 1. You call the game contract directly

You (or a frontend acting on your behalf) call `placeBet` on the game contract. Your collateral (USDC, WETH or $OVER) is pulled into the contract via `safeTransferFrom`. The contract validates your selection, checks the bet meets the `MIN_BET_USD` floor, and **reserves the worst-case payout liability** against its bankroll so the house can't oversell its book.

#### 2. The contract requests randomness from Chainlink VRF v2.5

The contract calls `vrfCoordinator.requestRandomWords(...)` with a configured key hash, subscription ID and callback gas limit. Your bet enters `PENDING` status, indexed by both an internal `betId` and the Chainlink `requestId`.

At this point, **the outcome of your bet does not exist anywhere.** Not on a server. Not in the contract. Not in some buffer waiting to be revealed. The randomness has not been generated yet.

#### 3. Chainlink fulfills the request

Chainlink's decentralized oracle network generates a cryptographically verifiable random number and calls back into the contract via `rawFulfillRandomWords`. This function is gated to the VRF coordinator address, no other caller, including Overtime, can fulfill a randomness request.

#### 4. The contract resolves the bet

Inside the same callback, the contract:

* Derives the game outcome from the random word using pure onchain logic (`randomWords[0] % 37` for roulette, weighted symbol sampling for slots, card draws for blackjack and baccarat, etc.)
* Marks the bet `RESOLVED` and emits a `BetResolved` event with the result
* Transfers the payout to the user immediately if they won
* Pays the referrer their share automatically if the user lost

#### 5. Everything is public

Every parameter, `houseEdge`, `maxProfitUsd`, supported collaterals, slot symbol weights, the configurable Banker payout in baccarat, is a public state variable. Every state transition emits a named event. Every step shows up on a block explorer.

#### And if a bet ever stalls

If Chainlink fulfillment fails for any reason, the contract has a `cancelTimeout` (minimum 30 seconds, configurable per game). After that timeout, **the user themselves** can call `cancelBet` and recover their full stake. The house cannot strand player funds. The escape hatch is enforced by code.

***

### What this means in practice

* **No operator can void a resolved win.** The function doesn't exist.
* **No operator can bias the RNG.** Chainlink VRF generates the randomness, not Overtime.
* **No operator can quietly inflate the house edge.** It's a public state variable, capped on-chain (`MAX_HOUSE_EDGE = 5%` on Dice and Slots).
* **No operator can hold up a withdrawal.** The payout transfer happens inside the same VRF callback that resolves the bet.
* **No operator can claw back a referral payout.** The referral fee is paid by the contract, in the same transaction, on every losing bet.

This is what "fully onchain" should mean. Not "the deposit is onchain and the rest is a centralized API." Not "trust us, our RNG is fair." The entire game lives in a contract you can read, simulate and verify.

***

### What you'll find in these docs

* **Game guides**: All guides, each with rules, payout tables, and a walkthrough of the user flow.
* **Become an Overtime Casino Affiliate**: how to generate a referral link and earn up to 20% of generated fees, paid directly by the contracts.
* **Integrate Overtime Casino**: developer guide for wiring the contracts into your own product, with notes for vibe coders and AI agents.

If you already have an Overtime account, you already have a casino account. Same wallet, same balance, same UX. Head to [**overtimemarkets.xyz/casino**](https://overtimemarkets.xyz/casino) and pick a game.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overtime.io/overtime-casino/introduction-to-overtime-casino.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
