@gearbox-protocol/sdk 17.2.0-next.1 → 17.2.0-next.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/intents/leverage-band.js +1 -1
- package/dist/cjs/onchain/accounts/intents/maxBorrow.js +8 -6
- package/dist/cjs/onchain/accounts/intents/testing/sdk-mock.js +5 -3
- package/dist/cjs/onchain/chain/chains.js +1 -2
- package/dist/cjs/onchain/index.js +2 -0
- package/dist/cjs/onchain/market/MarketSuite.js +11 -4
- package/dist/cjs/onchain/market/credit/CreditSuite.js +24 -177
- package/dist/cjs/onchain/market/credit/CreditSuiteStrategy.js +179 -0
- package/dist/cjs/onchain/market/credit/index.js +2 -0
- package/dist/cjs/onchain/market/index.js +2 -0
- package/dist/cjs/onchain/opportunities/OpportunitiesService.js +7 -9
- package/dist/cjs/sdk/prepare/PrepareApi.js +1 -1
- package/dist/esm/onchain/accounts/intents/leverage-band.js +1 -1
- package/dist/esm/onchain/accounts/intents/maxBorrow.js +8 -6
- package/dist/esm/onchain/accounts/intents/testing/sdk-mock.js +5 -3
- package/dist/esm/onchain/chain/chains.js +1 -2
- package/dist/esm/onchain/index.js +2 -1
- package/dist/esm/onchain/market/MarketSuite.js +11 -4
- package/dist/esm/onchain/market/credit/CreditSuite.js +26 -179
- package/dist/esm/onchain/market/credit/CreditSuiteStrategy.js +178 -0
- package/dist/esm/onchain/market/credit/index.js +2 -1
- package/dist/esm/onchain/market/index.js +2 -1
- package/dist/esm/onchain/opportunities/OpportunitiesService.js +7 -9
- package/dist/esm/sdk/prepare/PrepareApi.js +1 -1
- package/dist/types/onchain/accounts/intents/maxBorrow.d.ts +5 -5
- package/dist/types/onchain/index.d.ts +2 -1
- package/dist/types/onchain/market/MarketSuite.d.ts +6 -0
- package/dist/types/onchain/market/credit/CreditSuite.d.ts +17 -70
- package/dist/types/onchain/market/credit/CreditSuiteStrategy.d.ts +78 -0
- package/dist/types/onchain/market/credit/index.d.ts +2 -1
- package/dist/types/onchain/market/credit/types.d.ts +3 -1
- package/dist/types/onchain/market/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { isSunsetStrategy } from "../../chain/chains.js";
|
|
2
|
+
import { calcBorrowApy, calcQuotaRate } from "../math.js";
|
|
3
|
+
import { strategyName } from "../strategyName.js";
|
|
4
|
+
import { isAddressEqual } from "viem";
|
|
5
|
+
//#region src/onchain/market/credit/CreditSuiteStrategy.ts
|
|
6
|
+
/**
|
|
7
|
+
* Amount of underlying seeded into each pool at market creation to protect
|
|
8
|
+
* from inflation attacks, in raw token units. A strategy whose
|
|
9
|
+
* {@link CreditSuiteStrategy.maxBorrowAmount} is at or below this is treated
|
|
10
|
+
* as having nothing left to lend.
|
|
11
|
+
**/
|
|
12
|
+
const MIN_STRATEGY_BORROW_AMOUNT = 100000n;
|
|
13
|
+
/**
|
|
14
|
+
* The leveraged strategy a credit suite runs: one target collateral bought
|
|
15
|
+
* with underlying borrowed from the pool.
|
|
16
|
+
*
|
|
17
|
+
* A view over live suite state, see {@link CreditSuite.strategy}.
|
|
18
|
+
*/
|
|
19
|
+
var CreditSuiteStrategy = class {
|
|
20
|
+
/**
|
|
21
|
+
* Credit suite this strategy borrows through.
|
|
22
|
+
*/
|
|
23
|
+
suite;
|
|
24
|
+
/**
|
|
25
|
+
* Collateral token a position in this strategy is built to hold.
|
|
26
|
+
*/
|
|
27
|
+
targetCollateral;
|
|
28
|
+
constructor(suite, targetCollateral) {
|
|
29
|
+
this.suite = suite;
|
|
30
|
+
this.targetCollateral = targetCollateral;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* {@link targetCollateral} as the shared read model describes it.
|
|
34
|
+
*/
|
|
35
|
+
get token() {
|
|
36
|
+
return this.suite.sdk.tokensMeta.mustGetToken(this.targetCollateral);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Display name of this strategy, e.g. `"wstETH / WETH"`.
|
|
40
|
+
*/
|
|
41
|
+
get name() {
|
|
42
|
+
return strategyName(this.token, this.suite.underlyingToken);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Tokens a user can transfer from their wallet when opening a position in
|
|
46
|
+
* this strategy:
|
|
47
|
+
*
|
|
48
|
+
* 1. unwrapped underlying (USDC, never dcUSDC)
|
|
49
|
+
* 2. target collateral
|
|
50
|
+
* 3. remaining CM collaterals in manager order, excluding phantom tokens
|
|
51
|
+
* and tokens without price
|
|
52
|
+
*/
|
|
53
|
+
get allowedDepositTokens() {
|
|
54
|
+
const { market, creditManager, sdk } = this.suite;
|
|
55
|
+
const { tokensMeta } = sdk;
|
|
56
|
+
const { targetCollateral } = this;
|
|
57
|
+
const { mainPrices, reservePrices } = market.priceOracle;
|
|
58
|
+
const rest = creditManager.collateralTokens.filter((token) => {
|
|
59
|
+
const contractType = tokensMeta.mustGet(token).contractType;
|
|
60
|
+
return !market.isUnderlyingLike(token) && !isAddressEqual(token, targetCollateral) && !contractType?.startsWith("PHANTOM_TOKEN::") && (!!mainPrices.get(token)?.price || !!reservePrices.get(token)?.price);
|
|
61
|
+
});
|
|
62
|
+
return [
|
|
63
|
+
market.unwrappedUnderlying,
|
|
64
|
+
targetCollateral,
|
|
65
|
+
...rest
|
|
66
|
+
].map((token) => tokensMeta.mustGetToken(token));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Largest debt one new position can take right now, and which limit set
|
|
70
|
+
* that number.
|
|
71
|
+
*
|
|
72
|
+
* `amount` is `0` whenever no position can be opened right now,
|
|
73
|
+
* and `limit` explains why.
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
76
|
+
maxBorrowAmount() {
|
|
77
|
+
const { suite } = this;
|
|
78
|
+
const lends = suite.maxBorrowAmount();
|
|
79
|
+
if (lends.limit === "debtPerBlockLimit") return lends;
|
|
80
|
+
let value = lends.amount.value;
|
|
81
|
+
let limit = lends.limit;
|
|
82
|
+
const quota = suite.market.pool.pqk.quotaAvailable(this.targetCollateral);
|
|
83
|
+
if (quota < value) {
|
|
84
|
+
value = quota;
|
|
85
|
+
limit = "quotaAvailable";
|
|
86
|
+
}
|
|
87
|
+
if (value < suite.creditFacade.minDebt) return {
|
|
88
|
+
amount: suite.market.toUnderlyingAmount(0n),
|
|
89
|
+
limit: "minDebt"
|
|
90
|
+
};
|
|
91
|
+
return {
|
|
92
|
+
amount: suite.market.toUnderlyingAmount(value),
|
|
93
|
+
limit
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Whether this strategy is offered as an opportunity right now: it lends
|
|
98
|
+
* more than the pool's seed amount, and its target can be opened today.
|
|
99
|
+
*/
|
|
100
|
+
get isListed() {
|
|
101
|
+
return this.maxBorrowAmount().amount.value > MIN_STRATEGY_BORROW_AMOUNT && this.suite.isStrategyCollateral(this.targetCollateral, true);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Describes this strategy as the shared read model does. Whether it is
|
|
105
|
+
* listed at all is {@link isListed}.
|
|
106
|
+
*/
|
|
107
|
+
opportunity() {
|
|
108
|
+
const { suite, targetCollateral } = this;
|
|
109
|
+
const { market, creditManager: cm } = suite;
|
|
110
|
+
const { pool } = market.pool;
|
|
111
|
+
const oracle = market.priceOracle;
|
|
112
|
+
const debtParams = pool.creditManagerDebtParams.get(cm.address);
|
|
113
|
+
const borrowed = debtParams?.borrowed ?? 0n;
|
|
114
|
+
return {
|
|
115
|
+
kind: "strategy",
|
|
116
|
+
chainId: suite.chainId,
|
|
117
|
+
creditManager: cm.address,
|
|
118
|
+
targetCollateral: this.token,
|
|
119
|
+
name: this.name,
|
|
120
|
+
curator: market.curator,
|
|
121
|
+
underlyingToken: suite.underlyingToken,
|
|
122
|
+
totalBorrowed: oracle.toAmount(pool.underlying, borrowed),
|
|
123
|
+
allowedDepositTokens: this.allowedDepositTokens,
|
|
124
|
+
paused: suite.isPaused,
|
|
125
|
+
rwa: market.rwa,
|
|
126
|
+
sunset: market.sunset || isSunsetStrategy(cm.address, suite.sdk.networkType),
|
|
127
|
+
liquidationThreshold: cm.liquidationThresholds.mustGet(targetCollateral),
|
|
128
|
+
liquidationPremium: cm.liquidationPremium,
|
|
129
|
+
liquidationFee: cm.feeLiquidation,
|
|
130
|
+
expirationDate: suite.expirationDate,
|
|
131
|
+
borrowApy: calcBorrowApy(pool.baseInterestRate, cm.feeInterest),
|
|
132
|
+
quotaRate: calcQuotaRate(market.pool.pqk.quotaRate(targetCollateral), cm.feeInterest),
|
|
133
|
+
availableLiquidity: oracle.toAmount(pool.underlying, pool.availableLiquidity),
|
|
134
|
+
minDebt: oracle.toAmount(pool.underlying, suite.creditFacade.minDebt),
|
|
135
|
+
totalDebtLimit: oracle.toAmount(pool.underlying, debtParams?.limit ?? 0n),
|
|
136
|
+
maxBorrowAmount: oracle.toAmount(pool.underlying, this.maxBorrowAmount().amount.value),
|
|
137
|
+
maxLeverage: cm.maxLeverage(targetCollateral)
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* {@link opportunity} plus the data only its detail screen needs.
|
|
142
|
+
*/
|
|
143
|
+
opportunityDetail() {
|
|
144
|
+
const { market } = this.suite;
|
|
145
|
+
return {
|
|
146
|
+
...this.opportunity(),
|
|
147
|
+
rateCurve: market.pool.rateCurve,
|
|
148
|
+
priceFeeds: market.priceFeedSummary(this.targetCollateral)
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The KYC gate of this strategy; `null` when there is none.
|
|
153
|
+
* Wallet-independent.
|
|
154
|
+
*/
|
|
155
|
+
async kycRequirement() {
|
|
156
|
+
const nft = await this.suite.degenNFT();
|
|
157
|
+
if (!nft) return null;
|
|
158
|
+
const tokens = await nft.getTokens();
|
|
159
|
+
const token = tokens.find((t) => isAddressEqual(t, this.targetCollateral)) ?? tokens[0];
|
|
160
|
+
return {
|
|
161
|
+
protocol: nft.protocol,
|
|
162
|
+
token: token ? this.suite.sdk.tokensMeta.getToken(token) : void 0,
|
|
163
|
+
registrationLink: nft.registrationLink
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Whether `wallet` may open this strategy today; `true` when there is no
|
|
168
|
+
* KYC gate.
|
|
169
|
+
*/
|
|
170
|
+
async isEligible(wallet) {
|
|
171
|
+
const nft = await this.suite.degenNFT();
|
|
172
|
+
if (!nft) return true;
|
|
173
|
+
const requirements = await nft.getOpenAccountRequirements(wallet, { tokenOutAddress: this.targetCollateral });
|
|
174
|
+
return nft.isRegistered(requirements);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
//#endregion
|
|
178
|
+
export { CreditSuiteStrategy };
|
|
@@ -2,8 +2,9 @@ import { CreditConfiguratorV310Contract } from "./CreditConfiguratorV310Contract
|
|
|
2
2
|
import { CreditFacadeV310BaseContract, creditFacadeV310Abi as abi } from "./CreditFacadeV310BaseContract.js";
|
|
3
3
|
import { CreditFacadeV310Contract } from "./CreditFacadeV310Contract.js";
|
|
4
4
|
import { CreditManagerV310Contract } from "./CreditManagerV310Contract.js";
|
|
5
|
+
import { CreditSuiteStrategy } from "./CreditSuiteStrategy.js";
|
|
5
6
|
import { dominantCollateral, isStrategyCollateral, pickStrategyTargetCollateral } from "./collateralUtils.js";
|
|
6
7
|
import { CreditSuite } from "./CreditSuite.js";
|
|
7
8
|
import { expectedBalanceDeltas } from "./expectedBalanceDeltas.js";
|
|
8
9
|
import "./types.js";
|
|
9
|
-
export { CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, abi as creditFacadeV310Abi, dominantCollateral, expectedBalanceDeltas, isStrategyCollateral, pickStrategyTargetCollateral };
|
|
10
|
+
export { CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, CreditSuiteStrategy, abi as creditFacadeV310Abi, dominantCollateral, expectedBalanceDeltas, isStrategyCollateral, pickStrategyTargetCollateral };
|
|
@@ -93,6 +93,7 @@ import { DEGEN_NFT_MIDAS, PHANTOM_TOKEN_MIDAS_REDEMPTION, RWA_LIQUIDATOR_MIDAS }
|
|
|
93
93
|
import { MidasDegenNFT } from "./rwa/midas/MidasDegenNFT.js";
|
|
94
94
|
import { DEGEN_NFT_SECURITIZE, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, RWA_LIQUIDATOR_SECURITIZE } from "./rwa/securitize/constants.js";
|
|
95
95
|
import { strategyName } from "./strategyName.js";
|
|
96
|
+
import { CreditSuiteStrategy } from "./credit/CreditSuiteStrategy.js";
|
|
96
97
|
import { dominantCollateral, isStrategyCollateral, pickStrategyTargetCollateral } from "./credit/collateralUtils.js";
|
|
97
98
|
import { CreditSuite } from "./credit/CreditSuite.js";
|
|
98
99
|
import { expectedBalanceDeltas } from "./credit/expectedBalanceDeltas.js";
|
|
@@ -148,4 +149,4 @@ import { RWARegistry, RWA_COMPRESSOR_ADDRESS } from "./rwa/RWARegistry.js";
|
|
|
148
149
|
import { isRWAFactory } from "./rwa/types.js";
|
|
149
150
|
import "./rwa/index.js";
|
|
150
151
|
import "./types.js";
|
|
151
|
-
export { AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterType, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CamelotV3AdapterContract, CompositePriceFeedContract, ConstantPriceFeedContract, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, IERC20ZapperContract, IETHZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LidoV1AdapterContract, LinearInterestRateModelContract, MAX_LEVERAGE_BUFFER_BPS, MarketRegister, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolSuite, PoolV310Contract, PriceFeedRef, PriceFeedRegistry, PriceOracleV310Contract, PriceUpdatesCache, PythPriceFeed, RWARegistry, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RedstonePriceFeedContract, SecuritizeDegenNFT, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, TraderJoePoolVersion, TraderJoeRouterAdapterContract, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, UpshiftVaultAdapterContract, VelodromeV2RouterAdapterContract, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, ZapperContract, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, abi as creditFacadeV310Abi, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, dominantCollateral, erc4626ReferralAdapterAbi, expectedBalanceDeltas, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getRawPriceUpdates, hasAdapterDeployParamsAbi, healthFactorBps, 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, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isLPPriceFeed, isRWAFactory, isStrategyCollateral, isUpdatablePriceFeed, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, pickStrategyTargetCollateral, rayToBps, rewardsFromTransfers, strategyName, swapFromTransfers, toNetTransfers, updatableDependencies, usdToNumber };
|
|
152
|
+
export { AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterType, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CamelotV3AdapterContract, CompositePriceFeedContract, ConstantPriceFeedContract, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, CreditSuiteStrategy, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DaiUsdsAdapterContract, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, IERC20ZapperContract, IETHZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LidoV1AdapterContract, LinearInterestRateModelContract, MAX_LEVERAGE_BUFFER_BPS, MarketRegister, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolSuite, PoolV310Contract, PriceFeedRef, PriceFeedRegistry, PriceOracleV310Contract, PriceUpdatesCache, PythPriceFeed, RWARegistry, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RedstonePriceFeedContract, SecuritizeDegenNFT, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, TraderJoePoolVersion, TraderJoeRouterAdapterContract, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, UpshiftVaultAdapterContract, VelodromeV2RouterAdapterContract, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, ZapperContract, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, abi as creditFacadeV310Abi, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, dominantCollateral, erc4626ReferralAdapterAbi, expectedBalanceDeltas, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getRawPriceUpdates, hasAdapterDeployParamsAbi, healthFactorBps, 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, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isLPPriceFeed, isRWAFactory, isStrategyCollateral, isUpdatablePriceFeed, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, pickStrategyTargetCollateral, rayToBps, rewardsFromTransfers, strategyName, swapFromTransfers, toNetTransfers, updatableDependencies, usdToNumber };
|
|
@@ -42,12 +42,11 @@ var OpportunitiesService = class extends SDKConstruct {
|
|
|
42
42
|
* strategy.
|
|
43
43
|
**/
|
|
44
44
|
async getStrategy(key) {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const kyc = await suite.kycRequirement(detail.targetCollateral.address);
|
|
45
|
+
const strategy = this.sdk.marketRegister.findCreditManager(key.creditManager).strategy;
|
|
46
|
+
if (!strategy?.isListed) throw new Error(`credit manager ${key.creditManager} does not currently offer a strategy`);
|
|
47
|
+
const kyc = await strategy.kycRequirement();
|
|
49
48
|
return {
|
|
50
|
-
...
|
|
49
|
+
...strategy.opportunityDetail(),
|
|
51
50
|
kyc
|
|
52
51
|
};
|
|
53
52
|
}
|
|
@@ -59,10 +58,9 @@ var OpportunitiesService = class extends SDKConstruct {
|
|
|
59
58
|
* strategy.
|
|
60
59
|
**/
|
|
61
60
|
async isEligibleForStrategy(key, wallet) {
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return suite.isEligibleForStrategy(wallet, opportunity.targetCollateral.address);
|
|
61
|
+
const strategy = this.sdk.marketRegister.findCreditManager(key.creditManager).strategy;
|
|
62
|
+
if (!strategy?.isListed) throw new Error(`credit manager ${key.creditManager} does not currently offer a strategy`);
|
|
63
|
+
return strategy.isEligible(wallet);
|
|
66
64
|
}
|
|
67
65
|
};
|
|
68
66
|
//#endregion
|
|
@@ -230,7 +230,7 @@ var PrepareApi = class extends MultichainConstruct {
|
|
|
230
230
|
const sdk = await this.#chain(strategy.chainId);
|
|
231
231
|
const at = stateBlock(sdk);
|
|
232
232
|
Object.assign(state, marketOf(sdk, strategy.creditManager));
|
|
233
|
-
const targetToken = params.targetToken ?? sdk.marketRegister.findCreditManager(strategy.creditManager).
|
|
233
|
+
const targetToken = params.targetToken ?? sdk.marketRegister.findCreditManager(strategy.creditManager).strategy?.targetCollateral;
|
|
234
234
|
if (!targetToken) return refused(noStrategyTargetCollateral(strategy.creditManager), state);
|
|
235
235
|
const reused = await reusable(sdk, strategy, params.creditAccount);
|
|
236
236
|
if (reused && "error" in reused) return refused(reused.error, state);
|
|
@@ -29,9 +29,9 @@ interface MaxBorrowProps {
|
|
|
29
29
|
* Collateral is valued the way the transaction will be judged — at safe
|
|
30
30
|
* prices, under its liquidation threshold, capped by the quota the borrow
|
|
31
31
|
* buys for it, all of which is {@link collateralValuation}'s business. The ceiling
|
|
32
|
-
* is then held to what the market will actually lend
|
|
33
|
-
*
|
|
34
|
-
*
|
|
32
|
+
* is then held to what the market will actually lend,
|
|
33
|
+
* {@link CreditSuite.maxBorrowAmount}: the pool's free liquidity, the
|
|
34
|
+
* manager's own allowance and the facade's `maxDebt`, whichever binds first.
|
|
35
35
|
*
|
|
36
36
|
* The facade's `minDebt` is not applied to the collateral's own ceiling. It
|
|
37
37
|
* is a floor, and a ceiling answered as `0n` because the collateral is too
|
|
@@ -40,8 +40,8 @@ interface MaxBorrowProps {
|
|
|
40
40
|
* that carries something therefore answers with it, whether or not the market
|
|
41
41
|
* would lend that little; a loan under the floor is refused by `borrow`
|
|
42
42
|
* itself, with `debtOutOfRange` naming both ends. A market whose own capacity
|
|
43
|
-
* is under `minDebt` is different:
|
|
44
|
-
*
|
|
43
|
+
* is under `minDebt` is different: the answer is `0n`, because no loan of any
|
|
44
|
+
* size exists there.
|
|
45
45
|
*
|
|
46
46
|
* Nothing is fetched or simulated — the account does not exist yet and every
|
|
47
47
|
* input is loaded market state, so a form can call this on each keystroke.
|
|
@@ -178,6 +178,7 @@ import { LinearInterestRateModelContract } from "./market/pool/LinearInterestRat
|
|
|
178
178
|
import { PoolSuite } from "./market/pool/PoolSuite.js";
|
|
179
179
|
import { PoolV310Contract } from "./market/pool/PoolV310Contract.js";
|
|
180
180
|
import { MarketSuite } from "./market/MarketSuite.js";
|
|
181
|
+
import { CreditSuiteStrategy } from "./market/credit/CreditSuiteStrategy.js";
|
|
181
182
|
import { CreditSuite } from "./market/credit/CreditSuite.js";
|
|
182
183
|
import { StrategyCollateralProps, dominantCollateral, isStrategyCollateral, pickStrategyTargetCollateral } from "./market/credit/collateralUtils.js";
|
|
183
184
|
import { ExpectedBalanceDeltasProps, ExpectedOutput, expectedBalanceDeltas } from "./market/credit/expectedBalanceDeltas.js";
|
|
@@ -338,4 +339,4 @@ import { amountOf } from "./validation/helpers/amount.js";
|
|
|
338
339
|
import { MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_SAFE_HEALTH_FACTOR_FORM } from "./validation/helpers/health-factor-limits.js";
|
|
339
340
|
import { toToken, toTokenAmount } from "./validation/helpers/token.js";
|
|
340
341
|
import "./validation/index.js";
|
|
341
|
-
export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, type AccountCalculatorOperation, AccountMigratorAdapterContract, AccountSnapshot, AccountToCheck, AdapterContractStateHuman, AdapterContractType, AdapterData, AdapterFactoryArgs, AdapterOperation, AdapterOperationBase, AdapterProtocolOperation, AdapterType, type AddCollateralIntent, AddCollateralOp, AddLiquidityProps, AddressMap, AddressProviderAddresses, AddressProviderState, AddressProviderV310Contract, type AddressProviderV3StateHuman, AddressSet, type AdjustLeverageIntent, type AliasLossPolicyStateHuman, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, AssertAssignable, Asset, type AssetPriceFeedStateHuman, AssetWithAmountInTarget, AssetsMap, AttachOptions, BLOCKS_PER_WEEK_BY_NETWORK, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, BaseContractArgs, type BaseContractStateHuman, BaseParams, BasePlugin, type BasePriceFeedStateHuman, BaseState, BasicSwapCall, BigIntMath, type BlockNumberProps, BorrowLimitArgs, BorrowPreviewResult, type BorrowProps, type BorrowState, type BotListStateHuman, BotPermissions, BotStatusCall, BotsDirectResponse, type BoundedOracleStateHuman, BoundedPriceFeedContract, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, CalcBorrowRateProps, CalcDefaultQuotaProps, CalcHealthFactorProps, CalcLiquidationPriceForTargetProps, CalcLiquidationPriceProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, CallTrace, CamelotPool, CamelotV3AdapterContract, ChainBlock, ChainBlockPin, ChainBlockSource, ChainConfig, ChainContractsRegister, ChainNotConfiguredError, ChainQueryOneProps, ChainQueryProps, CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckLiquidationInput, CheckLiquidationOptions, CheckMidasAccountGreenlistInput, CheckOperationInput, CheckOperationOptions, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckSimulationInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, ClaimFarmRewardsProps, type ClaimRemainder, ClaimableWithdrawal, ClassifyInnerOperationsProps, ClientOptions, CloseCreditAccountOperation, CloseCreditAccountResult, CloseOrRepayOperation, ClosePathBalances, CollateralFundingPreview, CollateralisedArgs, CompareBalancesOp, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConnectedBotData, ConnectedBotsCall, ConnectedBotsPerAccount, type ConstantOracleStateHuman, ConstantPriceFeedContract, Construct, ConstructOptions, type ContractMethod, ContractOrInterface, ContractParseError, ContractParseErrorOptions, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, type CoreStateHuman, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountData, CreditAccountDataCall, CreditAccountDataPayload, CreditAccountFilter, CreditAccountFrozenArgs, CreditAccountOperation, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountState, CreditAccountStateProps, CreditAccountTokenQuota, CreditAccountTokensSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV310Contract, CreditFacadeState, type CreditFacadeStateHuman, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerDebtParams, type CreditManagerDebtParamsHuman, CreditManagerFilter, CreditManagerOperationResult, CreditManagerPausedArgs, CreditManagerState, type CreditManagerStateHuman, CreditManagerV310Contract, CreditOperationArgs, CreditOperationError, CreditOperationPreview, CreditSimulationInput, CreditSuite, CreditSuiteState, type CreditSuiteStateHuman, CurrentWithdrawals, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DStokenData, DUST_THRESHOLD, DaiUsdsAdapterContract, DebtLimitsArgs, DecreaseDebtOp, type DelayableIntent, DelayedIntentExtended, type DelayedRoute, type DelayedStart, type DelayedStartResult, DelayedWithdrawalClaim, DelayedWithdrawalRequest, DelegatedMulticall, DepositMetadata, type DepositStrategyIntent, DetectedDelayedClaim, DetectedDelayedOperation, DirectTokenTransferOperation, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, EmergencyLiquidatorArgs, EmptyAccountPreviewResult, EncodableCreditAccountOperation, Erc4626PriceFeedContract, EstimateRawTxGasParameters, EtherscanURLParam, ExecuteMulticallBatchesOptions, type ExecutionCost, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FacadeOperationMetadata, FilterDustUSDOptions, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, type FinishIntentProps, type FinishIntentResult, FluidDexAdapterContract, ForbiddenTokenArgs, FormatBNOptions, FullyLiquidateProps, FullyLiquidateResult, GaugeContract, GaugeData, GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, type GearStakingV3StateHuman, GearboxChain, type GearboxState, type GearboxStateHuman, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetCurrentWithdrawalsProps, GetCurrentWithdrawalsPropsBase, GetExternalAccountCurrentWithdrawalsProps, GetInvestorOptions, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetOpenAccountRequirementsProps, GetReward, GetWithdrawalRequestResultProps, HealthFactorThresholds, HydrateOptions, IAdapterContract, IAddressProviderContract, IBaseContract, ICreditAccountsService, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, type ILogger, IMultichainOpportunitiesService, IMultichainPositionsService, IOnchainSDKPlugin, IOnchainSDKPluginConstructor, IPluginState, IPoolContract, IPoolsService, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdateTx, type IPriceUpdater, IRWAFactory, IRateKeeperContract, IRedemptionLoggerContract, IRouterContract, type IUpdatablePriceFeedContract, IWithdrawalCompressorContract, IZapperContract, IncreaseDebtOp, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InnerFacadeOperation, InnerOperation, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, type IntentValidationError, type InterestRateModelStateHuman, InterestRateModelType, IsDustOptions, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LPMonopolizedPoolMeta, type LPPriceFeedStateHuman, type LatestUpdate, LegacyAdapterOperation, LeverageArgs, type LeverageBand, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, type LinearInterestRateModelStateHuman, LiquidateCreditAccountOperation, LiquidationEligibilityError, LiquidationFees, LiquidationValidationError, LiquidationsService, LiquidatorEligibleArgs, ListPoolPositionsProps, ListPositionsProps, ListPositionsPropsBase, ListStrategyPositionsProps, LoadRWALiquidatorsProps, type LogFn, type LossPolicyStateHuman, MAX_INT, MAX_LEVERAGE_BUFFER_BPS, MAX_UINT16, MAX_UINT256, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_INT96, MIN_SAFE_HEALTH_FACTOR_FORM, MULTICALL_ADDRESS, MakerDeposit, MakerRedeem, MarketData, MarketExpiredArgs, MarketFilter, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketStateError, type MarketStateHuman, MarketSuite, MarketType, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, Methods, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, type MultiCall, MulticallBatch, MulticallOperation, MulticallWithFailure, MultichainAttachOptions, type MultichainChainIdsProps, MultichainConstruct, MultichainHydrateOptions, MultichainLiquidationsService, type MultichainNetworkProps, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, MultichainSDKOptions, type MultichainState, type MultichainStateHuman, MultichainSyncStateOptions, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OnchainSDK, OnchainSDKOptions, OpenCAProps, OpenCreditAccountOperation, OpenStrategyPreviewResult, type OpenStrategyProps, OpenStrategyResult, type OpenStrategyState, Operation, OperationMetadata, type OperationState, OperationValidationError, OpportunitiesService, OptimalRepaidAmountProps, OuterFacadeOperation, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, ParsedCall, ParsedCallArgs, ParsedCallV2, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationOperation, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PartialRecord, PartiallyLiquidateProps, type PathLossRate, PendingWithdrawal, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PeripheryContract, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PickSomeRequired, PluginFactoriesMap, PluginFactory, PluginState, PluginStateVersionError, PluginStatesMap, PluginsMap, PoolDepositOperation, PoolLiquidityArgs, PoolMintOperation, PoolOperation, PoolOperationArgs, PoolOperationError, PoolPausedArgs, PoolQuotaKeeperContract, type PoolQuotaKeeperStateHuman, PoolRedeemOperation, PoolService, PoolServiceCall, PoolServiceCallResult, PoolSimulation, PoolState, type PoolStateHuman, PoolSuite, type PoolSuiteStateHuman, PoolSunsetArgs, PoolV310Contract, PoolWithdrawOperation, PositionsService, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PreviewOperationError, PriceFeedAnswer, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedMapEntry, PriceFeedRef, PriceFeedRegistry, type PriceFeedStateHuman, PriceFeedTreeNode, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleData, type PriceOracleStateHuman, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, ProjectedPoolOptions, PythPriceFeed, QuotaCountArgs, QuotaKeeperState, QuotaLimitArgs, QuotaMode, type QuotaParamsHuman, QuotaSlice, QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWADefaultTokenMeta, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWALiquidatorInfo, RWAMulticallOperation, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWAOpenCreditAccountOperation, RWAOpeningError, RWAOperation, RWAOperationMetadata, RWARegistry, RWAState, RWAStateHuman, RWATokenMeta, RWAUnderlyingContractType, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RampEvent, RateKeeperState, type RateKeeperStateHuman, RateKeeperType, type RawTx, RedemptionLog, RedemptionLoggerV310Contract, RedemptionPhantomRename, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RefusedIntent, RelaxedBaseParams, RemoveLiquidityProps, type RepayStrategyIntent, ReplayMulticallResult, ReplayState, ReplayableOperation, RequestableWithdrawal, ReservePriceLimitedArgs, type ResumableIntent, RetryOptions, RewardInfo, Rewards, type RouteErrors, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SDKConstruct, SDKOptions, SECONDS_PER_YEAR, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, SendRawTxParameters, SetBotProps, SetBotResult, SimpleTokenMeta, SimulateCallOptions, SimulateCallParameters, SimulateCallReturnType, SimulateMulticallParameters, SimulateMulticallReturnType, SimulatePoolOperationProps, SimulateWithPriceUpdatesError, SimulateWithPriceUpdatesErrorParams, SimulateWithPriceUpdatesErrorType, SimulateWithPriceUpdatesParameters, SimulateWithPriceUpdatesReturnType, SimulationError, SimulationErrorType, SimulationValidationError, StakingRewardsAdapterContract, type StartIntent, StoreExpectedBalancesOp, StrategyCollateralProps, StrategyRateInputs, SupportedValue, Swap, SwapOperation, SyncStateOptions, type TimestampedCalldata, TokenAmount, TokenInfo, TokenMetaData, TokenTransfer, TokensMeta, TokensMetaState, TraceAdapterExt, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, type TumblerStateHuman, TypedObjectUtils, Unarray, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpdateQuotaOp, UpshiftVaultAdapterContract, VERSION_RANGE_310, VaultDeposit, VelodromeV2RouterAdapterContract, VersionRange, VersionedAbi, VotingContractStatus, WAD, WAD_DECIMALS_POW, WalletFundingError, WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, WeighedFactors, type WithBlock, type WithMultichain, type WithPartialState, type WithdrawAssetIntent, type WithdrawCeilings, WithdrawCollateral, WithdrawCollateralOp, type WithdrawStrategyIntent, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalMetadata, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, accountSnapshotFromCreditAccountData, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, amountOf, assetsMap, attachOptionsSchema, botPermissionsToString, bpsToRay, buildDelayedStrategyPositionOperationPreview, bytes32ToString, calcBorrowApy, calcBorrowRate, calcDefaultQuota, calcEffectiveBorrowApy, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcQuotaUpdate, calcRecommendedQuota, calcTimeToLiquidationMs, calcUtilization, calcUtilizationRaw, chains, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLeverage, checkLiquidation, checkLiquidationEligibility, checkLiquidationFunding, checkLiquidatorEligible, checkMarket, checkMarketExpired, checkMidasAccountGreenlist, checkObtained, checkOperation, checkPoolFunding, checkPoolLiquidity, checkPoolOperation, checkPoolPaused, checkPoolSunset, checkQuotaCount, checkQuotaLimit, checkRWAOpenRequirements, checkRWAOpening, checkReservePriceLimited, checkSimulation, checkWallet, checkWalletAllowance, checkWalletBalance, childLogger, classifyCloseOrRepay, classifyCurveOperation, classifyInnerOperations, collateralPriceInUnderlying, collectTraces, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, decodeDelayedIntent, detectDelayedClaim, detectDelayedOperation, detectNetwork, dominantCollateral, encodeDelayedIntent, erc4626ReferralAdapterAbi, estimateClaimableAt, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, executeMulticallBatches, expectedBalanceDeltas, fetchCreditAccountSlice, filterDust, filterDustUSD, findCallTo, findCallWithInput, findCuratorMarketConfigurator, findExecuteBytes, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAccountTargetCollateral, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getLegacyStrategyTarget, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hasAdapterDeployParamsAbi, healthFactorBps, hexEq, hydrateAddressProvider, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCreditAccountAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isCloseOrRepay, isDust, isLPPriceFeed, isPhantomToken, isPoolOperation, isPublicNetwork, isRWAFactory, isRWAOperation, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, isZeroBalance, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, makeReplayState, mellowDvvAdapterAbi, midasGreenlistsAccount, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parsePosNegAmount, parseRWAFactoryOperationCalldata, percentFmt, pickStrategyTargetCollateral, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, raise, rayToBps, rayToNumber, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent, resolveProtocolCall, retry, rewardsFromTransfers, roundUpQuota, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, soleNonUnderlyingCollateral, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toToken, toTokenAmount, toWithdrawalStatus, updatableDependencies, usdToNumber, watchBlocksAsync };
|
|
342
|
+
export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, type AccountCalculatorOperation, AccountMigratorAdapterContract, AccountSnapshot, AccountToCheck, AdapterContractStateHuman, AdapterContractType, AdapterData, AdapterFactoryArgs, AdapterOperation, AdapterOperationBase, AdapterProtocolOperation, AdapterType, type AddCollateralIntent, AddCollateralOp, AddLiquidityProps, AddressMap, AddressProviderAddresses, AddressProviderState, AddressProviderV310Contract, type AddressProviderV3StateHuman, AddressSet, type AdjustLeverageIntent, type AliasLossPolicyStateHuman, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, AssertAssignable, Asset, type AssetPriceFeedStateHuman, AssetWithAmountInTarget, AssetsMap, AttachOptions, BLOCKS_PER_WEEK_BY_NETWORK, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, BaseContractArgs, type BaseContractStateHuman, BaseParams, BasePlugin, type BasePriceFeedStateHuman, BaseState, BasicSwapCall, BigIntMath, type BlockNumberProps, BorrowLimitArgs, BorrowPreviewResult, type BorrowProps, type BorrowState, type BotListStateHuman, BotPermissions, BotStatusCall, BotsDirectResponse, type BoundedOracleStateHuman, BoundedPriceFeedContract, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, CalcBorrowRateProps, CalcDefaultQuotaProps, CalcHealthFactorProps, CalcLiquidationPriceForTargetProps, CalcLiquidationPriceProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, CallTrace, CamelotPool, CamelotV3AdapterContract, ChainBlock, ChainBlockPin, ChainBlockSource, ChainConfig, ChainContractsRegister, ChainNotConfiguredError, ChainQueryOneProps, ChainQueryProps, CheckCollateralFundingInput, CheckLiquidationEligibilityInput, CheckLiquidationFundingInput, CheckLiquidationInput, CheckLiquidationOptions, CheckMidasAccountGreenlistInput, CheckOperationInput, CheckOperationOptions, CheckPoolFundingInput, CheckRWAOpenRequirementsInput, CheckRWAOpeningInput, CheckSimulationInput, CheckWalletAllowanceInput, CheckWalletBalanceInput, CheckWalletInput, ClaimFarmRewardsProps, type ClaimRemainder, ClaimableWithdrawal, ClassifyInnerOperationsProps, ClientOptions, CloseCreditAccountOperation, CloseCreditAccountResult, CloseOrRepayOperation, ClosePathBalances, CollateralFundingPreview, CollateralisedArgs, CompareBalancesOp, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConnectedBotData, ConnectedBotsCall, ConnectedBotsPerAccount, type ConstantOracleStateHuman, ConstantPriceFeedContract, Construct, ConstructOptions, type ContractMethod, ContractOrInterface, ContractParseError, ContractParseErrorOptions, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, type CoreStateHuman, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountData, CreditAccountDataCall, CreditAccountDataPayload, CreditAccountFilter, CreditAccountFrozenArgs, CreditAccountOperation, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountState, CreditAccountStateProps, CreditAccountTokenQuota, CreditAccountTokensSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV310Contract, CreditFacadeState, type CreditFacadeStateHuman, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerDebtParams, type CreditManagerDebtParamsHuman, CreditManagerFilter, CreditManagerOperationResult, CreditManagerPausedArgs, CreditManagerState, type CreditManagerStateHuman, CreditManagerV310Contract, CreditOperationArgs, CreditOperationError, CreditOperationPreview, CreditSimulationInput, CreditSuite, CreditSuiteState, type CreditSuiteStateHuman, CreditSuiteStrategy, CurrentWithdrawals, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DStokenData, DUST_THRESHOLD, DaiUsdsAdapterContract, DebtLimitsArgs, DecreaseDebtOp, type DelayableIntent, DelayedIntentExtended, type DelayedRoute, type DelayedStart, type DelayedStartResult, DelayedWithdrawalClaim, DelayedWithdrawalRequest, DelegatedMulticall, DepositMetadata, type DepositStrategyIntent, DetectedDelayedClaim, DetectedDelayedOperation, DirectTokenTransferOperation, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, EmergencyLiquidatorArgs, EmptyAccountPreviewResult, EncodableCreditAccountOperation, Erc4626PriceFeedContract, EstimateRawTxGasParameters, EtherscanURLParam, ExecuteMulticallBatchesOptions, type ExecutionCost, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FacadeOperationMetadata, FilterDustUSDOptions, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, type FinishIntentProps, type FinishIntentResult, FluidDexAdapterContract, ForbiddenTokenArgs, FormatBNOptions, FullyLiquidateProps, FullyLiquidateResult, GaugeContract, GaugeData, GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, type GearStakingV3StateHuman, GearboxChain, type GearboxState, type GearboxStateHuman, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetCurrentWithdrawalsProps, GetCurrentWithdrawalsPropsBase, GetExternalAccountCurrentWithdrawalsProps, GetInvestorOptions, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetOpenAccountRequirementsProps, GetReward, GetWithdrawalRequestResultProps, HealthFactorThresholds, HydrateOptions, IAdapterContract, IAddressProviderContract, IBaseContract, ICreditAccountsService, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, type ILogger, IMultichainOpportunitiesService, IMultichainPositionsService, IOnchainSDKPlugin, IOnchainSDKPluginConstructor, IPluginState, IPoolContract, IPoolsService, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdateTx, type IPriceUpdater, IRWAFactory, IRateKeeperContract, IRedemptionLoggerContract, IRouterContract, type IUpdatablePriceFeedContract, IWithdrawalCompressorContract, IZapperContract, IncreaseDebtOp, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InnerFacadeOperation, InnerOperation, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, type IntentValidationError, type InterestRateModelStateHuman, InterestRateModelType, IsDustOptions, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LPMonopolizedPoolMeta, type LPPriceFeedStateHuman, type LatestUpdate, LegacyAdapterOperation, LeverageArgs, type LeverageBand, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, type LinearInterestRateModelStateHuman, LiquidateCreditAccountOperation, LiquidationEligibilityError, LiquidationFees, LiquidationValidationError, LiquidationsService, LiquidatorEligibleArgs, ListPoolPositionsProps, ListPositionsProps, ListPositionsPropsBase, ListStrategyPositionsProps, LoadRWALiquidatorsProps, type LogFn, type LossPolicyStateHuman, MAX_INT, MAX_LEVERAGE_BUFFER_BPS, MAX_UINT16, MAX_UINT256, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_INT96, MIN_SAFE_HEALTH_FACTOR_FORM, MULTICALL_ADDRESS, MakerDeposit, MakerRedeem, MarketData, MarketExpiredArgs, MarketFilter, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketStateError, type MarketStateHuman, MarketSuite, MarketType, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, Methods, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, type MultiCall, MulticallBatch, MulticallOperation, MulticallWithFailure, MultichainAttachOptions, type MultichainChainIdsProps, MultichainConstruct, MultichainHydrateOptions, MultichainLiquidationsService, type MultichainNetworkProps, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, MultichainSDKOptions, type MultichainState, type MultichainStateHuman, MultichainSyncStateOptions, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OnchainSDK, OnchainSDKOptions, OpenCAProps, OpenCreditAccountOperation, OpenStrategyPreviewResult, type OpenStrategyProps, OpenStrategyResult, type OpenStrategyState, Operation, OperationMetadata, type OperationState, OperationValidationError, OpportunitiesService, OptimalRepaidAmountProps, OuterFacadeOperation, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, ParsedCall, ParsedCallArgs, ParsedCallV2, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationOperation, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PartialRecord, PartiallyLiquidateProps, type PathLossRate, PendingWithdrawal, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PeripheryContract, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PickSomeRequired, PluginFactoriesMap, PluginFactory, PluginState, PluginStateVersionError, PluginStatesMap, PluginsMap, PoolDepositOperation, PoolLiquidityArgs, PoolMintOperation, PoolOperation, PoolOperationArgs, PoolOperationError, PoolPausedArgs, PoolQuotaKeeperContract, type PoolQuotaKeeperStateHuman, PoolRedeemOperation, PoolService, PoolServiceCall, PoolServiceCallResult, PoolSimulation, PoolState, type PoolStateHuman, PoolSuite, type PoolSuiteStateHuman, PoolSunsetArgs, PoolV310Contract, PoolWithdrawOperation, PositionsService, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, PreviewOperationError, PriceFeedAnswer, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedMapEntry, PriceFeedRef, PriceFeedRegistry, type PriceFeedStateHuman, PriceFeedTreeNode, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleData, type PriceOracleStateHuman, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, ProjectedPoolOptions, PythPriceFeed, QuotaCountArgs, QuotaKeeperState, QuotaLimitArgs, QuotaMode, type QuotaParamsHuman, QuotaSlice, QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWADefaultTokenMeta, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWALiquidatorInfo, RWAMulticallOperation, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWAOpenCreditAccountOperation, RWAOpeningError, RWAOperation, RWAOperationMetadata, RWARegistry, RWAState, RWAStateHuman, RWATokenMeta, RWAUnderlyingContractType, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RampEvent, RateKeeperState, type RateKeeperStateHuman, RateKeeperType, type RawTx, RedemptionLog, RedemptionLoggerV310Contract, RedemptionPhantomRename, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RefusedIntent, RelaxedBaseParams, RemoveLiquidityProps, type RepayStrategyIntent, ReplayMulticallResult, ReplayState, ReplayableOperation, RequestableWithdrawal, ReservePriceLimitedArgs, type ResumableIntent, RetryOptions, RewardInfo, Rewards, type RouteErrors, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SDKConstruct, SDKOptions, SECONDS_PER_YEAR, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, SendRawTxParameters, SetBotProps, SetBotResult, SimpleTokenMeta, SimulateCallOptions, SimulateCallParameters, SimulateCallReturnType, SimulateMulticallParameters, SimulateMulticallReturnType, SimulatePoolOperationProps, SimulateWithPriceUpdatesError, SimulateWithPriceUpdatesErrorParams, SimulateWithPriceUpdatesErrorType, SimulateWithPriceUpdatesParameters, SimulateWithPriceUpdatesReturnType, SimulationError, SimulationErrorType, SimulationValidationError, StakingRewardsAdapterContract, type StartIntent, StoreExpectedBalancesOp, StrategyCollateralProps, StrategyRateInputs, SupportedValue, Swap, SwapOperation, SyncStateOptions, type TimestampedCalldata, TokenAmount, TokenInfo, TokenMetaData, TokenTransfer, TokensMeta, TokensMetaState, TraceAdapterExt, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, type TumblerStateHuman, TypedObjectUtils, Unarray, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpdateQuotaOp, UpshiftVaultAdapterContract, VERSION_RANGE_310, VaultDeposit, VelodromeV2RouterAdapterContract, VersionRange, VersionedAbi, VotingContractStatus, WAD, WAD_DECIMALS_POW, WalletFundingError, WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, WeighedFactors, type WithBlock, type WithMultichain, type WithPartialState, type WithdrawAssetIntent, type WithdrawCeilings, WithdrawCollateral, WithdrawCollateralOp, type WithdrawStrategyIntent, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalMetadata, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, accountSnapshotFromCreditAccountData, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, amountOf, assetsMap, attachOptionsSchema, botPermissionsToString, bpsToRay, buildDelayedStrategyPositionOperationPreview, bytes32ToString, calcBorrowApy, calcBorrowRate, calcDefaultQuota, calcEffectiveBorrowApy, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcQuotaUpdate, calcRecommendedQuota, calcTimeToLiquidationMs, calcUtilization, calcUtilizationRaw, chains, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLeverage, checkLiquidation, checkLiquidationEligibility, checkLiquidationFunding, checkLiquidatorEligible, checkMarket, checkMarketExpired, checkMidasAccountGreenlist, checkObtained, checkOperation, checkPoolFunding, checkPoolLiquidity, checkPoolOperation, checkPoolPaused, checkPoolSunset, checkQuotaCount, checkQuotaLimit, checkRWAOpenRequirements, checkRWAOpening, checkReservePriceLimited, checkSimulation, checkWallet, checkWalletAllowance, checkWalletBalance, childLogger, classifyCloseOrRepay, classifyCurveOperation, classifyInnerOperations, collateralPriceInUnderlying, collectTraces, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, decodeDelayedIntent, detectDelayedClaim, detectDelayedOperation, detectNetwork, dominantCollateral, encodeDelayedIntent, erc4626ReferralAdapterAbi, estimateClaimableAt, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, executeMulticallBatches, expectedBalanceDeltas, fetchCreditAccountSlice, filterDust, filterDustUSD, findCallTo, findCallWithInput, findCuratorMarketConfigurator, findExecuteBytes, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAccountTargetCollateral, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getLegacyStrategyTarget, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hasAdapterDeployParamsAbi, healthFactorBps, hexEq, hydrateAddressProvider, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCreditAccountAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isCloseOrRepay, isDust, isLPPriceFeed, isPhantomToken, isPoolOperation, isPublicNetwork, isRWAFactory, isRWAOperation, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, isZeroBalance, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, makeReplayState, mellowDvvAdapterAbi, midasGreenlistsAccount, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parsePosNegAmount, parseRWAFactoryOperationCalldata, percentFmt, pickStrategyTargetCollateral, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, raise, rayToBps, rayToNumber, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent, resolveProtocolCall, retry, rewardsFromTransfers, roundUpQuota, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, soleNonUnderlyingCollateral, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toToken, toTokenAmount, toWithdrawalStatus, updatableDependencies, usdToNumber, watchBlocksAsync };
|
|
@@ -12,6 +12,7 @@ import { IPriceOracleContract } from "./oracle/types.js";
|
|
|
12
12
|
import "./oracle/index.js";
|
|
13
13
|
import { PoolSuite } from "./pool/PoolSuite.js";
|
|
14
14
|
import "./pool/index.js";
|
|
15
|
+
import { CreditSuiteStrategy } from "./credit/CreditSuiteStrategy.js";
|
|
15
16
|
import { CreditSuite } from "./credit/CreditSuite.js";
|
|
16
17
|
import "./credit/index.js";
|
|
17
18
|
import { OnchainSDK } from "../OnchainSDK.js";
|
|
@@ -173,6 +174,11 @@ declare class MarketSuite extends SDKConstruct {
|
|
|
173
174
|
* condition means.
|
|
174
175
|
*/
|
|
175
176
|
opportunities(filter?: OpportunityFilter): Opportunity[];
|
|
177
|
+
/**
|
|
178
|
+
* Strategies this market lists as opportunities; see
|
|
179
|
+
* {@link CreditSuiteStrategy.isListed}.
|
|
180
|
+
*/
|
|
181
|
+
strategies(): CreditSuiteStrategy[];
|
|
176
182
|
/**
|
|
177
183
|
* Passive lending into this market's pool, as the shared read model
|
|
178
184
|
* describes it.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Bps, Timestamp, Token, UnderlyingToken } from "../../../model/primitives.js";
|
|
2
|
-
import {
|
|
3
|
-
import { StrategyOpportunity, StrategyOpportunityDetail } from "../../../model/opportunities.js";
|
|
2
|
+
import { RWAOperationArgs } from "../../../model/rwa.js";
|
|
4
3
|
import { CreditOperationMarket } from "../../../model/previews.js";
|
|
5
4
|
import "../../../model/index.js";
|
|
6
5
|
import { CreditAccountData, CreditSuiteState } from "../../base/types.js";
|
|
@@ -11,6 +10,7 @@ import { IRouterContract } from "../../router/types.js";
|
|
|
11
10
|
import "../../router/index.js";
|
|
12
11
|
import { MarketConfiguratorContract } from "../MarketConfiguratorContract.js";
|
|
13
12
|
import { MarketSuite } from "../MarketSuite.js";
|
|
13
|
+
import { CreditSuiteStrategy } from "./CreditSuiteStrategy.js";
|
|
14
14
|
import { MultiCall, RawTx } from "../../types/transactions.js";
|
|
15
15
|
import { OnchainSDK } from "../../OnchainSDK.js";
|
|
16
16
|
import "../../types/index.js";
|
|
@@ -99,16 +99,6 @@ declare class CreditSuite extends SDKConstruct {
|
|
|
99
99
|
* `undefined` when the facade has none, or when the NFT is not a KYC gate.
|
|
100
100
|
*/
|
|
101
101
|
degenNFT(): Promise<IDegenNFT | undefined>;
|
|
102
|
-
/**
|
|
103
|
-
* The KYC gate of this suite's strategy; `null` when there is none.
|
|
104
|
-
* Wallet-independent.
|
|
105
|
-
*/
|
|
106
|
-
kycRequirement(targetCollateral: Address): Promise<KycRequirement | null>;
|
|
107
|
-
/**
|
|
108
|
-
* Whether `wallet` may open this suite's strategy today; `true` when there
|
|
109
|
-
* is no KYC gate.
|
|
110
|
-
*/
|
|
111
|
-
isEligibleForStrategy(wallet: Address, targetCollateral: Address): Promise<boolean>;
|
|
112
102
|
/**
|
|
113
103
|
* Builds a transaction that executes a multicall on one of this suite's
|
|
114
104
|
* credit accounts.
|
|
@@ -175,7 +165,8 @@ declare class CreditSuite extends SDKConstruct {
|
|
|
175
165
|
* row all spread it, so the five fields are filled in one place and cannot
|
|
176
166
|
* drift apart between the halves of the SDK.
|
|
177
167
|
*
|
|
178
|
-
* The curator comes from the same getter
|
|
168
|
+
* The curator comes from the same getter
|
|
169
|
+
* {@link CreditSuiteStrategy.opportunity} reads, so
|
|
179
170
|
* a result and the opportunity beside it name one entity.
|
|
180
171
|
*/
|
|
181
172
|
creditOperationMarket(): CreditOperationMarket;
|
|
@@ -194,63 +185,38 @@ declare class CreditSuite extends SDKConstruct {
|
|
|
194
185
|
*/
|
|
195
186
|
isForbidden(token: Address): boolean;
|
|
196
187
|
/**
|
|
197
|
-
* Largest debt this credit manager
|
|
198
|
-
* and which limit set that number.
|
|
188
|
+
* Largest debt this credit manager allows to borrow, and which limit set that number.
|
|
199
189
|
*
|
|
200
190
|
* Minimum of:
|
|
201
191
|
* - the pool's available liquidity,
|
|
202
192
|
* - this manager's remaining debt allowance, and
|
|
203
193
|
* - the facade's per-account `maxDebt`.
|
|
204
|
-
* While `maxDebtPerBlockMultiplier` is `0` the facade
|
|
205
|
-
* takes no new debt at all, so the answer is `0`.
|
|
206
194
|
*
|
|
207
|
-
*
|
|
208
|
-
* included, which is what the guards hold a simulation to. Opening a position
|
|
209
|
-
* answers to two more — see {@link maxStrategyBorrowAmount}.
|
|
195
|
+
* If the credit manager allows no debt at all, the answer is `0`.
|
|
210
196
|
*/
|
|
211
197
|
maxBorrowAmount(): MaxBorrowAmount;
|
|
212
198
|
/**
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
* {@link maxBorrowAmount} held to the two bounds only a position being opened
|
|
217
|
-
* answers to: the remaining quota of the strategy target collateral, which
|
|
218
|
-
* the position has to buy to be worth anything, and the facade's `minDebt`,
|
|
219
|
-
* which a first debt cannot sit under. `amount` is `0` whenever no position
|
|
220
|
-
* can be opened right now, and `limit` names why.
|
|
221
|
-
*
|
|
222
|
-
* An operation on an account that already exists is held to neither: its
|
|
223
|
-
* quota is weighed against the token its own plan buys, and its debt is
|
|
224
|
-
* already over the floor, so a top-up smaller than `minDebt` is legal.
|
|
225
|
-
*/
|
|
226
|
-
maxStrategyBorrowAmount(): MaxBorrowAmount;
|
|
227
|
-
/**
|
|
228
|
-
* The single target collateral of this suite's strategy, or `undefined` when
|
|
229
|
-
* none can be resolved.
|
|
199
|
+
* This suite's leveraged strategy, or `undefined` when no target collateral
|
|
200
|
+
* can be resolved.
|
|
230
201
|
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
* 2. the collateral with the biggest index in
|
|
236
|
-
* {@link ICreditManagerContract.collateralTokens} that
|
|
237
|
-
* {@link isStrategyCollateral} accepts with quota required;
|
|
238
|
-
* 3. the biggest-index collateral that {@link isStrategyCollateral} accepts
|
|
239
|
-
* without quota.
|
|
202
|
+
* The strategy exists whether or not it is offered today, because its
|
|
203
|
+
* target also names existing positions; see
|
|
204
|
+
* {@link CreditSuiteStrategy.isListed} for whether it is listed as an
|
|
205
|
+
* opportunity.
|
|
240
206
|
*/
|
|
241
|
-
get
|
|
207
|
+
get strategy(): CreditSuiteStrategy | undefined;
|
|
242
208
|
/**
|
|
243
|
-
*
|
|
244
|
-
*
|
|
209
|
+
* Whether `token` can be this suite's strategy target; see
|
|
210
|
+
* {@link isStrategyCollateral}.
|
|
245
211
|
*/
|
|
246
|
-
|
|
212
|
+
isStrategyCollateral(token: Address, requireQuota?: boolean): boolean;
|
|
247
213
|
/**
|
|
248
214
|
* Collateral token an existing credit account in this suite is a strategy
|
|
249
215
|
* in. Same as {@link StrategyPosition.targetCollateral}.
|
|
250
216
|
*
|
|
251
217
|
* Resolution, in order:
|
|
252
218
|
* 1. a hardcoded per-account override, when present;
|
|
253
|
-
* 2. {@link
|
|
219
|
+
* 2. the target of {@link strategy};
|
|
254
220
|
* 3. `null` when neither can be resolved.
|
|
255
221
|
*/
|
|
256
222
|
accountTargetCollateral(creditAccount: Address): Token | null;
|
|
@@ -262,15 +228,6 @@ declare class CreditSuite extends SDKConstruct {
|
|
|
262
228
|
* symbol when no target can be resolved.
|
|
263
229
|
*/
|
|
264
230
|
accountStrategyName(creditAccount: Address): string;
|
|
265
|
-
/**
|
|
266
|
-
* Describes this suite's leveraged strategy as the shared read model does,
|
|
267
|
-
* or `undefined` when credit suite does not offer a strategy opportunity.
|
|
268
|
-
*/
|
|
269
|
-
strategyOpportunity(): StrategyOpportunity | undefined;
|
|
270
|
-
/**
|
|
271
|
-
* {@link strategyOpportunity} plus the data only its detail screen needs.
|
|
272
|
-
*/
|
|
273
|
-
strategyOpportunityDetail(): StrategyOpportunityDetail | undefined;
|
|
274
231
|
/**
|
|
275
232
|
* Everything a partial liquidation of credit account needs, with any parameter the
|
|
276
233
|
* caller pinned down taken as given and the rest derived from current state.
|
|
@@ -287,16 +244,6 @@ declare class CreditSuite extends SDKConstruct {
|
|
|
287
244
|
* @param ca - Credit account to partially liquidate.
|
|
288
245
|
*/
|
|
289
246
|
optimalHFForPartialLiquidation(ca: CreditAccountData): bigint;
|
|
290
|
-
/**
|
|
291
|
-
* Tokens a user can transfer from their wallet when opening an account in
|
|
292
|
-
* this suite:
|
|
293
|
-
*
|
|
294
|
-
* 1. unwrapped underlying (USDC, never dcUSDC)
|
|
295
|
-
* 2. target collateral
|
|
296
|
-
* 3. remaining CM collaterals in manager order, excluding phantom tokens
|
|
297
|
-
* and tokens without price
|
|
298
|
-
*/
|
|
299
|
-
allowedDepositTokens(targetCollateral: Address): Token[];
|
|
300
247
|
/**
|
|
301
248
|
* Whether the facade, manager, or configurator has observed logs that require
|
|
302
249
|
* a credit-suite resync.
|