> For the complete documentation index, see [llms.txt](https://zeebit.gitbook.io/zeebit.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zeebit.gitbook.io/zeebit.io/technical-overview/how-bets-work.md).

# How Bets Work

<figure><img src="https://lh7-us.googleusercontent.com/cr9rfK3Xg_J5LQ4GztZNywwXIJPVQDf7KqvfXcU7PH-I53lMNDk62JQ-rLTSOEI8e62TWN8ymQ8oaPlnEqSNek0YVM1g2nymJn7U90YthBGFc1cYvNQqnBnmq1LvzDH5yx2CKnWeEFR0" alt=""><figcaption></figcaption></figure>

Here's the anatomy of a bet on Zeebit:

1. A player selects their bet inputs, sets their stake and hits the button.
2. Within milliseconds, their bet hits a node on the blockchain validator (Solana x MagicBlock or Sonic), which communicates this transaction for processing to the network.
3. The game’s contract will interpret the request, perform validations and convert the bet into a ‘Game Instance’ (for example, schedule that the roulette wheel is to be spun).
4. The player’s bets are each validated with respect to the rules of the game, and if everything's in order, the contract will "lock" balance — both the player's wager as well as the potential payout the pool may need to make. This ensures that both the player and the protocol have the necessary balances to honour their side of the bet, should the bet go in either direction.
5. A request is invoked from the game contract to the verifiable randomness (VRF) oracle, which emits events to listening provider nodes. These nodes immediately pick up the transaction emit, take the inputs and produce verifiable randomness which is submitted (alongside a proof) back to the randomness program.
6. The randomness program checks that everything is in order, and invokes a callback to the game program which uses the randomness to determine the result of the game, and subsequently assesses the result and payouts of the bets.
7. The game contract determines what funds should be released - either to the liquidity pool in the case of a loss, or paid out directly to the player’s wallet, in the case of a player's win.
8. …and all of this happens across thousands of validators in just a few milliseconds.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://zeebit.gitbook.io/zeebit.io/technical-overview/how-bets-work.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
