|
|
@@ -1,7 +1,8 @@
|
|
|
-use tracing::{error};
|
|
|
+use tracing::{error, info};
|
|
|
use std::collections::BTreeMap;
|
|
|
use std::sync::Arc;
|
|
|
use std::sync::atomic::AtomicBool;
|
|
|
+use futures_util::future::err;
|
|
|
use rust_decimal::Decimal;
|
|
|
use tokio::spawn;
|
|
|
use tokio::sync::Mutex;
|
|
|
@@ -98,6 +99,7 @@ async fn on_data(core_arc_clone: Arc<Mutex<Core>>,
|
|
|
}
|
|
|
"order.update" => {
|
|
|
trace_stack.set_source("coinex_swap.orders".to_string());
|
|
|
+ info!("订单推送: {}", response.data);
|
|
|
let orders = standard::handle_info::HandleSwapInfo::handle_order(CoinexSwap, response.clone(), multiplier.clone());
|
|
|
let mut order_infos:Vec<OrderInfo> = Vec::new();
|
|
|
for mut order in orders.order {
|
|
|
@@ -132,6 +134,8 @@ async fn on_data(core_arc_clone: Arc<Mutex<Core>>,
|
|
|
if new_order.status != "REMOVE" || new_order.filled == Decimal::ZERO {
|
|
|
core.update_order(order_infos, trace_stack).await;
|
|
|
return
|
|
|
+ } else {
|
|
|
+ error!("不做操作的订单: {:?}", new_order);
|
|
|
}
|
|
|
|
|
|
// 单向持仓的处理
|