소스 검색

coinex修改频率限制和订单部分成交设置NEW

JiahengHe 1 년 전
부모
커밋
eaeb18d58b
4개의 변경된 파일7개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 1
      global/src/public_params.rs
  2. 2 2
      standard/src/coinex_swap.rs
  3. 1 1
      standard/src/coinex_swap_handle.rs
  4. 3 2
      strategy/src/coinex_usdt_swap.rs

+ 1 - 1
global/src/public_params.rs

@@ -25,7 +25,7 @@ pub const KUCOIN_USDT_SWAP_LIMIT:i64 = 7;
 pub const BINANCE_USDT_SWAP_LIMIT:i64 = 5;
 pub const BINANCE_SPOT_LIMIT:i64 = 2;
 pub const COINEX_SPOT_LIMIT:i64 = 20;
-pub const COINEX_USDT_SWAP_LIMIT:i64 = 20;
+pub const COINEX_USDT_SWAP_LIMIT:i64 = 30;
 pub const OKEX_USDT_SWAP_LIMIT:i64 = 30;
 pub const BITGET_USDT_SWAP_LIMIT:i64 = 10;
 pub const BITGET_USDT_SPOT_LIMIT:i64 = 100;

+ 2 - 2
standard/src/coinex_swap.rs

@@ -715,9 +715,9 @@ pub fn format_order_item(order: Value, ct_val: Decimal, status :&str) -> Order {
     if deal_amount != Decimal::ZERO{
         avg_price = filled_value/deal_amount;
     }
-    let custom_status = if status == "filled" || status == "part_canceled" || status == "canceled" {
+    let custom_status = if status == "filled" || status == "canceled" {
         "REMOVE".to_string()
-    } else if status == "open" {
+    } else if status == "open" || status == "part_filled" || status == "part_canceled" {
         "NEW".to_string()
     } else {
         error!("coinex_swap:格式化订单状态错误!\nformat_order_item:order={:?}", order);

+ 1 - 1
standard/src/coinex_swap_handle.rs

@@ -101,7 +101,7 @@ pub fn format_order_item(order: &Value, ct_val: Decimal, status: &str) -> Order
     }
     let amount = size * ct_val;
     let deal_amount = (size - left) * ct_val;
-    let custom_status = if status == "finish" { "REMOVE".to_string() } else if status == "put" { "NEW".to_string() } else {
+    let custom_status = if status == "finish" { "REMOVE".to_string() } else if status == "put" || status == "update" { "NEW".to_string() } else {
         "NULL".to_string()
     };
     let rst_order = Order {

+ 3 - 2
strategy/src/coinex_usdt_swap.rs

@@ -1,4 +1,4 @@
-use tracing::{error};
+use tracing::{error, info};
 use std::collections::BTreeMap;
 use std::sync::Arc;
 use std::sync::atomic::AtomicBool;
@@ -98,6 +98,7 @@ async fn on_data(core_arc_clone: Arc<Mutex<Core>>,
         }
         "order.update" => {
             trace_stack.set_source("coinex_swap.orders".to_string());
+            info!("coinex_usdt_swap 订单推送:{:?}", response.data);
             let orders = standard::handle_info::HandleSwapInfo::handle_order(CoinexSwap, response.clone(), multiplier.clone());
 
             let mut order_infos:Vec<OrderInfo> = Vec::new();
@@ -116,7 +117,7 @@ async fn on_data(core_arc_clone: Arc<Mutex<Core>>,
             }
         }
         "position.update" => {
-            // println!("coinex_usdt_swap 仓位推送:{:?}", response.data);
+            info!("coinex_usdt_swap 仓位推送:{:?}", response.data);
             let positions = standard::handle_info::HandleSwapInfo::handle_position(CoinexSwap, &response, multiplier);
             let mut core = core_arc_clone.lock().await;
             core.update_position(positions).await;