mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 02:53:50 +00:00
Merge pull request #175 from c9s/feature/max/fee-calc
improvement: query max account fee from the vip level api
This commit is contained in:
commit
3cd7192000
|
@ -406,9 +406,17 @@ func (e *Exchange) QueryAccount(ctx context.Context) (*types.Account, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vipLevel, err := e.client.AccountService.VipLevel()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// MAX returns the fee rate in the following format:
|
||||||
|
// "maker_fee": 0.0005 -> 0.05%
|
||||||
|
// "taker_fee": 0.0015 -> 0.15%
|
||||||
a := &types.Account{
|
a := &types.Account{
|
||||||
MakerCommission: 15, // 0.15%
|
MakerCommission: fixedpoint.NewFromFloat(vipLevel.Current.MakerFee * 10000.0), // 0.15% = 0.0015, 0.0015 * 10000 = 15
|
||||||
TakerCommission: 15, // 0.15%
|
TakerCommission: fixedpoint.NewFromFloat(vipLevel.Current.TakerFee * 10000.0), // 0.15% = 0.0015, 0.0015 * 10000 = 15
|
||||||
}
|
}
|
||||||
|
|
||||||
a.UpdateBalances(balances)
|
a.UpdateBalances(balances)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user