From ae8625da315ba214e2614cebd5d6e3332b8daf60 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 2 Jun 2022 01:34:14 +0800 Subject: [PATCH] max: net asset should substract debt --- pkg/exchange/max/exchange.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/exchange/max/exchange.go b/pkg/exchange/max/exchange.go index a39e9c22a..b6efbdf9c 100644 --- a/pkg/exchange/max/exchange.go +++ b/pkg/exchange/max/exchange.go @@ -605,7 +605,7 @@ func (e *Exchange) QueryAccountBalances(ctx context.Context) (types.BalanceMap, Currency: cur, Available: b.Balance, 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 Interest: b.Interest, }