@defisaver/positions-sdk 0.0.98 → 0.0.100

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.
Files changed (80) hide show
  1. package/README.md +63 -63
  2. package/cjs/config/contracts.d.ts +361 -15
  3. package/cjs/config/contracts.js +37 -15
  4. package/cjs/helpers/morphoBlueHelpers/index.d.ts +9 -2
  5. package/cjs/helpers/morphoBlueHelpers/index.js +66 -1
  6. package/cjs/maker/index.js +1 -1
  7. package/cjs/morphoBlue/index.js +4 -27
  8. package/cjs/types/contracts/generated/AaveV3View.d.ts +29 -2
  9. package/cjs/types/contracts/generated/MorphoBlueView.d.ts +61 -0
  10. package/cjs/types/contracts/generated/SparkView.d.ts +29 -2
  11. package/esm/config/contracts.d.ts +361 -15
  12. package/esm/config/contracts.js +37 -15
  13. package/esm/helpers/morphoBlueHelpers/index.d.ts +9 -2
  14. package/esm/helpers/morphoBlueHelpers/index.js +62 -0
  15. package/esm/maker/index.js +1 -1
  16. package/esm/morphoBlue/index.js +4 -27
  17. package/esm/types/contracts/generated/AaveV3View.d.ts +29 -2
  18. package/esm/types/contracts/generated/MorphoBlueView.d.ts +61 -0
  19. package/esm/types/contracts/generated/SparkView.d.ts +29 -2
  20. package/package.json +41 -40
  21. package/src/aaveV2/index.ts +227 -227
  22. package/src/aaveV3/index.ts +558 -558
  23. package/src/assets/index.ts +60 -60
  24. package/src/chickenBonds/index.ts +123 -123
  25. package/src/compoundV2/index.ts +219 -219
  26. package/src/compoundV3/index.ts +266 -266
  27. package/src/config/contracts.js +871 -848
  28. package/src/constants/index.ts +5 -5
  29. package/src/contracts.ts +128 -128
  30. package/src/curveUsd/index.ts +229 -229
  31. package/src/exchange/index.ts +17 -17
  32. package/src/helpers/aaveHelpers/index.ts +134 -134
  33. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  34. package/src/helpers/compoundHelpers/index.ts +181 -181
  35. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  36. package/src/helpers/index.ts +7 -7
  37. package/src/helpers/llamaLendHelpers/index.ts +45 -45
  38. package/src/helpers/makerHelpers/index.ts +94 -94
  39. package/src/helpers/morphoBlueHelpers/index.ts +117 -56
  40. package/src/helpers/sparkHelpers/index.ts +106 -106
  41. package/src/index.ts +46 -46
  42. package/src/liquity/index.ts +116 -116
  43. package/src/llamaLend/index.ts +268 -268
  44. package/src/maker/index.ts +117 -117
  45. package/src/markets/aave/index.ts +80 -80
  46. package/src/markets/aave/marketAssets.ts +24 -24
  47. package/src/markets/compound/index.ts +142 -142
  48. package/src/markets/compound/marketsAssets.ts +50 -50
  49. package/src/markets/curveUsd/index.ts +69 -69
  50. package/src/markets/index.ts +5 -5
  51. package/src/markets/llamaLend/contractAddresses.ts +95 -95
  52. package/src/markets/llamaLend/index.ts +150 -150
  53. package/src/markets/morphoBlue/index.ts +611 -611
  54. package/src/markets/spark/index.ts +29 -29
  55. package/src/markets/spark/marketAssets.ts +10 -10
  56. package/src/moneymarket/moneymarketCommonService.ts +76 -76
  57. package/src/morphoAaveV2/index.ts +256 -256
  58. package/src/morphoAaveV3/index.ts +612 -612
  59. package/src/morphoBlue/index.ts +171 -199
  60. package/src/multicall/index.ts +22 -22
  61. package/src/services/dsrService.ts +15 -15
  62. package/src/services/priceService.ts +21 -21
  63. package/src/services/utils.ts +51 -51
  64. package/src/setup.ts +8 -8
  65. package/src/spark/index.ts +424 -424
  66. package/src/staking/staking.ts +187 -187
  67. package/src/types/aave.ts +256 -256
  68. package/src/types/chickenBonds.ts +45 -45
  69. package/src/types/common.ts +84 -84
  70. package/src/types/compound.ts +128 -128
  71. package/src/types/contracts/generated/AaveV3View.ts +43 -3
  72. package/src/types/contracts/generated/MorphoBlueView.ts +87 -0
  73. package/src/types/contracts/generated/SparkView.ts +43 -3
  74. package/src/types/curveUsd.ts +118 -118
  75. package/src/types/index.ts +8 -8
  76. package/src/types/liquity.ts +30 -30
  77. package/src/types/llamaLend.ts +143 -143
  78. package/src/types/maker.ts +50 -50
  79. package/src/types/morphoBlue.ts +139 -139
  80. package/src/types/spark.ts +106 -106
