@gearbox-protocol/sdk 16.0.0-next.52 → 16.0.0-next.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -291,13 +291,13 @@ var CreditSuite = class extends require_onchain_base_SDKConstruct.SDKConstruct {
291
291
  }
292
292
  /**
293
293
  * Describes this suite's leveraged strategy as the shared read model does,
294
- * or `undefined` when {@link strategyTargetCollateral} cannot be resolved or
295
- * {@link maxBorrowAmount} is at or below {@link MIN_STRATEGY_BORROW_AMOUNT}.
294
+ * or `undefined` when credit suite does not offer a strategy opportunity.
296
295
  */
297
296
  strategyOpportunity() {
298
297
  if (this.maxBorrowAmount <= MIN_STRATEGY_BORROW_AMOUNT) return;
299
298
  const collateral = this.strategyTargetCollateral;
300
299
  if (!collateral) return;
300
+ if (!require_onchain_market_credit_collateralUtils.isStrategyCollateral(this.#strategyCollateralProps(collateral), true)) return;
301
301
  const { market, creditManager: cm } = this;
302
302
  const { pool } = market.pool;
303
303
  const oracle = market.priceOracle;
@@ -8,7 +8,7 @@ import { SDKConstruct } from "../../base/SDKConstruct.js";
8
8
  import "../../base/index.js";
9
9
  import { calcBorrowApy, calcQuotaRate, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount } from "../math.js";
10
10
  import { strategyName } from "../strategyName.js";
11
- import { dominantCollateral, pickStrategyTargetCollateral } from "./collateralUtils.js";
11
+ import { dominantCollateral, isStrategyCollateral, pickStrategyTargetCollateral } from "./collateralUtils.js";
12
12
  import createCreditConfigurator from "./createCreditConfigurator.js";
13
13
  import createCreditFacade from "./createCreditFacade.js";
14
14
  import createCreditManager from "./createCreditManager.js";
@@ -290,13 +290,13 @@ var CreditSuite = class extends SDKConstruct {
290
290
  }
291
291
  /**
292
292
  * Describes this suite's leveraged strategy as the shared read model does,
293
- * or `undefined` when {@link strategyTargetCollateral} cannot be resolved or
294
- * {@link maxBorrowAmount} is at or below {@link MIN_STRATEGY_BORROW_AMOUNT}.
293
+ * or `undefined` when credit suite does not offer a strategy opportunity.
295
294
  */
296
295
  strategyOpportunity() {
297
296
  if (this.maxBorrowAmount <= MIN_STRATEGY_BORROW_AMOUNT) return;
298
297
  const collateral = this.strategyTargetCollateral;
299
298
  if (!collateral) return;
299
+ if (!isStrategyCollateral(this.#strategyCollateralProps(collateral), true)) return;
300
300
  const { market, creditManager: cm } = this;
301
301
  const { pool } = market.pool;
302
302
  const oracle = market.priceOracle;
@@ -213,8 +213,7 @@ declare class CreditSuite extends SDKConstruct {
213
213
  accountStrategyName(creditAccount: Address): string;
214
214
  /**
215
215
  * Describes this suite's leveraged strategy as the shared read model does,
216
- * or `undefined` when {@link strategyTargetCollateral} cannot be resolved or
217
- * {@link maxBorrowAmount} is at or below {@link MIN_STRATEGY_BORROW_AMOUNT}.
216
+ * or `undefined` when credit suite does not offer a strategy opportunity.
218
217
  */
219
218
  strategyOpportunity(): StrategyOpportunity | undefined;
220
219
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "16.0.0-next.52",
3
+ "version": "16.0.0-next.53",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "repository": {