mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
types: add maker/taker fee rate fields to the account struct
This commit is contained in:
parent
657e1dc9bf
commit
fd2928fc82
|
@ -536,8 +536,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), // 0.15% = 0.0015
|
||||
TakerCommission: fixedpoint.NewFromFloat(vipLevel.Current.TakerFee), // 0.15% = 0.0015
|
||||
MakerFeeRate: fixedpoint.NewFromFloat(vipLevel.Current.MakerFee), // 0.15% = 0.0015
|
||||
TakerFeeRate: fixedpoint.NewFromFloat(vipLevel.Current.TakerFee), // 0.15% = 0.0015
|
||||
}
|
||||
|
||||
a.UpdateBalances(balances)
|
||||
|
|
|
@ -112,7 +112,10 @@ type Account struct {
|
|||
// bps. 0.15% fee will be 15.
|
||||
MakerCommission fixedpoint.Value `json:"makerCommission,omitempty"`
|
||||
TakerCommission fixedpoint.Value `json:"takerCommission,omitempty"`
|
||||
AccountType string `json:"accountType,omitempty"`
|
||||
|
||||
MakerFeeRate fixedpoint.Value `json:"makerFeeRate,omitempty"`
|
||||
TakerFeeRate fixedpoint.Value `json:"takerFeeRate,omitempty"`
|
||||
AccountType string `json:"accountType,omitempty"`
|
||||
|
||||
balances BalanceMap
|
||||
}
|
||||
|
@ -243,8 +246,12 @@ func (a *Account) Print() {
|
|||
logrus.Infof("account type: %s", a.AccountType)
|
||||
}
|
||||
|
||||
logrus.Infof("maker commission: %f", a.MakerCommission.Float64())
|
||||
logrus.Infof("taker commission: %f", a.TakerCommission.Float64())
|
||||
if a.MakerFeeRate > 0 {
|
||||
logrus.Infof("maker fee rate: %f", a.MakerFeeRate.Float64())
|
||||
}
|
||||
if a.TakerFeeRate > 0 {
|
||||
logrus.Infof("taker fee rate: %f", a.TakerFeeRate.Float64())
|
||||
}
|
||||
|
||||
a.balances.Print()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user