@gearbox-protocol/sdk 16.0.0-next.47 → 16.0.0-next.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/model/positions.schema.js +7 -2
- package/dist/cjs/offchain/positions/OffchainPositions.js +9 -0
- package/dist/cjs/onchain/accounts/intents/testing/sdk-mock.js +2 -0
- package/dist/cjs/onchain/market/MarketSuite.js +28 -0
- package/dist/cjs/onchain/positions/PositionsService.js +4 -2
- package/dist/cjs/preview/index.js +2 -0
- package/dist/cjs/preview/preview/buildDelayedStrategyPositionOperationPreview.js +20 -20
- package/dist/cjs/preview/preview/errors.js +16 -0
- package/dist/cjs/preview/preview/index.js +2 -1
- package/dist/cjs/preview/preview/previewAdjustStrategyPosition.js +4 -12
- package/dist/cjs/preview/preview/previewExitOrRepayStrategyPosition.js +15 -5
- package/dist/cjs/sdk/positions/PositionsNamespace.js +6 -0
- package/dist/esm/model/positions.schema.js +7 -2
- package/dist/esm/offchain/positions/OffchainPositions.js +10 -1
- package/dist/esm/onchain/accounts/intents/testing/sdk-mock.js +2 -0
- package/dist/esm/onchain/market/MarketSuite.js +28 -0
- package/dist/esm/onchain/positions/PositionsService.js +4 -2
- package/dist/esm/preview/index.js +2 -1
- package/dist/esm/preview/preview/buildDelayedStrategyPositionOperationPreview.js +21 -21
- package/dist/esm/preview/preview/errors.js +16 -1
- package/dist/esm/preview/preview/index.js +2 -2
- package/dist/esm/preview/preview/previewAdjustStrategyPosition.js +5 -13
- package/dist/esm/preview/preview/previewExitOrRepayStrategyPosition.js +15 -5
- package/dist/esm/sdk/positions/PositionsNamespace.js +6 -0
- package/dist/types/model/positions.d.ts +36 -2
- package/dist/types/model/positions.schema.d.ts +26 -2
- package/dist/types/model/previews.d.ts +6 -11
- package/dist/types/offchain/positions/OffchainPositions.d.ts +5 -1
- package/dist/types/offchain/positions/types.d.ts +7 -1
- package/dist/types/onchain/index.d.ts +2 -2
- package/dist/types/onchain/market/MarketSuite.d.ts +29 -2
- package/dist/types/onchain/market/index.d.ts +2 -2
- package/dist/types/preview/index.d.ts +2 -2
- package/dist/types/preview/preview/buildDelayedStrategyPositionOperationPreview.d.ts +3 -2
- package/dist/types/preview/preview/errors.d.ts +9 -1
- package/dist/types/preview/preview/index.d.ts +2 -2
- package/dist/types/sdk/positions/PositionsNamespace.d.ts +5 -1
- package/dist/types/sdk/positions/types.d.ts +10 -1
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AP_WETH_TOKEN } from "../../onchain/constants/address-provider.js";
|
|
2
2
|
import { DUST_THRESHOLD } from "../../onchain/constants/math.js";
|
|
3
|
-
import {
|
|
3
|
+
import { asEstimated } from "../../model/previews.js";
|
|
4
4
|
import "../../model/index.js";
|
|
5
5
|
import "../../onchain/index.js";
|
|
6
|
+
import { unpriceableTokenError } from "./errors.js";
|
|
6
7
|
import { replayMulticall } from "./replayMulticall.js";
|
|
7
8
|
import { unwrapNativeCollateral } from "./unwrapNativeCollateral.js";
|
|
8
9
|
//#region src/preview/preview/previewAdjustStrategyPosition.ts
|
|
@@ -24,18 +25,9 @@ function previewAdjustStrategyPosition(input, operation, options) {
|
|
|
24
25
|
const { assets: collateralAdded, error: unwrapError } = unwrapNativeCollateral(after.collateralAdded.toAssets(), value, sdk.addressProvider.getAddress(AP_WETH_TOKEN, 0));
|
|
25
26
|
error ??= unwrapError;
|
|
26
27
|
const assetsChange = account.balances.difference(before.balances).toAssets(DUST_THRESHOLD);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} catch {
|
|
31
|
-
error ??= {
|
|
32
|
-
code: ERROR_UNPRICEABLE_TOKEN,
|
|
33
|
-
message: `cannot price token ${token}`
|
|
34
|
-
};
|
|
35
|
-
return acc;
|
|
36
|
-
}
|
|
37
|
-
}, 0n);
|
|
38
|
-
const snap = account.toSnapshot(totalValue);
|
|
28
|
+
const priced = market.valueInUnderlying(account.balances.toAssets());
|
|
29
|
+
if (priced.unpriceable) error ??= unpriceableTokenError(priced.unpriceable);
|
|
30
|
+
const snap = account.toSnapshot(priced.value);
|
|
39
31
|
return {
|
|
40
32
|
operation: "AdjustCreditAccount",
|
|
41
33
|
...asEstimated(sdk.positions.projection(snap, { availableLiquidityChange: before.totalDebt - account.totalDebt })),
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AP_WETH_TOKEN } from "../../onchain/constants/address-provider.js";
|
|
2
2
|
import "../../onchain/constants/math.js";
|
|
3
|
+
import { asEstimated } from "../../model/previews.js";
|
|
4
|
+
import "../../model/index.js";
|
|
3
5
|
import "../../onchain/index.js";
|
|
6
|
+
import { unpriceableTokenError } from "./errors.js";
|
|
4
7
|
import { classifyCloseOrRepay } from "./detectCloseOrRepay.js";
|
|
5
8
|
import { replayMulticall } from "./replayMulticall.js";
|
|
6
9
|
import { unwrapNativeCollateral } from "./unwrapNativeCollateral.js";
|
|
@@ -22,7 +25,11 @@ function previewExitOrRepayStrategyPosition(input, operation, permanent, options
|
|
|
22
25
|
function previewCloseCreditAccount(input, operation, permanent, replay) {
|
|
23
26
|
const { sdk } = input;
|
|
24
27
|
const market = sdk.marketRegister.findByCreditManager(operation.creditManager);
|
|
25
|
-
const { after, error } = replay;
|
|
28
|
+
const { before, after, error: replayError } = replay;
|
|
29
|
+
const account = after.account;
|
|
30
|
+
let error = replayError;
|
|
31
|
+
const priced = market.valueInUnderlying(account.balances.toAssets());
|
|
32
|
+
if (priced.unpriceable) error ??= unpriceableTokenError(priced.unpriceable);
|
|
26
33
|
const suite = sdk.marketRegister.findCreditManager(operation.creditManager);
|
|
27
34
|
let receivedToken = market.underlying;
|
|
28
35
|
for (const m of operation.multicall) if (m.operation === "WithdrawCollateral" && m.amount === 115792089237316195423570985008687907853269984665640564039457584007913129639935n) {
|
|
@@ -32,7 +39,7 @@ function previewCloseCreditAccount(input, operation, permanent, replay) {
|
|
|
32
39
|
return {
|
|
33
40
|
operation: "CloseCreditAccount",
|
|
34
41
|
permanent,
|
|
35
|
-
...
|
|
42
|
+
...asEstimated(sdk.positions.projection(account.toSnapshot(priced.value), { availableLiquidityChange: before.totalDebt - account.totalDebt })),
|
|
36
43
|
creditAccount: operation.creditAccount,
|
|
37
44
|
name: suite.accountStrategyName(operation.creditAccount),
|
|
38
45
|
targetCollateral: suite.accountTargetCollateral(operation.creditAccount),
|
|
@@ -49,18 +56,21 @@ function previewRepayCreditAccount(input, operation, permanent, replay) {
|
|
|
49
56
|
const { sdk, value = 0n } = input;
|
|
50
57
|
const market = sdk.marketRegister.findByCreditManager(operation.creditManager);
|
|
51
58
|
const { before, after, error: replayError } = replay;
|
|
59
|
+
const account = after.account;
|
|
52
60
|
const { assets: collateralAdded, error: unwrapError } = unwrapNativeCollateral(after.collateralAdded.toAssets(), value, sdk.addressProvider.getAddress(AP_WETH_TOKEN, 0));
|
|
53
|
-
|
|
61
|
+
let error = replayError ?? unwrapError;
|
|
62
|
+
const priced = market.valueInUnderlying(account.balances.toAssets());
|
|
63
|
+
if (priced.unpriceable) error ??= unpriceableTokenError(priced.unpriceable);
|
|
54
64
|
const suite = sdk.marketRegister.findCreditManager(operation.creditManager);
|
|
55
65
|
return {
|
|
56
66
|
operation: "RepayCreditAccount",
|
|
57
67
|
permanent,
|
|
58
|
-
...
|
|
68
|
+
...asEstimated(sdk.positions.projection(account.toSnapshot(priced.value), { availableLiquidityChange: before.totalDebt - account.totalDebt })),
|
|
59
69
|
creditAccount: operation.creditAccount,
|
|
60
70
|
name: suite.accountStrategyName(operation.creditAccount),
|
|
61
71
|
targetCollateral: suite.accountTargetCollateral(operation.creditAccount),
|
|
62
72
|
collateralAdded: collateralAdded.map((a) => market.priceOracle.toTokenAmount(a.token, a.balance)),
|
|
63
|
-
debtRepaid: market.toUnderlyingAmount(before.totalDebt -
|
|
73
|
+
debtRepaid: market.toUnderlyingAmount(before.totalDebt - account.totalDebt),
|
|
64
74
|
collateralWithdrawn: after.collateralWithdrawn.toAssets().map((a) => market.priceOracle.toTokenAmount(a.token, a.balance)),
|
|
65
75
|
error
|
|
66
76
|
};
|
|
@@ -50,6 +50,12 @@ var PositionsNamespace = class extends AbstractNamespace {
|
|
|
50
50
|
return this.offchain.getCharts(key, metrics, range);
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
+
* {@inheritDoc IPositionsOffchainOnly.transactions}
|
|
54
|
+
**/
|
|
55
|
+
async transactions(key) {
|
|
56
|
+
return this.offchain.getTransactions(key);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
53
59
|
* {@inheritDoc IPositionsOnchainOnly.getCurrentWithdrawals}
|
|
54
60
|
**/
|
|
55
61
|
async getCurrentWithdrawals(props) {
|
|
@@ -489,11 +489,27 @@ interface PositionsTotals {
|
|
|
489
489
|
/**
|
|
490
490
|
* What a transaction did to a position.
|
|
491
491
|
**/
|
|
492
|
-
type PositionTransactionKind = "open" | "deposit" | "withdraw" | "adjustLeverage" | "addCollateral" | "withdrawCollateral" | "liquidation"
|
|
492
|
+
type PositionTransactionKind = "open" | "deposit" | "withdraw" | "adjustLeverage" | "addCollateral" | "withdrawCollateral" | "liquidation" | "repay" |
|
|
493
|
+
/**
|
|
494
|
+
* The transaction only rearranged what the account already held — a swap, a
|
|
495
|
+
* claim or a quota change — without moving its net value or its debt.
|
|
496
|
+
**/
|
|
497
|
+
"rebalance" |
|
|
498
|
+
/**
|
|
499
|
+
* The residual kind: the transaction is not one of the above. Either the
|
|
500
|
+
* backend could not attribute the account's state movement completely, or
|
|
501
|
+
* the movements it did observe contradict each other (value left the
|
|
502
|
+
* account while debt grew, say), so no single intent describes it. Never a
|
|
503
|
+
* synonym for "nothing happened", and never a direction to infer from.
|
|
504
|
+
**/
|
|
505
|
+
"other";
|
|
493
506
|
/**
|
|
494
507
|
* One transaction in a position's history, from the backend's indexer.
|
|
495
508
|
**/
|
|
496
509
|
interface PositionTransaction {
|
|
510
|
+
/**
|
|
511
|
+
* Hash of the transaction.
|
|
512
|
+
**/
|
|
497
513
|
txHash: Hex;
|
|
498
514
|
/**
|
|
499
515
|
* Unix seconds of the block the transaction was mined in.
|
|
@@ -501,9 +517,27 @@ interface PositionTransaction {
|
|
|
501
517
|
timestamp: Timestamp;
|
|
502
518
|
kind: PositionTransactionKind;
|
|
503
519
|
/**
|
|
504
|
-
*
|
|
520
|
+
* Net magnitudes of the assets the borrower moved. A directional kind
|
|
521
|
+
* supplies the direction; callers must not infer one for an `other`
|
|
522
|
+
* transaction.
|
|
505
523
|
**/
|
|
506
524
|
assets: TokenAmount[];
|
|
525
|
+
/**
|
|
526
|
+
* Signed change of every credit-account token balance caused by the
|
|
527
|
+
* transaction. Positive values were added to the account; negative values
|
|
528
|
+
* left it. Tokens whose balance did not change are omitted.
|
|
529
|
+
**/
|
|
530
|
+
balanceChanges: TokenAmount[];
|
|
531
|
+
/**
|
|
532
|
+
* Signed change of the position's total debt — principal plus accrued
|
|
533
|
+
* interest plus accrued fees — denominated in the market underlying. It is
|
|
534
|
+
* differenced between the backend's consecutive debt observations around
|
|
535
|
+
* the transaction, so it is what the borrower ends up owing, not the
|
|
536
|
+
* principal the transaction asked to move: a repayment outrun by accrued
|
|
537
|
+
* interest is positive, and a transaction that moved no principal at all
|
|
538
|
+
* can still carry the interest that accrued alongside it.
|
|
539
|
+
**/
|
|
540
|
+
debtChange: TokenAmount;
|
|
507
541
|
}
|
|
508
542
|
//#endregion
|
|
509
543
|
export { BorrowRateBreakdown, PnlBreakdown, PointsProgramPnL, PointsRewardsPnL, PoolPosition, PoolPositionKey, PoolPositionRef, Position, PositionCollateral, PositionFilter, PositionId, PositionKey, PositionKind, PositionTransaction, PositionTransactionKind, PositionsTotals, RewardsPnL, STRATEGY_POSITION_COLLATERAL_ERROR, StrategyPosition, StrategyPositionKey, StrategyPositionRef, TokenQuotaRate, TokenRewardsPnL, liquidationPositionId, matchesPositionFilter, poolPositionId, positionId, strategyPositionId };
|
|
@@ -1027,14 +1027,14 @@ declare const positionsTotalsSchema: z.ZodObject<{
|
|
|
1027
1027
|
/**
|
|
1028
1028
|
* {@link PositionTransactionKind}
|
|
1029
1029
|
**/
|
|
1030
|
-
declare const positionTransactionKindSchema: z.ZodUnion<readonly [z.ZodLiteral<"open">, z.ZodLiteral<"deposit">, z.ZodLiteral<"withdraw">, z.ZodLiteral<"adjustLeverage">, z.ZodLiteral<"addCollateral">, z.ZodLiteral<"withdrawCollateral">, z.ZodLiteral<"liquidation">]>;
|
|
1030
|
+
declare const positionTransactionKindSchema: z.ZodUnion<readonly [z.ZodLiteral<"open">, z.ZodLiteral<"deposit">, z.ZodLiteral<"withdraw">, z.ZodLiteral<"adjustLeverage">, z.ZodLiteral<"addCollateral">, z.ZodLiteral<"withdrawCollateral">, z.ZodLiteral<"liquidation">, z.ZodLiteral<"repay">, z.ZodLiteral<"rebalance">, z.ZodLiteral<"other">]>;
|
|
1031
1031
|
/**
|
|
1032
1032
|
* {@link PositionTransaction}
|
|
1033
1033
|
**/
|
|
1034
1034
|
declare const positionTransactionSchema: z.ZodObject<{
|
|
1035
1035
|
txHash: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
1036
1036
|
timestamp: z.ZodNumber;
|
|
1037
|
-
kind: z.ZodUnion<readonly [z.ZodLiteral<"open">, z.ZodLiteral<"deposit">, z.ZodLiteral<"withdraw">, z.ZodLiteral<"adjustLeverage">, z.ZodLiteral<"addCollateral">, z.ZodLiteral<"withdrawCollateral">, z.ZodLiteral<"liquidation">]>;
|
|
1037
|
+
kind: z.ZodUnion<readonly [z.ZodLiteral<"open">, z.ZodLiteral<"deposit">, z.ZodLiteral<"withdraw">, z.ZodLiteral<"adjustLeverage">, z.ZodLiteral<"addCollateral">, z.ZodLiteral<"withdrawCollateral">, z.ZodLiteral<"liquidation">, z.ZodLiteral<"repay">, z.ZodLiteral<"rebalance">, z.ZodLiteral<"other">]>;
|
|
1038
1038
|
assets: z.ZodArray<z.ZodObject<{
|
|
1039
1039
|
value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
|
|
1040
1040
|
valueUsd: z.ZodNullable<z.ZodNumber>;
|
|
@@ -1047,6 +1047,30 @@ declare const positionTransactionSchema: z.ZodObject<{
|
|
|
1047
1047
|
assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
|
|
1048
1048
|
}, z.core.$strip>;
|
|
1049
1049
|
}, z.core.$strip>>;
|
|
1050
|
+
balanceChanges: z.ZodArray<z.ZodObject<{
|
|
1051
|
+
value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
|
|
1052
|
+
valueUsd: z.ZodNullable<z.ZodNumber>;
|
|
1053
|
+
token: z.ZodObject<{
|
|
1054
|
+
chainId: z.ZodNumber;
|
|
1055
|
+
address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
1056
|
+
symbol: z.ZodString;
|
|
1057
|
+
name: z.ZodString;
|
|
1058
|
+
decimals: z.ZodNumber;
|
|
1059
|
+
assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
|
|
1060
|
+
}, z.core.$strip>;
|
|
1061
|
+
}, z.core.$strip>>;
|
|
1062
|
+
debtChange: z.ZodObject<{
|
|
1063
|
+
value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
|
|
1064
|
+
valueUsd: z.ZodNullable<z.ZodNumber>;
|
|
1065
|
+
token: z.ZodObject<{
|
|
1066
|
+
chainId: z.ZodNumber;
|
|
1067
|
+
address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
|
|
1068
|
+
symbol: z.ZodString;
|
|
1069
|
+
name: z.ZodString;
|
|
1070
|
+
decimals: z.ZodNumber;
|
|
1071
|
+
assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
|
|
1072
|
+
}, z.core.$strip>;
|
|
1073
|
+
}, z.core.$strip>;
|
|
1050
1074
|
}, z.core.$strip>;
|
|
1051
1075
|
//#endregion
|
|
1052
1076
|
export { borrowRateBreakdownSchema, pnlBreakdownSchema, pointsProgramPnLSchema, pointsRewardsPnLSchema, poolPositionKeySchema, poolPositionSchema, positionCollateralSchema, positionFilterQueryParamsSchema, positionFilterQuerySchema, positionFilterSchema, positionKeySchema, positionKindSchema, positionSchema, positionTransactionKindSchema, positionTransactionSchema, positionsTotalsSchema, rewardsPnLSchema, strategyPositionKeySchema, strategyPositionSchema, tokenQuotaRateSchema, tokenRewardsPnLSchema };
|
|
@@ -468,12 +468,8 @@ interface AdjustStrategyPositionPreview extends EstimatedProjection, AccountStat
|
|
|
468
468
|
* What an exit transaction that already exists would do — the counterpart of
|
|
469
469
|
* `prepare.withdrawStrategy` asked for everything, read off calldata rather
|
|
470
470
|
* than planned into it.
|
|
471
|
-
*
|
|
472
|
-
* Carries no {@link AccountProjection}: the account it describes ends up empty,
|
|
473
|
-
* so there is no position left to weigh — what a caller wants to know is the
|
|
474
|
-
* payout. The market it happened in is still named, as everywhere else.
|
|
475
471
|
**/
|
|
476
|
-
interface ExitStrategyPositionPreview extends
|
|
472
|
+
interface ExitStrategyPositionPreview extends EstimatedProjection {
|
|
477
473
|
operation: "CloseCreditAccount";
|
|
478
474
|
/**
|
|
479
475
|
* True when the account is closed permanently (facade `closeCreditAccount`
|
|
@@ -506,7 +502,8 @@ interface ExitStrategyPositionPreview extends CreditOperationMarket {
|
|
|
506
502
|
/**
|
|
507
503
|
* Set when preview encountered non-fatal errors, all fields are
|
|
508
504
|
* still computed best-effort, but the
|
|
509
|
-
* balance-derived `receivedAmount`
|
|
505
|
+
* balance-derived `receivedAmount` and the projected holdings may be
|
|
506
|
+
* unreliable in that case.
|
|
510
507
|
*/
|
|
511
508
|
error?: OperationPreviewError;
|
|
512
509
|
}
|
|
@@ -514,11 +511,8 @@ interface ExitStrategyPositionPreview extends CreditOperationMarket {
|
|
|
514
511
|
* What a settling repayment that already exists would do — the counterpart of
|
|
515
512
|
* `prepare.repayStrategy` asked for the whole debt, read off calldata rather
|
|
516
513
|
* than planned into it.
|
|
517
|
-
*
|
|
518
|
-
* Carries no {@link AccountProjection} for the same reason the exit does not:
|
|
519
|
-
* the loan ends here, so the risk metrics have nothing left to describe.
|
|
520
514
|
**/
|
|
521
|
-
interface RepayStrategyPositionPreview extends
|
|
515
|
+
interface RepayStrategyPositionPreview extends EstimatedProjection {
|
|
522
516
|
operation: "RepayCreditAccount";
|
|
523
517
|
/**
|
|
524
518
|
* True when the account is closed permanently (facade `closeCreditAccount`
|
|
@@ -564,7 +558,8 @@ interface RepayStrategyPositionPreview extends CreditOperationMarket {
|
|
|
564
558
|
/**
|
|
565
559
|
* Set when preview encountered non-fatal errors, all fields are
|
|
566
560
|
* still computed best-effort, but the
|
|
567
|
-
* balance-derived `collateralWithdrawn`
|
|
561
|
+
* balance-derived `collateralWithdrawn` and the projected holdings may be
|
|
562
|
+
* unreliable in that case.
|
|
568
563
|
*/
|
|
569
564
|
error?: OperationPreviewError;
|
|
570
565
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChartBundle, ChartRange } from "../../model/charts.js";
|
|
2
|
-
import { Position, PositionKey, PositionsTotals } from "../../model/positions.js";
|
|
2
|
+
import { Position, PositionKey, PositionTransaction, PositionsTotals, StrategyPositionKey } from "../../model/positions.js";
|
|
3
3
|
import { DataResponse } from "../../model/response.js";
|
|
4
4
|
import { ListPositionsPropsBase } from "../../onchain/positions/types.js";
|
|
5
5
|
import { GearboxAPIOptions } from "../types.js";
|
|
@@ -25,6 +25,10 @@ declare class OffchainPositions extends AbstractOffchainNamespace implements IOf
|
|
|
25
25
|
* {@inheritDoc IOffchainPositions.getCharts}
|
|
26
26
|
**/
|
|
27
27
|
getCharts<K extends PositionKey, const Metrics extends readonly PositionChartMetricFor<K>[]>(key: K, metrics: Metrics, range: ChartRange): Promise<DataResponse<ChartBundle<Metrics>>>;
|
|
28
|
+
/**
|
|
29
|
+
* {@inheritDoc IOffchainPositions.getTransactions}
|
|
30
|
+
**/
|
|
31
|
+
getTransactions(key: StrategyPositionKey): Promise<DataResponse<PositionTransaction[]>>;
|
|
28
32
|
}
|
|
29
33
|
//#endregion
|
|
30
34
|
export { OffchainPositions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChartBundle, ChartRange, PoolPositionChartMetric, StrategyPositionChartMetric } from "../../model/charts.js";
|
|
2
|
-
import { Position, PositionKey, PositionsTotals } from "../../model/positions.js";
|
|
2
|
+
import { Position, PositionKey, PositionTransaction, PositionsTotals, StrategyPositionKey } from "../../model/positions.js";
|
|
3
3
|
import { DataResponse } from "../../model/response.js";
|
|
4
4
|
import { ListPositionsPropsBase } from "../../onchain/positions/types.js";
|
|
5
5
|
import { Address } from "viem";
|
|
@@ -25,6 +25,12 @@ interface IOffchainPositions {
|
|
|
25
25
|
* Charts of one position: one series per metric, on a shared grid.
|
|
26
26
|
**/
|
|
27
27
|
getCharts<K extends PositionKey, const Metrics extends readonly PositionChartMetricFor<K>[]>(key: K, metrics: Metrics, range: ChartRange): Promise<DataResponse<ChartBundle<Metrics>>>;
|
|
28
|
+
/**
|
|
29
|
+
* Every transaction that touched the credit account while its current
|
|
30
|
+
* session was open, newest first. There is no paging, and an account with
|
|
31
|
+
* no open session answers with an empty list.
|
|
32
|
+
**/
|
|
33
|
+
getTransactions(key: StrategyPositionKey): Promise<DataResponse<PositionTransaction[]>>;
|
|
28
34
|
}
|
|
29
35
|
//#endregion
|
|
30
36
|
export { IOffchainPositions, PositionChartMetricFor };
|
|
@@ -172,7 +172,7 @@ import { GaugeContract, GaugeParams } from "./market/pool/GaugeContract.js";
|
|
|
172
172
|
import { LinearInterestRateModelContract } from "./market/pool/LinearInterestRateModelContract.js";
|
|
173
173
|
import { PoolSuite } from "./market/pool/PoolSuite.js";
|
|
174
174
|
import { PoolV310Contract } from "./market/pool/PoolV310Contract.js";
|
|
175
|
-
import { MarketSuite } from "./market/MarketSuite.js";
|
|
175
|
+
import { MarketSuite, ValueInUnderlying } from "./market/MarketSuite.js";
|
|
176
176
|
import { CreditSuite } from "./market/credit/CreditSuite.js";
|
|
177
177
|
import { StrategyCollateralProps, dominantCollateral, isStrategyCollateral, pickStrategyTargetCollateral } from "./market/credit/collateralUtils.js";
|
|
178
178
|
import { ExpectedBalanceDeltasProps, ExpectedOutput, expectedBalanceDeltas } from "./market/credit/expectedBalanceDeltas.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, 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 };
|
|
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, ValueInUnderlying, 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 };
|
|
@@ -2,7 +2,7 @@ import { Token, TokenAmount, UnderlyingToken } from "../../model/primitives.js";
|
|
|
2
2
|
import { Curator } from "../../model/curators.js";
|
|
3
3
|
import { Opportunity, OpportunityFilter, PoolOpportunity, PoolOpportunityDetail, PriceFeedSummary, QuotaAsset } from "../../model/opportunities.js";
|
|
4
4
|
import "../../model/index.js";
|
|
5
|
-
import { MarketData } from "../base/types.js";
|
|
5
|
+
import { Asset, MarketData } from "../base/types.js";
|
|
6
6
|
import { IRWAFactory } from "./rwa/types.js";
|
|
7
7
|
import { MarketStateHuman } from "../types/state-human.js";
|
|
8
8
|
import { MarketConfiguratorContract } from "./MarketConfiguratorContract.js";
|
|
@@ -20,6 +20,23 @@ import { SDKConstruct } from "../base/SDKConstruct.js";
|
|
|
20
20
|
import "../base/index.js";
|
|
21
21
|
import { Address } from "viem";
|
|
22
22
|
//#region src/onchain/market/MarketSuite.d.ts
|
|
23
|
+
/**
|
|
24
|
+
* Oracle estimate of a bag of holdings in this market's underlying.
|
|
25
|
+
*
|
|
26
|
+
* Tokens the oracle cannot price contribute `0` and are named on
|
|
27
|
+
* {@link unpriceable} (the first miss). Callers that speak preview errors map
|
|
28
|
+
* that address to `ERROR_UNPRICEABLE_TOKEN` themselves.
|
|
29
|
+
**/
|
|
30
|
+
interface ValueInUnderlying {
|
|
31
|
+
/**
|
|
32
|
+
* Sum of converted balances, in the pool underlying's decimals.
|
|
33
|
+
**/
|
|
34
|
+
value: bigint;
|
|
35
|
+
/**
|
|
36
|
+
* First token with no price; omitted if every entry converted.
|
|
37
|
+
**/
|
|
38
|
+
unpriceable?: Address;
|
|
39
|
+
}
|
|
23
40
|
/**
|
|
24
41
|
* Aggregates all SDK wrappers that make up one Gearbox market.
|
|
25
42
|
*
|
|
@@ -119,6 +136,16 @@ declare class MarketSuite extends SDKConstruct {
|
|
|
119
136
|
* not see two.
|
|
120
137
|
**/
|
|
121
138
|
toUnderlyingAmount: (value: bigint) => TokenAmount;
|
|
139
|
+
/**
|
|
140
|
+
* Sums `assets` in this market's underlying at latest oracle prices.
|
|
141
|
+
*
|
|
142
|
+
* Balances at or below `minBalance` are ignored. A token the oracle cannot
|
|
143
|
+
* price contributes nothing; the first such token is {@link ValueInUnderlying.unpriceable}.
|
|
144
|
+
*
|
|
145
|
+
* The counterpart of {@link toUnderlyingAmount}: that method labels a figure
|
|
146
|
+
* already in underlying, this one produces the figure from mixed holdings.
|
|
147
|
+
**/
|
|
148
|
+
valueInUnderlying(assets: Asset[], minBalance?: bigint): ValueInUnderlying;
|
|
122
149
|
/**
|
|
123
150
|
* Display name of this market's pool, e.g. `"USDC Pool"`.
|
|
124
151
|
*/
|
|
@@ -198,4 +225,4 @@ declare class MarketSuite extends SDKConstruct {
|
|
|
198
225
|
stateHuman(raw?: boolean): MarketStateHuman;
|
|
199
226
|
}
|
|
200
227
|
//#endregion
|
|
201
|
-
export { MarketSuite };
|
|
228
|
+
export { MarketSuite, ValueInUnderlying };
|
|
@@ -136,7 +136,7 @@ import { LinearInterestRateModelContract } from "./pool/LinearInterestRateModelC
|
|
|
136
136
|
import { PoolSuite } from "./pool/PoolSuite.js";
|
|
137
137
|
import { PoolV310Contract } from "./pool/PoolV310Contract.js";
|
|
138
138
|
import "./pool/index.js";
|
|
139
|
-
import { MarketSuite } from "./MarketSuite.js";
|
|
139
|
+
import { MarketSuite, ValueInUnderlying } from "./MarketSuite.js";
|
|
140
140
|
import { CreditSuite } from "./credit/CreditSuite.js";
|
|
141
141
|
import { StrategyCollateralProps, dominantCollateral, isStrategyCollateral, pickStrategyTargetCollateral } from "./credit/collateralUtils.js";
|
|
142
142
|
import { ExpectedBalanceDeltasProps, ExpectedOutput, expectedBalanceDeltas } from "./credit/expectedBalanceDeltas.js";
|
|
@@ -152,4 +152,4 @@ import "./zapper/index.js";
|
|
|
152
152
|
import { MarketRegister, MarketRegistryState, MarketRegistryStateHuman } from "./MarketRegister.js";
|
|
153
153
|
import { DEFAULT_QUOTA_BUFFER_BPS, MAX_LEVERAGE_BUFFER_BPS, OptimalRepaidAmountProps, PARTIAL_LIQUIDATION_BUFFER_BPS, QuotaMode, StrategyRateInputs, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, healthFactorBps, minSeizedAmount, optimalHFForPartialLiquidation, optimalRepaidAmount, rayToBps, usdToNumber } from "./math.js";
|
|
154
154
|
import { strategyName } from "./strategyName.js";
|
|
155
|
-
export { AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BasicSwapCall, BoundedPriceFeedContract, CamelotPool, CamelotV3AdapterContract, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, CreditAccountTokenQuota, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DStokenData, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, type FetchRedstonePayloadsOptions, FluidDexAdapterContract, GaugeContract, GaugeParams, GetInvestorOptions, GetOpenAccountRequirementsProps, GetReward, IAdapterContract, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, IPoolContract, IPriceFeedContract, IPriceOracleContract, IRWAFactory, IRateKeeperContract, IUpdatablePriceFeedContract, IZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InterestRateModelType, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LatestUpdate, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationFees, MAX_LEVERAGE_BUFFER_BPS, MakerDeposit, MakerRedeem, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, OptimalRepaidAmountProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolQuotaKeeperContract, PoolSuite, PoolV310Contract, PrepareUpdateQuotasProps, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegister, PriceFeedRegisterHooks, PriceFeedRegisterOptions, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleV310Contract, PriceUpdate, PythPriceFeed, QuotaMode, QuotaSlice, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryStateHuman, RWAFactoryType, RWAInvestorData, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs, RWARegistry, RWAState, RWAStateHuman, RWAUnderlyingData, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RampEvent, RateKeeperType, RedstonePriceFeedContract, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeCreditAccountData, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeMissingOpenAccountRequirements, SecuritizeOnRampAdapterContract, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, StakingRewardsAdapterContract, StrategyCollateralProps, StrategyRateInputs, Swap, type TimestampedCalldata, TokenAmount, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UnsupportedZapperFunctionError, UpdatePriceFeedsResult, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, 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 };
|
|
155
|
+
export { AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BasicSwapCall, BoundedPriceFeedContract, CamelotPool, CamelotV3AdapterContract, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, CreditAccountTokenQuota, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DStokenData, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, type FetchRedstonePayloadsOptions, FluidDexAdapterContract, GaugeContract, GaugeParams, GetInvestorOptions, GetOpenAccountRequirementsProps, GetReward, IAdapterContract, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, IPoolContract, IPriceFeedContract, IPriceOracleContract, IRWAFactory, IRateKeeperContract, IUpdatablePriceFeedContract, IZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InterestRateModelType, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LatestUpdate, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationFees, MAX_LEVERAGE_BUFFER_BPS, MakerDeposit, MakerRedeem, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketSuite, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, OptimalRepaidAmountProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialLiquidationParams, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolQuotaKeeperContract, PoolSuite, PoolV310Contract, PrepareUpdateQuotasProps, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegister, PriceFeedRegisterHooks, PriceFeedRegisterOptions, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleV310Contract, PriceUpdate, PythPriceFeed, QuotaMode, QuotaSlice, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryStateHuman, RWAFactoryType, RWAInvestorData, RWAMissingOpenAccountRequirements, RWAOpenAccountRequirements, RWAOperationArgs, RWARegistry, RWAState, RWAStateHuman, RWAUnderlyingData, RWA_FACTORY_SECURITIZE, RWA_FACTORY_TYPES, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RampEvent, RateKeeperType, RedstonePriceFeedContract, SECURITIZE_REGISTER_VAULT_TYPES, SecuritizeCreditAccountData, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeMissingOpenAccountRequirements, SecuritizeOnRampAdapterContract, SecuritizeOpenAccountRequirements, SecuritizeOperationArgs, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, SecuritizeRegisterMessage, SecuritizeRegisterVaultMessage, SecuritizeSignature, StakingRewardsAdapterContract, StrategyCollateralProps, StrategyRateInputs, Swap, type TimestampedCalldata, TokenAmount, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UnsupportedZapperFunctionError, UpdatePriceFeedsResult, UpshiftVaultAdapterContract, ValueInUnderlying, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, 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 };
|
|
@@ -32,7 +32,7 @@ import { DetectedDelayedOperation, detectDelayedOperation } from "./preview/dete
|
|
|
32
32
|
import { buildDelayedStrategyPositionOperationPreview } from "./preview/buildDelayedStrategyPositionOperationPreview.js";
|
|
33
33
|
import { classifyCloseOrRepay, isCloseOrRepay } from "./preview/detectCloseOrRepay.js";
|
|
34
34
|
import { DetectedDelayedClaim, detectDelayedClaim, resolveDelayedClaimIntent } from "./preview/detectDelayedClaim.js";
|
|
35
|
-
import { UnsupportedOperationError } from "./preview/errors.js";
|
|
35
|
+
import { UnsupportedOperationError, unpriceableTokenError } from "./preview/errors.js";
|
|
36
36
|
import { estimateClaimableAt } from "./preview/estimateClaimableAt.js";
|
|
37
37
|
import { previewAdjustStrategyPosition } from "./preview/previewAdjustStrategyPosition.js";
|
|
38
38
|
import { CloseOrRepayOperation, previewExitOrRepayStrategyPosition } from "./preview/previewExitOrRepayStrategyPosition.js";
|
|
@@ -44,4 +44,4 @@ import "./preview/index.js";
|
|
|
44
44
|
import { CheckOperationOptions, WeighedFactors, checkOperation, collateralIssue, marketIssues, quotaCountIssue } from "./validate/checkOperation.js";
|
|
45
45
|
import { checkSimulation } from "./validate/checkSimulation.js";
|
|
46
46
|
import "./validate/index.js";
|
|
47
|
-
export { AdapterOperation, AdapterOperationBase, AddCollateralOp, AllowanceDetail, AllowancePrerequisite, AllowanceResult, BalanceDetail, BalancePrerequisite, BalanceResult, type BorrowLimitBinding, CheckOperationOptions, ClassifyInnerOperationsProps, CloseCreditAccountOperation, CloseOrRepayOperation, CompareBalancesOp, CreditAccountOperation, CreditAccountState, CreditAccountStateProps, DecreaseDebtOp, DetectedDelayedClaim, DetectedDelayedOperation, DirectTokenTransferOperation, ExtractTransfersResult, FacadeCallType, FacadeOperationMetadata, FacadeParsedCall, IncreaseDebtOp, InnerFacadeOperation, InnerOperation, type InvalidDelayedIntentError, LiquidateCreditAccountOperation, MulticallOperation, OpenCreditAccountOperation, Operation, OperationMetadata, OuterFacadeOperation, PartialLiquidationOperation, PoolDepositOperation, PoolMintOperation, PoolOperation, PoolRedeemOperation, PoolWithdrawOperation, Prerequisite, PrerequisiteContext, PrerequisiteError, PrerequisiteKind, PrerequisiteOutcome, PrerequisiteResult, type PreviewErrorDetails, type PreviewErrorReason, type PreviewIssue, PreviewOperationError, PreviewOperationInput, PreviewOperationOptions, type PreviewRefusal, type PreviewSimulationError, RWAMulticallOperation, RWAOpenCreditAccountOperation, RWAOpenRequirementsDetail, RWAOpenRequirementsPrerequisite, RWAOpenRequirementsResult, RWAOperation, RWAOperationMetadata, ReplayMulticallResult, ReplayState, ReplayableOperation, type SimulationError, type SimulationFlowFailure, type SimulationFlowSource, StoreExpectedBalancesOp, TokenTransfer, TraceAdapterExt, TransferAlignmentError, UnexpectedFacadeEventOrderError, UnknownAdapterError, UnknownFacadeCallError, UnsupportedOperationError, UnsupportedPoolFunctionError, UnsupportedTargetError, type UnsupportedZapperFunctionError, UpdateQuotaOp, WeighedFactors, WithdrawCollateralAlignmentError, WithdrawCollateralEventInfo, WithdrawCollateralOp, asPreviewSimulationError, buildDelayedStrategyPositionOperationPreview, checkOperation, checkPrerequisites, checkSimulation, classifyCloseOrRepay, classifyInnerOperations, collateralIssue, detectDelayedClaim, detectDelayedOperation, estimateClaimableAt, extractAdapterCallTraces, extractTransfers, findFacadeCalls, isCloseOrRepay, isPoolOperation, isRWAOperation, makeReplayState, marketIssues, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parseRWAFactoryOperationCalldata, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, quotaCountIssue, raise, refuse, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent };
|
|
47
|
+
export { AdapterOperation, AdapterOperationBase, AddCollateralOp, AllowanceDetail, AllowancePrerequisite, AllowanceResult, BalanceDetail, BalancePrerequisite, BalanceResult, type BorrowLimitBinding, CheckOperationOptions, ClassifyInnerOperationsProps, CloseCreditAccountOperation, CloseOrRepayOperation, CompareBalancesOp, CreditAccountOperation, CreditAccountState, CreditAccountStateProps, DecreaseDebtOp, DetectedDelayedClaim, DetectedDelayedOperation, DirectTokenTransferOperation, ExtractTransfersResult, FacadeCallType, FacadeOperationMetadata, FacadeParsedCall, IncreaseDebtOp, InnerFacadeOperation, InnerOperation, type InvalidDelayedIntentError, LiquidateCreditAccountOperation, MulticallOperation, OpenCreditAccountOperation, Operation, OperationMetadata, OuterFacadeOperation, PartialLiquidationOperation, PoolDepositOperation, PoolMintOperation, PoolOperation, PoolRedeemOperation, PoolWithdrawOperation, Prerequisite, PrerequisiteContext, PrerequisiteError, PrerequisiteKind, PrerequisiteOutcome, PrerequisiteResult, type PreviewErrorDetails, type PreviewErrorReason, type PreviewIssue, PreviewOperationError, PreviewOperationInput, PreviewOperationOptions, type PreviewRefusal, type PreviewSimulationError, RWAMulticallOperation, RWAOpenCreditAccountOperation, RWAOpenRequirementsDetail, RWAOpenRequirementsPrerequisite, RWAOpenRequirementsResult, RWAOperation, RWAOperationMetadata, ReplayMulticallResult, ReplayState, ReplayableOperation, type SimulationError, type SimulationFlowFailure, type SimulationFlowSource, StoreExpectedBalancesOp, TokenTransfer, TraceAdapterExt, TransferAlignmentError, UnexpectedFacadeEventOrderError, UnknownAdapterError, UnknownFacadeCallError, UnsupportedOperationError, UnsupportedPoolFunctionError, UnsupportedTargetError, type UnsupportedZapperFunctionError, UpdateQuotaOp, WeighedFactors, WithdrawCollateralAlignmentError, WithdrawCollateralEventInfo, WithdrawCollateralOp, asPreviewSimulationError, buildDelayedStrategyPositionOperationPreview, checkOperation, checkPrerequisites, checkSimulation, classifyCloseOrRepay, classifyInnerOperations, collateralIssue, detectDelayedClaim, detectDelayedOperation, estimateClaimableAt, extractAdapterCallTraces, extractTransfers, findFacadeCalls, isCloseOrRepay, isPoolOperation, isRWAOperation, makeReplayState, marketIssues, parseFacadeOperationCalldata, parseOperationCalldata, parsePoolOperationCalldata, parseRWAFactoryOperationCalldata, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, quotaCountIssue, raise, refuse, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent, unpriceableTokenError };
|
|
@@ -13,8 +13,9 @@ import { Address } from "viem";
|
|
|
13
13
|
* the claim itself followed by the intent-specific tail
|
|
14
14
|
*
|
|
15
15
|
* Pure function: the input states are never mutated and no network access is performed.
|
|
16
|
-
* Swaps are estimated with the injected conversion;
|
|
17
|
-
*
|
|
16
|
+
* Swaps are estimated with the injected conversion; remaining holdings are
|
|
17
|
+
* priced by `MarketSuite.valueInUnderlying`. Tokens that cannot be priced
|
|
18
|
+
* contribute nothing and set a non-fatal `ERROR_UNPRICEABLE_TOKEN` error on the
|
|
18
19
|
* preview.
|
|
19
20
|
*
|
|
20
21
|
* The changes (e.g. `totalDebtChange`) are reported relative to the account
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { IGearboxError } from "../../model/errors.js";
|
|
2
|
+
import { OperationPreviewError } from "../../model/previews.js";
|
|
2
3
|
import "../../model/index.js";
|
|
4
|
+
import { Address } from "viem";
|
|
3
5
|
//#region src/preview/preview/errors.d.ts
|
|
4
6
|
/**
|
|
5
7
|
* Refusal answered by `previewOperation` for parsed operations it cannot
|
|
@@ -11,5 +13,11 @@ interface UnsupportedOperationError extends IGearboxError {
|
|
|
11
13
|
/** The parsed operation kind (the `operation` discriminant). */
|
|
12
14
|
operation: string;
|
|
13
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Preview limitation (2xxx): the oracle could not price `token`. Callers
|
|
18
|
+
* attach this with `error ??=` so a malformed-transaction (1xxx) error
|
|
19
|
+
* already recorded keeps precedence.
|
|
20
|
+
**/
|
|
21
|
+
declare function unpriceableTokenError(token: Address): OperationPreviewError;
|
|
14
22
|
//#endregion
|
|
15
|
-
export { UnsupportedOperationError };
|
|
23
|
+
export { UnsupportedOperationError, unpriceableTokenError };
|
|
@@ -3,11 +3,11 @@ import { DetectedDelayedOperation, detectDelayedOperation } from "./detectDelaye
|
|
|
3
3
|
import { buildDelayedStrategyPositionOperationPreview } from "./buildDelayedStrategyPositionOperationPreview.js";
|
|
4
4
|
import { classifyCloseOrRepay, isCloseOrRepay } from "./detectCloseOrRepay.js";
|
|
5
5
|
import { DetectedDelayedClaim, detectDelayedClaim, resolveDelayedClaimIntent } from "./detectDelayedClaim.js";
|
|
6
|
-
import { UnsupportedOperationError } from "./errors.js";
|
|
6
|
+
import { UnsupportedOperationError, unpriceableTokenError } from "./errors.js";
|
|
7
7
|
import { estimateClaimableAt } from "./estimateClaimableAt.js";
|
|
8
8
|
import { previewAdjustStrategyPosition } from "./previewAdjustStrategyPosition.js";
|
|
9
9
|
import { CloseOrRepayOperation, previewExitOrRepayStrategyPosition } from "./previewExitOrRepayStrategyPosition.js";
|
|
10
10
|
import { PreviewOperationError, previewOperation } from "./previewOperation.js";
|
|
11
11
|
import { ReplayState, makeReplayState, replayInnerOperations } from "./replayInnerOperations.js";
|
|
12
12
|
import { ReplayMulticallResult, ReplayableOperation, replayMulticall } from "./replayMulticall.js";
|
|
13
|
-
export { CloseOrRepayOperation, CreditAccountState, CreditAccountStateProps, DetectedDelayedClaim, DetectedDelayedOperation, PreviewOperationError, ReplayMulticallResult, ReplayState, ReplayableOperation, UnsupportedOperationError, buildDelayedStrategyPositionOperationPreview, classifyCloseOrRepay, detectDelayedClaim, detectDelayedOperation, estimateClaimableAt, isCloseOrRepay, makeReplayState, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent };
|
|
13
|
+
export { CloseOrRepayOperation, CreditAccountState, CreditAccountStateProps, DetectedDelayedClaim, DetectedDelayedOperation, PreviewOperationError, ReplayMulticallResult, ReplayState, ReplayableOperation, UnsupportedOperationError, buildDelayedStrategyPositionOperationPreview, classifyCloseOrRepay, detectDelayedClaim, detectDelayedOperation, estimateClaimableAt, isCloseOrRepay, makeReplayState, previewAdjustStrategyPosition, previewExitOrRepayStrategyPosition, previewOperation, replayInnerOperations, replayMulticall, resolveDelayedClaimIntent, unpriceableTokenError };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChartBundle, ChartRange, PoolPositionChartMetric, StrategyPositionChartMetric } from "../../model/charts.js";
|
|
2
|
-
import { PoolPositionRef, Position, PositionFilter, PositionsTotals, StrategyPositionRef } from "../../model/positions.js";
|
|
2
|
+
import { PoolPositionRef, Position, PositionFilter, PositionTransaction, PositionsTotals, StrategyPositionRef } from "../../model/positions.js";
|
|
3
3
|
import { DataResponse } from "../../model/response.js";
|
|
4
4
|
import { PositionWithdrawals } from "../../model/withdrawals.js";
|
|
5
5
|
import "../../model/index.js";
|
|
@@ -42,6 +42,10 @@ declare class PositionsNamespace extends AbstractNamespace<MultichainSDK["positi
|
|
|
42
42
|
**/
|
|
43
43
|
charts<const Metrics extends readonly PoolPositionChartMetric[]>(key: PoolPositionRef, metrics: Metrics, range: ChartRange): Promise<DataResponse<ChartBundle<Metrics>>>;
|
|
44
44
|
charts<const Metrics extends readonly StrategyPositionChartMetric[]>(key: StrategyPositionRef, metrics: Metrics, range: ChartRange): Promise<DataResponse<ChartBundle<Metrics>>>;
|
|
45
|
+
/**
|
|
46
|
+
* {@inheritDoc IPositionsOffchainOnly.transactions}
|
|
47
|
+
**/
|
|
48
|
+
transactions(key: StrategyPositionRef): Promise<DataResponse<PositionTransaction[]>>;
|
|
45
49
|
/**
|
|
46
50
|
* {@inheritDoc IPositionsOnchainOnly.getCurrentWithdrawals}
|
|
47
51
|
**/
|