@morpho-org/blue-sdk 5.1.1 → 5.2.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/addresses.d.ts +18 -18
- package/lib/addresses.js +8 -8
- package/lib/errors.d.ts +16 -0
- package/lib/errors.js +32 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/market/Market.d.ts +1 -11
- package/lib/market/Market.js +12 -19
- package/lib/position/Position.d.ts +4 -4
- package/lib/position/Position.js +3 -2
- package/lib/token/VaultToken.d.ts +3 -3
- package/lib/utils.d.ts +13 -0
- package/lib/utils.js +13 -0
- package/lib/vault/Vault.d.ts +23 -3
- package/lib/vault/Vault.js +31 -5
- package/lib/vault/index.d.ts +1 -0
- package/lib/vault/index.js +1 -0
- package/lib/vault/v2/VaultV2.d.ts +87 -0
- package/lib/vault/v2/VaultV2.js +161 -0
- package/lib/vault/v2/VaultV2Adapter.d.ts +29 -0
- package/lib/vault/v2/VaultV2Adapter.js +16 -0
- package/lib/vault/v2/VaultV2MorphoVaultV1Adapter.d.ts +24 -0
- package/lib/vault/v2/VaultV2MorphoVaultV1Adapter.js +41 -0
- package/lib/vault/v2/index.d.ts +3 -0
- package/lib/vault/v2/index.js +19 -0
- package/package.json +4 -4
package/lib/addresses.d.ts
CHANGED
|
@@ -25,8 +25,6 @@ export interface ChainAddresses {
|
|
|
25
25
|
adaptiveCurveIrm: Address;
|
|
26
26
|
publicAllocator?: Address;
|
|
27
27
|
metaMorphoFactory?: Address;
|
|
28
|
-
vaultV2Factory?: Address;
|
|
29
|
-
morphoVaultV1AdapterFactory?: Address;
|
|
30
28
|
registryList?: Address;
|
|
31
29
|
chainlinkOracleFactory?: Address;
|
|
32
30
|
preLiquidationFactory?: Address;
|
|
@@ -42,6 +40,8 @@ export interface ChainAddresses {
|
|
|
42
40
|
usdc?: Address;
|
|
43
41
|
stEth?: Address;
|
|
44
42
|
wstEth?: Address;
|
|
43
|
+
vaultV2Factory?: Address;
|
|
44
|
+
morphoVaultV1AdapterFactory?: Address;
|
|
45
45
|
}
|
|
46
46
|
declare const _addressesRegistry: {
|
|
47
47
|
readonly 1: {
|
|
@@ -63,8 +63,6 @@ declare const _addressesRegistry: {
|
|
|
63
63
|
readonly adaptiveCurveIrm: "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC";
|
|
64
64
|
readonly publicAllocator: "0xfd32fA2ca22c76dD6E550706Ad913FC6CE91c75D";
|
|
65
65
|
readonly metaMorphoFactory: "0x1897A8997241C1cD4bD0698647e4EB7213535c24";
|
|
66
|
-
readonly vaultV2Factory: "0xA1D94F746dEfa1928926b84fB2596c06926C0405";
|
|
67
|
-
readonly morphoVaultV1AdapterFactory: "0xD1B8E2dee25c2b89DCD2f98448a7ce87d6F63394";
|
|
68
66
|
readonly registryList: "0x3696c5eAe4a7Ffd04Ea163564571E9CD8Ed9364e";
|
|
69
67
|
readonly chainlinkOracleFactory: "0x3A7bB36Ee3f3eE32A60e9f2b33c1e5f2E83ad766";
|
|
70
68
|
readonly preLiquidationFactory: "0x6FF33615e792E35ed1026ea7cACCf42D9BF83476";
|
|
@@ -95,6 +93,8 @@ declare const _addressesRegistry: {
|
|
|
95
93
|
readonly crvUSDETHCRV: "0x4eBdF703948ddCEA3B11f675B4D1Fba9d2414A14";
|
|
96
94
|
readonly "stkcvx2BTC-f-morpho": "0x385E12cf4040543Bc8C18e05C1298Be5B04f3f5e";
|
|
97
95
|
readonly "2BTC-f": "0xB7ECB2AA52AA64a717180E030241bC75Cd946726";
|
|
96
|
+
readonly vaultV2Factory: "0xA1D94F746dEfa1928926b84fB2596c06926C0405";
|
|
97
|
+
readonly morphoVaultV1AdapterFactory: "0xD1B8E2dee25c2b89DCD2f98448a7ce87d6F63394";
|
|
98
98
|
};
|
|
99
99
|
readonly 8453: {
|
|
100
100
|
readonly morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb";
|
|
@@ -110,8 +110,6 @@ declare const _addressesRegistry: {
|
|
|
110
110
|
readonly adaptiveCurveIrm: "0x46415998764C29aB2a25CbeA6254146D50D22687";
|
|
111
111
|
readonly publicAllocator: "0xA090dD1a701408Df1d4d0B85b716c87565f90467";
|
|
112
112
|
readonly metaMorphoFactory: "0xFf62A7c278C62eD665133147129245053Bbf5918";
|
|
113
|
-
readonly vaultV2Factory: "0x4501125508079A99ebBebCE205DeC9593C2b5857";
|
|
114
|
-
readonly morphoVaultV1AdapterFactory: "0xF42D9c36b34c9c2CF3Bc30eD2a52a90eEB604642";
|
|
115
113
|
readonly registryList: "0x5C2531Cbd2cf112Cf687da3Cd536708aDd7DB10a";
|
|
116
114
|
readonly chainlinkOracleFactory: "0x2DC205F24BCb6B311E5cdf0745B0741648Aebd3d";
|
|
117
115
|
readonly preLiquidationFactory: "0x8cd16b62E170Ee0bA83D80e1F80E6085367e2aef";
|
|
@@ -119,6 +117,8 @@ declare const _addressesRegistry: {
|
|
|
119
117
|
readonly usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
120
118
|
readonly verUsdc: "0x59aaF835D34b1E3dF2170e4872B785f11E2a964b";
|
|
121
119
|
readonly testUsdc: "0xBC77067f829979812d795d516E523C4033b66409";
|
|
120
|
+
readonly vaultV2Factory: "0x4501125508079A99ebBebCE205DeC9593C2b5857";
|
|
121
|
+
readonly morphoVaultV1AdapterFactory: "0xF42D9c36b34c9c2CF3Bc30eD2a52a90eEB604642";
|
|
122
122
|
};
|
|
123
123
|
readonly 137: {
|
|
124
124
|
readonly morpho: "0x1bF0c2541F820E775182832f06c0B7Fc27A25f67";
|
|
@@ -431,11 +431,11 @@ declare const _deployments: {
|
|
|
431
431
|
readonly adaptiveCurveIrm: 18883124n;
|
|
432
432
|
readonly publicAllocator: 19375099n;
|
|
433
433
|
readonly metaMorphoFactory: 21439510n;
|
|
434
|
-
readonly vaultV2Factory: 23375073n;
|
|
435
|
-
readonly morphoVaultV1AdapterFactory: 23375073n;
|
|
436
434
|
readonly registryList: 23375119n;
|
|
437
435
|
readonly chainlinkOracleFactory: 19375066n;
|
|
438
436
|
readonly preLiquidationFactory: 21414664n;
|
|
437
|
+
readonly vaultV2Factory: 23375073n;
|
|
438
|
+
readonly morphoVaultV1AdapterFactory: 23375073n;
|
|
439
439
|
};
|
|
440
440
|
readonly 8453: {
|
|
441
441
|
readonly morpho: 13977148n;
|
|
@@ -451,11 +451,11 @@ declare const _deployments: {
|
|
|
451
451
|
readonly adaptiveCurveIrm: 13977152n;
|
|
452
452
|
readonly publicAllocator: 13979545n;
|
|
453
453
|
readonly metaMorphoFactory: 23928808n;
|
|
454
|
-
readonly vaultV2Factory: 35615206n;
|
|
455
|
-
readonly morphoVaultV1AdapterFactory: 35615206n;
|
|
456
454
|
readonly registryList: 35615358n;
|
|
457
455
|
readonly chainlinkOracleFactory: 13978286n;
|
|
458
456
|
readonly preLiquidationFactory: 23779056n;
|
|
457
|
+
readonly vaultV2Factory: 35615206n;
|
|
458
|
+
readonly morphoVaultV1AdapterFactory: 35615206n;
|
|
459
459
|
};
|
|
460
460
|
readonly 137: {
|
|
461
461
|
readonly morpho: 66931042n;
|
|
@@ -762,8 +762,6 @@ export declare let addressesRegistry: {
|
|
|
762
762
|
readonly adaptiveCurveIrm: "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC";
|
|
763
763
|
readonly publicAllocator: "0xfd32fA2ca22c76dD6E550706Ad913FC6CE91c75D";
|
|
764
764
|
readonly metaMorphoFactory: "0x1897A8997241C1cD4bD0698647e4EB7213535c24";
|
|
765
|
-
readonly vaultV2Factory: "0xA1D94F746dEfa1928926b84fB2596c06926C0405";
|
|
766
|
-
readonly morphoVaultV1AdapterFactory: "0xD1B8E2dee25c2b89DCD2f98448a7ce87d6F63394";
|
|
767
765
|
readonly registryList: "0x3696c5eAe4a7Ffd04Ea163564571E9CD8Ed9364e";
|
|
768
766
|
readonly chainlinkOracleFactory: "0x3A7bB36Ee3f3eE32A60e9f2b33c1e5f2E83ad766";
|
|
769
767
|
readonly preLiquidationFactory: "0x6FF33615e792E35ed1026ea7cACCf42D9BF83476";
|
|
@@ -794,6 +792,8 @@ export declare let addressesRegistry: {
|
|
|
794
792
|
readonly crvUSDETHCRV: "0x4eBdF703948ddCEA3B11f675B4D1Fba9d2414A14";
|
|
795
793
|
readonly "stkcvx2BTC-f-morpho": "0x385E12cf4040543Bc8C18e05C1298Be5B04f3f5e";
|
|
796
794
|
readonly "2BTC-f": "0xB7ECB2AA52AA64a717180E030241bC75Cd946726";
|
|
795
|
+
readonly vaultV2Factory: "0xA1D94F746dEfa1928926b84fB2596c06926C0405";
|
|
796
|
+
readonly morphoVaultV1AdapterFactory: "0xD1B8E2dee25c2b89DCD2f98448a7ce87d6F63394";
|
|
797
797
|
};
|
|
798
798
|
readonly 8453: {
|
|
799
799
|
readonly morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb";
|
|
@@ -809,8 +809,6 @@ export declare let addressesRegistry: {
|
|
|
809
809
|
readonly adaptiveCurveIrm: "0x46415998764C29aB2a25CbeA6254146D50D22687";
|
|
810
810
|
readonly publicAllocator: "0xA090dD1a701408Df1d4d0B85b716c87565f90467";
|
|
811
811
|
readonly metaMorphoFactory: "0xFf62A7c278C62eD665133147129245053Bbf5918";
|
|
812
|
-
readonly vaultV2Factory: "0x4501125508079A99ebBebCE205DeC9593C2b5857";
|
|
813
|
-
readonly morphoVaultV1AdapterFactory: "0xF42D9c36b34c9c2CF3Bc30eD2a52a90eEB604642";
|
|
814
812
|
readonly registryList: "0x5C2531Cbd2cf112Cf687da3Cd536708aDd7DB10a";
|
|
815
813
|
readonly chainlinkOracleFactory: "0x2DC205F24BCb6B311E5cdf0745B0741648Aebd3d";
|
|
816
814
|
readonly preLiquidationFactory: "0x8cd16b62E170Ee0bA83D80e1F80E6085367e2aef";
|
|
@@ -818,6 +816,8 @@ export declare let addressesRegistry: {
|
|
|
818
816
|
readonly usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
819
817
|
readonly verUsdc: "0x59aaF835D34b1E3dF2170e4872B785f11E2a964b";
|
|
820
818
|
readonly testUsdc: "0xBC77067f829979812d795d516E523C4033b66409";
|
|
819
|
+
readonly vaultV2Factory: "0x4501125508079A99ebBebCE205DeC9593C2b5857";
|
|
820
|
+
readonly morphoVaultV1AdapterFactory: "0xF42D9c36b34c9c2CF3Bc30eD2a52a90eEB604642";
|
|
821
821
|
};
|
|
822
822
|
readonly 137: {
|
|
823
823
|
readonly morpho: "0x1bF0c2541F820E775182832f06c0B7Fc27A25f67";
|
|
@@ -1128,11 +1128,11 @@ export declare let deployments: {
|
|
|
1128
1128
|
readonly adaptiveCurveIrm: 18883124n;
|
|
1129
1129
|
readonly publicAllocator: 19375099n;
|
|
1130
1130
|
readonly metaMorphoFactory: 21439510n;
|
|
1131
|
-
readonly vaultV2Factory: 23375073n;
|
|
1132
|
-
readonly morphoVaultV1AdapterFactory: 23375073n;
|
|
1133
1131
|
readonly registryList: 23375119n;
|
|
1134
1132
|
readonly chainlinkOracleFactory: 19375066n;
|
|
1135
1133
|
readonly preLiquidationFactory: 21414664n;
|
|
1134
|
+
readonly vaultV2Factory: 23375073n;
|
|
1135
|
+
readonly morphoVaultV1AdapterFactory: 23375073n;
|
|
1136
1136
|
};
|
|
1137
1137
|
readonly 8453: {
|
|
1138
1138
|
readonly morpho: 13977148n;
|
|
@@ -1148,11 +1148,11 @@ export declare let deployments: {
|
|
|
1148
1148
|
readonly adaptiveCurveIrm: 13977152n;
|
|
1149
1149
|
readonly publicAllocator: 13979545n;
|
|
1150
1150
|
readonly metaMorphoFactory: 23928808n;
|
|
1151
|
-
readonly vaultV2Factory: 35615206n;
|
|
1152
|
-
readonly morphoVaultV1AdapterFactory: 35615206n;
|
|
1153
1151
|
readonly registryList: 35615358n;
|
|
1154
1152
|
readonly chainlinkOracleFactory: 13978286n;
|
|
1155
1153
|
readonly preLiquidationFactory: 23779056n;
|
|
1154
|
+
readonly vaultV2Factory: 35615206n;
|
|
1155
|
+
readonly morphoVaultV1AdapterFactory: 35615206n;
|
|
1156
1156
|
};
|
|
1157
1157
|
readonly 137: {
|
|
1158
1158
|
readonly morpho: 66931042n;
|
package/lib/addresses.js
CHANGED
|
@@ -36,8 +36,6 @@ const _addressesRegistry = {
|
|
|
36
36
|
adaptiveCurveIrm: "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC",
|
|
37
37
|
publicAllocator: "0xfd32fA2ca22c76dD6E550706Ad913FC6CE91c75D",
|
|
38
38
|
metaMorphoFactory: "0x1897A8997241C1cD4bD0698647e4EB7213535c24",
|
|
39
|
-
vaultV2Factory: "0xA1D94F746dEfa1928926b84fB2596c06926C0405",
|
|
40
|
-
morphoVaultV1AdapterFactory: "0xD1B8E2dee25c2b89DCD2f98448a7ce87d6F63394",
|
|
41
39
|
registryList: "0x3696c5eAe4a7Ffd04Ea163564571E9CD8Ed9364e",
|
|
42
40
|
chainlinkOracleFactory: "0x3A7bB36Ee3f3eE32A60e9f2b33c1e5f2E83ad766",
|
|
43
41
|
preLiquidationFactory: "0x6FF33615e792E35ed1026ea7cACCf42D9BF83476",
|
|
@@ -74,6 +72,8 @@ const _addressesRegistry = {
|
|
|
74
72
|
crvUSDETHCRV: "0x4eBdF703948ddCEA3B11f675B4D1Fba9d2414A14",
|
|
75
73
|
"stkcvx2BTC-f-morpho": "0x385E12cf4040543Bc8C18e05C1298Be5B04f3f5e",
|
|
76
74
|
"2BTC-f": "0xB7ECB2AA52AA64a717180E030241bC75Cd946726",
|
|
75
|
+
vaultV2Factory: "0xA1D94F746dEfa1928926b84fB2596c06926C0405",
|
|
76
|
+
morphoVaultV1AdapterFactory: "0xD1B8E2dee25c2b89DCD2f98448a7ce87d6F63394",
|
|
77
77
|
},
|
|
78
78
|
[chain_js_1.ChainId.BaseMainnet]: {
|
|
79
79
|
morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
|
|
@@ -89,8 +89,6 @@ const _addressesRegistry = {
|
|
|
89
89
|
adaptiveCurveIrm: "0x46415998764C29aB2a25CbeA6254146D50D22687",
|
|
90
90
|
publicAllocator: "0xA090dD1a701408Df1d4d0B85b716c87565f90467",
|
|
91
91
|
metaMorphoFactory: "0xFf62A7c278C62eD665133147129245053Bbf5918",
|
|
92
|
-
vaultV2Factory: "0x4501125508079A99ebBebCE205DeC9593C2b5857",
|
|
93
|
-
morphoVaultV1AdapterFactory: "0xF42D9c36b34c9c2CF3Bc30eD2a52a90eEB604642",
|
|
94
92
|
registryList: "0x5C2531Cbd2cf112Cf687da3Cd536708aDd7DB10a",
|
|
95
93
|
chainlinkOracleFactory: "0x2DC205F24BCb6B311E5cdf0745B0741648Aebd3d",
|
|
96
94
|
preLiquidationFactory: "0x8cd16b62E170Ee0bA83D80e1F80E6085367e2aef",
|
|
@@ -99,6 +97,8 @@ const _addressesRegistry = {
|
|
|
99
97
|
usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
100
98
|
verUsdc: "0x59aaF835D34b1E3dF2170e4872B785f11E2a964b",
|
|
101
99
|
testUsdc: "0xBC77067f829979812d795d516E523C4033b66409",
|
|
100
|
+
vaultV2Factory: "0x4501125508079A99ebBebCE205DeC9593C2b5857",
|
|
101
|
+
morphoVaultV1AdapterFactory: "0xF42D9c36b34c9c2CF3Bc30eD2a52a90eEB604642",
|
|
102
102
|
},
|
|
103
103
|
[chain_js_1.ChainId.PolygonMainnet]: {
|
|
104
104
|
morpho: "0x1bF0c2541F820E775182832f06c0B7Fc27A25f67",
|
|
@@ -418,11 +418,11 @@ const _deployments = {
|
|
|
418
418
|
adaptiveCurveIrm: 18883124n,
|
|
419
419
|
publicAllocator: 19375099n,
|
|
420
420
|
metaMorphoFactory: 21439510n,
|
|
421
|
-
vaultV2Factory: 23375073n,
|
|
422
|
-
morphoVaultV1AdapterFactory: 23375073n,
|
|
423
421
|
registryList: 23375119n,
|
|
424
422
|
chainlinkOracleFactory: 19375066n,
|
|
425
423
|
preLiquidationFactory: 21414664n,
|
|
424
|
+
vaultV2Factory: 23375073n,
|
|
425
|
+
morphoVaultV1AdapterFactory: 23375073n,
|
|
426
426
|
},
|
|
427
427
|
[chain_js_1.ChainId.BaseMainnet]: {
|
|
428
428
|
morpho: 13977148n,
|
|
@@ -438,11 +438,11 @@ const _deployments = {
|
|
|
438
438
|
adaptiveCurveIrm: 13977152n,
|
|
439
439
|
publicAllocator: 13979545n,
|
|
440
440
|
metaMorphoFactory: 23928808n,
|
|
441
|
-
vaultV2Factory: 35615206n,
|
|
442
|
-
morphoVaultV1AdapterFactory: 35615206n,
|
|
443
441
|
registryList: 35615358n,
|
|
444
442
|
chainlinkOracleFactory: 13978286n,
|
|
445
443
|
preLiquidationFactory: 23779056n,
|
|
444
|
+
vaultV2Factory: 35615206n,
|
|
445
|
+
morphoVaultV1AdapterFactory: 35615206n,
|
|
446
446
|
},
|
|
447
447
|
[chain_js_1.ChainId.PolygonMainnet]: {
|
|
448
448
|
morpho: 66931042n,
|
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
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);
|
package/lib/market/Market.d.ts
CHANGED
|
@@ -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
|
}
|
package/lib/market/Market.js
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Market =
|
|
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("../
|
|
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("../
|
|
141
|
-
getWithdrawCollateralCapacityLimit(options?: MaxWithdrawCollateralOptions): import("../
|
|
142
|
-
getRepayCapacityLimit(loanTokenBalance: bigint): import("../
|
|
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;
|
package/lib/position/Position.js
CHANGED
|
@@ -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:
|
|
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:
|
|
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:
|
|
22
|
-
protected _unwrap(amount:
|
|
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 = {}));
|
package/lib/vault/Vault.d.ts
CHANGED
|
@@ -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:
|
|
120
|
-
toShares(assets:
|
|
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,8 +178,28 @@ 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`.
|
package/lib/vault/Vault.js
CHANGED
|
@@ -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:
|
|
243
|
+
limiter: utils_js_1.CapacityLimitReason.cap,
|
|
222
244
|
};
|
|
223
245
|
return {
|
|
224
246
|
value: assets,
|
|
225
|
-
limiter:
|
|
247
|
+
limiter: utils_js_1.CapacityLimitReason.balance,
|
|
226
248
|
};
|
|
227
249
|
}
|
|
228
|
-
|
|
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:
|
|
260
|
+
limiter: utils_js_1.CapacityLimitReason.liquidity,
|
|
235
261
|
};
|
|
236
262
|
return {
|
|
237
263
|
value: assets,
|
|
238
|
-
limiter:
|
|
264
|
+
limiter: utils_js_1.CapacityLimitReason.balance,
|
|
239
265
|
};
|
|
240
266
|
}
|
|
241
267
|
/**
|
package/lib/vault/index.d.ts
CHANGED
package/lib/vault/index.js
CHANGED
|
@@ -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,161 @@
|
|
|
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
|
+
const VaultV2MorphoVaultV1Adapter_1 = require("./VaultV2MorphoVaultV1Adapter");
|
|
10
|
+
class VaultV2 extends token_1.WrappedToken {
|
|
11
|
+
asset;
|
|
12
|
+
totalAssets;
|
|
13
|
+
_totalAssets;
|
|
14
|
+
totalSupply;
|
|
15
|
+
virtualShares;
|
|
16
|
+
maxRate;
|
|
17
|
+
lastUpdate;
|
|
18
|
+
adapters;
|
|
19
|
+
liquidityAdapter;
|
|
20
|
+
liquidityData;
|
|
21
|
+
liquidityAllocations;
|
|
22
|
+
performanceFee;
|
|
23
|
+
managementFee;
|
|
24
|
+
performanceFeeRecipient;
|
|
25
|
+
managementFeeRecipient;
|
|
26
|
+
constructor({ asset, totalAssets, _totalAssets, totalSupply, virtualShares, maxRate, lastUpdate, adapters, liquidityAdapter, liquidityData, liquidityAllocations, performanceFee, managementFee, performanceFeeRecipient, managementFeeRecipient, ...config }) {
|
|
27
|
+
super(config, asset);
|
|
28
|
+
this.asset = asset;
|
|
29
|
+
this.totalAssets = totalAssets;
|
|
30
|
+
this._totalAssets = _totalAssets;
|
|
31
|
+
this.totalSupply = totalSupply;
|
|
32
|
+
this.virtualShares = virtualShares;
|
|
33
|
+
this.maxRate = maxRate;
|
|
34
|
+
this.lastUpdate = lastUpdate;
|
|
35
|
+
this.adapters = adapters;
|
|
36
|
+
this.liquidityAdapter = liquidityAdapter;
|
|
37
|
+
this.liquidityData = liquidityData;
|
|
38
|
+
this.liquidityAllocations = liquidityAllocations;
|
|
39
|
+
this.performanceFee = performanceFee;
|
|
40
|
+
this.managementFee = managementFee;
|
|
41
|
+
this.performanceFeeRecipient = performanceFeeRecipient;
|
|
42
|
+
this.managementFeeRecipient = managementFeeRecipient;
|
|
43
|
+
}
|
|
44
|
+
toAssets(shares) {
|
|
45
|
+
return this._unwrap(shares, "Down");
|
|
46
|
+
}
|
|
47
|
+
toShares(assets) {
|
|
48
|
+
return this._wrap(assets, "Down");
|
|
49
|
+
}
|
|
50
|
+
_wrap(amount, rounding) {
|
|
51
|
+
return math_1.MathLib.mulDiv(amount, this.totalSupply + this.virtualShares, this.totalAssets + 1n, rounding);
|
|
52
|
+
}
|
|
53
|
+
_unwrap(amount, rounding) {
|
|
54
|
+
return math_1.MathLib.mulDiv(amount, this.totalAssets + 1n, this.totalSupply + this.virtualShares, rounding);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.VaultV2 = VaultV2;
|
|
58
|
+
class AccrualVaultV2 extends VaultV2 {
|
|
59
|
+
accrualLiquidityAdapter;
|
|
60
|
+
accrualAdapters;
|
|
61
|
+
assetBalance;
|
|
62
|
+
constructor(vault, accrualLiquidityAdapter, accrualAdapters, assetBalance) {
|
|
63
|
+
super({ ...vault, adapters: accrualAdapters.map((a) => a.address) });
|
|
64
|
+
this.accrualLiquidityAdapter = accrualLiquidityAdapter;
|
|
65
|
+
this.accrualAdapters = accrualAdapters;
|
|
66
|
+
this.assetBalance = assetBalance;
|
|
67
|
+
}
|
|
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) {
|
|
73
|
+
if (this.liquidityAdapter === viem_1.zeroAddress)
|
|
74
|
+
return { value: BigInt(assets), limiter: utils_1.CapacityLimitReason.balance };
|
|
75
|
+
let liquidityAdapterLimit;
|
|
76
|
+
if (this.accrualLiquidityAdapter instanceof VaultV2MorphoVaultV1Adapter_1.AccrualVaultV2MorphoVaultV1Adapter) {
|
|
77
|
+
liquidityAdapterLimit = this.accrualLiquidityAdapter.maxDeposit(this.liquidityData, assets);
|
|
78
|
+
}
|
|
79
|
+
if (this.liquidityAllocations == null || liquidityAdapterLimit == null)
|
|
80
|
+
throw new errors_1.VaultV2Errors.UnsupportedLiquidityAdapter(this.liquidityAdapter);
|
|
81
|
+
// At this stage: `liquidityAdapterLimit.value <= assets`
|
|
82
|
+
for (const { absoluteCap, relativeCap, allocation } of this
|
|
83
|
+
.liquidityAllocations) {
|
|
84
|
+
// `absoluteCap` can be set lower than `allocation`.
|
|
85
|
+
const absoluteMaxDeposit = math_1.MathLib.zeroFloorSub(absoluteCap, allocation);
|
|
86
|
+
if (liquidityAdapterLimit.value > absoluteMaxDeposit)
|
|
87
|
+
return {
|
|
88
|
+
value: absoluteMaxDeposit,
|
|
89
|
+
limiter: utils_1.CapacityLimitReason.vaultV2_absoluteCap,
|
|
90
|
+
};
|
|
91
|
+
if (relativeCap !== math_1.MathLib.WAD) {
|
|
92
|
+
// `relativeCap` can be set lower than `allocation / totalAssets`.
|
|
93
|
+
const relativeMaxDeposit = math_1.MathLib.zeroFloorSub(math_1.MathLib.wMulDown(this.totalAssets, relativeCap), allocation);
|
|
94
|
+
if (liquidityAdapterLimit.value > relativeMaxDeposit)
|
|
95
|
+
return {
|
|
96
|
+
value: relativeMaxDeposit,
|
|
97
|
+
limiter: utils_1.CapacityLimitReason.vaultV2_relativeCap,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return liquidityAdapterLimit;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Returns the maximum amount of assets that can be withdrawn from the vault.
|
|
105
|
+
* @param shares The maximum amount of shares to redeem.
|
|
106
|
+
*/
|
|
107
|
+
maxWithdraw(shares) {
|
|
108
|
+
const assets = this.toAssets(shares);
|
|
109
|
+
if (this.liquidityAdapter === viem_1.zeroAddress)
|
|
110
|
+
return { value: BigInt(assets), limiter: utils_1.CapacityLimitReason.balance };
|
|
111
|
+
let liquidity = this.assetBalance;
|
|
112
|
+
if (this.accrualLiquidityAdapter instanceof VaultV2MorphoVaultV1Adapter_1.AccrualVaultV2MorphoVaultV1Adapter)
|
|
113
|
+
liquidity += this.accrualLiquidityAdapter.maxWithdraw(this.liquidityData).value;
|
|
114
|
+
if (assets > liquidity)
|
|
115
|
+
return {
|
|
116
|
+
value: liquidity,
|
|
117
|
+
limiter: utils_1.CapacityLimitReason.liquidity,
|
|
118
|
+
};
|
|
119
|
+
return {
|
|
120
|
+
value: assets,
|
|
121
|
+
limiter: utils_1.CapacityLimitReason.balance,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Returns a new vault derived from this vault, whose interest has been accrued up to the given timestamp.
|
|
126
|
+
* @param timestamp The timestamp at which to accrue interest. Must be greater than or equal to the vault's `lastUpdate`.
|
|
127
|
+
*/
|
|
128
|
+
accrueInterest(timestamp) {
|
|
129
|
+
const vault = new AccrualVaultV2(this, this.accrualLiquidityAdapter, this.accrualAdapters, this.assetBalance);
|
|
130
|
+
timestamp = BigInt(timestamp);
|
|
131
|
+
const elapsed = timestamp - this.lastUpdate;
|
|
132
|
+
if (elapsed < 0n)
|
|
133
|
+
throw new errors_1.VaultV2Errors.InvalidInterestAccrual(this.address, timestamp, this.lastUpdate);
|
|
134
|
+
// Corresponds to the `firstTotalAssets == 0` onchain check.
|
|
135
|
+
if (elapsed === 0n)
|
|
136
|
+
return { vault, performanceFeeShares: 0n, managementFeeShares: 0n };
|
|
137
|
+
const realAssets = vault.accrualAdapters.reduce((curr, adapter) => curr + adapter.realAssets(timestamp), vault.assetBalance);
|
|
138
|
+
const maxTotalAssets = vault._totalAssets +
|
|
139
|
+
math_1.MathLib.wMulDown(vault._totalAssets * elapsed, vault.maxRate);
|
|
140
|
+
const newTotalAssets = math_1.MathLib.min(realAssets, maxTotalAssets);
|
|
141
|
+
const interest = math_1.MathLib.zeroFloorSub(newTotalAssets, vault._totalAssets);
|
|
142
|
+
const performanceFeeAssets = interest > 0n && vault.performanceFee > 0n
|
|
143
|
+
? math_1.MathLib.wMulDown(interest, vault.performanceFee)
|
|
144
|
+
: 0n;
|
|
145
|
+
const managementFeeAssets = elapsed > 0n && vault.managementFee > 0n
|
|
146
|
+
? math_1.MathLib.wMulDown(newTotalAssets * elapsed, vault.managementFee)
|
|
147
|
+
: 0n;
|
|
148
|
+
const newTotalAssetsWithoutFees = newTotalAssets - performanceFeeAssets - managementFeeAssets;
|
|
149
|
+
const performanceFeeShares = math_1.MathLib.mulDivDown(performanceFeeAssets, vault.totalSupply + vault.virtualShares, newTotalAssetsWithoutFees + 1n);
|
|
150
|
+
const managementFeeShares = math_1.MathLib.mulDivDown(managementFeeAssets, vault.totalSupply + vault.virtualShares, newTotalAssetsWithoutFees + 1n);
|
|
151
|
+
vault.totalAssets = newTotalAssets;
|
|
152
|
+
vault._totalAssets = newTotalAssets;
|
|
153
|
+
if (performanceFeeShares)
|
|
154
|
+
vault.totalSupply += performanceFeeShares;
|
|
155
|
+
if (managementFeeShares)
|
|
156
|
+
vault.totalSupply += managementFeeShares;
|
|
157
|
+
vault.lastUpdate = BigInt(timestamp);
|
|
158
|
+
return { vault, performanceFeeShares, managementFeeShares };
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
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,24 @@
|
|
|
1
|
+
import { type Address, type Hex } from "viem";
|
|
2
|
+
import { VaultV2Adapter } from "./VaultV2Adapter";
|
|
3
|
+
export interface IVaultV2MorphoVaultV1Adapter extends IVaultV2Adapter {
|
|
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,19 @@
|
|
|
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("./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.
|
|
4
|
+
"version": "5.2.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.
|
|
32
|
+
"viem": "^2.33.3",
|
|
33
33
|
"vitest": "^3.0.5",
|
|
34
|
-
"@morpho-org/
|
|
35
|
-
"@morpho-org/
|
|
34
|
+
"@morpho-org/morpho-ts": "^2.4.3",
|
|
35
|
+
"@morpho-org/test": "^2.6.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"prepublish": "$npm_execpath build",
|