coinglecko/derivatives
Cryptocurrency derivatives data.
Types
A derivative instrument.
pub type Derivative {
Derivative(
market: String,
symbol: String,
index_id: option.Option(String),
price: option.Option(Float),
price_percentage_change_24h: option.Option(Float),
contract_type: option.Option(String),
basis: option.Option(Float),
spread: option.Option(Float),
funding_rate: option.Option(Float),
open_interest: option.Option(Float),
volume_24h: option.Option(Float),
last_traded_at: option.Option(Int),
expired_at: option.Option(String),
)
}
Constructors
-
Derivative( market: String, symbol: String, index_id: option.Option(String), price: option.Option(Float), price_percentage_change_24h: option.Option(Float), contract_type: option.Option(String), basis: option.Option(Float), spread: option.Option(Float), funding_rate: option.Option(Float), open_interest: option.Option(Float), volume_24h: option.Option(Float), last_traded_at: option.Option(Int), expired_at: option.Option(String), )
A derivatives exchange with market data.
pub type DerivativesExchange {
DerivativesExchange(
id: String,
name: String,
open_interest_btc: option.Option(Float),
trade_volume_24h_btc: option.Option(Float),
number_of_perpetual_pairs: option.Option(Int),
number_of_futures_pairs: option.Option(Int),
year_established: option.Option(Int),
country: option.Option(String),
url: option.Option(String),
)
}
Constructors
-
DerivativesExchange( id: String, name: String, open_interest_btc: option.Option(Float), trade_volume_24h_btc: option.Option(Float), number_of_perpetual_pairs: option.Option(Int), number_of_futures_pairs: option.Option(Int), year_established: option.Option(Int), country: option.Option(String), url: option.Option(String), )
A simple derivatives exchange list item.
pub type DerivativesExchangeListItem {
DerivativesExchangeListItem(id: String, name: String)
}
Constructors
-
DerivativesExchangeListItem(id: String, name: String)
Values
pub fn decode_derivatives_exchange(
json_string: String,
) -> Result(DerivativesExchange, error.CoinGeckoError)
Decode a derivatives exchange detail response from a JSON string.
pub fn decode_derivatives_exchanges(
json_string: String,
) -> Result(List(DerivativesExchange), error.CoinGeckoError)
Decode a derivatives exchanges response from a JSON string.
pub fn decode_derivatives_exchanges_list(
json_string: String,
) -> Result(
List(DerivativesExchangeListItem),
error.CoinGeckoError,
)
Decode a derivatives exchanges list response from a JSON string.
pub fn decode_derivatives_list(
json_string: String,
) -> Result(List(Derivative), error.CoinGeckoError)
Decode a derivatives list response from a JSON string.
pub fn exchange_by_id(
client: client.Client,
id id: String,
include_tickers include_tickers: option.Option(String),
send sender: fn(request.Request(String)) -> Result(
response.Response(String),
String,
),
) -> Result(DerivativesExchange, error.CoinGeckoError)
Get a derivatives exchange by ID.
pub fn exchange_by_id_request(
client: client.Client,
id id: String,
include_tickers include_tickers: option.Option(String),
) -> Result(request.Request(String), error.CoinGeckoError)
Build a request to get a derivatives exchange by ID.
pub fn exchanges(
client: client.Client,
order order: option.Option(String),
per_page per_page: option.Option(Int),
page page: option.Option(Int),
send sender: fn(request.Request(String)) -> Result(
response.Response(String),
String,
),
) -> Result(List(DerivativesExchange), error.CoinGeckoError)
Get derivatives exchanges with market data.
pub fn exchanges_list(
client: client.Client,
send sender: fn(request.Request(String)) -> Result(
response.Response(String),
String,
),
) -> Result(
List(DerivativesExchangeListItem),
error.CoinGeckoError,
)
Get list of all derivatives exchanges (id and name only).
pub fn exchanges_list_request(
client: client.Client,
) -> Result(request.Request(String), error.CoinGeckoError)
Build a request to get list of all derivatives exchanges (id and name).
pub fn exchanges_request(
client: client.Client,
order order: option.Option(String),
per_page per_page: option.Option(Int),
page page: option.Option(Int),
) -> Result(request.Request(String), error.CoinGeckoError)
Build a request to get derivatives exchanges with market data.
pub fn list(
client: client.Client,
send sender: fn(request.Request(String)) -> Result(
response.Response(String),
String,
),
) -> Result(List(Derivative), error.CoinGeckoError)
Get list of all derivative tickers.
pub fn list_request(
client: client.Client,
) -> Result(request.Request(String), error.CoinGeckoError)
Build a request to get list of all derivative tickers.