@defisaver/positions-sdk 2.1.55 → 2.1.56-dev-exposure

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 (184) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +64 -64
  4. package/cjs/aaveV3/index.d.ts +1 -0
  5. package/cjs/aaveV3/index.js +1 -0
  6. package/cjs/compoundV2/index.d.ts +1 -0
  7. package/cjs/compoundV2/index.js +1 -0
  8. package/cjs/compoundV3/index.d.ts +1 -0
  9. package/cjs/compoundV3/index.js +1 -0
  10. package/cjs/eulerV2/index.d.ts +1 -0
  11. package/cjs/eulerV2/index.js +1 -0
  12. package/cjs/fluid/index.d.ts +3 -0
  13. package/cjs/helpers/aaveHelpers/index.js +1 -0
  14. package/cjs/helpers/compoundHelpers/index.js +2 -0
  15. package/cjs/helpers/curveUsdHelpers/index.js +1 -0
  16. package/cjs/helpers/eulerHelpers/index.js +1 -0
  17. package/cjs/helpers/fluidHelpers/index.js +1 -0
  18. package/cjs/helpers/liquityV2Helpers/index.js +1 -0
  19. package/cjs/helpers/llamaLendHelpers/index.js +1 -0
  20. package/cjs/helpers/morphoBlueHelpers/index.js +67 -66
  21. package/cjs/helpers/sparkHelpers/index.js +1 -0
  22. package/cjs/liquity/index.js +2 -0
  23. package/cjs/maker/index.js +2 -0
  24. package/cjs/markets/morphoBlue/index.d.ts +4 -0
  25. package/cjs/markets/morphoBlue/index.js +36 -2
  26. package/cjs/moneymarket/moneymarketCommonService.d.ts +1 -0
  27. package/cjs/moneymarket/moneymarketCommonService.js +8 -1
  28. package/cjs/savings/morphoVaults/index.js +17 -17
  29. package/cjs/spark/index.d.ts +1 -0
  30. package/cjs/spark/index.js +1 -0
  31. package/cjs/types/aave.d.ts +1 -0
  32. package/cjs/types/common.d.ts +1 -0
  33. package/cjs/types/compound.d.ts +1 -0
  34. package/cjs/types/curveUsd.d.ts +2 -0
  35. package/cjs/types/euler.d.ts +1 -0
  36. package/cjs/types/fluid.d.ts +1 -0
  37. package/cjs/types/liquity.d.ts +1 -0
  38. package/cjs/types/liquityV2.d.ts +2 -0
  39. package/cjs/types/llamaLend.d.ts +2 -0
  40. package/cjs/types/maker.d.ts +1 -0
  41. package/cjs/types/morphoBlue.d.ts +4 -0
  42. package/cjs/types/morphoBlue.js +2 -0
  43. package/cjs/types/spark.d.ts +1 -0
  44. package/esm/aaveV3/index.d.ts +1 -0
  45. package/esm/aaveV3/index.js +1 -0
  46. package/esm/compoundV2/index.d.ts +1 -0
  47. package/esm/compoundV2/index.js +1 -0
  48. package/esm/compoundV3/index.d.ts +1 -0
  49. package/esm/compoundV3/index.js +1 -0
  50. package/esm/eulerV2/index.d.ts +1 -0
  51. package/esm/eulerV2/index.js +1 -0
  52. package/esm/fluid/index.d.ts +3 -0
  53. package/esm/helpers/aaveHelpers/index.js +2 -1
  54. package/esm/helpers/compoundHelpers/index.js +3 -1
  55. package/esm/helpers/curveUsdHelpers/index.js +2 -1
  56. package/esm/helpers/eulerHelpers/index.js +2 -1
  57. package/esm/helpers/fluidHelpers/index.js +2 -1
  58. package/esm/helpers/liquityV2Helpers/index.js +2 -1
  59. package/esm/helpers/llamaLendHelpers/index.js +2 -1
  60. package/esm/helpers/morphoBlueHelpers/index.js +68 -67
  61. package/esm/helpers/sparkHelpers/index.js +2 -1
  62. package/esm/liquity/index.js +2 -0
  63. package/esm/maker/index.js +2 -0
  64. package/esm/markets/morphoBlue/index.d.ts +4 -0
  65. package/esm/markets/morphoBlue/index.js +32 -0
  66. package/esm/moneymarket/moneymarketCommonService.d.ts +1 -0
  67. package/esm/moneymarket/moneymarketCommonService.js +6 -0
  68. package/esm/savings/morphoVaults/index.js +17 -17
  69. package/esm/spark/index.d.ts +1 -0
  70. package/esm/spark/index.js +1 -0
  71. package/esm/types/aave.d.ts +1 -0
  72. package/esm/types/common.d.ts +1 -0
  73. package/esm/types/compound.d.ts +1 -0
  74. package/esm/types/curveUsd.d.ts +2 -0
  75. package/esm/types/euler.d.ts +1 -0
  76. package/esm/types/fluid.d.ts +1 -0
  77. package/esm/types/liquity.d.ts +1 -0
  78. package/esm/types/liquityV2.d.ts +2 -0
  79. package/esm/types/llamaLend.d.ts +2 -0
  80. package/esm/types/maker.d.ts +1 -0
  81. package/esm/types/morphoBlue.d.ts +4 -0
  82. package/esm/types/morphoBlue.js +2 -0
  83. package/esm/types/spark.d.ts +1 -0
  84. package/package.json +48 -48
  85. package/src/aaveV2/index.ts +240 -240
  86. package/src/aaveV3/index.ts +638 -637
  87. package/src/aaveV3/merit.ts +97 -97
  88. package/src/aaveV3/merkl.ts +74 -74
  89. package/src/claiming/aaveV3.ts +154 -154
  90. package/src/claiming/compV3.ts +22 -22
  91. package/src/claiming/ethena.ts +61 -61
  92. package/src/claiming/index.ts +12 -12
  93. package/src/claiming/king.ts +66 -66
  94. package/src/claiming/morphoBlue.ts +118 -118
  95. package/src/claiming/spark.ts +225 -225
  96. package/src/compoundV2/index.ts +245 -244
  97. package/src/compoundV3/index.ts +275 -274
  98. package/src/config/contracts.ts +1320 -1320
  99. package/src/constants/index.ts +10 -10
  100. package/src/contracts.ts +171 -171
  101. package/src/curveUsd/index.ts +254 -254
  102. package/src/eulerV2/index.ts +325 -324
  103. package/src/exchange/index.ts +25 -25
  104. package/src/fluid/index.ts +1800 -1800
  105. package/src/helpers/aaveHelpers/index.ts +203 -202
  106. package/src/helpers/compoundHelpers/index.ts +278 -276
  107. package/src/helpers/curveUsdHelpers/index.ts +44 -40
  108. package/src/helpers/eulerHelpers/index.ts +230 -229
  109. package/src/helpers/fluidHelpers/index.ts +338 -335
  110. package/src/helpers/index.ts +10 -10
  111. package/src/helpers/liquityV2Helpers/index.ts +85 -82
  112. package/src/helpers/llamaLendHelpers/index.ts +56 -53
  113. package/src/helpers/makerHelpers/index.ts +52 -52
  114. package/src/helpers/morphoBlueHelpers/index.ts +406 -405
  115. package/src/helpers/sparkHelpers/index.ts +170 -169
  116. package/src/index.ts +49 -49
  117. package/src/liquity/index.ts +161 -159
  118. package/src/liquityV2/index.ts +703 -703
  119. package/src/llamaLend/index.ts +305 -305
  120. package/src/maker/index.ts +225 -223
  121. package/src/markets/aave/index.ts +118 -118
  122. package/src/markets/aave/marketAssets.ts +54 -54
  123. package/src/markets/compound/index.ts +243 -243
  124. package/src/markets/compound/marketsAssets.ts +97 -97
  125. package/src/markets/curveUsd/index.ts +69 -69
  126. package/src/markets/euler/index.ts +26 -26
  127. package/src/markets/fluid/index.ts +2900 -2900
  128. package/src/markets/index.ts +25 -25
  129. package/src/markets/liquityV2/index.ts +102 -102
  130. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  131. package/src/markets/llamaLend/index.ts +235 -235
  132. package/src/markets/morphoBlue/index.ts +1020 -988
  133. package/src/markets/spark/index.ts +29 -29
  134. package/src/markets/spark/marketAssets.ts +12 -12
  135. package/src/moneymarket/moneymarketCommonService.ts +90 -84
  136. package/src/morphoBlue/index.ts +274 -274
  137. package/src/portfolio/index.ts +586 -586
  138. package/src/savings/index.ts +95 -95
  139. package/src/savings/makerDsr/index.ts +53 -53
  140. package/src/savings/makerDsr/options.ts +9 -9
  141. package/src/savings/morphoVaults/index.ts +80 -80
  142. package/src/savings/morphoVaults/options.ts +193 -193
  143. package/src/savings/skyOptions/index.ts +95 -95
  144. package/src/savings/skyOptions/options.ts +10 -10
  145. package/src/savings/sparkSavingsVaults/index.ts +60 -60
  146. package/src/savings/sparkSavingsVaults/options.ts +35 -35
  147. package/src/savings/yearnV3Vaults/index.ts +61 -61
  148. package/src/savings/yearnV3Vaults/options.ts +55 -55
  149. package/src/savings/yearnVaults/index.ts +73 -73
  150. package/src/savings/yearnVaults/options.ts +32 -32
  151. package/src/services/priceService.ts +278 -278
  152. package/src/services/utils.ts +115 -115
  153. package/src/services/viem.ts +57 -57
  154. package/src/setup.ts +8 -8
  155. package/src/spark/index.ts +460 -459
  156. package/src/staking/eligibility.ts +53 -53
  157. package/src/staking/index.ts +1 -1
  158. package/src/staking/staking.ts +192 -192
  159. package/src/types/aave.ts +200 -199
  160. package/src/types/claiming.ts +114 -114
  161. package/src/types/common.ts +116 -115
  162. package/src/types/compound.ts +146 -145
  163. package/src/types/curveUsd.ts +125 -123
  164. package/src/types/euler.ts +177 -176
  165. package/src/types/fluid.ts +486 -485
  166. package/src/types/index.ts +15 -15
  167. package/src/types/liquity.ts +31 -30
  168. package/src/types/liquityV2.ts +130 -128
  169. package/src/types/llamaLend.ts +163 -161
  170. package/src/types/maker.ts +64 -63
  171. package/src/types/merit.ts +1 -1
  172. package/src/types/merkl.ts +70 -70
  173. package/src/types/morphoBlue.ts +206 -202
  174. package/src/types/portfolio.ts +60 -60
  175. package/src/types/savings/index.ts +23 -23
  176. package/src/types/savings/makerDsr.ts +13 -13
  177. package/src/types/savings/morphoVaults.ts +32 -32
  178. package/src/types/savings/sky.ts +14 -14
  179. package/src/types/savings/sparkSavingsVaults.ts +15 -15
  180. package/src/types/savings/yearnV3Vaults.ts +17 -17
  181. package/src/types/savings/yearnVaults.ts +14 -14
  182. package/src/types/spark.ts +136 -135
  183. package/src/umbrella/index.ts +69 -69
  184. package/src/umbrella/umbrellaUtils.ts +29 -29
