|
|
@@ -1,6 +1,5 @@
|
|
|
use std::cmp::Ordering;
|
|
|
use std::str::FromStr;
|
|
|
-use chrono::Utc;
|
|
|
use rust_decimal::{Decimal};
|
|
|
use rust_decimal::prelude::FromPrimitive;
|
|
|
use rust_decimal_macros::dec;
|
|
|
@@ -150,7 +149,7 @@ impl HandleSwapInfo {
|
|
|
ExchangeEnum::GateSwap => {
|
|
|
depth_asks = gate_handle::format_depth_items(res_data_json["asks"].clone());
|
|
|
depth_bids = gate_handle::format_depth_items(res_data_json["bids"].clone());
|
|
|
- t = Decimal::from_i64(Utc::now().timestamp_micros()).unwrap();
|
|
|
+ t = Decimal::from_str(&res_data_json["t"].to_string()).unwrap();
|
|
|
}
|
|
|
ExchangeEnum::KucoinSwap => {
|
|
|
depth_asks = kucoin_handle::format_depth_items(res_data_json["asks"].clone());
|
|
|
@@ -165,12 +164,12 @@ impl HandleSwapInfo {
|
|
|
ExchangeEnum::OkxSwap => {
|
|
|
depth_asks = okx_handle::format_depth_items(res_data_json[0]["asks"].clone());
|
|
|
depth_bids = okx_handle::format_depth_items(res_data_json[0]["bids"].clone());
|
|
|
- t = Decimal::from_i64(Utc::now().timestamp_micros()).unwrap();
|
|
|
+ t = Decimal::from_str(&res_data_json["seqId"].to_string()).unwrap();
|
|
|
}
|
|
|
ExchangeEnum::BitgetSpot => {
|
|
|
depth_asks = bitget_spot_handle::format_depth_items(res_data_json[0]["asks"].clone());
|
|
|
depth_bids = bitget_spot_handle::format_depth_items(res_data_json[0]["bids"].clone());
|
|
|
- t = Decimal::from_i64(Utc::now().timestamp_micros()).unwrap();
|
|
|
+ t = Decimal::from_str(res_data_json["ts"].as_str().unwrap()).unwrap();
|
|
|
}
|
|
|
_ => {
|
|
|
error!("未找到该交易所!handle_special_depth: {:?}",exchange);
|