Asset Prices
InTots provides REST endpoints for fetching current crypto asset prices and fiat currency exchange rates. These are used internally for crypto loop events and are available for display and conversion purposes.
Crypto Asset Priceβ
Get the current price for a crypto asset.
GET /api/v1/assets/{symbol}/price
Path Parametersβ
| Parameter | Type | Description |
|---|---|---|
symbol | string | The trading pair symbol (e.g. BTCUSDT, ETHUSDT, SOLUSDT). |
Responseβ
{
"symbol": "BTCUSDT",
"price": 8734521
}
| Field | Type | Description |
|---|---|---|
symbol | string | The requested trading pair symbol. |
price | integer | Current asset price in cents. |
Supported Assetsβ
Common symbols include:
| Symbol | Asset |
|---|---|
BTCUSDT | Bitcoin |
ETHUSDT | Ethereum |
SOLUSDT | Solana |
Additional trading pairs may be available. The symbol format follows the Bybit convention: the base asset followed by the quote currency (e.g. BTCUSDT = BTC priced in USDT).
Price Sourceβ
Asset prices are sourced from the Bybit API and updated frequently by a background worker. The REST endpoint returns the most recently cached price. For real-time streaming prices, use the WebSocket asset price feed.
Exampleβ
# Get current BTC price
curl "https://api.intots.com/api/v1/assets/BTCUSDT/price"
# Get current ETH price
curl "https://api.intots.com/api/v1/assets/ETHUSDT/price"
const res = await fetch('/api/v1/assets/BTCUSDT/price');
const data = await res.json();
console.log(`BTC: $${(data.price / 100).toFixed(2)}`);
// BTC: $87345.21
Currency Exchange Rateβ
Get the current exchange rate between two currencies.
GET /api/v1/currency/rate
Query Parametersβ
| Parameter | Type | Description |
|---|---|---|
from | string | Required. Source currency code (e.g. USD). |
to | string | Required. Target currency code (e.g. RUB). |
Responseβ
{
"from": "USD",
"to": "RUB",
"rate": 9250
}
| Field | Type | Description |
|---|---|---|
from | string | Source currency code. |
to | string | Target currency code. |
rate | integer | Exchange rate in cents. Divide by 100 for the decimal rate. |
Exampleβ
# Get USD to RUB exchange rate
curl "https://api.intots.com/api/v1/currency/rate?from=USD&to=RUB"
const res = await fetch('/api/v1/currency/rate?from=USD&to=RUB');
const data = await res.json();
const rate = data.rate / 100;
console.log(`1 USD = ${rate.toFixed(2)} RUB`);
// 1 USD = 92.50 RUB
How Prices Are Usedβ
Crypto Loop Eventsβ
Crypto loop events are prediction markets tied to short-term price movements of assets like BTC, ETH, and SOL. These events use the asset price endpoints to:
- Set opening and target prices when the event is created.
- Determine the outcome at resolution (did the asset hit the target?).
- Display the current reference price alongside the prediction market.
Display and Conversionβ
The currency rate endpoint is used across the platform to:
- Show equivalent values in the user's local currency.
- Power the P2P fiat exchange (RUB/USDT conversions).
- Provide reference rates for deposit and withdrawal flows.
Real-Time Alternativesβ
The REST endpoints return cached prices suitable for most display purposes. If you need real-time streaming updates, use the WebSocket feeds instead:
| Data | REST Endpoint | WebSocket Endpoint |
|---|---|---|
| Crypto asset price | GET /api/v1/assets/{symbol}/price | /api/v1/ws/assets/{symbol}/price |
The WebSocket feed delivers updates as soon as new prices arrive from Bybit, while the REST endpoint reflects the last cached value.
Tipsβ
- All prices are in cents. Divide by 100 to display as a decimal (e.g.
8734521=$87,345.21). - Exchange rates are also in cents. A rate of
9250means 92.50 units of the target currency per unit of the source currency. - Cache responses client-side for a few seconds to avoid unnecessary requests. The underlying data updates at a fixed interval on the server.
- Use WebSocket for live tickers. The REST endpoint is best for initial page loads; switch to WebSocket for continuous updates.