@gearbox-protocol/sdk 15.1.0-next.19 → 15.1.0-next.20

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 (82) hide show
  1. package/dist/cjs/common-utils/charts/credit-session.js +1 -1
  2. package/dist/cjs/model/opportunities.js +4 -4
  3. package/dist/cjs/model/opportunities.schema.js +1 -2
  4. package/dist/cjs/new-sdk/prepare/PrepareApi.js +14 -10
  5. package/dist/cjs/offchain/opportunities/OffchainOpportunities.js +1 -1
  6. package/dist/cjs/plugins/accounts-counter/AccountsCounterPlugin.js +1 -1
  7. package/dist/cjs/sdk/OnchainSDK.js +2 -2
  8. package/dist/cjs/sdk/accounts/intents/testing/market.js +2 -1
  9. package/dist/cjs/sdk/accounts/intents/testing/sdk-mock.js +1 -0
  10. package/dist/cjs/sdk/accounts/intents/utils/pick-token.js +2 -2
  11. package/dist/cjs/sdk/accounts/intents/utils/quotas-for-update.js +1 -1
  12. package/dist/cjs/sdk/accounts/liquidations/LiquidationsService.js +2 -2
  13. package/dist/cjs/sdk/chain/chains.js +140 -51
  14. package/dist/cjs/sdk/chain/index.js +3 -0
  15. package/dist/cjs/sdk/constants/networks.js +1 -1
  16. package/dist/cjs/sdk/core/AbstractAddressProviderContract.js +1 -1
  17. package/dist/cjs/sdk/index.js +11 -7
  18. package/dist/cjs/sdk/market/MarketSuite.js +8 -39
  19. package/dist/cjs/sdk/market/credit/CreditSuite.js +61 -37
  20. package/dist/cjs/sdk/market/credit/{isStrategyCollateral.js → collateralUtils.js} +52 -5
  21. package/dist/cjs/sdk/market/credit/index.js +5 -6
  22. package/dist/cjs/sdk/market/index.js +7 -6
  23. package/dist/cjs/sdk/market/strategyName.js +19 -0
  24. package/dist/cjs/sdk/opportunities/OpportunitiesService.js +5 -3
  25. package/dist/cjs/sdk/positions/PositionsService.js +5 -10
  26. package/dist/cjs/sdk/utils/index.js +1 -1
  27. package/dist/esm/common-utils/charts/credit-session.js +1 -1
  28. package/dist/esm/model/opportunities.js +4 -4
  29. package/dist/esm/model/opportunities.schema.js +1 -2
  30. package/dist/esm/new-sdk/prepare/PrepareApi.js +14 -10
  31. package/dist/esm/offchain/opportunities/OffchainOpportunities.js +1 -1
  32. package/dist/esm/plugins/accounts-counter/AccountsCounterPlugin.js +1 -1
  33. package/dist/esm/sdk/OnchainSDK.js +2 -2
  34. package/dist/esm/sdk/accounts/intents/testing/market.js +2 -1
  35. package/dist/esm/sdk/accounts/intents/testing/sdk-mock.js +1 -0
  36. package/dist/esm/sdk/accounts/intents/utils/pick-token.js +1 -1
  37. package/dist/esm/sdk/accounts/intents/utils/quotas-for-update.js +1 -1
  38. package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +1 -1
  39. package/dist/esm/sdk/chain/chains.js +139 -53
  40. package/dist/esm/sdk/chain/index.js +2 -2
  41. package/dist/esm/sdk/constants/networks.js +1 -1
  42. package/dist/esm/sdk/core/AbstractAddressProviderContract.js +1 -1
  43. package/dist/esm/sdk/index.js +5 -5
  44. package/dist/esm/sdk/market/MarketSuite.js +8 -39
  45. package/dist/esm/sdk/market/credit/CreditSuite.js +62 -38
  46. package/dist/esm/sdk/market/credit/{isStrategyCollateral.js → collateralUtils.js} +51 -6
  47. package/dist/esm/sdk/market/credit/index.js +2 -3
  48. package/dist/esm/sdk/market/index.js +3 -3
  49. package/dist/esm/sdk/market/strategyName.js +18 -0
  50. package/dist/esm/sdk/opportunities/OpportunitiesService.js +5 -3
  51. package/dist/esm/sdk/positions/PositionsService.js +5 -10
  52. package/dist/esm/sdk/utils/index.js +1 -1
  53. package/dist/types/model/index.d.ts +1 -1
  54. package/dist/types/model/opportunities.d.ts +8 -15
  55. package/dist/types/model/opportunities.schema.d.ts +0 -2
  56. package/dist/types/model/positions.d.ts +2 -10
  57. package/dist/types/new-sdk/errors/SourceChainMismatchError.d.ts +1 -1
  58. package/dist/types/new-sdk/positions/mergePositionList.d.ts +3 -2
  59. package/dist/types/new-sdk/types.d.ts +1 -1
  60. package/dist/types/sdk/accounts/intents/testing/sdk-mock.d.ts +5 -0
  61. package/dist/types/sdk/accounts/liquidations/types.d.ts +1 -1
  62. package/dist/types/sdk/base/MultichainConstruct.d.ts +1 -1
  63. package/dist/types/sdk/base/TokensMeta.d.ts +1 -1
  64. package/dist/types/sdk/chain/chains.d.ts +51 -7
  65. package/dist/types/sdk/chain/index.d.ts +2 -2
  66. package/dist/types/sdk/index.d.ts +7 -7
  67. package/dist/types/sdk/market/MarketRegister.d.ts +1 -1
  68. package/dist/types/sdk/market/MarketSuite.d.ts +4 -34
  69. package/dist/types/sdk/market/ZapperRegister.d.ts +1 -1
  70. package/dist/types/sdk/market/credit/CreditSuite.d.ts +23 -14
  71. package/dist/types/sdk/market/credit/{isStrategyCollateral.d.ts → collateralUtils.d.ts} +36 -8
  72. package/dist/types/sdk/market/credit/index.d.ts +2 -3
  73. package/dist/types/sdk/market/index.d.ts +4 -4
  74. package/dist/types/sdk/market/oracle/PriceOracleBaseContract.d.ts +1 -1
  75. package/dist/types/sdk/market/oracle/types.d.ts +1 -1
  76. package/dist/types/sdk/market/strategyName.d.ts +18 -0
  77. package/dist/types/sdk/opportunities/OpportunitiesService.d.ts +2 -2
  78. package/dist/types/sdk/positions/types.d.ts +1 -1
  79. package/package.json +1 -1
  80. package/dist/cjs/sdk/market/credit/dominantCollateral.js +0 -47
  81. package/dist/esm/sdk/market/credit/dominantCollateral.js +0 -45
  82. package/dist/types/sdk/market/credit/dominantCollateral.d.ts +0 -29
