Module datamaxi::cex

source ·
Expand description

CEX-related data fetcher and data structures.

This module provides functionality related to centralized exchange (CEX) data. It includes data structures and methods for retrieving candle data, as well as information about supported exchanges, symbols and intervals.

§Usage

The Candle struct is the primary interface for interacting with the CEX data. It provides methods for retrieving data with optional parameters to filter and sort the results.

§Example

let config = datamaxi::api::Config {
    base_url: None,
    api_key: "my_api_key".to_string(),
};
let client = datamaxi::api::Client::new(config);
let candle = datamaxi::cex::Candle { client: client.clone() };

// Retrieve supported exchanges
let exchanges = candle.exchanges("spot");

// Retrieve supported intervals
let intervals = candle.intervals();

// Retrieve supported Binance symbols
let symbols_options = datamaxi::cex::SymbolsOptions::new();
let symbols = candle.symbols("binance", symbols_options);

// Retrieve candle data
let candle_options = datamaxi::cex::CandleOptions::new().interval("1h").market("spot");
let candle_data = candle.get("binance", "BTC-USDT", candle_options);

§Error Handling

All methods return a Result type, which should be handled appropriately to manage potential errors.

Re-exports§

Structs§

  • Provides methods for retrieving CEX candle data and related information.