mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
remove bps from the fee calc
This commit is contained in:
parent
c678d3f13a
commit
a52101b163
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user