| | |
| | | // canAddMaxBond = BigDecimal.ZERO; |
| | | // } |
| | | BigDecimal canReduceMaxBond = holdOrderEntity.getBondAmount().subtract(holdOrderEntity.getPrePaymentAmount()); |
| | | |
| | | if (rewardRatio.compareTo(BigDecimal.ZERO) < 0) { |
| | | canReduceMaxBond = canReduceMaxBond.add(rewardRatio); |
| | | } |
| | | |
| | | if (canReduceMaxBond.compareTo(BigDecimal.ZERO) < 0) { |
| | | canReduceMaxBond = BigDecimal.ZERO; |
| | | } |
| | |
| | | // 权益 |
| | | BigDecimal equity = walletContractEntity.getTotalBalance().add(totalProfitOrLess); |
| | | // 全仓模式,可用余额需随着盈亏变动 |
| | | if (memberEntity.getContractPositionType() == ContractEntrustOrderEntity.POSITION_TYPE_ALL) { |
| | | BigDecimal available = walletContractEntity.getAvailableBalance().add(totalProfitOrLess); |
| | | if (available.compareTo(BigDecimal.ZERO) < 0) { |
| | | available = BigDecimal.ZERO; |
| | | } |
| | | contractMoneyInfoVo.setAvailableBalance(available); |
| | | } |
| | | // if (memberEntity.getContractPositionType() == ContractEntrustOrderEntity.POSITION_TYPE_ALL) { |
| | | // BigDecimal available = walletContractEntity.getAvailableBalance().add(totalProfitOrLess); |
| | | // if (available.compareTo(BigDecimal.ZERO) < 0) { |
| | | // available = BigDecimal.ZERO; |
| | | // } |
| | | // contractMoneyInfoVo.setAvailableBalance(available); |
| | | // } |
| | | |
| | | |
| | | contractMoneyInfoVo.setBeUsedBondAmount(beUsedBondAmount); |
| | | contractMoneyInfoVo.setFrozenBondAmount(frozenBondAmount); |
| | | contractMoneyInfoVo.setAvailableBalance(walletContractEntity.getAvailableBalance()); |
| | | contractMoneyInfoVo.setEquity(equity); |
| | | contractMoneyInfoVo.setFeeRatio(tradeSetting.getFeeRatio()); |
| | | contractMoneyInfoVo.setLeverAgeRatio(tradeSetting.getLeverageRatio()); |