diff --git a/src/future/order.rs b/src/future/order.rs index 08bd648..9dcfcda 100644 --- a/src/future/order.rs +++ b/src/future/order.rs @@ -327,12 +327,23 @@ pub async fn monitoring_unfilled_order( Ok(()) } -// Cancel an NEW or PARTIALLY FILLED order. (/api, Weight(IP) 1) +// Cancel an LISTUP or NEW or PARTIALLY FILLED order. (/api, Weight(IP) 1) pub async fn cancel_open_positioning_order( order: &PositionCoinList, client: &Client, future_trade_fee: &FuturesTradeFee, ) -> Result<(), Box> { + if order.status.contains("LISTUP") { + let table_name = String::from("future_ordered_coin_list"); + let mut condition_build = String::from("WHERE id = "); + condition_build.push_str(order.id.to_string().as_str()); + condition_build.push_str(" AND symbol = \'"); + condition_build.push_str(&order.symbol); + condition_build.push('\''); + delete_record(&table_name, &condition_build).await; + return Ok(()); + } + // building URL and API-keys let mut url = String::new(); let mut api_key = String::new();