@gearbox-protocol/sdk 17.0.0-next.2 → 17.0.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/onchain/validation/checkSimulation.js +9 -3
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/history/trace/extractTransfers.js +1 -1
- package/dist/esm/onchain/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/esm/onchain/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
- package/dist/esm/onchain/base/TokensMeta.js +3 -3
- package/dist/esm/onchain/core/createAddressProvider.js +1 -1
- package/dist/esm/onchain/market/adapters/contracts/AccountMigratorAdapterContract.js +1 -1
- package/dist/esm/onchain/market/adapters/contracts/ERC4626AdapterContract.js +1 -1
- package/dist/esm/onchain/market/credit/CreditFacadeV310BaseContract.js +1 -1
- package/dist/esm/onchain/market/pool/PoolV310Contract.js +1 -1
- package/dist/esm/onchain/market/rwa/createDegenNFT.js +1 -1
- package/dist/esm/onchain/market/zapper/IETHZapperContract.js +1 -1
- package/dist/esm/onchain/market/zapper/ZapperContract.js +1 -1
- package/dist/esm/onchain/preview/preview/previewPoolPositionOperation.js +2 -2
- package/dist/esm/onchain/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/esm/onchain/validation/checkSimulation.js +9 -3
- package/dist/types/onchain/validation/checkSimulation.d.ts +6 -3
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_onchain_validation_helpers_token = require("./helpers/token.js");
|
|
3
3
|
require("./helpers/index.js");
|
|
4
4
|
const require_onchain_validation_checks_checkDebtLimits = require("./checks/checkDebtLimits.js");
|
|
5
|
+
const require_onchain_validation_checks_checkQuotaCount = require("./checks/checkQuotaCount.js");
|
|
5
6
|
require("./checks/index.js");
|
|
6
7
|
const require_onchain_validation_bundles_checkAccountQuotas = require("./bundles/checkAccountQuotas.js");
|
|
7
8
|
const require_onchain_validation_bundles_checkHealthFactors = require("./bundles/checkHealthFactors.js");
|
|
@@ -27,8 +28,10 @@ const require_onchain_validation_bundles_checkMarket = require("./bundles/checkM
|
|
|
27
28
|
* touched. The engine performed all three during the walk, so a simulation that
|
|
28
29
|
* came back `ok` has already passed them.
|
|
29
30
|
*
|
|
30
|
-
* A credit account only: a pool operation has no account
|
|
31
|
-
* three things its own state decides are read by `prepare`
|
|
31
|
+
* A credit account only, opened or adjusted: a pool operation has no account
|
|
32
|
+
* to weigh, and the three things its own state decides are read by `prepare`
|
|
33
|
+
* before it answers. An opening names its quotas `averageQuota` — the branch
|
|
34
|
+
* the planner already weighed it as.
|
|
32
35
|
*/
|
|
33
36
|
function checkSimulation(sdk, input, options = {}) {
|
|
34
37
|
const { state } = input;
|
|
@@ -43,7 +46,10 @@ function checkSimulation(sdk, input, options = {}) {
|
|
|
43
46
|
allowZero: true,
|
|
44
47
|
ceiling: suite.maxBorrowAmount()
|
|
45
48
|
}),
|
|
46
|
-
...
|
|
49
|
+
..."averageQuota" in state ? require_onchain_validation_checks_checkQuotaCount.checkQuotaCount({
|
|
50
|
+
count: state.averageQuota.filter((q) => q.balance > 0n).length,
|
|
51
|
+
max: suite.creditManager.maxEnabledTokens
|
|
52
|
+
}) : require_onchain_validation_bundles_checkAccountQuotas.checkAccountQuotas(suite, state),
|
|
47
53
|
...require_onchain_validation_bundles_checkHealthFactors.checkHealthFactors(state, options)
|
|
48
54
|
];
|
|
49
55
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { iCreditFacadeV310Abi } from "../abi/310/generated.js";
|
|
2
1
|
import { ierc20Abi } from "../abi/iERC20.js";
|
|
2
|
+
import { iCreditFacadeV310Abi } from "../abi/310/generated.js";
|
|
3
3
|
import { AddressMap } from "../onchain/utils/AddressMap.js";
|
|
4
4
|
import { AddressSet } from "../onchain/utils/AddressSet.js";
|
|
5
5
|
import { AssetsMap } from "../onchain/utils/AssetsMap.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { iWithdrawalCompressorV313Abi } from "../abi/IWithdrawalCompressorV313.js";
|
|
1
2
|
import { getNetworkType } from "../onchain/chain/chains.js";
|
|
2
3
|
import { getWithdrawalCompressorAddress } from "../onchain/accounts/withdrawal-compressor/addresses.js";
|
|
3
|
-
import { iWithdrawalCompressorV313Abi } from "../abi/IWithdrawalCompressorV313.js";
|
|
4
4
|
import "../onchain/index.js";
|
|
5
5
|
import { iMidasDataFeedAbi, iMidasRedemptionVaultAbi, midasGatewayAbi, midasRedeemerAbi, midasRedemptionVaultPhantomTokenAbi, securitizeRedeemerAbi, securitizeRedemptionGatewayAbi, securitizeRedemptionPhantomTokenAbi } from "./withdrawalAbi.js";
|
|
6
6
|
import { erc20Abi, hexToString, parseAbi, parseEther } from "viem";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { iCreditFacadeV310Abi } from "../../abi/310/generated.js";
|
|
2
1
|
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
2
|
+
import { iCreditFacadeV310Abi } from "../../abi/310/generated.js";
|
|
3
3
|
import { AddressMap } from "../../onchain/utils/AddressMap.js";
|
|
4
4
|
import "../../onchain/index.js";
|
|
5
5
|
import { UnexpectedFacadeEventOrderError } from "./errors.js";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { iBaseRewardPoolAbi } from "../../abi/iBaseRewardPool.js";
|
|
2
|
+
import { ierc4626AdapterAbi } from "../../abi/ierc4626Adapter.js";
|
|
1
3
|
import { AP_REWARDS_COMPRESSOR } from "../constants/address-provider.js";
|
|
2
4
|
import { ADDRESS_0X0 } from "../constants/addresses.js";
|
|
3
5
|
import { MAX_UINT256 } from "../constants/math.js";
|
|
@@ -8,8 +10,6 @@ import "../base/index.js";
|
|
|
8
10
|
import { AccountBotsService } from "./bots/AccountBotsService.js";
|
|
9
11
|
import "./bots/index.js";
|
|
10
12
|
import { rewardsCompressorAbi } from "../../abi/compressors/rewardsCompressor.js";
|
|
11
|
-
import { iBaseRewardPoolAbi } from "../../abi/iBaseRewardPool.js";
|
|
12
|
-
import { ierc4626AdapterAbi } from "../../abi/ierc4626Adapter.js";
|
|
13
13
|
import { expectedBalanceDeltas } from "../market/credit/expectedBalanceDeltas.js";
|
|
14
14
|
import "../market/index.js";
|
|
15
15
|
import { CreditAccountCompressor } from "./credit-account-compressor/CreditAccountCompressor.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { iLiquidationCompressorV313Abi } from "../../../abi/ILiquidationCompressorV313.js";
|
|
1
2
|
import { AddressSet } from "../../utils/AddressSet.js";
|
|
2
3
|
import { bytes32ToString } from "../../utils/bytes32ToString.js";
|
|
3
4
|
import { ADDRESS_0X0 } from "../../constants/addresses.js";
|
|
@@ -19,7 +20,6 @@ import { SecuritizeLiquidatorContract } from "../../market/rwa/securitize/Securi
|
|
|
19
20
|
import "../../market/rwa/securitize/index.js";
|
|
20
21
|
import "../../market/index.js";
|
|
21
22
|
import { LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS } from "./constants.js";
|
|
22
|
-
import { iLiquidationCompressorV313Abi } from "../../../abi/ILiquidationCompressorV313.js";
|
|
23
23
|
import { skipLiquidatableAccount } from "./skipLiquidatableAccount.js";
|
|
24
24
|
//#region src/onchain/accounts/liquidations/LiquidationsService.ts
|
|
25
25
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { iRedemptionLoggerV310Abi } from "../../../abi/iRedemptionLoggerV310.js";
|
|
1
2
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
2
3
|
import "../../base/index.js";
|
|
3
4
|
import { sdkErr, sdkOk } from "../../../model/result.js";
|
|
4
5
|
import "../../../model/index.js";
|
|
5
6
|
import { decodeDelayedIntent } from "./intent-codec.js";
|
|
6
|
-
import { iRedemptionLoggerV310Abi } from "../../../abi/iRedemptionLoggerV310.js";
|
|
7
7
|
//#region src/onchain/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.ts
|
|
8
8
|
const abi = iRedemptionLoggerV310Abi;
|
|
9
9
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
2
1
|
import { iWithdrawalCompressorV310Abi } from "../../../abi/IWithdrawalCompressorV310.js";
|
|
2
|
+
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
3
3
|
//#region src/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.ts
|
|
4
4
|
const abi = iWithdrawalCompressorV310Abi;
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
2
1
|
import { iWithdrawalCompressorV311Abi } from "../../../abi/IWithdrawalCompressorV311.js";
|
|
2
|
+
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
3
3
|
//#region src/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.ts
|
|
4
4
|
const abi = iWithdrawalCompressorV311Abi;
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { iWithdrawalCompressorV313Abi } from "../../../abi/IWithdrawalCompressorV313.js";
|
|
1
2
|
import { encodeDelayedIntent } from "./intent-codec.js";
|
|
2
3
|
import { AbstractWithdrawalCompressorContract, iCreditAccountAbi, toClaimableWithdrawal, toPendingWithdrawal, toRequestableWithdrawal } from "./AbstractWithdrawalCompressorContract.js";
|
|
3
|
-
import { iWithdrawalCompressorV313Abi } from "../../../abi/IWithdrawalCompressorV313.js";
|
|
4
4
|
import { toWithdrawalStatus } from "./types.js";
|
|
5
5
|
//#region src/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.ts
|
|
6
6
|
const abi = iWithdrawalCompressorV313Abi;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { iExpirableAbi } from "../../abi/iExpirable.js";
|
|
2
|
+
import { iStateSerializerAbi } from "../../abi/iStateSerializer.js";
|
|
3
|
+
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
1
4
|
import { AddressMap } from "../utils/AddressMap.js";
|
|
2
5
|
import { AddressSet } from "../utils/AddressSet.js";
|
|
3
6
|
import { bytes32ToString } from "../utils/bytes32ToString.js";
|
|
4
7
|
import { getAssetType } from "../chain/chains.js";
|
|
5
8
|
import { formatBN } from "../utils/formatter.js";
|
|
6
9
|
import "../utils/index.js";
|
|
7
|
-
import { iExpirableAbi } from "../../abi/iExpirable.js";
|
|
8
|
-
import { iStateSerializerAbi } from "../../abi/iStateSerializer.js";
|
|
9
|
-
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
10
10
|
import { SdkRWADataNotLoadedError } from "../core/errors.js";
|
|
11
11
|
import { executeMulticallBatches } from "../utils/viem/executeMulticallBatches.js";
|
|
12
12
|
//#region src/onchain/base/TokensMeta.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
1
2
|
import { AP_MARKET_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR } from "../constants/address-provider.js";
|
|
2
3
|
import { isV310 } from "../constants/versions.js";
|
|
3
4
|
import "../constants/index.js";
|
|
4
5
|
import { hexEq } from "../utils/hex.js";
|
|
5
|
-
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
6
6
|
import { AddressProviderV310Contract } from "./AddressProviderV310Contract.js";
|
|
7
7
|
//#region src/onchain/core/createAddressProvider.ts
|
|
8
8
|
const OVERRIDE_ADDRESSES = { Mainnet: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
2
1
|
import { accountMigratorAbi } from "../../../../abi/AccountMigrator.js";
|
|
2
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
3
3
|
//#region src/onchain/market/adapters/contracts/AccountMigratorAdapterContract.ts
|
|
4
4
|
const abi = accountMigratorAbi;
|
|
5
5
|
const protocolAbi = accountMigratorAbi;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ierc4626AdapterAbi } from "../../../../abi/ierc4626Adapter.js";
|
|
1
2
|
import { MissingSerializedParamsError } from "../../../base/errors.js";
|
|
2
3
|
import "../../../base/index.js";
|
|
3
|
-
import { ierc4626AdapterAbi } from "../../../../abi/ierc4626Adapter.js";
|
|
4
4
|
import { iERC4626Abi } from "../abi/targetContractAbi.js";
|
|
5
5
|
import { fnSigToName, swapFromTransfers } from "../transferHelpers.js";
|
|
6
6
|
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
1
2
|
import { iCreditFacadeMulticallV310Abi, iCreditFacadeV310Abi } from "../../../abi/310/generated.js";
|
|
2
3
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
3
4
|
import "../../base/index.js";
|
|
4
|
-
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
5
5
|
//#region src/onchain/market/credit/CreditFacadeV310BaseContract.ts
|
|
6
6
|
const abi = [
|
|
7
7
|
...iCreditFacadeV310Abi,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
1
2
|
import { iPoolV310Abi } from "../../../abi/310/generated.js";
|
|
2
3
|
import { AddressMap } from "../../utils/AddressMap.js";
|
|
3
4
|
import { RAY } from "../../constants/math.js";
|
|
@@ -7,7 +8,6 @@ import "../../utils/index.js";
|
|
|
7
8
|
import { SdkRWADataNotLoadedError } from "../../core/errors.js";
|
|
8
9
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
9
10
|
import "../../base/index.js";
|
|
10
|
-
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
11
11
|
//#region src/onchain/market/pool/PoolV310Contract.ts
|
|
12
12
|
const abi = [...iPoolV310Abi, ...iPausableAbi];
|
|
13
13
|
var PoolV310Contract = class extends BaseContract {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { iVersionAbi } from "../../../abi/iVersion.js";
|
|
1
2
|
import { bytes32ToString } from "../../utils/bytes32ToString.js";
|
|
2
3
|
import "../../utils/index.js";
|
|
3
|
-
import { iVersionAbi } from "../../../abi/iVersion.js";
|
|
4
4
|
import { iMidasDegenNFTAbi } from "../../../abi/rwa/iMidasDegenNFT.js";
|
|
5
5
|
import { DEGEN_NFT_MIDAS } from "./midas/constants.js";
|
|
6
6
|
import { MidasDegenNFT } from "./midas/MidasDegenNFT.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ZapperContract } from "./ZapperContract.js";
|
|
2
1
|
import { iethZapperAbi } from "../../../abi/iETHZapper.js";
|
|
2
|
+
import { ZapperContract } from "./ZapperContract.js";
|
|
3
3
|
//#region src/onchain/market/zapper/IETHZapperContract.ts
|
|
4
4
|
const abi = iethZapperAbi;
|
|
5
5
|
var IETHZapperContract = class extends ZapperContract {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
1
2
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
2
3
|
import "../../base/index.js";
|
|
3
4
|
import { sdkErr, sdkOk } from "../../../model/result.js";
|
|
4
5
|
import "../../../model/index.js";
|
|
5
|
-
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
6
6
|
//#region src/onchain/market/zapper/ZapperContract.ts
|
|
7
7
|
/**
|
|
8
8
|
* Base contract for every Gearbox zapper. Specialized zappers (e.g.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { iPoolV310Abi } from "../../../abi/310/generated.js";
|
|
2
1
|
import { ierc20Abi } from "../../../abi/iERC20.js";
|
|
2
|
+
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
3
|
+
import { iPoolV310Abi } from "../../../abi/310/generated.js";
|
|
3
4
|
import { sdkErr, sdkOk } from "../../../model/result.js";
|
|
4
5
|
import "../../../model/index.js";
|
|
5
|
-
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
6
6
|
//#region src/onchain/preview/preview/previewPoolPositionOperation.ts
|
|
7
7
|
function previewRead(operation) {
|
|
8
8
|
switch (operation.operation) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { errorAbis } from "../../../abi/errors.js";
|
|
2
|
-
import { generateCastTraceCall } from "./cast.js";
|
|
3
2
|
import { iUpdatablePriceFeedAbi } from "../../../abi/iUpdatablePriceFeed.js";
|
|
3
|
+
import { generateCastTraceCall } from "./cast.js";
|
|
4
4
|
import { simulateMulticall } from "./simulateMulticall.js";
|
|
5
5
|
import { BaseError, CallExecutionError, ContractFunctionRevertedError, decodeFunctionData, decodeFunctionResult, encodeFunctionData, parseAbi } from "viem";
|
|
6
6
|
import { getAction, parseAccount } from "viem/utils";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { toToken } from "./helpers/token.js";
|
|
2
2
|
import "./helpers/index.js";
|
|
3
3
|
import { checkDebtLimits } from "./checks/checkDebtLimits.js";
|
|
4
|
+
import { checkQuotaCount } from "./checks/checkQuotaCount.js";
|
|
4
5
|
import "./checks/index.js";
|
|
5
6
|
import { checkAccountQuotas } from "./bundles/checkAccountQuotas.js";
|
|
6
7
|
import { checkHealthFactors } from "./bundles/checkHealthFactors.js";
|
|
@@ -26,8 +27,10 @@ import { checkMarket } from "./bundles/checkMarket.js";
|
|
|
26
27
|
* touched. The engine performed all three during the walk, so a simulation that
|
|
27
28
|
* came back `ok` has already passed them.
|
|
28
29
|
*
|
|
29
|
-
* A credit account only: a pool operation has no account
|
|
30
|
-
* three things its own state decides are read by `prepare`
|
|
30
|
+
* A credit account only, opened or adjusted: a pool operation has no account
|
|
31
|
+
* to weigh, and the three things its own state decides are read by `prepare`
|
|
32
|
+
* before it answers. An opening names its quotas `averageQuota` — the branch
|
|
33
|
+
* the planner already weighed it as.
|
|
31
34
|
*/
|
|
32
35
|
function checkSimulation(sdk, input, options = {}) {
|
|
33
36
|
const { state } = input;
|
|
@@ -42,7 +45,10 @@ function checkSimulation(sdk, input, options = {}) {
|
|
|
42
45
|
allowZero: true,
|
|
43
46
|
ceiling: suite.maxBorrowAmount()
|
|
44
47
|
}),
|
|
45
|
-
...
|
|
48
|
+
..."averageQuota" in state ? checkQuotaCount({
|
|
49
|
+
count: state.averageQuota.filter((q) => q.balance > 0n).length,
|
|
50
|
+
max: suite.creditManager.maxEnabledTokens
|
|
51
|
+
}) : checkAccountQuotas(suite, state),
|
|
46
52
|
...checkHealthFactors(state, options)
|
|
47
53
|
];
|
|
48
54
|
}
|
|
@@ -3,13 +3,14 @@ import { DebtOutOfRangeError, InsufficientCollateralError, QuotaCountExceededErr
|
|
|
3
3
|
import "../../model/index.js";
|
|
4
4
|
import { OnchainSDK } from "../OnchainSDK.js";
|
|
5
5
|
import { OperationState } from "../accounts/intents/types.js";
|
|
6
|
+
import { OpenStrategyState } from "../accounts/intents/open-strategy.js";
|
|
6
7
|
import { HealthFactorThresholds } from "./bundles/checkHealthFactors.js";
|
|
7
8
|
import { MarketStateError } from "./bundles/checkMarket.js";
|
|
8
9
|
//#region src/onchain/validation/checkSimulation.d.ts
|
|
9
10
|
/** A simulated credit operation, as the intents engine reports one. */
|
|
10
11
|
interface CreditSimulationInput {
|
|
11
12
|
chainId: ChainId;
|
|
12
|
-
state: OperationState;
|
|
13
|
+
state: OperationState | OpenStrategyState;
|
|
13
14
|
}
|
|
14
15
|
type CheckSimulationInput = CreditSimulationInput;
|
|
15
16
|
/** {@inheritDoc checkSimulation} */
|
|
@@ -34,8 +35,10 @@ type SimulationValidationError = MarketStateError | DebtOutOfRangeError | QuotaC
|
|
|
34
35
|
* touched. The engine performed all three during the walk, so a simulation that
|
|
35
36
|
* came back `ok` has already passed them.
|
|
36
37
|
*
|
|
37
|
-
* A credit account only: a pool operation has no account
|
|
38
|
-
* three things its own state decides are read by `prepare`
|
|
38
|
+
* A credit account only, opened or adjusted: a pool operation has no account
|
|
39
|
+
* to weigh, and the three things its own state decides are read by `prepare`
|
|
40
|
+
* before it answers. An opening names its quotas `averageQuota` — the branch
|
|
41
|
+
* the planner already weighed it as.
|
|
39
42
|
*/
|
|
40
43
|
declare function checkSimulation(sdk: OnchainSDK, input: CheckSimulationInput, options?: HealthFactorThresholds): SimulationValidationError[];
|
|
41
44
|
//#endregion
|