@@ -1,16 +1,16 @@
1
- export * from './aave';
2
- export * from './compound';
3
- export * from './spark';
4
- export * from './curveUsd';
5
- export * from './liquity';
6
- export * from './liquityV2';
7
- export * from './maker';
8
- export * from './morphoBlue';
9
- export * from './llamaLend';
10
- export * from './euler';
11
- export * from './fluid';
12
- export * from './portfolio';
13
- export * from './merit';
14
- export * from './merkl';
15
- export * from './savings';
1
+ export * from './aave';
2
+ export * from './compound';
3
+ export * from './spark';
4
+ export * from './curveUsd';
5
+ export * from './liquity';
6
+ export * from './liquityV2';
7
+ export * from './maker';
8
+ export * from './morphoBlue';
9
+ export * from './llamaLend';
10
+ export * from './euler';
11
+ export * from './fluid';
12
+ export * from './portfolio';
13
+ export * from './merit';
14
+ export * from './merkl';
15
+ export * from './savings';
16
16
  export * from './common';
@@ -1,31 +1,32 @@
1
- export enum LIQUITY_TROVE_STATUS_ENUM {
2
- nonExistent,
3
- active,
4
- closedByOwner,
5
- closedByLiquidation,
6
- closedByRedemption,
7
- }
8
-
9
- export const LIQUITY_STATUS_MAPPING = {
10
- nonExistent: 'Non existent',
11
- active: 'Active',
12
- closedByOwner: 'Closed',
13
- closedByLiquidation: 'Liquidated',
14
- closedByRedemption: 'Redeemed',
15
- };
16
-
17
- export interface LiquityTroveInfo {
18
- troveStatus: string,
19
- collateral: string,
20
- debtInAsset: string,
21
- TCRatio: string,
22
- recoveryMode: boolean,
23
- claimableCollateral: string,
24
- borrowingRateWithDecay: string,
25
- assetPrice: string,
26
- totalETH: string,
27
- totalLUSD: string,
28
- minCollateralRatio: number,
29
- priceForRecovery: string,
30
- debtInFront: string,
1
+ export enum LIQUITY_TROVE_STATUS_ENUM {
2
+ nonExistent,
3
+ active,
4
+ closedByOwner,
5
+ closedByLiquidation,
6
+ closedByRedemption,
7
+ }
8
+
9
+ export const LIQUITY_STATUS_MAPPING = {
10
+ nonExistent: 'Non existent',
11
+ active: 'Active',
12
+ closedByOwner: 'Closed',
13
+ closedByLiquidation: 'Liquidated',
14
+ closedByRedemption: 'Redeemed',
15
+ };
16
+
17
+ export interface LiquityTroveInfo {
18
+ troveStatus: string,
19
+ collateral: string,
20
+ debtInAsset: string,
21
+ TCRatio: string,
22
+ recoveryMode: boolean,
23
+ claimableCollateral: string,
24
+ borrowingRateWithDecay: string,
25
+ assetPrice: string,
26
+ totalETH: string,
27
+ totalLUSD: string,
28
+ minCollateralRatio: number,
29
+ priceForRecovery: string,
30
+ debtInFront: string,
31
+ exposure: string,
31
32
  }
@@ -1,129 +1,131 @@
1
- import {
2
- EthAddress, IncentiveData, LeverageType, NetworkNumber,
3
- } from './common';
4
-
5
- export enum LiquityV2Versions {
6
- LiquityV2Eth = 'liquityv2eth',
7
- LiquityV2WstEth = 'liquityv2wsteth',
8
- LiquityV2REth = 'liquityv2reth',
9
- // Legacy
10
- LiquityV2EthLegacy = 'liquityv2ethlegacy',
11
- LiquityV2WstEthLegacy = 'liquityv2wstethlegacy',
12
- LiquityV2REthLegacy = 'liquityv2rethlegacy',
13
- }
14
-
15
- export enum LIQUITY_V2_TROVE_STATUS_ENUM {
16
- nonExistent,
17
- active,
18
- closedByOwner,
19
- closedByLiquidation,
20
- zombie,
21
- }
22
-
23
- export const LIQUITY_V2_STATUS_MAPPING = {
24
- nonExistent: 'Non existent',
25
- active: 'Active',
26
- closedByOwner: 'Closed',
27
- closedByLiquidation: 'Liquidated',
28
- zombie: 'Zombie',
29
- };
30
-
31
- export interface LiquityV2MarketInfo {
32
- chainIds: NetworkNumber[],
33
- label: string,
34
- shortLabel: string,
35
- url: string,
36
- value: LiquityV2Versions,
37
- debtToken: string,
38
- collateralToken: string,
39
- marketAddress: EthAddress,
40
- protocolName: string,
41
- isLegacy: boolean,
42
- }
43
-
44
- export interface LiquityV2AssetData {
45
- symbol: string,
46
- address: string,
47
- price: string,
48
- totalSupply: string,
49
- totalBorrow: string,
50
- canBeSupplied: boolean,
51
- canBeBorrowed: boolean,
52
- leftToBorrowGlobal: string,
53
- leftToWithdrawGlobal: string,
54
- supplyIncentives: IncentiveData[],
55
- borrowIncentives: IncentiveData[],
56
- }
57
-
58
- export type LiquityV2AssetsData = { [key: string]: LiquityV2AssetData };
59
-
60
- export interface InnerLiquityV2MarketData {
61
- minCollRatio: string,
62
- totalCollRatio: string,
63
- criticalCollRatio: string,
64
- batchCollRatio: string,
65
- isUnderCollateralized: boolean,
66
- hintHelperAddress: EthAddress,
67
- troveNFTAddress: EthAddress,
68
- borrowerOperationsAddress: EthAddress,
69
- troveManagerAddress: EthAddress,
70
- stabilityPoolAddress: EthAddress,
71
- collSurplusPoolAddress: EthAddress,
72
- activePoolAddress: EthAddress,
73
- }
74
-
75
- export interface LiquityV2MarketData {
76
- assetsData: LiquityV2AssetsData,
77
- marketData: InnerLiquityV2MarketData,
78
- }
79
-
80
- export interface LiquityV2UsedAsset {
81
- symbol: string,
82
- collateral?: boolean,
83
- supplied: string,
84
- suppliedUsd: string,
85
- borrowed: string,
86
- borrowedUsd: string,
87
- isSupplied: boolean,
88
- isBorrowed: boolean,
89
- }
90
-
91
- export type LiquityV2UsedAssets = { [key: string]: LiquityV2UsedAsset };
92
-
93
- export interface LiquityV2AggregatedTroveData {
94
- suppliedUsd: string,
95
- borrowedUsd: string,
96
- borrowLimitUsd: string,
97
- leftToBorrowUsd: string,
98
- netApy: string,
99
- incentiveUsd: string,
100
- totalInterestUsd: string,
101
- leveragedType: LeverageType,
102
- leveragedAsset: string,
103
- liquidationPrice: string,
104
- ratio: string,
105
- collRatio: string,
106
- }
107
-
108
- export interface LiquityV2TroveData {
109
- usedAssets: LiquityV2UsedAssets,
110
- troveId: string,
111
- ratio: string,
112
- collRatio: string,
113
- liqRatio: string,
114
- interestRate: string,
115
- leftToBorrowUsd: string,
116
- borrowLimitUsd: string,
117
- suppliedUsd: string,
118
- borrowedUsd: string,
119
- netApy: string,
120
- incentiveUsd: string,
121
- totalInterestUsd: string,
122
- interestBatchManager: EthAddress,
123
- troveStatus: string,
124
- leveragedType: LeverageType,
125
- leveragedAsset: string,
126
- liquidationPrice: string,
127
- debtInFront: string,
128
- lastInterestRateAdjTime: string,
1
+ import {
2
+ EthAddress, IncentiveData, LeverageType, NetworkNumber,
3
+ } from './common';
4
+
5
+ export enum LiquityV2Versions {
6
+ LiquityV2Eth = 'liquityv2eth',
7
+ LiquityV2WstEth = 'liquityv2wsteth',
8
+ LiquityV2REth = 'liquityv2reth',
9
+ // Legacy
10
+ LiquityV2EthLegacy = 'liquityv2ethlegacy',
11
+ LiquityV2WstEthLegacy = 'liquityv2wstethlegacy',
12
+ LiquityV2REthLegacy = 'liquityv2rethlegacy',
13
+ }
14
+
15
+ export enum LIQUITY_V2_TROVE_STATUS_ENUM {
16
+ nonExistent,
17
+ active,
18
+ closedByOwner,
19
+ closedByLiquidation,
20
+ zombie,
21
+ }
22
+
23
+ export const LIQUITY_V2_STATUS_MAPPING = {
24
+ nonExistent: 'Non existent',
25
+ active: 'Active',
26
+ closedByOwner: 'Closed',
27
+ closedByLiquidation: 'Liquidated',
28
+ zombie: 'Zombie',
29
+ };
30
+
31
+ export interface LiquityV2MarketInfo {
32
+ chainIds: NetworkNumber[],
33
+ label: string,
34
+ shortLabel: string,
35
+ url: string,
36
+ value: LiquityV2Versions,
37
+ debtToken: string,
38
+ collateralToken: string,
39
+ marketAddress: EthAddress,
40
+ protocolName: string,
41
+ isLegacy: boolean,
42
+ }
43
+
44
+ export interface LiquityV2AssetData {
45
+ symbol: string,
46
+ address: string,
47
+ price: string,
48
+ totalSupply: string,
49
+ totalBorrow: string,
50
+ canBeSupplied: boolean,
51
+ canBeBorrowed: boolean,
52
+ leftToBorrowGlobal: string,
53
+ leftToWithdrawGlobal: string,
54
+ supplyIncentives: IncentiveData[],
55
+ borrowIncentives: IncentiveData[],
56
+ }
57
+
58
+ export type LiquityV2AssetsData = { [key: string]: LiquityV2AssetData };
59
+
60
+ export interface InnerLiquityV2MarketData {
61
+ minCollRatio: string,
62
+ totalCollRatio: string,
63
+ criticalCollRatio: string,
64
+ batchCollRatio: string,
65
+ isUnderCollateralized: boolean,
66
+ hintHelperAddress: EthAddress,
67
+ troveNFTAddress: EthAddress,
68
+ borrowerOperationsAddress: EthAddress,
69
+ troveManagerAddress: EthAddress,
70
+ stabilityPoolAddress: EthAddress,
71
+ collSurplusPoolAddress: EthAddress,
72
+ activePoolAddress: EthAddress,
73
+ }
74
+
75
+ export interface LiquityV2MarketData {
76
+ assetsData: LiquityV2AssetsData,
77
+ marketData: InnerLiquityV2MarketData,
78
+ }
79
+
80
+ export interface LiquityV2UsedAsset {
81
+ symbol: string,
82
+ collateral?: boolean,
83
+ supplied: string,
84
+ suppliedUsd: string,
85
+ borrowed: string,
86
+ borrowedUsd: string,
87
+ isSupplied: boolean,
88
+ isBorrowed: boolean,
89
+ }
90
+
91
+ export type LiquityV2UsedAssets = { [key: string]: LiquityV2UsedAsset };
92
+
93
+ export interface LiquityV2AggregatedTroveData {
94
+ suppliedUsd: string,
95
+ borrowedUsd: string,
96
+ borrowLimitUsd: string,
97
+ leftToBorrowUsd: string,
98
+ netApy: string,
99
+ incentiveUsd: string,
100
+ totalInterestUsd: string,
101
+ leveragedType: LeverageType,
102
+ leveragedAsset: string,
103
+ liquidationPrice: string,
104
+ ratio: string,
105
+ collRatio: string,
106
+ exposure: string,
107
+ }
108
+
109
+ export interface LiquityV2TroveData {
110
+ usedAssets: LiquityV2UsedAssets,
111
+ troveId: string,
112
+ ratio: string,
113
+ collRatio: string,
114
+ liqRatio: string,
115
+ interestRate: string,
116
+ leftToBorrowUsd: string,
117
+ borrowLimitUsd: string,
118
+ suppliedUsd: string,
119
+ borrowedUsd: string,
120
+ netApy: string,
121
+ incentiveUsd: string,
122
+ totalInterestUsd: string,
123
+ interestBatchManager: EthAddress,
124
+ troveStatus: string,
125
+ leveragedType: LeverageType,
126
+ leveragedAsset: string,
127
+ liquidationPrice: string,
128
+ debtInFront: string,
129
+ lastInterestRateAdjTime: string,
130
+ exposure: string,
129
131
  }
@@ -1,161 +1,163 @@
1
- import {
2
- EthAddress, IncentiveData, LeverageType, NetworkNumber,
3
- } from './common';
4
- import { BandData, UserBandData } from './curveUsd';
5
-
6
- export enum LLVersionsEth {
7
- // long only
8
- LLWstethCrvusd = 'llamaLendwstETHcrvUSD',
9
- LLWstethCrvusd2 = 'llamaLendwstETHcrvUSD2',
10
- LLSusdeCrvusd = 'llamaLendsUSDecrvUSD',
11
- LLSusdeCrvusd2 = 'llamaLendsUSDecrvUSD2',
12
- LLWbtcCrvusd = 'llamaLendWBTCcrvUSD',
13
- // LLPufethCrvusd = 'llamaLendPufETHcrvUSD', // temp disabled
14
- LLUsdeCrvusd = 'llamaLendUSDecrvUSD',
15
- LLWethCrvusd2 = 'llamaLendWETHcrvUSD2',
16
- // long and short crv
17
- LLCrvCrvusd = 'llamaLendCRVcrvUSD',
18
- LLCrvusdCrv = 'llamaLendcrvUSDCRV',
19
- // long and short tbtc
20
- LLTbtcCrvusd = 'llamaLendTBTCcrvUSD',
21
- LLCrvusdTbtc = 'llamaLendcrvUSDTBTC',
22
- // long and short weth
23
- LLWethCrvusd = 'llamaLendWETHcrvUSD',
24
- LLCrvusdWeth = 'llamaLendcrvUSDWETH',
25
- }
26
-
27
- export enum LLVersionsArb {
28
- // long only
29
- LLArbCrvusd = 'llamaLendArbcrvUSD',
30
- LLArbCrvusd2 = 'llamaLendArbcrvUSD2',
31
- LLFxnCrvusd = 'llamaLendFXNcrvUSD',
32
- LLWbtcCrvusd = 'llamaLendWBTCcrvUSD',
33
- LLWbtcCrvusd2 = 'llamaLendWBTCcrvUSD2',
34
- LLCrvCrvusd = 'llamaLendCRVcrvUSD',
35
- LLWethCrvusd = 'llamaLendWETHcrvUSD',
36
- LLWethCrvusd2 = 'llamaLendWETHcrvUSD2',
37
- }
38
-
39
- export const LlamaLendVersions = {
40
- ...LLVersionsEth,
41
- ...LLVersionsArb,
42
- } as const;
43
-
44
- export type LlamaLendVersionsType = typeof LlamaLendVersions[keyof typeof LlamaLendVersions];
45
-
46
- export enum LlamaLendStatus {
47
- Nonexistant = 'Nonexistant',
48
- Safe = 'Safe',
49
- Risk = 'Risk',
50
- SoftLiquidating = 'SoftLiquidating',
51
- SoftLiquidated = 'SoftLiquidated',
52
- }
53
-
54
- export interface LlamaLendMarketData {
55
- chainIds: NetworkNumber[],
56
- label: string,
57
- shortLabel: string,
58
- value: LlamaLendVersionsType,
59
- collAsset: string,
60
- baseAsset: string,
61
- controllerAddress: EthAddress,
62
- vaultAddress: EthAddress,
63
- url: string,
64
- }
65
- export interface LlamaLendAssetData {
66
- symbol: string,
67
- address: string,
68
- price: string,
69
- supplyRate: string,
70
- borrowRate: string,
71
- totalSupply?: string,
72
- totalBorrow?: string,
73
- canBeSupplied?: boolean,
74
- canBeBorrowed?: boolean,
75
- shares?: string,
76
- supplyIncentives: IncentiveData[],
77
- borrowIncentives: IncentiveData[],
78
- }
79
-
80
- export type LlamaLendAssetsData = { [key: string]: LlamaLendAssetData };
81
-
82
- export interface LlamaLendGlobalMarketData {
83
- A:string,
84
- loanDiscount: string,
85
- activeBand: string,
86
- totalDebt: string,
87
- totalDebtSupplied:string,
88
- utilization:string,
89
- ammPrice: string,
90
- basePrice: string,
91
- oraclePrice: string,
92
- minted: string,
93
- redeemed: string,
94
- monetaryPolicyRate: string,
95
- ammRate: string,
96
- minBand: string,
97
- maxBand: string,
98
- borrowRate: string,
99
- lendRate: string,
100
- futureBorrowRate: string,
101
- leftToBorrow: string,
102
- bands: BandData[],
103
- assetsData: LlamaLendAssetsData,
104
- }
105
-
106
- export interface LlamaLendAggregatedPositionData {
107
- ratio: string,
108
- suppliedUsd: string,
109
- borrowedUsd: string,
110
- suppliedForYieldUsd: string,
111
- safetyRatio: string,
112
- borrowLimitUsd: string,
113
- minAllowedRatio: number,
114
- collFactor: string,
115
- leveragedType: LeverageType,
116
- leveragedAsset?: string,
117
- liquidationPrice?: string,
118
- netApy: string,
119
- incentiveUsd: string,
120
- totalInterestUsd: string,
121
- }
122
-
123
- export interface LlamaLendUsedAsset {
124
- isSupplied: boolean,
125
- supplied: string,
126
- suppliedUsd: string,
127
- borrowed: string,
128
- borrowedUsd: string,
129
- isBorrowed: boolean,
130
- symbol: string,
131
- collateral: boolean,
132
- price: string,
133
- interestRate?: string,
134
- suppliedForYield?: string,
135
- suppliedForYieldUsd?: string,
136
- shares?: string,
137
- }
138
-
139
- export interface LlamaLendUsedAssets {
140
- [key: string]: LlamaLendUsedAsset,
141
- }
142
-
143
- export interface LlamaLendUserData {
144
- debtAmount: string,
145
- health: string,
146
- healthPercent: string,
147
- priceHigh: string,
148
- priceLow: string,
149
- liquidationDiscount: string,
150
- numOfBands: string,
151
- usedAssets: LlamaLendUsedAssets,
152
- status: LlamaLendStatus,
153
- ratio: string,
154
- suppliedUsd: string,
155
- borrowedUsd: string,
156
- suppliedForYieldUsd: string,
157
- safetyRatio: string,
158
- userBands: UserBandData[],
159
- loanExists: boolean,
160
- borrowRate?: string,
161
- }
1
+ import {
2
+ EthAddress, IncentiveData, LeverageType, NetworkNumber,
3
+ } from './common';
4
+ import { BandData, UserBandData } from './curveUsd';
5
+
6
+ export enum LLVersionsEth {
7
+ // long only
8
+ LLWstethCrvusd = 'llamaLendwstETHcrvUSD',
9
+ LLWstethCrvusd2 = 'llamaLendwstETHcrvUSD2',
10
+ LLSusdeCrvusd = 'llamaLendsUSDecrvUSD',
11
+ LLSusdeCrvusd2 = 'llamaLendsUSDecrvUSD2',
12
+ LLWbtcCrvusd = 'llamaLendWBTCcrvUSD',
13
+ // LLPufethCrvusd = 'llamaLendPufETHcrvUSD', // temp disabled
14
+ LLUsdeCrvusd = 'llamaLendUSDecrvUSD',
15
+ LLWethCrvusd2 = 'llamaLendWETHcrvUSD2',
16
+ // long and short crv
17
+ LLCrvCrvusd = 'llamaLendCRVcrvUSD',
18
+ LLCrvusdCrv = 'llamaLendcrvUSDCRV',
19
+ // long and short tbtc
20
+ LLTbtcCrvusd = 'llamaLendTBTCcrvUSD',
21
+ LLCrvusdTbtc = 'llamaLendcrvUSDTBTC',
22
+ // long and short weth
23
+ LLWethCrvusd = 'llamaLendWETHcrvUSD',
24
+ LLCrvusdWeth = 'llamaLendcrvUSDWETH',
25
+ }
26
+
27
+ export enum LLVersionsArb {
28
+ // long only
29
+ LLArbCrvusd = 'llamaLendArbcrvUSD',
30
+ LLArbCrvusd2 = 'llamaLendArbcrvUSD2',
31
+ LLFxnCrvusd = 'llamaLendFXNcrvUSD',
32
+ LLWbtcCrvusd = 'llamaLendWBTCcrvUSD',
33
+ LLWbtcCrvusd2 = 'llamaLendWBTCcrvUSD2',
34
+ LLCrvCrvusd = 'llamaLendCRVcrvUSD',
35
+ LLWethCrvusd = 'llamaLendWETHcrvUSD',
36
+ LLWethCrvusd2 = 'llamaLendWETHcrvUSD2',
37
+ }
38
+
39
+ export const LlamaLendVersions = {
40
+ ...LLVersionsEth,
41
+ ...LLVersionsArb,
42
+ } as const;
43
+
44
+ export type LlamaLendVersionsType = typeof LlamaLendVersions[keyof typeof LlamaLendVersions];
45
+
46
+ export enum LlamaLendStatus {
47
+ Nonexistant = 'Nonexistant',
48
+ Safe = 'Safe',
49
+ Risk = 'Risk',
50
+ SoftLiquidating = 'SoftLiquidating',
51
+ SoftLiquidated = 'SoftLiquidated',
52
+ }
53
+
54
+ export interface LlamaLendMarketData {
55
+ chainIds: NetworkNumber[],
56
+ label: string,
57
+ shortLabel: string,
58
+ value: LlamaLendVersionsType,
59
+ collAsset: string,
60
+ baseAsset: string,
61
+ controllerAddress: EthAddress,
62
+ vaultAddress: EthAddress,
63
+ url: string,
64
+ }
65
+ export interface LlamaLendAssetData {
66
+ symbol: string,
67
+ address: string,
68
+ price: string,
69
+ supplyRate: string,
70
+ borrowRate: string,
71
+ totalSupply?: string,
72
+ totalBorrow?: string,
73
+ canBeSupplied?: boolean,
74
+ canBeBorrowed?: boolean,
75
+ shares?: string,
76
+ supplyIncentives: IncentiveData[],
77
+ borrowIncentives: IncentiveData[],
78
+ }
79
+
80
+ export type LlamaLendAssetsData = { [key: string]: LlamaLendAssetData };
81
+
82
+ export interface LlamaLendGlobalMarketData {
83
+ A:string,
84
+ loanDiscount: string,
85
+ activeBand: string,
86
+ totalDebt: string,
87
+ totalDebtSupplied:string,
88
+ utilization:string,
89
+ ammPrice: string,
90
+ basePrice: string,
91
+ oraclePrice: string,
92
+ minted: string,
93
+ redeemed: string,
94
+ monetaryPolicyRate: string,
95
+ ammRate: string,
96
+ minBand: string,
97
+ maxBand: string,
98
+ borrowRate: string,
99
+ lendRate: string,
100
+ futureBorrowRate: string,
101
+ leftToBorrow: string,
102
+ bands: BandData[],
103
+ assetsData: LlamaLendAssetsData,
104
+ }
105
+
106
+ export interface LlamaLendAggregatedPositionData {
107
+ ratio: string,
108
+ suppliedUsd: string,
109
+ borrowedUsd: string,
110
+ suppliedForYieldUsd: string,
111
+ safetyRatio: string,
112
+ borrowLimitUsd: string,
113
+ minAllowedRatio: number,
114
+ collFactor: string,
115
+ leveragedType: LeverageType,
116
+ leveragedAsset?: string,
117
+ liquidationPrice?: string,
118
+ netApy: string,
119
+ incentiveUsd: string,
120
+ totalInterestUsd: string,
121
+ exposure: string,
122
+ }
123
+
124
+ export interface LlamaLendUsedAsset {
125
+ isSupplied: boolean,
126
+ supplied: string,
127
+ suppliedUsd: string,
128
+ borrowed: string,
129
+ borrowedUsd: string,
130
+ isBorrowed: boolean,
131
+ symbol: string,
132
+ collateral: boolean,
133
+ price: string,
134
+ interestRate?: string,
135
+ suppliedForYield?: string,
136
+ suppliedForYieldUsd?: string,
137
+ shares?: string,
138
+ }
139
+
140
+ export interface LlamaLendUsedAssets {
141
+ [key: string]: LlamaLendUsedAsset,
142
+ }
143
+
144
+ export interface LlamaLendUserData {
145
+ debtAmount: string,
146
+ health: string,
147
+ healthPercent: string,
148
+ priceHigh: string,
149
+ priceLow: string,
150
+ liquidationDiscount: string,
151
+ numOfBands: string,
152
+ usedAssets: LlamaLendUsedAssets,
153
+ status: LlamaLendStatus,
154
+ ratio: string,
155
+ suppliedUsd: string,
156
+ borrowedUsd: string,
157
+ suppliedForYieldUsd: string,
158
+ safetyRatio: string,
159
+ userBands: UserBandData[],
160
+ loanExists: boolean,
161
+ borrowRate?: string,
162
+ exposure: string,
163
+ }