Bot now takes a vec of pairs directly
This commit is contained in:
		
							parent
							
								
									78b5b4d0f7
								
							
						
					
					
						commit
						fbe445f712
					
				
							
								
								
									
										10
									
								
								src/bot.rs
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/bot.rs
									
									
									
									
									
								
							| @ -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 { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user