Originals EngineOperator API

Info

Amounts

Every amount and balance in this API is a JSON integer in units. No decimals, no floating point, no strings.

Units#

One major unit in units
Currency kindUnits per major unit
fiat10^3 = 1,000
crypto10^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.

Units per currency
CurrencyKindSymbolDecimals (held, shown and staked)Units per major unitUnits per smallest amount
USDfiat$21,00010
EURfiat€21,00010
BRLfiatR$21,00010
INRfiat₹21,00010
TRYfiat₺21,00010
UAHfiat₴21,00010
CADfiatCA$21,00010
MXNfiatMX$21,00010
JPYfiat¥01,0001,000
KRWfiat₩01,0001,000
BTCcrypto₿8100,000,0001
ETHcryptoΞ8100,000,0001
LTCcryptoŁ8100,000,0001
USDTcrypto₮8100,000,0001
USDCcryptoUSDC8100,000,0001
TRXcryptoTRX8100,000,0001
SOLcryptoSOL8100,000,0001
DOGEcryptoÐ8100,000,0001
XRPcryptoXRP8100,000,0001
BNBcryptoBNB8100,000,0001
TONcryptoTON8100,000,0001

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#

Amounts in units
AmountUnits
5.32 USD5320
2500 JPY2500000
0.0532 BTC5320000
1.5 USDT150000000

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#

Amounts you send us, and how we use them
ValueHow we read it
balance, new_balance in your answersFor 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 answerThe 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_balanceChecked to be an integer; not used.
bet_value of a free bet you addMust be a whole number of smallest amounts. 1005 units of USD (1.005 USD) is refused with code 400; we never round a stake.
Balances you report, as the game shows them
You send (units)The player sees
5321 USD5.32 USD
-1 USD-0.01 USD
49992 USD49.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.

Unit literals
JSON textRead as
1000accepted: 1000
1000.0accepted: 1000
-250accepted: -250
1000.5refused
1e3refused
"1000"refused
9007199254740993accepted: 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.