Helius
2021-03-17 29409885ad41a3033c091de365213a6f7d8fd92c
src/main/java/com/xcong/excoin/modules/contract/service/impl/RabbitOrderServiceImpl.java
@@ -302,6 +302,7 @@
            }
            log.info("profitOrLoss:{}", profitOrLoss);
            BigDecimal rewardRatio = profitOrLoss.divide(holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getOpeningFeeAmount()), 4, BigDecimal.ROUND_DOWN);
            // 保证金
            BigDecimal bondAmount = CalculateUtil.getBondAmount(holdOrderEntity.getOpeningPrice(), lotNumber, closeCnt, holdOrderEntity.getLeverRatio());
@@ -323,6 +324,7 @@
            contractOrderEntity.setClosingType(closingType);
            contractOrderEntity.setSymbolCnt(closeCnt);
            contractOrderEntity.setRewardAmount(profitOrLoss);
            contractOrderEntity.setRewardRatio(rewardRatio);
            contractOrderEntity.setBondAmount(bondAmount.add(fee));
            contractOrderEntity.setClosingFeeAmount(fee);
            contractOrderEntity.setClosingTime(new Date());
@@ -445,6 +447,7 @@
        contractOrderEntity.setEntrustOpeningPrice(newPrice);
        contractOrderEntity.setEntrustTime(new Date());
        contractOrderEntity.setClosingPrice(newPrice);
        contractOrderEntity.setTradeType(ContractOrderEntity.TRADE_TYPE_LIMIT_PRICE);
        contractOrderEntity.setOrderType(entrustOrder.getEntrustType());
        contractOrderEntity.setClosingType(closingType);
        contractOrderEntity.setSymbolCnt(closeCnt);