@gearbox-protocol/sdk 18.4.1-aave.1 → 18.4.1-aave.3

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 (105) hide show
  1. package/dist/cjs/model/errors/index.js +1 -0
  2. package/dist/cjs/model/errors/operation-errors.js +9 -0
  3. package/dist/cjs/model/index.js +1 -0
  4. package/dist/cjs/onchain/accounts/bots/AccountBotsService.js +29 -0
  5. package/dist/cjs/onchain/accounts/bots/PeripheryCompressorV310Contract.js +2 -1
  6. package/dist/cjs/onchain/accounts/intents/operations.js +2 -2
  7. package/dist/cjs/onchain/accounts/intents/plan.js +6 -1
  8. package/dist/cjs/onchain/accounts/intents/tail.js +1 -1
  9. package/dist/cjs/onchain/index.js +10 -0
  10. package/dist/cjs/onchain/market/ZapperRegister.js +1 -1
  11. package/dist/cjs/onchain/market/adapters/abi/aave/iAaveOracle.js +20 -0
  12. package/dist/cjs/onchain/market/adapters/abi/aave/iAaveV3Pool.js +166 -0
  13. package/dist/cjs/onchain/market/adapters/abi/aave/iPoolAddressesProvider.js +11 -0
  14. package/dist/cjs/onchain/market/adapters/abi/aave/iVariableDebtToken.js +17 -0
  15. package/dist/cjs/onchain/market/adapters/abi/aave/index.js +6 -0
  16. package/dist/cjs/onchain/market/adapters/abi/adapters/iAaveHorizonBridgeAdapter.js +27 -0
  17. package/dist/cjs/onchain/market/adapters/abi/index.js +6 -0
  18. package/dist/cjs/onchain/market/adapters/contracts/AaveHorizonBridgeAdapterContract.js +71 -12
  19. package/dist/cjs/onchain/market/adapters/contracts/AaveV3PoolAdapterContract.js +5 -11
  20. package/dist/cjs/onchain/market/adapters/index.js +6 -0
  21. package/dist/cjs/onchain/market/index.js +6 -0
  22. package/dist/cjs/onchain/positions/projectAavePosition.js +163 -26
  23. package/dist/cjs/onchain/preview/index.js +2 -0
  24. package/dist/cjs/onchain/preview/preview/aaveBridgeBorrows.js +24 -0
  25. package/dist/cjs/onchain/preview/preview/index.js +2 -0
  26. package/dist/cjs/onchain/preview/preview/previewAdjustStrategyPosition.js +3 -0
  27. package/dist/cjs/onchain/preview/preview/previewExitOrRepayStrategyPosition.js +3 -0
  28. package/dist/cjs/onchain/validation/bundles/checkAaveDelegation.js +54 -0
  29. package/dist/cjs/onchain/validation/bundles/checkCreditOperation.js +34 -11
  30. package/dist/cjs/onchain/validation/bundles/index.js +2 -0
  31. package/dist/cjs/onchain/validation/checkOperation.js +16 -4
  32. package/dist/cjs/onchain/validation/index.js +2 -0
  33. package/dist/cjs/sdk/prepare/PrepareApi.js +21 -3
  34. package/dist/cjs/sdk/preview/PreviewNamespace.js +11 -2
  35. package/dist/esm/model/errors/index.js +2 -2
  36. package/dist/esm/model/errors/operation-errors.js +9 -1
  37. package/dist/esm/model/index.js +2 -2
  38. package/dist/esm/onchain/accounts/bots/AccountBotsService.js +29 -0
  39. package/dist/esm/onchain/accounts/bots/PeripheryCompressorV310Contract.js +1 -1
  40. package/dist/esm/onchain/accounts/intents/operations.js +2 -2
  41. package/dist/esm/onchain/accounts/intents/plan.js +6 -1
  42. package/dist/esm/onchain/accounts/intents/tail.js +1 -1
  43. package/dist/esm/onchain/index.js +6 -1
  44. package/dist/esm/onchain/market/ZapperRegister.js +1 -1
  45. package/dist/esm/onchain/market/adapters/abi/aave/iAaveOracle.js +19 -0
  46. package/dist/esm/onchain/market/adapters/abi/aave/iAaveV3Pool.js +166 -0
  47. package/dist/esm/onchain/market/adapters/abi/aave/iPoolAddressesProvider.js +10 -0
  48. package/dist/esm/onchain/market/adapters/abi/aave/iVariableDebtToken.js +16 -0
  49. package/dist/esm/onchain/market/adapters/abi/aave/index.js +4 -1
  50. package/dist/esm/onchain/market/adapters/abi/adapters/iAaveHorizonBridgeAdapter.js +27 -0
  51. package/dist/esm/onchain/market/adapters/abi/index.js +4 -1
  52. package/dist/esm/onchain/market/adapters/contracts/AaveHorizonBridgeAdapterContract.js +72 -13
  53. package/dist/esm/onchain/market/adapters/contracts/AaveV3PoolAdapterContract.js +6 -12
  54. package/dist/esm/onchain/market/adapters/index.js +4 -1
  55. package/dist/esm/onchain/market/index.js +4 -1
  56. package/dist/esm/onchain/positions/projectAavePosition.js +164 -27
  57. package/dist/esm/onchain/preview/index.js +2 -1
  58. package/dist/esm/onchain/preview/preview/aaveBridgeBorrows.js +23 -0
  59. package/dist/esm/onchain/preview/preview/index.js +2 -1
  60. package/dist/esm/onchain/preview/preview/previewAdjustStrategyPosition.js +3 -0
  61. package/dist/esm/onchain/preview/preview/previewExitOrRepayStrategyPosition.js +3 -0
  62. package/dist/esm/onchain/validation/bundles/checkAaveDelegation.js +53 -0
  63. package/dist/esm/onchain/validation/bundles/checkCreditOperation.js +34 -11
  64. package/dist/esm/onchain/validation/bundles/index.js +2 -1
  65. package/dist/esm/onchain/validation/checkOperation.js +16 -4
  66. package/dist/esm/onchain/validation/index.js +2 -1
  67. package/dist/esm/sdk/prepare/PrepareApi.js +22 -4
  68. package/dist/esm/sdk/preview/PreviewNamespace.js +11 -2
  69. package/dist/types/model/aave.d.ts +20 -3
  70. package/dist/types/model/errors/index.d.ts +2 -2
  71. package/dist/types/model/errors/operation-errors.d.ts +19 -0
  72. package/dist/types/model/index.d.ts +3 -3
  73. package/dist/types/model/previews.d.ts +11 -1
  74. package/dist/types/onchain/accounts/bots/AccountBotsService.d.ts +11 -1
  75. package/dist/types/onchain/accounts/bots/index.d.ts +2 -2
  76. package/dist/types/onchain/accounts/bots/types.d.ts +7 -1
  77. package/dist/types/onchain/accounts/index.d.ts +2 -2
  78. package/dist/types/onchain/accounts/intents/operations.d.ts +9 -3
  79. package/dist/types/onchain/accounts/intents/types.d.ts +5 -0
  80. package/dist/types/onchain/index.d.ts +7 -2
  81. package/dist/types/onchain/market/adapters/abi/aave/iAaveOracle.d.ts +22 -0
  82. package/dist/types/onchain/market/adapters/abi/aave/iAaveV3Pool.d.ts +139 -0
  83. package/dist/types/onchain/market/adapters/abi/aave/iPoolAddressesProvider.d.ts +11 -0
  84. package/dist/types/onchain/market/adapters/abi/aave/iVariableDebtToken.d.ts +17 -0
  85. package/dist/types/onchain/market/adapters/abi/aave/index.d.ts +4 -1
  86. package/dist/types/onchain/market/adapters/abi/adapters/iAaveHorizonBridgeAdapter.d.ts +21 -0
  87. package/dist/types/onchain/market/adapters/abi/index.d.ts +4 -1
  88. package/dist/types/onchain/market/adapters/contracts/AaveHorizonBridgeAdapterContract.d.ts +47 -10
  89. package/dist/types/onchain/market/adapters/contracts/AaveV3PoolAdapterContract.d.ts +142 -4
  90. package/dist/types/onchain/market/adapters/index.d.ts +4 -1
  91. package/dist/types/onchain/market/index.d.ts +4 -1
  92. package/dist/types/onchain/positions/projectAavePosition.d.ts +33 -4
  93. package/dist/types/onchain/preview/index.d.ts +2 -1
  94. package/dist/types/onchain/preview/preview/aaveBridgeBorrows.d.ts +15 -0
  95. package/dist/types/onchain/preview/preview/index.d.ts +2 -1
  96. package/dist/types/onchain/validation/bundles/checkAaveDelegation.d.ts +21 -0
  97. package/dist/types/onchain/validation/bundles/checkCreditOperation.d.ts +2 -2
  98. package/dist/types/onchain/validation/bundles/index.d.ts +2 -1
  99. package/dist/types/onchain/validation/index.d.ts +2 -1
  100. package/dist/types/sdk/index.d.ts +2 -2
  101. package/dist/types/sdk/prepare/PrepareApi.d.ts +2 -2
  102. package/dist/types/sdk/prepare/index.d.ts +2 -2
  103. package/dist/types/sdk/prepare/types.d.ts +49 -11
  104. package/dist/types/sdk/preview/types.d.ts +4 -2
  105. package/package.json +1 -1
