保证金就是保证金——有余额、有利率、有利息, 不存在'计息基数/Notional'概念。 现有代码把保证金塞进 InterestPrincipalFix 当计息腿处理是错误建模。 修正: - 删除 MarginLeg.cs(CalcBalance/accrualFactor 是融资腿的概念, 不该用在保证金) - 新增 MarginAccount.cs: 管理余额变动(Deposit追加/Withdraw释放), 不含计息 - MarginBalance: 注释去掉'计息基数', 改为'保证金余额' - IMarginResolver.Resolve: 去掉 accrualFactor 参数(融资腿比例, 非保证金概念) - CashMargin/CreditMargin/GuaranteeMargin: 同步去掉 accrualFactor - 枚举注释: '计息余额' → '余额' 保证金利息由 SwapInterest 纯函数按 余额×利率×天数/年化 计算, MarginAccount 只提供余额, 不掺计息逻辑。 验证: sln编译0错误, 全量486测试7失败(基线一致,零回归)。
11 lines
303 B
C#
11 lines
303 B
C#
namespace YLErp.Modules.SwapModule.Margin;
|
|
|
|
/// <summary>授信保证:余额 = 已用授信额度。</summary>
|
|
public sealed class CreditMargin : IMarginResolver
|
|
{
|
|
public MarginForm Form => MarginForm.Credit;
|
|
|
|
public MarginBalance Resolve(decimal postedAmount)
|
|
=> new(postedAmount);
|
|
}
|