# Mechanics

![SuiFrens x DeSuiLabs Coin Flip](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\&token=45da0595-2da6-4fa4-be3e-2f2a0df2326e)

​

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](https://docs.desuilabs.io/sui-coin-flip/fees)):

`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`

​
