@gearbox-protocol/sdk 16.0.0-next.46 → 16.0.0-next.47
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/index.js +0 -2
- package/dist/cjs/onchain/market/MarketSuite.js +9 -1
- package/dist/cjs/onchain/market/credit/CreditSuite.js +1 -2
- package/dist/cjs/onchain/market/pool/PoolV310Contract.js +25 -0
- package/dist/cjs/onchain/pools/PoolService.js +5 -56
- package/dist/cjs/onchain/pools/index.js +0 -2
- package/dist/cjs/preview/preview/previewPoolPositionOperation.js +31 -12
- package/dist/cjs/preview/simulate/index.js +1 -1
- package/dist/cjs/preview/simulate/simulateOperation.js +1 -1
- package/dist/cjs/preview/simulate/simulatePoolOperation.js +2 -0
- package/dist/cjs/sdk/prepare/PrepareApi.js +5 -6
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/withdrawalUtils.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/index.js +2 -2
- package/dist/esm/onchain/market/MarketSuite.js +9 -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/credit/CreditSuite.js +1 -2
- package/dist/esm/onchain/market/pool/PoolV310Contract.js +26 -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/pools/PoolService.js +7 -56
- package/dist/esm/onchain/pools/index.js +2 -2
- package/dist/esm/onchain/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/esm/preview/preview/previewPoolPositionOperation.js +33 -14
- package/dist/esm/preview/simulate/index.js +1 -1
- package/dist/esm/preview/simulate/simulateOperation.js +1 -1
- package/dist/esm/preview/simulate/simulatePoolOperation.js +2 -2
- package/dist/esm/preview/trace/extractTransfers.js +1 -1
- package/dist/esm/sdk/prepare/PrepareApi.js +5 -6
- package/dist/types/model/positions.d.ts +4 -1
- package/dist/types/model/previews.d.ts +28 -12
- package/dist/types/onchain/index.d.ts +3 -3
- package/dist/types/onchain/market/MarketSuite.d.ts +6 -0
- package/dist/types/onchain/market/pool/PoolV310Contract.d.ts +12 -0
- package/dist/types/onchain/market/pool/types.d.ts +18 -0
- package/dist/types/onchain/pools/PoolService.d.ts +2 -29
- package/dist/types/onchain/pools/index.d.ts +3 -3
- package/dist/types/onchain/pools/types.d.ts +1 -40
- package/dist/types/preview/simulate/simulatePoolOperation.d.ts +18 -1
- package/dist/types/preview/simulate/types.d.ts +12 -4
- package/dist/types/sdk/prepare/types.d.ts +6 -4
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
2
2
|
import { AddressSet } from "../utils/AddressSet.js";
|
|
3
3
|
import "../constants/addresses.js";
|
|
4
|
-
import { PERCENTAGE_FACTOR
|
|
4
|
+
import { PERCENTAGE_FACTOR } from "../constants/math.js";
|
|
5
5
|
import "../constants/index.js";
|
|
6
6
|
import { hexEq } from "../utils/hex.js";
|
|
7
7
|
import "../utils/index.js";
|
|
@@ -29,25 +29,6 @@ function payoutCeiling(market) {
|
|
|
29
29
|
return market.priceOracle.toAmount(pool.underlying, pool.pool.availableLiquidity * LIQUIDITY_SAFETY_NUM / LIQUIDITY_SAFETY_DENOM);
|
|
30
30
|
}
|
|
31
31
|
var PoolService = class extends SDKConstruct {
|
|
32
|
-
/**
|
|
33
|
-
* {@inheritDoc IPoolsService.getShareBalance}
|
|
34
|
-
*/
|
|
35
|
-
async getShareBalance(props) {
|
|
36
|
-
return this.client.readContract({
|
|
37
|
-
address: this.sdk.marketRegister.findByPool(props.pool).pool.pool.address,
|
|
38
|
-
abi: ierc20Abi,
|
|
39
|
-
functionName: "balanceOf",
|
|
40
|
-
args: [props.wallet],
|
|
41
|
-
blockNumber: props.blockNumber
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* {@inheritDoc IPoolsService.sharesToUnderlying}
|
|
46
|
-
*/
|
|
47
|
-
sharesToUnderlying(pool, shares) {
|
|
48
|
-
const market = this.sdk.marketRegister.findByPool(pool);
|
|
49
|
-
return market.toUnderlyingAmount(shares * market.pool.pool.dieselRate / RAY);
|
|
50
|
-
}
|
|
51
32
|
/**
|
|
52
33
|
* {@inheritDoc IPoolsService.getDepositTokensIn}
|
|
53
34
|
*/
|
|
@@ -164,7 +145,7 @@ var PoolService = class extends SDKConstruct {
|
|
|
164
145
|
const { zapper } = this.getDepositMetadata(poolAddr, tokenIn, tokenOut);
|
|
165
146
|
return {
|
|
166
147
|
tokenIn: toTokenAmount(tokenIn, amount),
|
|
167
|
-
tokenOut: toTokenAmount(tokenOut,
|
|
148
|
+
tokenOut: toTokenAmount(tokenOut, pool.pool.underlyingToShares(amount)),
|
|
168
149
|
zapper: zapper?.baseParams.addr
|
|
169
150
|
};
|
|
170
151
|
}
|
|
@@ -184,7 +165,7 @@ var PoolService = class extends SDKConstruct {
|
|
|
184
165
|
});
|
|
185
166
|
const { zapper } = this.getWithdrawalMetadata(poolAddr, tokenIn, tokenOut);
|
|
186
167
|
return {
|
|
187
|
-
tokenIn: toTokenAmount(tokenIn,
|
|
168
|
+
tokenIn: toTokenAmount(tokenIn, pool.pool.underlyingToShares(amount * PERCENTAGE_FACTOR / (PERCENTAGE_FACTOR - pool.pool.withdrawFee), true)),
|
|
188
169
|
tokenOut: toTokenAmount(tokenOut, amount),
|
|
189
170
|
zapper: zapper?.baseParams.addr,
|
|
190
171
|
availableLiquidity: payoutCeiling(market)
|
|
@@ -207,7 +188,7 @@ var PoolService = class extends SDKConstruct {
|
|
|
207
188
|
const { zapper } = this.getWithdrawalMetadata(poolAddr, tokenIn, tokenOut);
|
|
208
189
|
return {
|
|
209
190
|
tokenIn: toTokenAmount(tokenIn, amount),
|
|
210
|
-
tokenOut: toTokenAmount(tokenOut,
|
|
191
|
+
tokenOut: toTokenAmount(tokenOut, pool.pool.sharesToUnderlying(amount) * (PERCENTAGE_FACTOR - pool.pool.withdrawFee) / PERCENTAGE_FACTOR),
|
|
211
192
|
zapper: zapper?.baseParams.addr,
|
|
212
193
|
availableLiquidity: payoutCeiling(market)
|
|
213
194
|
};
|
|
@@ -239,7 +220,7 @@ var PoolService = class extends SDKConstruct {
|
|
|
239
220
|
}
|
|
240
221
|
const poolContract = this.sdk.marketRegister.findByPool(pool).pool.pool;
|
|
241
222
|
if (meta.zapper instanceof IETHZapperContract || meta.zapper instanceof IERC20ZapperContract) {
|
|
242
|
-
const shares = mode === "withdraw" ?
|
|
223
|
+
const shares = mode === "withdraw" ? poolContract.underlyingToShares(amount * PERCENTAGE_FACTOR / (PERCENTAGE_FACTOR - poolContract.withdrawFee), true) : amount;
|
|
243
224
|
const tx = permit ? meta.zapper.redeemWithPermit(shares, wallet, permit.deadline, permit.v, permit.r, permit.s) : meta.zapper.redeem(shares, wallet);
|
|
244
225
|
return {
|
|
245
226
|
tx,
|
|
@@ -433,40 +414,10 @@ var PoolService = class extends SDKConstruct {
|
|
|
433
414
|
chainId: this.chainId,
|
|
434
415
|
pool: pool.address,
|
|
435
416
|
underlyingToken: market.underlyingToken,
|
|
436
|
-
netValue:
|
|
417
|
+
netValue: market.toUnderlyingAmount(pool.sharesToUnderlying(shares)),
|
|
437
418
|
apy: { organicApy: rayToBps(pool.supplyRate) }
|
|
438
419
|
};
|
|
439
420
|
}
|
|
440
421
|
};
|
|
441
|
-
/**
|
|
442
|
-
* Shares minted for `assets`, as `previewDeposit` would report them.
|
|
443
|
-
*
|
|
444
|
-
* Both directions convert through the diesel rate — underlying per RAY of
|
|
445
|
-
* shares — because that is the rate the pool itself divides by, and the only
|
|
446
|
-
* exact one the SDK holds: `totalAssets` is this rate multiplied out, so
|
|
447
|
-
* converting back through it costs a wei on large amounts. Rounds down, as
|
|
448
|
-
* minting does.
|
|
449
|
-
*/
|
|
450
|
-
function toShares(pool, assets) {
|
|
451
|
-
const { dieselRate } = pool;
|
|
452
|
-
return dieselRate === 0n ? assets : assets * RAY / dieselRate;
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
* Shares a withdrawal of `assets` burns, as `previewWithdraw` would report
|
|
456
|
-
* them: {@link toShares} rounded the other way, since the burn has to cover
|
|
457
|
-
* the payout the caller asked for.
|
|
458
|
-
*/
|
|
459
|
-
function toSharesUp(pool, assets) {
|
|
460
|
-
const { dieselRate } = pool;
|
|
461
|
-
return dieselRate === 0n ? assets : (assets * RAY + dieselRate - 1n) / dieselRate;
|
|
462
|
-
}
|
|
463
|
-
/**
|
|
464
|
-
* Underlying paid out for `shares`, as `previewRedeem` would report it:
|
|
465
|
-
* {@link toShares} run backwards, less the pool's withdrawal fee.
|
|
466
|
-
*/
|
|
467
|
-
function toAssets(pool, shares) {
|
|
468
|
-
const { dieselRate, withdrawFee } = pool;
|
|
469
|
-
return (dieselRate === 0n ? shares : shares * dieselRate / RAY) * (PERCENTAGE_FACTOR - withdrawFee) / PERCENTAGE_FACTOR;
|
|
470
|
-
}
|
|
471
422
|
//#endregion
|
|
472
|
-
export { PoolService
|
|
423
|
+
export { PoolService };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PoolService
|
|
1
|
+
import { PoolService } from "./PoolService.js";
|
|
2
2
|
import "./types.js";
|
|
3
|
-
export { PoolService
|
|
3
|
+
export { PoolService };
|
|
@@ -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";
|
|
@@ -1,28 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
2
|
+
import { sdkErr, sdkOk } from "../../model/result.js";
|
|
2
3
|
import "../../model/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import "../simulate/
|
|
4
|
+
import { asPreviewSimulationError } from "../simulate/errors.js";
|
|
5
|
+
import { amountsInOut, previewContract } from "../simulate/simulatePoolOperation.js";
|
|
5
6
|
//#region src/preview/preview/previewPoolPositionOperation.ts
|
|
6
7
|
async function previewPoolPositionOperation(input, operation, options) {
|
|
7
|
-
const { sdk
|
|
8
|
+
const { sdk } = input;
|
|
8
9
|
const { tokenIn, tokenOut } = operation;
|
|
9
10
|
const market = sdk.marketRegister.findByPool(operation.pool);
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const pool = market.pool.pool;
|
|
12
|
+
const holder = "owner" in operation ? operation.owner : operation.receiver;
|
|
13
|
+
let previewAmount;
|
|
14
|
+
let shares;
|
|
15
|
+
try {
|
|
16
|
+
[previewAmount, shares] = await sdk.client.multicall({
|
|
17
|
+
contracts: [previewContract(operation), {
|
|
18
|
+
address: operation.pool,
|
|
19
|
+
abi: ierc20Abi,
|
|
20
|
+
functionName: "balanceOf",
|
|
21
|
+
args: [holder]
|
|
22
|
+
}],
|
|
23
|
+
allowFailure: false,
|
|
24
|
+
batchSize: 0,
|
|
25
|
+
blockNumber: options?.blockNumber
|
|
26
|
+
});
|
|
27
|
+
} catch (cause) {
|
|
28
|
+
const error = asPreviewSimulationError(cause, "multicall");
|
|
29
|
+
options?.logger?.error(error, "pool operation simulation failed");
|
|
30
|
+
return sdkErr(error);
|
|
31
|
+
}
|
|
32
|
+
const sim = amountsInOut(operation, previewAmount);
|
|
33
|
+
const inflow = operation.operation === "Deposit" || operation.operation === "Mint";
|
|
34
|
+
const after = shares + (inflow ? sim.amountOut : -sim.amountIn);
|
|
18
35
|
return sdkOk({
|
|
19
36
|
operation: operation.operation,
|
|
20
37
|
pool: operation.pool,
|
|
21
38
|
name: sdk.tokensMeta.mustGetToken(operation.pool).name,
|
|
22
39
|
underlyingToken: market.underlyingToken,
|
|
23
|
-
shareRate:
|
|
40
|
+
shareRate: pool.dieselRate,
|
|
24
41
|
tokenIn: market.priceOracle.toTokenAmount(tokenIn, sim.amountIn),
|
|
25
|
-
tokenOut: market.priceOracle.toTokenAmount(tokenOut, sim.amountOut)
|
|
42
|
+
tokenOut: market.priceOracle.toTokenAmount(tokenOut, sim.amountOut),
|
|
43
|
+
curator: market.curator,
|
|
44
|
+
netValue: market.toUnderlyingAmount(pool.sharesToUnderlying(after > 0n ? after : 0n))
|
|
26
45
|
});
|
|
27
46
|
}
|
|
28
47
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { asPreviewSimulationError } from "./errors.js";
|
|
2
|
-
import { simulateFacadeOperation } from "./simulateFacadeOperation.js";
|
|
3
2
|
import { simulatePoolOperation } from "./simulatePoolOperation.js";
|
|
3
|
+
import { simulateFacadeOperation } from "./simulateFacadeOperation.js";
|
|
4
4
|
import { simulateRWAOperation } from "./simulateRWAOperation.js";
|
|
5
5
|
import { simulateOperation } from "./simulateOperation.js";
|
|
6
6
|
export { asPreviewSimulationError, simulateFacadeOperation, simulateOperation, simulatePoolOperation, simulateRWAOperation };
|
|
@@ -2,8 +2,8 @@ import { sdkOk } from "../../model/result.js";
|
|
|
2
2
|
import "../../model/index.js";
|
|
3
3
|
import { isPoolOperation, isRWAOperation } from "../parse/types.js";
|
|
4
4
|
import "../parse/index.js";
|
|
5
|
-
import { simulateFacadeOperation } from "./simulateFacadeOperation.js";
|
|
6
5
|
import { simulatePoolOperation } from "./simulatePoolOperation.js";
|
|
6
|
+
import { simulateFacadeOperation } from "./simulateFacadeOperation.js";
|
|
7
7
|
import { simulateRWAOperation } from "./simulateRWAOperation.js";
|
|
8
8
|
//#region src/preview/simulate/simulateOperation.ts
|
|
9
9
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { iZapperAbi } from "../../abi/iZapper.js";
|
|
2
1
|
import { iPoolV310Abi } from "../../abi/310/generated.js";
|
|
3
2
|
import { sdkErr, sdkOk } from "../../model/result.js";
|
|
4
3
|
import "../../model/index.js";
|
|
4
|
+
import { iZapperAbi } from "../../abi/iZapper.js";
|
|
5
5
|
import { asPreviewSimulationError } from "./errors.js";
|
|
6
6
|
//#region src/preview/simulate/simulatePoolOperation.ts
|
|
7
7
|
function previewRead(operation) {
|
|
@@ -103,4 +103,4 @@ async function simulatePoolOperation(input, options = {}) {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
|
-
export { simulatePoolOperation };
|
|
106
|
+
export { amountsInOut, previewContract, simulatePoolOperation };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
2
1
|
import { iCreditFacadeV310Abi } from "../../abi/310/generated.js";
|
|
2
|
+
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
3
3
|
import { AddressMap } from "../../onchain/utils/AddressMap.js";
|
|
4
4
|
import "../../onchain/index.js";
|
|
5
5
|
import { UnexpectedFacadeEventOrderError } from "./errors.js";
|
|
@@ -551,14 +551,13 @@ function routed(result, at) {
|
|
|
551
551
|
* a screen can show.
|
|
552
552
|
**/
|
|
553
553
|
async function lpState(sdk, pool, wallet, simulation, moved) {
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
}) + (moved.mints ?? -moved.burns);
|
|
554
|
+
const market = sdk.marketRegister.findByPool(pool);
|
|
555
|
+
const poolContract = market.pool.pool;
|
|
556
|
+
const after = await poolContract.getShareBalance(wallet) + (moved.mints ?? -moved.burns);
|
|
558
557
|
return {
|
|
559
558
|
...simulation,
|
|
560
|
-
curator:
|
|
561
|
-
|
|
559
|
+
curator: market.curator,
|
|
560
|
+
netValue: market.toUnderlyingAmount(poolContract.sharesToUnderlying(after > 0n ? after : 0n))
|
|
562
561
|
};
|
|
563
562
|
}
|
|
564
563
|
/**
|
|
@@ -122,7 +122,10 @@ interface PoolPosition {
|
|
|
122
122
|
underlyingToken: UnderlyingToken;
|
|
123
123
|
/**
|
|
124
124
|
* Underlying the held shares are worth at the current share rate, i.e.
|
|
125
|
-
* `pool.
|
|
125
|
+
* `pool.sharesToUnderlying(pool.getShareBalance(wallet))`.
|
|
126
|
+
*
|
|
127
|
+
* Does not account for withdraw fee: this is what the shares are worth,
|
|
128
|
+
* not what leaving with them would pay.
|
|
126
129
|
**/
|
|
127
130
|
netValue: TokenAmount;
|
|
128
131
|
/**
|
|
@@ -120,23 +120,24 @@ interface PoolPositionOperationPreview {
|
|
|
120
120
|
*/
|
|
121
121
|
underlyingToken: UnderlyingToken;
|
|
122
122
|
/**
|
|
123
|
-
* Token that goes from user to pool
|
|
124
|
-
* In case of deposit, underlying for direct deposit, zapper input for zapper-routed deposit
|
|
125
|
-
* In case of withdraw, pool shares (diesel token) for direct withdraw or zapper token out
|
|
123
|
+
* Token that goes from user to pool.
|
|
124
|
+
* In case of deposit, underlying for direct deposit, zapper input for zapper-routed deposit.
|
|
125
|
+
* In case of withdraw, pool shares (diesel token) for direct withdraw or zapper token out.
|
|
126
126
|
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
127
|
+
* On withdraw, this is the amount of shares burend that covers both the requested payout
|
|
128
|
+
* and the fee.
|
|
129
|
+
*
|
|
130
|
+
* On redeem this is the shares from calldata, fee-free.
|
|
130
131
|
*/
|
|
131
132
|
tokenIn: TokenAmount;
|
|
132
133
|
/**
|
|
133
|
-
* Token that goes from pool to user
|
|
134
|
-
* In case of deposit, pool shares (diesel token) for direct deposit or zapper token out
|
|
135
|
-
* In case of withdraw, underlying for direct withdraw or zapper token in
|
|
134
|
+
* Token that goes from pool to user.
|
|
135
|
+
* In case of deposit, pool shares (diesel token) for direct deposit or zapper token out.
|
|
136
|
+
* In case of withdraw, underlying for direct withdraw or zapper token in.
|
|
136
137
|
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
138
|
+
* On withdraw this is the requested underlying.
|
|
139
|
+
* On redeem this is the underlying after `withdrawFee`, so less than
|
|
140
|
+
* the burned shares are worth.
|
|
140
141
|
*/
|
|
141
142
|
tokenOut: TokenAmount;
|
|
142
143
|
/**
|
|
@@ -144,6 +145,21 @@ interface PoolPositionOperationPreview {
|
|
|
144
145
|
* (`1e27`).
|
|
145
146
|
*/
|
|
146
147
|
shareRate: bigint;
|
|
148
|
+
/**
|
|
149
|
+
* Curator of the market this pool belongs to
|
|
150
|
+
*/
|
|
151
|
+
curator: Curator;
|
|
152
|
+
/**
|
|
153
|
+
* Remaining LP after this transaction: the same quantity
|
|
154
|
+
* {@link PoolPosition.netValue} reports for a live position, denominated in
|
|
155
|
+
* the market's unwrapped underlying. For RWA markets this is USDC rather than
|
|
156
|
+
* dcUSDC (the pool's on-chain underlying) or diesel shares.
|
|
157
|
+
*
|
|
158
|
+
* Does not account for withdraw fee: this is what the remaining shares are worth, not
|
|
159
|
+
* what leaving with them would pay. The fee shows up on {@link tokenIn} /
|
|
160
|
+
* {@link tokenOut} instead.
|
|
161
|
+
*/
|
|
162
|
+
netValue: TokenAmount;
|
|
147
163
|
/**
|
|
148
164
|
* Set when preview encountered non-fatal errors, all fields are
|
|
149
165
|
* still computed best-effort
|
|
@@ -196,8 +196,8 @@ import { MultichainOpportunitiesService } from "./opportunities/MultichainOpport
|
|
|
196
196
|
import { OpportunitiesService } from "./opportunities/OpportunitiesService.js";
|
|
197
197
|
import "./opportunities/index.js";
|
|
198
198
|
import { ContractMethod, IPriceUpdateTx, MultiCall, RawTx } from "./types/transactions.js";
|
|
199
|
-
import { AddLiquidityProps, DepositMetadata, IPoolsService, ListPoolPositionsProps, MarketType, PoolServiceCall, PoolServiceCallResult,
|
|
200
|
-
import { PoolService
|
|
199
|
+
import { AddLiquidityProps, DepositMetadata, IPoolsService, ListPoolPositionsProps, MarketType, PoolServiceCall, PoolServiceCallResult, PoolSimulation, RemoveLiquidityProps, SimulatePoolOperationProps, WithdrawalMetadata } from "./pools/types.js";
|
|
200
|
+
import { PoolService } from "./pools/PoolService.js";
|
|
201
201
|
import "./pools/index.js";
|
|
202
202
|
import { AccountSnapshot, GetCurrentWithdrawalsProps, GetCurrentWithdrawalsPropsBase, IMultichainPositionsService, ListPositionsProps, ListPositionsPropsBase, ListStrategyPositionsProps, accountSnapshotFromCreditAccountData } from "./positions/types.js";
|
|
203
203
|
import { CalcBorrowRateProps, calcBorrowRate } from "./positions/calcBorrowRate.js";
|
|
@@ -273,4 +273,4 @@ import { SDKOptions, attachOptionsSchema, onchainSDKOptionsSchema } from "./opti
|
|
|
273
273
|
import { MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_SAFE_HEALTH_FACTOR_FORM, amountOf, checkBorrowLimit, checkCollateralised, checkCreditManagerPaused, checkDebtInBand, checkForbiddenToken, checkFunding, checkLeverageAtLeastOne, checkMarketExpired, checkPoolPaused, checkPoolPayout, checkPoolSunset, checkPreviewError, checkQuotaCount, checkQuotaLimit, isMalformedPreviewError } from "./validation/checks.js";
|
|
274
274
|
import { toToken, toTokenAmount } from "./validation/token.js";
|
|
275
275
|
import "./validation/index.js";
|
|
276
|
-
export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_RWA_COMPRESSOR, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, type AccountCalculatorOperation, AccountMigratorAdapterContract, AccountSnapshot, AccountToCheck, AdapterContractStateHuman, AdapterContractType, AdapterData, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, type AddCollateralIntent, AddLiquidityProps, AddressMap, AddressProviderAddresses, AddressProviderState, AddressProviderV310Contract, type AddressProviderV3StateHuman, AddressSet, type AdjustLeverageIntent, type AliasLossPolicyStateHuman, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, AssertAssignable, Asset, type AssetPriceFeedStateHuman, AssetWithAmountInTarget, AssetsMap, AttachOptions, BLOCKS_PER_WEEK_BY_NETWORK, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, BaseContractArgs, type BaseContractStateHuman, BaseParams, BasePlugin, type BasePriceFeedStateHuman, BaseState, BasicSwapCall, BigIntMath, type BlockNumberProps, type BorrowLimitBinding, type BotListStateHuman, BotPermissions, BotStatusCall, BotsDirectResponse, type BoundedOracleStateHuman, BoundedPriceFeedContract, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, CalcBorrowRateProps, CalcDefaultQuotaProps, CalcHealthFactorProps, CalcLiquidationPriceForTargetProps, CalcLiquidationPriceProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, CallTrace, CamelotPool, CamelotV3AdapterContract, ChainBlock, ChainBlockPin, ChainBlockSource, ChainConfig, ChainContractsRegister, ChainNotConfiguredError, ChainQueryOneProps, ChainQueryProps, ClaimFarmRewardsProps, type ClaimRemainder, ClaimableWithdrawal, ClientOptions, CloseCreditAccountResult, ClosePathBalances, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConnectedBotData, ConnectedBotsCall, ConnectedBotsPerAccount, type ConstantOracleStateHuman, Construct, ConstructOptions, type ContractMethod, ContractOrInterface, ContractParseError, ContractParseErrorOptions, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, type CoreStateHuman, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountData, CreditAccountDataCall, CreditAccountDataPayload, CreditAccountFilter, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountTokenQuota, CreditAccountTokensSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV310Contract, CreditFacadeState, type CreditFacadeStateHuman, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerDebtParams, type CreditManagerDebtParamsHuman, CreditManagerFilter, CreditManagerOperationResult, CreditManagerState, type CreditManagerStateHuman, CreditManagerV310Contract, CreditSuite, CreditSuiteState, type CreditSuiteStateHuman, CurrentWithdrawals, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DStokenData, DUST_THRESHOLD, DaiUsdsAdapterContract, type DelayableIntent, DelayedIntentExtended, type DelayedRoute, type DelayedStart, type DelayedStartResult, DelayedWithdrawalClaim, DelayedWithdrawalRequest, DelegatedMulticall, DepositMetadata, type DepositStrategyIntent, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, EncodableCreditAccountOperation, Erc4626PriceFeedContract, EstimateRawTxGasParameters, EtherscanURLParam, ExecuteMulticallBatchesOptions, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, type FetchRedstonePayloadsOptions, FilterDustUSDOptions, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, type FinishIntentProps, type FinishIntentResult, FluidDexAdapterContract, FormatBNOptions, FullyLiquidateProps, FullyLiquidateResult, GaugeContract, GaugeData, GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, type GearStakingV3StateHuman, GearboxChain, type GearboxState, type GearboxStateHuman, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetCurrentWithdrawalsProps, GetCurrentWithdrawalsPropsBase, GetExternalAccountCurrentWithdrawalsProps, GetInvestorOptions, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetOpenAccountRequirementsProps, GetReward, GetWithdrawalRequestResultProps, HydrateOptions, IAdapterContract, IAddressProviderContract, IBaseContract, ICreditAccountsService, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, type ILogger, IMultichainOpportunitiesService, IMultichainPositionsService, IOnchainSDKPlugin, IOnchainSDKPluginConstructor, IPluginState, IPoolContract, IPoolsService, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTx, IRWAFactory, IRateKeeperContract, IRedemptionLoggerContract, IRouterContract, IUpdatablePriceFeedContract, IWithdrawalCompressorContract, IZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, type InterestRateModelStateHuman, InterestRateModelType, InvalidDelayedIntentError, IsDustOptions, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LPMonopolizedPoolMeta, type LPPriceFeedStateHuman, LatestUpdate, LegacyAdapterOperation, type LeverageBand, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, type LinearInterestRateModelStateHuman, LiquidationFees, LiquidationsService, ListPoolPositionsProps, ListPositionsProps, ListPositionsPropsBase, ListStrategyPositionsProps, LoadRWALiquidatorsProps, type LogFn, type LossPolicyStateHuman, MAX_INT, MAX_LEVERAGE_BUFFER_BPS, MAX_UINT16, MAX_UINT256, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_INT96, MIN_SAFE_HEALTH_FACTOR_FORM, MULTICALL_ADDRESS, MakerDeposit, MakerRedeem, MarketData, MarketFilter, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, type MarketStateHuman, MarketSuite, MarketType, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, Methods, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, type MultiCall, MulticallBatch, MulticallWithFailure, MultichainAttachOptions, type MultichainChainIdsProps, MultichainConstruct, MultichainHydrateOptions, MultichainLiquidationsService, type MultichainNetworkProps, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, MultichainSDKOptions, type MultichainState, type MultichainStateHuman, MultichainSyncStateOptions, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OnchainSDK, OnchainSDKOptions, OpenCAProps, OpenStrategyPreviewResult, type OpenStrategyProps, OpenStrategyResult, type OpenStrategyState, type OperationState, OpportunitiesService, OptimalRepaidAmountProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, ParsedCall, ParsedCallArgs, ParsedCallV2, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PartialRecord, PartiallyLiquidateProps, type PathLossRate, PendingWithdrawal, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PeripheryContract, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PickSomeRequired, PluginFactoriesMap, PluginFactory, PluginState, PluginStateVersionError, PluginStatesMap, PluginsMap, PoolQuotaKeeperContract, type PoolQuotaKeeperStateHuman, PoolService, PoolServiceCall, PoolServiceCallResult, PoolShareBalanceProps, PoolSimulation, PoolState, type PoolStateHuman, PoolSuite, type PoolSuiteStateHuman, PoolV310Contract, PositionsService, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, type PreviewErrorDetails, type PreviewErrorReason, type PreviewIssue, type PreviewRefusal, PriceFeedAnswer, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, PriceFeedRegisterHooks, PriceFeedRegisterOptions, type PriceFeedStateHuman, PriceFeedTreeNode, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleData, type PriceOracleStateHuman, PriceOracleV310Contract, PriceUpdate, ProjectedPoolOptions, PythPriceFeed, QuotaKeeperState, QuotaMode, type QuotaParamsHuman, QuotaSlice, QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWADefaultTokenMeta, RWAFactoryData, RWAFactoryStateHuman, RWAFactoryType, RWAInvestorData, RWALiquidatorInfo, RWAMissingOpenAccountRequirements, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWAOpenAccountRequirements, RWAOperationArgs, RWARegistry, RWAState, RWAStateHuman, RWATokenMeta, RWAUnderlyingContractType, RWAUnderlyingData, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RampEvent, RateKeeperState, type RateKeeperStateHuman, RateKeeperType, type RawTx, RedemptionLog, RedemptionLoggerV310Contract, RedemptionPhantomRename, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, RelaxedBaseParams, RemoveLiquidityProps, type RepayStrategyIntent, RequestableWithdrawal, type ResumableIntent, RetryOptions, RewardInfo, Rewards, type RouteRefusals, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SDKConstruct, SDKOptions, SECONDS_PER_YEAR, SECURITIZE_REGISTER_VAULT_TYPES, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeCreditAccountData, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeMissingOpenAccountRequirements, SecuritizeOnRampAdapterContract, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, SendRawTxParameters, SetBotProps, SetBotResult, SimpleTokenMeta, SimulateCallOptions, SimulateCallParameters, SimulateCallReturnType, SimulateMulticallParameters, SimulateMulticallReturnType, SimulatePoolOperationProps, SimulateWithPriceUpdatesError, SimulateWithPriceUpdatesErrorParams, SimulateWithPriceUpdatesErrorType, SimulateWithPriceUpdatesParameters, SimulateWithPriceUpdatesReturnType, SimulationError, SimulationErrorType, StakingRewardsAdapterContract, type StartIntent, StrategyCollateralProps, StrategyRateInputs, SupportedValue, Swap, SwapOperation, SyncStateOptions, type TimestampedCalldata, TokenAmount, TokenInfo, TokenMetaData, TokensMeta, TokensMetaState, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, type TumblerStateHuman, TypedObjectUtils, Unarray, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UnsupportedZapperFunctionError, UpdatePriceFeedsResult, UpshiftVaultAdapterContract, VERSION_RANGE_310, VaultDeposit, VelodromeV2RouterAdapterContract, VersionRange, VersionedAbi, VotingContractStatus, WAD, WAD_DECIMALS_POW, WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, type WithBlock, type WithMultichain, type WithdrawAssetIntent, type WithdrawCeilings, WithdrawCollateral, type WithdrawStrategyIntent, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalMetadata, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, accountSnapshotFromCreditAccountData, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, amountOf, assetsMap, attachOptionsSchema, borrowable, botPermissionsToString, bpsToRay, bytes32ToString, calcBorrowApy, calcBorrowRate, calcDefaultQuota, calcEffectiveBorrowApy, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcQuotaUpdate, calcRecommendedQuota, calcTimeToLiquidationMs, calcUtilization, calcUtilizationRaw, chains, checkBorrowLimit, checkCollateralised, checkCreditManagerPaused, checkDebtInBand, checkForbiddenToken, checkFunding, checkLeverageAtLeastOne, checkMarketExpired, checkPoolPaused, checkPoolPayout, checkPoolSunset, checkPreviewError, checkQuotaCount, checkQuotaLimit, childLogger, classifyCurveOperation, collateralPriceInUnderlying, collectTraces, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, decodeDelayedIntent, detectNetwork, dominantCollateral, encodeDelayedIntent, erc4626ReferralAdapterAbi, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, executeMulticallBatches, expectedBalanceDeltas, fetchCreditAccountSlice, fetchRedstonePayloads, filterDust, filterDustUSD, findCallTo, findCallWithInput, findCuratorMarketConfigurator, findExecuteBytes, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAccountTargetCollateral, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getLegacyStrategyTarget, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hasAdapterDeployParamsAbi, healthFactorBps, hexEq, hydrateAddressProvider, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCreditAccountAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isDust, isLPPriceFeed, isMalformedPreviewError, isPhantomToken, isPublicNetwork, isRWAFactory, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, isZeroBalance, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, percentFmt, pickStrategyTargetCollateral, raise, rayToBps, rayToNumber, refuse, resolveProtocolCall, retry, rewardsFromTransfers, roundUpQuota, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, soleNonUnderlyingCollateral, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toShares, toSharesUp, toSignificant, toToken, toTokenAmount, toWithdrawalStatus, usdToNumber, watchBlocksAsync };
|
|
276
|
+
export { ADDRESS_0X0, ADDRESS_PROVIDER_V310, AP_ACCOUNT_FACTORY, AP_ACL, AP_BOT_LIST, AP_BYTECODE_REPOSITORY, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_CREDIT_SUITE_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GAUGE_COMPRESSOR, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_PARTIAL_LIQUIDATION_BOT, AP_PERIPHERY_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_FEED_STORE, AP_PRICE_ORACLE, AP_REDEMPTION_LOGGER, AP_REWARDS_COMPRESSOR, AP_ROUTER, AP_RWA_COMPRESSOR, AP_TOKEN_COMPRESSOR, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AbstractWithdrawalCompressorContract, AccountBotsService, type AccountCalculatorOperation, AccountMigratorAdapterContract, AccountSnapshot, AccountToCheck, AdapterContractStateHuman, AdapterContractType, AdapterData, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, type AddCollateralIntent, AddLiquidityProps, AddressMap, AddressProviderAddresses, AddressProviderState, AddressProviderV310Contract, type AddressProviderV3StateHuman, AddressSet, type AdjustLeverageIntent, type AliasLossPolicyStateHuman, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, AssertAssignable, Asset, type AssetPriceFeedStateHuman, AssetWithAmountInTarget, AssetsMap, AttachOptions, BLOCKS_PER_WEEK_BY_NETWORK, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, BaseContractArgs, type BaseContractStateHuman, BaseParams, BasePlugin, type BasePriceFeedStateHuman, BaseState, BasicSwapCall, BigIntMath, type BlockNumberProps, type BorrowLimitBinding, type BotListStateHuman, BotPermissions, BotStatusCall, BotsDirectResponse, type BoundedOracleStateHuman, BoundedPriceFeedContract, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, CalcBorrowRateProps, CalcDefaultQuotaProps, CalcHealthFactorProps, CalcLiquidationPriceForTargetProps, CalcLiquidationPriceProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, CallTrace, CamelotPool, CamelotV3AdapterContract, ChainBlock, ChainBlockPin, ChainBlockSource, ChainConfig, ChainContractsRegister, ChainNotConfiguredError, ChainQueryOneProps, ChainQueryProps, ClaimFarmRewardsProps, type ClaimRemainder, ClaimableWithdrawal, ClientOptions, CloseCreditAccountResult, ClosePathBalances, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConnectedBotData, ConnectedBotsCall, ConnectedBotsPerAccount, type ConstantOracleStateHuman, Construct, ConstructOptions, type ContractMethod, ContractOrInterface, ContractParseError, ContractParseErrorOptions, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, type CoreStateHuman, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountData, CreditAccountDataCall, CreditAccountDataPayload, CreditAccountFilter, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountTokenQuota, CreditAccountTokensSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV310Contract, CreditFacadeState, type CreditFacadeStateHuman, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerDebtParams, type CreditManagerDebtParamsHuman, CreditManagerFilter, CreditManagerOperationResult, CreditManagerState, type CreditManagerStateHuman, CreditManagerV310Contract, CreditSuite, CreditSuiteState, type CreditSuiteStateHuman, CurrentWithdrawals, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, DStokenData, DUST_THRESHOLD, DaiUsdsAdapterContract, type DelayableIntent, DelayedIntentExtended, type DelayedRoute, type DelayedStart, type DelayedStartResult, DelayedWithdrawalClaim, DelayedWithdrawalRequest, DelegatedMulticall, DepositMetadata, type DepositStrategyIntent, ERC4626AdapterContract, ERC4626ReferralAdapterContract, EXECUTE_BYTES_SELECTOR, EncodableCreditAccountOperation, Erc4626PriceFeedContract, EstimateRawTxGasParameters, EtherscanURLParam, ExecuteMulticallBatchesOptions, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, type FetchRedstonePayloadsOptions, FilterDustUSDOptions, FindBestClosePathProps, FindClaimAllRewardsProps, FindManyToOnePathProps, FindOneTokenPathProps, FindOpenStrategyPathProps, type FinishIntentProps, type FinishIntentResult, FluidDexAdapterContract, FormatBNOptions, FullyLiquidateProps, FullyLiquidateResult, GaugeContract, GaugeData, GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, type GearStakingV3StateHuman, GearboxChain, type GearboxState, type GearboxStateHuman, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetCurrentWithdrawalsProps, GetCurrentWithdrawalsPropsBase, GetExternalAccountCurrentWithdrawalsProps, GetInvestorOptions, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetOpenAccountRequirementsProps, GetReward, GetWithdrawalRequestResultProps, HydrateOptions, IAdapterContract, IAddressProviderContract, IBaseContract, ICreditAccountsService, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, type ILogger, IMultichainOpportunitiesService, IMultichainPositionsService, IOnchainSDKPlugin, IOnchainSDKPluginConstructor, IPluginState, IPoolContract, IPoolsService, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTx, IRWAFactory, IRateKeeperContract, IRedemptionLoggerContract, IRouterContract, IUpdatablePriceFeedContract, IWithdrawalCompressorContract, IZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, type InterestRateModelStateHuman, InterestRateModelType, InvalidDelayedIntentError, IsDustOptions, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LEVERAGE_DECIMALS, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, LPMonopolizedPoolMeta, type LPPriceFeedStateHuman, LatestUpdate, LegacyAdapterOperation, type LeverageBand, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, type LinearInterestRateModelStateHuman, LiquidationFees, LiquidationsService, ListPoolPositionsProps, ListPositionsProps, ListPositionsPropsBase, ListStrategyPositionsProps, LoadRWALiquidatorsProps, type LogFn, type LossPolicyStateHuman, MAX_INT, MAX_LEVERAGE_BUFFER_BPS, MAX_UINT16, MAX_UINT256, MIN_HEALTH_FACTOR_FACADE, MIN_HEALTH_FACTOR_FORM, MIN_HF_LIMITED, MIN_INT96, MIN_SAFE_HEALTH_FACTOR_FORM, MULTICALL_ADDRESS, MakerDeposit, MakerRedeem, MarketData, MarketFilter, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, type MarketStateHuman, MarketSuite, MarketType, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, Methods, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, MissingSerializedParamsError, type MultiCall, MulticallBatch, MulticallWithFailure, MultichainAttachOptions, type MultichainChainIdsProps, MultichainConstruct, MultichainHydrateOptions, MultichainLiquidationsService, type MultichainNetworkProps, MultichainOpportunitiesService, MultichainPositionsService, MultichainSDK, MultichainSDKOptions, type MultichainState, type MultichainStateHuman, MultichainSyncStateOptions, NATIVE_ADDRESS, NON_STRATEGY_PHANTOM_TOKEN_TYPES, NOT_DEPLOYED, NO_VERSION, NetworkType, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OnchainSDK, OnchainSDKOptions, OpenCAProps, OpenStrategyPreviewResult, type OpenStrategyProps, OpenStrategyResult, type OpenStrategyState, type OperationState, OpportunitiesService, OptimalRepaidAmountProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PERCENTAGE_FACTOR_1KK, PERIPHERY_CONTRACTS, PHANTOM_TOKEN_CONTRACT_TYPES, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, PRICE_DECIMALS, PRICE_DECIMALS_POW, ParsedCall, ParsedCallArgs, ParsedCallV2, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PartialRecord, PartiallyLiquidateProps, type PathLossRate, PendingWithdrawal, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PeripheryCompressorV310Contract, PeripheryContract, PermitResult, PhantomTokenContractType, PhantomTokenMeta, PickSomeRequired, PluginFactoriesMap, PluginFactory, PluginState, PluginStateVersionError, PluginStatesMap, PluginsMap, PoolQuotaKeeperContract, type PoolQuotaKeeperStateHuman, PoolService, PoolServiceCall, PoolServiceCallResult, PoolSimulation, PoolState, type PoolStateHuman, PoolSuite, type PoolSuiteStateHuman, PoolV310Contract, PositionsService, PrepareUpdateQuotasProps, PreviewDelayedWithdrawalProps, type PreviewErrorDetails, type PreviewErrorReason, type PreviewIssue, type PreviewRefusal, PriceFeedAnswer, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, PriceFeedRegisterHooks, PriceFeedRegisterOptions, type PriceFeedStateHuman, PriceFeedTreeNode, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleData, type PriceOracleStateHuman, PriceOracleV310Contract, PriceUpdate, ProjectedPoolOptions, PythPriceFeed, QuotaKeeperState, QuotaMode, type QuotaParamsHuman, QuotaSlice, QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWADefaultTokenMeta, RWAFactoryData, RWAFactoryStateHuman, RWAFactoryType, RWAInvestorData, RWALiquidatorInfo, RWAMissingOpenAccountRequirements, RWAOnDemandLPMeta, RWAOnDemandLPMonopolizedMeta, RWAOnDemandLpContractType, RWAOnDemandTokenMeta, RWAOpenAccountRequirements, RWAOperationArgs, RWARegistry, RWAState, RWAStateHuman, RWATokenMeta, RWAUnderlyingContractType, RWAUnderlyingData, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RWA_ON_DEMAND_LP_MONOPOLIZED, RWA_UNDERLYING_DEFAULT, RWA_UNDERLYING_ON_DEMAND, RampEvent, RateKeeperState, type RateKeeperStateHuman, RateKeeperType, type RawTx, RedemptionLog, RedemptionLoggerV310Contract, RedemptionPhantomRename, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, RelaxedBaseParams, RemoveLiquidityProps, type RepayStrategyIntent, RequestableWithdrawal, type ResumableIntent, RetryOptions, RewardInfo, Rewards, type RouteRefusals, RouterCASlice, RouterCMSlice, RouterCloseResult, RouterResult, RouterRewardsResult, RouterV310Contract, SDKConstruct, SDKOptions, SECONDS_PER_YEAR, SECURITIZE_REGISTER_VAULT_TYPES, SLIPPAGE_DECIMALS, STATE_VERSION, SUPPORTED_NETWORKS, SdkAlreadyAttachedError, SdkChainMismatchError, SdkMissingChainStateError, SdkNotAttachedError, SdkRWADataNotLoadedError, SdkStateVersionMismatchError, SdkSyncFailedError, SecuritizeCreditAccountData, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeMissingOpenAccountRequirements, SecuritizeOnRampAdapterContract, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, SendRawTxParameters, SetBotProps, SetBotResult, SimpleTokenMeta, SimulateCallOptions, SimulateCallParameters, SimulateCallReturnType, SimulateMulticallParameters, SimulateMulticallReturnType, SimulatePoolOperationProps, SimulateWithPriceUpdatesError, SimulateWithPriceUpdatesErrorParams, SimulateWithPriceUpdatesErrorType, SimulateWithPriceUpdatesParameters, SimulateWithPriceUpdatesReturnType, SimulationError, SimulationErrorType, StakingRewardsAdapterContract, type StartIntent, StrategyCollateralProps, StrategyRateInputs, SupportedValue, Swap, SwapOperation, SyncStateOptions, type TimestampedCalldata, TokenAmount, TokenInfo, TokenMetaData, TokensMeta, TokensMetaState, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, type TumblerStateHuman, TypedObjectUtils, Unarray, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UnsupportedZapperFunctionError, UpdatePriceFeedsResult, UpshiftVaultAdapterContract, VERSION_RANGE_310, VaultDeposit, VelodromeV2RouterAdapterContract, VersionRange, VersionedAbi, VotingContractStatus, WAD, WAD_DECIMALS_POW, WatchBlocksAsyncParameters, WatchBlocksAsyncReturnType, type WithBlock, type WithMultichain, type WithdrawAssetIntent, type WithdrawCeilings, WithdrawCollateral, type WithdrawStrategyIntent, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalMetadata, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, ZodAddress, ZodBigInt, ZodHex, accountSnapshotFromCreditAccountData, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, amountOf, assetsMap, attachOptionsSchema, borrowable, botPermissionsToString, bpsToRay, bytes32ToString, calcBorrowApy, calcBorrowRate, calcDefaultQuota, calcEffectiveBorrowApy, calcHealthFactor, calcLiquidationPrice, calcLiquidationPriceForTarget, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcQuotaUpdate, calcRecommendedQuota, calcTimeToLiquidationMs, calcUtilization, calcUtilizationRaw, chains, checkBorrowLimit, checkCollateralised, checkCreditManagerPaused, checkDebtInBand, checkForbiddenToken, checkFunding, checkLeverageAtLeastOne, checkMarketExpired, checkPoolPaused, checkPoolPayout, checkPoolSunset, checkPreviewError, checkQuotaCount, checkQuotaLimit, childLogger, classifyCurveOperation, collateralPriceInUnderlying, collectTraces, createAdapter, createAddressProvider, createPriceOracle, createRawTx, createRedemptionLogger, createRouter, createWithdrawalCompressor, createZapper, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, decodeDelayedIntent, detectNetwork, dominantCollateral, encodeDelayedIntent, erc4626ReferralAdapterAbi, estimateRawTxGas, etherscanApiUrl, etherscanUrl, executeDelegatedMulticalls, executeMulticallBatches, expectedBalanceDeltas, fetchCreditAccountSlice, fetchRedstonePayloads, filterDust, filterDustUSD, findCallTo, findCallWithInput, findCuratorMarketConfigurator, findExecuteBytes, fmtBinaryMask, fnSigToName, formatBN, formatBNvalue, formatDuration, formatLeverage, formatNumberToString_, formatPercentage, formatTimestamp, functionArgsToMap, functionArgsToRecord, generateCastTraceCall, getAccountTargetCollateral, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getAssetType, getCastTraceArgs, getChain, getCuratorName, getFunctionSignature, getLegacyStrategyTarget, getNetworkType, getRawPriceUpdates, getSimulateWithPriceUpdatesError, getWithdrawalCompressorAddress, halfRAY, hasAdapterDeployParamsAbi, healthFactorBps, hexEq, hydrateAddressProvider, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCreditAccountAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isDust, isLPPriceFeed, isMalformedPreviewError, isPhantomToken, isPublicNetwork, isRWAFactory, isRWAToken, isStrategyCollateral, isSunsetPool, isSunsetStrategy, isSupportedNetwork, isUpdatablePriceFeed, isV310, isVersionRange, isZeroBalance, iwstETHAbi, iwstEthv1AdapterAbi, json_parse, json_stringify, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, numberWithCommas, onchainSDKOptionsSchema, optimalHFForPartialLiquidation, optimalRepaidAmount, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, percentFmt, pickStrategyTargetCollateral, raise, rayToBps, rayToNumber, refuse, resolveProtocolCall, retry, rewardsFromTransfers, roundUpQuota, sendRawTx, shortAddress, shortHash, simulateCall, simulateMulticall, simulateWithPriceUpdates, soleNonUnderlyingCollateral, strategyName, swapFromTransfers, toAddress, toBN, toBigInt, toChainIds, toClaimableWithdrawal, toCreditAccountSlice, toNetTransfers, toPendingWithdrawal, toRequestableWithdrawal, toSignificant, toToken, toTokenAmount, toWithdrawalStatus, usdToNumber, watchBlocksAsync };
|
|
@@ -101,6 +101,12 @@ declare class MarketSuite extends SDKConstruct {
|
|
|
101
101
|
* wrapper itself, e.g. USDC rather than dcUSDC (which will be "wrappedAddress" in this case)
|
|
102
102
|
*/
|
|
103
103
|
get underlyingToken(): UnderlyingToken;
|
|
104
|
+
/**
|
|
105
|
+
* Whether `token` is this market's pool underlying or the asset it wraps
|
|
106
|
+
* (dcUSDC or USDC on an RWA pool). Amounts in either unit are 1:1 with the
|
|
107
|
+
* figure {@link toUnderlyingAmount} reports.
|
|
108
|
+
*/
|
|
109
|
+
isUnderlyingLike(token: Address): boolean;
|
|
104
110
|
/**
|
|
105
111
|
* Prices a figure already denominated in this market's underlying — a debt,
|
|
106
112
|
* a TVL, a payout — as the read model reports one.
|
|
@@ -1149,6 +1149,18 @@ declare class PoolV310Contract extends BaseContract<abi> implements IPoolContrac
|
|
|
1149
1149
|
* {@inheritDoc IPoolContract.totalAssets}
|
|
1150
1150
|
*/
|
|
1151
1151
|
get totalAssets(): bigint;
|
|
1152
|
+
/**
|
|
1153
|
+
* {@inheritDoc IPoolContract.getShareBalance}
|
|
1154
|
+
*/
|
|
1155
|
+
getShareBalance(wallet: Address, blockNumber?: bigint): Promise<bigint>;
|
|
1156
|
+
/**
|
|
1157
|
+
* {@inheritDoc IPoolContract.sharesToUnderlying}
|
|
1158
|
+
*/
|
|
1159
|
+
sharesToUnderlying(shares: bigint): bigint;
|
|
1160
|
+
/**
|
|
1161
|
+
* {@inheritDoc IPoolContract.underlyingToShares}
|
|
1162
|
+
*/
|
|
1163
|
+
underlyingToShares(underlying: bigint, roundUp?: boolean): bigint;
|
|
1152
1164
|
/**
|
|
1153
1165
|
* {@inheritDoc IPoolContract.unwrappedUnderlying}
|
|
1154
1166
|
*/
|
|
@@ -130,6 +130,24 @@ interface IPoolContract extends IBaseContract {
|
|
|
130
130
|
* rate. Unlike {@link totalSupply}, this is denominated in the underlying.
|
|
131
131
|
*/
|
|
132
132
|
readonly totalAssets: bigint;
|
|
133
|
+
/**
|
|
134
|
+
* Diesel shares `wallet` holds. The pool contract is its own ERC-20.
|
|
135
|
+
**/
|
|
136
|
+
getShareBalance(wallet: Address, blockNumber?: bigint): Promise<bigint>;
|
|
137
|
+
/**
|
|
138
|
+
* Underlying `shares` of diesel are worth at the current share rate, with
|
|
139
|
+
* no withdrawal fee. An empty pool (diesel rate still zero) converts
|
|
140
|
+
* one-for-one. This is what the shares are worth, not what leaving with
|
|
141
|
+
* them would pay.
|
|
142
|
+
*/
|
|
143
|
+
sharesToUnderlying(shares: bigint): bigint;
|
|
144
|
+
/**
|
|
145
|
+
* Shares minted (or burned) for this much underlying at the current share
|
|
146
|
+
* rate, with no withdrawal fee. Rounds down as `previewDeposit`; pass
|
|
147
|
+
* `true` to round up as `previewWithdraw`'s conversion (fee inflation is
|
|
148
|
+
* the caller's). An empty pool converts one-for-one.
|
|
149
|
+
*/
|
|
150
|
+
underlyingToShares(underlying: bigint, roundUp?: boolean): bigint;
|
|
133
151
|
/**
|
|
134
152
|
* The token the pool's underlying wraps, or the underlying itself when it
|
|
135
153
|
* wraps nothing. An RWA market borrows a compliance wrapper that converts
|
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
import { TokenAmount } from "../../model/primitives.js";
|
|
2
1
|
import { PoolPosition } from "../../model/positions.js";
|
|
3
2
|
import "../../model/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import "../market/index.js";
|
|
6
|
-
import { AddLiquidityProps, DepositMetadata, IPoolsService, ListPoolPositionsProps, PoolServiceCallResult, PoolShareBalanceProps, PoolSimulation, RemoveLiquidityProps, SimulatePoolOperationProps, WithdrawalMetadata } from "./types.js";
|
|
3
|
+
import { AddLiquidityProps, DepositMetadata, IPoolsService, ListPoolPositionsProps, PoolServiceCallResult, PoolSimulation, RemoveLiquidityProps, SimulatePoolOperationProps, WithdrawalMetadata } from "./types.js";
|
|
7
4
|
import { SDKConstruct } from "../base/SDKConstruct.js";
|
|
8
5
|
import "../base/index.js";
|
|
9
6
|
import { Address } from "viem";
|
|
10
7
|
//#region src/onchain/pools/PoolService.d.ts
|
|
11
8
|
declare class PoolService extends SDKConstruct implements IPoolsService {
|
|
12
9
|
#private;
|
|
13
|
-
/**
|
|
14
|
-
* {@inheritDoc IPoolsService.getShareBalance}
|
|
15
|
-
*/
|
|
16
|
-
getShareBalance(props: PoolShareBalanceProps): Promise<bigint>;
|
|
17
|
-
/**
|
|
18
|
-
* {@inheritDoc IPoolsService.sharesToUnderlying}
|
|
19
|
-
*/
|
|
20
|
-
sharesToUnderlying(pool: Address, shares: bigint): TokenAmount;
|
|
21
10
|
/**
|
|
22
11
|
* {@inheritDoc IPoolsService.getDepositTokensIn}
|
|
23
12
|
*/
|
|
@@ -67,21 +56,5 @@ declare class PoolService extends SDKConstruct implements IPoolsService {
|
|
|
67
56
|
*/
|
|
68
57
|
listPositions(props: ListPoolPositionsProps): Promise<PoolPosition[]>;
|
|
69
58
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Shares minted for `assets`, as `previewDeposit` would report them.
|
|
72
|
-
*
|
|
73
|
-
* Both directions convert through the diesel rate — underlying per RAY of
|
|
74
|
-
* shares — because that is the rate the pool itself divides by, and the only
|
|
75
|
-
* exact one the SDK holds: `totalAssets` is this rate multiplied out, so
|
|
76
|
-
* converting back through it costs a wei on large amounts. Rounds down, as
|
|
77
|
-
* minting does.
|
|
78
|
-
*/
|
|
79
|
-
declare function toShares(pool: IPoolContract, assets: bigint): bigint;
|
|
80
|
-
/**
|
|
81
|
-
* Shares a withdrawal of `assets` burns, as `previewWithdraw` would report
|
|
82
|
-
* them: {@link toShares} rounded the other way, since the burn has to cover
|
|
83
|
-
* the payout the caller asked for.
|
|
84
|
-
*/
|
|
85
|
-
declare function toSharesUp(pool: IPoolContract, assets: bigint): bigint;
|
|
86
59
|
//#endregion
|
|
87
|
-
export { PoolService
|
|
60
|
+
export { PoolService };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AddLiquidityProps, DepositMetadata, IPoolsService, ListPoolPositionsProps, MarketType, PoolServiceCall, PoolServiceCallResult,
|
|
2
|
-
import { PoolService
|
|
3
|
-
export { AddLiquidityProps, DepositMetadata, IPoolsService, ListPoolPositionsProps, MarketType, PoolService, PoolServiceCall, PoolServiceCallResult,
|
|
1
|
+
import { AddLiquidityProps, DepositMetadata, IPoolsService, ListPoolPositionsProps, MarketType, PoolServiceCall, PoolServiceCallResult, PoolSimulation, RemoveLiquidityProps, SimulatePoolOperationProps, WithdrawalMetadata } from "./types.js";
|
|
2
|
+
import { PoolService } from "./PoolService.js";
|
|
3
|
+
export { AddLiquidityProps, DepositMetadata, IPoolsService, ListPoolPositionsProps, MarketType, PoolService, PoolServiceCall, PoolServiceCallResult, PoolSimulation, RemoveLiquidityProps, SimulatePoolOperationProps, WithdrawalMetadata };
|
|
@@ -169,23 +169,6 @@ interface ListPoolPositionsProps {
|
|
|
169
169
|
**/
|
|
170
170
|
blockNumber?: bigint;
|
|
171
171
|
}
|
|
172
|
-
/**
|
|
173
|
-
* Props for {@link IPoolsService.getShareBalance}.
|
|
174
|
-
**/
|
|
175
|
-
interface PoolShareBalanceProps {
|
|
176
|
-
/**
|
|
177
|
-
* Address of the Gearbox lending pool, which is the share token itself.
|
|
178
|
-
**/
|
|
179
|
-
pool: Address;
|
|
180
|
-
/**
|
|
181
|
-
* Wallet holding the shares.
|
|
182
|
-
**/
|
|
183
|
-
wallet: Address;
|
|
184
|
-
/**
|
|
185
|
-
* Block to read at. Defaults to the latest block.
|
|
186
|
-
**/
|
|
187
|
-
blockNumber?: bigint;
|
|
188
|
-
}
|
|
189
172
|
/**
|
|
190
173
|
* Service interface for pool liquidity operations.
|
|
191
174
|
**/
|
|
@@ -196,28 +179,6 @@ interface IPoolsService {
|
|
|
196
179
|
* @param props - {@link ListPoolPositionsProps}
|
|
197
180
|
**/
|
|
198
181
|
listPositions(props: ListPoolPositionsProps): Promise<PoolPosition[]>;
|
|
199
|
-
/**
|
|
200
|
-
* Shares of one pool a wallet holds, which is the position it has in that
|
|
201
|
-
* pool: the pool contract is its own share token, so this is the same figure
|
|
202
|
-
* {@link listPositions} converts into {@link PoolPosition.netValue}.
|
|
203
|
-
*
|
|
204
|
-
* The one thing about a pool operation the SDK cannot work out from loaded
|
|
205
|
-
* state, hence a read of its own rather than a field on the market.
|
|
206
|
-
*
|
|
207
|
-
* @param props - {@link PoolShareBalanceProps}
|
|
208
|
-
**/
|
|
209
|
-
getShareBalance(props: PoolShareBalanceProps): Promise<bigint>;
|
|
210
|
-
/**
|
|
211
|
-
* What a number of pool shares is worth, in the market's underlying and at
|
|
212
|
-
* the rate the loaded state implies: the conversion behind
|
|
213
|
-
* {@link PoolPosition.netValue}, for a share count a caller holds itself.
|
|
214
|
-
*
|
|
215
|
-
* The token named is the unwrapped underlying — USDC rather than the dcUSDC
|
|
216
|
-
* an RWA pool holds — so an amount from here sits beside a position's own
|
|
217
|
-
* without two names for one asset. No withdrawal fee is taken off: this is
|
|
218
|
-
* what the shares are worth, not what leaving with them would pay.
|
|
219
|
-
**/
|
|
220
|
-
sharesToUnderlying(pool: Address, shares: bigint): TokenAmount;
|
|
221
182
|
/**
|
|
222
183
|
* Returns list of tokens that can be deposited to a pool
|
|
223
184
|
* @param pool
|
|
@@ -320,4 +281,4 @@ interface IPoolsService {
|
|
|
320
281
|
removeLiquidity(props: RemoveLiquidityProps): PoolServiceCallResult;
|
|
321
282
|
}
|
|
322
283
|
//#endregion
|
|
323
|
-
export { AddLiquidityProps, DepositMetadata, IPoolsService, ListPoolPositionsProps, MarketType, PoolServiceCall, PoolServiceCallResult,
|
|
284
|
+
export { AddLiquidityProps, DepositMetadata, IPoolsService, ListPoolPositionsProps, MarketType, PoolServiceCall, PoolServiceCallResult, PoolSimulation, RemoveLiquidityProps, SimulatePoolOperationProps, WithdrawalMetadata };
|