Bot now takes a vec of pairs directly

This commit is contained in:
Giulio De Pasquale 2021-03-02 17:16:27 +00:00
parent 78b5b4d0f7
commit fbe445f712

View File

@ -20,18 +20,12 @@ impl BfxBot {
// TODO: change constructor to take SymbolPairs and not Symbol
pub fn new(
exchanges: Vec<ExchangeDetails>,
trading_symbols: Vec<Symbol>,
quote: Symbol,
trading_pairs: Vec<SymbolPair>,
tick_duration: Duration,
) -> Self {
let pairs: Vec<_> = trading_symbols
.iter()
.map(|x| SymbolPair::new(quote.clone(), x.clone()))
.collect();
let exchange_managers = exchanges
.iter()
.map(|x| ExchangeManager::new(x, &pairs))
.map(|x| ExchangeManager::new(x, &trading_pairs))
.collect();
BfxBot {