| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- use tracing::info;
- use crate::utils::logs;
- use crate::utils::utils::{BalanceConfigInfo, TickerConfigInfo};
- pub mod swap_binance;
- pub mod swap_gate;
- pub mod swap_okx;
- pub mod robot_data;
- pub mod utils;
- pub mod http;
- pub mod struct_standard;
- pub mod export_template;
- pub mod handle_ticker;
- pub mod export_balance;
- pub mod export_ticker;
- mod hl_pr_utile;
- struct ConfigList {
- ticker_info: TickerConfigInfo,
- balance_info: BalanceConfigInfo,
- }
- #[tokio::main]
- async fn main() {
- logs::init_log_with_info();
- let ticker_config = utils::utils::get_ticker_config_info("./config_ticker.toml");
- let balance_config = utils::utils::get_balance_config_info("./config_balance.toml");
- let config_obj = ConfigList {
- ticker_info: ticker_config,
- balance_info: balance_config,
- };
- // if config_obj.ticker_info.is_export {
- // info!("----------正在导出Ticker信息----------");
- // let config_clone = config_obj.ticker_info.clone();
- // if http::proxy::ParsingDetail::http_enable_proxy(config_clone.proxy_address.clone()) {
- // info!("检测有代理配置,配置走代理");
- // }
- // export_ticker::export_ticker(config_clone).await;
- // }
- // if config_obj.balance_info.is_export {
- // info!("----------正在导出Balance信息----------");
- // let config_clone = config_obj.balance_info.clone();
- // if http::proxy::ParsingDetail::http_enable_proxy(config_clone.proxy_address.clone()) {
- // info!("检测有代理配置,配置走代理");
- // }
- // export_balance::export_balance(config_clone).await;
- // }
- //根据帧 来查看数据,规则:根据当前币对选择 时间范围,的秒级 ticker 数量
- if config_obj.ticker_info.is_export {
- info!("----------正在导出Ticker信息----------");
- let config_clone = config_obj.ticker_info.clone();
- if http::proxy::ParsingDetail::http_enable_proxy(config_clone.proxy_address.clone()) {
- info!("检测有代理配置,配置走代理");
- }
- // "10M" => (1000 * 60 * 10),
- // "20M" => (1000 * 60 * 20),
- // "30M" => (1000 * 60 * 30),
- // "1H" => (1000 * 60 * 60 * 1),
- // "10H" => (1000 * 60 * 60 * 10),
- // "1D" => (1000 * 60 * 60 * 24),
- // "2D" => (1000 * 60 * 60 * 24 * 2),
- // "3D" => (1000 * 60 * 60 * 24 * 3),
- // "5D" => (1000 * 60 * 60 * 24 * 5),
- // "1Z" => (1000 * 60 * 60 * 24 * 7),
- // "2Z" => (1000 * 60 * 60 * 24 * 7 * 2),
- // "4Z" => (1000 * 60 * 60 * 24 * 7 * 4),
- // 提示: 1. 代码颗粒度为秒级,100毫秒与999毫秒都归纳于1秒之内,
- // 2. 不同币对成交量可能存在差异,当前查询是1000条已经是最大值,但是有点币对交易量只有几百,但是有的可能好几千,这个需要酌情调整
- hl_pr_utile::export_ticker("XRP_USDT","GATE","30M").await;
- }
- }
|