From 1d7c656665a781894837657d4ff23172ecec7fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Rasc=C3=A3o?= Date: Tue, 21 Sep 2021 05:01:22 +0100 Subject: [PATCH] huobi: don't overwrite account balances when request spot asset (#785) --- exchanges/huobi/huobi_wrapper.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/exchanges/huobi/huobi_wrapper.go b/exchanges/huobi/huobi_wrapper.go index 73fdbcb3..72c1ac65 100644 --- a/exchanges/huobi/huobi_wrapper.go +++ b/exchanges/huobi/huobi_wrapper.go @@ -662,6 +662,9 @@ func (h *HUOBI) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (ac return info, err } for i := range accounts { + if accounts[i].Type != "spot" { + continue + } acc.ID = strconv.FormatInt(accounts[i].ID, 10) balances, err := h.GetAccountBalance(ctx, acc.ID) if err != nil { @@ -746,7 +749,7 @@ func (h *HUOBI) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (ac } acc.Currencies = currencyDetails } - acc.AssetType = asset.Futures + acc.AssetType = assetType info.Accounts = append(info.Accounts, acc) err := account.Process(&info) if err != nil {