Files
zszq-trs/YLErpDAL/Modules/SwapModule/FundingLegs/UnderlyingEntryFullPriceLeg.cs
T
hjhan 70550af29a refactor(funding-leg): 清理CalcNotional死参数posiLong/posiShort+修正过时InterestMode注释
- 删除 IFundingLegStrategy.CalcNotional 的 posiLong/posiShort 死参数(多空存续腿界面已禁用,三个实现均不读取),同步三个实现签名、SwapDealService 唯一调用点、FundingLegStrategyTest 7 处调用
- 修正 SwapPosition/SwapFlowEvent/EodSwapPosition 的 InterestMode 字段注释(去掉已删的 3/4,补全 5/6/9)
- 重写 SwapUnwindFloatingLegDiagnosticTdd 过时类注释

零行为变化;编译 0 错误;FundingLegStrategyTest 11/11 通过。
2026-08-13 08:51:21 +08:00

20 lines
955 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using YLErp.DBModels;
namespace YLErp.Modules.SwapModule.FundingLegs;
/// <summary>
/// 标的期初全价融资腿(InterestMode=标的期初全价)。
/// 计息基数 = 标的期初含费全价(PosiGrossPrice/EntryDirtyPrice) × 数量。
/// "期初(Entry)"是关键——建仓时点的全价,非当前估值全价。
/// 主路径 CalcNotionalByMode 公式与合约名义本金规模(2)相同;
/// 差异在衡泰路径会乘 grossPrice 折算(SwapDealService.GetUnwindInterestsByHT),
/// 以及 EOD 复利部分平仓后直接返回剩余本金(禁止反推,SwapEodPositionService:1458-1465)。
/// </summary>
public sealed class UnderlyingEntryFullPriceLeg : IFundingLegStrategy
{
public InterestModeEnum Mode => InterestModeEnum.标的期初全价;
public NotionalResult CalcNotional(decimal fix, decimal posiNotional, decimal closePercent)
=> new(posiNotional * closePercent, posiNotional, closePercent);
}