@gearbox-protocol/sdk 16.0.0-next.37 → 16.0.0-next.39

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.
Files changed (36) hide show
  1. package/dist/cjs/model/liquidations.schema.js +1 -0
  2. package/dist/cjs/onchain/accounts/intents/testing/sdk-mock.js +15 -1
  3. package/dist/cjs/onchain/accounts/liquidations/LiquidationsService.js +1 -2
  4. package/dist/cjs/onchain/index.js +0 -3
  5. package/dist/cjs/onchain/market/credit/CreditSuite.js +68 -3
  6. package/dist/cjs/onchain/market/credit/index.js +0 -3
  7. package/dist/cjs/onchain/market/index.js +0 -3
  8. package/dist/cjs/onchain/positions/PositionsService.js +4 -8
  9. package/dist/cjs/preview/preview/buildDelayedStrategyPositionOperationPreview.js +7 -2
  10. package/dist/cjs/preview/preview/previewAdjustStrategyPosition.js +3 -0
  11. package/dist/cjs/preview/preview/previewExitOrRepayStrategyPosition.js +8 -3
  12. package/dist/cjs/preview/preview/previewOperation.js +4 -3
  13. package/dist/cjs/preview/preview/previewPoolPositionOperation.js +1 -0
  14. package/dist/esm/model/liquidations.schema.js +2 -1
  15. package/dist/esm/onchain/accounts/intents/testing/sdk-mock.js +15 -1
  16. package/dist/esm/onchain/accounts/liquidations/LiquidationsService.js +1 -2
  17. package/dist/esm/onchain/index.js +1 -2
  18. package/dist/esm/onchain/market/credit/CreditSuite.js +69 -4
  19. package/dist/esm/onchain/market/credit/index.js +1 -2
  20. package/dist/esm/onchain/market/index.js +1 -2
  21. package/dist/esm/onchain/positions/PositionsService.js +4 -8
  22. package/dist/esm/preview/preview/buildDelayedStrategyPositionOperationPreview.js +7 -2
  23. package/dist/esm/preview/preview/previewAdjustStrategyPosition.js +3 -0
  24. package/dist/esm/preview/preview/previewExitOrRepayStrategyPosition.js +8 -3
  25. package/dist/esm/preview/preview/previewOperation.js +4 -3
  26. package/dist/esm/preview/preview/previewPoolPositionOperation.js +1 -0
  27. package/dist/types/model/liquidations.schema.d.ts +18 -0
  28. package/dist/types/model/previews.d.ts +38 -2
  29. package/dist/types/onchain/index.d.ts +1 -2
  30. package/dist/types/onchain/market/credit/CreditSuite.d.ts +48 -1
  31. package/dist/types/onchain/market/credit/index.d.ts +1 -2
  32. package/dist/types/onchain/market/index.d.ts +1 -2
  33. package/package.json +1 -1
  34. package/dist/cjs/onchain/market/credit/creditOperationMarket.js +0 -36
  35. package/dist/esm/onchain/market/credit/creditOperationMarket.js +0 -34
  36. package/dist/types/onchain/market/credit/creditOperationMarket.d.ts +0 -27
