query max account fee from the vip level api

This commit is contained in:
c9s 2021-03-19 17:06:48 +08:00
parent db2ba22146
commit d97275e408

View File

@ -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)