@@ -1,84 +1,84 @@
1
- // General
2
- export type EthAddress = string;
3
- export type Blockish = number | 'latest';
4
- export type AssetSymbol = string;
5
- export type Amount = string | number;
6
-
7
- export enum NetworkNumber {
8
- Eth = 1,
9
- Opt = 10,
10
- Arb = 42161,
11
- Base = 8453,
12
- }
13
- export type Networkish = string | NetworkNumber;
14
-
15
- // Common
16
- export interface MMAssetData {
17
- symbol: string,
18
- supplyRate: string,
19
- borrowRate: string,
20
- price: string,
21
- collateralFactor: string,
22
- underlyingTokenAddress: string,
23
- marketLiquidity: string,
24
- utilization: string,
25
- borrowCap: string,
26
- totalSupply: string,
27
- canBeBorrowed: boolean,
28
- canBeSupplied: boolean,
29
- totalBorrow: string,
30
- incentiveBorrowApy?: string,
31
- incentiveBorrowToken?: string,
32
- incentiveSupplyApy?: string,
33
- incentiveSupplyToken?: string,
34
- borrowRateP2P?: string,
35
- supplyRateP2P?: string,
36
- }
37
-
38
- export interface MMAssetsData {
39
- [token: string]: MMAssetData,
40
- }
41
- export interface MMMarketData {
42
- assetsData: MMAssetData[],
43
- }
44
- export interface MMUsedAsset {
45
- symbol: string,
46
- supplied: string,
47
- suppliedUsd: string,
48
- isSupplied: boolean,
49
- borrowed: string,
50
- borrowedUsd: string,
51
- isBorrowed: boolean,
52
- debt?: string,
53
- supplyRate?: string,
54
- borrowRate?: string,
55
- discountedBorrowRate?: string,
56
- stableBorrowRate?: string,
57
- interestMode?: string,
58
- collateral?: boolean,
59
- }
60
- export interface MMUsedAssets {
61
- [token: string]: MMUsedAsset,
62
- }
63
- export interface MMUsedAssetWStableB extends MMUsedAsset {
64
- stableBorrowRate: string,
65
- borrowedStable: string,
66
- borrowedVariable: string,
67
- borrowedUsdStable: string,
68
- borrowedUsdVariable: string,
69
- interestMode: string,
70
- }
71
- export interface MMPositionData {
72
- usedAssets: any,
73
- netApy: string,
74
- lastUpdated: number,
75
- // ...
76
- }
77
-
78
- export type Balances = Record<AssetSymbol, Amount>;
79
- export interface PositionBalances {
80
- collateral?: Balances,
81
- debt?: Balances,
82
- selling?: Balances,
83
- deposited?: Balances,
84
- }
1
+ // General
2
+ export type EthAddress = string;
3
+ export type Blockish = number | 'latest';
4
+ export type AssetSymbol = string;
5
+ export type Amount = string | number;
6
+
7
+ export enum NetworkNumber {
8
+ Eth = 1,
9
+ Opt = 10,
10
+ Arb = 42161,
11
+ Base = 8453,
12
+ }
13
+ export type Networkish = string | NetworkNumber;
14
+
15
+ // Common
16
+ export interface MMAssetData {
17
+ symbol: string,
18
+ supplyRate: string,
19
+ borrowRate: string,
20
+ price: string,
21
+ collateralFactor: string,
22
+ underlyingTokenAddress: string,
23
+ marketLiquidity: string,
24
+ utilization: string,
25
+ borrowCap: string,
26
+ totalSupply: string,
27
+ canBeBorrowed: boolean,
28
+ canBeSupplied: boolean,
29
+ totalBorrow: string,
30
+ incentiveBorrowApy?: string,
31
+ incentiveBorrowToken?: string,
32
+ incentiveSupplyApy?: string,
33
+ incentiveSupplyToken?: string,
34
+ borrowRateP2P?: string,
35
+ supplyRateP2P?: string,
36
+ }
37
+
38
+ export interface MMAssetsData {
39
+ [token: string]: MMAssetData,
40
+ }
41
+ export interface MMMarketData {
42
+ assetsData: MMAssetData[],
43
+ }
44
+ export interface MMUsedAsset {
45
+ symbol: string,
46
+ supplied: string,
47
+ suppliedUsd: string,
48
+ isSupplied: boolean,
49
+ borrowed: string,
50
+ borrowedUsd: string,
51
+ isBorrowed: boolean,
52
+ debt?: string,
53
+ supplyRate?: string,
54
+ borrowRate?: string,
55
+ discountedBorrowRate?: string,
56
+ stableBorrowRate?: string,
57
+ interestMode?: string,
58
+ collateral?: boolean,
59
+ }
60
+ export interface MMUsedAssets {
61
+ [token: string]: MMUsedAsset,
62
+ }
63
+ export interface MMUsedAssetWStableB extends MMUsedAsset {
64
+ stableBorrowRate: string,
65
+ borrowedStable: string,
66
+ borrowedVariable: string,
67
+ borrowedUsdStable: string,
68
+ borrowedUsdVariable: string,
69
+ interestMode: string,
70
+ }
71
+ export interface MMPositionData {
72
+ usedAssets: any,
73
+ netApy: string,
74
+ lastUpdated: number,
75
+ // ...
76
+ }
77
+
78
+ export type Balances = Record<AssetSymbol, Amount>;
79
+ export interface PositionBalances {
80
+ collateral?: Balances,
81
+ debt?: Balances,
82
+ selling?: Balances,
83
+ deposited?: Balances,
84
+ }
@@ -1,129 +1,129 @@
1
- import {
2
- MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
3
- } from './common';
4
-
5
- export enum CompoundVersions {
6
- 'CompoundV2' = 'v2',
7
- 'CompoundV3USDC' = 'v3-USDC',
8
- 'CompoundV3USDCe' = 'v3-USDC.e',
9
- 'CompoundV3ETH' = 'v3-ETH',
10
- 'CompoundV3USDbC' = 'v3-USDbC',
11
- }
12
-
13
- export interface CompoundBulkerOptions {
14
- supply: number | string,
15
- withdraw: number | string,
16
- }
17
-
18
- export interface CompoundMarketData {
19
- chainIds: NetworkNumber[],
20
- label: string,
21
- shortLabel: string,
22
- value: CompoundVersions,
23
- baseAsset: string,
24
- collAssets: readonly string[],
25
- baseMarket: string,
26
- baseMarketAddress: string,
27
- secondLabel: string,
28
- bulkerName: string,
29
- bulkerAddress: string,
30
- bulkerOptions: CompoundBulkerOptions,
31
- // icon: Function,
32
- }
33
-
34
- export interface CompoundUsedAsset extends MMUsedAsset {
35
- collateral: boolean,
36
- limit?: string,
37
- }
38
-
39
- export interface CompoundV2UsedAsset extends CompoundUsedAsset {
40
- }
41
- export interface CompoundV3UsedAsset extends CompoundUsedAsset {
42
- }
43
-
44
- export interface CompoundUsedAssets<T> {
45
- [token: string]: T,
46
- }
47
-
48
- export type CompoundV2UsedAssets = CompoundUsedAssets<CompoundV2UsedAsset>;
49
- export type CompoundV3UsedAssets = CompoundUsedAssets<CompoundV3UsedAsset>;
50
-
51
- export interface CompoundAssetData extends MMAssetData {
52
- supplyCapAlternative?: string,
53
- totalSupplyAlternative?: string,
54
- priceAlternative?: string,
55
- sortIndex?: number,
56
- }
57
-
58
- export interface CompoundV2AssetData extends CompoundAssetData {
59
- }
60
- export interface CompoundV3AssetData extends CompoundAssetData {
61
- borrowCollateralFactor: string,
62
- liquidateCollateralFactor: string,
63
- minDebt: string,
64
- liquidationRatio: string,
65
- supplyCap: string,
66
- priceInBaseAsset: string,
67
- }
68
-
69
- export interface CompoundAssetsData<T> {
70
- [token: string]: T
71
- }
72
- export type CompoundV2AssetsData = CompoundAssetsData<CompoundV2AssetData>;
73
- export type CompoundV3AssetsData = CompoundAssetsData<CompoundV3AssetData>;
74
-
75
- export type CompoundMarketsData<T> = { assetsData: T };
76
- export type CompoundV2MarketsData = CompoundMarketsData<CompoundV2AssetsData>;
77
- export type CompoundV3MarketsData = CompoundMarketsData<CompoundV3AssetsData>;
78
-
79
- export interface BaseAdditionalAssetData {
80
- totalBorrow: string,
81
- utilization: string,
82
- marketLiquidity: string,
83
- rewardSupplySpeed: string,
84
- rewardBorrowSpeed: string,
85
- minDebt: string,
86
- isBase: boolean,
87
- }
88
-
89
- export interface CompoundAggregatedPositionData {
90
- suppliedUsd: string,
91
- suppliedCollateralUsd: string,
92
- borrowedUsd: string,
93
- borrowLimitUsd: string,
94
- liquidationLimitUsd: string,
95
- leftToBorrowUsd: string,
96
- ratio: string,
97
- collRatio: string,
98
- netApy: string,
99
- incentiveUsd: string,
100
- totalInterestUsd: string,
101
- liqRatio: string,
102
- liqPercent: string,
103
- leveragedType: string,
104
- leveragedAsset?: string,
105
- leveragedLsdAssetRatio?: string,
106
- liquidationPrice?: string,
107
- minRatio: string,
108
- debtTooLow: boolean,
109
- minDebt: string,
110
- }
111
-
112
- export interface CompoundPositionData extends MMPositionData {
113
- ratio: string,
114
- minRatio: string,
115
- borrowedUsd: string,
116
- borrowLimitUsd: string,
117
- incentiveUsd: string,
118
- totalInterestUsd: string,
119
- isSubscribedToAutomation?: boolean,
120
- automationResubscribeRequired?: boolean,
121
- }
122
-
123
- export interface CompoundV2PositionData extends CompoundPositionData {
124
- usedAssets: CompoundV2UsedAssets,
125
- }
126
-
127
- export interface CompoundV3PositionData extends CompoundPositionData {
128
- usedAssets: CompoundV3UsedAssets,
1
+ import {
2
+ MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
3
+ } from './common';
4
+
5
+ export enum CompoundVersions {
6
+ 'CompoundV2' = 'v2',
7
+ 'CompoundV3USDC' = 'v3-USDC',
8
+ 'CompoundV3USDCe' = 'v3-USDC.e',
9
+ 'CompoundV3ETH' = 'v3-ETH',
10
+ 'CompoundV3USDbC' = 'v3-USDbC',
11
+ }
12
+
13
+ export interface CompoundBulkerOptions {
14
+ supply: number | string,
15
+ withdraw: number | string,
16
+ }
17
+
18
+ export interface CompoundMarketData {
19
+ chainIds: NetworkNumber[],
20
+ label: string,
21
+ shortLabel: string,
22
+ value: CompoundVersions,
23
+ baseAsset: string,
24
+ collAssets: readonly string[],
25
+ baseMarket: string,
26
+ baseMarketAddress: string,
27
+ secondLabel: string,
28
+ bulkerName: string,
29
+ bulkerAddress: string,
30
+ bulkerOptions: CompoundBulkerOptions,
31
+ // icon: Function,
32
+ }
33
+
34
+ export interface CompoundUsedAsset extends MMUsedAsset {
35
+ collateral: boolean,
36
+ limit?: string,
37
+ }
38
+
39
+ export interface CompoundV2UsedAsset extends CompoundUsedAsset {
40
+ }
41
+ export interface CompoundV3UsedAsset extends CompoundUsedAsset {
42
+ }
43
+
44
+ export interface CompoundUsedAssets<T> {
45
+ [token: string]: T,
46
+ }
47
+
48
+ export type CompoundV2UsedAssets = CompoundUsedAssets<CompoundV2UsedAsset>;
49
+ export type CompoundV3UsedAssets = CompoundUsedAssets<CompoundV3UsedAsset>;
50
+
51
+ export interface CompoundAssetData extends MMAssetData {
52
+ supplyCapAlternative?: string,
53
+ totalSupplyAlternative?: string,
54
+ priceAlternative?: string,
55
+ sortIndex?: number,
56
+ }
57
+
58
+ export interface CompoundV2AssetData extends CompoundAssetData {
59
+ }
60
+ export interface CompoundV3AssetData extends CompoundAssetData {
61
+ borrowCollateralFactor: string,
62
+ liquidateCollateralFactor: string,
63
+ minDebt: string,
64
+ liquidationRatio: string,
65
+ supplyCap: string,
66
+ priceInBaseAsset: string,
67
+ }
68
+
69
+ export interface CompoundAssetsData<T> {
70
+ [token: string]: T
71
+ }
72
+ export type CompoundV2AssetsData = CompoundAssetsData<CompoundV2AssetData>;
73
+ export type CompoundV3AssetsData = CompoundAssetsData<CompoundV3AssetData>;
74
+
75
+ export type CompoundMarketsData<T> = { assetsData: T };
76
+ export type CompoundV2MarketsData = CompoundMarketsData<CompoundV2AssetsData>;
77
+ export type CompoundV3MarketsData = CompoundMarketsData<CompoundV3AssetsData>;
78
+
79
+ export interface BaseAdditionalAssetData {
80
+ totalBorrow: string,
81
+ utilization: string,
82
+ marketLiquidity: string,
83
+ rewardSupplySpeed: string,
84
+ rewardBorrowSpeed: string,
85
+ minDebt: string,
86
+ isBase: boolean,
87
+ }
88
+
89
+ export interface CompoundAggregatedPositionData {
90
+ suppliedUsd: string,
91
+ suppliedCollateralUsd: string,
92
+ borrowedUsd: string,
93
+ borrowLimitUsd: string,
94
+ liquidationLimitUsd: string,
95
+ leftToBorrowUsd: string,
96
+ ratio: string,
97
+ collRatio: string,
98
+ netApy: string,
99
+ incentiveUsd: string,
100
+ totalInterestUsd: string,
101
+ liqRatio: string,
102
+ liqPercent: string,
103
+ leveragedType: string,
104
+ leveragedAsset?: string,
105
+ leveragedLsdAssetRatio?: string,
106
+ liquidationPrice?: string,
107
+ minRatio: string,
108
+ debtTooLow: boolean,
109
+ minDebt: string,
110
+ }
111
+
112
+ export interface CompoundPositionData extends MMPositionData {
113
+ ratio: string,
114
+ minRatio: string,
115
+ borrowedUsd: string,
116
+ borrowLimitUsd: string,
117
+ incentiveUsd: string,
118
+ totalInterestUsd: string,
119
+ isSubscribedToAutomation?: boolean,
120
+ automationResubscribeRequired?: boolean,
121
+ }
122
+
123
+ export interface CompoundV2PositionData extends CompoundPositionData {
124
+ usedAssets: CompoundV2UsedAssets,
125
+ }
126
+
127
+ export interface CompoundV3PositionData extends CompoundPositionData {
128
+ usedAssets: CompoundV3UsedAssets,
129
129
  }
@@ -22,6 +22,41 @@ export interface EventOptions {
22
22
  }
23
23
 
24
24
  export declare namespace AaveV3View {
25
+ export type LiquidityChangeParamsStruct =
26
+ | [string, number | string | BN, number | string | BN]
27
+ | {
28
+ reserveAddress: string;
29
+ liquidityAdded: number | string | BN;
30
+ liquidityTaken: number | string | BN;
31
+ };
32
+
33
+ export type LiquidityChangeParamsStructOutputArray = [string, string, string];
34
+ export type LiquidityChangeParamsStructOutputStruct = {
35
+ reserveAddress: string;
36
+ liquidityAdded: string;
37
+ liquidityTaken: string;
38
+ };
39
+ export type LiquidityChangeParamsStructOutput =
40
+ LiquidityChangeParamsStructOutputArray &
41
+ LiquidityChangeParamsStructOutputStruct;
42
+
43
+ export type EstimatedRatesStruct =
44
+ | [string, number | string | BN, number | string | BN]
45
+ | {
46
+ reserveAddress: string;
47
+ supplyRate: number | string | BN;
48
+ variableBorrowRate: number | string | BN;
49
+ };
50
+
51
+ export type EstimatedRatesStructOutputArray = [string, string, string];
52
+ export type EstimatedRatesStructOutputStruct = {
53
+ reserveAddress: string;
54
+ supplyRate: string;
55
+ variableBorrowRate: string;
56
+ };
57
+ export type EstimatedRatesStructOutput = EstimatedRatesStructOutputArray &
58
+ EstimatedRatesStructOutputStruct;
59
+
25
60
  export type TokenInfoFullStruct =
26
61
  | [
27
62
  string,
@@ -177,6 +212,7 @@ export declare namespace AaveV3View {
177
212
  number | string | BN,
178
213
  number | string | BN,
179
214
  string[],
215
+ boolean[],
180
216
  string[],
181
217
  number | string | BN[],
182
218
  number | string | BN[],
@@ -192,6 +228,7 @@ export declare namespace AaveV3View {
192
228
  ratio: number | string | BN;
193
229
  eMode: number | string | BN;
194
230
  collAddr: string[];
231
+ enabledAsColl: boolean[];
195
232
  borrowAddr: string[];
196
233
  collAmounts: number | string | BN[];
197
234
  borrowStableAmounts: number | string | BN[];
@@ -208,6 +245,7 @@ export declare namespace AaveV3View {
208
245
  string,
209
246
  string,
210
247
  string[],
248
+ boolean[],
211
249
  string[],
212
250
  string[],
213
251
  string[],
@@ -223,6 +261,7 @@ export declare namespace AaveV3View {
223
261
  ratio: string;
224
262
  eMode: string;
225
263
  collAddr: string[];
264
+ enabledAsColl: boolean[];
226
265
  borrowAddr: string[];
227
266
  collAmounts: string[];
228
267
  borrowStableAmounts: string[];
@@ -315,9 +354,10 @@ export interface AaveV3View extends BaseContract {
315
354
  methods: {
316
355
  AAVE_REFERRAL_CODE(): NonPayableTransactionObject<string>;
317
356
 
318
- STABLE_ID(): NonPayableTransactionObject<string>;
319
-
320
- VARIABLE_ID(): NonPayableTransactionObject<string>;
357
+ getApyAfterValuesEstimation(
358
+ _market: string,
359
+ _reserveParams: AaveV3View.LiquidityChangeParamsStruct[]
360
+ ): NonPayableTransactionObject<AaveV3View.EstimatedRatesStructOutput[]>;
321
361
 
322
362
  getAssetPrice(
323
363
  _market: string,
@@ -48,7 +48,69 @@ export type MarketParamsStructOutputStruct = {
48
48
  export type MarketParamsStructOutput = MarketParamsStructOutputArray &
49
49
  MarketParamsStructOutputStruct;
50
50
 
51
+ export type MarketStruct =
52
+ | [
53
+ number | string | BN,
54
+ number | string | BN,
55
+ number | string | BN,
56
+ number | string | BN,
57
+ number | string | BN,
58
+ number | string | BN
59
+ ]
60
+ | {
61
+ totalSupplyAssets: number | string | BN;
62
+ totalSupplyShares: number | string | BN;
63
+ totalBorrowAssets: number | string | BN;
64
+ totalBorrowShares: number | string | BN;
65
+ lastUpdate: number | string | BN;
66
+ fee: number | string | BN;
67
+ };
68
+
69
+ export type MarketStructOutputArray = [
70
+ string,
71
+ string,
72
+ string,
73
+ string,
74
+ string,
75
+ string
76
+ ];
77
+ export type MarketStructOutputStruct = {
78
+ totalSupplyAssets: string;
79
+ totalSupplyShares: string;
80
+ totalBorrowAssets: string;
81
+ totalBorrowShares: string;
82
+ lastUpdate: string;
83
+ fee: string;
84
+ };
85
+ export type MarketStructOutput = MarketStructOutputArray &
86
+ MarketStructOutputStruct;
87
+
51
88
  export declare namespace MorphoBlueView {
89
+ export type LiquidityChangeParamsStruct =
90
+ | [MarketParamsStruct, boolean, number | string | BN, number | string | BN]
91
+ | {
92
+ marketParams: MarketParamsStruct;
93
+ isBorrowOperation: boolean;
94
+ liquidityAdded: number | string | BN;
95
+ liquidityRemoved: number | string | BN;
96
+ };
97
+
98
+ export type LiquidityChangeParamsStructOutputArray = [
99
+ MarketParamsStructOutput,
100
+ boolean,
101
+ string,
102
+ string
103
+ ];
104
+ export type LiquidityChangeParamsStructOutputStruct = {
105
+ marketParams: MarketParamsStructOutput;
106
+ isBorrowOperation: boolean;
107
+ liquidityAdded: string;
108
+ liquidityRemoved: string;
109
+ };
110
+ export type LiquidityChangeParamsStructOutput =
111
+ LiquidityChangeParamsStructOutputArray &
112
+ LiquidityChangeParamsStructOutputStruct;
113
+
52
114
  export type MarketInfoStruct =
53
115
  | [
54
116
  string | number[],
@@ -142,6 +204,15 @@ export interface MorphoBlueView extends BaseContract {
142
204
  methods: {
143
205
  MORPHO_BLUE_ADDRESS(): NonPayableTransactionObject<string>;
144
206
 
207
+ getApyAfterValuesEstimation(
208
+ params: MorphoBlueView.LiquidityChangeParamsStruct
209
+ ): NonPayableTransactionObject<
210
+ [string, MarketStructOutput] & {
211
+ borrowRate: string;
212
+ market: MarketStructOutput;
213
+ }
214
+ >;
215
+
145
216
  getMarketId(
146
217
  marketParams: MarketParamsStruct
147
218
  ): NonPayableTransactionObject<string>;
@@ -158,6 +229,22 @@ export interface MorphoBlueView extends BaseContract {
158
229
  lltv: number | string | BN
159
230
  ): NonPayableTransactionObject<MorphoBlueView.MarketInfoStructOutput>;
160
231
 
232
+ getRatio(
233
+ marketId: string | number[],
234
+ marketParams: MarketParamsStruct,
235
+ owner: string
236
+ ): NonPayableTransactionObject<string>;
237
+
238
+ getRatioUsingId(
239
+ marketId: string | number[],
240
+ owner: string
241
+ ): NonPayableTransactionObject<string>;
242
+
243
+ getRatioUsingParams(
244
+ marketParams: MarketParamsStruct,
245
+ owner: string
246
+ ): NonPayableTransactionObject<string>;
247
+
161
248
  getUserInfo(
162
249
  marketParams: MarketParamsStruct,
163
250
  owner: string