@@ -25,6 +25,7 @@ const liquidatableAccountFilterSchema = zod_v4.z.object({
25
25
  const liquidatableAccountSchema = zod_v4.z.object({
26
26
  creditManager: require_onchain_utils_zod.ZodAddress(),
27
27
  name: zod_v4.z.string(),
28
+ underlyingToken: require_model_primitives_schema.underlyingTokenSchema,
28
29
  curator: require_model_curators_schema.curatorSchema,
29
30
  liquidationDiscount: require_model_primitives_schema.bpsSchema,
30
31
  chainId: require_model_primitives_schema.chainIdSchema,
@@ -1,6 +1,7 @@
1
1
  require("../../../constants/math.js");
2
2
  require("../../../constants/index.js");
3
3
  const require_onchain_market_math = require("../../../market/math.js");
4
+ const require_onchain_market_credit_CreditSuite = require("../../../market/credit/CreditSuite.js");
4
5
  const require_onchain_positions_PositionsService = require("../../../positions/PositionsService.js");
5
6
  let vitest = require("vitest");
6
7
  //#region src/onchain/accounts/intents/testing/sdk-mock.ts
@@ -225,9 +226,22 @@ function buildMockSdk(args) {
225
226
  const forbiddenTokensMask = collateralTokens.reduce((mask, token, i) => forbidden.has(token) ? mask | 1n << BigInt(i) : mask, 0n);
226
227
  const facadePaused = args.facadePaused ?? false;
227
228
  const expirationDate = args.expirationDate ?? 0;
229
+ const strategyTargetCollateral = args.strategyTargetCollateral ?? collateralTokens.find((t) => t !== args.underlying.toLowerCase());
230
+ const unwrappedUnderlying = args.rwaAssets?.[args.underlying.toLowerCase()] ?? args.underlying;
231
+ const underlyingToken = {
232
+ ...tokenOf(unwrappedUnderlying),
233
+ wrappedAddress: unwrappedUnderlying.toLowerCase() === args.underlying.toLowerCase() ? null : args.underlying
234
+ };
235
+ const strategyName = strategyTargetCollateral ? `${tokenOf(strategyTargetCollateral).symbol} / ${underlyingToken.symbol}` : void 0;
228
236
  const creditManagerSuite = {
229
237
  name: "TestCreditManager",
238
+ strategyName,
239
+ underlyingToken,
240
+ accountTargetCollateral: () => strategyTargetCollateral ? tokenOf(strategyTargetCollateral) : null,
241
+ accountStrategyName: () => strategyName ?? underlyingToken.symbol,
230
242
  liquidationFees: () => MOCK_LIQUIDATION_FEES,
243
+ totalLiquidationDiscount: require_onchain_market_credit_CreditSuite.CreditSuite.prototype.totalLiquidationDiscount,
244
+ creditOperationMarket: require_onchain_market_credit_CreditSuite.CreditSuite.prototype.creditOperationMarket,
231
245
  creditManager: {
232
246
  address: args.creditManager,
233
247
  liquidationThresholds,
@@ -248,7 +262,7 @@ function buildMockSdk(args) {
248
262
  market,
249
263
  isPaused: facadePaused || poolPaused,
250
264
  forbiddenTokens: [...forbidden],
251
- strategyTargetCollateral: args.strategyTargetCollateral ?? collateralTokens.find((t) => t !== args.underlying.toLowerCase()),
265
+ strategyTargetCollateral,
252
266
  isExpired: expirationDate > 0 && expirationDate < (args.timestamp ?? 0)
253
267
  };
254
268
  const routeCalls = (tokenIn, tokenOut) => {
@@ -11,7 +11,6 @@ const require_onchain_base_SDKConstruct = require("../../base/SDKConstruct.js");
11
11
  require("../../base/index.js");
12
12
  const require_onchain_market_math = require("../../market/math.js");
13
13
  const require_onchain_market_credit_collateralUtils = require("../../market/credit/collateralUtils.js");
14
- const require_onchain_market_credit_creditOperationMarket = require("../../market/credit/creditOperationMarket.js");
15
14
  const require_model_liquidations = require("../../../model/liquidations.js");
16
15
  require("../../../model/index.js");
17
16
  const require_onchain_market_rwa_midas_constants = require("../../market/rwa/midas/constants.js");
@@ -261,7 +260,7 @@ var LiquidationsService = class extends require_onchain_base_SDKConstruct.SDKCon
261
260
  const token = this.sdk.tokensMeta.mustGetToken(unwrappedUnderlying);
262
261
  const usd = (part) => ca.totalValue > 0n ? require_onchain_market_math.usdToNumber(ca.totalValueUSD * part / ca.totalValue) : 0;
263
262
  return {
264
- ...require_onchain_market_credit_creditOperationMarket.creditOperationMarket(suite),
263
+ ...suite.creditOperationMarket(),
265
264
  chainId: this.sdk.chainId,
266
265
  creditAccount: ca.creditAccount,
267
266
  asset: this.sdk.tokensMeta.mustGetToken(this.#mainAsset(ca, market, unwrappedUnderlying)),
@@ -139,7 +139,6 @@ const require_onchain_market_credit_CreditManagerV310Contract = require("./marke
139
139
  const require_onchain_market_strategyName = require("./market/strategyName.js");
140
140
  const require_onchain_market_credit_collateralUtils = require("./market/credit/collateralUtils.js");
141
141
  const require_onchain_market_credit_CreditSuite = require("./market/credit/CreditSuite.js");
142
- const require_onchain_market_credit_creditOperationMarket = require("./market/credit/creditOperationMarket.js");
143
142
  const require_onchain_market_credit_expectedBalanceDeltas = require("./market/credit/expectedBalanceDeltas.js");
144
143
  const require_onchain_utils_viem_simulateMulticall = require("./utils/viem/simulateMulticall.js");
145
144
  const require_onchain_utils_viem_simulateWithPriceUpdates = require("./utils/viem/simulateWithPriceUpdates.js");
@@ -532,7 +531,6 @@ exports.createRouter = require_onchain_router_createRouter.createRouter;
532
531
  exports.createWithdrawalCompressor = require_onchain_accounts_withdrawal_compressor_createWithdrawalCompressor.createWithdrawalCompressor;
533
532
  exports.createZapper = require_onchain_market_zapper_createZapper.createZapper;
534
533
  exports.creditFacadeV310Abi = require_onchain_market_credit_CreditFacadeV310BaseContract.creditFacadeV310Abi;
535
- exports.creditOperationMarket = require_onchain_market_credit_creditOperationMarket.creditOperationMarket;
536
534
  exports.curveAddLiquidityFromTransfers = require_onchain_market_adapters_transferHelpers.curveAddLiquidityFromTransfers;
537
535
  exports.curveRemoveLiquidityFromTransfers = require_onchain_market_adapters_transferHelpers.curveRemoveLiquidityFromTransfers;
538
536
  exports.decodeDelayedIntent = require_onchain_accounts_withdrawal_compressor_intent_codec.decodeDelayedIntent;
@@ -717,6 +715,5 @@ exports.toSignificant = require_onchain_utils_formatter.toSignificant;
717
715
  exports.toToken = require_onchain_validation_token.toToken;
718
716
  exports.toTokenAmount = require_onchain_validation_token.toTokenAmount;
719
717
  exports.toWithdrawalStatus = require_onchain_accounts_withdrawal_compressor_types.toWithdrawalStatus;
720
- exports.totalLiquidationDiscount = require_onchain_market_credit_creditOperationMarket.totalLiquidationDiscount;
721
718
  exports.usdToNumber = require_onchain_market_math.usdToNumber;
722
719
  exports.watchBlocksAsync = require_onchain_utils_viem_watchBlocksAsync.watchBlocksAsync;
@@ -86,6 +86,16 @@ var CreditSuite = class extends require_onchain_base_SDKConstruct.SDKConstruct {
86
86
  return this.creditManager.underlying;
87
87
  }
88
88
  /**
89
+ * Pool underlying token as the shared read model describes it.
90
+ *
91
+ * For RWA markets this is the unwrapped asset, e.g. USDC rather than
92
+ * dcUSDC (the pool's on-chain underlying). Same as
93
+ * {@link MarketSuite.underlyingToken}.
94
+ */
95
+ get underlyingToken() {
96
+ return this.market.underlyingToken;
97
+ }
98
+ /**
89
99
  * Parent market that contains this credit manager
90
100
  */
91
101
  get market() {
@@ -172,6 +182,37 @@ var CreditSuite = class extends require_onchain_base_SDKConstruct.SDKConstruct {
172
182
  };
173
183
  }
174
184
  /**
185
+ * What a liquidation takes off an account, in basis points: the premium the
186
+ * liquidator keeps plus the protocol's own fee, with the suite's expiration
187
+ * already resolved.
188
+ *
189
+ * Not {@link LiquidationFees.liquidationDiscount}, which is the complement of
190
+ * the premium alone (`100% - liquidationPremium`) and says what share of the
191
+ * seized collateral repays the debt.
192
+ */
193
+ totalLiquidationDiscount() {
194
+ const { feeLiquidation, liquidationDiscount } = this.liquidationFees();
195
+ return Number(require_onchain_constants_math.PERCENTAGE_FACTOR) - liquidationDiscount + feeLiquidation;
196
+ }
197
+ /**
198
+ * The market half of every credit operation result, read off this suite: a
199
+ * preview, a projection, the open-strategy walk and a liquidatable-account
200
+ * row all spread it, so the five fields are filled in one place and cannot
201
+ * drift apart between the halves of the SDK.
202
+ *
203
+ * The curator comes from the same getter {@link strategyOpportunity} reads, so
204
+ * a result and the opportunity beside it name one entity.
205
+ */
206
+ creditOperationMarket() {
207
+ return {
208
+ creditManager: this.creditManager.address,
209
+ name: this.strategyName ?? this.underlyingToken.symbol,
210
+ underlyingToken: this.underlyingToken,
211
+ curator: this.market.curator,
212
+ liquidationDiscount: this.totalLiquidationDiscount()
213
+ };
214
+ }
215
+ /**
175
216
  * Whether this suite can be used right now. A paused pool blocks borrowing,
176
217
  * so the suite is unusable even when its own facade is live.
177
218
  */
@@ -222,7 +263,31 @@ var CreditSuite = class extends require_onchain_base_SDKConstruct.SDKConstruct {
222
263
  get strategyName() {
223
264
  const collateral = this.strategyTargetCollateral;
224
265
  if (!collateral) return;
225
- return require_onchain_market_strategyName.strategyName(this.tokensMeta.mustGetToken(collateral), this.market.underlyingToken);
266
+ return require_onchain_market_strategyName.strategyName(this.tokensMeta.mustGetToken(collateral), this.underlyingToken);
267
+ }
268
+ /**
269
+ * Collateral token an existing credit account in this suite is a strategy
270
+ * in. Same as {@link StrategyPosition.targetCollateral}.
271
+ *
272
+ * Resolution, in order:
273
+ * 1. a hardcoded per-account override, when present;
274
+ * 2. {@link strategyTargetCollateral};
275
+ * 3. `null` when neither can be resolved.
276
+ */
277
+ accountTargetCollateral(creditAccount) {
278
+ const addr = require_onchain_chain_chains.getAccountTargetCollateral(creditAccount, this.chainId) ?? this.strategyTargetCollateral;
279
+ return addr ? this.tokensMeta.mustGetToken(addr) : null;
280
+ }
281
+ /**
282
+ * Display name of an existing credit account in this suite, e.g.
283
+ * `"wstETH / WETH"`. Same as {@link StrategyPosition.name}.
284
+ *
285
+ * {@link accountTargetCollateral} over the underlying, or the underlying
286
+ * symbol when no target can be resolved.
287
+ */
288
+ accountStrategyName(creditAccount) {
289
+ const target = this.accountTargetCollateral(creditAccount);
290
+ return target ? require_onchain_market_strategyName.strategyName(target, this.underlyingToken) : this.underlyingToken.symbol;
226
291
  }
227
292
  /**
228
293
  * Describes this suite's leveraged strategy as the shared read model does,
@@ -245,9 +310,9 @@ var CreditSuite = class extends require_onchain_base_SDKConstruct.SDKConstruct {
245
310
  chainId: this.chainId,
246
311
  creditManager: cm.address,
247
312
  targetCollateral: this.tokensMeta.mustGetToken(collateral),
248
- name: this.strategyName ?? this.market.underlyingToken.symbol,
313
+ name: this.strategyName ?? this.underlyingToken.symbol,
249
314
  curator: market.curator,
250
- underlyingToken: market.underlyingToken,
315
+ underlyingToken: this.underlyingToken,
251
316
  totalBorrowed: oracle.toAmount(pool.underlying, borrowed),
252
317
  allowedDepositTokens: this.#allowedDepositTokens(collateral),
253
318
  paused: this.isPaused,
@@ -5,7 +5,6 @@ const require_onchain_market_credit_CreditFacadeV310Contract = require("./Credit
5
5
  const require_onchain_market_credit_CreditManagerV310Contract = require("./CreditManagerV310Contract.js");
6
6
  const require_onchain_market_credit_collateralUtils = require("./collateralUtils.js");
7
7
  const require_onchain_market_credit_CreditSuite = require("./CreditSuite.js");
8
- const require_onchain_market_credit_creditOperationMarket = require("./creditOperationMarket.js");
9
8
  const require_onchain_market_credit_expectedBalanceDeltas = require("./expectedBalanceDeltas.js");
10
9
  require("./types.js");
11
10
  exports.CreditConfiguratorV310Contract = require_onchain_market_credit_CreditConfiguratorV310Contract.CreditConfiguratorV310Contract;
@@ -14,9 +13,7 @@ exports.CreditFacadeV310Contract = require_onchain_market_credit_CreditFacadeV31
14
13
  exports.CreditManagerV310Contract = require_onchain_market_credit_CreditManagerV310Contract.CreditManagerV310Contract;
15
14
  exports.CreditSuite = require_onchain_market_credit_CreditSuite.CreditSuite;
16
15
  exports.creditFacadeV310Abi = require_onchain_market_credit_CreditFacadeV310BaseContract.creditFacadeV310Abi;
17
- exports.creditOperationMarket = require_onchain_market_credit_creditOperationMarket.creditOperationMarket;
18
16
  exports.dominantCollateral = require_onchain_market_credit_collateralUtils.dominantCollateral;
19
17
  exports.expectedBalanceDeltas = require_onchain_market_credit_expectedBalanceDeltas.expectedBalanceDeltas;
20
18
  exports.isStrategyCollateral = require_onchain_market_credit_collateralUtils.isStrategyCollateral;
21
19
  exports.pickStrategyTargetCollateral = require_onchain_market_credit_collateralUtils.pickStrategyTargetCollateral;
22
- exports.totalLiquidationDiscount = require_onchain_market_credit_creditOperationMarket.totalLiquidationDiscount;
@@ -93,7 +93,6 @@ const require_onchain_market_credit_CreditManagerV310Contract = require("./credi
93
93
  const require_onchain_market_strategyName = require("./strategyName.js");
94
94
  const require_onchain_market_credit_collateralUtils = require("./credit/collateralUtils.js");
95
95
  const require_onchain_market_credit_CreditSuite = require("./credit/CreditSuite.js");
96
- const require_onchain_market_credit_creditOperationMarket = require("./credit/creditOperationMarket.js");
97
96
  const require_onchain_market_credit_expectedBalanceDeltas = require("./credit/expectedBalanceDeltas.js");
98
97
  require("./credit/index.js");
99
98
  const require_onchain_market_oracle_collateralPriceInUnderlying = require("./oracle/collateralPriceInUnderlying.js");
@@ -262,7 +261,6 @@ exports.createAdapter = require_onchain_market_adapters_createAdapter.createAdap
262
261
  exports.createPriceOracle = require_onchain_market_oracle_createPriceOracle.createPriceOracle;
263
262
  exports.createZapper = require_onchain_market_zapper_createZapper.createZapper;
264
263
  exports.creditFacadeV310Abi = require_onchain_market_credit_CreditFacadeV310BaseContract.creditFacadeV310Abi;
265
- exports.creditOperationMarket = require_onchain_market_credit_creditOperationMarket.creditOperationMarket;
266
264
  exports.curveAddLiquidityFromTransfers = require_onchain_market_adapters_transferHelpers.curveAddLiquidityFromTransfers;
267
265
  exports.curveRemoveLiquidityFromTransfers = require_onchain_market_adapters_transferHelpers.curveRemoveLiquidityFromTransfers;
268
266
  exports.dominantCollateral = require_onchain_market_credit_collateralUtils.dominantCollateral;
@@ -364,5 +362,4 @@ exports.rewardsFromTransfers = require_onchain_market_adapters_transferHelpers.r
364
362
  exports.strategyName = require_onchain_market_strategyName.strategyName;
365
363
  exports.swapFromTransfers = require_onchain_market_adapters_transferHelpers.swapFromTransfers;
366
364
  exports.toNetTransfers = require_onchain_market_adapters_transferHelpers.toNetTransfers;
367
- exports.totalLiquidationDiscount = require_onchain_market_credit_creditOperationMarket.totalLiquidationDiscount;
368
365
  exports.usdToNumber = require_onchain_market_math.usdToNumber;
@@ -1,14 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_onchain_utils_AddressMap = require("../utils/AddressMap.js");
3
- const require_onchain_chain_chains = require("../chain/chains.js");
4
3
  require("../constants/math.js");
5
4
  require("../constants/index.js");
6
5
  require("../utils/index.js");
7
6
  const require_onchain_base_SDKConstruct = require("../base/SDKConstruct.js");
8
7
  require("../base/index.js");
9
8
  const require_onchain_market_math = require("../market/math.js");
10
- const require_onchain_market_strategyName = require("../market/strategyName.js");
11
- const require_onchain_market_credit_creditOperationMarket = require("../market/credit/creditOperationMarket.js");
12
9
  const require_model_filters = require("../../model/filters.js");
13
10
  const require_model_positions = require("../../model/positions.js");
14
11
  require("../../model/index.js");
@@ -264,7 +261,7 @@ var PositionsService = class extends require_onchain_base_SDKConstruct.SDKConstr
264
261
  const market = this.sdk.marketRegister.findByCreditManager(creditManager);
265
262
  const { priceOracle } = market;
266
263
  return {
267
- ...require_onchain_market_credit_creditOperationMarket.creditOperationMarket(this.sdk.marketRegister.findCreditManager(creditManager)),
264
+ ...this.sdk.marketRegister.findCreditManager(creditManager).creditOperationMarket(),
268
265
  totalValue: market.toUnderlyingAmount(totalValue),
269
266
  totalDebt: market.toUnderlyingAmount(totalDebt),
270
267
  netValue: market.toUnderlyingAmount(totalValue - totalDebt),
@@ -287,9 +284,8 @@ var PositionsService = class extends require_onchain_base_SDKConstruct.SDKConstr
287
284
  const { market } = suite;
288
285
  const { priceOracle } = market;
289
286
  const { pool } = market.pool;
290
- const token = market.underlyingToken;
287
+ const token = suite.underlyingToken;
291
288
  const totalDebtValue = ca.debt + ca.accruedInterest + ca.accruedFees;
292
- const target = require_onchain_chain_chains.getAccountTargetCollateral(ca.creditAccount, this.sdk.chainId) ?? suite.strategyTargetCollateral;
293
289
  const priceFailed = !ca.success;
294
290
  const recomputeTotals = ca.debt === 0n || priceFailed;
295
291
  const collaterals = [];
@@ -323,8 +319,8 @@ var PositionsService = class extends require_onchain_base_SDKConstruct.SDKConstr
323
319
  creditManager: ca.creditManager,
324
320
  creditAccount: ca.creditAccount,
325
321
  underlyingToken: token,
326
- name: target ? require_onchain_market_strategyName.strategyName(this.sdk.tokensMeta.mustGetToken(target), token) : token.symbol,
327
- targetCollateral: target ? this.sdk.tokensMeta.mustGetToken(target) : null,
322
+ name: suite.accountStrategyName(ca.creditAccount),
323
+ targetCollateral: suite.accountTargetCollateral(ca.creditAccount),
328
324
  leverage: require_onchain_market_math.calcPositionLeverage(totalValue, totalDebtValue),
329
325
  borrowApy: require_onchain_market_math.calcBorrowApy(pool.baseInterestRate, suite.creditManager.feeInterest),
330
326
  totalDebt: {
@@ -2,7 +2,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_onchain_utils_AssetsMap = require("../../onchain/utils/AssetsMap.js");
3
3
  const require_onchain_utils_bigint_math = require("../../onchain/utils/bigint-math.js");
4
4
  const require_onchain_constants_math = require("../../onchain/constants/math.js");
5
- const require_onchain_market_credit_creditOperationMarket = require("../../onchain/market/credit/creditOperationMarket.js");
6
5
  const require_model_previews = require("../../model/previews.js");
7
6
  require("../../model/index.js");
8
7
  require("../../onchain/index.js");
@@ -164,11 +163,14 @@ function totalValueInUnderlying(post, convert, dust) {
164
163
  function buildClosePreview(post, converter, receivedToken, sdk) {
165
164
  const totalValue = totalValueInUnderlying(post, converter.convert, 0n);
166
165
  const oracle = sdk.marketRegister.findByCreditManager(post.creditManager).priceOracle;
166
+ const suite = sdk.marketRegister.findCreditManager(post.creditManager);
167
167
  return {
168
168
  operation: "CloseCreditAccount",
169
169
  permanent: false,
170
- ...require_onchain_market_credit_creditOperationMarket.creditOperationMarket(sdk.marketRegister.findCreditManager(post.creditManager)),
170
+ ...suite.creditOperationMarket(),
171
171
  creditAccount: post.creditAccount,
172
+ name: suite.accountStrategyName(post.creditAccount),
173
+ targetCollateral: suite.accountTargetCollateral(post.creditAccount),
172
174
  receivedAmount: oracle.toTokenAmount(receivedToken, require_onchain_utils_bigint_math.BigIntMath.max(totalValue - post.totalDebt, 0n)),
173
175
  error: converter.error
174
176
  };
@@ -176,11 +178,14 @@ function buildClosePreview(post, converter, receivedToken, sdk) {
176
178
  function buildAdjustPreview(post, before, collateralWithdrawn, converter, sdk) {
177
179
  const snap = post.toSnapshot(totalValueInUnderlying(post, converter.convert, require_onchain_constants_math.DUST_THRESHOLD));
178
180
  const market = sdk.marketRegister.findByCreditManager(post.creditManager);
181
+ const suite = sdk.marketRegister.findCreditManager(post.creditManager);
179
182
  const oracle = market.priceOracle;
180
183
  return {
181
184
  operation: "AdjustCreditAccount",
182
185
  ...require_model_previews.asEstimated(sdk.positions.projection(snap, { availableLiquidityChange: before.totalDebt - post.totalDebt })),
183
186
  creditAccount: post.creditAccount,
187
+ name: suite.accountStrategyName(post.creditAccount),
188
+ targetCollateral: suite.accountTargetCollateral(post.creditAccount),
184
189
  collateralAdded: [],
185
190
  collateralWithdrawn: collateralWithdrawn.toAssets().map((a) => oracle.toTokenAmount(a.token, a.balance)),
186
191
  totalDebtChange: market.toUnderlyingAmount(post.totalDebt - before.totalDebt),
@@ -17,6 +17,7 @@ const require_preview_preview_unwrapNativeCollateral = require("./unwrapNativeCo
17
17
  function previewAdjustStrategyPosition(input, operation, options) {
18
18
  const { sdk, value = 0n } = input;
19
19
  const market = sdk.marketRegister.findByCreditManager(operation.creditManager);
20
+ const suite = sdk.marketRegister.findCreditManager(operation.creditManager);
20
21
  const oracle = market.priceOracle;
21
22
  const { before, after, error: replayError } = require_preview_preview_replayMulticall.replayMulticall(sdk, operation, options);
22
23
  const account = after.account;
@@ -40,6 +41,8 @@ function previewAdjustStrategyPosition(input, operation, options) {
40
41
  operation: "AdjustCreditAccount",
41
42
  ...require_model_previews.asEstimated(sdk.positions.projection(snap, { availableLiquidityChange: before.totalDebt - account.totalDebt })),
42
43
  creditAccount: operation.creditAccount,
44
+ name: suite.accountStrategyName(operation.creditAccount),
45
+ targetCollateral: suite.accountTargetCollateral(operation.creditAccount),
43
46
  collateralAdded: collateralAdded.map((a) => oracle.toTokenAmount(a.token, a.balance)),
44
47
  collateralWithdrawn: after.collateralWithdrawn.toAssets().map((a) => oracle.toTokenAmount(a.token, a.balance)),
45
48
  totalDebtChange: market.toUnderlyingAmount(account.totalDebt - before.totalDebt),
@@ -1,7 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_onchain_constants_address_provider = require("../../onchain/constants/address-provider.js");
3
3
  require("../../onchain/constants/math.js");
4
- const require_onchain_market_credit_creditOperationMarket = require("../../onchain/market/credit/creditOperationMarket.js");
5
4
  require("../../onchain/index.js");
6
5
  const require_preview_preview_detectCloseOrRepay = require("./detectCloseOrRepay.js");
7
6
  const require_preview_preview_replayMulticall = require("./replayMulticall.js");
@@ -25,6 +24,7 @@ function previewCloseCreditAccount(input, operation, permanent, replay) {
25
24
  const { sdk } = input;
26
25
  const market = sdk.marketRegister.findByCreditManager(operation.creditManager);
27
26
  const { after, error } = replay;
27
+ const suite = sdk.marketRegister.findCreditManager(operation.creditManager);
28
28
  let receivedToken = market.underlying;
29
29
  for (const m of operation.multicall) if (m.operation === "WithdrawCollateral" && m.amount === 115792089237316195423570985008687907853269984665640564039457584007913129639935n) {
30
30
  receivedToken = m.token;
@@ -33,8 +33,10 @@ function previewCloseCreditAccount(input, operation, permanent, replay) {
33
33
  return {
34
34
  operation: "CloseCreditAccount",
35
35
  permanent,
36
- ...require_onchain_market_credit_creditOperationMarket.creditOperationMarket(sdk.marketRegister.findCreditManager(operation.creditManager)),
36
+ ...suite.creditOperationMarket(),
37
37
  creditAccount: operation.creditAccount,
38
+ name: suite.accountStrategyName(operation.creditAccount),
39
+ targetCollateral: suite.accountTargetCollateral(operation.creditAccount),
38
40
  receivedAmount: market.priceOracle.toTokenAmount(receivedToken, after.collateralWithdrawn.getOrZero(receivedToken)),
39
41
  error
40
42
  };
@@ -50,11 +52,14 @@ function previewRepayCreditAccount(input, operation, permanent, replay) {
50
52
  const { before, after, error: replayError } = replay;
51
53
  const { assets: collateralAdded, error: unwrapError } = require_preview_preview_unwrapNativeCollateral.unwrapNativeCollateral(after.collateralAdded.toAssets(), value, sdk.addressProvider.getAddress(require_onchain_constants_address_provider.AP_WETH_TOKEN, 0));
52
54
  const error = replayError ?? unwrapError;
55
+ const suite = sdk.marketRegister.findCreditManager(operation.creditManager);
53
56
  return {
54
57
  operation: "RepayCreditAccount",
55
58
  permanent,
56
- ...require_onchain_market_credit_creditOperationMarket.creditOperationMarket(sdk.marketRegister.findCreditManager(operation.creditManager)),
59
+ ...suite.creditOperationMarket(),
57
60
  creditAccount: operation.creditAccount,
61
+ name: suite.accountStrategyName(operation.creditAccount),
62
+ targetCollateral: suite.accountTargetCollateral(operation.creditAccount),
58
63
  collateralAdded: collateralAdded.map((a) => market.priceOracle.toTokenAmount(a.token, a.balance)),
59
64
  debtRepaid: market.toUnderlyingAmount(before.totalDebt - after.account.totalDebt),
60
65
  collateralWithdrawn: after.collateralWithdrawn.toAssets().map((a) => market.priceOracle.toTokenAmount(a.token, a.balance)),
@@ -1,6 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_onchain_market_credit_creditOperationMarket = require("../../onchain/market/credit/creditOperationMarket.js");
3
- require("../../onchain/index.js");
4
2
  const require_preview_parse_parseOperationCalldata = require("../parse/parseOperationCalldata.js");
5
3
  const require_preview_parse_types = require("../parse/types.js");
6
4
  require("../parse/index.js");
@@ -67,10 +65,13 @@ async function previewMulticallOperation(input, operation, options) {
67
65
  const convert = (token, to, amount) => market.priceOracle.convert(token, to, amount);
68
66
  const meta = sdk.tokensMeta.get(market.underlying);
69
67
  const receivedToken = meta && sdk.tokensMeta.isRWAUnderlying(meta) ? meta.asset : market.underlying;
68
+ const suite = sdk.marketRegister.findCreditManager(operation.creditManager);
70
69
  return {
71
70
  operation: "DelayedCreditAccountOperation",
72
71
  creditAccount: operation.creditAccount,
73
- ...require_onchain_market_credit_creditOperationMarket.creditOperationMarket(sdk.marketRegister.findCreditManager(operation.creditManager)),
72
+ ...suite.creditOperationMarket(),
73
+ name: suite.accountStrategyName(operation.creditAccount),
74
+ targetCollateral: suite.accountTargetCollateral(operation.creditAccount),
74
75
  intent: delayed.intent,
75
76
  estClaimableAt: require_preview_preview_estimateClaimableAt.estimateClaimableAt(sdk, delayed.request.phantomToken),
76
77
  instantPreview,
@@ -16,6 +16,7 @@ async function previewPoolPositionOperation(input, operation, options) {
16
16
  operation: operation.operation,
17
17
  pool: operation.pool,
18
18
  name: sdk.tokensMeta.mustGetToken(operation.pool).name,
19
+ underlyingToken: market.underlyingToken,
19
20
  shareRate: market.pool.pool.dieselRate,
20
21
  tokenIn: market.priceOracle.toTokenAmount(tokenIn, sim.amountIn),
21
22
  tokenOut: market.priceOracle.toTokenAmount(tokenOut, sim.amountOut)
@@ -1,5 +1,5 @@
1
1
  import { ZodAddress } from "../onchain/utils/zod.js";
2
- import { assetTypeSchema, bpsSchema, chainIdSchema, timestampSchema, tokenAmountSchema, tokenSchema, txCallSchema } from "./primitives.schema.js";
2
+ import { assetTypeSchema, bpsSchema, chainIdSchema, timestampSchema, tokenAmountSchema, tokenSchema, txCallSchema, underlyingTokenSchema } from "./primitives.schema.js";
3
3
  import { curatorSchema } from "./curators.schema.js";
4
4
  import { filterable } from "./filters.schema.js";
5
5
  import { z } from "zod/v4";
@@ -24,6 +24,7 @@ const liquidatableAccountFilterSchema = z.object({
24
24
  const liquidatableAccountSchema = z.object({
25
25
  creditManager: ZodAddress(),
26
26
  name: z.string(),
27
+ underlyingToken: underlyingTokenSchema,
27
28
  curator: curatorSchema,
28
29
  liquidationDiscount: bpsSchema,
29
30
  chainId: chainIdSchema,
@@ -1,6 +1,7 @@
1
1
  import "../../../constants/math.js";
2
2
  import "../../../constants/index.js";
3
3
  import { calcMaxLeverage, usdToNumber } from "../../../market/math.js";
4
+ import { CreditSuite } from "../../../market/credit/CreditSuite.js";
4
5
  import { PositionsService } from "../../../positions/PositionsService.js";
5
6
  import { vi } from "vitest";
6
7
  //#region src/onchain/accounts/intents/testing/sdk-mock.ts
@@ -225,9 +226,22 @@ function buildMockSdk(args) {
225
226
  const forbiddenTokensMask = collateralTokens.reduce((mask, token, i) => forbidden.has(token) ? mask | 1n << BigInt(i) : mask, 0n);
226
227
  const facadePaused = args.facadePaused ?? false;
227
228
  const expirationDate = args.expirationDate ?? 0;
229
+ const strategyTargetCollateral = args.strategyTargetCollateral ?? collateralTokens.find((t) => t !== args.underlying.toLowerCase());
230
+ const unwrappedUnderlying = args.rwaAssets?.[args.underlying.toLowerCase()] ?? args.underlying;
231
+ const underlyingToken = {
232
+ ...tokenOf(unwrappedUnderlying),
233
+ wrappedAddress: unwrappedUnderlying.toLowerCase() === args.underlying.toLowerCase() ? null : args.underlying
234
+ };
235
+ const strategyName = strategyTargetCollateral ? `${tokenOf(strategyTargetCollateral).symbol} / ${underlyingToken.symbol}` : void 0;
228
236
  const creditManagerSuite = {
229
237
  name: "TestCreditManager",
238
+ strategyName,
239
+ underlyingToken,
240
+ accountTargetCollateral: () => strategyTargetCollateral ? tokenOf(strategyTargetCollateral) : null,
241
+ accountStrategyName: () => strategyName ?? underlyingToken.symbol,
230
242
  liquidationFees: () => MOCK_LIQUIDATION_FEES,
243
+ totalLiquidationDiscount: CreditSuite.prototype.totalLiquidationDiscount,
244
+ creditOperationMarket: CreditSuite.prototype.creditOperationMarket,
231
245
  creditManager: {
232
246
  address: args.creditManager,
233
247
  liquidationThresholds,
@@ -248,7 +262,7 @@ function buildMockSdk(args) {
248
262
  market,
249
263
  isPaused: facadePaused || poolPaused,
250
264
  forbiddenTokens: [...forbidden],
251
- strategyTargetCollateral: args.strategyTargetCollateral ?? collateralTokens.find((t) => t !== args.underlying.toLowerCase()),
265
+ strategyTargetCollateral,
252
266
  isExpired: expirationDate > 0 && expirationDate < (args.timestamp ?? 0)
253
267
  };
254
268
  const routeCalls = (tokenIn, tokenOut) => {
@@ -10,7 +10,6 @@ import { SDKConstruct } from "../../base/SDKConstruct.js";
10
10
  import "../../base/index.js";
11
11
  import { usdToNumber } from "../../market/math.js";
12
12
  import { dominantCollateral } from "../../market/credit/collateralUtils.js";
13
- import { creditOperationMarket } from "../../market/credit/creditOperationMarket.js";
14
13
  import { matchesLiquidatableAccountFilter } from "../../../model/liquidations.js";
15
14
  import "../../../model/index.js";
16
15
  import { RWA_LIQUIDATOR_MIDAS } from "../../market/rwa/midas/constants.js";
@@ -260,7 +259,7 @@ var LiquidationsService = class extends SDKConstruct {
260
259
  const token = this.sdk.tokensMeta.mustGetToken(unwrappedUnderlying);
261
260
  const usd = (part) => ca.totalValue > 0n ? usdToNumber(ca.totalValueUSD * part / ca.totalValue) : 0;
262
261
  return {
263
- ...creditOperationMarket(suite),
262
+ ...suite.creditOperationMarket(),
264
263
  chainId: this.sdk.chainId,
265
264
  creditAccount: ca.creditAccount,
266
265
  asset: this.sdk.tokensMeta.mustGetToken(this.#mainAsset(ca, market, unwrappedUnderlying)),
@@ -138,7 +138,6 @@ import { CreditManagerV310Contract } from "./market/credit/CreditManagerV310Cont
138
138
  import { strategyName } from "./market/strategyName.js";
139
139
  import { dominantCollateral, isStrategyCollateral, pickStrategyTargetCollateral } from "./market/credit/collateralUtils.js";
140
140
  import { CreditSuite } from "./market/credit/CreditSuite.js";
141
- import { creditOperationMarket, totalLiquidationDiscount } from "./market/credit/creditOperationMarket.js";
142
141
  import { expectedBalanceDeltas } from "./market/credit/expectedBalanceDeltas.js";
143
142
  import { simulateMulticall } from "./utils/viem/simulateMulticall.js";
144
143
  import { SimulateWithPriceUpdatesError, getSimulateWithPriceUpdatesError, simulateWithPriceUpdates } from "./utils/viem/simulateWithPriceUpdates.js";
@@ -247,4 +246,4 @@ import { MultichainSDK } from "./MultichainSDK.js";
247
246
  import { attachOptionsSchema, onchainSDKOptionsSchema } from "./options.js";
248
247
  import "./types/index.js";
249
248
  import "./validation/index.js";
250
- export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_RWA_COMPRESSOR, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, AccountMigratorAdapterContract, AdapterType, AddressMap, AddressProviderV310Contract, AddressSet, AssetsMap, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, BasePlugin, BigIntMath, BotPermissions, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainContractsRegister, ChainNotConfiguredError, CompositePriceFeedContract, Construct, ContractParseError, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountOperationsService, CreditAccountsServiceV310, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DUST_THRESHOLD, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, Erc4626PriceFeedContract, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, IERC20ZapperContract, IETHZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, IntentPreviewError, InvalidDelayedIntentError, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationsService, MAX_INT, MAX_LEVERAGE_BUFFER_BPS, MAX_UINT16, MAX_UINT256, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_INT96, MIN_SAFE_HEALTH_FACTOR_FORM, MULTICALL_ADDRESS, MarketRegister, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, MultichainConstruct, MultichainLiquidationsService, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainSDK, OpportunitiesService, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PluginStateVersionError, PoolService, PoolSuite, PoolV310Contract, PositionsService, PriceFeedRef, PriceFeedRegister, PriceOracleV310Contract, PythPriceFeed, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWARegistry, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RedemptionLoggerV310Contract, RedstonePriceFeedContract, RouterV310Contract, SDKConstruct, SECONDS_PER_YEAR, SECURITIZE_REGISTER_VAULT_TYPES, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRedemptionGatewayAdapterContract, SimulateWithPriceUpdatesError, SimulationError, StakingRewardsAdapterContract, TokensMeta, TraderJoePoolVersion, TraderJoeRouterAdapterContract, TypedObjectUtils, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UnsupportedZapperFunctionError, UpshiftVaultAdapterContract, VERSION_RANGE_310, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, ZapperContract, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, accountSnapshotFromCreditAccountData, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, amountOf, assetsMap, attachOptionsSchema, borrowable, botPermissionsToString, bpsToRay, bytes32ToString, calcBorrowApy, calcBorrowRate, calcDefaultQuota, calcEffectiveBorrowApy, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcQuotaUpdate, calcRecommendedQuota, calcTimeToLiquidationMs, calcUtilization, calcUtilizationRaw, chains, checkBorrowLimit, checkCollateralised, checkCreditManagerPaused, checkDebtInBand, checkForbiddenToken, checkFunding, checkLeverageAtLeastOne, checkMarketExpired, checkPoolPaused, checkPoolPayout, checkPoolSunset, checkPreviewError, checkQuotaCount, checkQuotaLimit, childLogger, classifyCurveOperation, collateralPriceInUnderlying, collectTraces, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, abi as creditFacadeV310Abi, creditOperationMarket, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, decodeDelayedIntent, detectNetwork, dominantCollateral, encodeDelayedIntent, erc4626ReferralAdapterAbi, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, executeMulticallBatches, expectedBalanceDeltas, fetchCreditAccountSlice, fetchRedstonePayloads, filterDust, filterDustUSD, findCallTo, findCallWithInput, findCuratorMarketConfigurator, findExecuteBytes, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAccountTargetCollateral, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getLegacyStrategyTarget, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hasAdapterDeployParamsAbi, healthFactorBps, hexEq, hydrateAddressProvider, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCreditAccountAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isDust, isLPPriceFeed, isMalformedPreviewError, isPhantomToken, isPublicNetwork, isRWAFactory, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, isZeroBalance, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, percentFmt, pickStrategyTargetCollateral, raise, rayToBps, rayToNumber, refuse, resolveProtocolCall, retry, rewardsFromTransfers, roundUpQuota, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, soleNonUnderlyingCollateral, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toShares, toSharesUp, toSignificant, toToken, toTokenAmount, toWithdrawalStatus, totalLiquidationDiscount, usdToNumber, watchBlocksAsync };
249
+ export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_RWA_COMPRESSOR, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, AccountMigratorAdapterContract, AdapterType, AddressMap, AddressProviderV310Contract, AddressSet, AssetsMap, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, BasePlugin, BigIntMath, BotPermissions, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainContractsRegister, ChainNotConfiguredError, CompositePriceFeedContract, Construct, ContractParseError, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountOperationsService, CreditAccountsServiceV310, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DUST_THRESHOLD, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, Erc4626PriceFeedContract, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, IERC20ZapperContract, IETHZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, IntentPreviewError, InvalidDelayedIntentError, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationsService, MAX_INT, MAX_LEVERAGE_BUFFER_BPS, MAX_UINT16, MAX_UINT256, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_INT96, MIN_SAFE_HEALTH_FACTOR_FORM, MULTICALL_ADDRESS, MarketRegister, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, MultichainConstruct, MultichainLiquidationsService, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainSDK, OpportunitiesService, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PluginStateVersionError, PoolService, PoolSuite, PoolV310Contract, PositionsService, PriceFeedRef, PriceFeedRegister, PriceOracleV310Contract, PythPriceFeed, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWARegistry, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RedemptionLoggerV310Contract, RedstonePriceFeedContract, RouterV310Contract, SDKConstruct, SECONDS_PER_YEAR, SECURITIZE_REGISTER_VAULT_TYPES, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRedemptionGatewayAdapterContract, SimulateWithPriceUpdatesError, SimulationError, StakingRewardsAdapterContract, TokensMeta, TraderJoePoolVersion, TraderJoeRouterAdapterContract, TypedObjectUtils, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UnsupportedZapperFunctionError, UpshiftVaultAdapterContract, VERSION_RANGE_310, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, ZapperContract, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, accountSnapshotFromCreditAccountData, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, amountOf, assetsMap, attachOptionsSchema, borrowable, botPermissionsToString, bpsToRay, bytes32ToString, calcBorrowApy, calcBorrowRate, calcDefaultQuota, calcEffectiveBorrowApy, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcQuotaUpdate, calcRecommendedQuota, calcTimeToLiquidationMs, calcUtilization, calcUtilizationRaw, chains, checkBorrowLimit, checkCollateralised, checkCreditManagerPaused, checkDebtInBand, checkForbiddenToken, checkFunding, checkLeverageAtLeastOne, checkMarketExpired, checkPoolPaused, checkPoolPayout, checkPoolSunset, checkPreviewError, checkQuotaCount, checkQuotaLimit, childLogger, classifyCurveOperation, collateralPriceInUnderlying, collectTraces, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, abi as creditFacadeV310Abi, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, decodeDelayedIntent, detectNetwork, dominantCollateral, encodeDelayedIntent, erc4626ReferralAdapterAbi, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, executeMulticallBatches, expectedBalanceDeltas, fetchCreditAccountSlice, fetchRedstonePayloads, filterDust, filterDustUSD, findCallTo, findCallWithInput, findCuratorMarketConfigurator, findExecuteBytes, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAccountTargetCollateral, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getLegacyStrategyTarget, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hasAdapterDeployParamsAbi, healthFactorBps, hexEq, hydrateAddressProvider, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCreditAccountAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isDust, isLPPriceFeed, isMalformedPreviewError, isPhantomToken, isPublicNetwork, isRWAFactory, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, isZeroBalance, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, percentFmt, pickStrategyTargetCollateral, raise, rayToBps, rayToNumber, refuse, resolveProtocolCall, retry, rewardsFromTransfers, roundUpQuota, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, soleNonUnderlyingCollateral, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toShares, toSharesUp, toSignificant, toToken, toTokenAmount, toWithdrawalStatus, usdToNumber, watchBlocksAsync };