diff --git a/protocol/x/perpetuals/keeper/perpetual.go b/protocol/x/perpetuals/keeper/perpetual.go index 1b8b5905fe..f11a164d16 100644 --- a/protocol/x/perpetuals/keeper/perpetual.go +++ b/protocol/x/perpetuals/keeper/perpetual.go @@ -33,8 +33,12 @@ import ( ) func (k Keeper) IsIsolatedPerpetual(ctx sdk.Context, perpetualId uint32) (bool, error) { - insuranceFundName, err := k.GetInsuranceFundName(ctx, perpetualId) - return insuranceFundName == types.InsuranceFundName, err + perpetual, err := k.GetPerpetual(ctx, perpetualId) + if err != nil { + return false, err + } + + return perpetual.Params.MarketType == types.PerpetualMarketType_PERPETUAL_MARKET_TYPE_ISOLATED, nil } // GetInsuranceFundName returns the name of the insurance fund account for a given perpetual. diff --git a/protocol/x/subaccounts/keeper/negative_tnc_subaccount.go b/protocol/x/subaccounts/keeper/negative_tnc_subaccount.go index ebef13a73e..069dcff2b7 100644 --- a/protocol/x/subaccounts/keeper/negative_tnc_subaccount.go +++ b/protocol/x/subaccounts/keeper/negative_tnc_subaccount.go @@ -112,9 +112,9 @@ func (k Keeper) getNegativeTncSubaccountStoreSuffix( return "", err } if isIsolated { - return types.CrossCollateralSuffix, nil - } else { return lib.UintToString(perpetualId), nil + } else { + return types.CrossCollateralSuffix, nil } }