getSpreads {KrakenR}R Documentation

Retrieve Recent Spreads Data from Kraken Exchange

Description

This function fetches recent spread data from the Kraken API for a specified trading pair.

Usage

getSpreads(pair, since = NULL, timestamp = FALSE)

Arguments

pair

A character string specifying the trading pair (e.g., "XTZUSD", "ADAEUR"). This is a required parameter.

since

A character string for a human-readable date-time (e.g., "2024-10-01 12:00:00") or a Unix timestamp. Default is NULL.

timestamp

A logical value. If TRUE, the function returns both the spreads data frame and the last timestamp for future polling. If FALSE (default), it returns only the data frame.

Value

A data frame containing the spread data or a list containing the data frame and the last timestamp.

Examples

getSpreads("XTZUSD")
getSpreads("ADAEUR", since = "2024-10-01 00:00:00", timestamp = TRUE)

[Package KrakenR version 1.0.0 Index]