diff --git a/pkg/exchange/binance/exchange.go b/pkg/exchange/binance/exchange.go index 902433190..2089a3b8f 100644 --- a/pkg/exchange/binance/exchange.go +++ b/pkg/exchange/binance/exchange.go @@ -377,9 +377,10 @@ func (e *Exchange) QueryAccount(ctx context.Context) (*types.Account, error) { } } + // binance use 15 -> 0.15%, so we convert it to 0.0015 a := &types.Account{ - MakerCommission: fixedpoint.NewFromInt64(account.MakerCommission), - TakerCommission: fixedpoint.NewFromInt64(account.TakerCommission), + MakerCommission: fixedpoint.NewFromFloat(float64(account.MakerCommission) * 0.0001), + TakerCommission: fixedpoint.NewFromFloat(float64(account.TakerCommission) * 0.0001), } a.UpdateBalances(balances) return a, nil diff --git a/pkg/exchange/ftx/exchange.go b/pkg/exchange/ftx/exchange.go index ad26692db..918499736 100644 --- a/pkg/exchange/ftx/exchange.go +++ b/pkg/exchange/ftx/exchange.go @@ -73,10 +73,9 @@ func (e *Exchange) QueryAccount(ctx context.Context) (*types.Account, error) { return nil, fmt.Errorf("ftx returns querying balances failure") } - bps := fixedpoint.NewFromFloat(10000) a := &types.Account{ - MakerCommission: fixedpoint.NewFromFloat(resp.Result.MakerFee).Mul(bps), - TakerCommission: fixedpoint.NewFromFloat(resp.Result.TakerFee).Mul(bps), + MakerCommission: fixedpoint.NewFromFloat(resp.Result.MakerFee), + TakerCommission: fixedpoint.NewFromFloat(resp.Result.TakerFee), } balances, err := e.QueryAccountBalances(ctx) diff --git a/pkg/exchange/max/exchange.go b/pkg/exchange/max/exchange.go index 20fd8f143..d6139d794 100644 --- a/pkg/exchange/max/exchange.go +++ b/pkg/exchange/max/exchange.go @@ -415,8 +415,8 @@ func (e *Exchange) QueryAccount(ctx context.Context) (*types.Account, error) { // "maker_fee": 0.0005 -> 0.05% // "taker_fee": 0.0015 -> 0.15% a := &types.Account{ - MakerCommission: fixedpoint.NewFromFloat(vipLevel.Current.MakerFee * 10000.0), // 0.15% = 0.0015, 0.0015 * 10000 = 15 - TakerCommission: fixedpoint.NewFromFloat(vipLevel.Current.TakerFee * 10000.0), // 0.15% = 0.0015, 0.0015 * 10000 = 15 + MakerCommission: fixedpoint.NewFromFloat(vipLevel.Current.MakerFee), // 0.15% = 0.0015 + TakerCommission: fixedpoint.NewFromFloat(vipLevel.Current.TakerFee), // 0.15% = 0.0015 } a.UpdateBalances(balances)