|
|
@@ -419,7 +419,6 @@ fn parse_order_item(order: &serde_json::Value, amount_size: Decimal) -> Order {
|
|
|
let custom_id = text.replace("t-my-custom-id_", "");
|
|
|
let amount = size * amount_size;
|
|
|
let deal_amount = (amount - left) * amount_size;
|
|
|
- let avg_price = fill_price / deal_amount;
|
|
|
let custom_status = if "finished" == status { "REMOVE".to_string() } else if status == "open" { "NEW".to_string() } else { "OTHER".to_string() };
|
|
|
Order {
|
|
|
id: order["id"].to_string(),
|
|
|
@@ -427,7 +426,7 @@ fn parse_order_item(order: &serde_json::Value, amount_size: Decimal) -> Order {
|
|
|
price: order["price"].as_str().unwrap_or("0").parse().unwrap_or(dec!(0)),
|
|
|
amount: order["size"].to_string().parse().unwrap_or(dec!(0)),
|
|
|
deal_amount,
|
|
|
- avg_price,
|
|
|
+ avg_price: fill_price,
|
|
|
status: custom_status,
|
|
|
order_type: "limit".to_string(),
|
|
|
}
|