From d76245cb43d65641dec74eaf6a9d406a4ab78966 Mon Sep 17 00:00:00 2001 From: Raphanus Lo Date: Tue, 2 Aug 2022 15:12:14 +0800 Subject: [PATCH] exchange: adjust tests for order fee-amount protection --- pkg/bbgo/config_test.go | 25 +++++++++++++++++-------- pkg/bbgo/testdata/strategy.yaml | 8 ++++++++ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/pkg/bbgo/config_test.go b/pkg/bbgo/config_test.go index 723290431..13ad37ed2 100644 --- a/pkg/bbgo/config_test.go +++ b/pkg/bbgo/config_test.go @@ -82,16 +82,25 @@ func TestLoadConfig(t *testing.T) { assert.Equal(t, map[string]interface{}{ "sessions": map[string]interface{}{ "max": map[string]interface{}{ - "exchange": "max", - "envVarPrefix": "MAX", - "takerFeeRate": 0., - "makerFeeRate": 0., + "exchange": "max", + "envVarPrefix": "MAX", + "takerFeeRate": 0., + "makerFeeRate": 0., + "modifyOrderAmountForFee": false, }, "binance": map[string]interface{}{ - "exchange": "binance", - "envVarPrefix": "BINANCE", - "takerFeeRate": 0., - "makerFeeRate": 0., + "exchange": "binance", + "envVarPrefix": "BINANCE", + "takerFeeRate": 0., + "makerFeeRate": 0., + "modifyOrderAmountForFee": false, + }, + "ftx": map[string]interface{}{ + "exchange": "ftx", + "envVarPrefix": "FTX", + "takerFeeRate": 0., + "makerFeeRate": 0., + "modifyOrderAmountForFee": true, }, }, "build": map[string]interface{}{ diff --git a/pkg/bbgo/testdata/strategy.yaml b/pkg/bbgo/testdata/strategy.yaml index e04e630e1..9c1ecc482 100644 --- a/pkg/bbgo/testdata/strategy.yaml +++ b/pkg/bbgo/testdata/strategy.yaml @@ -5,11 +5,19 @@ sessions: envVarPrefix: MAX takerFeeRate: 0 makerFeeRate: 0 + modifyOrderAmountForFee: false binance: exchange: binance envVarPrefix: BINANCE takerFeeRate: 0 makerFeeRate: 0 + modifyOrderAmountForFee: false + ftx: + exchange: ftx + envVarPrefix: FTX + takerFeeRate: 0 + makerFeeRate: 0 + modifyOrderAmountForFee: true exchangeStrategies: - on: ["binance"]