1
zj
2025-05-25 a0295049dfce83691dccab5d33992a368e78bc48
src/main/java/project/project/web/api/ContractOrderController.java
@@ -1,4 +1,4 @@
package project.project.web.api;
package project.web.api;
import java.io.IOException;
import java.text.DecimalFormat;
@@ -216,25 +216,25 @@
            if (map.get("direction") != null) {
               String direction = map.get("direction").toString();
               double liquidationPrice;
               double deposit = depositOpen + profit;
               double deposit =  profit;
               if(leverRate == 1){
                  liquidationPrice = 0;
               }else {
                  if ("sell".equals(direction)) {
                     liquidationPrice = tradeAvgPrice + (deposit / div);
                     double lossPercentage = deposit / Double.parseDouble(map.get("amount").toString());
                     double priceIncrease = lossPercentage * tradeAvgPrice;
                     liquidationPrice = tradeAvgPrice + priceIncrease;
                  } else {
                     liquidationPrice = (mul * tradeAvgPrice) / (deposit + mul);
                     double lossPercentage = deposit / Double.parseDouble(map.get("amount").toString());
                     double priceDrop = lossPercentage * tradeAvgPrice;
                     liquidationPrice = tradeAvgPrice - priceDrop;
                  }
               }
               DecimalFormat dfs = new DecimalFormat("#.#####");
               String formattedPrice = dfs.format(liquidationPrice);
               map.put("qiangPing", formattedPrice);
            }
            // 标记价格
            Realtime realtime = realtimeMap.get(map.get("symbol"));
            if (null == realtime) {