From 10daeab1cb3c12b2403241fd2be2d848550226b4 Mon Sep 17 00:00:00 2001 From: gx578007 Date: Tue, 17 Oct 2023 15:45:55 +0800 Subject: [PATCH] FIX: [max] remove outdated margin fields --- pkg/exchange/max/exchange.go | 4 ++-- pkg/exchange/max/maxapi/account.go | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/exchange/max/exchange.go b/pkg/exchange/max/exchange.go index 0a894d4fa..4c095a5c3 100644 --- a/pkg/exchange/max/exchange.go +++ b/pkg/exchange/max/exchange.go @@ -664,8 +664,8 @@ func (e *Exchange) queryBalances(ctx context.Context, walletType maxapi.WalletTy Currency: cur, Available: b.Balance, Locked: b.Locked, - NetAsset: b.Balance.Add(b.Locked).Sub(b.Debt), - Borrowed: b.Borrowed, + NetAsset: b.Balance.Add(b.Locked).Sub(b.Principal).Sub(b.Interest), + Borrowed: b.Principal, Interest: b.Interest, } } diff --git a/pkg/exchange/max/maxapi/account.go b/pkg/exchange/max/maxapi/account.go index 17d4e29d4..678de81f7 100644 --- a/pkg/exchange/max/maxapi/account.go +++ b/pkg/exchange/max/maxapi/account.go @@ -25,9 +25,7 @@ type Account struct { Locked fixedpoint.Value `json:"locked"` // v3 fields for M wallet - Debt fixedpoint.Value `json:"debt"` Principal fixedpoint.Value `json:"principal"` - Borrowed fixedpoint.Value `json:"borrowed"` Interest fixedpoint.Value `json:"interest"` // v2 fields