Skip to content

Market Data

Access orderbooks, prices, and market information.

Get Markets

typescript
// List all markets
const markets = await client.markets.getMarkets()

for (const market of markets) {
  console.log(`${market.symbol}: ${market.base_symbol}/${market.quote_symbol}`)
}

// Get specific market
const market = await client.markets.getMarket('BTC-USD')

Get Assets

typescript
// List all supported assets
const assets = await client.markets.getAssets()

for (const asset of assets) {
  console.log(`${asset.symbol}: ${asset.display_name}`)
  for (const token of asset.tokens) {
    console.log(`  - ${token.blockchain}`)
  }
}

Orderbook

typescript
// Get orderbook depth
const depth = await client.markets.getDepth('BTC-USD', 10)

console.log('Bids:', depth.bids)
console.log('Asks:', depth.asks)

// Get full orderbook data
const orderbook = await client.markets.getOrderBook('BTC-USD')

Ticker

typescript
// Get single ticker
const ticker = await client.markets.getTicker('BTC-USD')

console.log('Last:', ticker.last_price)
console.log('24h High:', ticker.high_24h)
console.log('24h Low:', ticker.low_24h)
console.log('24h Volume:', ticker.volume_24h)

// Get all tickers
const tickers = await client.markets.getTickers()

Trade History

typescript
// Get recent trades
const trades = await client.markets.getTradeHistory('BTC-USD', {
  limit: 50n,
})

for (const trade of trades) {
  console.log(`${trade.side} ${trade.quantity} @ ${trade.price}`)
}

K-Lines (Candlesticks)

typescript
// Get candlestick data
const klines = await client.markets.getKLines('BTC-USD', {
  interval: '1h',
  limit: 100,
})

for (const kline of klines) {
  console.log(`Open: ${kline.open}, Close: ${kline.close}`)
  console.log(`High: ${kline.high}, Low: ${kline.low}`)
}

Available Intervals:

IntervalDescription
'1m'1 minute
'5m'5 minutes
'15m'15 minutes
'1h'1 hour
'4h'4 hours
'1d'1 day
'1w'1 week

Market Metrics

typescript
const metrics = await client.markets.getMetrics('BTC-USD')

console.log('24h Volume:', metrics.volume_24h)
console.log('Trade Count:', metrics.trade_count_24h)

Spread

typescript
const spread = await client.markets.getSpread('BTC-USD')
console.log('Spread:', spread)

Public Queries

Most market data methods work without authentication:

typescript
const client = await VortumClient.create()

// These work before login
const markets = await client.markets.getMarkets()
const ticker = await client.markets.getTicker('BTC-USD')
const depth = await client.markets.getDepth('BTC-USD', 10)