Skip to content
Velo

Fetch Market Caps

Use the marketCaps namespace to fetch market caps for coins.

const velo = new Velo({ apiKey: process.env.VELO_API_KEY! });
const caps = await velo.query(
  marketCaps.history({ coins: ['BTC', 'ETH'] }),
);
 
for (const marketCap of caps) {
  console.log(marketCap.coin, marketCap.circ_dollars);
}

coins must be a non-empty array.

Result type

velo.query() resolves to a MarketCap[]. For example:

[
  {
    "coin": "BTC",
    "time": 1783513513252,
    "circ": 20053612,
    "circ_dollars": 1248112746545.6,
    "fdv": 20053612,
    "fdv_dollars": 1248112746545.6
  }
]

Each item uses the exported MarketCap type:

interface MarketCap {
  coin: string;
  time: number;
  circ: number | null;
  circ_dollars: number | null;
  fdv: number | null;
  fdv_dollars: number | null;
}
FieldDescription
coinVelo's normalized coin symbol
timeSnapshot time, as a Unix timestamp in milliseconds
circCirculating supply
circ_dollarsCirculating market capitalization in dollars
fdvFully diluted supply
fdv_dollarsFully diluted valuation in dollars

Supply and valuation fields may be null when a value is unavailable.