max: net asset should substract debt

This commit is contained in:
c9s 2022-06-02 01:34:14 +08:00
parent 92882f68f4
commit ae8625da31
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -605,7 +605,7 @@ func (e *Exchange) QueryAccountBalances(ctx context.Context) (types.BalanceMap,
Currency: cur, Currency: cur,
Available: b.Balance, Available: b.Balance,
Locked: b.Locked, Locked: b.Locked,
NetAsset: b.Balance.Add(b.Locked), NetAsset: b.Balance.Add(b.Locked).Sub(b.Debt),
Borrowed: b.Debt, // TODO: Replace this with borrow in the newer version Borrowed: b.Debt, // TODO: Replace this with borrow in the newer version
Interest: b.Interest, Interest: b.Interest,
} }