# Mechanics

<img src="https://643316035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhHDpCdmrFTRkw7ggFgXw%2Fuploads%2FMkCsHpG7AsKwH5li3gUG%2FSUI%20FRENS%20FLIP%20HOME.png?alt=media&#x26;token=45da0595-2da6-4fa4-be3e-2f2a0df2326e" alt="SuiFrens x DeSuiLabs Coin Flip" width="563">

​

DeSui Coin Filp is a double or nothing smart contract with 50/50 odds of heads or tails.

A user bets on heads or tails. If they guess correctly, they win and the smart contract loses. A loss triggers the smart contract to send the user double their initial wager (minus [fees](/sui-coin-flip/fees.md)):

`User: bets 0.5 SUI on HEADS.`

`Smart contract: HEADS ✅`

`-> Smart Contract sends 1 SUI to user wallet`

If a user guesses incorrectly, the user receives nothing and the smart contract sends the  wager into the house balance. &#x20;

`User: bets 0.5 SUI on TAILS.`

`Smart contract: HEADS ❌`

`-> Smart Contract sends 0.5 SUI to house wallet`

​


---

# 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.desuilabs.io/sui-coin-flip/mechanics.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.
