refactor(eod): MarginModes.FixedAmountAndMargin + DirectionRatio.RateType提取

候选F: 3处内联 new List{固定值,初始预付金,追加预付金} → MarginModes.FixedAmountAndMargin
候选I: 7处内联 收取?Buy:Sell → DirectionRatio.RateType(direction)

SwapModule零回归(7基线/510通过)
This commit is contained in:
hjhan
2026-08-12 14:38:04 +08:00
parent af94003939
commit 1aa0579fbd
3 changed files with 28 additions and 10 deletions
@@ -28,4 +28,9 @@ public static class DirectionRatio
var ratio = ReceivePay(interestDirection);
return MarginModes.Contains(interestMode) ? -ratio : ratio;
}
/// <summary>按收付方向选汇率类型。收取→Buy, 支付→Sell。
/// 原 7 处内联 `收取 ? Buy : Sell` 收口到此。</summary>
public static CurrencyRateType RateType(int direction)
=> direction == (int)SwapDirectionEnum. ? CurrencyRateType.Buy : CurrencyRateType.Sell;
}