fix: 恢复互换平仓交易费用按基础费率计算
This commit is contained in:
@@ -43,6 +43,9 @@ function loadUnwindHelpers() {
|
||||
vueDatePicker() { return {}; },
|
||||
vueNumberInput() { return {}; }
|
||||
},
|
||||
swapPricePrecision: {
|
||||
createVueInputComponent() { return {}; }
|
||||
},
|
||||
tradeHelper: { IsBond() { return false; } },
|
||||
main: {
|
||||
post() {
|
||||
@@ -112,14 +115,14 @@ describe('base-rate pending trading fee', () => {
|
||||
expectClose(result, 450.00);
|
||||
});
|
||||
|
||||
test('partial close fee and pending fee both use the rounded opening fee allocation', () => {
|
||||
const tradingFee = swapPosiFeeCalc.calcAllocatedTradingFee(
|
||||
113.46, consPosiFeeType.Percent, 1.1234, 4039.2, 4000, 10098, 10000);
|
||||
test('a manually adjusted pending fee does not override the base-rate close fee', () => {
|
||||
const tradingFee = swapPosiFeeCalc.calcTradingFee(
|
||||
consPosiFeeType.Unit, 0.123456, 0, 10000);
|
||||
const pendingFee = swapPosiFeeCalc.calcTradingFeePending(
|
||||
113.46, consPosiFeeType.Percent, 1.1234, 4039.2, 4000, 10098, 10000, 0.4);
|
||||
1235.56, consPosiFeeType.Unit, 0.123456, 0, 10000, 0, 10000, 1);
|
||||
|
||||
expectClose(tradingFee, 45.38);
|
||||
expectClose(pendingFee, 45.38);
|
||||
expectClose(tradingFee, 1234.56);
|
||||
expectClose(pendingFee, 1235.56);
|
||||
});
|
||||
|
||||
test('without a configured base rate, the legacy close-percent calculation remains', () => {
|
||||
|
||||
Reference in New Issue
Block a user