@gearbox-protocol/sdk 16.0.0-next.2 → 16.0.0-next.4
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/dev/mode-parity/fieldDiff.js +1 -1
- package/dist/cjs/model/opportunities.schema.js +5 -5
- package/dist/cjs/sdk/chain/chains.js +1 -0
- package/dist/cjs/sdk/index.js +1 -0
- package/dist/cjs/sdk/market/MarketSuite.js +22 -20
- package/dist/cjs/sdk/market/credit/CreditSuite.js +24 -13
- package/dist/cjs/sdk/market/index.js +1 -0
- package/dist/cjs/sdk/market/math.js +10 -2
- package/dist/cjs/sdk/market/pool/PoolSuite.js +0 -6
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +0 -7
- package/dist/cjs/sdk/market/pool/math.js +1 -1
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/mode-parity/fieldDiff.js +1 -1
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/model/opportunities.schema.js +5 -5
- package/dist/esm/preview/simulate/simulatePoolOperation.js +1 -1
- package/dist/esm/preview/trace/extractTransfers.js +1 -1
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
- package/dist/esm/sdk/base/TokensMeta.js +3 -3
- package/dist/esm/sdk/chain/chains.js +1 -0
- package/dist/esm/sdk/chain/detectNetwork.js +1 -1
- package/dist/esm/sdk/core/createAddressProvider.js +1 -1
- package/dist/esm/sdk/index.js +2 -2
- package/dist/esm/sdk/market/MarketSuite.js +22 -20
- package/dist/esm/sdk/market/adapters/contracts/AccountMigratorAdapterContract.js +1 -1
- package/dist/esm/sdk/market/adapters/contracts/ERC4626AdapterContract.js +1 -1
- package/dist/esm/sdk/market/credit/CreditFacadeV310BaseContract.js +1 -1
- package/dist/esm/sdk/market/credit/CreditSuite.js +25 -14
- package/dist/esm/sdk/market/index.js +2 -2
- package/dist/esm/sdk/market/math.js +10 -3
- package/dist/esm/sdk/market/pool/PoolSuite.js +0 -6
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +1 -8
- package/dist/esm/sdk/market/pool/math.js +2 -2
- package/dist/esm/sdk/market/zapper/IETHZapperContract.js +1 -1
- package/dist/esm/sdk/market/zapper/ZapperContract.js +1 -1
- package/dist/esm/sdk/pools/PoolService.js +1 -1
- package/dist/esm/sdk/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/types/dev/mode-parity/fieldDiff.d.ts +3 -3
- package/dist/types/model/opportunities.d.ts +27 -30
- package/dist/types/model/opportunities.schema.d.ts +56 -64
- package/dist/types/model/primitives.d.ts +1 -1
- package/dist/types/sdk/index.d.ts +2 -2
- package/dist/types/sdk/market/MarketSuite.d.ts +8 -5
- package/dist/types/sdk/market/credit/CreditSuite.d.ts +0 -7
- package/dist/types/sdk/market/index.d.ts +2 -2
- package/dist/types/sdk/market/math.d.ts +9 -4
- package/dist/types/sdk/market/pool/PoolSuite.d.ts +0 -5
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +0 -6
- package/dist/types/sdk/market/pool/types.d.ts +0 -6
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AddressMap } from "../utils/AddressMap.js";
|
|
2
2
|
import { isRWAToken, isSunsetPool } from "../chain/chains.js";
|
|
3
|
-
import { PERCENTAGE_FACTOR } from "../constants/math.js";
|
|
4
3
|
import "../utils/index.js";
|
|
5
4
|
import { SDKConstruct } from "../base/SDKConstruct.js";
|
|
6
5
|
import "../base/index.js";
|
|
@@ -17,6 +16,7 @@ import { createPriceOracle } from "./oracle/createPriceOracle.js";
|
|
|
17
16
|
import "./oracle/index.js";
|
|
18
17
|
import { PoolSuite } from "./pool/PoolSuite.js";
|
|
19
18
|
import "./pool/index.js";
|
|
19
|
+
import { isAddressEqual } from "viem";
|
|
20
20
|
//#region src/sdk/market/MarketSuite.ts
|
|
21
21
|
/**
|
|
22
22
|
* Aggregates all SDK wrappers that make up one Gearbox market.
|
|
@@ -136,20 +136,28 @@ var MarketSuite = class extends SDKConstruct {
|
|
|
136
136
|
return this.configurator.curator;
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
|
-
* Tokens a
|
|
140
|
-
*
|
|
139
|
+
* Tokens a user can transfer from their wallet to deposit into this pool.
|
|
140
|
+
*
|
|
141
|
+
* 1. unwrapped underlying
|
|
142
|
+
* 2. tokenIn of every zapper (order does not matter), skipping the wrapped
|
|
143
|
+
* and unwrapped underlying
|
|
141
144
|
*/
|
|
142
|
-
get
|
|
143
|
-
const seen = new AddressMap(void 0, "
|
|
144
|
-
|
|
145
|
+
get allowedDepositTokens() {
|
|
146
|
+
const seen = new AddressMap(void 0, "allowedDepositTokens");
|
|
147
|
+
seen.upsert(this.unwrappedUnderlying, this.underlyingToken);
|
|
148
|
+
for (const zapper of this.sdk.marketRegister.poolZappers(this.pool.pool.address)) {
|
|
149
|
+
const tokenIn = zapper.tokenIn.addr;
|
|
150
|
+
if (isAddressEqual(tokenIn, this.pool.underlying) || isAddressEqual(tokenIn, this.unwrappedUnderlying)) continue;
|
|
151
|
+
seen.upsert(tokenIn, this.tokensMeta.mustGetToken(tokenIn));
|
|
152
|
+
}
|
|
145
153
|
return seen.values();
|
|
146
154
|
}
|
|
147
155
|
/**
|
|
148
|
-
* Whether
|
|
149
|
-
*
|
|
156
|
+
* Whether one of the market's quoted tokens is a real-world-asset token.
|
|
157
|
+
* Read from a hardcoded per-chain list rather than from the chain.
|
|
150
158
|
*/
|
|
151
159
|
get rwa() {
|
|
152
|
-
return this.
|
|
160
|
+
return this.pool.pqk.quotas.keys().some((token) => isRWAToken(token, this.sdk.networkType));
|
|
153
161
|
}
|
|
154
162
|
/**
|
|
155
163
|
* Whether this market's pool is being wound down and should no longer be
|
|
@@ -165,16 +173,11 @@ var MarketSuite = class extends SDKConstruct {
|
|
|
165
173
|
quotaAssets() {
|
|
166
174
|
const oracle = this.priceOracle;
|
|
167
175
|
const { underlying } = this;
|
|
168
|
-
|
|
169
|
-
const sumUsed = quotas.reduce((sum, [, quota]) => sum + quota.totalQuoted, 0n);
|
|
170
|
-
const { totalBorrowed } = this.pool.pool;
|
|
171
|
-
return quotas.map(([token, quota]) => ({
|
|
176
|
+
return this.pool.pqk.quotas.entries().map(([token, quota]) => ({
|
|
172
177
|
token: this.tokensMeta.mustGetToken(token),
|
|
173
178
|
quotaRate: quota.rate,
|
|
174
179
|
limit: oracle.toAmount(underlying, quota.limit),
|
|
175
|
-
used: oracle.toAmount(underlying, quota.totalQuoted)
|
|
176
|
-
allocationShare: sumUsed === 0n ? 0 : Number(quota.totalQuoted * PERCENTAGE_FACTOR / sumUsed),
|
|
177
|
-
allocatedDebt: oracle.toAmount(underlying, sumUsed === 0n ? 0n : totalBorrowed * quota.totalQuoted / sumUsed)
|
|
180
|
+
used: oracle.toAmount(underlying, quota.totalQuoted)
|
|
178
181
|
}));
|
|
179
182
|
}
|
|
180
183
|
/**
|
|
@@ -221,12 +224,11 @@ var MarketSuite = class extends SDKConstruct {
|
|
|
221
224
|
name: this.poolName,
|
|
222
225
|
curator: this.curator,
|
|
223
226
|
underlyingToken: this.underlyingToken,
|
|
224
|
-
totalSupply: oracle.toAmount(pool.underlying, pool.
|
|
227
|
+
totalSupply: oracle.toAmount(pool.underlying, pool.expectedLiquidity),
|
|
225
228
|
availableLiquidity: oracle.toAmount(pool.underlying, pool.availableLiquidity),
|
|
226
|
-
|
|
227
|
-
utilization: pool.utilization,
|
|
229
|
+
totalBorrowedWithInterest: oracle.toAmount(pool.underlying, pool.borrowed),
|
|
228
230
|
supplyApy: { organicApy: rayToBps(pool.supplyRate) },
|
|
229
|
-
|
|
231
|
+
allowedDepositTokens: this.allowedDepositTokens,
|
|
230
232
|
paused: pool.isPaused,
|
|
231
233
|
rwa: this.rwa,
|
|
232
234
|
sunset: this.sunset,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { accountMigratorAbi } from "../../../../abi/AccountMigrator.js";
|
|
2
1
|
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
2
|
+
import { accountMigratorAbi } from "../../../../abi/AccountMigrator.js";
|
|
3
3
|
//#region src/sdk/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";
|
|
2
1
|
import { MissingSerializedParamsError } from "../../../base/errors.js";
|
|
3
2
|
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";
|
|
2
1
|
import { iCreditFacadeMulticallV310Abi, iCreditFacadeV310Abi } from "../../../abi/310/generated.js";
|
|
3
2
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
4
3
|
import "../../base/index.js";
|
|
4
|
+
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
5
5
|
//#region src/sdk/market/credit/CreditFacadeV310BaseContract.ts
|
|
6
6
|
const abi = [
|
|
7
7
|
...iCreditFacadeV310Abi,
|
|
@@ -8,10 +8,11 @@ import { SDKConstruct } from "../../base/SDKConstruct.js";
|
|
|
8
8
|
import "../../base/index.js";
|
|
9
9
|
import { calcBorrowApy, calcQuotaRate, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount } from "../math.js";
|
|
10
10
|
import { strategyName } from "../strategyName.js";
|
|
11
|
-
import { dominantCollateral,
|
|
11
|
+
import { dominantCollateral, pickStrategyTargetCollateral } from "./collateralUtils.js";
|
|
12
12
|
import createCreditConfigurator from "./createCreditConfigurator.js";
|
|
13
13
|
import createCreditFacade from "./createCreditFacade.js";
|
|
14
14
|
import createCreditManager from "./createCreditManager.js";
|
|
15
|
+
import { isAddressEqual } from "viem";
|
|
15
16
|
//#region src/sdk/market/credit/CreditSuite.ts
|
|
16
17
|
/**
|
|
17
18
|
* Amount of underlying seeded into each pool at market creation to protect
|
|
@@ -177,17 +178,6 @@ var CreditSuite = class extends SDKConstruct {
|
|
|
177
178
|
return this.creditFacade.isPaused || this.market.pool.isPaused;
|
|
178
179
|
}
|
|
179
180
|
/**
|
|
180
|
-
* Collateral tokens a leveraged position can be built around in this suite,
|
|
181
|
-
* see {@link isStrategyCollateral} for the per-token criteria. Tokens the
|
|
182
|
-
* facade has forbidden are excluded — they cannot be taken on — even when
|
|
183
|
-
* they still pass the shared eligibility rule used for target selection.
|
|
184
|
-
*/
|
|
185
|
-
get strategyCollaterals() {
|
|
186
|
-
if (this.maxBorrowAmount <= MIN_STRATEGY_BORROW_AMOUNT) return [];
|
|
187
|
-
const forbidden = new Set(this.forbiddenTokens);
|
|
188
|
-
return this.creditManager.collateralTokens.filter((token) => !forbidden.has(token) && isStrategyCollateral(this.#strategyCollateralProps(token), true));
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
181
|
* Tokens forbidden by the facade.
|
|
192
182
|
*/
|
|
193
183
|
get forbiddenTokens() {
|
|
@@ -257,8 +247,8 @@ var CreditSuite = class extends SDKConstruct {
|
|
|
257
247
|
name: this.strategyName ?? this.market.underlyingToken.symbol,
|
|
258
248
|
curator: market.curator,
|
|
259
249
|
underlyingToken: market.underlyingToken,
|
|
260
|
-
|
|
261
|
-
|
|
250
|
+
totalBorrowed: oracle.toAmount(pool.underlying, borrowed),
|
|
251
|
+
allowedDepositTokens: this.#allowedDepositTokens(collateral),
|
|
262
252
|
paused: this.isPaused,
|
|
263
253
|
rwa: market.rwa,
|
|
264
254
|
sunset: market.sunset || isSunsetStrategy(cm.address, this.sdk.networkType),
|
|
@@ -327,6 +317,27 @@ var CreditSuite = class extends SDKConstruct {
|
|
|
327
317
|
return collateral;
|
|
328
318
|
}
|
|
329
319
|
/**
|
|
320
|
+
* Tokens a user can transfer from their wallet when opening an account in
|
|
321
|
+
* this suite:
|
|
322
|
+
*
|
|
323
|
+
* 1. unwrapped underlying (USDC, never dcUSDC)
|
|
324
|
+
* 2. target collateral
|
|
325
|
+
* 3. remaining CM collaterals in manager order, no phantoms
|
|
326
|
+
*/
|
|
327
|
+
#allowedDepositTokens(targetCollateral) {
|
|
328
|
+
const unwrappedUnderlying = this.market.unwrappedUnderlying;
|
|
329
|
+
const contractUnderlying = this.underlying;
|
|
330
|
+
const skip = (token) => isAddressEqual(token, unwrappedUnderlying) || isAddressEqual(token, contractUnderlying) || isAddressEqual(token, targetCollateral);
|
|
331
|
+
return [
|
|
332
|
+
unwrappedUnderlying,
|
|
333
|
+
targetCollateral,
|
|
334
|
+
...this.creditManager.collateralTokens.filter((token) => {
|
|
335
|
+
const contractType = this.tokensMeta.mustGet(token).contractType;
|
|
336
|
+
return !skip(token) && !contractType?.startsWith("PHANTOM_TOKEN::");
|
|
337
|
+
})
|
|
338
|
+
].map((token) => this.tokensMeta.mustGetToken(token));
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
330
341
|
* Shared inputs of {@link isStrategyCollateral} for one of this suite's
|
|
331
342
|
* collateral tokens.
|
|
332
343
|
*/
|
|
@@ -87,7 +87,7 @@ import "./adapters/index.js";
|
|
|
87
87
|
import { CreditConfiguratorV310Contract } from "./credit/CreditConfiguratorV310Contract.js";
|
|
88
88
|
import { CreditFacadeV310BaseContract, creditFacadeV310Abi as abi } from "./credit/CreditFacadeV310BaseContract.js";
|
|
89
89
|
import { CreditFacadeV310Contract } from "./credit/CreditFacadeV310Contract.js";
|
|
90
|
-
import { DEFAULT_QUOTA_BUFFER_BPS, MAX_LEVERAGE_BUFFER_BPS, PARTIAL_LIQUIDATION_BUFFER_BPS, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, healthFactorBps, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount, rayToBps, usdToNumber } from "./math.js";
|
|
90
|
+
import { DEFAULT_QUOTA_BUFFER_BPS, MAX_LEVERAGE_BUFFER_BPS, PARTIAL_LIQUIDATION_BUFFER_BPS, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, healthFactorBps, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount, rayToBps, usdToNumber } from "./math.js";
|
|
91
91
|
import { CreditManagerV310Contract } from "./credit/CreditManagerV310Contract.js";
|
|
92
92
|
import { strategyName } from "./strategyName.js";
|
|
93
93
|
import { dominantCollateral, isStrategyCollateral, pickStrategyTargetCollateral } from "./credit/collateralUtils.js";
|
|
@@ -144,4 +144,4 @@ import { RWARegistry } from "./rwa/RWARegistry.js";
|
|
|
144
144
|
import { RWA_FACTORY_TYPES, isRWAFactory } from "./rwa/types.js";
|
|
145
145
|
import "./rwa/index.js";
|
|
146
146
|
import "./types.js";
|
|
147
|
-
export { AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterType, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CamelotV3AdapterContract, CompositePriceFeedContract, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, 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, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolSuite, PoolV310Contract, PriceFeedRef, PriceFeedRegister, PriceOracleV310Contract, PythPriceFeed, RWARegistry, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RedstonePriceFeedContract, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, TraderJoePoolVersion, TraderJoeRouterAdapterContract, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UnsupportedZapperFunctionError, UpshiftVaultAdapterContract, VelodromeV2RouterAdapterContract, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, ZapperContract, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, classifyCurveOperation, createAdapter, createPriceOracle, createZapper, abi as creditFacadeV310Abi, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, dominantCollateral, erc4626ReferralAdapterAbi, expectedBalanceDeltas, fetchRedstonePayloads, 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, usdToNumber };
|
|
147
|
+
export { AbstractAdapterContract, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterType, BalancerStablePriceFeedContract, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CamelotV3AdapterContract, CompositePriceFeedContract, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditConfiguratorV310Contract, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, DEFAULT_QUOTA_BUFFER_BPS, 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, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PartialPriceFeedInitError, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolSuite, PoolV310Contract, PriceFeedRef, PriceFeedRegister, PriceOracleV310Contract, PythPriceFeed, RWARegistry, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RedstonePriceFeedContract, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, TraderJoePoolVersion, TraderJoeRouterAdapterContract, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UnsupportedZapperFunctionError, UpshiftVaultAdapterContract, VelodromeV2RouterAdapterContract, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, ZapperContract, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, createAdapter, createPriceOracle, createZapper, abi as creditFacadeV310Abi, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, dominantCollateral, erc4626ReferralAdapterAbi, expectedBalanceDeltas, fetchRedstonePayloads, 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, usdToNumber };
|
|
@@ -60,15 +60,22 @@ function usdToNumber(usd) {
|
|
|
60
60
|
* @example
|
|
61
61
|
* ```ts
|
|
62
62
|
* // borrowed: 750, total: 1000
|
|
63
|
-
*
|
|
63
|
+
* calcUtilizationRaw(750n, 1000n) // 750 / 1000 = 7500 bps = 75%
|
|
64
64
|
* ```
|
|
65
65
|
**/
|
|
66
|
-
function
|
|
66
|
+
function calcUtilizationRaw(borrowed, total) {
|
|
67
67
|
if (total <= 0n || borrowed <= 0n) return 0;
|
|
68
68
|
const utilization = Number(borrowed * PERCENTAGE_FACTOR / total);
|
|
69
69
|
return Math.min(utilization, FULL);
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
+
* Pool utilization: {@link PoolOpportunity.totalBorrowedWithInterest} as a
|
|
73
|
+
* share of {@link PoolOpportunity.totalSupply}, in basis points.
|
|
74
|
+
**/
|
|
75
|
+
function calcUtilization(poolOpportunity) {
|
|
76
|
+
return calcUtilizationRaw(poolOpportunity.totalBorrowedWithInterest.value, poolOpportunity.totalSupply.value);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
72
79
|
* Annual cost of debt for a credit manager, in basis points:
|
|
73
80
|
* `baseInterestRate × (1 + feeInterest)` — the pool's base rate plus the
|
|
74
81
|
* protocol's cut of the accrued interest.
|
|
@@ -267,4 +274,4 @@ function optimalHFForPartialLiquidation(borrowRate) {
|
|
|
267
274
|
return PERCENTAGE_FACTOR + (borrowRate < 100n ? borrowRate : 100n);
|
|
268
275
|
}
|
|
269
276
|
//#endregion
|
|
270
|
-
export { DEFAULT_QUOTA_BUFFER_BPS, MAX_LEVERAGE_BUFFER_BPS, PARTIAL_LIQUIDATION_BUFFER_BPS, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, healthFactorBps, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount, rayToBps, usdToNumber };
|
|
277
|
+
export { DEFAULT_QUOTA_BUFFER_BPS, MAX_LEVERAGE_BUFFER_BPS, PARTIAL_LIQUIDATION_BUFFER_BPS, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, healthFactorBps, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount, rayToBps, usdToNumber };
|
|
@@ -105,12 +105,6 @@ var PoolSuite = class extends SDKConstruct {
|
|
|
105
105
|
return this.pool.unwrappedUnderlying;
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
|
-
* {@inheritDoc IPoolContract.utilization}
|
|
109
|
-
*/
|
|
110
|
-
get utilization() {
|
|
111
|
-
return this.pool.utilization;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
108
|
* Whether the pool is paused, which blocks borrowing across every connected
|
|
115
109
|
* credit suite.
|
|
116
110
|
*/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
2
1
|
import { iPoolV310Abi } from "../../../abi/310/generated.js";
|
|
3
2
|
import { AddressMap } from "../../utils/AddressMap.js";
|
|
4
3
|
import { RAY } from "../../constants/math.js";
|
|
@@ -7,7 +6,7 @@ import { formatBN, formatBNvalue, percentFmt } from "../../utils/formatter.js";
|
|
|
7
6
|
import "../../utils/index.js";
|
|
8
7
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
9
8
|
import "../../base/index.js";
|
|
10
|
-
import {
|
|
9
|
+
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
11
10
|
//#region src/sdk/market/pool/PoolV310Contract.ts
|
|
12
11
|
const abi = [...iPoolV310Abi, ...iPausableAbi];
|
|
13
12
|
var PoolV310Contract = class extends BaseContract {
|
|
@@ -47,12 +46,6 @@ var PoolV310Contract = class extends BaseContract {
|
|
|
47
46
|
return this.totalSupply * this.dieselRate / RAY;
|
|
48
47
|
}
|
|
49
48
|
/**
|
|
50
|
-
* {@inheritDoc IPoolContract.utilization}
|
|
51
|
-
*/
|
|
52
|
-
get utilization() {
|
|
53
|
-
return calcUtilization(this.borrowed, this.expectedLiquidity);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
49
|
* {@inheritDoc IPoolContract.unwrappedUnderlying}
|
|
57
50
|
*/
|
|
58
51
|
get unwrappedUnderlying() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PERCENTAGE_FACTOR } from "../../constants/math.js";
|
|
2
|
-
import {
|
|
2
|
+
import { calcUtilizationRaw } from "../math.js";
|
|
3
3
|
//#region src/sdk/market/pool/math.ts
|
|
4
4
|
const FULL = Number(PERCENTAGE_FACTOR);
|
|
5
5
|
/**
|
|
@@ -28,7 +28,7 @@ function borrowRateAtUtilization(utilization, params) {
|
|
|
28
28
|
**/
|
|
29
29
|
function utilizationAfterLiquidityChange(expectedLiquidity, availableLiquidity, availableLiquidityChange) {
|
|
30
30
|
const borrowed = expectedLiquidity - (availableLiquidity + availableLiquidityChange);
|
|
31
|
-
return
|
|
31
|
+
return calcUtilizationRaw(borrowed, expectedLiquidity);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Rate depositors earn at a given utilization, in basis points: the interest
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { iethZapperAbi } from "../../../abi/iETHZapper.js";
|
|
2
1
|
import { ZapperContract } from "./ZapperContract.js";
|
|
2
|
+
import { iethZapperAbi } from "../../../abi/iETHZapper.js";
|
|
3
3
|
//#region src/sdk/market/zapper/IETHZapperContract.ts
|
|
4
4
|
const abi = iethZapperAbi;
|
|
5
5
|
var IETHZapperContract = class extends ZapperContract {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
2
1
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
3
2
|
import "../../base/index.js";
|
|
3
|
+
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
4
4
|
import { UnsupportedZapperFunctionError } from "./errors.js";
|
|
5
5
|
//#region src/sdk/market/zapper/ZapperContract.ts
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
2
1
|
import { AddressSet } from "../utils/AddressSet.js";
|
|
2
|
+
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
3
3
|
import "../constants/addresses.js";
|
|
4
4
|
import { PERCENTAGE_FACTOR, RAY } from "../constants/math.js";
|
|
5
5
|
import "../constants/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { errorAbis } from "../../../abi/errors.js";
|
|
2
|
-
import { iUpdatablePriceFeedAbi } from "../../../abi/iUpdatablePriceFeed.js";
|
|
3
2
|
import { generateCastTraceCall } from "./cast.js";
|
|
3
|
+
import { iUpdatablePriceFeedAbi } from "../../../abi/iUpdatablePriceFeed.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";
|
|
@@ -26,7 +26,7 @@ type ExpectedDiffReason = "mode-scoped" | "tolerance";
|
|
|
26
26
|
interface FieldDiff {
|
|
27
27
|
/**
|
|
28
28
|
* Dotted path into the row, with array elements keyed by their own identity
|
|
29
|
-
* rather than by index, e.g. `
|
|
29
|
+
* rather than by index, e.g. `allowedDepositTokens[0xa0b8...].symbol`.
|
|
30
30
|
**/
|
|
31
31
|
path: string;
|
|
32
32
|
/**
|
|
@@ -74,7 +74,7 @@ interface EntityFieldDiff {
|
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* How often one field disagreed across all matched rows, with array keys
|
|
77
|
-
* collapsed, e.g. `
|
|
77
|
+
* collapsed, e.g. `allowedDepositTokens[].symbol`.
|
|
78
78
|
**/
|
|
79
79
|
interface DiffPathCount {
|
|
80
80
|
path: string;
|
|
@@ -165,7 +165,7 @@ declare function withExpected(diff: FieldDiff, reason: ExpectedDiffReason): Fiel
|
|
|
165
165
|
**/
|
|
166
166
|
declare function countPaths(diffs: Iterable<EntityFieldDiff>): DiffPathCount[];
|
|
167
167
|
/**
|
|
168
|
-
* Collapse `
|
|
168
|
+
* Collapse `allowedDepositTokens[0xa0b8...].symbol` to `allowedDepositTokens[].symbol`.
|
|
169
169
|
**/
|
|
170
170
|
declare function collapseArrayKeys(path: string): string;
|
|
171
171
|
/**
|
|
@@ -132,17 +132,11 @@ interface OpportunityBase {
|
|
|
132
132
|
**/
|
|
133
133
|
underlyingToken: Token;
|
|
134
134
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* (`pool.creditManagerBorrowed(creditManager)`).
|
|
135
|
+
* Tokens a user can transfer from their wallet to deposit into a pool
|
|
136
|
+
* position or to use when opening a credit account. They are not necessarily
|
|
137
|
+
* the pool underlying or credit-account collateral tokens.
|
|
139
138
|
**/
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Tokens accepted as collateral, i.e. the tokens that have both a non-zero
|
|
143
|
-
* liquidation threshold and a non-zero quota limit.
|
|
144
|
-
**/
|
|
145
|
-
collateralTokens: Token[];
|
|
139
|
+
allowedDepositTokens: Token[];
|
|
146
140
|
/**
|
|
147
141
|
* The contract's own pause flag: the pool for a {@link PoolOpportunity}, the
|
|
148
142
|
* credit facade or the pool it borrows from for a
|
|
@@ -150,8 +144,8 @@ interface OpportunityBase {
|
|
|
150
144
|
**/
|
|
151
145
|
paused: boolean;
|
|
152
146
|
/**
|
|
153
|
-
* Whether
|
|
154
|
-
*
|
|
147
|
+
* Whether one of the market's quoted tokens is a real-world-asset token.
|
|
148
|
+
* Read from a hardcoded per-chain list rather than from the chain.
|
|
155
149
|
**/
|
|
156
150
|
rwa: boolean;
|
|
157
151
|
/**
|
|
@@ -174,10 +168,9 @@ interface PoolOpportunity extends OpportunityBase {
|
|
|
174
168
|
**/
|
|
175
169
|
pool: Address;
|
|
176
170
|
/**
|
|
177
|
-
* Size of the pool:
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
* {@link OpportunityBase.totalBorrow}.
|
|
171
|
+
* Size of the pool: deposits plus accrued interest, i.e.
|
|
172
|
+
* `pool.expectedLiquidity`. Denominated in the underlying rather than in
|
|
173
|
+
* shares, so it is comparable with {@link totalBorrowedWithInterest}.
|
|
181
174
|
**/
|
|
182
175
|
totalSupply: Amount;
|
|
183
176
|
/**
|
|
@@ -185,11 +178,11 @@ interface PoolOpportunity extends OpportunityBase {
|
|
|
185
178
|
**/
|
|
186
179
|
availableLiquidity: Amount;
|
|
187
180
|
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
181
|
+
* Everything the pool has lent out plus accrued interest:
|
|
182
|
+
* `pool.expectedLiquidity - pool.availableLiquidity`. Denominated in the
|
|
183
|
+
* underlying.
|
|
191
184
|
**/
|
|
192
|
-
|
|
185
|
+
totalBorrowedWithInterest: Amount;
|
|
193
186
|
/**
|
|
194
187
|
* Yield earned by supplying to the pool.
|
|
195
188
|
*
|
|
@@ -226,6 +219,12 @@ interface StrategyOpportunity extends OpportunityBase {
|
|
|
226
219
|
* Collateral token the position is built around.
|
|
227
220
|
**/
|
|
228
221
|
targetCollateral: Token;
|
|
222
|
+
/**
|
|
223
|
+
* Debt principal this credit manager has drawn from the pool
|
|
224
|
+
* (`pool.creditManagerBorrowed(creditManager)`). Denominated in the
|
|
225
|
+
* underlying.
|
|
226
|
+
**/
|
|
227
|
+
totalBorrowed: Amount;
|
|
229
228
|
/**
|
|
230
229
|
* Liquidation threshold of {@link targetCollateral} in this credit manager,
|
|
231
230
|
* in basis points: the share of the collateral value that counts towards
|
|
@@ -310,7 +309,7 @@ interface StrategyOpportunity extends OpportunityBase {
|
|
|
310
309
|
totalValue?: Amount;
|
|
311
310
|
/**
|
|
312
311
|
* Share of {@link totalValue} that is borrowed, in basis points:
|
|
313
|
-
* `
|
|
312
|
+
* `totalBorrowed / totalValue`.
|
|
314
313
|
*
|
|
315
314
|
* Absent in `onchain` mode, because its denominator is, see
|
|
316
315
|
* {@link totalValue}.
|
|
@@ -499,19 +498,17 @@ interface QuotaAsset {
|
|
|
499
498
|
**/
|
|
500
499
|
used: Amount;
|
|
501
500
|
/**
|
|
502
|
-
*
|
|
503
|
-
* `used / Σ used` over every quota asset of the pool. Zero when nothing is
|
|
504
|
-
* quoted.
|
|
501
|
+
* TODO: add description
|
|
505
502
|
*
|
|
506
|
-
* @
|
|
503
|
+
* @mode offchain
|
|
507
504
|
**/
|
|
508
|
-
allocationShare
|
|
505
|
+
allocationShare?: Bps;
|
|
509
506
|
/**
|
|
510
|
-
*
|
|
511
|
-
*
|
|
512
|
-
*
|
|
507
|
+
* TODO: add description
|
|
508
|
+
*
|
|
509
|
+
* @mode offchain
|
|
513
510
|
**/
|
|
514
|
-
allocatedDebt
|
|
511
|
+
allocatedDebt?: Amount;
|
|
515
512
|
}
|
|
516
513
|
/**
|
|
517
514
|
* A price feed and the feeds it is composed of.
|