diff --git a/YLErpDAL/Modules/SwapModule/Margin/MarginCalc.cs b/YLErpDAL/Modules/SwapModule/Margin/MarginCalc.cs index 40f8787e..d0ce29be 100644 --- a/YLErpDAL/Modules/SwapModule/Margin/MarginCalc.cs +++ b/YLErpDAL/Modules/SwapModule/Margin/MarginCalc.cs @@ -9,7 +9,12 @@ public static class MarginCalc { /// /// 取上一日终保证金余额。 - /// 优先 InterestPrincipalFix,其次 TdInterestPrincipal,都没有用 fallback。 + /// + /// 三级优先级(均有测试覆盖,不可简化): + /// 1. InterestPrincipalFix——EOD 归档赋值时的首选字段 + /// 2. TdInterestPrincipal——部分 EOD 归档路径未写 InterestPrincipalFix(值为0), + /// 此时 TdInterestPrincipal 含正确的保证金本金(生产 eod_swap_position(35774) 即此场景) + /// 3. fallback——首次平仓(preEod.id==0, 无归档)时用当日保证金余额 /// public static decimal PreviousBalance(eod_swap_position preEod, decimal fallback) {