@@ -154,16 +154,20 @@ var PrepareApi = class extends MultichainConstruct {
154
154
  async openNewStrategy(strategy, params) {
155
155
  return this.queryChain({
156
156
  network: strategy.chainId,
157
- run: (sdk) => service(sdk).openStrategyIntent({
158
- sdk,
159
- creditManager: strategy.creditManager,
160
- collateral: params.collateral,
161
- targetToken: params.targetToken ?? strategy.targetCollateral,
162
- leverage: params.leverage,
163
- leftoverBalances: params.leftoverBalances,
164
- slippage: params.slippage,
165
- quotaReserve: params.quotaReserve
166
- })
157
+ run: (sdk) => {
158
+ const targetToken = params.targetToken ?? sdk.marketRegister.findCreditManager(strategy.creditManager).strategyTargetCollateral;
159
+ if (!targetToken) throw new Error(`credit manager ${strategy.creditManager} has no strategy target collateral`);
160
+ return service(sdk).openStrategyIntent({
161
+ sdk,
162
+ creditManager: strategy.creditManager,
163
+ collateral: params.collateral,
164
+ targetToken,
165
+ leverage: params.leverage,
166
+ leftoverBalances: params.leftoverBalances,
167
+ slippage: params.slippage,
168
+ quotaReserve: params.quotaReserve
169
+ });
170
+ }
167
171
  });
168
172
  }
169
173
  /**
@@ -52,7 +52,7 @@ var OffchainOpportunities = class extends AbstractOffchainNamespace {
52
52
  return `${this.#root}/pools/${key.chainId}/${key.pool}`;
53
53
  }
54
54
  #strategyPath(key) {
55
- return `${this.#root}/strategies/${key.chainId}/${key.creditManager}/${key.targetCollateral}`;
55
+ return `${this.#root}/strategies/${key.chainId}/${key.creditManager}`;
56
56
  }
57
57
  #chartRoot(key) {
58
58
  return key.kind === "pool" ? this.#poolPath(key) : this.#strategyPath(key);
@@ -1,8 +1,8 @@
1
1
  import { AddressMap } from "../../sdk/utils/AddressMap.js";
2
- import { TypedObjectUtils } from "../../sdk/utils/mappers.js";
3
2
  import { AP_CREDIT_ACCOUNT_COMPRESSOR } from "../../sdk/constants/address-provider.js";
4
3
  import { ADDRESS_0X0 } from "../../sdk/constants/addresses.js";
5
4
  import { MAX_UINT256 } from "../../sdk/constants/math.js";
5
+ import { TypedObjectUtils } from "../../sdk/utils/mappers.js";
6
6
  import { VERSION_RANGE_310 } from "../../sdk/constants/versions.js";
7
7
  import { creditAccountCompressorAbi } from "../../abi/compressors/creditAccountCompressor.js";
8
8
  import { BasePlugin } from "../../sdk/plugins/BasePlugin.js";
@@ -1,7 +1,7 @@
1
- import { TypedObjectUtils } from "./utils/mappers.js";
2
1
  import { getChain } from "./chain/chains.js";
3
2
  import "./chain/index.js";
4
3
  import { ADDRESS_PROVIDER_V310, AP_GEAR_TOKEN, AP_ROUTER } from "./constants/address-provider.js";
4
+ import { TypedObjectUtils } from "./utils/mappers.js";
5
5
  import { VERSION_RANGE_310, isV310 } from "./constants/versions.js";
6
6
  import "./constants/index.js";
7
7
  import { formatTimestamp } from "./utils/formatter.js";
@@ -152,7 +152,7 @@ var OnchainSDK = class extends ChainContractsRegister {
152
152
  async attach(options) {
153
153
  if (this.#attached) throw new SdkAlreadyAttachedError();
154
154
  const { addressProvider = ADDRESS_PROVIDER_V310, blockNumber, ignoreUpdateablePrices, ignoreMarkets, marketConfigurators: mcs, redstone } = options ?? {};
155
- const marketConfigurators = mcs ?? TypedObjectUtils.keys(this.client.chain.defaultMarketConfigurators);
155
+ const marketConfigurators = mcs ?? this.client.chain.defaultMarketConfigurators.keys();
156
156
  const rwaFactories = options?.rwaFactories ?? this.client.chain.rwaFactories;
157
157
  this.logger?.info({
158
158
  networkType: this.networkType,
@@ -106,7 +106,8 @@ function buildMarketSdk(extras) {
106
106
  availableLiquidity: extras?.availableLiquidity,
107
107
  debtLimitAvailable: extras?.debtLimitAvailable,
108
108
  maxDebtPerBlockMultiplier: extras?.maxDebtPerBlockMultiplier,
109
- forbiddenTokens: extras?.forbiddenTokens
109
+ forbiddenTokens: extras?.forbiddenTokens,
110
+ strategyTargetCollateral: POS
110
111
  });
111
112
  }
112
113
  /** Converts an amount to UND at fixture prices (mirrors the mock oracle). */
@@ -177,6 +177,7 @@ function buildMockSdk(args) {
177
177
  },
178
178
  market,
179
179
  isPaused: facadePaused || poolPaused,
180
+ strategyTargetCollateral: args.strategyTargetCollateral ?? collateralTokens.find((t) => t !== args.underlying.toLowerCase()),
180
181
  isExpired: expirationDate > 0 && expirationDate < (args.timestamp ?? 0)
181
182
  };