@@ -107,6 +107,27 @@ export declare const iAaveHorizonBridgeAdapterAbi: readonly [{
107
107
  readonly type: "bool";
108
108
  readonly name: "useSafePrices";
109
109
  }];
110
+ }, {
111
+ readonly name: "openPositionDiff";
112
+ readonly type: "function";
113
+ readonly stateMutability: "nonpayable";
114
+ readonly inputs: readonly [{
115
+ readonly type: "address";
116
+ readonly name: "aToken";
117
+ }, {
118
+ readonly type: "address";
119
+ readonly name: "debtToken";
120
+ }, {
121
+ readonly type: "uint256";
122
+ readonly name: "leftoverAmount";
123
+ }, {
124
+ readonly type: "uint256";
125
+ readonly name: "borrowAmount";
126
+ }];
127
+ readonly outputs: readonly [{
128
+ readonly type: "bool";
129
+ readonly name: "useSafePrices";
130
+ }];
110
131
  }, {
111
132
  readonly name: "closePosition";
112
133
  readonly type: "function";
@@ -1,5 +1,8 @@
1
1
  import { iAaveHorizonBridgeAbi } from "./aave/iAaveHorizonBridge.js";
2
+ import { iAaveOracleAbi } from "./aave/iAaveOracle.js";
2
3
  import { iAaveV3PoolAbi } from "./aave/iAaveV3Pool.js";
4
+ import { iPoolAddressesProviderAbi } from "./aave/iPoolAddressesProvider.js";
5
+ import { iVariableDebtTokenAbi } from "./aave/iVariableDebtToken.js";
3
6
  import "./aave/index.js";
4
7
  import { adapterActionAbi, adapterActionSelectors, adapterActionSignatures } from "./actionAbi.js";
5
8
  import { erc4626ReferralAdapterAbi } from "./adapters/erc4626ReferralAdapter.js";
@@ -56,4 +59,4 @@ import { iTreehouseRedemptionGatewayAbi } from "./treehouse/iTreehouseRedemption
56
59
  import { iTreehouseRouterAbi } from "./treehouse/iTreehouseRouter.js";
57
60
  import "./treehouse/index.js";
58
61
  import { getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, hasAdapterDeployParamsAbi, parseAdapterAction, parseAdapterDeployParams } from "./utils.js";
59
- export { adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, erc4626ReferralAdapterAbi, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, hasAdapterDeployParamsAbi, iAaveHorizonBridgeAbi, iAaveHorizonBridgeAdapterAbi, iAaveV3PoolAbi, iAaveV3PoolAdapterAbi, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, 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, iTreehouseFastlaneAbi, iTreehouseFastlaneAdapterAbi, iTreehouseRedemptionGatewayAbi, iTreehouseRedemptionGatewayAdapterAbi, iTreehouseRouterAbi, iTreehouseRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, parseAdapterAction, parseAdapterDeployParams };
62
+ export { adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, erc4626ReferralAdapterAbi, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, hasAdapterDeployParamsAbi, iAaveHorizonBridgeAbi, iAaveHorizonBridgeAdapterAbi, iAaveOracleAbi, iAaveV3PoolAbi, iAaveV3PoolAdapterAbi, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, 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, iPoolAddressesProviderAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iTreehouseFastlaneAbi, iTreehouseFastlaneAdapterAbi, iTreehouseRedemptionGatewayAbi, iTreehouseRedemptionGatewayAdapterAbi, iTreehouseRouterAbi, iTreehouseRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVariableDebtTokenAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, parseAdapterAction, parseAdapterDeployParams };
@@ -114,6 +114,27 @@ declare const abi: readonly [{
114
114
  readonly type: "bool";
115
115
  readonly name: "useSafePrices";
116
116
  }];
117
+ }, {
118
+ readonly name: "openPositionDiff";
119
+ readonly type: "function";
120
+ readonly stateMutability: "nonpayable";
121
+ readonly inputs: readonly [{
122
+ readonly type: "address";
123
+ readonly name: "aToken";
124
+ }, {
125
+ readonly type: "address";
126
+ readonly name: "debtToken";
127
+ }, {
128
+ readonly type: "uint256";
129
+ readonly name: "leftoverAmount";
130
+ }, {
131
+ readonly type: "uint256";
132
+ readonly name: "borrowAmount";
133
+ }];
134
+ readonly outputs: readonly [{
135
+ readonly type: "bool";
136
+ readonly name: "useSafePrices";
137
+ }];
117
138
  }, {
118
139
  readonly name: "closePosition";
119
140
  readonly type: "function";
@@ -282,11 +303,27 @@ export declare class AaveHorizonBridgeAdapterContract extends AbstractAdapterCon
282
303
  isATokenAllowed(token: Address): boolean;
283
304
  isDebtTokenAllowed(token: Address): boolean;
284
305
  /**
285
- * Facade call handing `aTokenAmount` of `aToken` to the account owner and
286
- * borrowing `borrowAmount` of `debtToken` on the owner's behalf into the
287
- * account.
306
+ * Facade call handing every `aToken` the account holds above
307
+ * `leftoverAmount` to the account owner and borrowing `borrowAmount` of
308
+ * `debtToken` on the owner's behalf into the account.
309
+ */
310
+ openPositionDiffCall(aToken: Address, debtToken: Address, leftoverAmount: bigint, borrowAmount: bigint): MultiCall;
311
+ /**
312
+ * What an opening call borrows on the owner's behalf: `debtToken` and
313
+ * `borrowAmount`. `undefined` for a call that borrows nothing.
314
+ */
315
+ parseBorrow(calldata: Hex): {
316
+ debtToken: Address;
317
+ amount: bigint;
318
+ } | undefined;
319
+ /**
320
+ * Every account on this credit manager is finished by the Horizon finalizer
321
+ * bot a block after its own transaction, so opening one grants the bot its
322
+ * permissions. The bot is the one the market configurator lists among its
323
+ * periphery contracts for this adapter's bridge, the latest version where
324
+ * there are several; nothing where it lists none.
288
325
  */
289
- openPositionCall(aToken: Address, debtToken: Address, aTokenAmount: bigint, borrowAmount: bigint): MultiCall;
326
+ openingCalls(): Promise<MultiCall[]>;
290
327
  stateHuman(raw?: boolean): {
291
328
  address: string;
292
329
  version: number;
@@ -298,13 +335,13 @@ export declare class AaveHorizonBridgeAdapterContract extends AbstractAdapterCon
298
335
  allowedDebtTokens: string[] | undefined;
299
336
  };
300
337
  /**
301
- * Opening and closing a position are legal outside a bracket: both amounts
302
- * are named in the calldata and the bridge moves exactly those, so there is
303
- * nothing for an on-chain comparison to enforce.
338
+ * Opening and closing a position are legal outside a bracket: the bridge
339
+ * moves exactly the amounts the calldata names, or the balance above the
340
+ * named leftover, so there is nothing for an on-chain comparison to enforce.
304
341
  *
305
- * Opening hands `aTokenAmount` of the aToken to the account owner and brings
306
- * `borrowAmount` of the debt token in; closing sends `repayAmount` of the
307
- * debt token out and brings the aTokens back.
342
+ * Opening hands the aTokens to the account owner and brings `borrowAmount`
343
+ * of the debt token in; closing sends `repayAmount` of the debt token out and
344
+ * brings the aTokens back.
308
345
  */
309
346
  replayOutOfBracketCall(balances: AssetsMap, calldata: Hex): boolean;
310
347
  }
