diff --git a/pkg/types/asset.go b/pkg/types/asset.go index 043fa89c6..4bd13183b 100644 --- a/pkg/types/asset.go +++ b/pkg/types/asset.go @@ -12,10 +12,13 @@ import ( type Asset struct { Currency string `json:"currency" db:"currency"` + Total fixedpoint.Value `json:"total" db:"total"` NetAsset fixedpoint.Value `json:"netAsset" db:"net_asset"` + Interest fixedpoint.Value `json:"interest" db:"interest"` + // InUSD is net asset in USD InUSD fixedpoint.Value `json:"inUSD" db:"net_asset_in_usd"` diff --git a/pkg/types/balance.go b/pkg/types/balance.go index eb63e971d..5399936fe 100644 --- a/pkg/types/balance.go +++ b/pkg/types/balance.go @@ -108,12 +108,11 @@ func (m BalanceMap) Assets(prices map[string]fixedpoint.Value, priceTime time.Ti _, btcInUSD, hasBtcPrice := findUSDMarketPrice("BTC", prices) for currency, b := range m { - if b.Locked.IsZero() && b.Available.IsZero() && b.Borrowed.IsZero() { - continue - } - total := b.Total() netAsset := b.Net() + if total.IsZero() && netAsset.IsZero() { + continue + } asset := Asset{ Currency: currency, @@ -122,6 +121,7 @@ func (m BalanceMap) Assets(prices map[string]fixedpoint.Value, priceTime time.Ti Locked: b.Locked, Available: b.Available, Borrowed: b.Borrowed, + Interest: b.Interest, NetAsset: netAsset, }