diff --git a/pkg/exchange/max/convert.go b/pkg/exchange/max/convert.go index a497ceef9..7d72af641 100644 --- a/pkg/exchange/max/convert.go +++ b/pkg/exchange/max/convert.go @@ -11,6 +11,15 @@ import ( "github.com/c9s/bbgo/pkg/types" ) +func toGlobalNetwork(network string) string { + parts := strings.SplitN(network, "-", 2) + if len(parts) > 0 { + return parts[0] + } + + return network +} + func toGlobalCurrency(currency string) string { return strings.ToUpper(currency) } diff --git a/pkg/exchange/max/exchange.go b/pkg/exchange/max/exchange.go index f0206842c..172567be5 100644 --- a/pkg/exchange/max/exchange.go +++ b/pkg/exchange/max/exchange.go @@ -961,7 +961,7 @@ func (e *Exchange) QueryDepositHistory( TransactionID: d.TxID, Status: toGlobalDepositStatus(d.State), Confirmation: strconv.FormatInt(d.Confirmations, 10), - Network: d.NetworkProtocol, + Network: toGlobalNetwork(d.NetworkProtocol), RawStatus: toRawStatusStr(d), }) }