@morpho-org/blue-sdk 5.2.0 → 5.3.0-next.1

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/lib/errors.d.ts CHANGED
@@ -25,6 +25,10 @@ export declare class UnsupportedPreLiquidationParamsError extends Error {
25
25
  readonly lltv: bigint;
26
26
  constructor(lltv: bigint);
27
27
  }
28
+ export declare class UnsupportedVaultV2AdapterError extends Error {
29
+ readonly address: Address;
30
+ constructor(address: Address);
31
+ }
28
32
  export declare namespace BlueErrors {
29
33
  class AlreadySet extends Error {
30
34
  readonly name: string;
@@ -65,6 +69,18 @@ export declare namespace BlueErrors {
65
69
  constructor(deadline: bigint);
66
70
  }
67
71
  }
72
+ export declare namespace VaultV2Errors {
73
+ class InvalidInterestAccrual extends Error {
74
+ readonly vault: Address;
75
+ readonly timestamp: bigint;
76
+ readonly lastUpdate: bigint;
77
+ constructor(vault: Address, timestamp: bigint, lastUpdate: bigint);
78
+ }
79
+ class UnsupportedLiquidityAdapter extends Error {
80
+ readonly address: Address;
81
+ constructor(address: Address);
82
+ }
83
+ }
68
84
  export interface ErrorClass<E extends Error> {
69
85
  new (...args: any[]): E;
70
86
  }
package/lib/errors.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BlueErrors = exports.UnsupportedPreLiquidationParamsError = exports.UnsupportedChainIdError = exports.UnknownVaultConfigError = exports.UnknownMarketParamsError = exports.UnknownTokenPriceError = exports.UnknownTokenError = exports.UnknownDataError = void 0;
3
+ exports.VaultV2Errors = exports.BlueErrors = exports.UnsupportedVaultV2AdapterError = exports.UnsupportedPreLiquidationParamsError = exports.UnsupportedChainIdError = exports.UnknownVaultConfigError = exports.UnknownMarketParamsError = exports.UnknownTokenPriceError = exports.UnknownTokenError = exports.UnknownDataError = void 0;
4
4
  exports._try = _try;
5
5
  const viem_1 = require("viem");
6
6
  class UnknownDataError extends Error {
@@ -54,6 +54,14 @@ class UnsupportedPreLiquidationParamsError extends Error {
54
54
  }
55
55
  }
56
56
  exports.UnsupportedPreLiquidationParamsError = UnsupportedPreLiquidationParamsError;
57
+ class UnsupportedVaultV2AdapterError extends Error {
58
+ address;
59
+ constructor(address) {
60
+ super(`vault v2 adapter "${address}" is not supported`);
61
+ this.address = address;
62
+ }
63
+ }
64
+ exports.UnsupportedVaultV2AdapterError = UnsupportedVaultV2AdapterError;
57
65
  var BlueErrors;
58
66
  (function (BlueErrors) {
59
67
  class AlreadySet extends Error {
@@ -133,6 +141,29 @@ var BlueErrors;
133
141
  }
134
142
  BlueErrors.ExpiredSignature = ExpiredSignature;
135
143
  })(BlueErrors || (exports.BlueErrors = BlueErrors = {}));
144
+ var VaultV2Errors;
145
+ (function (VaultV2Errors) {
146
+ class InvalidInterestAccrual extends Error {
147
+ vault;
148
+ timestamp;
149
+ lastUpdate;
150
+ constructor(vault, timestamp, lastUpdate) {
151
+ super(`invalid interest accrual on vault ${vault}: accrual timestamp ${timestamp} can't be prior to last update ${lastUpdate}`);
152
+ this.vault = vault;
153
+ this.timestamp = timestamp;
154
+ this.lastUpdate = lastUpdate;
155
+ }
156
+ }
157
+ VaultV2Errors.InvalidInterestAccrual = InvalidInterestAccrual;
158
+ class UnsupportedLiquidityAdapter extends Error {
159
+ address;
160
+ constructor(address) {
161
+ super(`unsupported liquidity adapter "${address}"`);
162
+ this.address = address;
163
+ }
164
+ }
165
+ VaultV2Errors.UnsupportedLiquidityAdapter = UnsupportedLiquidityAdapter;
166
+ })(VaultV2Errors || (exports.VaultV2Errors = VaultV2Errors = {}));
136
167
  function _try(accessor, ...errorClasses) {
137
168
  const maybeCatchError = (error) => {
138
169
  if (errorClasses.length === 0 ||
package/lib/index.d.ts CHANGED
@@ -11,3 +11,4 @@ export * from "./holding/index.js";
11
11
  export * from "./position/index.js";
12
12
  export * from "./vault/index.js";
13
13
  export * from "./preLiquidation.js";
14
+ export * from "./utils.js";
package/lib/index.js CHANGED
@@ -27,3 +27,4 @@ __exportStar(require("./holding/index.js"), exports);
27
27
  __exportStar(require("./position/index.js"), exports);
28
28
  __exportStar(require("./vault/index.js"), exports);
29
29
  __exportStar(require("./preLiquidation.js"), exports);
30
+ __exportStar(require("./utils.js"), exports);
@@ -1,17 +1,7 @@
1
1
  import { type RoundingDirection } from "../math/index.js";
2
2
  import type { BigIntish } from "../types.js";
3
+ import { type CapacityLimit } from "../utils.js";
3
4
  import { type IMarketParams, MarketParams } from "./MarketParams.js";
4
- export declare enum CapacityLimitReason {
5
- liquidity = "Liquidity",
6
- balance = "Balance",
7
- position = "Position",
8
- collateral = "Collateral",
9
- cap = "Cap"
10
- }
11
- export interface CapacityLimit {
12
- value: bigint;
13
- limiter: CapacityLimitReason;
14
- }
15
5
  export interface MaxBorrowOptions {
16
6
  maxLtv?: bigint;
17
7
  }
@@ -1,19 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Market = exports.CapacityLimitReason = void 0;
3
+ exports.Market = void 0;
4
4
  const morpho_ts_1 = require("@morpho-org/morpho-ts");
5
5
  const errors_js_1 = require("../errors.js");
6
6
  const index_js_1 = require("../math/index.js");
7
+ const utils_js_1 = require("../utils.js");
7
8
  const MarketParams_js_1 = require("./MarketParams.js");
8
9
  const MarketUtils_js_1 = require("./MarketUtils.js");
9
- var CapacityLimitReason;
10
- (function (CapacityLimitReason) {
11
- CapacityLimitReason["liquidity"] = "Liquidity";
12
- CapacityLimitReason["balance"] = "Balance";
13
- CapacityLimitReason["position"] = "Position";
14
- CapacityLimitReason["collateral"] = "Collateral";
15
- CapacityLimitReason["cap"] = "Cap";
16
- })(CapacityLimitReason || (exports.CapacityLimitReason = CapacityLimitReason = {}));
17
10
  /**
18
11
  * Represents a lending market on Morpho Blue.
19
12
  */
@@ -497,11 +490,11 @@ class Market {
497
490
  if (maxBorrowableAssets > liquidity)
498
491
  return {
499
492
  value: liquidity,
500
- limiter: CapacityLimitReason.liquidity,
493
+ limiter: utils_js_1.CapacityLimitReason.liquidity,
501
494
  };
502
495
  return {
503
496
  value: maxBorrowableAssets,
504
- limiter: CapacityLimitReason.collateral,
497
+ limiter: utils_js_1.CapacityLimitReason.collateral,
505
498
  };
506
499
  }
507
500
  /**
@@ -514,11 +507,11 @@ class Market {
514
507
  if (borrowAssets > loanTokenBalance)
515
508
  return {
516
509
  value: loanTokenBalance,
517
- limiter: CapacityLimitReason.balance,
510
+ limiter: utils_js_1.CapacityLimitReason.balance,
518
511
  };
519
512
  return {
520
513
  value: borrowAssets,
521
- limiter: CapacityLimitReason.position,
514
+ limiter: utils_js_1.CapacityLimitReason.position,
522
515
  };
523
516
  }
524
517
  /**
@@ -532,11 +525,11 @@ class Market {
532
525
  if (supplyAssets > liquidity)
533
526
  return {
534
527
  value: liquidity,
535
- limiter: CapacityLimitReason.liquidity,
528
+ limiter: utils_js_1.CapacityLimitReason.liquidity,
536
529
  };
537
530
  return {
538
531
  value: supplyAssets,
539
- limiter: CapacityLimitReason.position,
532
+ limiter: utils_js_1.CapacityLimitReason.position,
540
533
  };
541
534
  }
542
535
  /**
@@ -552,11 +545,11 @@ class Market {
552
545
  if (position.collateral > withdrawableCollateral)
553
546
  return {
554
547
  value: withdrawableCollateral,
555
- limiter: CapacityLimitReason.collateral,
548
+ limiter: utils_js_1.CapacityLimitReason.collateral,
556
549
  };
557
550
  return {
558
551
  value: position.collateral,
559
- limiter: CapacityLimitReason.position,
552
+ limiter: utils_js_1.CapacityLimitReason.position,
560
553
  };
561
554
  }
562
555
  /**
@@ -570,14 +563,14 @@ class Market {
570
563
  return {
571
564
  supply: {
572
565
  value: loanTokenBalance,
573
- limiter: CapacityLimitReason.balance,
566
+ limiter: utils_js_1.CapacityLimitReason.balance,
574
567
  },
575
568
  withdraw: this.getWithdrawCapacityLimit(position),
576
569
  borrow: this.getBorrowCapacityLimit(position, options?.borrow),
577
570
  repay: this.getRepayCapacityLimit(position.borrowShares, loanTokenBalance),
578
571
  supplyCollateral: {
579
572
  value: collateralTokenBalance,
580
- limiter: CapacityLimitReason.balance,
573
+ limiter: utils_js_1.CapacityLimitReason.balance,
581
574
  },
582
575
  withdrawCollateral: this.getWithdrawCollateralCapacityLimit(position, options?.withdrawCollateral),
583
576
  };
@@ -109,7 +109,7 @@ export declare class AccrualPosition extends Position implements IAccrualPositio
109
109
  * Returns the maximum amount of loan assets that can be withdrawn given a certain supply position
110
110
  * and a balance of loan assets, and the reason for the limit.
111
111
  */
112
- get withdrawCapacityLimit(): import("../market/Market.js").CapacityLimit;
112
+ get withdrawCapacityLimit(): import("../utils.js").CapacityLimit;
113
113
  /**
114
114
  * Returns a new position derived from this position, whose interest has been accrued up to the given timestamp.
115
115
  * @param timestamp The timestamp at which to accrue interest. Must be greater than or equal to the market's `lastUpdate`.
@@ -137,9 +137,9 @@ export declare class AccrualPosition extends Position implements IAccrualPositio
137
137
  assets: bigint;
138
138
  shares: bigint;
139
139
  };
140
- getBorrowCapacityLimit(options?: MaxBorrowOptions): import("../market/Market.js").CapacityLimit | undefined;
141
- getWithdrawCollateralCapacityLimit(options?: MaxWithdrawCollateralOptions): import("../market/Market.js").CapacityLimit | undefined;
142
- getRepayCapacityLimit(loanTokenBalance: bigint): import("../market/Market.js").CapacityLimit;
140
+ getBorrowCapacityLimit(options?: MaxBorrowOptions): import("../utils.js").CapacityLimit | undefined;
141
+ getWithdrawCollateralCapacityLimit(options?: MaxWithdrawCollateralOptions): import("../utils.js").CapacityLimit | undefined;
142
+ getRepayCapacityLimit(loanTokenBalance: bigint): import("../utils.js").CapacityLimit;
143
143
  getMaxCapacities(loanTokenBalance: bigint, collateralTokenBalance: bigint, options?: {
144
144
  borrow?: MaxBorrowOptions;
145
145
  withdrawCollateral?: MaxWithdrawCollateralOptions;
@@ -4,6 +4,7 @@ exports.AccrualPosition = exports.Position = void 0;
4
4
  const errors_js_1 = require("../errors.js");
5
5
  const index_js_1 = require("../market/index.js");
6
6
  const MathLib_js_1 = require("../math/MathLib.js");
7
+ const utils_js_1 = require("../utils.js");
7
8
  class Position {
8
9
  /**
9
10
  * The user holding this position.
@@ -225,14 +226,14 @@ class AccrualPosition extends Position {
225
226
  return {
226
227
  supply: {
227
228
  value: loanTokenBalance,
228
- limiter: index_js_1.CapacityLimitReason.balance,
229
+ limiter: utils_js_1.CapacityLimitReason.balance,
229
230
  },
230
231
  withdraw: this.withdrawCapacityLimit,
231
232
  borrow: this.getBorrowCapacityLimit(options?.borrow),
232
233
  repay: this.getRepayCapacityLimit(loanTokenBalance),
233
234
  supplyCollateral: {
234
235
  value: collateralTokenBalance,
235
- limiter: index_js_1.CapacityLimitReason.balance,
236
+ limiter: utils_js_1.CapacityLimitReason.balance,
236
237
  },
237
238
  withdrawCollateral: this.getWithdrawCollateralCapacityLimit(options?.withdrawCollateral),
238
239
  };
@@ -1,5 +1,5 @@
1
1
  import type { RoundingDirection } from "../math/index.js";
2
- import type { Address } from "../types.js";
2
+ import type { Address, BigIntish } from "../types.js";
3
3
  import type { IVaultConfig } from "../vault/VaultConfig.js";
4
4
  import { WrappedToken } from "./WrappedToken.js";
5
5
  export interface IVaultToken {
@@ -18,6 +18,6 @@ export declare class VaultToken extends WrappedToken implements IVaultToken {
18
18
  */
19
19
  totalAssets: bigint;
20
20
  constructor(config: IVaultConfig, { totalAssets, totalSupply }: IVaultToken);
21
- protected _wrap(amount: bigint, rounding: RoundingDirection): bigint;
22
- protected _unwrap(amount: bigint, rounding: RoundingDirection): bigint;
21
+ protected _wrap(amount: BigIntish, rounding: RoundingDirection): bigint;
22
+ protected _unwrap(amount: BigIntish, rounding: RoundingDirection): bigint;
23
23
  }
package/lib/utils.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ export declare enum CapacityLimitReason {
2
+ liquidity = "Liquidity",
3
+ balance = "Balance",
4
+ position = "Position",
5
+ collateral = "Collateral",
6
+ cap = "Cap",
7
+ vaultV2_absoluteCap = "VaultV2_AbsoluteCap",
8
+ vaultV2_relativeCap = "VaultV2_RelativeCap"
9
+ }
10
+ export interface CapacityLimit {
11
+ value: bigint;
12
+ limiter: CapacityLimitReason;
13
+ }
package/lib/utils.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CapacityLimitReason = void 0;
4
+ var CapacityLimitReason;
5
+ (function (CapacityLimitReason) {
6
+ CapacityLimitReason["liquidity"] = "Liquidity";
7
+ CapacityLimitReason["balance"] = "Balance";
8
+ CapacityLimitReason["position"] = "Position";
9
+ CapacityLimitReason["collateral"] = "Collateral";
10
+ CapacityLimitReason["cap"] = "Cap";
11
+ CapacityLimitReason["vaultV2_absoluteCap"] = "VaultV2_AbsoluteCap";
12
+ CapacityLimitReason["vaultV2_relativeCap"] = "VaultV2_RelativeCap";
13
+ })(CapacityLimitReason || (exports.CapacityLimitReason = CapacityLimitReason = {}));
@@ -1,7 +1,7 @@
1
- import { type CapacityLimit } from "../market/index.js";
2
1
  import { type RoundingDirection } from "../math/index.js";
3
2
  import { VaultToken } from "../token/index.js";
4
3
  import type { Address, BigIntish, MarketId } from "../types.js";
4
+ import { type CapacityLimit } from "../utils.js";
5
5
  import type { IVaultConfig } from "./VaultConfig.js";
6
6
  import { type IVaultMarketAllocation, VaultMarketAllocation } from "./VaultMarketAllocation.js";
7
7
  export interface Pending<T> {
@@ -116,8 +116,8 @@ export declare class Vault extends VaultToken implements IVault {
116
116
  * The amount of interest in assets accrued since the last interaction with the vault.
117
117
  */
118
118
  get totalInterest(): bigint;
119
- toAssets(shares: bigint, rounding?: RoundingDirection): bigint;
120
- toShares(assets: bigint, rounding?: RoundingDirection): bigint;
119
+ toAssets(shares: BigIntish, rounding?: RoundingDirection): bigint;
120
+ toShares(assets: BigIntish, rounding?: RoundingDirection): bigint;
121
121
  }
122
122
  export interface CollateralAllocation {
123
123
  address: Address;
@@ -178,11 +178,31 @@ export declare class AccrualVault extends Vault implements IAccrualVault {
178
178
  */
179
179
  getNetApy(timestamp?: BigIntish): number;
180
180
  getAllocationProportion(marketId: MarketId): bigint;
181
+ /**
182
+ * Returns the deposit capacity limit of a given amount of assets on the vault.
183
+ * @param assets The maximum amount of assets to deposit.
184
+ * @deprecated Use `maxDeposit` instead.
185
+ */
181
186
  getDepositCapacityLimit(assets: bigint): CapacityLimit;
187
+ /**
188
+ * Returns the withdraw capacity limit corresponding to a given amount of shares of the vault.
189
+ * @param shares The maximum amount of shares to redeem.
190
+ * @deprecated Use `maxWithdraw` instead.
191
+ */
182
192
  getWithdrawCapacityLimit(shares: bigint): CapacityLimit;
193
+ /**
194
+ * Returns the maximum amount of assets that can be deposited to the vault.
195
+ * @param assets The maximum amount of assets to deposit.
196
+ */
197
+ maxDeposit(assets: BigIntish): CapacityLimit;
198
+ /**
199
+ * Returns the maximum amount of assets that can be withdrawn from the vault.
200
+ * @param shares The maximum amount of shares to redeem.
201
+ */
202
+ maxWithdraw(shares: BigIntish): CapacityLimit;
183
203
  /**
184
204
  * Returns a new vault derived from this vault, whose interest has been accrued up to the given timestamp.
185
205
  * @param timestamp The timestamp at which to accrue interest. Must be greater than or equal to each of the vault's market's `lastUpdate`.
186
206
  */
187
- accrueInterest(timestamp: BigIntish): AccrualVault;
207
+ accrueInterest(timestamp?: BigIntish): AccrualVault;
188
208
  }
@@ -5,6 +5,7 @@ const morpho_ts_1 = require("@morpho-org/morpho-ts");
5
5
  const index_js_1 = require("../market/index.js");
6
6
  const index_js_2 = require("../math/index.js");
7
7
  const index_js_3 = require("../token/index.js");
8
+ const utils_js_1 = require("../utils.js");
8
9
  const VaultMarketAllocation_js_1 = require("./VaultMarketAllocation.js");
9
10
  class Vault extends index_js_3.VaultToken {
10
11
  /**
@@ -208,7 +209,28 @@ class AccrualVault extends Vault {
208
209
  return 0n;
209
210
  return index_js_2.MathLib.wDivDown(allocation.position.supplyAssets, this.totalAssets);
210
211
  }
212
+ /**
213
+ * Returns the deposit capacity limit of a given amount of assets on the vault.
214
+ * @param assets The maximum amount of assets to deposit.
215
+ * @deprecated Use `maxDeposit` instead.
216
+ */
211
217
  getDepositCapacityLimit(assets) {
218
+ return this.maxDeposit(assets);
219
+ }
220
+ /**
221
+ * Returns the withdraw capacity limit corresponding to a given amount of shares of the vault.
222
+ * @param shares The maximum amount of shares to redeem.
223
+ * @deprecated Use `maxWithdraw` instead.
224
+ */
225
+ getWithdrawCapacityLimit(shares) {
226
+ return this.maxWithdraw(shares);
227
+ }
228
+ /**
229
+ * Returns the maximum amount of assets that can be deposited to the vault.
230
+ * @param assets The maximum amount of assets to deposit.
231
+ */
232
+ maxDeposit(assets) {
233
+ assets = BigInt(assets);
212
234
  const suppliable = this.allocations
213
235
  .values()
214
236
  .reduce((total, { config: { cap }, position: { marketId, supplyAssets } }) => index_js_2.MathLib.min(total +
@@ -218,24 +240,28 @@ class AccrualVault extends Vault {
218
240
  if (assets > suppliable)
219
241
  return {
220
242
  value: suppliable,
221
- limiter: index_js_1.CapacityLimitReason.cap,
243
+ limiter: utils_js_1.CapacityLimitReason.cap,
222
244
  };
223
245
  return {
224
246
  value: assets,
225
- limiter: index_js_1.CapacityLimitReason.balance,
247
+ limiter: utils_js_1.CapacityLimitReason.balance,
226
248
  };
227
249
  }
228
- getWithdrawCapacityLimit(shares) {
250
+ /**
251
+ * Returns the maximum amount of assets that can be withdrawn from the vault.
252
+ * @param shares The maximum amount of shares to redeem.
253
+ */
254
+ maxWithdraw(shares) {
229
255
  const assets = this.toAssets(shares);
230
256
  const { liquidity } = this;
231
257
  if (assets > liquidity)
232
258
  return {
233
259
  value: liquidity,
234
- limiter: index_js_1.CapacityLimitReason.liquidity,
260
+ limiter: utils_js_1.CapacityLimitReason.liquidity,
235
261
  };
236
262
  return {
237
263
  value: assets,
238
- limiter: index_js_1.CapacityLimitReason.balance,
264
+ limiter: utils_js_1.CapacityLimitReason.balance,
239
265
  };
240
266
  }
241
267
  /**
@@ -5,3 +5,4 @@ export * from "./VaultMarketConfig.js";
5
5
  export * from "./VaultMarketPublicAllocatorConfig.js";
6
6
  export * from "./VaultUser.js";
7
7
  export * from "./Vault.js";
8
+ export * from "./v2";
@@ -21,3 +21,4 @@ __exportStar(require("./VaultMarketConfig.js"), exports);
21
21
  __exportStar(require("./VaultMarketPublicAllocatorConfig.js"), exports);
22
22
  __exportStar(require("./VaultUser.js"), exports);
23
23
  __exportStar(require("./Vault.js"), exports);
24
+ __exportStar(require("./v2"), exports);
@@ -0,0 +1,87 @@
1
+ import { type Address, type Hash, type Hex } from "viem";
2
+ import { type RoundingDirection } from "../../math";
3
+ import { type IToken, WrappedToken } from "../../token";
4
+ import type { BigIntish } from "../../types";
5
+ import { type CapacityLimit } from "../../utils";
6
+ import type { IAccrualVaultV2Adapter } from "./VaultV2Adapter";
7
+ export interface IVaultV2Allocation {
8
+ id: Hash;
9
+ absoluteCap: bigint;
10
+ relativeCap: bigint;
11
+ allocation: bigint;
12
+ }
13
+ export interface IVaultV2 extends IToken {
14
+ asset: Address;
15
+ /**
16
+ * The total assets, *including* virtually accrued interest.
17
+ */
18
+ totalAssets: bigint;
19
+ /**
20
+ * The total assets, *excluding* virtually accrued interest.
21
+ */
22
+ _totalAssets: bigint;
23
+ /**
24
+ * The total supply of shares.
25
+ */
26
+ totalSupply: bigint;
27
+ virtualShares: bigint;
28
+ maxRate: bigint;
29
+ lastUpdate: bigint;
30
+ adapters: Address[];
31
+ liquidityAdapter: Address;
32
+ liquidityData: Hex;
33
+ liquidityAllocations: IVaultV2Allocation[] | undefined;
34
+ performanceFee: bigint;
35
+ managementFee: bigint;
36
+ performanceFeeRecipient: Address;
37
+ managementFeeRecipient: Address;
38
+ }
39
+ export declare class VaultV2 extends WrappedToken implements IVaultV2 {
40
+ readonly asset: Address;
41
+ totalAssets: bigint;
42
+ _totalAssets: bigint;
43
+ totalSupply: bigint;
44
+ virtualShares: bigint;
45
+ maxRate: bigint;
46
+ lastUpdate: bigint;
47
+ adapters: `0x${string}`[];
48
+ liquidityAdapter: `0x${string}`;
49
+ liquidityData: `0x${string}`;
50
+ liquidityAllocations: IVaultV2Allocation[] | undefined;
51
+ performanceFee: bigint;
52
+ managementFee: bigint;
53
+ performanceFeeRecipient: `0x${string}`;
54
+ managementFeeRecipient: `0x${string}`;
55
+ constructor({ asset, totalAssets, _totalAssets, totalSupply, virtualShares, maxRate, lastUpdate, adapters, liquidityAdapter, liquidityData, liquidityAllocations, performanceFee, managementFee, performanceFeeRecipient, managementFeeRecipient, ...config }: IVaultV2);
56
+ toAssets(shares: BigIntish): bigint;
57
+ toShares(assets: BigIntish): bigint;
58
+ protected _wrap(amount: BigIntish, rounding: RoundingDirection): bigint;
59
+ protected _unwrap(amount: BigIntish, rounding: RoundingDirection): bigint;
60
+ }
61
+ export interface IAccrualVaultV2 extends Omit<IVaultV2, "adapters"> {
62
+ }
63
+ export declare class AccrualVaultV2 extends VaultV2 implements IAccrualVaultV2 {
64
+ accrualLiquidityAdapter: IAccrualVaultV2Adapter | undefined;
65
+ accrualAdapters: IAccrualVaultV2Adapter[];
66
+ assetBalance: bigint;
67
+ constructor(vault: IAccrualVaultV2, accrualLiquidityAdapter: IAccrualVaultV2Adapter | undefined, accrualAdapters: IAccrualVaultV2Adapter[], assetBalance: bigint);
68
+ /**
69
+ * Returns the maximum amount of assets that can be deposited to the vault.
70
+ * @param assets The maximum amount of assets to deposit.
71
+ */
72
+ maxDeposit(assets: BigIntish): CapacityLimit;
73
+ /**
74
+ * Returns the maximum amount of assets that can be withdrawn from the vault.
75
+ * @param shares The maximum amount of shares to redeem.
76
+ */
77
+ maxWithdraw(shares: BigIntish): CapacityLimit;
78
+ /**
79
+ * Returns a new vault derived from this vault, whose interest has been accrued up to the given timestamp.
80
+ * @param timestamp The timestamp at which to accrue interest. Must be greater than or equal to the vault's `lastUpdate`.
81
+ */
82
+ accrueInterest(timestamp: BigIntish): {
83
+ vault: AccrualVaultV2;
84
+ performanceFeeShares: bigint;
85
+ managementFeeShares: bigint;
86
+ };
87
+ }
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccrualVaultV2 = exports.VaultV2 = void 0;
4
+ const viem_1 = require("viem");
5
+ const errors_1 = require("../../errors");
6
+ const math_1 = require("../../math");
7
+ const token_1 = require("../../token");
8
+ const utils_1 = require("../../utils");
9
+ class VaultV2 extends token_1.WrappedToken {
10
+ asset;
11
+ totalAssets;
12
+ _totalAssets;
13
+ totalSupply;
14
+ virtualShares;
15
+ maxRate;
16
+ lastUpdate;
17
+ adapters;
18
+ liquidityAdapter;
19
+ liquidityData;
20
+ liquidityAllocations;
21
+ performanceFee;
22
+ managementFee;
23
+ performanceFeeRecipient;
24
+ managementFeeRecipient;
25
+ constructor({ asset, totalAssets, _totalAssets, totalSupply, virtualShares, maxRate, lastUpdate, adapters, liquidityAdapter, liquidityData, liquidityAllocations, performanceFee, managementFee, performanceFeeRecipient, managementFeeRecipient, ...config }) {
26
+ super(config, asset);
27
+ this.asset = asset;
28
+ this.totalAssets = totalAssets;
29
+ this._totalAssets = _totalAssets;
30
+ this.totalSupply = totalSupply;
31
+ this.virtualShares = virtualShares;
32
+ this.maxRate = maxRate;
33
+ this.lastUpdate = lastUpdate;
34
+ this.adapters = adapters;
35
+ this.liquidityAdapter = liquidityAdapter;
36
+ this.liquidityData = liquidityData;
37
+ this.liquidityAllocations = liquidityAllocations;
38
+ this.performanceFee = performanceFee;
39
+ this.managementFee = managementFee;
40
+ this.performanceFeeRecipient = performanceFeeRecipient;
41
+ this.managementFeeRecipient = managementFeeRecipient;
42
+ }
43
+ toAssets(shares) {
44
+ return this._unwrap(shares, "Down");
45
+ }
46
+ toShares(assets) {
47
+ return this._wrap(assets, "Down");
48
+ }
49
+ _wrap(amount, rounding) {
50
+ return math_1.MathLib.mulDiv(amount, this.totalSupply + this.virtualShares, this.totalAssets + 1n, rounding);
51
+ }
52
+ _unwrap(amount, rounding) {
53
+ return math_1.MathLib.mulDiv(amount, this.totalAssets + 1n, this.totalSupply + this.virtualShares, rounding);
54
+ }
55
+ }
56
+ exports.VaultV2 = VaultV2;
57
+ class AccrualVaultV2 extends VaultV2 {
58
+ accrualLiquidityAdapter;
59
+ accrualAdapters;
60
+ assetBalance;
61
+ constructor(vault, accrualLiquidityAdapter, accrualAdapters, assetBalance) {
62
+ super({ ...vault, adapters: accrualAdapters.map((a) => a.address) });
63
+ this.accrualLiquidityAdapter = accrualLiquidityAdapter;
64
+ this.accrualAdapters = accrualAdapters;
65
+ this.assetBalance = assetBalance;
66
+ }
67
+ /**
68
+ * Returns the maximum amount of assets that can be deposited to the vault.
69
+ * @param assets The maximum amount of assets to deposit.
70
+ */
71
+ maxDeposit(assets) {
72
+ if (this.liquidityAdapter === viem_1.zeroAddress)
73
+ return { value: BigInt(assets), limiter: utils_1.CapacityLimitReason.balance };
74
+ let liquidityAdapterLimit;
75
+ if (this.accrualLiquidityAdapter != null)
76
+ liquidityAdapterLimit = this.accrualLiquidityAdapter.maxDeposit(this.liquidityData, assets);
77
+ if (this.liquidityAllocations == null || liquidityAdapterLimit == null)
78
+ throw new errors_1.VaultV2Errors.UnsupportedLiquidityAdapter(this.liquidityAdapter);
79
+ // At this stage: `liquidityAdapterLimit.value <= assets`
80
+ for (const { absoluteCap, relativeCap, allocation } of this
81
+ .liquidityAllocations) {
82
+ // `absoluteCap` can be set lower than `allocation`.
83
+ const absoluteMaxDeposit = math_1.MathLib.zeroFloorSub(absoluteCap, allocation);
84
+ if (liquidityAdapterLimit.value > absoluteMaxDeposit)
85
+ return {
86
+ value: absoluteMaxDeposit,
87
+ limiter: utils_1.CapacityLimitReason.vaultV2_absoluteCap,
88
+ };
89
+ if (relativeCap !== math_1.MathLib.WAD) {
90
+ // `relativeCap` can be set lower than `allocation / totalAssets`.
91
+ const relativeMaxDeposit = math_1.MathLib.zeroFloorSub(math_1.MathLib.wMulDown(this.totalAssets, relativeCap), allocation);
92
+ if (liquidityAdapterLimit.value > relativeMaxDeposit)
93
+ return {
94
+ value: relativeMaxDeposit,
95
+ limiter: utils_1.CapacityLimitReason.vaultV2_relativeCap,
96
+ };
97
+ }
98
+ }
99
+ return liquidityAdapterLimit;
100
+ }
101
+ /**
102
+ * Returns the maximum amount of assets that can be withdrawn from the vault.
103
+ * @param shares The maximum amount of shares to redeem.
104
+ */
105
+ maxWithdraw(shares) {
106
+ const assets = this.toAssets(shares);
107
+ if (this.liquidityAdapter === viem_1.zeroAddress)
108
+ return { value: BigInt(assets), limiter: utils_1.CapacityLimitReason.balance };
109
+ let liquidity = this.assetBalance;
110
+ if (this.accrualLiquidityAdapter != null)
111
+ liquidity += this.accrualLiquidityAdapter.maxWithdraw(this.liquidityData).value;
112
+ if (assets > liquidity)
113
+ return {
114
+ value: liquidity,
115
+ limiter: utils_1.CapacityLimitReason.liquidity,
116
+ };
117
+ return {
118
+ value: assets,
119
+ limiter: utils_1.CapacityLimitReason.balance,
120
+ };
121
+ }
122
+ /**
123
+ * Returns a new vault derived from this vault, whose interest has been accrued up to the given timestamp.
124
+ * @param timestamp The timestamp at which to accrue interest. Must be greater than or equal to the vault's `lastUpdate`.
125
+ */
126
+ accrueInterest(timestamp) {
127
+ const vault = new AccrualVaultV2(this, this.accrualLiquidityAdapter, this.accrualAdapters, this.assetBalance);
128
+ timestamp = BigInt(timestamp);
129
+ const elapsed = timestamp - this.lastUpdate;
130
+ if (elapsed < 0n)
131
+ throw new errors_1.VaultV2Errors.InvalidInterestAccrual(this.address, timestamp, this.lastUpdate);
132
+ // Corresponds to the `firstTotalAssets == 0` onchain check.
133
+ if (elapsed === 0n)
134
+ return { vault, performanceFeeShares: 0n, managementFeeShares: 0n };
135
+ const realAssets = vault.accrualAdapters.reduce((curr, adapter) => curr + adapter.realAssets(timestamp), vault.assetBalance);
136
+ const maxTotalAssets = vault._totalAssets +
137
+ math_1.MathLib.wMulDown(vault._totalAssets * elapsed, vault.maxRate);
138
+ const newTotalAssets = math_1.MathLib.min(realAssets, maxTotalAssets);
139
+ const interest = math_1.MathLib.zeroFloorSub(newTotalAssets, vault._totalAssets);
140
+ const performanceFeeAssets = interest > 0n && vault.performanceFee > 0n
141
+ ? math_1.MathLib.wMulDown(interest, vault.performanceFee)
142
+ : 0n;
143
+ const managementFeeAssets = elapsed > 0n && vault.managementFee > 0n
144
+ ? math_1.MathLib.wMulDown(newTotalAssets * elapsed, vault.managementFee)
145
+ : 0n;
146
+ const newTotalAssetsWithoutFees = newTotalAssets - performanceFeeAssets - managementFeeAssets;
147
+ const performanceFeeShares = math_1.MathLib.mulDivDown(performanceFeeAssets, vault.totalSupply + vault.virtualShares, newTotalAssetsWithoutFees + 1n);
148
+ const managementFeeShares = math_1.MathLib.mulDivDown(managementFeeAssets, vault.totalSupply + vault.virtualShares, newTotalAssetsWithoutFees + 1n);
149
+ vault.totalAssets = newTotalAssets;
150
+ vault._totalAssets = newTotalAssets;
151
+ if (performanceFeeShares)
152
+ vault.totalSupply += performanceFeeShares;
153
+ if (managementFeeShares)
154
+ vault.totalSupply += managementFeeShares;
155
+ vault.lastUpdate = BigInt(timestamp);
156
+ return { vault, performanceFeeShares, managementFeeShares };
157
+ }
158
+ }
159
+ exports.AccrualVaultV2 = AccrualVaultV2;
@@ -0,0 +1,29 @@
1
+ import type { Address, Hash, Hex } from "viem";
2
+ import type { BigIntish } from "../../types";
3
+ import type { CapacityLimit } from "../../utils";
4
+ export interface IVaultV2Adapter {
5
+ address: Address;
6
+ parentVault: Address;
7
+ adapterId: Hash;
8
+ skimRecipient: Address;
9
+ }
10
+ export declare abstract class VaultV2Adapter implements IVaultV2Adapter {
11
+ readonly address: Address;
12
+ readonly parentVault: Address;
13
+ readonly adapterId: Hash;
14
+ skimRecipient: Address;
15
+ constructor({ address, parentVault, adapterId, skimRecipient, }: IVaultV2Adapter);
16
+ }
17
+ export interface IAccrualVaultV2Adapter extends IVaultV2Adapter {
18
+ realAssets(timestamp: BigIntish): bigint;
19
+ /**
20
+ * Returns the maximum amount of assets that can be deposited to this adapter.
21
+ * @param assets The maximum amount of assets to deposit.
22
+ */
23
+ maxDeposit(data: Hex, assets: BigIntish): CapacityLimit;
24
+ /**
25
+ * Returns the maximum amount of assets that can be withdrawn from this adapter.
26
+ * @param shares The maximum amount of shares to redeem.
27
+ */
28
+ maxWithdraw(data: Hex): CapacityLimit;
29
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VaultV2Adapter = void 0;
4
+ class VaultV2Adapter {
5
+ address;
6
+ parentVault;
7
+ adapterId;
8
+ skimRecipient;
9
+ constructor({ address, parentVault, adapterId, skimRecipient, }) {
10
+ this.address = address;
11
+ this.parentVault = parentVault;
12
+ this.adapterId = adapterId;
13
+ this.skimRecipient = skimRecipient;
14
+ }
15
+ }
16
+ exports.VaultV2Adapter = VaultV2Adapter;
@@ -0,0 +1,30 @@
1
+ import { type Address, type Hex } from "viem";
2
+ import { type IMarketParams, MarketParams } from "../../market";
3
+ import type { AccrualPosition } from "../../position";
4
+ import type { BigIntish } from "../../types";
5
+ import { CapacityLimitReason } from "../../utils";
6
+ import { VaultV2Adapter } from "./VaultV2Adapter";
7
+ import type { IAccrualVaultV2Adapter, IVaultV2Adapter } from "./VaultV2Adapter";
8
+ export interface IVaultV2MorphoMarketV1Adapter extends Omit<IVaultV2Adapter, "adapterId"> {
9
+ marketParamsList: IMarketParams[];
10
+ }
11
+ export declare class VaultV2MorphoMarketV1Adapter extends VaultV2Adapter implements IVaultV2MorphoMarketV1Adapter {
12
+ static adapterId(address: Address): `0x${string}`;
13
+ static collateralId(address: Address): `0x${string}`;
14
+ static marketParamsId(address: Address, params: MarketParams): `0x${string}`;
15
+ marketParamsList: MarketParams[];
16
+ constructor({ marketParamsList, ...vaultV2Adapter }: IVaultV2MorphoMarketV1Adapter);
17
+ ids(params: MarketParams): `0x${string}`[];
18
+ }
19
+ export interface IAccrualVaultV2MorphoMarketV1Adapter extends IVaultV2MorphoMarketV1Adapter {
20
+ }
21
+ export declare class AccrualVaultV2MorphoMarketV1Adapter extends VaultV2MorphoMarketV1Adapter implements IAccrualVaultV2MorphoMarketV1Adapter, IAccrualVaultV2Adapter {
22
+ positions: AccrualPosition[];
23
+ constructor(adapter: IAccrualVaultV2MorphoMarketV1Adapter, positions: AccrualPosition[]);
24
+ realAssets(timestamp?: BigIntish): bigint;
25
+ maxDeposit(_data: Hex, assets: BigIntish): {
26
+ value: bigint;
27
+ limiter: CapacityLimitReason;
28
+ };
29
+ maxWithdraw(_data: Hex): import("../../utils").CapacityLimit;
30
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccrualVaultV2MorphoMarketV1Adapter = exports.VaultV2MorphoMarketV1Adapter = void 0;
4
+ const viem_1 = require("viem");
5
+ const market_1 = require("../../market");
6
+ const utils_1 = require("../../utils");
7
+ const VaultV2Adapter_1 = require("./VaultV2Adapter");
8
+ const marketParamsAbi = {
9
+ type: "tuple",
10
+ components: [
11
+ { type: "address", name: "loanToken" },
12
+ { type: "address", name: "collateralToken" },
13
+ { type: "address", name: "oracle" },
14
+ { type: "address", name: "irm" },
15
+ { type: "uint256", name: "lltv" },
16
+ ],
17
+ };
18
+ class VaultV2MorphoMarketV1Adapter extends VaultV2Adapter_1.VaultV2Adapter {
19
+ static adapterId(address) {
20
+ return (0, viem_1.keccak256)((0, viem_1.encodeAbiParameters)([{ type: "string" }, { type: "address" }], ["this", address]));
21
+ }
22
+ static collateralId(address) {
23
+ return (0, viem_1.keccak256)((0, viem_1.encodeAbiParameters)([{ type: "string" }, { type: "address" }], ["collateralToken", address]));
24
+ }
25
+ static marketParamsId(address, params) {
26
+ return (0, viem_1.keccak256)((0, viem_1.encodeAbiParameters)([{ type: "string" }, { type: "address" }, marketParamsAbi], ["this/marketParams", address, params]));
27
+ }
28
+ marketParamsList;
29
+ constructor({ marketParamsList, ...vaultV2Adapter }) {
30
+ super({
31
+ ...vaultV2Adapter,
32
+ adapterId: VaultV2MorphoMarketV1Adapter.adapterId(vaultV2Adapter.address),
33
+ });
34
+ this.marketParamsList = marketParamsList.map((params) => new market_1.MarketParams(params));
35
+ }
36
+ ids(params) {
37
+ return [
38
+ this.adapterId,
39
+ VaultV2MorphoMarketV1Adapter.collateralId(params.collateralToken),
40
+ VaultV2MorphoMarketV1Adapter.marketParamsId(this.address, params),
41
+ ];
42
+ }
43
+ }
44
+ exports.VaultV2MorphoMarketV1Adapter = VaultV2MorphoMarketV1Adapter;
45
+ class AccrualVaultV2MorphoMarketV1Adapter extends VaultV2MorphoMarketV1Adapter {
46
+ positions;
47
+ constructor(adapter, positions) {
48
+ super(adapter);
49
+ this.positions = positions;
50
+ }
51
+ realAssets(timestamp) {
52
+ return this.positions.reduce((total, position) => total + position.accrueInterest(timestamp).supplyAssets, 0n);
53
+ }
54
+ maxDeposit(_data, assets) {
55
+ return {
56
+ value: BigInt(assets),
57
+ limiter: utils_1.CapacityLimitReason.balance,
58
+ };
59
+ }
60
+ maxWithdraw(_data) {
61
+ const [marketParams] = (0, viem_1.decodeAbiParameters)([marketParamsAbi], _data);
62
+ const marketId = new market_1.MarketParams(marketParams).id;
63
+ const position = this.positions.find((position) => position.marketId === marketId);
64
+ return (position?.market?.getWithdrawCapacityLimit(position) ?? {
65
+ value: 0n,
66
+ limiter: utils_1.CapacityLimitReason.position,
67
+ });
68
+ }
69
+ }
70
+ exports.AccrualVaultV2MorphoMarketV1Adapter = AccrualVaultV2MorphoMarketV1Adapter;
@@ -0,0 +1,24 @@
1
+ import { type Address, type Hex } from "viem";
2
+ import { VaultV2Adapter } from "./VaultV2Adapter";
3
+ export interface IVaultV2MorphoVaultV1Adapter extends Omit<IVaultV2Adapter, "adapterId"> {
4
+ morphoVaultV1: Address;
5
+ }
6
+ import type { BigIntish } from "../../types";
7
+ import type { AccrualVault } from "../Vault";
8
+ import type { IAccrualVaultV2Adapter, IVaultV2Adapter } from "./VaultV2Adapter";
9
+ export declare class VaultV2MorphoVaultV1Adapter extends VaultV2Adapter implements IVaultV2MorphoVaultV1Adapter {
10
+ static adapterId(address: Address): `0x${string}`;
11
+ readonly morphoVaultV1: Address;
12
+ constructor({ morphoVaultV1, ...vaultV2Adapter }: IVaultV2MorphoVaultV1Adapter);
13
+ ids(): `0x${string}`[];
14
+ }
15
+ export interface IAccrualVaultV2MorphoVaultV1Adapter extends IVaultV2MorphoVaultV1Adapter {
16
+ }
17
+ export declare class AccrualVaultV2MorphoVaultV1Adapter extends VaultV2MorphoVaultV1Adapter implements IAccrualVaultV2MorphoVaultV1Adapter, IAccrualVaultV2Adapter {
18
+ accrualVaultV1: AccrualVault;
19
+ shares: bigint;
20
+ constructor(adapter: IAccrualVaultV2MorphoVaultV1Adapter, accrualVaultV1: AccrualVault, shares: bigint);
21
+ realAssets(timestamp?: BigIntish): bigint;
22
+ maxDeposit(_data: Hex, assets: BigIntish): import("../..").CapacityLimit;
23
+ maxWithdraw(_data: Hex): import("../..").CapacityLimit;
24
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccrualVaultV2MorphoVaultV1Adapter = exports.VaultV2MorphoVaultV1Adapter = void 0;
4
+ const viem_1 = require("viem");
5
+ const VaultV2Adapter_1 = require("./VaultV2Adapter");
6
+ class VaultV2MorphoVaultV1Adapter extends VaultV2Adapter_1.VaultV2Adapter {
7
+ static adapterId(address) {
8
+ return (0, viem_1.keccak256)((0, viem_1.encodeAbiParameters)([{ type: "string" }, { type: "address" }], ["this", address]));
9
+ }
10
+ morphoVaultV1;
11
+ constructor({ morphoVaultV1, ...vaultV2Adapter }) {
12
+ super({
13
+ ...vaultV2Adapter,
14
+ adapterId: VaultV2MorphoVaultV1Adapter.adapterId(vaultV2Adapter.address),
15
+ });
16
+ this.morphoVaultV1 = morphoVaultV1;
17
+ }
18
+ ids() {
19
+ return [this.adapterId];
20
+ }
21
+ }
22
+ exports.VaultV2MorphoVaultV1Adapter = VaultV2MorphoVaultV1Adapter;
23
+ class AccrualVaultV2MorphoVaultV1Adapter extends VaultV2MorphoVaultV1Adapter {
24
+ accrualVaultV1;
25
+ shares;
26
+ constructor(adapter, accrualVaultV1, shares) {
27
+ super(adapter);
28
+ this.accrualVaultV1 = accrualVaultV1;
29
+ this.shares = shares;
30
+ }
31
+ realAssets(timestamp) {
32
+ return this.accrualVaultV1.accrueInterest(timestamp).toAssets(this.shares);
33
+ }
34
+ maxDeposit(_data, assets) {
35
+ return this.accrualVaultV1.maxDeposit(assets);
36
+ }
37
+ maxWithdraw(_data) {
38
+ return this.accrualVaultV1.maxWithdraw(this.shares);
39
+ }
40
+ }
41
+ exports.AccrualVaultV2MorphoVaultV1Adapter = AccrualVaultV2MorphoVaultV1Adapter;
@@ -0,0 +1,4 @@
1
+ export * from "./VaultV2.js";
2
+ export * from "./VaultV2Adapter.js";
3
+ export * from "./VaultV2MorphoMarketV1Adapter.js";
4
+ export * from "./VaultV2MorphoVaultV1Adapter.js";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./VaultV2.js"), exports);
18
+ __exportStar(require("./VaultV2Adapter.js"), exports);
19
+ __exportStar(require("./VaultV2MorphoMarketV1Adapter.js"), exports);
20
+ __exportStar(require("./VaultV2MorphoVaultV1Adapter.js"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@morpho-org/blue-sdk",
3
3
  "description": "Framework-agnostic package that defines Morpho-related entity classes (such as `Market`, `Token`, `Vault`).",
4
- "version": "5.2.0",
4
+ "version": "5.3.0-next.1",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "contributors": [
7
7
  "Rubilmax <rmilon@gmail.com>"
@@ -29,10 +29,10 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "typescript": "^5.7.2",
32
- "viem": "^2.23.0",
32
+ "viem": "^2.33.3",
33
33
  "vitest": "^3.0.5",
34
- "@morpho-org/morpho-ts": "^2.4.3",
35
- "@morpho-org/test": "^2.6.0"
34
+ "@morpho-org/test": "^2.6.0",
35
+ "@morpho-org/morpho-ts": "^2.4.3"
36
36
  },
37
37
  "scripts": {
38
38
  "prepublish": "$npm_execpath build",