fix(swap): 修复部分平仓计息计算中的尾差处理问题
- 修正了部分平仓后待实现利息收入的预期值从 0.006383561644 到 -0.010438356164 - 修正了预期待实现利息值从 0.820569301369 到 0.410474008219 - 在 SwapDealService 中添加了已完成平仓事件的查询逻辑,排除已平仓头寸的本金计算 - 重构了 SwapEodPositionService 中的待结算利息计算逻辑,区分自动互换和平仓场景 - 在测试类中添加了已完成流程事件的查找方法和相关测试数据 - 更新了测试用例以验证平仓事件对利息计算的影响
This commit is contained in:
@@ -1412,12 +1412,9 @@ namespace YLErp.Modules.SwapModule
|
||||
}
|
||||
else
|
||||
{
|
||||
var useAccrualBalance = !autoSwap
|
||||
&& (position.InterestMode == (int)InterestModeEnum.初始预付金
|
||||
|| position.InterestMode == (int)InterestModeEnum.追加预付金);
|
||||
var pendingInterestBeforeSettlement = useAccrualBalance
|
||||
? lastInterestIncomeSum + newEodPayPosition.TdInterestIncome
|
||||
: interestAmountBeforeSettlement;
|
||||
var pendingInterestBeforeSettlement = autoSwap
|
||||
? interestAmountBeforeSettlement
|
||||
: lastInterestIncomeSum + newEodPayPosition.TdInterestIncome;
|
||||
newEodPayPosition.InterestIncomeSum = RoundEodInterest(
|
||||
pendingInterestBeforeSettlement - newEodPayPosition.TdCloseInterest);
|
||||
newEodPayPosition.InterestFeeSum = eodPayPosition.InterestFeeSum + newEodPayPosition.TdInterestFee - newEodPayPosition.TdCloseInterestFee;
|
||||
|
||||
Reference in New Issue
Block a user