@gearbox-protocol/sdk 16.3.0-next.3 → 16.3.0-next.5
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/model/errors/operation-errors.js +1 -1
- package/dist/cjs/model/index.js +2 -2
- package/dist/cjs/model/rwa.js +4 -4
- package/dist/cjs/model/rwa.schema.js +4 -4
- package/dist/cjs/offchain/opportunities/OffchainOpportunities.js +1 -1
- package/dist/cjs/onchain/accounts/CreditAccountsServiceV310.js +1 -3
- package/dist/cjs/onchain/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/cjs/onchain/index.js +4 -4
- package/dist/cjs/onchain/market/credit/CreditSuite.js +19 -9
- package/dist/cjs/onchain/market/rwa/midas/MidasDegenNFT.js +45 -5
- package/dist/cjs/onchain/market/rwa/securitize/SecuritizeDegenNFT.js +56 -12
- package/dist/cjs/onchain/market/rwa/securitize/SecuritizeRWAFactory.js +0 -37
- package/dist/cjs/onchain/opportunities/MultichainOpportunitiesService.js +8 -2
- package/dist/cjs/onchain/opportunities/OpportunitiesService.js +16 -4
- package/dist/cjs/onchain/preview/parse/parseRWAFactoryOperationCalldata.js +2 -2
- package/dist/cjs/onchain/validation/bundles/checkCreditOperation.js +8 -7
- package/dist/cjs/onchain/validation/bundles/{checkDraw.js → checkIncreaseDebt.js} +10 -10
- package/dist/cjs/onchain/validation/bundles/{checkQuotasAsked.js → checkIncreaseQuota.js} +3 -3
- package/dist/cjs/onchain/validation/bundles/checkRWAOpenRequirements.js +9 -9
- package/dist/cjs/onchain/validation/bundles/checkRWAOpening.js +6 -5
- package/dist/cjs/onchain/validation/bundles/index.js +4 -4
- package/dist/cjs/onchain/validation/checks/checkBorrowLimit.js +1 -1
- package/dist/cjs/onchain/validation/checks/checkPoolLiquidity.js +1 -1
- package/dist/cjs/onchain/validation/index.js +4 -4
- package/dist/cjs/sdk/execute/ExecuteApi.js +2 -2
- package/dist/cjs/sdk/opportunities/OpportunitiesNamespace.js +9 -3
- package/dist/esm/model/errors/operation-errors.js +1 -1
- package/dist/esm/model/index.js +3 -3
- package/dist/esm/model/rwa.js +4 -4
- package/dist/esm/model/rwa.schema.js +5 -5
- package/dist/esm/offchain/opportunities/OffchainOpportunities.js +1 -1
- package/dist/esm/onchain/accounts/CreditAccountsServiceV310.js +1 -3
- package/dist/esm/onchain/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/esm/onchain/index.js +3 -3
- package/dist/esm/onchain/market/credit/CreditSuite.js +19 -9
- package/dist/esm/onchain/market/rwa/midas/MidasDegenNFT.js +45 -5
- package/dist/esm/onchain/market/rwa/securitize/SecuritizeDegenNFT.js +55 -10
- package/dist/esm/onchain/market/rwa/securitize/SecuritizeRWAFactory.js +0 -37
- package/dist/esm/onchain/opportunities/MultichainOpportunitiesService.js +8 -2
- package/dist/esm/onchain/opportunities/OpportunitiesService.js +16 -4
- package/dist/esm/onchain/preview/parse/parseRWAFactoryOperationCalldata.js +2 -2
- package/dist/esm/onchain/validation/bundles/checkCreditOperation.js +8 -7
- package/dist/esm/onchain/validation/bundles/checkIncreaseDebt.js +27 -0
- package/dist/esm/onchain/validation/bundles/{checkQuotasAsked.js → checkIncreaseQuota.js} +3 -3
- package/dist/esm/onchain/validation/bundles/checkRWAOpenRequirements.js +9 -9
- package/dist/esm/onchain/validation/bundles/checkRWAOpening.js +6 -5
- package/dist/esm/onchain/validation/bundles/index.js +3 -3
- package/dist/esm/onchain/validation/checks/checkBorrowLimit.js +1 -1
- package/dist/esm/onchain/validation/checks/checkPoolLiquidity.js +1 -1
- package/dist/esm/onchain/validation/index.js +3 -3
- package/dist/esm/sdk/execute/ExecuteApi.js +2 -2
- package/dist/esm/sdk/opportunities/OpportunitiesNamespace.js +9 -3
- package/dist/types/model/errors/operation-errors.d.ts +8 -6
- package/dist/types/model/index.d.ts +3 -3
- package/dist/types/model/opportunities.d.ts +6 -7
- package/dist/types/model/rwa.d.ts +47 -27
- package/dist/types/model/rwa.schema.d.ts +3 -3
- package/dist/types/offchain/opportunities/OffchainOpportunities.d.ts +1 -2
- package/dist/types/offchain/opportunities/types.d.ts +1 -4
- package/dist/types/onchain/accounts/types.d.ts +4 -2
- package/dist/types/onchain/index.d.ts +4 -4
- package/dist/types/onchain/market/credit/CreditSuite.d.ts +8 -3
- package/dist/types/onchain/market/index.d.ts +2 -2
- package/dist/types/onchain/market/pool/types.d.ts +1 -1
- package/dist/types/onchain/market/rwa/index.d.ts +2 -2
- package/dist/types/onchain/market/rwa/midas/MidasDegenNFT.d.ts +19 -4
- package/dist/types/onchain/market/rwa/securitize/SecuritizeDegenNFT.d.ts +24 -4
- package/dist/types/onchain/market/rwa/securitize/SecuritizeRWAFactory.d.ts +2 -14
- package/dist/types/onchain/market/rwa/types.d.ts +39 -37
- package/dist/types/onchain/opportunities/MultichainOpportunitiesService.d.ts +5 -1
- package/dist/types/onchain/opportunities/OpportunitiesService.d.ts +10 -3
- package/dist/types/onchain/opportunities/types.d.ts +6 -1
- package/dist/types/onchain/validation/bundles/checkCreditOperation.d.ts +3 -2
- package/dist/types/onchain/validation/bundles/{checkDraw.d.ts → checkIncreaseDebt.d.ts} +7 -7
- package/dist/types/onchain/validation/bundles/{checkQuotasAsked.d.ts → checkIncreaseQuota.d.ts} +3 -3
- package/dist/types/onchain/validation/bundles/checkRWAOpenRequirements.d.ts +2 -2
- package/dist/types/onchain/validation/bundles/checkRWAOpening.d.ts +3 -3
- package/dist/types/onchain/validation/bundles/index.d.ts +3 -3
- package/dist/types/onchain/validation/checks/checkBorrowLimit.d.ts +1 -1
- package/dist/types/onchain/validation/checks/checkPoolLiquidity.d.ts +1 -1
- package/dist/types/onchain/validation/index.d.ts +3 -3
- package/dist/types/sdk/opportunities/OpportunitiesNamespace.d.ts +5 -1
- package/dist/types/sdk/opportunities/types.d.ts +9 -3
- package/package.json +1 -1
- package/dist/esm/onchain/validation/bundles/checkDraw.js +0 -27
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AddressMap } from "../../../utils/AddressMap.js";
|
|
2
|
-
import { AddressSet } from "../../../utils/AddressSet.js";
|
|
3
2
|
import "../../../utils/index.js";
|
|
4
3
|
import { BaseContract } from "../../../base/BaseContract.js";
|
|
5
4
|
import "../../../base/index.js";
|
|
@@ -11,7 +10,6 @@ import { decodeAbiParameters } from "viem";
|
|
|
11
10
|
//#region src/onchain/market/rwa/securitize/SecuritizeRWAFactory.ts
|
|
12
11
|
const abi = iSecuritizeRWAFactoryAbi;
|
|
13
12
|
var SecuritizeRWAFactory = class extends BaseContract {
|
|
14
|
-
#sdk;
|
|
15
13
|
#investorCache = new AddressMap();
|
|
16
14
|
degenNFT;
|
|
17
15
|
owner;
|
|
@@ -23,7 +21,6 @@ var SecuritizeRWAFactory = class extends BaseContract {
|
|
|
23
21
|
name: "SecuritizeRWAFactory",
|
|
24
22
|
abi
|
|
25
23
|
});
|
|
26
|
-
this.#sdk = sdk;
|
|
27
24
|
const decoded = decodeAbiParameters([
|
|
28
25
|
{
|
|
29
26
|
name: "owner",
|
|
@@ -184,40 +181,6 @@ var SecuritizeRWAFactory = class extends BaseContract {
|
|
|
184
181
|
});
|
|
185
182
|
}
|
|
186
183
|
/**
|
|
187
|
-
* {@inheritDoc IRWAFactory.getOpenAccountRequirements}
|
|
188
|
-
*/
|
|
189
|
-
async getOpenAccountRequirements(investor, props) {
|
|
190
|
-
const [investorData] = await this.#sdk.rwa.getInvestorData(investor, [this.address]);
|
|
191
|
-
const tokensToRegister = new AddressSet([props.tokenOutAddress]);
|
|
192
|
-
const registredTokens = new AddressSet(investorData.registeredTokens);
|
|
193
|
-
const signedTokens = new AddressSet(investorData.cachedSignatures.map((s) => s.token));
|
|
194
|
-
const unsignedTokens = tokensToRegister.difference(signedTokens);
|
|
195
|
-
const securitizeTokensToRegister = tokensToRegister.difference(registredTokens);
|
|
196
|
-
const requiredSignatures = investorData.registerVaultMessages.filter((m) => unsignedTokens.has(m.message.token));
|
|
197
|
-
return {
|
|
198
|
-
type: RWA_FACTORY_SECURITIZE,
|
|
199
|
-
securitizeTokensToRegister: Array.from(securitizeTokensToRegister),
|
|
200
|
-
tokensToRegister: Array.from(tokensToRegister),
|
|
201
|
-
requiredSignatures
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* {@inheritDoc IRWAFactory.getMissingRequirements}
|
|
206
|
-
*
|
|
207
|
-
* A required signature is omitted when `providedArgs.signaturesToCache`
|
|
208
|
-
* already carries a signature for the same token: the transaction caches it
|
|
209
|
-
* on-chain as part of the operation.
|
|
210
|
-
*/
|
|
211
|
-
getMissingRequirements(requirements, providedArgs) {
|
|
212
|
-
const providedTokens = new AddressSet((providedArgs?.signaturesToCache ?? []).map((s) => s.token));
|
|
213
|
-
const requiredSignatures = requirements.requiredSignatures.filter((message) => !providedTokens.has(message.message.token));
|
|
214
|
-
if (requiredSignatures.length === 0) return;
|
|
215
|
-
return {
|
|
216
|
-
type: RWA_FACTORY_SECURITIZE,
|
|
217
|
-
requiredSignatures
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
184
|
* {@inheritDoc IRWAFactory.openCreditAccount}
|
|
222
185
|
*/
|
|
223
186
|
openCreditAccount(creditManager, calls, args) {
|
|
@@ -37,12 +37,18 @@ var MultichainOpportunitiesService = class extends MultichainConstruct {
|
|
|
37
37
|
*
|
|
38
38
|
* See {@link MultichainOpportunitiesService.getPool}.
|
|
39
39
|
**/
|
|
40
|
-
async getStrategy(key
|
|
40
|
+
async getStrategy(key) {
|
|
41
41
|
return this.queryChain({
|
|
42
42
|
network: key.chainId,
|
|
43
|
-
run: (sdk) => sdk.opportunities.getStrategy(key
|
|
43
|
+
run: (sdk) => sdk.opportunities.getStrategy(key)
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* {@inheritDoc OpportunitiesService.isEligibleForStrategy}
|
|
48
|
+
**/
|
|
49
|
+
async isEligibleForStrategy(key, wallet) {
|
|
50
|
+
return this.sdk.chain(key.chainId).opportunities.isEligibleForStrategy(key, wallet);
|
|
51
|
+
}
|
|
46
52
|
};
|
|
47
53
|
//#endregion
|
|
48
54
|
export { MultichainOpportunitiesService };
|
|
@@ -36,22 +36,34 @@ var OpportunitiesService = class extends SDKConstruct {
|
|
|
36
36
|
* A single strategy opportunity plus the rate curve of the pool it borrows
|
|
37
37
|
* from and the price feeds its liquidation price depends on.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
* with the strategy's KYC provider first; `null` otherwise.
|
|
39
|
+
* `kyc` is the strategy's KYC gate, independent of any wallet.
|
|
41
40
|
*
|
|
42
41
|
* @throws If the credit manager is unknown, or does not currently offer a
|
|
43
42
|
* strategy.
|
|
44
43
|
**/
|
|
45
|
-
async getStrategy(key
|
|
44
|
+
async getStrategy(key) {
|
|
46
45
|
const suite = this.sdk.marketRegister.findCreditManager(key.creditManager);
|
|
47
46
|
const detail = suite.strategyOpportunityDetail();
|
|
48
47
|
if (!detail) throw new Error(`credit manager ${key.creditManager} does not currently offer a strategy`);
|
|
49
|
-
const kyc =
|
|
48
|
+
const kyc = await suite.kycRequirement(detail.targetCollateral.address);
|
|
50
49
|
return {
|
|
51
50
|
...detail,
|
|
52
51
|
kyc
|
|
53
52
|
};
|
|
54
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Whether `wallet` may open this strategy today: `true` when it is not
|
|
56
|
+
* KYC-gated or the wallet already passed the gate.
|
|
57
|
+
*
|
|
58
|
+
* @throws If the credit manager is unknown, or does not currently offer a
|
|
59
|
+
* strategy.
|
|
60
|
+
**/
|
|
61
|
+
async isEligibleForStrategy(key, wallet) {
|
|
62
|
+
const suite = this.sdk.marketRegister.findCreditManager(key.creditManager);
|
|
63
|
+
const opportunity = suite.strategyOpportunity();
|
|
64
|
+
if (!opportunity) throw new Error(`credit manager ${key.creditManager} does not currently offer a strategy`);
|
|
65
|
+
return suite.isEligibleForStrategy(wallet, opportunity.targetCollateral.address);
|
|
66
|
+
}
|
|
55
67
|
};
|
|
56
68
|
//#endregion
|
|
57
69
|
export { OpportunitiesService };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hexEq } from "../../utils/hex.js";
|
|
2
2
|
import { AbstractAdapterContract } from "../../market/adapters/contracts/AbstractAdapter.js";
|
|
3
3
|
import { CreditFacadeV310Contract } from "../../market/credit/CreditFacadeV310Contract.js";
|
|
4
|
-
import
|
|
4
|
+
import "../../../model/rwa.js";
|
|
5
5
|
import "../../../model/index.js";
|
|
6
6
|
import { isRWAFactory } from "../../market/rwa/types.js";
|
|
7
7
|
import { classifyInnerOperations } from "./classifyInnerOperations.js";
|
|
@@ -32,7 +32,7 @@ function parseSecuritizeOperationCalldata(sdk, factory, calldata) {
|
|
|
32
32
|
const { rawArgs } = parsed;
|
|
33
33
|
const innerCalls = rawArgs.calls ?? [];
|
|
34
34
|
const args = {
|
|
35
|
-
|
|
35
|
+
protocol: "securitize",
|
|
36
36
|
tokensToRegister: [...rawArgs.tokensToRegister ?? []],
|
|
37
37
|
signaturesToCache: [...rawArgs.signaturesToCache ?? []]
|
|
38
38
|
};
|
|
@@ -4,11 +4,11 @@ import { checkDebtLimits } from "../checks/checkDebtLimits.js";
|
|
|
4
4
|
import "../checks/index.js";
|
|
5
5
|
import { checkAccountQuotas } from "./checkAccountQuotas.js";
|
|
6
6
|
import { checkCollateralFunding } from "./checkCollateralFunding.js";
|
|
7
|
-
import { checkDraw } from "./checkDraw.js";
|
|
8
7
|
import { checkHealthFactors } from "./checkHealthFactors.js";
|
|
8
|
+
import { checkIncreaseDebt } from "./checkIncreaseDebt.js";
|
|
9
|
+
import { checkIncreaseQuota } from "./checkIncreaseQuota.js";
|
|
9
10
|
import { checkMarket } from "./checkMarket.js";
|
|
10
11
|
import { checkObtained } from "./checkObtained.js";
|
|
11
|
-
import { checkQuotasAsked } from "./checkQuotasAsked.js";
|
|
12
12
|
import { checkRWAOpening } from "./checkRWAOpening.js";
|
|
13
13
|
//#region src/onchain/validation/bundles/checkCreditOperation.ts
|
|
14
14
|
/**
|
|
@@ -16,8 +16,9 @@ import { checkRWAOpening } from "./checkRWAOpening.js";
|
|
|
16
16
|
* has to hold, approve or sign.
|
|
17
17
|
*
|
|
18
18
|
* The array is in check order, most fundamental first: the market's own state,
|
|
19
|
-
* then what the facade would revert on, then what the operation
|
|
20
|
-
*
|
|
19
|
+
* then what the facade would revert on, then what the operation borrows and the
|
|
20
|
+
* quota it increases, then the account it leaves behind, and last the wallet's
|
|
21
|
+
* side.
|
|
21
22
|
*/
|
|
22
23
|
async function checkCreditOperation(args) {
|
|
23
24
|
const { sdk, preview, sender, blockNumber, ...thresholds } = args;
|
|
@@ -35,10 +36,10 @@ async function checkCreditOperation(args) {
|
|
|
35
36
|
allowZero: !isOpening,
|
|
36
37
|
maxBorrowAmount: suite.maxBorrowAmount()
|
|
37
38
|
}),
|
|
38
|
-
...
|
|
39
|
+
...checkIncreaseDebt(suite, preview, underlying),
|
|
39
40
|
...checkObtained(suite, preview),
|
|
40
41
|
...checkAccountQuotas(suite, preview),
|
|
41
|
-
...
|
|
42
|
+
...checkIncreaseQuota(market, preview, underlying),
|
|
42
43
|
...checkHealthFactors({
|
|
43
44
|
totalDebt: preview.totalDebt,
|
|
44
45
|
healthFactor: preview.estHealthFactor,
|
|
@@ -50,7 +51,7 @@ async function checkCreditOperation(args) {
|
|
|
50
51
|
preview,
|
|
51
52
|
sender,
|
|
52
53
|
blockNumber
|
|
53
|
-
}), preview.operation === "RWAOpenCreditAccount" ? checkRWAOpening({
|
|
54
|
+
}), preview.operation === "OpenCreditAccount" || preview.operation === "RWAOpenCreditAccount" ? checkRWAOpening({
|
|
54
55
|
sdk,
|
|
55
56
|
preview,
|
|
56
57
|
sender
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { checkBorrowLimit } from "../checks/checkBorrowLimit.js";
|
|
2
|
+
import "../checks/index.js";
|
|
3
|
+
//#region src/onchain/validation/bundles/checkIncreaseDebt.ts
|
|
4
|
+
/**
|
|
5
|
+
* What the transaction borrows, against what the market can lend right now.
|
|
6
|
+
*
|
|
7
|
+
* Only a debt increase is weighed: repaying, or leaving the debt alone, can
|
|
8
|
+
* never exceed the borrow limit. Opening borrows the whole debt; adjusting
|
|
9
|
+
* borrows `totalDebtChange`.
|
|
10
|
+
*
|
|
11
|
+
* The engine holds every simulation to this already (`assertCanBorrow`), so
|
|
12
|
+
* this is here for the transactions it never saw — a pasted calldata reaches
|
|
13
|
+
* the confirm screen with nothing else standing between it and a revert.
|
|
14
|
+
*/
|
|
15
|
+
function checkIncreaseDebt(suite, preview, underlying) {
|
|
16
|
+
const debtIncrease = preview.operation === "AdjustCreditAccount" ? preview.totalDebtChange.value : preview.totalDebt.value;
|
|
17
|
+
if (debtIncrease <= 0n) return [];
|
|
18
|
+
const maxBorrowAmount = suite.maxBorrowAmount();
|
|
19
|
+
return checkBorrowLimit({
|
|
20
|
+
requested: debtIncrease,
|
|
21
|
+
available: maxBorrowAmount.amount.value,
|
|
22
|
+
limit: maxBorrowAmount.limit,
|
|
23
|
+
underlying
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { checkIncreaseDebt };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { checkQuotaLimit } from "../checks/checkQuotaLimit.js";
|
|
2
2
|
import "../checks/index.js";
|
|
3
|
-
//#region src/onchain/validation/bundles/
|
|
3
|
+
//#region src/onchain/validation/bundles/checkIncreaseQuota.ts
|
|
4
4
|
/** Every quota the operation raises, against the room the keeper has left. */
|
|
5
|
-
function
|
|
5
|
+
function checkIncreaseQuota(market, preview, underlying) {
|
|
6
6
|
const increases = preview.operation === "AdjustCreditAccount" ? preview.quotasChange : preview.quotas;
|
|
7
7
|
const { pqk } = market.pool;
|
|
8
8
|
return increases.filter((q) => q.value > 0n).flatMap((q) => {
|
|
@@ -16,4 +16,4 @@ function checkQuotasAsked(market, preview, underlying) {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
|
-
export {
|
|
19
|
+
export { checkIncreaseQuota };
|
|
@@ -5,24 +5,24 @@ import { toToken } from "../helpers/token.js";
|
|
|
5
5
|
import "../helpers/index.js";
|
|
6
6
|
//#region src/onchain/validation/bundles/checkRWAOpenRequirements.ts
|
|
7
7
|
/**
|
|
8
|
-
* The
|
|
8
|
+
* The degen NFT is satisfied that `wallet` may open on `token` with the
|
|
9
9
|
* registration args already on the transaction.
|
|
10
10
|
*/
|
|
11
11
|
async function checkRWAOpenRequirements(input) {
|
|
12
12
|
const { sdk, wallet, creditManager, token, providedArgs } = input;
|
|
13
13
|
try {
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (!missing && requirements.securitizeTokensToRegister.length === 0) return [];
|
|
14
|
+
const nft = await sdk.marketRegister.findCreditManager(creditManager).degenNFT();
|
|
15
|
+
if (!nft) return [];
|
|
16
|
+
const requirements = await nft.getOpenAccountRequirements(wallet, { tokenOutAddress: token });
|
|
17
|
+
const missing = nft.getMissingRequirements(requirements, providedArgs);
|
|
18
|
+
if (!missing && nft.isRegistered(requirements)) return [];
|
|
20
19
|
return [rwaOpenRequirementsNotMet({
|
|
21
20
|
token: toToken(sdk, token),
|
|
22
21
|
creditManager,
|
|
23
|
-
|
|
22
|
+
protocol: nft.protocol,
|
|
23
|
+
registrationLink: nft.registrationLink,
|
|
24
24
|
requirements,
|
|
25
|
-
|
|
25
|
+
missing
|
|
26
26
|
})];
|
|
27
27
|
} catch (cause) {
|
|
28
28
|
return [unexpectedFailure(cause, "read the RWA opening requirements")];
|
|
@@ -2,21 +2,22 @@ import { AddressSet } from "../../utils/AddressSet.js";
|
|
|
2
2
|
import { checkRWAOpenRequirements } from "./checkRWAOpenRequirements.js";
|
|
3
3
|
//#region src/onchain/validation/bundles/checkRWAOpening.ts
|
|
4
4
|
/**
|
|
5
|
-
* Per
|
|
5
|
+
* Per KYC-gated token among `collateralAdded ∪ quotas`, whether the
|
|
6
6
|
* borrower still has to register or sign before this opening can land.
|
|
7
7
|
*/
|
|
8
8
|
async function checkRWAOpening(input) {
|
|
9
9
|
const { sdk, preview, sender } = input;
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
12
|
-
const gated = new AddressSet(
|
|
10
|
+
const nft = await sdk.marketRegister.findCreditManager(preview.creditManager).degenNFT();
|
|
11
|
+
if (!nft) return [];
|
|
12
|
+
const gated = new AddressSet(await nft.getTokens());
|
|
13
13
|
const candidates = new AddressSet([...preview.collateralAdded.map((a) => a.token.address), ...preview.quotas.map((q) => q.token.address)]);
|
|
14
|
+
const providedArgs = preview.operation === "RWAOpenCreditAccount" ? preview.rwaArgs : void 0;
|
|
14
15
|
return (await Promise.all([...candidates].filter((token) => gated.has(token)).map((token) => checkRWAOpenRequirements({
|
|
15
16
|
sdk,
|
|
16
17
|
wallet: sender,
|
|
17
18
|
creditManager: preview.creditManager,
|
|
18
19
|
token,
|
|
19
|
-
providedArgs
|
|
20
|
+
providedArgs
|
|
20
21
|
})))).flat();
|
|
21
22
|
}
|
|
22
23
|
//#endregion
|
|
@@ -2,11 +2,11 @@ import { checkAccountQuotas } from "./checkAccountQuotas.js";
|
|
|
2
2
|
import { checkWalletAllowance } from "./checkWalletAllowance.js";
|
|
3
3
|
import { checkWalletBalance } from "./checkWalletBalance.js";
|
|
4
4
|
import { checkCollateralFunding } from "./checkCollateralFunding.js";
|
|
5
|
-
import { checkDraw } from "./checkDraw.js";
|
|
6
5
|
import { checkHealthFactors } from "./checkHealthFactors.js";
|
|
6
|
+
import { checkIncreaseDebt } from "./checkIncreaseDebt.js";
|
|
7
|
+
import { checkIncreaseQuota } from "./checkIncreaseQuota.js";
|
|
7
8
|
import { checkMarket } from "./checkMarket.js";
|
|
8
9
|
import { checkObtained } from "./checkObtained.js";
|
|
9
|
-
import { checkQuotasAsked } from "./checkQuotasAsked.js";
|
|
10
10
|
import { checkRWAOpenRequirements } from "./checkRWAOpenRequirements.js";
|
|
11
11
|
import { checkRWAOpening } from "./checkRWAOpening.js";
|
|
12
12
|
import { checkCreditOperation } from "./checkCreditOperation.js";
|
|
@@ -15,4 +15,4 @@ import { checkLiquidationFunding } from "./checkLiquidationFunding.js";
|
|
|
15
15
|
import { checkWallet } from "./checkWallet.js";
|
|
16
16
|
import { checkPoolFunding } from "./checkPoolFunding.js";
|
|
17
17
|
import { checkPoolOperation } from "./checkPoolOperation.js";
|
|
18
|
-
export { checkAccountQuotas, checkCollateralFunding, checkCreditOperation,
|
|
18
|
+
export { checkAccountQuotas, checkCollateralFunding, checkCreditOperation, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLiquidationEligibility, checkLiquidationFunding, checkMarket, checkObtained, checkPoolFunding, checkPoolOperation, checkRWAOpenRequirements, checkRWAOpening, checkWallet, checkWalletAllowance, checkWalletBalance };
|
|
@@ -4,7 +4,7 @@ import { amountOf } from "../helpers/amount.js";
|
|
|
4
4
|
import "../helpers/index.js";
|
|
5
5
|
//#region src/onchain/validation/checks/checkBorrowLimit.ts
|
|
6
6
|
/**
|
|
7
|
-
* What the pool will hand over, against
|
|
7
|
+
* What the pool will hand over, against the amount requested.
|
|
8
8
|
*
|
|
9
9
|
* `available` and `limit` are the caller's reading of which limit is in the
|
|
10
10
|
* way; this check only compares. `maxBorrowAmount` is the largest debt still
|
|
@@ -7,7 +7,7 @@ import "../helpers/index.js";
|
|
|
7
7
|
* What the pool holds, against what is being taken out of it.
|
|
8
8
|
*
|
|
9
9
|
* The operator is not `checkBorrowLimit`'s: a pool holding exactly the amount
|
|
10
|
-
*
|
|
10
|
+
* requested still cannot serve it, so equality is already a refusal. That is
|
|
11
11
|
* the rule the legacy withdrawal validator enforced and it is preserved to the
|
|
12
12
|
* unit.
|
|
13
13
|
*/
|
|
@@ -22,11 +22,11 @@ import { checkAccountQuotas } from "./bundles/checkAccountQuotas.js";
|
|
|
22
22
|
import { checkWalletAllowance } from "./bundles/checkWalletAllowance.js";
|
|
23
23
|
import { checkWalletBalance } from "./bundles/checkWalletBalance.js";
|
|
24
24
|
import { checkCollateralFunding } from "./bundles/checkCollateralFunding.js";
|
|
25
|
-
import { checkDraw } from "./bundles/checkDraw.js";
|
|
26
25
|
import { checkHealthFactors } from "./bundles/checkHealthFactors.js";
|
|
26
|
+
import { checkIncreaseDebt } from "./bundles/checkIncreaseDebt.js";
|
|
27
|
+
import { checkIncreaseQuota } from "./bundles/checkIncreaseQuota.js";
|
|
27
28
|
import { checkMarket } from "./bundles/checkMarket.js";
|
|
28
29
|
import { checkObtained } from "./bundles/checkObtained.js";
|
|
29
|
-
import { checkQuotasAsked } from "./bundles/checkQuotasAsked.js";
|
|
30
30
|
import { checkRWAOpenRequirements } from "./bundles/checkRWAOpenRequirements.js";
|
|
31
31
|
import { checkRWAOpening } from "./bundles/checkRWAOpening.js";
|
|
32
32
|
import { checkCreditOperation } from "./bundles/checkCreditOperation.js";
|
|
@@ -40,4 +40,4 @@ import { checkLiquidation } from "./checkLiquidation.js";
|
|
|
40
40
|
import { checkOperation } from "./checkOperation.js";
|
|
41
41
|
import { checkSimulation } from "./checkSimulation.js";
|
|
42
42
|
import { raise } from "./raise.js";
|
|
43
|
-
export { MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_SAFE_HEALTH_FACTOR_FORM, amountOf, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits,
|
|
43
|
+
export { MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_SAFE_HEALTH_FACTOR_FORM, amountOf, checkAccountQuotas, checkBorrowLimit, checkCollateralFunding, checkCollateralised, checkCreditAccountFrozen, checkCreditManagerPaused, checkCreditOperation, checkDebtLimits, checkEmergencyLiquidator, checkForbiddenToken, checkHealthFactors, checkIncreaseDebt, checkIncreaseQuota, checkLeverage, checkLiquidation, checkLiquidationEligibility, checkLiquidationFunding, checkLiquidatorEligible, checkMarket, checkMarketExpired, checkObtained, checkOperation, checkPoolFunding, checkPoolLiquidity, checkPoolOperation, checkPoolPaused, checkPoolSunset, checkQuotaCount, checkQuotaLimit, checkRWAOpenRequirements, checkRWAOpening, checkSimulation, checkWallet, checkWalletAllowance, checkWalletBalance, raise, toToken, toTokenAmount };
|
|
@@ -73,9 +73,9 @@ async function openTx(sdk, request) {
|
|
|
73
73
|
async function openRwaOptions(sdk, request) {
|
|
74
74
|
if (!request.targetToken) return;
|
|
75
75
|
const requirements = await sdk.accounts.getOpenAccountRequirements(request.wallet, request.creditManager, { tokenOutAddress: request.targetToken });
|
|
76
|
-
if (
|
|
76
|
+
if (requirements?.protocol !== "securitize") return;
|
|
77
77
|
return {
|
|
78
|
-
|
|
78
|
+
protocol: "securitize",
|
|
79
79
|
tokensToRegister: requirements.tokensToRegister,
|
|
80
80
|
signaturesToCache: request.signaturesToCache ?? []
|
|
81
81
|
};
|
|
@@ -70,15 +70,21 @@ var OpportunitiesNamespace = class extends AbstractNamespace {
|
|
|
70
70
|
/**
|
|
71
71
|
* {@inheritDoc IOpportunitiesBase.getStrategy}
|
|
72
72
|
**/
|
|
73
|
-
async getStrategy(key
|
|
73
|
+
async getStrategy(key) {
|
|
74
74
|
return this.merged("get strategy opportunity", {
|
|
75
75
|
chainIds: [key.chainId],
|
|
76
|
-
fromChain: (source) => source.getStrategy(key
|
|
77
|
-
fromBackend: (source) => source.getStrategy(key
|
|
76
|
+
fromChain: (source) => source.getStrategy(key),
|
|
77
|
+
fromBackend: (source) => source.getStrategy(key),
|
|
78
78
|
merge: this.merge.strategy
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
+
* {@inheritDoc IOpportunitiesOnchainOnly.isEligibleForStrategy}
|
|
83
|
+
**/
|
|
84
|
+
async isEligibleForStrategy(key, wallet) {
|
|
85
|
+
return this.onchain.isEligibleForStrategy(key, wallet);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
82
88
|
* {@inheritDoc IOpportunitiesBase.filter}
|
|
83
89
|
**/
|
|
84
90
|
filter(response, filter) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Bps, Token, TokenAmount } from "../primitives.js";
|
|
2
2
|
import { IGearboxError } from "./base.js";
|
|
3
|
-
import { RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements } from "../rwa.js";
|
|
3
|
+
import { RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAProtocol } from "../rwa.js";
|
|
4
4
|
import { MaxBorrowAmount } from "../../onchain/market/credit/types.js";
|
|
5
5
|
import "../../onchain/index.js";
|
|
6
6
|
import { Address } from "viem";
|
|
@@ -55,7 +55,7 @@ interface PoolSunsetError extends IGearboxError {
|
|
|
55
55
|
/** {@inheritDoc PoolSunsetError} */
|
|
56
56
|
declare function poolSunset(pool: Address): PoolSunsetError;
|
|
57
57
|
/**
|
|
58
|
-
* The pool cannot lend what the operation
|
|
58
|
+
* The pool cannot lend what the operation wants to borrow.
|
|
59
59
|
**/
|
|
60
60
|
interface InsufficientPoolLiquidityError extends IGearboxError {
|
|
61
61
|
code: "insufficientPoolLiquidity";
|
|
@@ -140,7 +140,7 @@ declare function forbiddenToken(token: Token): ForbiddenTokenError;
|
|
|
140
140
|
**/
|
|
141
141
|
interface QuotaLimitReachedError extends IGearboxError {
|
|
142
142
|
code: "quotaLimitReached";
|
|
143
|
-
/** The token whose quota is
|
|
143
|
+
/** The token whose quota is increased. */
|
|
144
144
|
token: Token;
|
|
145
145
|
/**
|
|
146
146
|
* In the **underlying**, which is what a quota is measured in. Absent for a
|
|
@@ -201,17 +201,19 @@ interface InsufficientAllowanceError extends IGearboxError {
|
|
|
201
201
|
/** {@inheritDoc InsufficientAllowanceError} */
|
|
202
202
|
declare function insufficientAllowance(args: Omit<InsufficientAllowanceError, "code" | "message">): InsufficientAllowanceError;
|
|
203
203
|
/**
|
|
204
|
-
* The RWA
|
|
204
|
+
* The RWA protocol still wants something from the borrower before this token
|
|
205
205
|
* can be opened on.
|
|
206
206
|
**/
|
|
207
207
|
interface RWAOpenRequirementsError extends IGearboxError {
|
|
208
208
|
code: "rwaOpenRequirementsNotMet";
|
|
209
209
|
token: Token;
|
|
210
210
|
creditManager: Address;
|
|
211
|
-
|
|
211
|
+
protocol: RWAProtocol;
|
|
212
|
+
/** Where the wallet completes registration with {@link protocol}. */
|
|
213
|
+
registrationLink: string;
|
|
212
214
|
/** Always present on the error. */
|
|
213
215
|
requirements: RWAOpenAccountRequirements;
|
|
214
|
-
/** Absent when only issuer-side registration is pending. */
|
|
216
|
+
/** Absent when only issuer-side registration is pending (or Midas greenlist). */
|
|
215
217
|
missing?: RWAMissingOpenAccountRequirements;
|
|
216
218
|
}
|
|
217
219
|
/** {@inheritDoc RWAOpenRequirementsError} */
|
|
@@ -5,7 +5,7 @@ import { Curator, CuratorName } from "./curators.js";
|
|
|
5
5
|
import { DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedWithdrawCollateralIntent } from "./delayed-intents.js";
|
|
6
6
|
import { IGearboxError } from "./errors/base.js";
|
|
7
7
|
import { CreditAccountFrozenError, LiquidatorNotEligibleError, NotEmergencyLiquidatorError, creditAccountFrozen, liquidatorNotEligible, notEmergencyLiquidator } from "./errors/liquidation-errors.js";
|
|
8
|
-
import {
|
|
8
|
+
import { KYC_REGISTRATION_LINKS, KycProtocol, KycRequirement, MidasOpenAccountRequirements, RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs, RWAProtocol, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_PROTOCOLS, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature } from "./rwa.js";
|
|
9
9
|
import { BorrowLimitCause, CreditManagerPausedError, DebtOutOfRangeError, ForbiddenTokenError, InsufficientAllowanceError, InsufficientBalanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, LeverageOutOfRangeError, MarketExpiredError, PoolPausedError, PoolSunsetError, QuotaCountExceededError, QuotaLimitReachedError, RWAOpenRequirementsError, creditManagerPaused, debtOutOfRange, forbiddenToken, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, leverageOutOfRange, marketExpired, poolPaused, poolSunset, quotaCountExceeded, quotaLimitReached, rwaOpenRequirementsNotMet } from "./errors/operation-errors.js";
|
|
10
10
|
import { UnpriceableTokenError, unpriceableTokenError } from "./errors/oracle-errors.js";
|
|
11
11
|
import { CreditAccountNotEmptyError, CreditAccountNotFoundError, MultipleDelayedWithdrawalsError, NoDelayedRouteError, NoRecordedIntentError, NoStrategyTargetCollateralError, UnexpectedFailureError, UnsupportedCollateralTokenError, UnsupportedTokenPairError, WithdrawalInProgressError, creditAccountNotEmpty, creditAccountNotFound, multipleDelayedWithdrawals, noDelayedRoute, noRecordedIntent, noStrategyTargetCollateral, unexpectedFailure, unsupportedCollateralToken, unsupportedTokenPair, withdrawalInProgress } from "./errors/prepare-errors.js";
|
|
@@ -30,7 +30,7 @@ import { amountSchema, assetTypeSchema, bpsSchema, chainIdSchema, leverageSchema
|
|
|
30
30
|
import { ChainFailed, ChainMetadata, ChainScoped, ChainSucceeded, DataResponse, DataSource, ResponseMetadata } from "./response.js";
|
|
31
31
|
import { chainFailedSchema, chainMetadataSchema, chainSucceededSchema, dataSourceSchema, responseMetadataSchema, responseSchema } from "./response.schema.js";
|
|
32
32
|
import { SDKError, SDKResult, SDKReturn, SafeValue, safeValue, sdkErr, sdkOk } from "./result.js";
|
|
33
|
-
import {
|
|
33
|
+
import { kycRequirementSchema, rwaProtocolSchema } from "./rwa.schema.js";
|
|
34
34
|
import { PositionClaimableWithdrawal, PositionPendingWithdrawal, PositionWithdrawals, WithdrawalOutputAmount } from "./withdrawals.js";
|
|
35
35
|
import { positionClaimableWithdrawalSchema, positionPendingWithdrawalSchema, positionWithdrawalsSchema, withdrawalOutputAmountSchema } from "./withdrawals.schema.js";
|
|
36
|
-
export { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, AccountHoldings, AccountMetrics, AccountProjection, AccountStateChange, AdjustStrategyPositionPreview, Amount, AnalyticsChartQuery, AnalyticsLiquidationPosition, AnalyticsPoolPosition, AnalyticsPosition, AnalyticsPositionListOptions, AnalyticsPositionOwner, AnalyticsPositionPage, AnalyticsPositionSortField, AnalyticsSortDirection, AnalyticsStrategyPosition, ApyBreakdown, Asset, AssetType, BorrowLimitCause, BorrowRateBreakdown, Bps, CHART_METRIC_UNITS, CHART_RANGES, CHART_UNAVAILABLE_CODES, ChainFailed, ChainId, ChainMetadata, ChainScoped, ChainScopedFilter, ChainSucceeded, ChartBundle, ChartDenomination, ChartMetric, ChartQuery, ChartRange, ChartSeries, ChartSeriesOk, ChartSeriesUnavailable, ChartUnavailableCode, ChartUnit, ChartValue, ChartWindow, CompareTag, CompareTolerance, CreditAccountFrozenError, CreditAccountNotEmptyError, CreditAccountNotFoundError, CreditManagerPausedError, CreditOperationMarket, Curator, CuratorName, DataResponse, DataSource, DebtOutOfRangeError, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedReceivedAsset, DelayedStrategyPositionOperationPreview, DelayedWithdrawCollateralIntent, Estimated, EstimatedProjection, ExitStrategyPositionPreview, FILTER_ALL, FilterAll, Filterable, ForbiddenTokenError, GridSampling, IGearboxError, InstantReceivedAsset, InstantStrategyPositionOperationPreview, InsufficientAllowanceError, InsufficientBalanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, InvalidDelayedIntentError,
|
|
36
|
+
export { ANALYTICS_POSITIONS_DEFAULT_LIMIT, ANALYTICS_POSITIONS_MAX_LIMIT, AccountHoldings, AccountMetrics, AccountProjection, AccountStateChange, AdjustStrategyPositionPreview, Amount, AnalyticsChartQuery, AnalyticsLiquidationPosition, AnalyticsPoolPosition, AnalyticsPosition, AnalyticsPositionListOptions, AnalyticsPositionOwner, AnalyticsPositionPage, AnalyticsPositionSortField, AnalyticsSortDirection, AnalyticsStrategyPosition, ApyBreakdown, Asset, AssetType, BorrowLimitCause, BorrowRateBreakdown, Bps, CHART_METRIC_UNITS, CHART_RANGES, CHART_UNAVAILABLE_CODES, ChainFailed, ChainId, ChainMetadata, ChainScoped, ChainScopedFilter, ChainSucceeded, ChartBundle, ChartDenomination, ChartMetric, ChartQuery, ChartRange, ChartSeries, ChartSeriesOk, ChartSeriesUnavailable, ChartUnavailableCode, ChartUnit, ChartValue, ChartWindow, CompareTag, CompareTolerance, CreditAccountFrozenError, CreditAccountNotEmptyError, CreditAccountNotFoundError, CreditManagerPausedError, CreditOperationMarket, Curator, CuratorName, DataResponse, DataSource, DebtOutOfRangeError, DelayedAddCollateralIntent, DelayedCloseAccountIntent, DelayedDecreaseLeverageIntent, DelayedDepositAndIncreaseLeverageIntent, DelayedDepositIntent, DelayedIncreaseLeverageIntent, DelayedIntent, DelayedReceivedAsset, DelayedStrategyPositionOperationPreview, DelayedWithdrawCollateralIntent, Estimated, EstimatedProjection, ExitStrategyPositionPreview, FILTER_ALL, FilterAll, Filterable, ForbiddenTokenError, GridSampling, IGearboxError, InstantReceivedAsset, InstantStrategyPositionOperationPreview, InsufficientAllowanceError, InsufficientBalanceError, InsufficientCollateralError, InsufficientPoolLiquidityError, InvalidDelayedIntentError, KYC_REGISTRATION_LINKS, KycProtocol, KycRequirement, Leverage, LeverageOutOfRangeError, LiquidatableAccount, LiquidatableAccountFilter, LiquidationApproval, LiquidationDetails, LiquidationPosition, LiquidatorNotEligibleError, MalformedTransactionError, MarketExpiredError, MidasOpenAccountRequirements, MultipleDelayedWithdrawalsError, NoDelayedRouteError, NoRecordedIntentError, NoStrategyTargetCollateralError, NotEmergencyLiquidatorError, Notice, NoticeKind, NoticeSubject, OpenNonRWAStrategyPositionPreview, OpenRWAStrategyPositionPreview, OpenStrategyPositionPreview, OperationPreview, Opportunity, OpportunityBase, OpportunityChartMetric, OpportunityDetail, OpportunityFilter, OpportunityId, OpportunityKey, OpportunityKind, OpportunityTotals, POOL_OPPORTUNITY_CHART_METRICS, POOL_POSITION_CHART_METRICS, PROTOCOL_CHART_METRICS, PnlBreakdown, PointRewards, PointsProgram, PointsProgramPnL, PointsRewardsPnL, PoolOperationPreviewError, PoolOperationType, PoolOpportunity, PoolOpportunityChartMetric, PoolOpportunityDetail, PoolOpportunityKey, PoolOpportunityRef, PoolPausedError, PoolPosition, PoolPositionChartMetric, PoolPositionKey, PoolPositionOperationPreview, PoolPositionRef, PoolSunsetError, Position, PositionChartMetric, PositionClaimableWithdrawal, PositionCollateral, PositionFilter, PositionId, PositionKey, PositionKind, PositionPendingWithdrawal, PositionTransaction, PositionTransactionKind, PositionWithdrawals, PositionsTotals, PreviewOperationInput, PreviewOperationOptions, PriceFeedData, PriceFeedSummary, ProtocolChartMetric, QuotaAsset, QuotaCountExceededError, QuotaLimitReachedError, RWAFactoryType, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOpenRequirementsError, RWAOperationArgs, RWAProtocol, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_PROTOCOLS, RateCurve, RateCurvePoint, ReceivedAsset, RepayStrategyPositionPreview, ResponseMetadata, Rewards, RewardsPnL, RoutedField, SDKError, SDKResult, SDKReturn, SECURITIZE_REGISTER_VAULT_TYPES, STRATEGY_OPPORTUNITY_CHART_METRICS, STRATEGY_POSITION_CHART_METRICS, STRATEGY_POSITION_COLLATERAL_ERROR, SafeValue, SecuritizeMissingOpenAccountRequirements, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, StrategyOpportunity, StrategyOpportunityChartMetric, StrategyOpportunityDetail, StrategyOpportunityKey, StrategyOpportunityRef, StrategyPosition, StrategyPositionChartMetric, StrategyPositionKey, StrategyPositionRef, Timestamp, Token, TokenAmount, TokenQuotaRate, TokenRewards, TokenRewardsPnL, ToleranceCompareTag, TxCall, UnderlyingToken, UnexpectedFailureError, UnpriceableTokenError, UnsupportedCollateralTokenError, UnsupportedOperationError, UnsupportedPoolFunctionError, UnsupportedTargetError, UnsupportedTokenPairError, UnsupportedZapperFunctionError, WithdrawalInProgressError, WithdrawalOutputAmount, amountSchema, analyticsChartQueryOptionsSchema, analyticsChartQueryParamsSchema, analyticsChartQuerySchema, analyticsPositionListOptionsSchema, analyticsPositionListQueryParamsSchema, analyticsPositionListQuerySchema, analyticsPositionPageSchema, analyticsPositionSchema, analyticsPositionSortFieldSchema, analyticsSortDirectionSchema, apyBreakdownSchema, asEstimated, assetTypeSchema, backendPreferred, booleanParamSchema, borrowRateBreakdownSchema, bpsSchema, chainFailedSchema, chainIdSchema, chainMetadataSchema, chainSucceededSchema, chartBundleSchemaFor, chartDenominationSchema, chartMetricSchema, chartQueryCodec, chartQueryParamsSchema, chartQuerySchema, chartRangeSchema, chartSeriesSchema, chartValueSchema, chartWindowSchema, compareTagOf, creditAccountFrozen, creditAccountNotEmpty, creditAccountNotFound, creditManagerPaused, curatorNameSchema, curatorSchema, dataSourceSchema, debtOutOfRange, delayedReceivedAssetSchema, encodeFlag, filterAllSchema, filterable, forbiddenToken, instantReceivedAssetSchema, insufficientAllowance, insufficientBalance, insufficientCollateral, insufficientPoolLiquidity, isFilterSet, kycRequirementSchema, leverageOutOfRange, leverageSchema, liquidatableAccountFilterSchema, liquidatableAccountSchema, liquidationApprovalSchema, liquidationDetailsSchema, liquidationPositionId, liquidationPositionSchema, liquidatorNotEligible, malformedTransaction, marketExpired, matchesLiquidatableAccountFilter, matchesOpportunityFilter, matchesPositionFilter, multipleDelayedWithdrawals, noDelayedRoute, noRecordedIntent, noStrategyTargetCollateral, notEmergencyLiquidator, noticeKindSchema, noticeSchema, offchainOnly, onchainOnly, opportunityBaseSchema, opportunityDetailSchema, opportunityFilterQueryParamsSchema, opportunityFilterQuerySchema, opportunityFilterSchema, opportunityId, opportunityKeySchema, opportunityKindSchema, opportunitySchema, opportunityTotalsSchema, pnlBreakdownSchema, pointRewardsSchema, pointsProgramPnLSchema, pointsProgramSchema, pointsRewardsPnLSchema, poolOpportunityChartMetricSchema, poolOpportunityDetailSchema, poolOpportunityId, poolOpportunityKeySchema, poolOpportunitySchema, poolPaused, poolPositionChartMetricSchema, poolPositionId, poolPositionKeySchema, poolPositionSchema, poolSunset, positionClaimableWithdrawalSchema, positionCollateralSchema, positionFilterQueryParamsSchema, positionFilterQuerySchema, positionFilterSchema, positionId, positionKeySchema, positionKindSchema, positionPendingWithdrawalSchema, positionSchema, positionTransactionKindSchema, positionTransactionSchema, positionWithdrawalsSchema, positionsTotalsSchema, priceFeedDataSchema, priceFeedSummarySchema, protocolChartMetricSchema, quotaAssetSchema, quotaCountExceeded, quotaLimitReached, rateCurvePointSchema, rateCurveSchema, receivedAssetSchema, responseMetadataSchema, responseSchema, rewardsPnLSchema, rewardsSchema, rwaOpenRequirementsNotMet, rwaProtocolSchema, safeValue, sdkErr, sdkOk, strategyOpportunityChartMetricSchema, strategyOpportunityDetailSchema, strategyOpportunityId, strategyOpportunityKeySchema, strategyOpportunitySchema, strategyPositionChartMetricSchema, strategyPositionId, strategyPositionKeySchema, strategyPositionSchema, timestampSchema, tokenAmountSchema, tokenQuotaRateSchema, tokenRewardsPnLSchema, tokenRewardsSchema, tokenSchema, tolerance, txCallSchema, underlyingTokenSchema, unexpectedFailure, unpriceableTokenError, unsupportedCollateralToken, unsupportedTokenPair, withdrawalInProgress, withdrawalOutputAmountSchema };
|
|
@@ -221,7 +221,7 @@ interface StrategyOpportunity extends OpportunityBase {
|
|
|
221
221
|
**/
|
|
222
222
|
targetCollateral: Token;
|
|
223
223
|
/**
|
|
224
|
-
* Debt principal this credit manager has
|
|
224
|
+
* Debt principal this credit manager has borrowed from the pool
|
|
225
225
|
* (`pool.creditManagerBorrowed(creditManager)`). Denominated in the
|
|
226
226
|
* underlying.
|
|
227
227
|
**/
|
|
@@ -331,7 +331,7 @@ interface StrategyOpportunity extends OpportunityBase {
|
|
|
331
331
|
**/
|
|
332
332
|
minDebt: Amount;
|
|
333
333
|
/**
|
|
334
|
-
* Cap on the total debt this credit manager may
|
|
334
|
+
* Cap on the total debt this credit manager may borrow from the pool, shared
|
|
335
335
|
* by all of its accounts and denominated in the underlying
|
|
336
336
|
* (`creditManagerDebtParams.limit`).
|
|
337
337
|
**/
|
|
@@ -591,11 +591,10 @@ interface StrategyOpportunityDetail extends StrategyOpportunity {
|
|
|
591
591
|
**/
|
|
592
592
|
priceFeeds: PriceFeedSummary;
|
|
593
593
|
/**
|
|
594
|
-
*
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
*
|
|
598
|
-
* `both` mode `kyc` is taken from the chain whenever that leg succeeded.
|
|
594
|
+
* KYC gate of this strategy, independent of any wallet. `null` when the
|
|
595
|
+
* strategy is not KYC-gated. `undefined` only in `offchain` mode, until the
|
|
596
|
+
* backend serves it. In `both` mode `kyc` is taken from the chain whenever
|
|
597
|
+
* that leg succeeded.
|
|
599
598
|
**/
|
|
600
599
|
kyc?: KycRequirement | null;
|
|
601
600
|
}
|