# Single Bet

This chapter provides a detailed introduction to MemeDice's betting process, win/loss determination, and strategy.

***

## Betting Process

```mermaid
flowchart TD
    A[Choose direction: Bet Big/Bet Small] --> B[Set win rate 10%-90%]
    B --> C[Enter bet amount]
    C --> D{First bet?}
    D -->|Yes| E[Approve token authorization]
    E --> F[Click Bet]
    D -->|No| F
    F --> G{Random number mode}
    G -->|Prevrandao| H[Result appears immediately after transaction confirmation]
    G -->|Oracle| I[Wait for oracle callback]
    I --> J[Result appears]
    H --> J
    J --> K{Win/Loss determination}
    K -->|Win| L[Receive reward 🎉]
    K -->|Lose| M[Lose bet amount 😢]
```

***

## Step 1: Choose direction

The game interface has two large buttons:

| Button          | Meaning                                                              | Color |
| --------------- | -------------------------------------------------------------------- | ----- |
| **▼ Bet Small** | Bet that the random number is less than the threshold                | Blue  |
| **▲ Bet Big**   | Bet that the random number is greater than or equal to the threshold | Red   |

<figure><img src="/files/1c19460acce34632925bcf88ff8b3102da103608" alt=""><figcaption></figcaption></figure>

***

## Step 2: Set win rate

Drag the win rate slider, range 10% - 90%.

* **The higher the win rate** → The lower the odds → Higher chance to win but smaller winnings
* **The lower the win rate** → The higher the odds → Lower chance to win but bigger winnings

The interface will display in real time:

* **Win rate**: The currently set win rate percentage
* **Odds**: 100 / win rate, for example 50% win rate = 2.00x odds
* **Winning profit**: If you win, how much profit you can get
* **Winning condition**: The condition the random number must satisfy

### Winning condition example

Assume the win rate is set to 50% (threshold = 5000):

| Direction | Winning condition    | Random number range |
| --------- | -------------------- | ------------------- |
| Bet big   | Random number ≥ 5000 | 5000 - 9999         |
| Bet Small | Random number < 5000 | 0 - 4999            |

<figure><img src="/files/f56528810985a505a5b84ca9dc150d984dd522de" alt=""><figcaption></figcaption></figure>

***

## Step 3: Enter bet amount

Enter the amount of tokens you want to bet in the amount input box.

The interface will show your current token balance for reference.

{% hint style="info" %}
The bet amount must be within the game's preset minimum and maximum betting range.
{% endhint %}

***

## Step 4: Approve token authorization

If this is your first time betting in this game, you need to authorize the game contract to use your tokens first.

1. Click the yellow **"Approve XXX"** Button
2. Confirm the authorization transaction in MetaMask
3. Wait for the transaction to confirm
4. After authorization succeeds, the button turns purple **"Bet"** Button

{% hint style="info" %}
Approve only needs to be done once. After authorization, subsequent bets do not need to be approved again.
{% endhint %}

***

## Step 5: Click Bet

Click the **"🎲 Bet"** button and wait for the result.

### Prevrandao mode (synchronous)

The result appears immediately after transaction confirmation; the whole process is completed in a single transaction.

### Oracle mode (asynchronous)

1. After the transaction is submitted, the interface shows **"Waiting for oracle result..."**
2. The oracle service generates a random number and calls back the contract (usually within a few seconds)
3. Once the result is out, the interface updates automatically

<figure><img src="/files/ccdd582dd5e81c82798170132807aeb701ffb34f" alt=""><figcaption></figcaption></figure>

***

## View result

The betting result will be shown on the right in the **"Recent Results"** panel, including:

| Information            | Description                                                 |
| ---------------------- | ----------------------------------------------------------- |
| **Win/Loss**           | Green means win, red means lose                             |
| **Profit/Loss amount** | Win shows +amount, loss shows -amount                       |
| **Win rate**           | The win rate setting for this bet                           |
| **Odds**               | The odds for this bet                                       |
| **Bet amount**         | The amount of this bet                                      |
| **Direction**          | Bet big or bet small                                        |
| **Random number**      | The generated random number (0-9999)                        |
| **Result direction**   | Big/Small corresponding to the random number                |
| **transaction hash**   | On-chain transaction hash (copyable)                        |
| **Commit Hash**        | Commit hash in Oracle mode (can be used to verify fairness) |

<figure><img src="/files/0e49d7083e78b4b9806b568a65bac0543d9b6d80" alt=""><figcaption></figcaption></figure>

***

## Fee Explanation

Each bet will incur two types of fees:

| Fee              | Description                                            |
| ---------------- | ------------------------------------------------------ |
| **Platform fee** | Service fee charged by the platform (usually very low) |
| **Owner fee**    | Fee rate set by the game creator (0-9%)                |

The fee is deducted from the bet amount, and the remaining part is the effective bet amount. The odds are calculated based on the effective bet amount.

{% hint style="info" %}
Oracle mode also requires a small amount of native token (such as BNB) to pay for oracle service fees.
{% endhint %}

***

## Pool information

The top of the game page shows the current pool information:

* **Pool balance**: The total amount of tokens currently in the pool
* **Your balance**: The balance of this token in your wallet
* **Owner fee rate**: The current game's owner fee rate
* **Randomness Mode**: Oracle or Prevrandao

{% hint style="warning" %}
**Important**: Your maximum possible winnings are limited by the pool balance. If the pool is not enough to pay your potential reward, the bet may fail.
{% endhint %}


---

# 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.dapp.meme/dapp.meme-en/play-games/single-bet.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.
