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β
| What | Format | Example |
|---|---|---|
| Balance, amounts | Cents (kopecks) | 10000 = 100.00 RUB |
| Market prices | 0β10000 | 7500 = 75.00% probability |
| Share quantities | Cents | 50000 = 500.00 shares |
| P2P exchange rates | Cents per unit | 100000 = 1000.00 RUB per USDT |
Price Format (0β10000)β
Market prices represent probability as an integer:
| Price | Probability | Meaning |
|---|---|---|
0 | 0.00% | Impossible |
2500 | 25.00% | Unlikely |
5000 | 50.00% | Even odds |
7500 | 75.00% | Likely |
10000 | 100.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:
| Action | Amount Represents | Example |
|---|---|---|
| BUY order | Budget in cents (how much to spend) | 100000 = spend 1000.00 RUB |
| SELL order | Shares in cents (how many to sell) | 50000 = sell 500.00 shares |
| LMSR trade (spend) | Budget in cents | 100000 = spend 1000.00 RUB |
| LMSR trade (shares) | Share quantity in cents | 50000 = 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