mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45: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{
|
a := &types.Account{
|
||||||
MakerCommission: fixedpoint.NewFromInt64(account.MakerCommission),
|
MakerCommission: fixedpoint.NewFromFloat(float64(account.MakerCommission) * 0.0001),
|
||||||
TakerCommission: fixedpoint.NewFromInt64(account.TakerCommission),
|
TakerCommission: fixedpoint.NewFromFloat(float64(account.TakerCommission) * 0.0001),
|
||||||
}
|
}
|
||||||
a.UpdateBalances(balances)
|
a.UpdateBalances(balances)
|
||||||
return a, nil
|
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")
|
return nil, fmt.Errorf("ftx returns querying balances failure")
|
||||||
}
|
}
|
||||||
|
|
||||||
bps := fixedpoint.NewFromFloat(10000)
|
|
||||||
a := &types.Account{
|
a := &types.Account{
|
||||||
MakerCommission: fixedpoint.NewFromFloat(resp.Result.MakerFee).Mul(bps),
|
MakerCommission: fixedpoint.NewFromFloat(resp.Result.MakerFee),
|
||||||
TakerCommission: fixedpoint.NewFromFloat(resp.Result.TakerFee).Mul(bps),
|
TakerCommission: fixedpoint.NewFromFloat(resp.Result.TakerFee),
|
||||||
}
|
}
|
||||||
|
|
||||||
balances, err := e.QueryAccountBalances(ctx)
|
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%
|
// "maker_fee": 0.0005 -> 0.05%
|
||||||
// "taker_fee": 0.0015 -> 0.15%
|
// "taker_fee": 0.0015 -> 0.15%
|
||||||
a := &types.Account{
|
a := &types.Account{
|
||||||
MakerCommission: fixedpoint.NewFromFloat(vipLevel.Current.MakerFee * 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 * 10000.0), // 0.15% = 0.0015, 0.0015 * 10000 = 15
|
TakerCommission: fixedpoint.NewFromFloat(vipLevel.Current.TakerFee), // 0.15% = 0.0015
|
||||||
}
|
}
|
||||||
|
|
||||||
a.UpdateBalances(balances)
|
a.UpdateBalances(balances)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user