命名: InterestLeg→FundingLeg, 消除'interest'与通用'利息'歧义。 Funding精确表达'融资成本'(客户付券商的杠杆成本 spread+FR007)。 改名清单: - IInterestLegStrategy → IFundingLegStrategy - InterestLegStrategyFactory → FundingLegStrategyFactory - InterestLegStrategyTest → FundingLegStrategyTest - 命名空间 InterestLegs → FundingLegs - 目录 InterestLegs/ → FundingLegs/ - SwapDealService 引用同步更新 验证: 编译0错误, 全量503测试7失败(基线一致)。
19 lines
927 B
C#
19 lines
927 B
C#
using YLErp.DBModels;
|
||
|
||
namespace YLErp.Modules.SwapModule.FundingLegs;
|
||
|
||
/// <summary>
|
||
/// 标的期初全价融资腿(InterestMode=标的期初全价)。
|
||
/// 站在"持仓全价"视角:计息基数 = 标的含费全价(PosiGrossPrice/EntryDirtyPrice) × 数量。
|
||
/// 主路径 CalcNotionalByMode 公式与合约名义本金规模(2)相同;
|
||
/// 差异在衡泰路径会乘 grossPrice 折算(SwapDealService.GetUnwindInterestsByHT),
|
||
/// 以及 EOD 复利部分平仓后直接返回剩余本金(禁止反推,SwapEodPositionService:1458-1465)。
|
||
/// </summary>
|
||
public sealed class UnderlyingFullPriceLeg : IFundingLegStrategy
|
||
{
|
||
public InterestModeEnum Mode => InterestModeEnum.标的期初全价;
|
||
|
||
public NotionalResult CalcNotional(decimal fix, decimal posiNotional, decimal posiLong, decimal posiShort, decimal closePercent)
|
||
=> new(posiNotional * closePercent, posiNotional, closePercent);
|
||
}
|