@gearbox-protocol/sdk 18.4.1-aave.1 → 18.4.1-aave.2
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.
- package/dist/cjs/onchain/accounts/bots/AccountBotsService.js +29 -0
- package/dist/cjs/onchain/accounts/bots/PeripheryCompressorV310Contract.js +2 -1
- package/dist/cjs/onchain/accounts/intents/operations.js +2 -2
- package/dist/cjs/onchain/index.js +4 -0
- package/dist/cjs/onchain/market/ZapperRegister.js +1 -1
- package/dist/cjs/onchain/market/adapters/abi/aave/iAaveOracle.js +20 -0
- package/dist/cjs/onchain/market/adapters/abi/aave/iAaveV3Pool.js +166 -0
- package/dist/cjs/onchain/market/adapters/abi/aave/iPoolAddressesProvider.js +11 -0
- package/dist/cjs/onchain/market/adapters/abi/aave/index.js +4 -0
- package/dist/cjs/onchain/market/adapters/abi/adapters/iAaveHorizonBridgeAdapter.js +27 -0
- package/dist/cjs/onchain/market/adapters/abi/index.js +4 -0
- package/dist/cjs/onchain/market/adapters/contracts/AaveHorizonBridgeAdapterContract.js +53 -12
- package/dist/cjs/onchain/market/adapters/contracts/AaveV3PoolAdapterContract.js +5 -11
- package/dist/cjs/onchain/market/adapters/index.js +4 -0
- package/dist/cjs/onchain/market/index.js +4 -0
- package/dist/cjs/onchain/positions/projectAavePosition.js +161 -26
- package/dist/cjs/sdk/prepare/PrepareApi.js +19 -2
- package/dist/cjs/sdk/preview/PreviewNamespace.js +11 -2
- package/dist/esm/onchain/accounts/bots/AccountBotsService.js +29 -0
- package/dist/esm/onchain/accounts/bots/PeripheryCompressorV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/intents/operations.js +2 -2
- package/dist/esm/onchain/index.js +3 -1
- package/dist/esm/onchain/market/ZapperRegister.js +1 -1
- package/dist/esm/onchain/market/adapters/abi/aave/iAaveOracle.js +19 -0
- package/dist/esm/onchain/market/adapters/abi/aave/iAaveV3Pool.js +166 -0
- package/dist/esm/onchain/market/adapters/abi/aave/iPoolAddressesProvider.js +10 -0
- package/dist/esm/onchain/market/adapters/abi/aave/index.js +3 -1
- package/dist/esm/onchain/market/adapters/abi/adapters/iAaveHorizonBridgeAdapter.js +27 -0
- package/dist/esm/onchain/market/adapters/abi/index.js +3 -1
- package/dist/esm/onchain/market/adapters/contracts/AaveHorizonBridgeAdapterContract.js +54 -13
- package/dist/esm/onchain/market/adapters/contracts/AaveV3PoolAdapterContract.js +6 -12
- package/dist/esm/onchain/market/adapters/index.js +3 -1
- package/dist/esm/onchain/market/index.js +3 -1
- package/dist/esm/onchain/positions/projectAavePosition.js +162 -27
- package/dist/esm/sdk/prepare/PrepareApi.js +20 -3
- package/dist/esm/sdk/preview/PreviewNamespace.js +11 -2
- package/dist/types/model/aave.d.ts +5 -3
- package/dist/types/onchain/accounts/bots/AccountBotsService.d.ts +11 -1
- package/dist/types/onchain/accounts/bots/index.d.ts +2 -2
- package/dist/types/onchain/accounts/bots/types.d.ts +7 -1
- package/dist/types/onchain/accounts/index.d.ts +2 -2
- package/dist/types/onchain/accounts/intents/operations.d.ts +9 -3
- package/dist/types/onchain/index.d.ts +4 -2
- package/dist/types/onchain/market/adapters/abi/aave/iAaveOracle.d.ts +22 -0
- package/dist/types/onchain/market/adapters/abi/aave/iAaveV3Pool.d.ts +139 -0
- package/dist/types/onchain/market/adapters/abi/aave/iPoolAddressesProvider.d.ts +11 -0
- package/dist/types/onchain/market/adapters/abi/aave/index.d.ts +3 -1
- package/dist/types/onchain/market/adapters/abi/adapters/iAaveHorizonBridgeAdapter.d.ts +21 -0
- package/dist/types/onchain/market/adapters/abi/index.d.ts +3 -1
- package/dist/types/onchain/market/adapters/contracts/AaveHorizonBridgeAdapterContract.d.ts +39 -10
- package/dist/types/onchain/market/adapters/contracts/AaveV3PoolAdapterContract.d.ts +142 -4
- package/dist/types/onchain/market/adapters/index.d.ts +3 -1
- package/dist/types/onchain/market/index.d.ts +3 -1
- package/dist/types/onchain/positions/projectAavePosition.d.ts +33 -4
- package/dist/types/sdk/index.d.ts +2 -2
- package/dist/types/sdk/prepare/PrepareApi.d.ts +2 -2
- package/dist/types/sdk/prepare/index.d.ts +2 -2
- package/dist/types/sdk/prepare/types.d.ts +32 -5
- package/dist/types/sdk/preview/types.d.ts +4 -2
- package/package.json +1 -1
|
@@ -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
|
|
283
|
-
*
|
|
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
|
-
|
|
424
|
+
supplyDiffCall(asset: Address, leftoverAmount: bigint): MultiCall;
|
|
287
425
|
stateHuman(raw?: boolean): {
|
|
288
426
|
address: string;
|
|
289
427
|
version: number;
|
|
@@ -1,5 +1,7 @@
|
|
|
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";
|
|
3
5
|
import { AdapterContractStateHuman, AdapterContractType, AdapterProtocolOperation, AdapterType, DelayedWithdrawalClaim, DelayedWithdrawalRequest, IAdapterContract, VersionedAbi } from "./types.js";
|
|
4
6
|
import { adapterActionAbi, adapterActionSelectors, adapterActionSignatures } from "./abi/actionAbi.js";
|
|
5
7
|
import { erc4626ReferralAdapterAbi } from "./abi/adapters/erc4626ReferralAdapter.js";
|
|
@@ -102,4 +104,4 @@ import "./contracts/index.js";
|
|
|
102
104
|
import { AdapterFactoryArgs, createAdapter } from "./createAdapter.js";
|
|
103
105
|
import { TokenTransfer } from "./transfers.js";
|
|
104
106
|
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 };
|
|
107
|
+
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, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, rewardsFromTransfers, swapFromTransfers, toNetTransfers };
|
|
@@ -1,5 +1,7 @@
|
|
|
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";
|
|
3
5
|
import { DEGEN_NFT_MIDAS, PHANTOM_TOKEN_MIDAS_REDEMPTION, RWA_LIQUIDATOR_MIDAS } from "./rwa/midas/constants.js";
|
|
4
6
|
import { DEGEN_NFT_SECURITIZE, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, RWA_LIQUIDATOR_SECURITIZE } from "./rwa/securitize/constants.js";
|
|
5
7
|
import { DStokenData, SecuritizeCreditAccountData, SecuritizeInvestorData, SecuritizeRWAFactoryStateHuman } from "./rwa/securitize/types.js";
|
|
@@ -173,4 +175,4 @@ import "./zapper/index.js";
|
|
|
173
175
|
import { MarketRegister, MarketRegistryState, MarketRegistryStateHuman } from "./MarketRegister.js";
|
|
174
176
|
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
177
|
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 };
|
|
178
|
+
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, 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
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
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):
|
|
44
|
+
export declare function projectAavePosition(sdk: OnchainSDK, snapshot: AccountSnapshot, owner: Address): Promise<AaveProjection | undefined>;
|
|
16
45
|
//#endregion
|
|
@@ -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:
|
|
80
|
+
openAavePosition(strategy: StrategyInput, params: OpenAavePositionParams): Promise<SDKReturn<OpenAavePositionResult, (OpenStrategyError | UnsupportedCollateralTokenError) & WithPartialState<OpenAavePositionState>>>;
|
|
81
81
|
/**
|
|
82
82
|
* {@inheritDoc IOpportunitiesPrepare.borrow}
|
|
83
83
|
**/
|
|
@@ -4,6 +4,6 @@ import { ExecutionCost, OperationState, PathLossRate, RouteErrors, WithPartialSt
|
|
|
4
4
|
import { BorrowState } from "../../onchain/accounts/intents/borrow.js";
|
|
5
5
|
import { LeverageBand } from "../../onchain/accounts/intents/leverage-band.js";
|
|
6
6
|
import { PoolOperationError } from "../../onchain/validation/bundles/checkPoolOperation.js";
|
|
7
|
-
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 "./types.js";
|
|
7
|
+
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 "./types.js";
|
|
8
8
|
import { ChainOf, PrepareApi } from "./PrepareApi.js";
|
|
9
|
-
export { AccountFlowError, AddCollateralParams, AdjustLeverageParams, BorrowAndWithdrawParams, BorrowParams, BorrowResult, type BorrowState, ChainOf, type CreditAccountNotEmptyError, type CreditAccountNotFoundError, DelayedStrategyResult, DepositStrategyParams, EmptyCreditAccountResult, type ExecutionCost, FinalizeParams, FinalizeResult, IOpportunitiesPrepare, type LeverageBand, LpParams, LpRedeemParams, LpResult, LpState, MaxBorrowAndWithdrawOptions, MaxBorrowParams, MaxWithdrawCollateralOptions, MoveToAaveParams, type MultipleDelayedWithdrawalsError, type NoDelayedRouteError, type NoRecordedIntentError, type NoStrategyTargetCollateralError, OpenAavePositionResult, OpenAavePositionState, OpenFlowError, OpenStrategyError, OpenStrategyParams, OpenStrategyResult, type OperationState, type PathLossRate, PoolInput, type PoolOperationError, PositionInput, PrepareApi, PrepareOptions, QuotaBufferState, RepayStrategyParams, type RouteErrors, StrategyInput, StrategyResult, StrategyRoutesResult, type UnexpectedFailureError, type UnsupportedCollateralTokenError, type UnsupportedTokenPairError, UpdateQuotaParams, type WithPartialState, WithRouteErrors, type WithdrawCeilings, WithdrawCollateralParams, WithdrawStrategyParams, type WithdrawalInProgressError, creditAccountNotEmpty, creditAccountNotFound, noStrategyTargetCollateral, unexpectedFailure };
|
|
9
|
+
export { AccountFlowError, AddCollateralParams, AdjustLeverageParams, BorrowAndWithdrawParams, BorrowParams, BorrowResult, type BorrowState, ChainOf, type CreditAccountNotEmptyError, type CreditAccountNotFoundError, DelayedStrategyResult, DepositStrategyParams, EmptyCreditAccountResult, type ExecutionCost, FinalizeParams, FinalizeResult, IOpportunitiesPrepare, type LeverageBand, LpParams, LpRedeemParams, LpResult, LpState, MaxBorrowAndWithdrawOptions, MaxBorrowParams, MaxWithdrawCollateralOptions, MoveToAaveParams, type MultipleDelayedWithdrawalsError, type NoDelayedRouteError, type NoRecordedIntentError, type NoStrategyTargetCollateralError, OpenAavePositionParams, OpenAavePositionResult, OpenAavePositionState, OpenFlowError, OpenStrategyError, OpenStrategyParams, OpenStrategyResult, type OperationState, type PathLossRate, PoolInput, type PoolOperationError, PositionInput, PrepareApi, PrepareOptions, QuotaBufferState, RepayStrategyParams, type RouteErrors, StrategyInput, StrategyResult, StrategyRoutesResult, type UnexpectedFailureError, type UnsupportedCollateralTokenError, type UnsupportedTokenPairError, UpdateQuotaParams, type WithPartialState, WithRouteErrors, type WithdrawCeilings, WithdrawCollateralParams, WithdrawStrategyParams, type WithdrawalInProgressError, creditAccountNotEmpty, creditAccountNotFound, noStrategyTargetCollateral, unexpectedFailure };
|
|
@@ -463,6 +463,14 @@ export interface OpenStrategyParams extends PrepareOptions {
|
|
|
463
463
|
**/
|
|
464
464
|
creditAccount?: Address;
|
|
465
465
|
}
|
|
466
|
+
export interface OpenAavePositionParams extends OpenStrategyParams {
|
|
467
|
+
/**
|
|
468
|
+
* Wallet the account is opened for. The Aave position is this wallet's own,
|
|
469
|
+
* so what it already holds and owes on the Horizon pool counts towards the
|
|
470
|
+
* health factor and the debt Aave lends.
|
|
471
|
+
**/
|
|
472
|
+
wallet: Address;
|
|
473
|
+
}
|
|
466
474
|
export interface BorrowParams extends PrepareOptions {
|
|
467
475
|
/**
|
|
468
476
|
* Token the wallet puts up as collateral. Must be a collateral token of the
|
|
@@ -657,12 +665,27 @@ export interface IOpportunitiesPrepare {
|
|
|
657
665
|
/**
|
|
658
666
|
* Opening a leveraged position on Aave Horizon from wallet collateral.
|
|
659
667
|
*
|
|
660
|
-
* The RWA collateral
|
|
661
|
-
* one {@link openNewStrategy} prepares: a Gearbox credit account borrows
|
|
662
|
-
* subscribes to the mint. Once the mint settles
|
|
663
|
-
*
|
|
668
|
+
* The RWA collateral may be minted asynchronously, so the opening itself is
|
|
669
|
+
* the one {@link openNewStrategy} prepares: a Gearbox credit account borrows
|
|
670
|
+
* and subscribes to the mint. Once the mint settles — at once where the
|
|
671
|
+
* withdrawal compressor lists no delayed operation for the RWA — the
|
|
672
|
+
* position moves to Aave, and `state.aave` describes it there.
|
|
673
|
+
*
|
|
674
|
+
* The move is the finalizer bot's: the facade refuses to change an
|
|
675
|
+
* account's debt twice in a block, so it cannot ride on the opening even
|
|
676
|
+
* when the mint is instant. The opening grants the bot its permissions on
|
|
677
|
+
* every credit manager with a Horizon bridge adapter, whichever of the two
|
|
678
|
+
* methods prepared it; the bot is the one the market configurator lists
|
|
679
|
+
* among its periphery contracts for that bridge, and with none listed the
|
|
680
|
+
* opening grants nothing and the move is left to {@link moveToAave}.
|
|
681
|
+
*
|
|
682
|
+
* The bot borrows the whole Gearbox debt on Aave or reverts, so an opening
|
|
683
|
+
* whose debt is above what Aave lends against the collateral at its LTV is
|
|
684
|
+
* refused with `debtOutOfRange`, `maxDebt` being that amount. A market whose
|
|
685
|
+
* target collateral cannot be moved to Aave is refused with
|
|
686
|
+
* `unsupportedCollateralToken`.
|
|
664
687
|
**/
|
|
665
|
-
openAavePosition(strategy: StrategyInput, params:
|
|
688
|
+
openAavePosition(strategy: StrategyInput, params: OpenAavePositionParams): Promise<SDKReturn<OpenAavePositionResult, (OpenStrategyError | UnsupportedCollateralTokenError) & WithPartialState<OpenAavePositionState>>>;
|
|
666
689
|
/**
|
|
667
690
|
* Handing a wallet an account that holds nothing: no collateral, no debt, no
|
|
668
691
|
* quotas and no route quoted. It exists so a wallet can hold an account
|
|
@@ -787,6 +810,10 @@ export interface IOpportunitiesPrepare {
|
|
|
787
810
|
* The second half of an {@link openAavePosition}: once the RWA collateral
|
|
788
811
|
* has been minted, the position leaves the credit account for Aave Horizon.
|
|
789
812
|
*
|
|
813
|
+
* The finalizer bot does this by itself; this is the manual path, for an
|
|
814
|
+
* account the bot has not reached. It makes the bot's adapter calls, but the
|
|
815
|
+
* debt is read here rather than in the transaction, hence the margin.
|
|
816
|
+
*
|
|
790
817
|
* One transaction: the whole balance of `token` is supplied to the Aave
|
|
791
818
|
* pool, the aTokens go to the account owner through the Horizon bridge,
|
|
792
819
|
* which borrows the underlying on the owner's behalf into the account, and
|
|
@@ -31,8 +31,10 @@ export interface IPreview {
|
|
|
31
31
|
* credit account the position is built in while the mint settles, and the
|
|
32
32
|
* position it becomes on Aave after that.
|
|
33
33
|
*
|
|
34
|
-
* Calldata that is not an account opening
|
|
35
|
-
* `unsupportedOperation`.
|
|
34
|
+
* Calldata that is not an account opening, or opens on a credit manager
|
|
35
|
+
* that cannot move it to Aave, is refused with `unsupportedOperation`. The
|
|
36
|
+
* Aave position is the one of the opening's `onBehalfOf`, or of the sender
|
|
37
|
+
* where the calldata names no owner.
|
|
36
38
|
**/
|
|
37
39
|
openAavePosition(input: PreviewOperationInput, options?: PreviewOperationOptions): Promise<SDKReturn<OpenAavePositionPreview, PreviewOperationError>>;
|
|
38
40
|
/**
|