@defisaver/positions-sdk 1.0.11-fluid-dev9 → 1.0.11-fluid-dev11

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 (78) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +69 -69
  4. package/cjs/config/contracts.js +2 -2
  5. package/cjs/fluid/index.js +33 -8
  6. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  7. package/esm/config/contracts.js +2 -2
  8. package/esm/fluid/index.js +33 -8
  9. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  10. package/package.json +54 -54
  11. package/src/aaveV2/index.ts +227 -227
  12. package/src/aaveV3/index.ts +624 -624
  13. package/src/assets/index.ts +60 -60
  14. package/src/chickenBonds/index.ts +123 -123
  15. package/src/compoundV2/index.ts +220 -220
  16. package/src/compoundV3/index.ts +291 -291
  17. package/src/config/contracts.js +1155 -1155
  18. package/src/constants/index.ts +6 -6
  19. package/src/contracts.ts +135 -135
  20. package/src/curveUsd/index.ts +239 -239
  21. package/src/eulerV2/index.ts +303 -303
  22. package/src/exchange/index.ts +17 -17
  23. package/src/fluid/index.ts +1261 -1224
  24. package/src/helpers/aaveHelpers/index.ts +203 -203
  25. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  26. package/src/helpers/compoundHelpers/index.ts +248 -248
  27. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  28. package/src/helpers/eulerHelpers/index.ts +234 -234
  29. package/src/helpers/fluidHelpers/index.ts +294 -294
  30. package/src/helpers/index.ts +11 -11
  31. package/src/helpers/liquityV2Helpers/index.ts +80 -80
  32. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  33. package/src/helpers/makerHelpers/index.ts +94 -94
  34. package/src/helpers/morphoBlueHelpers/index.ts +367 -367
  35. package/src/helpers/sparkHelpers/index.ts +154 -154
  36. package/src/index.ts +52 -52
  37. package/src/liquity/index.ts +116 -116
  38. package/src/liquityV2/index.ts +295 -295
  39. package/src/llamaLend/index.ts +275 -275
  40. package/src/maker/index.ts +117 -117
  41. package/src/markets/aave/index.ts +152 -152
  42. package/src/markets/aave/marketAssets.ts +46 -46
  43. package/src/markets/compound/index.ts +213 -213
  44. package/src/markets/compound/marketsAssets.ts +82 -82
  45. package/src/markets/curveUsd/index.ts +69 -69
  46. package/src/markets/euler/index.ts +26 -26
  47. package/src/markets/fluid/index.ts +2454 -2454
  48. package/src/markets/index.ts +27 -27
  49. package/src/markets/liquityV2/index.ts +54 -54
  50. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  51. package/src/markets/llamaLend/index.ts +235 -235
  52. package/src/markets/morphoBlue/index.ts +895 -895
  53. package/src/markets/spark/index.ts +29 -29
  54. package/src/markets/spark/marketAssets.ts +10 -10
  55. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  56. package/src/morphoAaveV2/index.ts +256 -256
  57. package/src/morphoAaveV3/index.ts +630 -630
  58. package/src/morphoBlue/index.ts +202 -202
  59. package/src/multicall/index.ts +33 -33
  60. package/src/services/priceService.ts +130 -130
  61. package/src/services/utils.ts +59 -59
  62. package/src/setup.ts +8 -8
  63. package/src/spark/index.ts +460 -460
  64. package/src/staking/staking.ts +217 -217
  65. package/src/types/aave.ts +275 -275
  66. package/src/types/chickenBonds.ts +45 -45
  67. package/src/types/common.ts +84 -84
  68. package/src/types/compound.ts +133 -133
  69. package/src/types/curveUsd.ts +119 -119
  70. package/src/types/euler.ts +173 -173
  71. package/src/types/fluid.ts +325 -325
  72. package/src/types/index.ts +11 -11
  73. package/src/types/liquity.ts +30 -30
  74. package/src/types/liquityV2.ts +119 -119
  75. package/src/types/llamaLend.ts +155 -155
  76. package/src/types/maker.ts +50 -50
  77. package/src/types/morphoBlue.ts +194 -194
  78. package/src/types/spark.ts +135 -135