182
183
  const routeCalls = (tokenIn, tokenOut) => {
@@ -1,4 +1,4 @@
1
- import { NON_STRATEGY_PHANTOM_TOKEN_TYPES } from "../../../market/credit/isStrategyCollateral.js";
1
+ import { NON_STRATEGY_PHANTOM_TOKEN_TYPES } from "../../../market/credit/collateralUtils.js";
2
2
  import { eq } from "./common.js";
3
3
  import { convertAmount } from "./convert-amount.js";
4
4
  //#region src/sdk/accounts/intents/utils/pick-token.ts
@@ -1,5 +1,5 @@
1
- import { TypedObjectUtils } from "../../../utils/mappers.js";
2
1
  import { MIN_INT96 } from "../../../constants/math.js";
2
+ import { TypedObjectUtils } from "../../../utils/mappers.js";
3
3
  import { calcQuotaUpdate } from "../../../../common-utils/utils/creditAccount/quota-utils.js";
4
4
  //#region src/sdk/accounts/intents/utils/quotas-for-update.ts
5
5
  function getQuotasForUpdate({ assetsBefore, assetsAfter, initialQuotas, quotaReserve = 0, liquidationThresholds: liquidationThresholdsMap, quotas: quotasMap, maxDebt, underlyingToken, convert }) {
@@ -9,7 +9,7 @@ import "../../utils/index.js";
9
9
  import { SDKConstruct } from "../../base/SDKConstruct.js";
10
10
  import "../../base/index.js";
11
11
  import { usdToNumber } from "../../market/math.js";
12
- import { dominantCollateral } from "../../market/credit/dominantCollateral.js";
12
+ import { dominantCollateral } from "../../market/credit/collateralUtils.js";
13
13
  import { matchesLiquidatableAccountFilter } from "../../../model/liquidations.js";
14
14
  import "../../../model/index.js";
15
15
  import { RWA_LIQUIDATOR_MIDAS } from "../../market/rwa/midas/constants.js";
@@ -1,5 +1,6 @@
1
- import { TypedObjectUtils } from "../utils/mappers.js";
2
- import { defineChain, isAddressEqual } from "viem";
1
+ import { AddressMap } from "../utils/AddressMap.js";
2
+ import { AddressSet } from "../utils/AddressSet.js";
3
+ import { defineChain } from "viem";
3
4
  import { arbitrum, avalanche, base, berachain, bsc, etherlink, hemi, lisk, mainnet, megaeth, monad, optimism, plasma, somnia, sonic, worldchain } from "viem/chains";
4
5
  import { z } from "zod/v4";
5
6
  //#region src/sdk/chain/chains.ts
@@ -47,7 +48,7 @@ const chains = {
47
48
  Mainnet: withPublicNode({
48
49
  ...mainnet,
49
50
  network: "Mainnet",
50
- defaultMarketConfigurators: {
51
+ defaultMarketConfigurators: AddressMap.fromRecord({
51
52
  "0xc168343c791d56dd1da4b4b8b0cc1c1ec1a16e6b": "cp0x",
52
53
  "0x3b56538833fc02f4f0e75609390f26ded0c32e42": "Re7",
53
54
  "0x7a133fbd01736fd076158307c9476cc3877f1af5": "Invariant Group",
@@ -55,26 +56,57 @@ const chains = {
55
56
  "0x1b265b97eb169fb6668e3258007c3b0242c7bdbe": "KPK",
56
57
  "0x9dddd1b9ce0ac8aa0c80e4ec141600b9bf0101c3": "UltraYield",
57
58
  "0x601067eba24bb5b558a184fc082525637e96a42d": "Gami Labs"
58
- },
59
- testMarketConfigurators: {
59
+ }),
60
+ testMarketConfigurators: AddressMap.fromRecord({
60
61
  "0x99df7330bf42d596af2e9d9836d4fc2077c574aa": "M11 Credit",
61
62
  "0x610627d8d01a413bdd9b0a0b60070da7dd1e54ad": "Securitize",
62
63
  "0xa770ce584adb6491a2138da6eaec33243bdcd248": "Testnet Curator"
63
- },
64
+ }),
64
65
  rwaFactories: [],
65
- underlyingAssetTypes: {
66
+ underlyingAssetTypes: AddressMap.fromRecord({
66
67
  "0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0": "ETH",
67
68
  "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2": "ETH",
68
69
  "0x18084fbA666a33d37592fA2633fD49a74DD93a88": "BTC",
69
70
  "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48": "Stable",
70
71
  "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599": "BTC"
71
- },
72
- rwaTokens: [
72
+ }),
73
+ rwaTokens: new AddressSet([
73
74
  "0x17418038ecF73BA4026c4f428547BF099706F27B",
74
75
  "0x51C2d74017390CbBd30550179A16A1c28F7210fc",
75
76
  "0x238a700eD6165261Cf8b2e544ba797BC11e466Ba",
76
77
  "0x7433806912Eae67919e66aea853d46Fa0aef98A8"
77
- ],
78
+ ]),
79
+ legacyStrategyTargets: AddressMap.fromRecord({
80
+ "0x1293a69e4ad4a93293a06b6303104be35bdd83af": "0x1a711a5bc48b5c1352c1882fa65dc14b5b9e829d",
81
+ "0x29350a3c2627fb78c7e915cd59af754edf8998c5": "0xe1d9b789da5b5375eacf66f036022b019a2af307",
82
+ "0x79c6c1ce5b12abcc3e407ce8c160ee1160250921": "0x02a4cceed3c400b5ba9fd22ad6ec18d8f7a3d48e",
83
+ "0x9a0fdf7cdab4604fc27ebeab4b3d57bd825e8ebe": "0xcd5fe23c85820f7b72d0926fc9b05b43e359b7ee",
84
+ "0x9fb5493deb601a0329ad8bff43cd182a61321ca7": "0x02a4cceed3c400b5ba9fd22ad6ec18d8f7a3d48e",
85
+ "0x68df4deeff1d9007063395cc190a486dceb05920": "0x31454faa1daa04cacf59a6bd37681da9160d092a",
86
+ "0x0f4e4432977bbf3962322996f1c9aefdbc62256d": "0xda06ee2dacf9245aa80072a4407debdea0d7e341",
87
+ "0xfc896a605da98f3df6da47beb29cb59ae382351d": "0x924d24c238db7ecae2aa3a19430239ed684bde4a",
88
+ "0x52b27889f67887fc9b98a59304037570e7d7e556": "0x4956b52ae2ff65d74ca2d61207523288e4528f96",
89
+ "0xa64d5e7567c5e8f494549dbff60c77846e059706": "0x4956b52ae2ff65d74ca2d61207523288e4528f96",
90
+ "0x0af1324369e3fd78325fab0cb62eea19f3e4ebf0": "0xb908c9fe885369643adb5fba4407d52bd726c72d",
91
+ "0x0fafa30cd35bc6a48ff2b40694d4a73d4f4bcc92": "0xb908c9fe885369643adb5fba4407d52bd726c72d"
92
+ }),
93
+ accountTargetCollaterals: AddressMap.fromRecord({
94
+ "0x56631dcb1ea548d2629e82e01375090ed1f81b7e": "0x1a711a5bc48b5c1352c1882fa65dc14b5b9e829d",
95
+ "0x89014edc549ffa5c5b6e859b1496731bd035c247": "0x31454faa1daa04cacf59a6bd37681da9160d092a",
96
+ "0x3b7ab1f4fee570933b24b202de90ffda82f6cae0": "0x31454faa1daa04cacf59a6bd37681da9160d092a",
97
+ "0x721798d8ccf31ae75c12db82fa72b3806759cbc9": "0x31454faa1daa04cacf59a6bd37681da9160d092a",
98
+ "0xd7273d9594ac88f993eda9773041e621633acea0": "0x1a711a5bc48b5c1352c1882fa65dc14b5b9e829d",
99
+ "0x34442ca47435e90b80d835aab9737166e76d9962": "0x403cc0d2694ec2639101f32b146b90d766461ce9"
100
+ }),
101
+ sunsetPools: new AddressSet([
102
+ "0xF791Ecc5F2472637eac9DFe3f7894C0B32C32bDf",
103
+ "0xC155444481854c60e7a29f4150373f479988F32D",
104
+ "0xF0795C47fA58d00f5F77F4D5c01F31eE891E21B4",
105
+ "0x119f75D5AC5739Ae49ffC46117a20654793A9b18",
106
+ "0xb46edf298989F0F106EDD80E4ae8f59a13531dB4",
107
+ "0xd98e31C67c7C21f233C37c9AC9Ae656dcb0d5d25"
108
+ ]),
109
+ sunsetStrategies: new AddressSet(["0x9fF97B167Dd442bd5f277098bf1154C5807D3566", "0x187C5022002d45107dB72B0b59E72111f69Bd513"]),
78
110
  isPublic: true,
79
111
  wellKnownToken: {
80
112
  address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
@@ -86,7 +118,7 @@ const chains = {
86
118
  Arbitrum: withPublicNode({
87
119
  ...arbitrum,
88
120
  network: "Arbitrum",
89
- defaultMarketConfigurators: { "0x01023850b360b88de0d0f84015bbba1eba57fe7e": "Chaos Labs" },
121
+ defaultMarketConfigurators: AddressMap.fromRecord({ "0x01023850b360b88de0d0f84015bbba1eba57fe7e": "Chaos Labs" }),
90
122
  rwaFactories: [],
91
123
  isPublic: true,
92
124
  wellKnownToken: {
@@ -99,10 +131,10 @@ const chains = {
99
131
  Optimism: withPublicNode({
100
132
  ...optimism,
101
133
  network: "Optimism",
102
- defaultMarketConfigurators: {
134
+ defaultMarketConfigurators: AddressMap.fromRecord({
103
135
  "0x2a15969CE5320868eb609680751cF8896DD92De5": "Chaos Labs",
104
136
  "0x9dddd1b9ce0ac8aa0c80e4ec141600b9bf0101c3": "UltraYield"
105
- },
137
+ }),
106
138
  rwaFactories: [],
107
139
  isPublic: true,
108
140
  wellKnownToken: {
@@ -115,7 +147,7 @@ const chains = {
115
147
  Base: withPublicNode({
116
148
  ...base,
117
149
  network: "Base",
118
- defaultMarketConfigurators: {},
150
+ defaultMarketConfigurators: new AddressMap(),
119
151
  rwaFactories: [],
120
152
  isPublic: false,
121
153
  wellKnownToken: {
@@ -127,7 +159,7 @@ const chains = {
127
159
  Sonic: withPublicNode(defineChain({
128
160
  ...sonic,
129
161
  network: "Sonic",
130
- defaultMarketConfigurators: { "0x8FFDd1F1433674516f83645a768E8900A2A5D076": "Chaos Labs" },
162
+ defaultMarketConfigurators: AddressMap.fromRecord({ "0x8FFDd1F1433674516f83645a768E8900A2A5D076": "Chaos Labs" }),
131
163
  rwaFactories: [],
132
164
  isPublic: true,
133
165
  blockExplorers: { default: {
@@ -145,7 +177,7 @@ const chains = {
145
177
  MegaETH: defineChain({
146
178
  ...megaeth,
147
179
  network: "MegaETH",
148
- defaultMarketConfigurators: {},
180
+ defaultMarketConfigurators: new AddressMap(),
149
181
  rwaFactories: [],
150
182
  isPublic: false,
151
183
  wellKnownToken: {
@@ -161,16 +193,35 @@ const chains = {
161
193
  url: "https://monadscan.com/"
162
194
  } },
163
195
  network: "Monad",
164
- defaultMarketConfigurators: {
196
+ defaultMarketConfigurators: AddressMap.fromRecord({
165
197
  "0x16956912813ab9a38d95730b52a8cf53e860a7c5": "Tulipa",
166
198
  "0x7c6ee1bf9c1eb3ee55bdbdc1e8d0317aab718e0a": "UltraYield"
167
- },
168
- underlyingAssetTypes: {
199
+ }),
200
+ underlyingAssetTypes: AddressMap.fromRecord({
169
201
  "0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A": "ETH",
170
202
  "0x754704Bc059F8C67012fEd69BC8A327a5aafb603": "Stable",
171
203
  "0xe7cd86e13AC4309349F30B3435a9d337750fC82D": "Stable",
172
204
  "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a": "Stable"
173
- },
205
+ }),
206
+ legacyStrategyTargets: AddressMap.fromRecord({
207
+ "0xd9b000e3f14ea2dd27be07859ab3ab9e0ef62dfa": "0x1c8ee940b654bfced403f2a44c1603d5be0f50fa",
208
+ "0x01b3b3c03269e2fdf654676f2e57a9e325a55e51": "0x1c8ee940b654bfced403f2a44c1603d5be0f50fa"
209
+ }),
210
+ sunsetPools: new AddressSet([
211
+ "0x09cA6b76276eC0682adb896418b99CB7E44a58A0",
212
+ "0x34752948B0dc28969485Df2066fFE86D5dc36689",
213
+ "0x164A35F31e4E0F6c45D500962a6978D2cbD5a16b"
214
+ ]),
215
+ sunsetStrategies: new AddressSet([
216
+ "0xA1F05494Dab74Eb9C352C3A042836579fE168aa7",
217
+ "0xb8C7D72CDD00F44390aDF6f0756AB11fd19723B5",
218
+ "0xE01FEeBC233ee715592D056B0a53A4F316a62d1A",
219
+ "0x5b5b351d70A67d18300cD89Db04089Aa37b271d2",
220
+ "0xb21f766c193541305C18cE146DCD3Fdf642b40eF",
221
+ "0x04620081bb818B8CD3996943D0A4a37Dbf296cF4",
222
+ "0x5452971Fc17d025a1AFFDd5F7a44CCDD1BF0524C",
223
+ "0x7ea06087C63568f1071c6BEA3AeB51e070ec68B9"
224
+ ]),
174
225
  rwaFactories: [],
175
226
  isPublic: true,
176
227
  wellKnownToken: {
@@ -183,7 +234,7 @@ const chains = {
183
234
  Berachain: withPublicNode({
184
235
  ...berachain,
185
236
  network: "Berachain",
186
- defaultMarketConfigurators: {},
237
+ defaultMarketConfigurators: new AddressMap(),
187
238
  rwaFactories: [],
188
239
  isPublic: false,
189
240
  blockExplorers: { default: {
@@ -200,7 +251,7 @@ const chains = {
200
251
  Avalanche: withPublicNode({
201
252
  ...avalanche,
202
253
  network: "Avalanche",
203
- defaultMarketConfigurators: {},
254
+ defaultMarketConfigurators: new AddressMap(),
204
255
  rwaFactories: [],
205
256
  isPublic: false,
206
257
  wellKnownToken: {
@@ -212,11 +263,11 @@ const chains = {
212
263
  BNB: withPublicNode({
213
264
  ...bsc,
214
265
  network: "BNB",
215
- defaultMarketConfigurators: {
266
+ defaultMarketConfigurators: AddressMap.fromRecord({
216
267
  "0x19037a281025b83fa37e3264b77af523ff87a3a4": "Chaos Labs",
217
268
  "0x92dc4ee43e9b207e16fbf3fd1a6933563c0a0d35": "Re7"
218
- },
219
- testMarketConfigurators: {},
269
+ }),
270
+ testMarketConfigurators: new AddressMap(),
220
271
  rwaFactories: [],
221
272
  isPublic: true,
222
273
  wellKnownToken: {
@@ -229,7 +280,7 @@ const chains = {
229
280
  WorldChain: defineChain({
230
281
  ...worldchain,
231
282
  network: "WorldChain",
232
- defaultMarketConfigurators: {},
283
+ defaultMarketConfigurators: new AddressMap(),
233
284
  rwaFactories: [],
234
285
  isPublic: false,
235
286
  wellKnownToken: {
@@ -241,8 +292,9 @@ const chains = {
241
292
  Etherlink: defineChain({
242
293
  ...etherlink,
243
294
  network: "Etherlink",
244
- defaultMarketConfigurators: { "0x577424f0e6f50db668cc1bc76babb87e36732291": "Re7" },
245
- underlyingAssetTypes: { "0x796Ea11Fa2dD751eD01b53C372fFDB4AAa8f00F9": "Stable" },
295
+ defaultMarketConfigurators: AddressMap.fromRecord({ "0x577424f0e6f50db668cc1bc76babb87e36732291": "Re7" }),
296
+ underlyingAssetTypes: AddressMap.fromRecord({ "0x796Ea11Fa2dD751eD01b53C372fFDB4AAa8f00F9": "Stable" }),
297
+ legacyStrategyTargets: AddressMap.fromRecord({ "0xf6f9bb0be5128bf6d02de00bba9c34b132c2c8ee": "0x2247b5a46bb79421a314ab0f0b67ffd11dd37ee4" }),
246
298
  rwaFactories: [],
247
299
  isPublic: true,
248
300
  wellKnownToken: {
@@ -255,7 +307,7 @@ const chains = {
255
307
  Hemi: defineChain({
256
308
  ...hemi,
257
309
  network: "Hemi",
258
- defaultMarketConfigurators: { "0xc9961b8a0c763779690577f2c76962c086af2fe3": "Invariant Group" },
310
+ defaultMarketConfigurators: AddressMap.fromRecord({ "0xc9961b8a0c763779690577f2c76962c086af2fe3": "Invariant Group" }),
259
311
  rwaFactories: [],
260
312
  isPublic: true,
261
313
  wellKnownToken: {
@@ -271,7 +323,7 @@ const chains = {
271
323
  Lisk: defineChain({
272
324
  ...lisk,
273
325
  network: "Lisk",
274
- defaultMarketConfigurators: { "0x25778dbf0e56b7feb8358c4aa2f6f9e19a1c145a": "Re7" },
326
+ defaultMarketConfigurators: AddressMap.fromRecord({ "0x25778dbf0e56b7feb8358c4aa2f6f9e19a1c145a": "Re7" }),
275
327
  rwaFactories: [],
276
328
  isPublic: true,
277
329
  wellKnownToken: {
@@ -283,16 +335,23 @@ const chains = {
283
335
  Plasma: defineChain({
284
336
  ...plasma,
285
337
  network: "Plasma",
286
- defaultMarketConfigurators: {
338
+ defaultMarketConfigurators: AddressMap.fromRecord({
287
339
  "0x7a133fbd01736fd076158307c9476cc3877f1af5": "Invariant Group",
288
340
  "0x4bce62622be621ce036691de98afcab0e41a77a3": "UltraYield",
289
341
  "0xce1cf71a28837daaa7b92d00ca4ef2fd649c2a67": "Hyperithm",
290
342
  "0x9655f82b585b11cee8a05576ed8efcf755cec04b": "TelosC"
291
- },
292
- underlyingAssetTypes: {
343
+ }),
344
+ underlyingAssetTypes: AddressMap.fromRecord({
293
345
  "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb": "Stable",
294
346
  "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34": "Stable"
295
- },
347
+ }),
348
+ sunsetPools: new AddressSet([
349
+ "0x76309A9a56309104518847BbA321c261B7B4a43f",
350
+ "0x4273EEa5ffF61d8ee0C397cCcFCc8cF4B518221f",
351
+ "0x53E4e9b8766969c43895839CC9c673bb6bC8Ac97",
352
+ "0xB74760FD26400030620027DD29D19d74D514700e",
353
+ "0xBa21b2807fcF136F1d61F40341d6Fb8F2535615F"
354
+ ]),
296
355
  rwaFactories: [],
297
356
  isPublic: true,
298
357
  wellKnownToken: {
@@ -311,12 +370,13 @@ const chains = {
311
370
  } },
312
371
  blockTime: 200,
313
372
  network: "Somnia",
314
- defaultMarketConfigurators: { "0x1ca8b92aa7233a9f8f7ba031ac45c878141adff0": "Invariant Group" },
315
- underlyingAssetTypes: {
373
+ defaultMarketConfigurators: AddressMap.fromRecord({ "0x1ca8b92aa7233a9f8f7ba031ac45c878141adff0": "Invariant Group" }),
374
+ underlyingAssetTypes: AddressMap.fromRecord({
316
375
  "0x28BEc7E30E6faee657a03e19Bf1128AaD7632A00": "Stable",
317
376
  "0x046EDe9564A72571df6F5e44d0405360c0f4dCab": "ETH"
318
- },
377
+ }),
319
378
  rwaFactories: [],
379
+ sunsetPools: new AddressSet(["0xa561d6D554fB3637F590c4D73527fe19525d596b", "0x6f652fbCfC2107ef9C99456311B5650cd52D6419"]),
320
380
  isPublic: true,
321
381
  wellKnownToken: {
322
382
  address: "0x67B302E35Aef5EEE8c32D934F5856869EF428330",
@@ -395,10 +455,10 @@ function isPublicNetwork(networkOrChainId) {
395
455
  **/
396
456
  function getCuratorName(marketConfigurator, network) {
397
457
  const chainz = network ? [chains[network]] : Object.values(chains);
398
- for (const c of chainz) for (const [a, curator] of TypedObjectUtils.entries({
399
- ...c.defaultMarketConfigurators,
400
- ...c.testMarketConfigurators
401
- })) if (a.toLowerCase() === marketConfigurator.toLowerCase()) return curator;
458
+ for (const c of chainz) {
459
+ const name = c.defaultMarketConfigurators.get(marketConfigurator) ?? c.testMarketConfigurators?.get(marketConfigurator);
460
+ if (name) return name;
461
+ }
402
462
  }
403
463
  /**
404
464
  * Finds the market configurator address for a given curator on a network.
@@ -410,11 +470,8 @@ function getCuratorName(marketConfigurator, network) {
410
470
  **/
411
471
  function findCuratorMarketConfigurator(curator, network) {
412
472
  const { defaultMarketConfigurators, testMarketConfigurators } = chains[network];
413
- const all = {
414
- ...defaultMarketConfigurators,
415
- ...testMarketConfigurators
416
- };
417
- for (const [a, c] of TypedObjectUtils.entries(all)) if (c === curator) return a;
473
+ for (const [address, name] of defaultMarketConfigurators.entries()) if (name === curator) return address;
474
+ for (const [address, name] of testMarketConfigurators?.entries() ?? []) if (name === curator) return address;
418
475
  }
419
476
  /**
420
477
  * Looks up the {@link AssetType} of a token in hardcoded classifier.
@@ -425,9 +482,7 @@ function findCuratorMarketConfigurator(curator, network) {
425
482
  * @returns The asset type, or `undefined` when the token is not classified
426
483
  **/
427
484
  function getAssetType(token, network) {
428
- const table = chains[network].underlyingAssetTypes;
429
- if (!table) return;
430
- for (const [a, assetType] of TypedObjectUtils.entries(table)) if (isAddressEqual(a, token)) return assetType;
485
+ return chains[network].underlyingAssetTypes?.get(token);
431
486
  }
432
487
  /**
433
488
  * Checks whether a token represents a real-world asset, per the curated list of
@@ -437,7 +492,7 @@ function getAssetType(token, network) {
437
492
  * @param network - Network the token lives on.
438
493
  **/
439
494
  function isRWAToken(token, network) {
440
- return !!chains[network].rwaTokens?.some((t) => isAddressEqual(t, token));
495
+ return !!chains[network].rwaTokens?.has(token);
441
496
  }
442
497
  /**
443
498
  * Checks whether a pool is on the sunset list of a network.
@@ -446,7 +501,7 @@ function isRWAToken(token, network) {
446
501
  * @param network - Network the pool lives on.
447
502
  **/
448
503
  function isSunsetPool(pool, network) {
449
- return !!chains[network].sunsetPools?.some((p) => isAddressEqual(p, pool));
504
+ return !!chains[network].sunsetPools?.has(pool);
450
505
  }
451
506
  /**
452
507
  * Checks whether a credit manager is on the sunset list of a network.
@@ -455,7 +510,38 @@ function isSunsetPool(pool, network) {
455
510
  * @param network - Network the credit manager lives on.
456
511
  **/
457
512
  function isSunsetStrategy(creditManager, network) {
458
- return !!chains[network].sunsetStrategies?.some((s) => isAddressEqual(s, creditManager));
513
+ return !!chains[network].sunsetStrategies?.has(creditManager);
514
+ }
515
+ /**
516
+ * Hardcoded target collateral of a legacy credit manager, or `undefined` when
517
+ * the manager is not in the table and the on-chain rule should apply.
518
+ *
519
+ * @param creditManager - Credit manager address.
520
+ * @param network - Chain id or {@link NetworkType} label.
521
+ **/
522
+ function getLegacyStrategyTarget(creditManager, network) {
523
+ return getChain(network).legacyStrategyTargets?.get(creditManager);
524
+ }
525
+ /**
526
+ * Hardcoded target collateral of an already-existing credit account, or
527
+ * `undefined` when the account is not in the table and the credit manager's
528
+ * target should apply.
529
+ *
530
+ * @param creditAccount - Credit account address.
531
+ * @param network - Chain id or {@link NetworkType} label.
532
+ **/
533
+ function getAccountTargetCollateral(creditAccount, network) {
534
+ return getChain(network).accountTargetCollaterals?.get(creditAccount);
535
+ }
536
+ /**
537
+ * Curated display name of a token, or `undefined` when the token has none and
538
+ * its ticker symbol should be used instead.
539
+ *
540
+ * @param token - Token address.
541
+ * @param network - Chain id or {@link NetworkType} label.
542
+ **/
543
+ function getTokenPrettyName(token, network) {
544
+ return getChain(network).tokenPrettyNames?.get(token);
459
545
  }
460
546
  //#endregion
461
- export { NetworkType, SUPPORTED_NETWORKS, chains, findCuratorMarketConfigurator, getAssetType, getChain, getCuratorName, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds };
547
+ export { NetworkType, SUPPORTED_NETWORKS, chains, findCuratorMarketConfigurator, getAccountTargetCollateral, getAssetType, getChain, getCuratorName, getLegacyStrategyTarget, getNetworkType, getTokenPrettyName, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds };
@@ -1,3 +1,3 @@
1
- import { NetworkType, SUPPORTED_NETWORKS, chains, findCuratorMarketConfigurator, getAssetType, getChain, getCuratorName, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds } from "./chains.js";
1
+ import { NetworkType, SUPPORTED_NETWORKS, chains, findCuratorMarketConfigurator, getAccountTargetCollateral, getAssetType, getChain, getCuratorName, getLegacyStrategyTarget, getNetworkType, getTokenPrettyName, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds } from "./chains.js";
2
2
  import { detectNetwork } from "./detectNetwork.js";
3
- export { NetworkType, SUPPORTED_NETWORKS, chains, detectNetwork, findCuratorMarketConfigurator, getAssetType, getChain, getCuratorName, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds };
3
+ export { NetworkType, SUPPORTED_NETWORKS, chains, detectNetwork, findCuratorMarketConfigurator, getAccountTargetCollateral, getAssetType, getChain, getCuratorName, getLegacyStrategyTarget, getNetworkType, getTokenPrettyName, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds };
@@ -1,6 +1,6 @@
1
- import { TypedObjectUtils } from "../utils/mappers.js";
2
1
  import { chains } from "../chain/chains.js";
3
2
  import "../chain/index.js";
3
+ import { TypedObjectUtils } from "../utils/mappers.js";
4
4
  //#region src/sdk/constants/networks.ts
5
5
  const BLOCK_DURATION_LOCAL = {
6
6
  Mainnet: 12050,
@@ -1,5 +1,5 @@
1
- import { TypedObjectUtils } from "../utils/mappers.js";
2
1
  import "../constants/address-provider.js";
2
+ import { TypedObjectUtils } from "../utils/mappers.js";
3
3
  import "../constants/index.js";
4
4
  import { BaseContract } from "../base/BaseContract.js";
5
5
  import "../base/index.js";
@@ -7,8 +7,7 @@ import { BigIntMath } from "./utils/bigint-math.js";
7
7
  import { bytes32ToString } from "./utils/bytes32ToString.js";
8
8
  import { childLogger } from "./utils/childLogger.js";
9
9
  import { createRawTx } from "./utils/createRawTx.js";
10
- import { TypedObjectUtils } from "./utils/mappers.js";
11
- import { NetworkType, SUPPORTED_NETWORKS, chains, findCuratorMarketConfigurator, getAssetType, getChain, getCuratorName, getNetworkType, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds } from "./chain/chains.js";
10
+ import { NetworkType, SUPPORTED_NETWORKS, chains, findCuratorMarketConfigurator, getAccountTargetCollateral, getAssetType, getChain, getCuratorName, getLegacyStrategyTarget, getNetworkType, getTokenPrettyName, isPublicNetwork, isRWAToken, isSunsetPool, isSunsetStrategy, isSupportedNetwork, toChainIds } from "./chain/chains.js";
12
11
  import { detectNetwork } from "./chain/detectNetwork.js";
13
12
  import "./chain/index.js";
14
13
  import { etherscanApiUrl, etherscanUrl } from "./utils/etherscan.js";
@@ -16,6 +15,7 @@ import { ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTE
16
15
  import { ADDRESS_0X0, MULTICALL_ADDRESS, NATIVE_ADDRESS, NOT_DEPLOYED } from "./constants/addresses.js";
17
16
  import { BotPermissions, botPermissionsToString } from "./constants/bot-permissions.js";
18
17
  import { DUST_THRESHOLD, LEVERAGE_DECIMALS, MAX_INT, MAX_UINT16, MAX_UINT256, MIN_INT96, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PRICE_DECIMALS, PRICE_DECIMALS_POW, RAY, RAY_DECIMALS_POW, SECONDS_PER_YEAR, SLIPPAGE_DECIMALS, WAD, WAD_DECIMALS_POW, halfRAY } from "./constants/math.js";
18
+ import { TypedObjectUtils } from "./utils/mappers.js";
19
19
  import { BLOCKS_PER_WEEK_BY_NETWORK, RAMP_DURATION_BY_NETWORK } from "./constants/networks.js";
20
20
  import { PERIPHERY_CONTRACTS } from "./constants/periphery.js";
21
21
  import { VERSION_RANGE_310, isV310, isVersionRange } from "./constants/versions.js";
@@ -133,8 +133,8 @@ import { CreditFacadeV310BaseContract, creditFacadeV310Abi as abi } from "./mark
133
133
  import { CreditFacadeV310Contract } from "./market/credit/CreditFacadeV310Contract.js";
134
134
  import { MAX_LEVERAGE_BUFFER_BPS, PARTIAL_LIQUIDATION_BUFFER_BPS, calcAdditionalBorrowApy, calcBorrowApy, calcMaxLeverage, calcPositionLeverage, calcUtilization, healthFactorBps, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount, rayToBps, usdToNumber } from "./market/math.js";
135
135
  import { CreditManagerV310Contract } from "./market/credit/CreditManagerV310Contract.js";
136
- import { dominantCollateral, mustGetDominantCollateral } from "./market/credit/dominantCollateral.js";
137
- import { NON_STRATEGY_PHANTOM_TOKEN_TYPES, isStrategyCollateral } from "./market/credit/isStrategyCollateral.js";
136
+ import { strategyName } from "./market/strategyName.js";
137
+ import { NON_STRATEGY_PHANTOM_TOKEN_TYPES, dominantCollateral, isStrategyCollateral, pickStrategyTargetCollateral } from "./market/credit/collateralUtils.js";
138
138
  import { CreditSuite } from "./market/credit/CreditSuite.js";
139
139
  import { expectedBalanceDeltas } from "./market/credit/expectedBalanceDeltas.js";
140
140
  import { simulateMulticall } from "./utils/viem/simulateMulticall.js";
@@ -238,4 +238,4 @@ import { OnchainSDK, STATE_VERSION } from "./OnchainSDK.js";
238
238
  import { MultichainSDK } from "./MultichainSDK.js";
239
239
  import { attachOptionsSchema, onchainSDKOptionsSchema } from "./options.js";
240
240
  import "./types/index.js";
241
- 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, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DUST_THRESHOLD, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, 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_INT96, 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, 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, assetsMap, attachOptionsSchema, botPermissionsToString, bytes32ToString, calcAdditionalBorrowApy, calcBorrowApy, calcBorrowRate, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcPositionLeverage, calcTimeToLiquidationMs, calcUtilization, chains, childLogger, classifyCurveOperation, 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, findCuratorMarketConfigurator, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, 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, isPublicNetwork, isRWAFactory, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, mustGetDominantCollateral, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, percentFmt, rayToBps, rayToNumber, retry, rewardsFromTransfers, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toShares, toSharesUp, toSignificant, toWithdrawalStatus, usdToNumber, watchBlocksAsync };
241
+ 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, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DUST_THRESHOLD, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, 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_INT96, 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, 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, assetsMap, attachOptionsSchema, botPermissionsToString, bytes32ToString, calcAdditionalBorrowApy, calcBorrowApy, calcBorrowRate, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcPositionLeverage, calcTimeToLiquidationMs, calcUtilization, chains, childLogger, classifyCurveOperation, 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, findCuratorMarketConfigurator, 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, getTokenPrettyName, 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, isPublicNetwork, isRWAFactory, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, percentFmt, pickStrategyTargetCollateral, rayToBps, rayToNumber, retry, rewardsFromTransfers, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toShares, toSharesUp, toSignificant, toWithdrawalStatus, usdToNumber, watchBlocksAsync };