```\nfunction beforeRebalanceChecks(\n  GMXTypes.Store storage self,\n  GMXTypes.RebalanceType rebalanceType\n) external view {\n  if (\n    self.status != GMXTypes.Status.Open &&\n    self.status != GMXTypes.Status.Rebalance_Open\n  ) revert Errors.NotAllowedInCurrentVaultStatus();\n\n  // Check that rebalance type is Delta or Debt\n  // And then check that rebalance conditions are met\n  // Note that Delta rebalancing requires vault's delta strategy to be Neutral as well\n  if (rebalanceType == GMXTypes.RebalanceType.Delta && self.delta == GMXTypes.Delta.Neutral) {\n    if (\n      self.rebalanceCache.healthParams.deltaBefore < self.deltaUpperLimit &&\n      self.rebalanceCache.healthParams.deltaBefore > self.deltaLowerLimit\n    ) revert Errors.InvalidRebalancePreConditions();\n  } else if (rebalanceType == GMXTypes.RebalanceType.Debt) {\n    if (\n      self.rebalanceCache.healthParams.debtRatioBefore < self.debtRatioUpperLimit &&\n      self.rebalanceCache.healthParams.debtRatioBefore > self.debtRatioLowerLimit\n    ) revert Errors.InvalidRebalancePreConditions();\n  } else {\n     revert Errors.InvalidRebalanceParameters();\n  }\n}\n```\n