| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- 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 export_balance;
- pub mod export_ticker;
- pub mod hl_pr_utile;
- pub mod swap_bybit;
- 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_ticker1.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;
- }
- // if true {
- // 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条已经是最大值,但是有点币对交易量只有几百,但是有的可能好几千,这个需要酌情调整
- // //time_interval -数据请求的时间间隔 毫秒级
- // hl_pr_utile::export_ticker("WLD_USDT", "GATE", "10M", (1 * 60)).await;
- // }
- }
|