Info
Amounts
Every amount and balance in this API is a JSON integer in units. No decimals, no floating point, no strings.
Units#
| Currency kind | Units per major unit |
|---|---|
| fiat | 10^3 = 1,000 |
| crypto | 10^8 = 100,000,000 |
So 1 USD is 1000 units and 1 BTC is 100000000 units. A currency's smallest amount (10^-8 of the coin in a crypto currency, a satoshi in BTC; a cent, a yen or won in a fiat currency) is always a whole number of units; in a crypto currency it is exactly one unit.
| Currency | Kind | Symbol | Decimals (held, shown and staked) | Units per major unit | Units per smallest amount |
|---|---|---|---|---|---|
USD | fiat | $ | 2 | 1,000 | 10 |
EUR | fiat | € | 2 | 1,000 | 10 |
BRL | fiat | R$ | 2 | 1,000 | 10 |
INR | fiat | ₹ | 2 | 1,000 | 10 |
TRY | fiat | ₺ | 2 | 1,000 | 10 |
UAH | fiat | ₴ | 2 | 1,000 | 10 |
CAD | fiat | CA$ | 2 | 1,000 | 10 |
MXN | fiat | MX$ | 2 | 1,000 | 10 |
JPY | fiat | ¥ | 0 | 1,000 | 1,000 |
KRW | fiat | ₩ | 0 | 1,000 | 1,000 |
BTC | crypto | ₿ | 8 | 100,000,000 | 1 |
ETH | crypto | Ξ | 8 | 100,000,000 | 1 |
LTC | crypto | Ł | 8 | 100,000,000 | 1 |
USDT | crypto | ₮ | 8 | 100,000,000 | 1 |
USDC | crypto | USDC | 8 | 100,000,000 | 1 |
TRX | crypto | TRX | 8 | 100,000,000 | 1 |
SOL | crypto | SOL | 8 | 100,000,000 | 1 |
DOGE | crypto | Ð | 8 | 100,000,000 | 1 |
XRP | crypto | XRP | 8 | 100,000,000 | 1 |
BNB | crypto | BNB | 8 | 100,000,000 | 1 |
TON | crypto | TON | 8 | 100,000,000 | 1 |
Crypto currencies#
In a crypto currency our amounts are the API's units: one unit is 10^-8 of the coin, our smallest amount. Nothing is converted or rounded between us and your wallet, in either direction. Your wallet must book 10^-8 of the coin exactly: a withdraw or a deposit of one unit moves the balance by exactly one unit (the scenario smallest-amount of the conformance suite checks it).
A wallet that keeps more decimals than 8 (ETH has 18, SOL 9) reports floor(balance × 10^8) units. The remainder below 10^-8 stays in your wallet: every amount we send is a whole number of units, so our calls never touch it.
Fiat currencies#
In a fiat currency our amounts are whole cents (whole yen and won in JPY and KRW): one cent is 10 units, one yen or won is 1,000 units. A balance you report with a third decimal is rounded down to the cent for display (see What you send). Stakes are whole cents. A win is rounded down to the cent: a 0.10 USD stake at 1.98× pays 0.19 USD, not 0.198.
So a winning round can lose less than one smallest amount (a cent, a yen or won) to rounding. Our default minimum bet is never below 100 smallest amounts (1.00 USD, EUR or CAD; 100 JPY), which keeps that loss under 1 % of the stake. A lower minimum bet can be set in our back office. Under the field it then says what it costs: "With this minimum bet, rounding to the smallest unit can cost a player up to N % of the stake on a winning round." N is 100 divided by the minimum in smallest amounts, rounded up to one decimal: 10 at a minimum of 0.10 USD.
Shown amounts#
The game shows a crypto amount with 8 decimals, trailing zeros kept (1.00000000 ₮), and a fiat amount with the decimals of its currency (2; none for JPY and KRW). A brand's display settings may show fewer decimals, or BTC in mBTC or µBTC: the shown figure is then rounded down, so the game never shows more than the player has.
Examples#
| Amount | Units |
|---|---|
| 5.32 USD | 5320 |
| 2500 JPY | 2500000 |
| 0.0532 BTC | 5320000 |
| 1.5 USDT | 150000000 |
What we send#
Amounts in our calls (withdraw, deposit, rollback) and in our free-bet answers are exact: the bet or win the round produced, converted without rounding. Move exactly that amount.
What you send#
| Value | How we read it |
|---|---|
balance, new_balance in your answers | For display only. A balance finer than the currency's smallest amount is rounded down for display, so the game never shows more than the player has. We never compute money from your balance: your wallet decides every withdraw. |
maxbet in your auth answer | The player's largest bet, rounded down to the currency's smallest amount. A cap below one smallest amount (1–9 units of a two-decimal currency) becomes 0, which refuses every bet. |
old_balance | Checked to be an integer; not used. |
bet_value of a free bet you add | Must be a whole number of smallest amounts. 1005 units of USD (1.005 USD) is refused with code 400; we never round a stake. |
| You send (units) | The player sees |
|---|---|
5321 USD | 5.32 USD |
-1 USD | -0.01 USD |
49992 USD | 49.99 USD |
How we read a unit value#
We read every unit value from its JSON text, never through a floating-point number. The text must be an integer, optionally followed by a fraction of zeros only (a client that types the field as a double may send 1000.0). Anything else is refused: in your answer it counts as a malformed answer, in your request it is code 400.
| JSON text | Read as |
|---|---|
1000 | accepted: 1000 |
1000.0 | accepted: 1000 |
-250 | accepted: -250 |
1000.5 | refused |
1e3 | refused |
"1000" | refused |
9007199254740993 | accepted: 9007199254740993 |
Amounts in the iframe messages are different: there they are a copy for your page in major units, as JSON numbers. See the iframe API.