refactor(return-leg): 新增 ReturnLegSummary 标的端值对象
标的端(Total Return Leg)归档产出的汇总值: 多空名义本金/平仓名义本金/含费全价。 对应原 SwapPositionCompose 里 DealFloatPositions 传给 DealInterests 的4个标量。 命名说明(防歧义): - 用 ReturnLeg(业界标准 Total Return Leg), 不用 FloatLeg - 'float'在金融里首要含义是'浮动利率'(如FR007), 用于标的端会产生歧义 - 标的端 = 标的资产的总回报(价格涨跌+票息分红), 与浮动利率无关 纯新增骨架, 零生产改动。 验证: 编译0错误, 3个单测全过, 全量489测试7失败(基线一致)。
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
namespace YLErp.Modules.SwapModule.ReturnLegs;
|
||||
|
||||
/// <summary>
|
||||
/// 标的端(Total Return Leg)归档产出的汇总值。
|
||||
///
|
||||
/// 这些值由标的盯市+分红计算得出,传给融资端(FundingLeg)作为计息基数参考。
|
||||
/// 对应原 SwapPositionCompose 里 DealFloatPositions 的产出:
|
||||
/// posiLongNotional / posiShortNotional / closePosiNotional / grossPrice
|
||||
///
|
||||
/// 命名说明:这里叫 ReturnLeg(业界标准 Total Return Leg),不叫 FloatLeg——
|
||||
/// "float" 在金融里首要含义是"浮动利率"(如 FR007),用于标的端会产生歧义。
|
||||
/// 标的端 = 标的资产的总回报(价格涨跌 + 票息/分红),与浮动利率无关。
|
||||
/// </summary>
|
||||
public readonly struct ReturnLegSummary
|
||||
{
|
||||
/// <summary>多头剩余名义本金(= 数量 × 全价)。融资端用它算多头腿计息基数。</summary>
|
||||
public decimal LongNotional { get; }
|
||||
|
||||
/// <summary>空头剩余名义本金。</summary>
|
||||
public decimal ShortNotional { get; }
|
||||
|
||||
/// <summary>本次平仓名义本金(平仓数量 × 合约乘数 × 含费全价)。</summary>
|
||||
public decimal CloseNotional { get; }
|
||||
|
||||
/// <summary>标的含费全价(PosiGrossPrice / EntryDirtyPrice)。融资端 mode 9 衡泰路径折算用。</summary>
|
||||
public decimal GrossPrice { get; }
|
||||
|
||||
public ReturnLegSummary(decimal longNotional, decimal shortNotional, decimal closeNotional, decimal grossPrice)
|
||||
=> (LongNotional, ShortNotional, CloseNotional, GrossPrice)
|
||||
= (longNotional, shortNotional, closeNotional, grossPrice);
|
||||
}
|
||||
Reference in New Issue
Block a user