|
|
@@ -934,6 +934,7 @@ pub async fn run_transaction(quant_arc: Arc<Mutex<Quant>>, name: String, symbols
|
|
|
loop {
|
|
|
match rx.recv().await {
|
|
|
Some(data) => {
|
|
|
+ info!(?data);
|
|
|
if data.code == "200" {
|
|
|
if data.channel == "futures.order_book" {
|
|
|
let depth = standard::gate_handle::handle_special_depth(data);
|
|
|
@@ -992,13 +993,14 @@ pub async fn run_transaction(quant_arc: Arc<Mutex<Quant>>, name: String, symbols
|
|
|
min_sell = Decimal::ZERO;
|
|
|
quant.is_update.remove(str.as_str());
|
|
|
}
|
|
|
- let trade: OriginalTradeGa = serde_json::from_str(data.data.as_str()).unwrap();
|
|
|
-
|
|
|
- if trade.price > max_buy || max_buy == Decimal::ZERO{
|
|
|
- max_buy = trade.price
|
|
|
- }
|
|
|
- if trade.price < min_sell || min_sell == Decimal::ZERO{
|
|
|
- min_sell = trade.price
|
|
|
+ let trades: Vec<OriginalTradeGa> = serde_json::from_str(data.data.as_str()).unwrap();
|
|
|
+ for trade in trades {
|
|
|
+ if trade.price > max_buy || max_buy == Decimal::ZERO{
|
|
|
+ max_buy = trade.price
|
|
|
+ }
|
|
|
+ if trade.price < min_sell || min_sell == Decimal::ZERO{
|
|
|
+ min_sell = trade.price
|
|
|
+ }
|
|
|
}
|
|
|
quant.max_buy_min_sell_cache.insert(data.lable, vec![max_buy, min_sell]);
|
|
|
}
|