#![feature(drain_filter)] use std::thread::JoinHandle; use tokio::time::{delay_for, Duration}; use crate::bot::BfxBot; use crate::connectors::{BitfinexConnector, ExchangeKind}; use crate::currency::{Symbol, SymbolPair}; use crate::events::SignalKind; mod bot; mod connectors; mod currency; mod events; mod managers; mod models; mod strategy; mod ticker; pub type BoxError = Box; #[tokio::main] async fn main() -> Result<(), BoxError> { let test_api_key = "P1EVE68DJByDAkGQvpIkTwfrbYXd2Vo2ZaIhTYb9vx2"; let test_api_secret = "1nicg8z0zKVEt5Rb7ZDpIYjVYVTgvCaCPMZqB0niFli"; let affiliate_code = "XPebOgHxA"; let bitfinex = ExchangeKind::Bitfinex { api_key: test_api_key.into(), api_secret: test_api_secret.into(), affiliate_code: Some(affiliate_code.into()), }; let mut bot = BfxBot::new( vec![bitfinex], vec![Symbol::TESTBTC], Symbol::TESTUSD, Duration::new(1, 0), ); Ok(bot.start_loop().await?) }