@morpho-org/morpho-sdk 9.0.0 → 9.1.0
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/README.md +3 -1
- package/lib/cjs/actions/blue/borrow.d.ts +1 -0
- package/lib/cjs/actions/blue/borrow.js +1 -0
- package/lib/cjs/actions/blue/refinance.d.ts +1 -0
- package/lib/cjs/actions/blue/refinance.js +3 -0
- package/lib/cjs/actions/blue/repay.d.ts +1 -0
- package/lib/cjs/actions/blue/repay.js +1 -0
- package/lib/cjs/actions/blue/repayWithdrawCollateral.d.ts +1 -0
- package/lib/cjs/actions/blue/repayWithdrawCollateral.js +2 -0
- package/lib/cjs/actions/blue/supply.d.ts +1 -0
- package/lib/cjs/actions/blue/supply.js +2 -0
- package/lib/cjs/actions/blue/supplyCollateral.d.ts +1 -0
- package/lib/cjs/actions/blue/supplyCollateral.js +1 -0
- package/lib/cjs/actions/blue/supplyCollateralBorrow.d.ts +1 -0
- package/lib/cjs/actions/blue/supplyCollateralBorrow.js +2 -0
- package/lib/cjs/actions/blue/withdraw.d.ts +1 -0
- package/lib/cjs/actions/blue/withdraw.js +2 -0
- package/lib/cjs/actions/blue/withdrawCollateral.d.ts +1 -0
- package/lib/cjs/actions/blue/withdrawCollateral.js +1 -0
- package/lib/cjs/actions/midnight/takeLend.d.ts +1 -0
- package/lib/cjs/actions/midnight/takeLend.js +1 -0
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.d.ts +1 -0
- package/lib/cjs/actions/midnight/takeRepayWithdrawCollateral.js +1 -0
- package/lib/cjs/blue/errors.d.ts +1 -1
- package/lib/cjs/blue/errors.js +2 -1
- package/lib/cjs/client/morphoViemExtension.d.ts +1 -1
- package/lib/cjs/client/morphoViemExtension.js +1 -7
- package/lib/cjs/entities/blue/blue.d.ts +43 -7
- package/lib/cjs/entities/blue/blue.js +27 -3
- package/lib/cjs/entities/midnight/midnight.d.ts +14 -6
- package/lib/cjs/entities/midnight/midnight.js +14 -6
- package/lib/cjs/entities/midnight/types.d.ts +9 -2
- package/lib/cjs/entities/vaultV2/vaultV2.d.ts +3 -1
- package/lib/cjs/entities/vaultV2/vaultV2.js +8 -5
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +40 -13
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +207 -70
- package/lib/cjs/errors.d.ts +1 -1
- package/lib/cjs/errors.js +3 -2
- package/lib/cjs/helpers/validate.d.ts +11 -1
- package/lib/cjs/helpers/validate.js +17 -1
- package/lib/cjs/helpers/validateTakeableOffers.d.ts +4 -2
- package/lib/cjs/helpers/validateTakeableOffers.js +12 -1
- package/lib/cjs/types/error.d.ts +10 -1
- package/lib/cjs/types/error.js +13 -2
- package/lib/cjs/types/sharedLiquidity.d.ts +27 -11
- package/lib/esm/actions/blue/borrow.d.ts +1 -0
- package/lib/esm/actions/blue/borrow.js +1 -0
- package/lib/esm/actions/blue/refinance.d.ts +1 -0
- package/lib/esm/actions/blue/refinance.js +4 -1
- package/lib/esm/actions/blue/repay.d.ts +1 -0
- package/lib/esm/actions/blue/repay.js +1 -0
- package/lib/esm/actions/blue/repayWithdrawCollateral.d.ts +1 -0
- package/lib/esm/actions/blue/repayWithdrawCollateral.js +3 -1
- package/lib/esm/actions/blue/supply.d.ts +1 -0
- package/lib/esm/actions/blue/supply.js +3 -1
- package/lib/esm/actions/blue/supplyCollateral.d.ts +1 -0
- package/lib/esm/actions/blue/supplyCollateral.js +1 -0
- package/lib/esm/actions/blue/supplyCollateralBorrow.d.ts +1 -0
- package/lib/esm/actions/blue/supplyCollateralBorrow.js +3 -1
- package/lib/esm/actions/blue/withdraw.d.ts +1 -0
- package/lib/esm/actions/blue/withdraw.js +3 -1
- package/lib/esm/actions/blue/withdrawCollateral.d.ts +1 -0
- package/lib/esm/actions/blue/withdrawCollateral.js +1 -0
- package/lib/esm/actions/midnight/takeLend.d.ts +1 -0
- package/lib/esm/actions/midnight/takeLend.js +1 -0
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.d.ts +1 -0
- package/lib/esm/actions/midnight/takeRepayWithdrawCollateral.js +1 -0
- package/lib/esm/blue/errors.d.ts +1 -1
- package/lib/esm/blue/errors.js +1 -1
- package/lib/esm/client/morphoViemExtension.d.ts +1 -1
- package/lib/esm/client/morphoViemExtension.js +1 -7
- package/lib/esm/entities/blue/blue.d.ts +43 -7
- package/lib/esm/entities/blue/blue.js +27 -3
- package/lib/esm/entities/midnight/midnight.d.ts +14 -6
- package/lib/esm/entities/midnight/midnight.js +14 -6
- package/lib/esm/entities/midnight/types.d.ts +9 -2
- package/lib/esm/entities/vaultV2/vaultV2.d.ts +3 -1
- package/lib/esm/entities/vaultV2/vaultV2.js +9 -6
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +40 -13
- package/lib/esm/entities/vaultV2BlueReallocationData.js +208 -71
- package/lib/esm/errors.d.ts +1 -1
- package/lib/esm/errors.js +1 -1
- package/lib/esm/helpers/validate.d.ts +11 -1
- package/lib/esm/helpers/validate.js +15 -0
- package/lib/esm/helpers/validateTakeableOffers.d.ts +4 -2
- package/lib/esm/helpers/validateTakeableOffers.js +13 -2
- package/lib/esm/types/error.d.ts +10 -1
- package/lib/esm/types/error.js +11 -1
- package/lib/esm/types/sharedLiquidity.d.ts +27 -11
- package/package.json +4 -4
|
@@ -5,12 +5,15 @@ export interface VaultV2BluePublicAllocatorOptions {
|
|
|
5
5
|
/** Whether Vault V2 public allocator discovery is enabled. */
|
|
6
6
|
readonly enabled?: boolean;
|
|
7
7
|
/**
|
|
8
|
-
* Timestamp at which market and Vault V2 state is evaluated.
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
8
|
+
* Timestamp at which market and Vault V2 state is evaluated. Defaults to the
|
|
9
|
+
* snapshot's timestamp (the fetched block's timestamp), never earlier than
|
|
10
|
+
* the latest market/vault `lastUpdate`; when the snapshot has no timestamp,
|
|
11
|
+
* defaults to the latest market/vault `lastUpdate`. Canonical state and the
|
|
12
|
+
* returned post-state stay at this timestamp; only target-market cap checks
|
|
13
|
+
* reserve interest on the vault's existing allocation through this timestamp
|
|
14
|
+
* plus `capAccrualBuffer`. For market-source reallocations the source
|
|
15
|
+
* position's interest is also reserved on cap ids shared with the target, and
|
|
16
|
+
* reserves persist across every leg of a plan.
|
|
14
17
|
*/
|
|
15
18
|
readonly timestamp?: BigIntish;
|
|
16
19
|
/**
|
|
@@ -53,16 +56,29 @@ export interface VaultV2BluePublicAllocatorOptions {
|
|
|
53
56
|
readonly reallocatableVaults?: Iterable<Address>;
|
|
54
57
|
/**
|
|
55
58
|
* Maximum utilization source markets may reach during friendly discovery,
|
|
56
|
-
* scaled by WAD.
|
|
57
|
-
*
|
|
59
|
+
* scaled by WAD. Within each penalty tier, the amount-aware planner falls
|
|
60
|
+
* back to 100% only when that tier's friendly pass leaves an absolute
|
|
61
|
+
* shortfall.
|
|
58
62
|
*
|
|
59
63
|
* @default 90% (900000000000000000n)
|
|
60
64
|
*/
|
|
61
65
|
readonly maxWithdrawalUtilization?: bigint;
|
|
62
66
|
/**
|
|
63
|
-
* Maximum proportional vault-asset penalty accepted
|
|
64
|
-
*
|
|
65
|
-
* penalty
|
|
67
|
+
* Maximum proportional vault-asset penalty accepted per call, scaled by
|
|
68
|
+
* WAD; higher-penalty vaults are ignored. Must not exceed WAD. Operation
|
|
69
|
+
* plans consider penalty tiers ascending, free first. Each tier uses friendly
|
|
70
|
+
* source utilization (90% by default) before 100%; positive tiers cover only
|
|
71
|
+
* the remaining absolute shortfall. Free capacity inside
|
|
72
|
+
* `allocatorCapHeadroom` stays unused, so a penalized leg can cover it.
|
|
73
|
+
* Getters count all vaults up to this limit. For `refinance`, compute the
|
|
74
|
+
* plan on the destination-market handle (for example,
|
|
75
|
+
* `client.morpho.blue(destination.marketParams, chainId)`), not the source
|
|
76
|
+
* handle. Pass the source position's `borrowAssets` accrued to
|
|
77
|
+
* `max(now, source.lastUpdate, destination.lastUpdate) + 2h` as
|
|
78
|
+
* `operation.amount`; the optional `operation.referralFeePct` is WAD-scaled.
|
|
79
|
+
* The planner includes the referral fee and its own allocator-leg penalties
|
|
80
|
+
* in destination debt, so penalized legs also cover their own penalty.
|
|
81
|
+
* Refinance never uses vaults with a 100% penalty.
|
|
66
82
|
*
|
|
67
83
|
* @default 0n
|
|
68
84
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morpho-org/morpho-sdk",
|
|
3
3
|
"description": "Abstraction layer for Morpho's complexity.",
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.1.0",
|
|
5
5
|
"author": "Morpho Association <contact@morpho.org>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -153,9 +153,9 @@
|
|
|
153
153
|
"MIGRATION-v8-to-v9.md"
|
|
154
154
|
],
|
|
155
155
|
"dependencies": {
|
|
156
|
-
"@morpho-org/blue-sdk": "^8.0.
|
|
157
|
-
"@morpho-org/blue-sdk-viem": "^7.
|
|
158
|
-
"@morpho-org/midnight-sdk": "^2.2.
|
|
156
|
+
"@morpho-org/blue-sdk": "^8.0.2",
|
|
157
|
+
"@morpho-org/blue-sdk-viem": "^7.1.0",
|
|
158
|
+
"@morpho-org/midnight-sdk": "^2.2.1",
|
|
159
159
|
"@morpho-org/morpho-ts": "^4.1.0"
|
|
160
160
|
},
|
|
161
161
|
"peerDependencies": {
|