From 39572c5fe0fd778dfff3676bba0bf2beacdb8748 Mon Sep 17 00:00:00 2001 From: zenix Date: Mon, 7 Mar 2022 14:20:49 +0900 Subject: [PATCH] fix: remove maker/buyer/taker/sellerCommission --- config/bollgrid.yaml | 4 ++-- config/grid-usdttwd.yaml | 4 ++-- config/pricedrop.yaml | 6 ++---- config/support-margin.yaml | 4 ++-- pkg/bbgo/config.go | 4 ---- pkg/bbgo/testdata/backtest.yaml | 6 ++---- pkg/exchange/binance/exchange.go | 2 -- pkg/exchange/ftx/exchange.go | 2 -- pkg/exchange/ftx/exchange_test.go | 3 --- pkg/types/account.go | 4 ---- 10 files changed, 10 insertions(+), 29 deletions(-) diff --git a/config/bollgrid.yaml b/config/bollgrid.yaml index 53e686641..bef337112 100644 --- a/config/bollgrid.yaml +++ b/config/bollgrid.yaml @@ -53,8 +53,8 @@ backtest: - BTCUSDT account: max: - makerCommission: 15 - takerCommission: 15 + makerFeeRate: 15 + takerFeeRate: 15 balances: BTC: 0.0 USDT: 10000.0 diff --git a/config/grid-usdttwd.yaml b/config/grid-usdttwd.yaml index 55e0dd5f5..29eb06c8a 100644 --- a/config/grid-usdttwd.yaml +++ b/config/grid-usdttwd.yaml @@ -31,8 +31,8 @@ backtest: - USDTTWD account: max: - makerCommission: 15 - takerCommission: 15 + makerFeeRate: 15 + takerFeeRate: 15 balances: BTC: 0.0 USDT: 10_000.0 diff --git a/config/pricedrop.yaml b/config/pricedrop.yaml index ff4680617..e650a981c 100644 --- a/config/pricedrop.yaml +++ b/config/pricedrop.yaml @@ -46,10 +46,8 @@ backtest: - BTCUSDT account: binance: - makerCommission: 15 - takerCommission: 15 - buyerCommission: 0 - sellerCommission: 0 + makerFeeRate: 15 + takerFeeRate: 15 balances: BTC: 0.1 USDT: 10000.0 diff --git a/config/support-margin.yaml b/config/support-margin.yaml index 808865477..bc28cea49 100644 --- a/config/support-margin.yaml +++ b/config/support-margin.yaml @@ -47,8 +47,8 @@ backtest: - LINKUSDT account: binance: - makerCommission: 15 - takerCommission: 15 + makerFeeRate: 15 + takerFeeRate: 15 balances: LINK: 0.0 USDT: 10000.0 diff --git a/pkg/bbgo/config.go b/pkg/bbgo/config.go index 01464fc8b..e1d69948b 100644 --- a/pkg/bbgo/config.go +++ b/pkg/bbgo/config.go @@ -109,10 +109,6 @@ type BacktestAccount struct { MakerFeeRate fixedpoint.Value `json:"makerFeeRate"` TakerFeeRate fixedpoint.Value `json:"takerFeeRate"` - MakerCommission fixedpoint.Value `json:"makerCommission"` - TakerCommission fixedpoint.Value `json:"takerCommission"` - BuyerCommission int `json:"buyerCommission"` - SellerCommission int `json:"sellerCommission"` Balances BacktestAccountBalanceMap `json:"balances" yaml:"balances"` } diff --git a/pkg/bbgo/testdata/backtest.yaml b/pkg/bbgo/testdata/backtest.yaml index 655331681..7c96b81d2 100644 --- a/pkg/bbgo/testdata/backtest.yaml +++ b/pkg/bbgo/testdata/backtest.yaml @@ -15,10 +15,8 @@ backtest: startTime: "2020-01-01" account: binance: - makerCommission: 15 - takerCommission: 15 - buyerCommission: 0 - sellerCommission: 0 + makerFeeRate: 15 + takerFeeRate: 15 balances: BTC: 1.0 USDT: 5000.0 diff --git a/pkg/exchange/binance/exchange.go b/pkg/exchange/binance/exchange.go index 3d4bd1e55..204871045 100644 --- a/pkg/exchange/binance/exchange.go +++ b/pkg/exchange/binance/exchange.go @@ -457,8 +457,6 @@ func (e *Exchange) QuerySpotAccount(ctx context.Context) (*types.Account, error) a := &types.Account{ AccountType: types.AccountTypeSpot, - MakerCommission: fixedpoint.NewFromFloat(float64(account.MakerCommission) * 0.0001), - TakerCommission: fixedpoint.NewFromFloat(float64(account.TakerCommission) * 0.0001), CanDeposit: account.CanDeposit, // if can transfer in asset CanTrade: account.CanTrade, // if can trade CanWithdraw: account.CanWithdraw, // if can transfer out asset diff --git a/pkg/exchange/ftx/exchange.go b/pkg/exchange/ftx/exchange.go index 691020183..bed81a992 100644 --- a/pkg/exchange/ftx/exchange.go +++ b/pkg/exchange/ftx/exchange.go @@ -177,8 +177,6 @@ func (e *Exchange) QueryAccount(ctx context.Context) (*types.Account, error) { } a := &types.Account{ - MakerCommission: ftxAccount.MakerFee, - TakerCommission: ftxAccount.TakerFee, TotalAccountValue: ftxAccount.TotalAccountValue, } diff --git a/pkg/exchange/ftx/exchange_test.go b/pkg/exchange/ftx/exchange_test.go index 9fa8b6d27..eb7cc731a 100644 --- a/pkg/exchange/ftx/exchange_test.go +++ b/pkg/exchange/ftx/exchange_test.go @@ -340,9 +340,6 @@ func TestExchange_QueryAccount(t *testing.T) { } expected.Locked = expected.Locked.Sub(expected.Available) assert.Equal(t, expected, b) - - assert.Equal(t, fixedpoint.NewFromFloat(0.0002), resp.MakerCommission) - assert.Equal(t, fixedpoint.NewFromFloat(0.0005), resp.TakerCommission) } func TestExchange_QueryMarkets(t *testing.T) { diff --git a/pkg/types/account.go b/pkg/types/account.go index e998d2941..f8f97a176 100644 --- a/pkg/types/account.go +++ b/pkg/types/account.go @@ -217,10 +217,6 @@ type Account struct { MakerFeeRate fixedpoint.Value `json:"makerFeeRate,omitempty"` TakerFeeRate fixedpoint.Value `json:"takerFeeRate,omitempty"` - // bps. 0.15% fee will be 15. - MakerCommission fixedpoint.Value `json:"makerCommission,omitempty"` - TakerCommission fixedpoint.Value `json:"takerCommission,omitempty"` - TotalAccountValue fixedpoint.Value `json:"totalAccountValue,omitempty"` CanDeposit bool `json:"canDeposit"`