@morpho-org/blue-sdk 5.1.1 → 5.2.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/addresses.d.ts +122 -20
- package/lib/addresses.js +48 -10
- 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 +29 -33
- package/lib/market/Market.js +43 -40
- package/lib/market/MarketUtils.d.ts +21 -3
- package/lib/market/MarketUtils.js +27 -3
- 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/types.d.ts +1 -0
- package/lib/types.js +5 -0
- package/lib/utils.d.ts +15 -0
- package/lib/utils.js +77 -0
- package/lib/vault/Vault.d.ts +32 -18
- package/lib/vault/Vault.js +50 -35
- package/lib/vault/VaultMarketAllocation.d.ts +2 -2
- package/lib/vault/VaultMarketAllocation.js +1 -2
- 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 +160 -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
|
@@ -9,6 +9,30 @@ export declare const NATIVE_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEe
|
|
|
9
9
|
export interface ChainAddresses {
|
|
10
10
|
morpho: Address;
|
|
11
11
|
permit2?: Address;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
14
|
+
*/
|
|
15
|
+
bundler?: Address;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
18
|
+
*/
|
|
19
|
+
aaveV3OptimizerBundler?: Address;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
22
|
+
*/
|
|
23
|
+
aaveV2Bundler?: Address;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
26
|
+
*/
|
|
27
|
+
aaveV3Bundler?: Address;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
30
|
+
*/
|
|
31
|
+
compoundV3Bundler?: Address;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
34
|
+
*/
|
|
35
|
+
compoundV2Bundler?: Address;
|
|
12
36
|
bundler3: {
|
|
13
37
|
bundler3: Address;
|
|
14
38
|
generalAdapter1: Address;
|
|
@@ -25,8 +49,6 @@ export interface ChainAddresses {
|
|
|
25
49
|
adaptiveCurveIrm: Address;
|
|
26
50
|
publicAllocator?: Address;
|
|
27
51
|
metaMorphoFactory?: Address;
|
|
28
|
-
vaultV2Factory?: Address;
|
|
29
|
-
morphoVaultV1AdapterFactory?: Address;
|
|
30
52
|
registryList?: Address;
|
|
31
53
|
chainlinkOracleFactory?: Address;
|
|
32
54
|
preLiquidationFactory?: Address;
|
|
@@ -42,11 +64,17 @@ export interface ChainAddresses {
|
|
|
42
64
|
usdc?: Address;
|
|
43
65
|
stEth?: Address;
|
|
44
66
|
wstEth?: Address;
|
|
67
|
+
vaultV2Factory?: Address;
|
|
68
|
+
morphoVaultV1AdapterFactory?: Address;
|
|
45
69
|
}
|
|
46
70
|
declare const _addressesRegistry: {
|
|
47
71
|
readonly 1: {
|
|
48
72
|
readonly morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb";
|
|
49
73
|
readonly permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3";
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
76
|
+
*/
|
|
77
|
+
readonly bundler: "0x4095F064B8d3c3548A3bebfd0Bbfd04750E30077";
|
|
50
78
|
readonly bundler3: {
|
|
51
79
|
readonly bundler3: "0x6566194141eefa99Af43Bb5Aa71460Ca2Dc90245";
|
|
52
80
|
readonly generalAdapter1: "0x4A6c312ec70E8747a587EE860a0353cd42Be0aE0";
|
|
@@ -60,11 +88,29 @@ declare const _addressesRegistry: {
|
|
|
60
88
|
readonly aaveV3EtherFiMigrationAdapter: "0x4011dc6581fA05F9B0c7A12AdCd676e2b1a59ca3";
|
|
61
89
|
readonly aaveV3OptimizerMigrationAdapter: "0x9e2ea2d5785598a163D569D795f286F5C55ad972";
|
|
62
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
93
|
+
*/
|
|
94
|
+
readonly aaveV3OptimizerBundler: "0x16F38d2E764E7BeBF625a8E995b34968226D2F9c";
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
97
|
+
*/
|
|
98
|
+
readonly aaveV2Bundler: "0xb3dCc75DB379925edFd3007511A8CE0cB4aa8e76";
|
|
99
|
+
/**
|
|
100
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
101
|
+
*/
|
|
102
|
+
readonly aaveV3Bundler: "0x98ccB155E86bb478d514a827d16f58c6912f9BDC";
|
|
103
|
+
/**
|
|
104
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
105
|
+
*/
|
|
106
|
+
readonly compoundV3Bundler: "0x3a0e2E9FB9c95fBc843daF166276C90B6C479558";
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
109
|
+
*/
|
|
110
|
+
readonly compoundV2Bundler: "0x26bF52a84360Ad3d01d7CDc28FC2dDC04d8c8647";
|
|
63
111
|
readonly adaptiveCurveIrm: "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC";
|
|
64
112
|
readonly publicAllocator: "0xfd32fA2ca22c76dD6E550706Ad913FC6CE91c75D";
|
|
65
113
|
readonly metaMorphoFactory: "0x1897A8997241C1cD4bD0698647e4EB7213535c24";
|
|
66
|
-
readonly vaultV2Factory: "0xA1D94F746dEfa1928926b84fB2596c06926C0405";
|
|
67
|
-
readonly morphoVaultV1AdapterFactory: "0xD1B8E2dee25c2b89DCD2f98448a7ce87d6F63394";
|
|
68
114
|
readonly registryList: "0x3696c5eAe4a7Ffd04Ea163564571E9CD8Ed9364e";
|
|
69
115
|
readonly chainlinkOracleFactory: "0x3A7bB36Ee3f3eE32A60e9f2b33c1e5f2E83ad766";
|
|
70
116
|
readonly preLiquidationFactory: "0x6FF33615e792E35ed1026ea7cACCf42D9BF83476";
|
|
@@ -95,10 +141,16 @@ declare const _addressesRegistry: {
|
|
|
95
141
|
readonly crvUSDETHCRV: "0x4eBdF703948ddCEA3B11f675B4D1Fba9d2414A14";
|
|
96
142
|
readonly "stkcvx2BTC-f-morpho": "0x385E12cf4040543Bc8C18e05C1298Be5B04f3f5e";
|
|
97
143
|
readonly "2BTC-f": "0xB7ECB2AA52AA64a717180E030241bC75Cd946726";
|
|
144
|
+
readonly vaultV2Factory: "0xA1D94F746dEfa1928926b84fB2596c06926C0405";
|
|
145
|
+
readonly morphoVaultV1AdapterFactory: "0xD1B8E2dee25c2b89DCD2f98448a7ce87d6F63394";
|
|
98
146
|
};
|
|
99
147
|
readonly 8453: {
|
|
100
148
|
readonly morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb";
|
|
101
149
|
readonly permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3";
|
|
150
|
+
/**
|
|
151
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
152
|
+
*/
|
|
153
|
+
readonly bundler: "0x23055618898e202386e6c13955a58D3C68200BFB";
|
|
102
154
|
readonly bundler3: {
|
|
103
155
|
readonly bundler3: "0x6BFd8137e702540E7A42B74178A4a49Ba43920C4";
|
|
104
156
|
readonly generalAdapter1: "0xb98c948CFA24072e58935BC004a8A7b376AE746A";
|
|
@@ -107,11 +159,21 @@ declare const _addressesRegistry: {
|
|
|
107
159
|
readonly compoundV3MigrationAdapter: "0x85D4812Ef92c040d4270eD8547b6835e41FbbB70";
|
|
108
160
|
readonly aaveV3CoreMigrationAdapter: "0xb27Aa2a964eAd5ed661D86974b37e4fB995b36f5";
|
|
109
161
|
};
|
|
162
|
+
/**
|
|
163
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
164
|
+
*/
|
|
165
|
+
readonly compoundV2Bundler: "0x123f3167a416cA19365dE03a65e0AF3532af7223";
|
|
166
|
+
/**
|
|
167
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
168
|
+
*/
|
|
169
|
+
readonly aaveV3Bundler: "0xcAe2929baBc60Be34818EaA5F40bF69265677108";
|
|
170
|
+
/**
|
|
171
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
172
|
+
*/
|
|
173
|
+
readonly compoundV3Bundler: "0x1f8076e2EB6f10b12e6886f30D4909A91969F7dA";
|
|
110
174
|
readonly adaptiveCurveIrm: "0x46415998764C29aB2a25CbeA6254146D50D22687";
|
|
111
175
|
readonly publicAllocator: "0xA090dD1a701408Df1d4d0B85b716c87565f90467";
|
|
112
176
|
readonly metaMorphoFactory: "0xFf62A7c278C62eD665133147129245053Bbf5918";
|
|
113
|
-
readonly vaultV2Factory: "0x4501125508079A99ebBebCE205DeC9593C2b5857";
|
|
114
|
-
readonly morphoVaultV1AdapterFactory: "0xF42D9c36b34c9c2CF3Bc30eD2a52a90eEB604642";
|
|
115
177
|
readonly registryList: "0x5C2531Cbd2cf112Cf687da3Cd536708aDd7DB10a";
|
|
116
178
|
readonly chainlinkOracleFactory: "0x2DC205F24BCb6B311E5cdf0745B0741648Aebd3d";
|
|
117
179
|
readonly preLiquidationFactory: "0x8cd16b62E170Ee0bA83D80e1F80E6085367e2aef";
|
|
@@ -119,6 +181,8 @@ declare const _addressesRegistry: {
|
|
|
119
181
|
readonly usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
120
182
|
readonly verUsdc: "0x59aaF835D34b1E3dF2170e4872B785f11E2a964b";
|
|
121
183
|
readonly testUsdc: "0xBC77067f829979812d795d516E523C4033b66409";
|
|
184
|
+
readonly vaultV2Factory: "0x4501125508079A99ebBebCE205DeC9593C2b5857";
|
|
185
|
+
readonly morphoVaultV1AdapterFactory: "0xF42D9c36b34c9c2CF3Bc30eD2a52a90eEB604642";
|
|
122
186
|
};
|
|
123
187
|
readonly 137: {
|
|
124
188
|
readonly morpho: "0x1bF0c2541F820E775182832f06c0B7Fc27A25f67";
|
|
@@ -392,7 +456,6 @@ declare const _addressesRegistry: {
|
|
|
392
456
|
readonly chainlinkOracleFactory: "0xeb476f124FaD625178759d13557A72394A6f9aF5";
|
|
393
457
|
readonly preLiquidationFactory: "0x1b6782Ac7A859503cE953FBf4736311CC335B8f0";
|
|
394
458
|
readonly wNative: "0x5555555555555555555555555555555555555555";
|
|
395
|
-
readonly usdc: "0xb88339CB7199b77E23DB6E890353E22632Ba630f";
|
|
396
459
|
};
|
|
397
460
|
readonly 1329: {
|
|
398
461
|
readonly morpho: "0xc9cDAc20FCeAAF616f7EB0bb6Cd2c69dcfa9094c";
|
|
@@ -431,11 +494,11 @@ declare const _deployments: {
|
|
|
431
494
|
readonly adaptiveCurveIrm: 18883124n;
|
|
432
495
|
readonly publicAllocator: 19375099n;
|
|
433
496
|
readonly metaMorphoFactory: 21439510n;
|
|
434
|
-
readonly vaultV2Factory: 23375073n;
|
|
435
|
-
readonly morphoVaultV1AdapterFactory: 23375073n;
|
|
436
497
|
readonly registryList: 23375119n;
|
|
437
498
|
readonly chainlinkOracleFactory: 19375066n;
|
|
438
499
|
readonly preLiquidationFactory: 21414664n;
|
|
500
|
+
readonly vaultV2Factory: 23375073n;
|
|
501
|
+
readonly morphoVaultV1AdapterFactory: 23375073n;
|
|
439
502
|
};
|
|
440
503
|
readonly 8453: {
|
|
441
504
|
readonly morpho: 13977148n;
|
|
@@ -451,11 +514,11 @@ declare const _deployments: {
|
|
|
451
514
|
readonly adaptiveCurveIrm: 13977152n;
|
|
452
515
|
readonly publicAllocator: 13979545n;
|
|
453
516
|
readonly metaMorphoFactory: 23928808n;
|
|
454
|
-
readonly vaultV2Factory: 35615206n;
|
|
455
|
-
readonly morphoVaultV1AdapterFactory: 35615206n;
|
|
456
517
|
readonly registryList: 35615358n;
|
|
457
518
|
readonly chainlinkOracleFactory: 13978286n;
|
|
458
519
|
readonly preLiquidationFactory: 23779056n;
|
|
520
|
+
readonly vaultV2Factory: 35615206n;
|
|
521
|
+
readonly morphoVaultV1AdapterFactory: 35615206n;
|
|
459
522
|
};
|
|
460
523
|
readonly 137: {
|
|
461
524
|
readonly morpho: 66931042n;
|
|
@@ -746,6 +809,10 @@ export declare let addressesRegistry: {
|
|
|
746
809
|
readonly 1: {
|
|
747
810
|
readonly morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb";
|
|
748
811
|
readonly permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3";
|
|
812
|
+
/**
|
|
813
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
814
|
+
*/
|
|
815
|
+
readonly bundler: "0x4095F064B8d3c3548A3bebfd0Bbfd04750E30077";
|
|
749
816
|
readonly bundler3: {
|
|
750
817
|
readonly bundler3: "0x6566194141eefa99Af43Bb5Aa71460Ca2Dc90245";
|
|
751
818
|
readonly generalAdapter1: "0x4A6c312ec70E8747a587EE860a0353cd42Be0aE0";
|
|
@@ -759,11 +826,29 @@ export declare let addressesRegistry: {
|
|
|
759
826
|
readonly aaveV3EtherFiMigrationAdapter: "0x4011dc6581fA05F9B0c7A12AdCd676e2b1a59ca3";
|
|
760
827
|
readonly aaveV3OptimizerMigrationAdapter: "0x9e2ea2d5785598a163D569D795f286F5C55ad972";
|
|
761
828
|
};
|
|
829
|
+
/**
|
|
830
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
831
|
+
*/
|
|
832
|
+
readonly aaveV3OptimizerBundler: "0x16F38d2E764E7BeBF625a8E995b34968226D2F9c";
|
|
833
|
+
/**
|
|
834
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
835
|
+
*/
|
|
836
|
+
readonly aaveV2Bundler: "0xb3dCc75DB379925edFd3007511A8CE0cB4aa8e76";
|
|
837
|
+
/**
|
|
838
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
839
|
+
*/
|
|
840
|
+
readonly aaveV3Bundler: "0x98ccB155E86bb478d514a827d16f58c6912f9BDC";
|
|
841
|
+
/**
|
|
842
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
843
|
+
*/
|
|
844
|
+
readonly compoundV3Bundler: "0x3a0e2E9FB9c95fBc843daF166276C90B6C479558";
|
|
845
|
+
/**
|
|
846
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
847
|
+
*/
|
|
848
|
+
readonly compoundV2Bundler: "0x26bF52a84360Ad3d01d7CDc28FC2dDC04d8c8647";
|
|
762
849
|
readonly adaptiveCurveIrm: "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC";
|
|
763
850
|
readonly publicAllocator: "0xfd32fA2ca22c76dD6E550706Ad913FC6CE91c75D";
|
|
764
851
|
readonly metaMorphoFactory: "0x1897A8997241C1cD4bD0698647e4EB7213535c24";
|
|
765
|
-
readonly vaultV2Factory: "0xA1D94F746dEfa1928926b84fB2596c06926C0405";
|
|
766
|
-
readonly morphoVaultV1AdapterFactory: "0xD1B8E2dee25c2b89DCD2f98448a7ce87d6F63394";
|
|
767
852
|
readonly registryList: "0x3696c5eAe4a7Ffd04Ea163564571E9CD8Ed9364e";
|
|
768
853
|
readonly chainlinkOracleFactory: "0x3A7bB36Ee3f3eE32A60e9f2b33c1e5f2E83ad766";
|
|
769
854
|
readonly preLiquidationFactory: "0x6FF33615e792E35ed1026ea7cACCf42D9BF83476";
|
|
@@ -794,10 +879,16 @@ export declare let addressesRegistry: {
|
|
|
794
879
|
readonly crvUSDETHCRV: "0x4eBdF703948ddCEA3B11f675B4D1Fba9d2414A14";
|
|
795
880
|
readonly "stkcvx2BTC-f-morpho": "0x385E12cf4040543Bc8C18e05C1298Be5B04f3f5e";
|
|
796
881
|
readonly "2BTC-f": "0xB7ECB2AA52AA64a717180E030241bC75Cd946726";
|
|
882
|
+
readonly vaultV2Factory: "0xA1D94F746dEfa1928926b84fB2596c06926C0405";
|
|
883
|
+
readonly morphoVaultV1AdapterFactory: "0xD1B8E2dee25c2b89DCD2f98448a7ce87d6F63394";
|
|
797
884
|
};
|
|
798
885
|
readonly 8453: {
|
|
799
886
|
readonly morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb";
|
|
800
887
|
readonly permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3";
|
|
888
|
+
/**
|
|
889
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
890
|
+
*/
|
|
891
|
+
readonly bundler: "0x23055618898e202386e6c13955a58D3C68200BFB";
|
|
801
892
|
readonly bundler3: {
|
|
802
893
|
readonly bundler3: "0x6BFd8137e702540E7A42B74178A4a49Ba43920C4";
|
|
803
894
|
readonly generalAdapter1: "0xb98c948CFA24072e58935BC004a8A7b376AE746A";
|
|
@@ -806,11 +897,21 @@ export declare let addressesRegistry: {
|
|
|
806
897
|
readonly compoundV3MigrationAdapter: "0x85D4812Ef92c040d4270eD8547b6835e41FbbB70";
|
|
807
898
|
readonly aaveV3CoreMigrationAdapter: "0xb27Aa2a964eAd5ed661D86974b37e4fB995b36f5";
|
|
808
899
|
};
|
|
900
|
+
/**
|
|
901
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
902
|
+
*/
|
|
903
|
+
readonly compoundV2Bundler: "0x123f3167a416cA19365dE03a65e0AF3532af7223";
|
|
904
|
+
/**
|
|
905
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
906
|
+
*/
|
|
907
|
+
readonly aaveV3Bundler: "0xcAe2929baBc60Be34818EaA5F40bF69265677108";
|
|
908
|
+
/**
|
|
909
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
910
|
+
*/
|
|
911
|
+
readonly compoundV3Bundler: "0x1f8076e2EB6f10b12e6886f30D4909A91969F7dA";
|
|
809
912
|
readonly adaptiveCurveIrm: "0x46415998764C29aB2a25CbeA6254146D50D22687";
|
|
810
913
|
readonly publicAllocator: "0xA090dD1a701408Df1d4d0B85b716c87565f90467";
|
|
811
914
|
readonly metaMorphoFactory: "0xFf62A7c278C62eD665133147129245053Bbf5918";
|
|
812
|
-
readonly vaultV2Factory: "0x4501125508079A99ebBebCE205DeC9593C2b5857";
|
|
813
|
-
readonly morphoVaultV1AdapterFactory: "0xF42D9c36b34c9c2CF3Bc30eD2a52a90eEB604642";
|
|
814
915
|
readonly registryList: "0x5C2531Cbd2cf112Cf687da3Cd536708aDd7DB10a";
|
|
815
916
|
readonly chainlinkOracleFactory: "0x2DC205F24BCb6B311E5cdf0745B0741648Aebd3d";
|
|
816
917
|
readonly preLiquidationFactory: "0x8cd16b62E170Ee0bA83D80e1F80E6085367e2aef";
|
|
@@ -818,6 +919,8 @@ export declare let addressesRegistry: {
|
|
|
818
919
|
readonly usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
819
920
|
readonly verUsdc: "0x59aaF835D34b1E3dF2170e4872B785f11E2a964b";
|
|
820
921
|
readonly testUsdc: "0xBC77067f829979812d795d516E523C4033b66409";
|
|
922
|
+
readonly vaultV2Factory: "0x4501125508079A99ebBebCE205DeC9593C2b5857";
|
|
923
|
+
readonly morphoVaultV1AdapterFactory: "0xF42D9c36b34c9c2CF3Bc30eD2a52a90eEB604642";
|
|
821
924
|
};
|
|
822
925
|
readonly 137: {
|
|
823
926
|
readonly morpho: "0x1bF0c2541F820E775182832f06c0B7Fc27A25f67";
|
|
@@ -1091,7 +1194,6 @@ export declare let addressesRegistry: {
|
|
|
1091
1194
|
readonly chainlinkOracleFactory: "0xeb476f124FaD625178759d13557A72394A6f9aF5";
|
|
1092
1195
|
readonly preLiquidationFactory: "0x1b6782Ac7A859503cE953FBf4736311CC335B8f0";
|
|
1093
1196
|
readonly wNative: "0x5555555555555555555555555555555555555555";
|
|
1094
|
-
readonly usdc: "0xb88339CB7199b77E23DB6E890353E22632Ba630f";
|
|
1095
1197
|
};
|
|
1096
1198
|
readonly 1329: {
|
|
1097
1199
|
readonly morpho: "0xc9cDAc20FCeAAF616f7EB0bb6Cd2c69dcfa9094c";
|
|
@@ -1128,11 +1230,11 @@ export declare let deployments: {
|
|
|
1128
1230
|
readonly adaptiveCurveIrm: 18883124n;
|
|
1129
1231
|
readonly publicAllocator: 19375099n;
|
|
1130
1232
|
readonly metaMorphoFactory: 21439510n;
|
|
1131
|
-
readonly vaultV2Factory: 23375073n;
|
|
1132
|
-
readonly morphoVaultV1AdapterFactory: 23375073n;
|
|
1133
1233
|
readonly registryList: 23375119n;
|
|
1134
1234
|
readonly chainlinkOracleFactory: 19375066n;
|
|
1135
1235
|
readonly preLiquidationFactory: 21414664n;
|
|
1236
|
+
readonly vaultV2Factory: 23375073n;
|
|
1237
|
+
readonly morphoVaultV1AdapterFactory: 23375073n;
|
|
1136
1238
|
};
|
|
1137
1239
|
readonly 8453: {
|
|
1138
1240
|
readonly morpho: 13977148n;
|
|
@@ -1148,11 +1250,11 @@ export declare let deployments: {
|
|
|
1148
1250
|
readonly adaptiveCurveIrm: 13977152n;
|
|
1149
1251
|
readonly publicAllocator: 13979545n;
|
|
1150
1252
|
readonly metaMorphoFactory: 23928808n;
|
|
1151
|
-
readonly vaultV2Factory: 35615206n;
|
|
1152
|
-
readonly morphoVaultV1AdapterFactory: 35615206n;
|
|
1153
1253
|
readonly registryList: 35615358n;
|
|
1154
1254
|
readonly chainlinkOracleFactory: 13978286n;
|
|
1155
1255
|
readonly preLiquidationFactory: 23779056n;
|
|
1256
|
+
readonly vaultV2Factory: 35615206n;
|
|
1257
|
+
readonly morphoVaultV1AdapterFactory: 35615206n;
|
|
1156
1258
|
};
|
|
1157
1259
|
readonly 137: {
|
|
1158
1260
|
readonly morpho: 66931042n;
|
package/lib/addresses.js
CHANGED
|
@@ -20,6 +20,10 @@ const _addressesRegistry = {
|
|
|
20
20
|
[chain_js_1.ChainId.EthMainnet]: {
|
|
21
21
|
morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
|
|
22
22
|
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
25
|
+
*/
|
|
26
|
+
bundler: "0x4095F064B8d3c3548A3bebfd0Bbfd04750E30077",
|
|
23
27
|
bundler3: {
|
|
24
28
|
bundler3: "0x6566194141eefa99Af43Bb5Aa71460Ca2Dc90245",
|
|
25
29
|
generalAdapter1: "0x4A6c312ec70E8747a587EE860a0353cd42Be0aE0",
|
|
@@ -33,11 +37,29 @@ const _addressesRegistry = {
|
|
|
33
37
|
aaveV3EtherFiMigrationAdapter: "0x4011dc6581fA05F9B0c7A12AdCd676e2b1a59ca3",
|
|
34
38
|
aaveV3OptimizerMigrationAdapter: "0x9e2ea2d5785598a163D569D795f286F5C55ad972",
|
|
35
39
|
},
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
42
|
+
*/
|
|
43
|
+
aaveV3OptimizerBundler: "0x16F38d2E764E7BeBF625a8E995b34968226D2F9c",
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
46
|
+
*/
|
|
47
|
+
aaveV2Bundler: "0xb3dCc75DB379925edFd3007511A8CE0cB4aa8e76",
|
|
48
|
+
/**
|
|
49
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
50
|
+
*/
|
|
51
|
+
aaveV3Bundler: "0x98ccB155E86bb478d514a827d16f58c6912f9BDC",
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
54
|
+
*/
|
|
55
|
+
compoundV3Bundler: "0x3a0e2E9FB9c95fBc843daF166276C90B6C479558",
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
58
|
+
*/
|
|
59
|
+
compoundV2Bundler: "0x26bF52a84360Ad3d01d7CDc28FC2dDC04d8c8647",
|
|
36
60
|
adaptiveCurveIrm: "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC",
|
|
37
61
|
publicAllocator: "0xfd32fA2ca22c76dD6E550706Ad913FC6CE91c75D",
|
|
38
62
|
metaMorphoFactory: "0x1897A8997241C1cD4bD0698647e4EB7213535c24",
|
|
39
|
-
vaultV2Factory: "0xA1D94F746dEfa1928926b84fB2596c06926C0405",
|
|
40
|
-
morphoVaultV1AdapterFactory: "0xD1B8E2dee25c2b89DCD2f98448a7ce87d6F63394",
|
|
41
63
|
registryList: "0x3696c5eAe4a7Ffd04Ea163564571E9CD8Ed9364e",
|
|
42
64
|
chainlinkOracleFactory: "0x3A7bB36Ee3f3eE32A60e9f2b33c1e5f2E83ad766",
|
|
43
65
|
preLiquidationFactory: "0x6FF33615e792E35ed1026ea7cACCf42D9BF83476",
|
|
@@ -74,10 +96,16 @@ const _addressesRegistry = {
|
|
|
74
96
|
crvUSDETHCRV: "0x4eBdF703948ddCEA3B11f675B4D1Fba9d2414A14",
|
|
75
97
|
"stkcvx2BTC-f-morpho": "0x385E12cf4040543Bc8C18e05C1298Be5B04f3f5e",
|
|
76
98
|
"2BTC-f": "0xB7ECB2AA52AA64a717180E030241bC75Cd946726",
|
|
99
|
+
vaultV2Factory: "0xA1D94F746dEfa1928926b84fB2596c06926C0405",
|
|
100
|
+
morphoVaultV1AdapterFactory: "0xD1B8E2dee25c2b89DCD2f98448a7ce87d6F63394",
|
|
77
101
|
},
|
|
78
102
|
[chain_js_1.ChainId.BaseMainnet]: {
|
|
79
103
|
morpho: "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
|
|
80
104
|
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
|
|
105
|
+
/**
|
|
106
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
107
|
+
*/
|
|
108
|
+
bundler: "0x23055618898e202386e6c13955a58D3C68200BFB",
|
|
81
109
|
bundler3: {
|
|
82
110
|
bundler3: "0x6BFd8137e702540E7A42B74178A4a49Ba43920C4",
|
|
83
111
|
generalAdapter1: "0xb98c948CFA24072e58935BC004a8A7b376AE746A",
|
|
@@ -86,11 +114,21 @@ const _addressesRegistry = {
|
|
|
86
114
|
compoundV3MigrationAdapter: "0x85D4812Ef92c040d4270eD8547b6835e41FbbB70",
|
|
87
115
|
aaveV3CoreMigrationAdapter: "0xb27Aa2a964eAd5ed661D86974b37e4fB995b36f5",
|
|
88
116
|
},
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
119
|
+
*/
|
|
120
|
+
compoundV2Bundler: "0x123f3167a416cA19365dE03a65e0AF3532af7223",
|
|
121
|
+
/**
|
|
122
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
123
|
+
*/
|
|
124
|
+
aaveV3Bundler: "0xcAe2929baBc60Be34818EaA5F40bF69265677108",
|
|
125
|
+
/**
|
|
126
|
+
* @deprecated All bundles should use Bundler3 instead.
|
|
127
|
+
*/
|
|
128
|
+
compoundV3Bundler: "0x1f8076e2EB6f10b12e6886f30D4909A91969F7dA",
|
|
89
129
|
adaptiveCurveIrm: "0x46415998764C29aB2a25CbeA6254146D50D22687",
|
|
90
130
|
publicAllocator: "0xA090dD1a701408Df1d4d0B85b716c87565f90467",
|
|
91
131
|
metaMorphoFactory: "0xFf62A7c278C62eD665133147129245053Bbf5918",
|
|
92
|
-
vaultV2Factory: "0x4501125508079A99ebBebCE205DeC9593C2b5857",
|
|
93
|
-
morphoVaultV1AdapterFactory: "0xF42D9c36b34c9c2CF3Bc30eD2a52a90eEB604642",
|
|
94
132
|
registryList: "0x5C2531Cbd2cf112Cf687da3Cd536708aDd7DB10a",
|
|
95
133
|
chainlinkOracleFactory: "0x2DC205F24BCb6B311E5cdf0745B0741648Aebd3d",
|
|
96
134
|
preLiquidationFactory: "0x8cd16b62E170Ee0bA83D80e1F80E6085367e2aef",
|
|
@@ -99,6 +137,8 @@ const _addressesRegistry = {
|
|
|
99
137
|
usdc: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
100
138
|
verUsdc: "0x59aaF835D34b1E3dF2170e4872B785f11E2a964b",
|
|
101
139
|
testUsdc: "0xBC77067f829979812d795d516E523C4033b66409",
|
|
140
|
+
vaultV2Factory: "0x4501125508079A99ebBebCE205DeC9593C2b5857",
|
|
141
|
+
morphoVaultV1AdapterFactory: "0xF42D9c36b34c9c2CF3Bc30eD2a52a90eEB604642",
|
|
102
142
|
},
|
|
103
143
|
[chain_js_1.ChainId.PolygonMainnet]: {
|
|
104
144
|
morpho: "0x1bF0c2541F820E775182832f06c0B7Fc27A25f67",
|
|
@@ -381,8 +421,6 @@ const _addressesRegistry = {
|
|
|
381
421
|
chainlinkOracleFactory: "0xeb476f124FaD625178759d13557A72394A6f9aF5",
|
|
382
422
|
preLiquidationFactory: "0x1b6782Ac7A859503cE953FBf4736311CC335B8f0",
|
|
383
423
|
wNative: "0x5555555555555555555555555555555555555555",
|
|
384
|
-
// Must implement USDC permit version 2 (otherwise breaks permit signatures).
|
|
385
|
-
usdc: "0xb88339CB7199b77E23DB6E890353E22632Ba630f",
|
|
386
424
|
},
|
|
387
425
|
[chain_js_1.ChainId.SeiMainnet]: {
|
|
388
426
|
morpho: "0xc9cDAc20FCeAAF616f7EB0bb6Cd2c69dcfa9094c",
|
|
@@ -418,11 +456,11 @@ const _deployments = {
|
|
|
418
456
|
adaptiveCurveIrm: 18883124n,
|
|
419
457
|
publicAllocator: 19375099n,
|
|
420
458
|
metaMorphoFactory: 21439510n,
|
|
421
|
-
vaultV2Factory: 23375073n,
|
|
422
|
-
morphoVaultV1AdapterFactory: 23375073n,
|
|
423
459
|
registryList: 23375119n,
|
|
424
460
|
chainlinkOracleFactory: 19375066n,
|
|
425
461
|
preLiquidationFactory: 21414664n,
|
|
462
|
+
vaultV2Factory: 23375073n,
|
|
463
|
+
morphoVaultV1AdapterFactory: 23375073n,
|
|
426
464
|
},
|
|
427
465
|
[chain_js_1.ChainId.BaseMainnet]: {
|
|
428
466
|
morpho: 13977148n,
|
|
@@ -438,11 +476,11 @@ const _deployments = {
|
|
|
438
476
|
adaptiveCurveIrm: 13977152n,
|
|
439
477
|
publicAllocator: 13979545n,
|
|
440
478
|
metaMorphoFactory: 23928808n,
|
|
441
|
-
vaultV2Factory: 35615206n,
|
|
442
|
-
morphoVaultV1AdapterFactory: 35615206n,
|
|
443
479
|
registryList: 35615358n,
|
|
444
480
|
chainlinkOracleFactory: 13978286n,
|
|
445
481
|
preLiquidationFactory: 23779056n,
|
|
482
|
+
vaultV2Factory: 35615206n,
|
|
483
|
+
morphoVaultV1AdapterFactory: 35615206n,
|
|
446
484
|
},
|
|
447
485
|
[chain_js_1.ChainId.PolygonMainnet]: {
|
|
448
486
|
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
|
}
|
|
@@ -98,9 +88,19 @@ export declare class Market implements IMarket {
|
|
|
98
88
|
*/
|
|
99
89
|
get utilization(): bigint;
|
|
100
90
|
/**
|
|
101
|
-
* The market's Annual Percentage Yield (APY) at the IRM's target utilization rate, if applicable.
|
|
91
|
+
* The market's Annual Percentage Yield (APY) at the IRM's target utilization rate, if applicable (scaled by WAD).
|
|
92
|
+
*/
|
|
93
|
+
get apyAtTarget(): bigint | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Returns the rate at which interest accrued for suppliers of this market,
|
|
96
|
+
* since the last time the market was updated (scaled by WAD).
|
|
97
|
+
* @deprecated There's no such thing as a supply rate in Morpho. Only the supply APY is meaningful.
|
|
98
|
+
*/
|
|
99
|
+
get supplyRate(): bigint;
|
|
100
|
+
/**
|
|
101
|
+
* @deprecated Use `avgBorrowRate` instead.
|
|
102
102
|
*/
|
|
103
|
-
get
|
|
103
|
+
get borrowRate(): bigint;
|
|
104
104
|
/**
|
|
105
105
|
* Returns the instantaneous rate at which interest accrues for borrowers of this market,
|
|
106
106
|
* if `accrueInterest` was called immediately onchain (scaled by WAD).
|
|
@@ -127,15 +127,19 @@ export declare class Market implements IMarket {
|
|
|
127
127
|
*/
|
|
128
128
|
get avgBorrowRate(): bigint;
|
|
129
129
|
/**
|
|
130
|
-
* The market's current, instantaneous supply-side Annual Percentage Yield (APY).
|
|
130
|
+
* The market's current, instantaneous supply-side Annual Percentage Yield (APY) (scaled by WAD).
|
|
131
131
|
* If interested in the APY at a specific timestamp, use `getSupplyApy(timestamp)` instead.
|
|
132
132
|
*/
|
|
133
|
-
get supplyApy():
|
|
133
|
+
get supplyApy(): bigint;
|
|
134
134
|
/**
|
|
135
|
-
* The market's current, instantaneous borrow-side Annual Percentage Yield (APY).
|
|
135
|
+
* The market's current, instantaneous borrow-side Annual Percentage Yield (APY) (scaled by WAD).
|
|
136
136
|
* If interested in the APY at a specific timestamp, use `getBorrowApy(timestamp)` instead.
|
|
137
137
|
*/
|
|
138
|
-
get borrowApy():
|
|
138
|
+
get borrowApy(): bigint;
|
|
139
|
+
/**
|
|
140
|
+
* @deprecated Use `getEndBorrowRate(timestamp)` instead.
|
|
141
|
+
*/
|
|
142
|
+
getBorrowRate(timestamp?: BigIntish): bigint;
|
|
139
143
|
/**
|
|
140
144
|
* Returns the instantaneous rate at which interest accrues for borrowers of this market,
|
|
141
145
|
* at the given timestamp, if the state remains unchanged (not accrued) (scaled by WAD).
|
|
@@ -169,44 +173,36 @@ export declare class Market implements IMarket {
|
|
|
169
173
|
};
|
|
170
174
|
/**
|
|
171
175
|
* The market's instantaneous borrow-side Annual Percentage Yield (APY) at the given timestamp,
|
|
172
|
-
* if the state remains unchanged (not accrued).
|
|
176
|
+
* if the state remains unchanged (not accrued) (scaled by WAD).
|
|
173
177
|
* @param timestamp The timestamp at which to calculate the borrow APY.
|
|
174
178
|
* Must be greater than or equal to `lastUpdate`.
|
|
175
179
|
* Defaults to `Time.timestamp()` (returns the current borrow APY).
|
|
176
180
|
*/
|
|
177
|
-
getBorrowApy(timestamp?: BigIntish):
|
|
181
|
+
getBorrowApy(timestamp?: BigIntish): bigint;
|
|
178
182
|
/**
|
|
179
183
|
* The market's instantaneous supply-side Annual Percentage Yield (APY) at the given timestamp,
|
|
180
|
-
* if the state remains unchanged (not accrued).
|
|
184
|
+
* if the state remains unchanged (not accrued) (scaled by WAD).
|
|
181
185
|
* @param timestamp The timestamp at which to calculate the supply APY.
|
|
182
186
|
* Must be greater than or equal to `lastUpdate`.
|
|
183
187
|
* Defaults to `Time.timestamp()` (returns the current supply APY).
|
|
184
188
|
*/
|
|
185
|
-
getSupplyApy(timestamp?: BigIntish):
|
|
189
|
+
getSupplyApy(timestamp?: BigIntish): bigint;
|
|
186
190
|
/**
|
|
187
191
|
* The market's experienced borrow-side Annual Percentage Yield (APY),
|
|
188
|
-
* if interest was to be accrued at the given timestamp.
|
|
192
|
+
* if interest was to be accrued at the given timestamp (scaled by WAD).
|
|
189
193
|
* @param timestamp The timestamp at which to calculate the borrow APY.
|
|
190
194
|
* Must be greater than or equal to `lastUpdate`.
|
|
191
195
|
* Defaults to `Time.timestamp()` (returns the current borrow APY).
|
|
192
196
|
*/
|
|
193
|
-
getAvgBorrowApy(timestamp?: BigIntish):
|
|
194
|
-
/**
|
|
195
|
-
* Returns the average rate at which interest _would_ accrue for suppliers of this market,
|
|
196
|
-
* if `accrueInterest` was called at the given timestamp (scaled by WAD).
|
|
197
|
-
* @param timestamp The timestamp at which to calculate the average supply rate.
|
|
198
|
-
* Must be greater than or equal to `lastUpdate`.
|
|
199
|
-
* Defaults to `Time.timestamp()` (returns the current average supply rate).
|
|
200
|
-
*/
|
|
201
|
-
getAvgSupplyRate(timestamp?: BigIntish): bigint;
|
|
197
|
+
getAvgBorrowApy(timestamp?: BigIntish): bigint;
|
|
202
198
|
/**
|
|
203
199
|
* The market's experienced supply-side Annual Percentage Yield (APY),
|
|
204
|
-
* if interest was to be accrued at the given timestamp.
|
|
200
|
+
* if interest was to be accrued at the given timestamp (scaled by WAD).
|
|
205
201
|
* @param timestamp The timestamp at which to calculate the supply APY.
|
|
206
202
|
* Must be greater than or equal to `lastUpdate`.
|
|
207
203
|
* Defaults to `Time.timestamp()` (returns the current supply APY).
|
|
208
204
|
*/
|
|
209
|
-
getAvgSupplyApy(timestamp?: BigIntish):
|
|
205
|
+
getAvgSupplyApy(timestamp?: BigIntish): bigint;
|
|
210
206
|
/**
|
|
211
207
|
* Returns a new market derived from this market, whose interest has been accrued up to the given timestamp.
|
|
212
208
|
* @param timestamp The timestamp at which to accrue interest.
|