@@ -264,6 +264,145 @@ declare const protocolAbi: readonly [{
264
264
  readonly outputs: readonly [{
265
265
  readonly type: "address";
266
266
  }];
267
+ }, {
268
+ readonly name: "ADDRESSES_PROVIDER";
269
+ readonly type: "function";
270
+ readonly stateMutability: "view";
271
+ readonly inputs: readonly [];
272
+ readonly outputs: readonly [{
273
+ readonly type: "address";
274
+ }];
275
+ }, {
276
+ readonly name: "getReserveData";
277
+ readonly type: "function";
278
+ readonly stateMutability: "view";
279
+ readonly inputs: readonly [{
280
+ readonly type: "address";
281
+ readonly name: "asset";
282
+ }];
283
+ readonly outputs: readonly [{
284
+ readonly type: "tuple";
285
+ readonly components: readonly [{
286
+ readonly type: "tuple";
287
+ readonly name: "configuration";
288
+ readonly components: readonly [{
289
+ readonly type: "uint256";
290
+ readonly name: "data";
291
+ }];
292
+ }, {
293
+ readonly type: "uint128";
294
+ readonly name: "liquidityIndex";
295
+ }, {
296
+ readonly type: "uint128";
297
+ readonly name: "currentLiquidityRate";
298
+ }, {
299
+ readonly type: "uint128";
300
+ readonly name: "variableBorrowIndex";
301
+ }, {
302
+ readonly type: "uint128";
303
+ readonly name: "currentVariableBorrowRate";
304
+ }, {
305
+ readonly type: "uint128";
306
+ readonly name: "currentStableBorrowRate";
307
+ }, {
308
+ readonly type: "uint40";
309
+ readonly name: "lastUpdateTimestamp";
310
+ }, {
311
+ readonly type: "uint16";
312
+ readonly name: "id";
313
+ }, {
314
+ readonly type: "address";
315
+ readonly name: "aTokenAddress";
316
+ }, {
317
+ readonly type: "address";
318
+ readonly name: "stableDebtTokenAddress";
319
+ }, {
320
+ readonly type: "address";
321
+ readonly name: "variableDebtTokenAddress";
322
+ }, {
323
+ readonly type: "address";
324
+ readonly name: "interestRateStrategyAddress";
325
+ }, {
326
+ readonly type: "uint128";
327
+ readonly name: "accruedToTreasury";
328
+ }, {
329
+ readonly type: "uint128";
330
+ readonly name: "unbacked";
331
+ }, {
332
+ readonly type: "uint128";
333
+ readonly name: "isolationModeTotalDebt";
334
+ }];
335
+ }];
336
+ }, {
337
+ readonly name: "getUserAccountData";
338
+ readonly type: "function";
339
+ readonly stateMutability: "view";
340
+ readonly inputs: readonly [{
341
+ readonly type: "address";
342
+ readonly name: "user";
343
+ }];
344
+ readonly outputs: readonly [{
345
+ readonly type: "uint256";
346
+ readonly name: "totalCollateralBase";
347
+ }, {
348
+ readonly type: "uint256";
349
+ readonly name: "totalDebtBase";
350
+ }, {
351
+ readonly type: "uint256";
352
+ readonly name: "availableBorrowsBase";
353
+ }, {
354
+ readonly type: "uint256";
355
+ readonly name: "currentLiquidationThreshold";
356
+ }, {
357
+ readonly type: "uint256";
358
+ readonly name: "ltv";
359
+ }, {
360
+ readonly type: "uint256";
361
+ readonly name: "healthFactor";
362
+ }];
363
+ }, {
364
+ readonly name: "getUserEMode";
365
+ readonly type: "function";
366
+ readonly stateMutability: "view";
367
+ readonly inputs: readonly [{
368
+ readonly type: "address";
369
+ readonly name: "user";
370
+ }];
371
+ readonly outputs: readonly [{
372
+ readonly type: "uint256";
373
+ }];
374
+ }, {
375
+ readonly name: "getEModeCategoryCollateralConfig";
376
+ readonly type: "function";
377
+ readonly stateMutability: "view";
378
+ readonly inputs: readonly [{
379
+ readonly type: "uint8";
380
+ readonly name: "id";
381
+ }];
382
+ readonly outputs: readonly [{
383
+ readonly type: "tuple";
384
+ readonly components: readonly [{
385
+ readonly type: "uint16";
386
+ readonly name: "ltv";
387
+ }, {
388
+ readonly type: "uint16";
389
+ readonly name: "liquidationThreshold";
390
+ }, {
391
+ readonly type: "uint16";
392
+ readonly name: "liquidationBonus";
393
+ }];
394
+ }];
395
+ }, {
396
+ readonly name: "getEModeCategoryCollateralBitmap";
397
+ readonly type: "function";
398
+ readonly stateMutability: "view";
399
+ readonly inputs: readonly [{
400
+ readonly type: "uint8";
401
+ readonly name: "id";
402
+ }];
403
+ readonly outputs: readonly [{
404
+ readonly type: "uint128";
405
+ }];
267
406
  }];
268
407
  type protocolAbi = typeof protocolAbi;
