get_mktcap: Get the global market capitalization

View source: R/get_mcap.R

get_mktcapR Documentation

Get the global market capitalization

Description

The get_mktcap()-functions returns the global cryptocurrency market capitalization.

Usage

get_mktcap(
  interval = "1d",
  from = NULL,
  to = NULL,
  altcoin = FALSE,
  reported = FALSE
)

Arguments

interval

A character-vector of length 1. ⁠1d⁠ by default. See available_intervals() for available intervals.

from

An optional character-, date- or POSIXct-vector of length 1. NULL by default.

to

An optional character-, date- or POSIXct-vector of length 1. NULL by default.

altcoin

A logical-vector of length 1. FALSE by default. Returns altcoin market capitalization if TRUE

reported

A logical-vector of length 1. FALSE by default. Returns reported volume if TRUE.

Details

On time-zones and dates

Values passed to ⁠from`` or ⁠to⁠must be coercible by [as.Date()], or [as.POSIXct()], with a format of either⁠"%Y-%m-%d"or"%Y-%m-%d %H:%M:%S"'. By default all dates are passed and returned with Sys.timezone().

On returns

If only from is provided 200 pips are returned up to Sys.time(). If only to is provided 200 pips up to the specified date is returned.

Value

An <[xts]>-object containing,

index

<POSIXct> The time-index

marketcap

<numeric> Market capitalization

volume

<numeric> Trading volume

Author(s)

Serkan Korkmaz

See Also

Other get-functions: get_fgindex(), get_fundingrate(), get_lsratio(), get_openinterest()

Examples

## Not run: 
  # script start;

  # get quote on
  # BTCUSDT pair from
  # Binance in 30m
  # intervals from the
  # last 24 hours
  tail(
    BTC <- cryptoQuotes::get_quote(
      ticker   = 'BTCUSDT',
      source   = 'binance',
      interval = '30m',
      futures  = FALSE,
      from     = Sys.Date() - 1
    )
  )

  # script end;

## End(Not run)

cryptoQuotes documentation built on Sept. 16, 2025, 1:09 a.m.