Skip to main content

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​

ParameterTypeDescription
symbolstringThe trading pair symbol (e.g. BTCUSDT, ETHUSDT, SOLUSDT).

Response​

{
"symbol": "BTCUSDT",
"price": 8734521
}
FieldTypeDescription
symbolstringThe requested trading pair symbol.
priceintegerCurrent asset price in cents.

Supported Assets​

Common symbols include:

SymbolAsset
BTCUSDTBitcoin
ETHUSDTEthereum
SOLUSDTSolana

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​

ParameterTypeDescription
fromstringRequired. Source currency code (e.g. USD).
tostringRequired. Target currency code (e.g. RUB).

Response​

{
"from": "USD",
"to": "RUB",
"rate": 9250
}
FieldTypeDescription
fromstringSource currency code.
tostringTarget currency code.
rateintegerExchange 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:

DataREST EndpointWebSocket Endpoint
Crypto asset priceGET /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 9250 means 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.