269
408
  export declare class AaveV3PoolAdapterContract extends AbstractAdapterContract<abi, protocolAbi> {
@@ -279,11 +418,10 @@ export declare class AaveV3PoolAdapterContract extends AbstractAdapterContract<a
279
418
  */
280
419
  aToken(asset: Address): Promise<Address>;
281
420
  /**
282
- * Facade call supplying `amount` of `asset` from the credit account. The
283
- * adapter mints the aTokens to the account whatever `onBehalfOf` says, so
284
- * neither it nor the referral code is sent.
421
+ * Facade call supplying every `asset` the credit account holds above
422
+ * `leftoverAmount`.
285
423
  */
286
- supplyCall(asset: Address, amount: bigint): MultiCall;
424
+ supplyDiffCall(asset: Address, leftoverAmount: bigint): MultiCall;
287
425
  stateHuman(raw?: boolean): {
288
426
  address: string;
289
427
  version: number;
@@ -1,5 +1,8 @@
1
1
  import { iAaveHorizonBridgeAbi } from "./abi/aave/iAaveHorizonBridge.js";
2
+ import { iAaveOracleAbi } from "./abi/aave/iAaveOracle.js";
2
3
  import { iAaveV3PoolAbi } from "./abi/aave/iAaveV3Pool.js";
4
+ import { iPoolAddressesProviderAbi } from "./abi/aave/iPoolAddressesProvider.js";
5
+ import { iVariableDebtTokenAbi } from "./abi/aave/iVariableDebtToken.js";
3
6
  import { AdapterContractStateHuman, AdapterContractType, AdapterProtocolOperation, AdapterType, DelayedWithdrawalClaim, DelayedWithdrawalRequest, IAdapterContract, VersionedAbi } from "./types.js";
4
7
  import { adapterActionAbi, adapterActionSelectors, adapterActionSignatures } from "./abi/actionAbi.js";
5
8
  import { erc4626ReferralAdapterAbi } from "./abi/adapters/erc4626ReferralAdapter.js";
@@ -102,4 +105,4 @@ import "./contracts/index.js";
102
105
  import { AdapterFactoryArgs, createAdapter } from "./createAdapter.js";
103
106
  import { TokenTransfer } from "./transfers.js";
104
107
  import { allTransfersAsTokenAmounts, classifyCurveOperation, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, fnSigToName, parsePosNegAmount, rewardsFromTransfers, swapFromTransfers, toNetTransfers } from "./transferHelpers.js";
105
- export { AaveHorizonBridgeAdapterContract, AaveV3PoolAdapterContract, AbstractAdapterContract, AbstractAdapterContractOptions, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BasicSwapCall, CamelotPool, CamelotV3AdapterContract, ConcreteAdapterContractOptions, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, FluidDexAdapterContract, GetReward, IAdapterContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, MakerDeposit, MakerRedeem, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowWrapperAdapterContract, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasRedemptionVaultAdapterContract, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTokenType, SecuritizeOnRampAdapterContract, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, Swap, TokenAmount, TokenTransfer, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, TreehouseFastlaneAdapterContract, TreehouseRedemptionGatewayAdapterContract, TreehouseRouterAdapterContract, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, classifyCurveOperation, createAdapter, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, erc4626ReferralAdapterAbi, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, hasAdapterDeployParamsAbi, iAaveHorizonBridgeAbi, iAaveHorizonBridgeAdapterAbi, iAaveV3PoolAbi, iAaveV3PoolAdapterAbi, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, 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, iTreehouseFastlaneAbi, iTreehouseFastlaneAdapterAbi, iTreehouseRedemptionGatewayAbi, iTreehouseRedemptionGatewayAdapterAbi, iTreehouseRouterAbi, iTreehouseRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, rewardsFromTransfers, swapFromTransfers, toNetTransfers };
108
+ export { AaveHorizonBridgeAdapterContract, AaveV3PoolAdapterContract, AbstractAdapterContract, AbstractAdapterContractOptions, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BasicSwapCall, CamelotPool, CamelotV3AdapterContract, ConcreteAdapterContractOptions, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, FluidDexAdapterContract, GetReward, IAdapterContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, MakerDeposit, MakerRedeem, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowWrapperAdapterContract, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasRedemptionVaultAdapterContract, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTokenType, SecuritizeOnRampAdapterContract, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, Swap, TokenAmount, TokenTransfer, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, TreehouseFastlaneAdapterContract, TreehouseRedemptionGatewayAdapterContract, TreehouseRouterAdapterContract, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, classifyCurveOperation, createAdapter, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, erc4626ReferralAdapterAbi, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, hasAdapterDeployParamsAbi, iAaveHorizonBridgeAbi, iAaveHorizonBridgeAdapterAbi, iAaveOracleAbi, iAaveV3PoolAbi, iAaveV3PoolAdapterAbi, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, 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, iPoolAddressesProviderAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iTreehouseFastlaneAbi, iTreehouseFastlaneAdapterAbi, iTreehouseRedemptionGatewayAbi, iTreehouseRedemptionGatewayAdapterAbi, iTreehouseRouterAbi, iTreehouseRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVariableDebtTokenAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, rewardsFromTransfers, swapFromTransfers, toNetTransfers };
@@ -1,5 +1,8 @@
1
1
  import { iAaveHorizonBridgeAbi } from "./adapters/abi/aave/iAaveHorizonBridge.js";
2
+ import { iAaveOracleAbi } from "./adapters/abi/aave/iAaveOracle.js";
2
3
  import { iAaveV3PoolAbi } from "./adapters/abi/aave/iAaveV3Pool.js";
4
+ import { iPoolAddressesProviderAbi } from "./adapters/abi/aave/iPoolAddressesProvider.js";
5
+ import { iVariableDebtTokenAbi } from "./adapters/abi/aave/iVariableDebtToken.js";
3
6
  import { DEGEN_NFT_MIDAS, PHANTOM_TOKEN_MIDAS_REDEMPTION, RWA_LIQUIDATOR_MIDAS } from "./rwa/midas/constants.js";
4
7
  import { DEGEN_NFT_SECURITIZE, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, RWA_LIQUIDATOR_SECURITIZE } from "./rwa/securitize/constants.js";
5
8
  import { DStokenData, SecuritizeCreditAccountData, SecuritizeInvestorData, SecuritizeRWAFactoryStateHuman } from "./rwa/securitize/types.js";
@@ -173,4 +176,4 @@ import "./zapper/index.js";
173
176
  import { MarketRegister, MarketRegistryState, MarketRegistryStateHuman } from "./MarketRegister.js";
174
177
  import { DEFAULT_QUOTA_BUFFER_BPS, MAX_LEVERAGE_BUFFER_BPS, OptimalPartialLiquidationAmounts, OptimalPartialLiquidationAmountsProps, PARTIAL_LIQUIDATION_BUFFER_BPS, QuotaMode, StrategyRateInputs, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, healthFactorBps, minSeizedAmount, optimalHFForPartialLiquidation, optimalPartialLiquidationAmounts, rayToBps, usdToNumber } from "./math.js";
175
178
  import { strategyName } from "./strategyName.js";
176
- export { AaveHorizonBridgeAdapterContract, AaveV3PoolAdapterContract, AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BasicSwapCall, BoundedPriceFeedContract, CamelotPool, CamelotV3AdapterContract, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConstantPriceFeedContract, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, CreditAccountTokenQuota, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, CreditSuiteStrategy, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DStokenData, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, GaugeParams, GetInvestorOptions, GetOpenAccountRequirementsProps, GetReward, IAdapterContract, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, IPoolContract, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdater, IRWAFactory, IRateKeeperContract, type IUpdatablePriceFeedContract, IZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InterestRateModelType, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, type LatestUpdate, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationFees, MAX_LEVERAGE_BUFFER_BPS, MakerDeposit, MakerRedeem, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketSuite, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, OptimalPartialLiquidationAmounts, OptimalPartialLiquidationAmountsProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolQuotaKeeperContract, PoolSuite, PoolV310Contract, PrepareUpdateQuotasProps, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegistry, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, PythPriceFeed, QuotaMode, QuotaSlice, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWARegistry, RWAState, RWAStateHuman, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RampEvent, RateKeeperType, RedstonePriceFeedContract, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, StrategyCollateralProps, StrategyRateInputs, Swap, type TimestampedCalldata, TokenAmount, TokenTransfer, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, TreehouseFastlaneAdapterContract, TreehouseRedemptionGatewayAdapterContract, TreehouseRouterAdapterContract, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, dominantCollateral, erc4626ReferralAdapterAbi, expectedBalanceDeltas, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getRawPriceUpdates, hasAdapterDeployParamsAbi, healthFactorBps, iAaveHorizonBridgeAbi, iAaveHorizonBridgeAdapterAbi, iAaveV3PoolAbi, iAaveV3PoolAdapterAbi, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, 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, iTreehouseFastlaneAbi, iTreehouseFastlaneAdapterAbi, iTreehouseRedemptionGatewayAbi, iTreehouseRedemptionGatewayAdapterAbi, iTreehouseRouterAbi, iTreehouseRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isLPPriceFeed, isRWAFactory, isStrategyCollateral, isUpdatablePriceFeed, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, optimalHFForPartialLiquidation, optimalPartialLiquidationAmounts, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, pickStrategyTargetCollateral, rayToBps, rewardsFromTransfers, strategyName, swapFromTransfers, toNetTransfers, updatableDependencies, usdToNumber };
179
+ export { AaveHorizonBridgeAdapterContract, AaveV3PoolAdapterContract, AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BasicSwapCall, BoundedPriceFeedContract, CamelotPool, CamelotV3AdapterContract, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConstantPriceFeedContract, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, CreditAccountTokenQuota, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, CreditSuiteStrategy, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DStokenData, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, GaugeParams, GetInvestorOptions, GetOpenAccountRequirementsProps, GetReward, IAdapterContract, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, IPoolContract, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdater, IRWAFactory, IRateKeeperContract, type IUpdatablePriceFeedContract, IZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InterestRateModelType, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, type LatestUpdate, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationFees, MAX_LEVERAGE_BUFFER_BPS, MakerDeposit, MakerRedeem, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketSuite, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, OptimalPartialLiquidationAmounts, OptimalPartialLiquidationAmountsProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolQuotaKeeperContract, PoolSuite, PoolV310Contract, PrepareUpdateQuotasProps, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegistry, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, PythPriceFeed, QuotaMode, QuotaSlice, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWARegistry, RWAState, RWAStateHuman, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RampEvent, RateKeeperType, RedstonePriceFeedContract, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, StrategyCollateralProps, StrategyRateInputs, Swap, type TimestampedCalldata, TokenAmount, TokenTransfer, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, TreehouseFastlaneAdapterContract, TreehouseRedemptionGatewayAdapterContract, TreehouseRouterAdapterContract, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, dominantCollateral, erc4626ReferralAdapterAbi, expectedBalanceDeltas, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getRawPriceUpdates, hasAdapterDeployParamsAbi, healthFactorBps, iAaveHorizonBridgeAbi, iAaveHorizonBridgeAdapterAbi, iAaveOracleAbi, iAaveV3PoolAbi, iAaveV3PoolAdapterAbi, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, 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, iPoolAddressesProviderAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iTreehouseFastlaneAbi, iTreehouseFastlaneAdapterAbi, iTreehouseRedemptionGatewayAbi, iTreehouseRedemptionGatewayAdapterAbi, iTreehouseRouterAbi, iTreehouseRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVariableDebtTokenAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isLPPriceFeed, isRWAFactory, isStrategyCollateral, isUpdatablePriceFeed, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, optimalHFForPartialLiquidation, optimalPartialLiquidationAmounts, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, pickStrategyTargetCollateral, rayToBps, rewardsFromTransfers, strategyName, swapFromTransfers, toNetTransfers, updatableDependencies, usdToNumber };
@@ -3,14 +3,43 @@ import "../../model/index.js";
3
3
  import { AccountSnapshot } from "./types.js";
4
4
  import { OnchainSDK } from "../OnchainSDK.js";
5
5
  import "../index.js";
6
+ import { Address } from "viem";
6
7
  //#region src/onchain/positions/projectAavePosition.d.ts
8
+ /**
9
+ * Where an Aave Horizon opening lands, and how much the Aave side lends.
10
+ **/
11
+ export interface AaveProjection {
12
+ aave: AavePositionProjection;
13
+ /**
14
+ * The most the owner's Aave position can borrow once the collateral is in
15
+ * it, in the market underlying: Aave lends up to the collateral times its
16
+ * LTV, less what the owner already owes there, and the finalizer bot borrows
17
+ * the whole Gearbox debt or reverts.
18
+ **/
19
+ maxDebt: bigint;
20
+ }
7
21
  /**
8
22
  * Where an opening lands once it has moved to Aave Horizon, from the snapshot
9
23
  * of the credit account it is built in.
10
24
  *
11
- * Placeholder until the Aave Horizon contracts ship: the mint is assumed to
12
- * take {@link MINT_DURATION} and to mint the account's balances one for one,
13
- * and the Aave side is weighed by the credit manager's own projection.
25
+ * The finalizer bot supplies the account's RWA to the pool and borrows the
26
+ * Gearbox debt against it on the owner's behalf, so the Aave side is read off
27
+ * the pool for `owner`: the reserve's LTV and liquidation threshold (its eMode
28
+ * category's, where the owner is in one that lists it), the Aave oracle's
29
+ * prices, the variable borrow rate of the underlying, and whatever the owner
30
+ * already holds and owes there. `healthFactor` and `liquidationPrice` are of
31
+ * that whole position; the values describe this opening alone.
32
+ *
33
+ * The RWA is either on the account already, and the position is on Aave at
34
+ * once (the bot's move is the next block), or still being minted: then the
35
+ * account holds the withdrawal phantom token of a delayed operation the
36
+ * withdrawal compressor lists for the credit manager, the mint takes that
37
+ * operation's `withdrawalLength` and is assumed to come out one for one, and
38
+ * the Gearbox debt accrues interest at the credit manager's rate meanwhile.
39
+ *
40
+ * `undefined` when the credit manager cannot move the account to Aave: no
41
+ * pool adapter lists an asset of the account or the RWA it is being minted
42
+ * into, or no bridge adapter takes its aToken against the underlying.
14
43
  **/
15
- export declare function projectAavePosition(sdk: OnchainSDK, snapshot: AccountSnapshot): AavePositionProjection;
44
+ export declare function projectAavePosition(sdk: OnchainSDK, snapshot: AccountSnapshot, owner: Address): Promise<AaveProjection | undefined>;
16
45
  //#endregion
@@ -9,6 +9,7 @@ import { parseOperationCalldata } from "./parse/parseOperationCalldata.js";
9
9
  import { parsePoolOperationCalldata } from "./parse/parsePoolOperationCalldata.js";
10
10
  import { parseRWAFactoryOperationCalldata } from "./parse/parseRWAFactoryOperationCalldata.js";
11
11
  import "./parse/index.js";
12
+ import { aaveBridgeBorrows } from "./preview/aaveBridgeBorrows.js";
12
13
  import { CreditAccountState, CreditAccountStateProps } from "./preview/CreditAccountState.js";
13
14
  import { DetectedDelayedOperation, detectDelayedOperation } from "./preview/detectDelayedOperation.js";
14
15
  import { buildDelayedStrategyPositionOperationPreview } from "./preview/buildDelayedStrategyPositionOperationPreview.js";
@@ -22,4 +23,4 @@ import { previewAdjustStrategyPosition } from "./preview/previewAdjustStrategyPo
22
23
  import { CloseOrRepayOperation, previewExitOrRepayStrategyPosition } from "./preview/previewExitOrRepayStrategyPosition.js";
23
24
  import { PreviewOperationError, previewOperation } from "./preview/previewOperation.js";
24
25
  import "./preview/index.js";
25
- export { AdapterOperation, AdapterOperationBase, AddCollateralOp, ClassifyInnerOperationsProps, CloseCreditAccountOperation, CloseOrRepayOperation, CompareBalancesOp, CreditAccountOperation, CreditAccountState, CreditAccountStateProps, DecreaseDebtOp, DetectedDelayedClaim, DetectedDelayedOperation, DirectTokenTransferOperation, FacadeOperationMetadata, IncreaseDebtOp, InnerFacadeOperation, InnerOperation, LiquidateCreditAccountOperation, MulticallOperation, OpenCreditAccountOperation, Operation, OperationMetadata, OuterFacadeOperation, PartialLiquidationOperation, PoolDepositOperation, PoolMintOperation, PoolOperation, PoolRedeemOperation, PoolWithdrawOperation, PreviewOperationError, RWAMulticallOperation, RWAOpenCreditAccountOperation, RWAOperation, RWAOperationMetadata, ReplayMulticallResult, ReplayState, ReplayableOperation, StoreExpectedBalancesOp, TraceAdapterExt, UpdateQuotaOp, WithdrawCollateralOp, buildDelayedStrategyPositionOperationPreview, classifyCloseOrRepay, classifyInnerOperations, detectDelayedClaim, detectDelayedOperation, estimateClaimableAt, isCloseOrRepay, isPoolOperation, isRWAOperation, makeReplayState, midasGreenlistsAccount, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parseRWAFactoryOperationCalldata, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent };
26
+ export { AdapterOperation, AdapterOperationBase, AddCollateralOp, ClassifyInnerOperationsProps, CloseCreditAccountOperation, CloseOrRepayOperation, CompareBalancesOp, CreditAccountOperation, CreditAccountState, CreditAccountStateProps, DecreaseDebtOp, DetectedDelayedClaim, DetectedDelayedOperation, DirectTokenTransferOperation, FacadeOperationMetadata, IncreaseDebtOp, InnerFacadeOperation, InnerOperation, LiquidateCreditAccountOperation, MulticallOperation, OpenCreditAccountOperation, Operation, OperationMetadata, OuterFacadeOperation, PartialLiquidationOperation, PoolDepositOperation, PoolMintOperation, PoolOperation, PoolRedeemOperation, PoolWithdrawOperation, PreviewOperationError, RWAMulticallOperation, RWAOpenCreditAccountOperation, RWAOperation, RWAOperationMetadata, ReplayMulticallResult, ReplayState, ReplayableOperation, StoreExpectedBalancesOp, TraceAdapterExt, UpdateQuotaOp, WithdrawCollateralOp, aaveBridgeBorrows, buildDelayedStrategyPositionOperationPreview, classifyCloseOrRepay, classifyInnerOperations, detectDelayedClaim, detectDelayedOperation, estimateClaimableAt, isCloseOrRepay, isPoolOperation, isRWAOperation, makeReplayState, midasGreenlistsAccount, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parseRWAFactoryOperationCalldata, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent };
@@ -0,0 +1,15 @@
1
+ import { AaveBridgeBorrow } from "../../../model/aave.js";
2
+ import "../../../model/index.js";
3
+ import { PluginsMap } from "../../plugins/types.js";
4
+ import { OnchainSDK } from "../../OnchainSDK.js";
5
+ import { InnerOperation } from "../parse/types-facades.js";
6
+ import "../parse/index.js";
7
+ import "../../index.js";
8
+ import { Address } from "viem";
9
+ //#region src/onchain/preview/preview/aaveBridgeBorrows.d.ts
10
+ /**
11
+ * The loans the multicall's Horizon bridge calls take as the account owner,
12
+ * at the amounts the calldata names.
13
+ */
14
+ export declare function aaveBridgeBorrows<P extends PluginsMap>(sdk: OnchainSDK<P>, creditManager: Address, multicall: InnerOperation[]): AaveBridgeBorrow[];
15
+ //#endregion
@@ -1,3 +1,4 @@
1
+ import { aaveBridgeBorrows } from "./aaveBridgeBorrows.js";
1
2
  import { CreditAccountState, CreditAccountStateProps } from "./CreditAccountState.js";
2
3
  import { DetectedDelayedOperation, detectDelayedOperation } from "./detectDelayedOperation.js";
3
4
  import { buildDelayedStrategyPositionOperationPreview } from "./buildDelayedStrategyPositionOperationPreview.js";
@@ -10,4 +11,4 @@ import { ReplayMulticallResult, ReplayableOperation, replayMulticall } from "./r
10
11
  import { previewAdjustStrategyPosition } from "./previewAdjustStrategyPosition.js";
11
12
  import { CloseOrRepayOperation, previewExitOrRepayStrategyPosition } from "./previewExitOrRepayStrategyPosition.js";
12
13
  import { PreviewOperationError, previewOperation } from "./previewOperation.js";
13
- export { CloseOrRepayOperation, CreditAccountState, CreditAccountStateProps, DetectedDelayedClaim, DetectedDelayedOperation, PreviewOperationError, ReplayMulticallResult, ReplayState, ReplayableOperation, buildDelayedStrategyPositionOperationPreview, classifyCloseOrRepay, detectDelayedClaim, detectDelayedOperation, estimateClaimableAt, isCloseOrRepay, makeReplayState, midasGreenlistsAccount, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent };
14
+ export { CloseOrRepayOperation, CreditAccountState, CreditAccountStateProps, DetectedDelayedClaim, DetectedDelayedOperation, PreviewOperationError, ReplayMulticallResult, ReplayState, ReplayableOperation, aaveBridgeBorrows, buildDelayedStrategyPositionOperationPreview, classifyCloseOrRepay, detectDelayedClaim, detectDelayedOperation, estimateClaimableAt, isCloseOrRepay, makeReplayState, midasGreenlistsAccount, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent };
@@ -0,0 +1,21 @@
1
+ import { InsufficientBorrowAllowanceError } from "../../../model/errors/operation-errors.js";
2
+ import { UnexpectedFailureError } from "../../../model/errors/prepare-errors.js";
3
+ import { AaveBridgeBorrow } from "../../../model/aave.js";
4
+ import "../../../model/index.js";
5
+ import { OnchainSDK } from "../../OnchainSDK.js";
6
+ import { Address } from "viem";
7
+ //#region src/onchain/validation/bundles/checkAaveDelegation.d.ts
8
+ export interface CheckAaveDelegationInput {
9
+ sdk: OnchainSDK;
10
+ /** Account owner the bridge borrows as. */
11
+ owner: Address;
12
+ borrow: AaveBridgeBorrow;
13
+ blockNumber?: bigint;
14
+ }
15
+ /**
16
+ * `owner` has delegated the bridge at least the borrowed amount on the
17
+ * variable debt token of the borrowed token, in the pool the bridge borrows
18
+ * from.
19
+ */
20
+ export declare function checkAaveDelegation(input: CheckAaveDelegationInput): Promise<(InsufficientBorrowAllowanceError | UnexpectedFailureError)[]>;
21
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { AccountNotMidasGreenlistedError, DebtOutOfRangeError, ForbiddenTokenError, InsufficientCollateralError, InsufficientPoolLiquidityError, QuotaAboveMaxError, QuotaCountExceededError, QuotaLimitReachedError, RWAOpenRequirementsError } from "../../../model/errors/operation-errors.js";
1
+ import { AccountNotMidasGreenlistedError, DebtOutOfRangeError, ForbiddenTokenError, InsufficientBorrowAllowanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, QuotaAboveMaxError, QuotaCountExceededError, QuotaLimitReachedError, RWAOpenRequirementsError } from "../../../model/errors/operation-errors.js";
2
2
  import { AdjustStrategyPositionPreview, OpenStrategyPositionPreview } from "../../../model/previews.js";
3
3
  import "../../../model/index.js";
4
4
  import { OnchainSDK } from "../../OnchainSDK.js";
@@ -8,7 +8,7 @@ import { MarketStateError } from "./checkMarket.js";
8
8
  import { Address } from "viem";
9
9
  //#region src/onchain/validation/bundles/checkCreditOperation.d.ts
10
10
  /** {@inheritDoc checkCreditOperation} */
11
- export type CreditOperationError = MarketStateError | DebtOutOfRangeError | InsufficientPoolLiquidityError | ForbiddenTokenError | QuotaCountExceededError | QuotaAboveMaxError | QuotaLimitReachedError | InsufficientCollateralError | WalletFundingError | RWAOpenRequirementsError | AccountNotMidasGreenlistedError;
11
+ export type CreditOperationError = MarketStateError | DebtOutOfRangeError | InsufficientPoolLiquidityError | ForbiddenTokenError | QuotaCountExceededError | QuotaAboveMaxError | QuotaLimitReachedError | InsufficientCollateralError | WalletFundingError | RWAOpenRequirementsError | AccountNotMidasGreenlistedError | InsufficientBorrowAllowanceError;
12
12
  /** The two previews that carry a position for the thresholds to weigh. */
13
13
  export type CreditOperationPreview = OpenStrategyPositionPreview | AdjustStrategyPositionPreview;
14
14
  export interface CreditOperationArgs extends HealthFactorThresholds {
@@ -1,3 +1,4 @@
1
+ import { CheckAaveDelegationInput, checkAaveDelegation } from "./checkAaveDelegation.js";
1
2
  import { checkAccountQuotas } from "./checkAccountQuotas.js";
2
3
  import { CheckWalletInput, WalletFundingError, checkWallet } from "./checkWallet.js";
3
4
  import { CheckCollateralFundingInput, CollateralFundingPreview, checkCollateralFunding } from "./checkCollateralFunding.js";
@@ -17,4 +18,4 @@ import { CheckRWAOpeningInput, RWAOpeningError, checkRWAOpening } from "./checkR
17
18
  import { CheckRWAOpenRequirementsInput, checkRWAOpenRequirements } from "./checkRWAOpenRequirements.js";
18
19
  import { CheckWalletAllowanceInput, checkWalletAllowance } from "./checkWalletAllowance.js";
19
20
  import { CheckWalletBalanceInput, checkWalletBalance } from "./checkWalletBalance.js";
20
- export { CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckMidasAccountGreenlistInput, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, CollateralFundingPreview, CreditOperationArgs, CreditOperationError, CreditOperationPreview, HealthFactorThresholds, LiquidationEligibilityError, MarketStateError, PoolOperationArgs, PoolOperationError, QuotaUpdateError, RWAOpeningError, WalletFundingError, WeighedFactors, checkAccountQuotas, checkCollateralFunding, checkCreditOperation, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLiquidationEligibility, checkLiquidationFunding, checkMarket, checkMidasAccountGreenlist, checkObtained, checkPoolFunding, checkPoolOperation, checkQuotaUpdates, checkRWAOpenRequirements, checkRWAOpening, checkWallet, checkWalletAllowance, checkWalletBalance };
21
+ export { CheckAaveDelegationInput, CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckMidasAccountGreenlistInput, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, CollateralFundingPreview, CreditOperationArgs, CreditOperationError, CreditOperationPreview, HealthFactorThresholds, LiquidationEligibilityError, MarketStateError, PoolOperationArgs, PoolOperationError, QuotaUpdateError, RWAOpeningError, WalletFundingError, WeighedFactors, checkAaveDelegation, checkAccountQuotas, checkCollateralFunding, checkCreditOperation, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLiquidationEligibility, checkLiquidationFunding, checkMarket, checkMidasAccountGreenlist, checkObtained, checkPoolFunding, checkPoolOperation, checkQuotaUpdates, checkRWAOpenRequirements, checkRWAOpening, checkWallet, checkWalletAllowance, checkWalletBalance };
@@ -1,4 +1,5 @@
1
1
  import { IntentValidationError, raise } from "./raise.js";
2
+ import { CheckAaveDelegationInput, checkAaveDelegation } from "./bundles/checkAaveDelegation.js";
2
3
  import { checkAccountQuotas } from "./bundles/checkAccountQuotas.js";
3
4
  import { CheckWalletInput, WalletFundingError, checkWallet } from "./bundles/checkWallet.js";
4
5
  import { CheckCollateralFundingInput, CollateralFundingPreview, checkCollateralFunding } from "./bundles/checkCollateralFunding.js";
@@ -47,4 +48,4 @@ import { amountOf } from "./helpers/amount.js";
47
48
  import { MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_SAFE_HEALTH_FACTOR_FORM } from "./helpers/health-factor-limits.js";
48
49
  import { toToken, toTokenAmount } from "./helpers/token.js";
49
50
  import "./helpers/index.js";
50
- export { BorrowLimitArgs, CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckLiquidationInput, CheckLiquidationOptions, CheckMidasAccountGreenlistInput, CheckOperationInput, CheckOperationOptions, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckSimulationInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, CollateralFundingPreview, CollateralisedArgs, CreditAccountFrozenArgs, CreditManagerPausedArgs, CreditOperationArgs, CreditOperationError, CreditOperationPreview, CreditSimulationInput, DebtLimitsArgs, EmergencyLiquidatorArgs, ForbiddenTokenArgs, HealthFactorThresholds, type IntentValidationError, LeverageArgs, LiquidationEligibilityError, LiquidationValidationError, LiquidatorEligibleArgs, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_SAFE_HEALTH_FACTOR_FORM, MarketExpiredArgs, MarketStateError, MaxQuotaArgs, OperationValidationError, PartiallyLiquidatableArgs, PoolLiquidityArgs, PoolOperationArgs, PoolOperationError, PoolPausedArgs, PoolSunsetArgs, QuotaActiveArgs, QuotaChangeArgs, QuotaCountArgs, QuotaLimitArgs, QuotaUpdateError, RWAOpeningError, ReservePriceLimitedArgs, SimulationValidationError, WalletFundingError, WeighedFactors, amountOf, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLeverage, checkLiquidation, checkLiquidationEligibility, checkLiquidationFunding, checkLiquidatorEligible, checkMarket, checkMarketExpired, checkMaxQuota, checkMidasAccountGreenlist, checkObtained, checkOperation, checkPartiallyLiquidatable, checkPoolFunding, checkPoolLiquidity, checkPoolOperation, checkPoolPaused, checkPoolSunset, checkQuotaActive, checkQuotaChange, checkQuotaCount, checkQuotaLimit, checkQuotaUpdates, checkRWAOpenRequirements, checkRWAOpening, checkReservePriceLimited, checkSimulation, checkWallet, checkWalletAllowance, checkWalletBalance, raise, toToken, toTokenAmount };
51
+ export { BorrowLimitArgs, CheckAaveDelegationInput, CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckLiquidationInput, CheckLiquidationOptions, CheckMidasAccountGreenlistInput, CheckOperationInput, CheckOperationOptions, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckSimulationInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, CollateralFundingPreview, CollateralisedArgs, CreditAccountFrozenArgs, CreditManagerPausedArgs, CreditOperationArgs, CreditOperationError, CreditOperationPreview, CreditSimulationInput, DebtLimitsArgs, EmergencyLiquidatorArgs, ForbiddenTokenArgs, HealthFactorThresholds, type IntentValidationError, LeverageArgs, LiquidationEligibilityError, LiquidationValidationError, LiquidatorEligibleArgs, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_SAFE_HEALTH_FACTOR_FORM, MarketExpiredArgs, MarketStateError, MaxQuotaArgs, OperationValidationError, PartiallyLiquidatableArgs, PoolLiquidityArgs, PoolOperationArgs, PoolOperationError, PoolPausedArgs, PoolSunsetArgs, QuotaActiveArgs, QuotaChangeArgs, QuotaCountArgs, QuotaLimitArgs, QuotaUpdateError, RWAOpeningError, ReservePriceLimitedArgs, SimulationValidationError, WalletFundingError, WeighedFactors, amountOf, checkAaveDelegation, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLeverage, checkLiquidation, checkLiquidationEligibility, checkLiquidationFunding, checkLiquidatorEligible, checkMarket, checkMarketExpired, checkMaxQuota, checkMidasAccountGreenlist, checkObtained, checkOperation, checkPartiallyLiquidatable, checkPoolFunding, checkPoolLiquidity, checkPoolOperation, checkPoolPaused, checkPoolSunset, checkQuotaActive, checkQuotaChange, checkQuotaCount, checkQuotaLimit, checkQuotaUpdates, checkRWAOpenRequirements, checkRWAOpening, checkReservePriceLimited, checkSimulation, checkWallet, checkWalletAllowance, checkWalletBalance, raise, toToken, toTokenAmount };
@@ -5,7 +5,7 @@ import { LeverageBand } from "../onchain/accounts/intents/leverage-band.js";
5
5
  import { PoolOperationError } from "../onchain/validation/bundles/checkPoolOperation.js";
6
6
  import { IAnalytics, IAnalyticsByMode } from "./analytics/types.js";
7
7
  import { ILiquidations, ILiquidationsByMode, IsEmergencyLiquidatorProps } from "./liquidations/types.js";
8
- import { AccountFlowError, AddCollateralParams, AdjustLeverageParams, BorrowAndWithdrawParams, BorrowParams, BorrowResult, DelayedStrategyResult, DepositStrategyParams, EmptyCreditAccountResult, FinalizeParams, FinalizeResult, IOpportunitiesPrepare, LpParams, LpRedeemParams, LpResult, LpState, MaxBorrowAndWithdrawOptions, MaxBorrowParams, MaxWithdrawCollateralOptions, MoveToAaveParams, OpenAavePositionResult, OpenAavePositionState, OpenFlowError, OpenStrategyError, OpenStrategyParams, OpenStrategyResult, PoolInput, PositionInput, PrepareOptions, QuotaBufferState, RepayStrategyParams, StrategyInput, StrategyResult, StrategyRoutesResult, UpdateQuotaParams, WithRouteErrors, WithdrawCollateralParams, WithdrawStrategyParams } from "./prepare/types.js";
8
+ import { AccountFlowError, AddCollateralParams, AdjustLeverageParams, BorrowAndWithdrawParams, BorrowParams, BorrowResult, DelayedStrategyResult, DepositStrategyParams, EmptyCreditAccountResult, FinalizeParams, FinalizeResult, IOpportunitiesPrepare, LpParams, LpRedeemParams, LpResult, LpState, MaxBorrowAndWithdrawOptions, MaxBorrowParams, MaxWithdrawCollateralOptions, MoveToAaveParams, OpenAavePositionParams, OpenAavePositionResult, OpenAavePositionState, OpenFlowError, OpenStrategyError, OpenStrategyParams, OpenStrategyResult, PoolInput, PositionInput, PrepareOptions, QuotaBufferState, RepayStrategyParams, StrategyInput, StrategyResult, StrategyRoutesResult, UpdateQuotaParams, WithRouteErrors, WithdrawCollateralParams, WithdrawStrategyParams } from "./prepare/types.js";
9
9
  import { ChainOf, PrepareApi } from "./prepare/PrepareApi.js";
10
10
  import "./prepare/index.js";
11
11
  import { AccountPrepareRequest, BorrowPrepareRequest, IOpportunitiesExecute, OpenEmptyPrepareRequest, OpenPrepareRequest, PoolPrepareRequest, PrepareRequest } from "./execute/types.js";
@@ -45,4 +45,4 @@ import { SourceUnavailableError } from "./errors/SourceUnavailableError.js";
45
45
  import { assertSameChains } from "./errors/assertSameChains.js";
46
46
  import { everyChainFailed } from "./errors/everyChainFailed.js";
47
47
  import "./errors/index.js";
48
- export { AbstractNamespace, AccountFlowError, AccountPrepareRequest, AddCollateralParams, AdjustLeverageParams, AllSourcesFailedError, AnalyticsNamespace, BorrowAndWithdrawParams, BorrowParams, BorrowPrepareRequest, BorrowResult, type BorrowState, ChainOf, ChainRef, CheckOperationProps, type CreditAccountNotEmptyError, type CreditAccountNotFoundError, DEFAULT_MAX_OFFCHAIN_LAG, DEFAULT_MAX_STATE_AGE, DelayedStrategyResult, DepositStrategyParams, EmptyCreditAccountResult, EnsureFreshChains, type EntityMerger, ExecuteApi, type ExecutionCost, type FilterResult, FinalizeParams, FinalizeResult, GearboxSDK, GearboxSDKOptions, IAnalytics, IAnalyticsByMode, IGearboxSDK, ILiquidations, ILiquidationsByMode, IOpportunities, IOpportunitiesBase, IOpportunitiesByMode, IOpportunitiesExecute, IOpportunitiesOffchainBranch, IOpportunitiesOffchainOnly, IOpportunitiesOnchainBranch, IOpportunitiesOnchainOnly, IOpportunitiesPrepare, IOpportunityMergers, IPositionMergers, IPositions, IPositionsBase, IPositionsByMode, IPositionsOffchainBranch, IPositionsOffchainOnly, IPositionsOnchainBranch, IPositionsOnchainOnly, IPreview, IPreviewByMode, type IRewards, type IRewardsByMode, IsEmergencyLiquidatorProps, type LeverageBand, LiquidationsNamespace, type ListMerger, LpParams, LpRedeemParams, LpResult, LpState, MaxBorrowAndWithdrawOptions, MaxBorrowParams, MaxWithdrawCollateralOptions, type MergeListResult, MergedQuery, MerklRequestFailedError, type MerkleXYZUserRewardsV4Response, MissingSourceError, Mode, MoveToAaveParams, type MultipleDelayedWithdrawalsError, NamespaceOptions, type NoDelayedRouteError, type NoRecordedIntentError, NoSourceServedError, type NoStrategyTargetCollateralError, OffchainByMode, OffchainSource, OnchainByMode, OnchainSource, OpenAavePositionResult, OpenAavePositionState, OpenEmptyPrepareRequest, OpenFlowError, OpenPrepareRequest, OpenStrategyError, OpenStrategyParams, OpenStrategyResult, type OperationState, OpportunitiesNamespace, type PathLossRate, PlainMultichainSDKOptions, PoolInput, type PoolOperationError, PoolPrepareRequest, PositionInput, PositionsNamespace, PrepareApi, PrepareOptions, PrepareRequest, PreviewNamespace, QuotaBufferState, RepayStrategyParams, type RewardsKeys, RewardsNamespace, type RouteErrors, SourceChainMismatchError, SourceUnavailableError, StrategyInput, StrategyResult, StrategyRoutesResult, TurtleRequestFailedError, type TurtleWalletRewards, type UnexpectedFailureError, type UnsupportedCollateralTokenError, type UnsupportedTokenPairError, UpdateQuotaParams, type WithPartialState, WithRouteErrors, type WithdrawCeilings, WithdrawCollateralParams, WithdrawStrategyParams, type WithdrawalInProgressError, assertSameChains, creditAccountNotEmpty, creditAccountNotFound, everyChainFailed, filterResponse, mergeChainList, mergeChainOne, noStrategyTargetCollateral, unexpectedFailure };
48
+ export { AbstractNamespace, AccountFlowError, AccountPrepareRequest, AddCollateralParams, AdjustLeverageParams, AllSourcesFailedError, AnalyticsNamespace, BorrowAndWithdrawParams, BorrowParams, BorrowPrepareRequest, BorrowResult, type BorrowState, ChainOf, ChainRef, CheckOperationProps, type CreditAccountNotEmptyError, type CreditAccountNotFoundError, DEFAULT_MAX_OFFCHAIN_LAG, DEFAULT_MAX_STATE_AGE, DelayedStrategyResult, DepositStrategyParams, EmptyCreditAccountResult, EnsureFreshChains, type EntityMerger, ExecuteApi, type ExecutionCost, type FilterResult, FinalizeParams, FinalizeResult, GearboxSDK, GearboxSDKOptions, IAnalytics, IAnalyticsByMode, IGearboxSDK, ILiquidations, ILiquidationsByMode, IOpportunities, IOpportunitiesBase, IOpportunitiesByMode, IOpportunitiesExecute, IOpportunitiesOffchainBranch, IOpportunitiesOffchainOnly, IOpportunitiesOnchainBranch, IOpportunitiesOnchainOnly, IOpportunitiesPrepare, IOpportunityMergers, IPositionMergers, IPositions, IPositionsBase, IPositionsByMode, IPositionsOffchainBranch, IPositionsOffchainOnly, IPositionsOnchainBranch, IPositionsOnchainOnly, IPreview, IPreviewByMode, type IRewards, type IRewardsByMode, IsEmergencyLiquidatorProps, type LeverageBand, LiquidationsNamespace, type ListMerger, LpParams, LpRedeemParams, LpResult, LpState, MaxBorrowAndWithdrawOptions, MaxBorrowParams, MaxWithdrawCollateralOptions, type MergeListResult, MergedQuery, MerklRequestFailedError, type MerkleXYZUserRewardsV4Response, MissingSourceError, Mode, MoveToAaveParams, type MultipleDelayedWithdrawalsError, NamespaceOptions, type NoDelayedRouteError, type NoRecordedIntentError, NoSourceServedError, type NoStrategyTargetCollateralError, OffchainByMode, OffchainSource, OnchainByMode, OnchainSource, OpenAavePositionParams, OpenAavePositionResult, OpenAavePositionState, OpenEmptyPrepareRequest, OpenFlowError, OpenPrepareRequest, OpenStrategyError, OpenStrategyParams, OpenStrategyResult, type OperationState, OpportunitiesNamespace, type PathLossRate, PlainMultichainSDKOptions, PoolInput, type PoolOperationError, PoolPrepareRequest, PositionInput, PositionsNamespace, PrepareApi, PrepareOptions, PrepareRequest, PreviewNamespace, QuotaBufferState, RepayStrategyParams, type RewardsKeys, RewardsNamespace, type RouteErrors, SourceChainMismatchError, SourceUnavailableError, StrategyInput, StrategyResult, StrategyRoutesResult, TurtleRequestFailedError, type TurtleWalletRewards, type UnexpectedFailureError, type UnsupportedCollateralTokenError, type UnsupportedTokenPairError, UpdateQuotaParams, type WithPartialState, WithRouteErrors, type WithdrawCeilings, WithdrawCollateralParams, WithdrawStrategyParams, type WithdrawalInProgressError, assertSameChains, creditAccountNotEmpty, creditAccountNotFound, everyChainFailed, filterResponse, mergeChainList, mergeChainOne, noStrategyTargetCollateral, unexpectedFailure };
@@ -14,7 +14,7 @@ import { LeverageBand } from "../../onchain/accounts/intents/leverage-band.js";
14
14
  import { OpenStrategyState } from "../../onchain/accounts/intents/open-strategy.js";
15
15
  import { PoolOperationError } from "../../onchain/validation/bundles/checkPoolOperation.js";
16
16
  import "../../onchain/index.js";
17
- import { AccountFlowError, AddCollateralParams, AdjustLeverageParams, BorrowAndWithdrawParams, BorrowParams, BorrowResult, DepositStrategyParams, EmptyCreditAccountResult, FinalizeParams, FinalizeResult, IOpportunitiesPrepare, LpParams, LpRedeemParams, LpResult, LpState, MaxBorrowAndWithdrawOptions, MaxBorrowParams, MaxWithdrawCollateralOptions, MoveToAaveParams, OpenAavePositionResult, OpenAavePositionState, OpenFlowError, OpenStrategyError, OpenStrategyParams, OpenStrategyResult, PoolInput, PositionInput, QuotaBufferState, RepayStrategyParams, StrategyInput, StrategyResult, StrategyRoutesResult, UpdateQuotaParams, WithRouteErrors, WithdrawCollateralParams, WithdrawStrategyParams } from "./types.js";
17
+ import { AccountFlowError, AddCollateralParams, AdjustLeverageParams, BorrowAndWithdrawParams, BorrowParams, BorrowResult, DepositStrategyParams, EmptyCreditAccountResult, FinalizeParams, FinalizeResult, IOpportunitiesPrepare, LpParams, LpRedeemParams, LpResult, LpState, MaxBorrowAndWithdrawOptions, MaxBorrowParams, MaxWithdrawCollateralOptions, MoveToAaveParams, OpenAavePositionParams, OpenAavePositionResult, OpenAavePositionState, OpenFlowError, OpenStrategyError, OpenStrategyParams, OpenStrategyResult, PoolInput, PositionInput, QuotaBufferState, RepayStrategyParams, StrategyInput, StrategyResult, StrategyRoutesResult, UpdateQuotaParams, WithRouteErrors, WithdrawCollateralParams, WithdrawStrategyParams } from "./types.js";
18
18
  import { EnsureFreshChains } from "../types.js";
19
19
  import { Address } from "viem";
20
20
  //#region src/sdk/prepare/PrepareApi.d.ts
@@ -77,7 +77,7 @@ export declare class PrepareApi extends MultichainConstruct implements IOpportun
77
77
  /**
78
78
  * {@inheritDoc IOpportunitiesPrepare.openAavePosition}
79
79
  **/
80
- openAavePosition(strategy: StrategyInput, params: OpenStrategyParams): Promise<SDKReturn<OpenAavePositionResult, OpenStrategyError & WithPartialState<OpenAavePositionState>>>;
80
+ openAavePosition(strategy: StrategyInput, params: OpenAavePositionParams): Promise<SDKReturn<OpenAavePositionResult, (OpenStrategyError | UnsupportedCollateralTokenError) & WithPartialState<OpenAavePositionState>>>;
81
81
  /**
82
82
  * {@inheritDoc IOpportunitiesPrepare.borrow}
83
83
  **/