Skip to main content

Money Format

All monetary values in Intotes are stored and transmitted as integers in cents (kopecks for RUB). This eliminates floating-point precision errors in financial calculations.

Basic Rules​

WhatFormatExample
Balance, amountsCents (kopecks)10000 = 100.00 RUB
Market prices0–100007500 = 75.00% probability
Share quantitiesCents50000 = 500.00 shares
P2P exchange ratesCents per unit100000 = 1000.00 RUB per USDT

Price Format (0–10000)​

Market prices represent probability as an integer:

PriceProbabilityMeaning
00.00%Impossible
250025.00%Unlikely
500050.00%Even odds
750075.00%Likely
10000100.00%Certain

The YES and NO prices always sum to 10000. If YES is at 7500 (75%), then NO is at 2500 (25%).

Amount Semantics​

The meaning of amount depends on the order type:

ActionAmount RepresentsExample
BUY orderBudget in cents (how much to spend)100000 = spend 1000.00 RUB
SELL orderShares in cents (how many to sell)50000 = sell 500.00 shares
LMSR trade (spend)Budget in cents100000 = spend 1000.00 RUB
LMSR trade (shares)Share quantity in cents50000 = buy/sell 500.00 shares

Share Conversion​

To convert between budget and shares:

shares_cents = (budget_cents * 10000) / price_cents
budget_cents = (shares_cents * price_cents) / 10000

Example: Buy at price 2500 (25%) with budget 100000 (1000.00 RUB):

shares = (100000 * 10000) / 2500 = 400000 (4000.00 shares)

P2P Exchange Rate​

For P2P ads, exchange_rate is in cents per unit:

fiat_amount_cents = (usdt_amount_cents * exchange_rate) / 10000

Example: 100.00 USDT at rate 1000.00 RUB/USDT:

usdt_amount = 10000 (100.00 USDT)
exchange_rate = 100000 (1000.00 RUB per USDT)
fiat_amount = (10000 * 100000) / 10000 = 100000 (1000.00 RUB)

Display Formatting​

To display a cents value to users:

// JavaScript
const displayValue = (cents / 100).toFixed(2); // 10000 β†’ "100.00"

// Price to percentage
const probability = (price / 100).toFixed(2) + '%'; // 7500 β†’ "75.00%"
// Go
display := fmt.Sprintf("%.2f", float64(cents)/100) // 10000 β†’ "100.00"

Important Notes​

  • Never use floating-point for monetary calculations β€” always work with integer cents
  • All API requests and responses use the cents format
  • Timestamps use RFC3339 format: 2024-01-15T10:30:00Z