@@ -1,174 +1,174 @@
1
- import {
2
- MMPositionData, NetworkNumber,
3
- } from './common';
4
-
5
- export enum EulerV2Versions {
6
- eUSDC2 = 'eUSDC-2',
7
- eWETH2 = 'eWETH-2',
8
- }
9
-
10
- export enum EulerV2VaultType {
11
- Escrow = 'Escrow',
12
- Governed = 'Governed',
13
- Ungoverned = 'Ungoverned',
14
- }
15
-
16
- export interface EulerV2Market {
17
- chainIds: NetworkNumber[],
18
- label: string,
19
- shortLabel: string,
20
- asset: string,
21
- value: EulerV2Versions,
22
- secondLabel: string,
23
- marketAddress: string,
24
- // icon: Function,
25
- }
26
-
27
- export interface EulerV2PositionData extends MMPositionData {
28
- ratio: string,
29
- minRatio: string,
30
- borrowedUsd: string,
31
- borrowLimitUsd: string,
32
- incentiveUsd: string,
33
- totalInterestUsd: string,
34
- isSubscribedToAutomation?: boolean,
35
- automationResubscribeRequired?: boolean,
36
- }
37
-
38
- export interface EulerV2AssetData {
39
- vaultAddress: string,
40
- vaultSymbol: string
41
- sortIndex?: number
42
- liquidationRatio: string
43
- cash: string
44
- supplyCap: string
45
- assetAddress: string
46
- decimals: string
47
- symbol: string
48
- price: string
49
- borrowCap: string
50
- canBeBorrowed: boolean
51
- canBeSupplied: boolean
52
- incentiveSupplyApy?: string
53
- incentiveSupplyToken?: string
54
- totalBorrow: string
55
- collateralFactor: string
56
- borrowRate: string
57
- supplyRate: string
58
- utilization: string
59
- governorAdmin: string
60
- vaultType: EulerV2VaultType
61
- }
62
-
63
- export interface EulerV2UsedAsset {
64
- isSupplied: boolean
65
- isBorrowed: boolean
66
- supplied: string
67
- suppliedUsd: string
68
- borrowed: string
69
- borrowedUsd: string
70
- symbol: string
71
- collateral: boolean
72
- vaultAddress: string
73
- }
74
-
75
- export interface EulerV2MarketInfoData {
76
- name: string,
77
- symbol: string,
78
- decimals: string,
79
- vaultAddress: string,
80
- irm: string,
81
- creator: string,
82
- governorAdmin: string,
83
- unitOfAccount: string,
84
- unitOfAccountUsdPrice: string,
85
- isInUSD: boolean,
86
- oracle: string,
87
- collaterals: string[],
88
- isEscrow: boolean,
89
- isGoverned: boolean,
90
- vaultType: EulerV2VaultType,
91
- }
92
-
93
- export type EulerV2AssetsData = { [key: string]: EulerV2AssetData };
94
- export type EulerV2UsedAssets = { [key: string]: EulerV2UsedAsset };
95
-
96
-
97
- export interface EulerV2CollateralInfo {
98
- lltv: string
99
- borrowLtv: string
100
- totalBorrows: string
101
- cash: string
102
- supplyCap: string
103
- }
104
-
105
- export interface EulerV2MarketData {
106
- name: string
107
- symbol: string
108
- decimals: number
109
-
110
- totalSupplyShares: string
111
- cash: string
112
- totalBorrows: string
113
- totalAssets: string
114
- supplyCap: string
115
- borrowCap: string
116
-
117
- collaterals: string[]
118
-
119
- badDebtSocializationEnabled: boolean
120
-
121
- unitOfAccount: string
122
- oracle: string
123
- assetPrice: string
124
-
125
- interestRate: string
126
- irm: string
127
-
128
- creator: string
129
-
130
- governorAdmin: string
131
-
132
- interestFee: string
133
- }
134
-
135
- export interface EulerV2FullMarketData {
136
- marketData: EulerV2MarketInfoData
137
- assetsData: EulerV2AssetsData
138
- }
139
-
140
- export interface EulerV2AccountData {
141
- owner: string
142
- inLockDownMode: boolean
143
- inPermitDisabledMode: boolean
144
-
145
- borrowVault: string
146
- borrowAmountInUnit: string
147
-
148
- collaterals: string[] // all collaterals user has enabled on main evc contract (globally - not only collaterals for his borrow market)
149
- collateralAmountsInUnit: string[] // only amounts used as collateral for his debt (empty array if no debt)
150
- }
151
-
152
- export interface EulerV2AggregatedPositionData {
153
- suppliedUsd: string,
154
- suppliedCollateralUsd: string,
155
- borrowedUsd: string,
156
- borrowLimitUsd: string,
157
- liquidationLimitUsd: string,
158
- leftToBorrowUsd: string,
159
- ratio: string,
160
- collRatio: string,
161
- netApy: string,
162
- incentiveUsd: string,
163
- totalInterestUsd: string,
164
- liqRatio: string,
165
- liqPercent: string,
166
- leveragedType: string,
167
- leveragedAsset?: string,
168
- leveragedLsdAssetRatio?: string,
169
- liquidationPrice?: string,
170
- minRatio: string,
171
- minDebt: string,
172
- minCollRatio: string,
173
- collLiquidationRatio: string,
1
+ import {
2
+ MMPositionData, NetworkNumber,
3
+ } from './common';
4
+
5
+ export enum EulerV2Versions {
6
+ eUSDC2 = 'eUSDC-2',
7
+ eWETH2 = 'eWETH-2',
8
+ }
9
+
10
+ export enum EulerV2VaultType {
11
+ Escrow = 'Escrow',
12
+ Governed = 'Governed',
13
+ Ungoverned = 'Ungoverned',
14
+ }
15
+
16
+ export interface EulerV2Market {
17
+ chainIds: NetworkNumber[],
18
+ label: string,
19
+ shortLabel: string,
20
+ asset: string,
21
+ value: EulerV2Versions,
22
+ secondLabel: string,
23
+ marketAddress: string,
24
+ // icon: Function,
25
+ }
26
+
27
+ export interface EulerV2PositionData extends MMPositionData {
28
+ ratio: string,
29
+ minRatio: string,
30
+ borrowedUsd: string,
31
+ borrowLimitUsd: string,
32
+ incentiveUsd: string,
33
+ totalInterestUsd: string,
34
+ isSubscribedToAutomation?: boolean,
35
+ automationResubscribeRequired?: boolean,
36
+ }
37
+
38
+ export interface EulerV2AssetData {
39
+ vaultAddress: string,
40
+ vaultSymbol: string
41
+ sortIndex?: number
42
+ liquidationRatio: string
43
+ cash: string
44
+ supplyCap: string
45
+ assetAddress: string
46
+ decimals: string
47
+ symbol: string
48
+ price: string
49
+ borrowCap: string
50
+ canBeBorrowed: boolean
51
+ canBeSupplied: boolean
52
+ incentiveSupplyApy?: string
53
+ incentiveSupplyToken?: string
54
+ totalBorrow: string
55
+ collateralFactor: string
56
+ borrowRate: string
57
+ supplyRate: string
58
+ utilization: string
59
+ governorAdmin: string
60
+ vaultType: EulerV2VaultType
61
+ }
62
+
63
+ export interface EulerV2UsedAsset {
64
+ isSupplied: boolean
65
+ isBorrowed: boolean
66
+ supplied: string
67
+ suppliedUsd: string
68
+ borrowed: string
69
+ borrowedUsd: string
70
+ symbol: string
71
+ collateral: boolean
72
+ vaultAddress: string
73
+ }
74
+
75
+ export interface EulerV2MarketInfoData {
76
+ name: string,
77
+ symbol: string,
78
+ decimals: string,
79
+ vaultAddress: string,
80
+ irm: string,
81
+ creator: string,
82
+ governorAdmin: string,
83
+ unitOfAccount: string,
84
+ unitOfAccountUsdPrice: string,
85
+ isInUSD: boolean,
86
+ oracle: string,
87
+ collaterals: string[],
88
+ isEscrow: boolean,
89
+ isGoverned: boolean,
90
+ vaultType: EulerV2VaultType,
91
+ }
92
+
93
+ export type EulerV2AssetsData = { [key: string]: EulerV2AssetData };
94
+ export type EulerV2UsedAssets = { [key: string]: EulerV2UsedAsset };
95
+
96
+
97
+ export interface EulerV2CollateralInfo {
98
+ lltv: string
99
+ borrowLtv: string
100
+ totalBorrows: string
101
+ cash: string
102
+ supplyCap: string
103
+ }
104
+
105
+ export interface EulerV2MarketData {
106
+ name: string
107
+ symbol: string
108
+ decimals: number
109
+
110
+ totalSupplyShares: string
111
+ cash: string
112
+ totalBorrows: string
113
+ totalAssets: string
114
+ supplyCap: string
115
+ borrowCap: string
116
+
117
+ collaterals: string[]
118
+
119
+ badDebtSocializationEnabled: boolean
120
+
121
+ unitOfAccount: string
122
+ oracle: string
123
+ assetPrice: string
124
+
125
+ interestRate: string
126
+ irm: string
127
+
128
+ creator: string
129
+
130
+ governorAdmin: string
131
+
132
+ interestFee: string
133
+ }
134
+
135
+ export interface EulerV2FullMarketData {
136
+ marketData: EulerV2MarketInfoData
137
+ assetsData: EulerV2AssetsData
138
+ }
139
+
140
+ export interface EulerV2AccountData {
141
+ owner: string
142
+ inLockDownMode: boolean
143
+ inPermitDisabledMode: boolean
144
+
145
+ borrowVault: string
146
+ borrowAmountInUnit: string
147
+
148
+ collaterals: string[] // all collaterals user has enabled on main evc contract (globally - not only collaterals for his borrow market)
149
+ collateralAmountsInUnit: string[] // only amounts used as collateral for his debt (empty array if no debt)
150
+ }
151
+
152
+ export interface EulerV2AggregatedPositionData {
153
+ suppliedUsd: string,
154
+ suppliedCollateralUsd: string,
155
+ borrowedUsd: string,
156
+ borrowLimitUsd: string,
157
+ liquidationLimitUsd: string,
158
+ leftToBorrowUsd: string,
159
+ ratio: string,
160
+ collRatio: string,
161
+ netApy: string,
162
+ incentiveUsd: string,
163
+ totalInterestUsd: string,
164
+ liqRatio: string,
165
+ liqPercent: string,
166
+ leveragedType: string,
167
+ leveragedAsset?: string,
168
+ leveragedLsdAssetRatio?: string,
169
+ liquidationPrice?: string,
170
+ minRatio: string,
171
+ minDebt: string,
172
+ minCollRatio: string,
173
+ collLiquidationRatio: string,
174
174
  }