Skip to contents

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.

Value

An <[xts]>-object containing,

index

<POSIXct> The time-index

marketcap

<numeric> Market capitalization

volume

<numeric> Trading volume

Details

On time-zones and dates

Values passed to from`` or tomust 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.

See also

Author

Serkan Korkmaz

Examples

if (FALSE) { # \dontrun{
  # 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;
} # }