@defisaver/positions-sdk 0.0.183-dev-allocator → 0.0.184

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 (73) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +69 -69
  4. package/cjs/helpers/morphoBlueHelpers/index.d.ts +0 -5
  5. package/cjs/helpers/morphoBlueHelpers/index.js +1 -127
  6. package/cjs/staking/staking.js +2 -2
  7. package/cjs/types/morphoBlue.d.ts +0 -25
  8. package/esm/helpers/morphoBlueHelpers/index.d.ts +0 -5
  9. package/esm/helpers/morphoBlueHelpers/index.js +0 -124
  10. package/esm/staking/staking.js +2 -2
  11. package/esm/types/morphoBlue.d.ts +0 -25
  12. package/package.json +49 -49
  13. package/src/aaveV2/index.ts +227 -227
  14. package/src/aaveV3/index.ts +624 -624
  15. package/src/assets/index.ts +60 -60
  16. package/src/chickenBonds/index.ts +123 -123
  17. package/src/compoundV2/index.ts +220 -220
  18. package/src/compoundV3/index.ts +282 -282
  19. package/src/config/contracts.js +1043 -1043
  20. package/src/constants/index.ts +6 -6
  21. package/src/contracts.ts +130 -130
  22. package/src/curveUsd/index.ts +229 -229
  23. package/src/eulerV2/index.ts +303 -303
  24. package/src/exchange/index.ts +17 -17
  25. package/src/helpers/aaveHelpers/index.ts +198 -198
  26. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  27. package/src/helpers/compoundHelpers/index.ts +246 -246
  28. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  29. package/src/helpers/eulerHelpers/index.ts +232 -232
  30. package/src/helpers/index.ts +8 -8
  31. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  32. package/src/helpers/makerHelpers/index.ts +94 -94
  33. package/src/helpers/morphoBlueHelpers/index.ts +115 -256
  34. package/src/helpers/sparkHelpers/index.ts +150 -150
  35. package/src/index.ts +48 -48
  36. package/src/liquity/index.ts +116 -116
  37. package/src/llamaLend/index.ts +275 -275
  38. package/src/maker/index.ts +117 -117
  39. package/src/markets/aave/index.ts +152 -152
  40. package/src/markets/aave/marketAssets.ts +46 -46
  41. package/src/markets/compound/index.ts +173 -173
  42. package/src/markets/compound/marketsAssets.ts +64 -64
  43. package/src/markets/curveUsd/index.ts +69 -69
  44. package/src/markets/euler/index.ts +26 -26
  45. package/src/markets/index.ts +23 -23
  46. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  47. package/src/markets/llamaLend/index.ts +235 -235
  48. package/src/markets/morphoBlue/index.ts +809 -809
  49. package/src/markets/spark/index.ts +29 -29
  50. package/src/markets/spark/marketAssets.ts +10 -10
  51. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  52. package/src/morphoAaveV2/index.ts +256 -256
  53. package/src/morphoAaveV3/index.ts +630 -630
  54. package/src/morphoBlue/index.ts +171 -171
  55. package/src/multicall/index.ts +22 -22
  56. package/src/services/dsrService.ts +15 -15
  57. package/src/services/priceService.ts +21 -21
  58. package/src/services/utils.ts +56 -56
  59. package/src/setup.ts +8 -8
  60. package/src/spark/index.ts +461 -461
  61. package/src/staking/staking.ts +220 -220
  62. package/src/types/aave.ts +270 -270
  63. package/src/types/chickenBonds.ts +45 -45
  64. package/src/types/common.ts +84 -84
  65. package/src/types/compound.ts +129 -129
  66. package/src/types/curveUsd.ts +118 -118
  67. package/src/types/euler.ts +171 -171
  68. package/src/types/index.ts +9 -9
  69. package/src/types/liquity.ts +30 -30
  70. package/src/types/llamaLend.ts +155 -155
  71. package/src/types/maker.ts +50 -50
  72. package/src/types/morphoBlue.ts +154 -177
  73. package/src/types/spark.ts +131 -131
@@ -1,155 +1,155 @@
1
- import { EthAddress, NetworkNumber } from './common';
2
- import { BandData, UserBandData } from './curveUsd';
3
-
4
- export enum LLVersionsEth {
5
- // long only
6
- LLWstethCrvusd = 'llamaLendwstETHcrvUSD',
7
- LLWstethCrvusd2 = 'llamaLendwstETHcrvUSD2',
8
- LLSusdeCrvusd = 'llamaLendsUSDecrvUSD',
9
- LLSusdeCrvusd2 = 'llamaLendsUSDecrvUSD2',
10
- LLWbtcCrvusd = 'llamaLendWBTCcrvUSD',
11
- // LLPufethCrvusd = 'llamaLendPufETHcrvUSD', // temp disabled
12
- LLUsdeCrvusd = 'llamaLendUSDecrvUSD',
13
- LLWethCrvusd2 = 'llamaLendWETHcrvUSD2',
14
- // long and short crv
15
- LLCrvCrvusd = 'llamaLendCRVcrvUSD',
16
- LLCrvusdCrv = 'llamaLendcrvUSDCRV',
17
- // long and short tbtc
18
- LLTbtcCrvusd = 'llamaLendTBTCcrvUSD',
19
- LLCrvusdTbtc = 'llamaLendcrvUSDTBTC',
20
- // long and short weth
21
- LLWethCrvusd = 'llamaLendWETHcrvUSD',
22
- LLCrvusdWeth = 'llamaLendcrvUSDWETH',
23
- }
24
-
25
- export enum LLVersionsArb {
26
- // long only
27
- LLArbCrvusd = 'llamaLendArbcrvUSD',
28
- LLArbCrvusd2 = 'llamaLendArbcrvUSD2',
29
- LLFxnCrvusd = 'llamaLendFXNcrvUSD',
30
- LLWbtcCrvusd = 'llamaLendWBTCcrvUSD',
31
- LLWbtcCrvusd2 = 'llamaLendWBTCcrvUSD2',
32
- LLCrvCrvusd = 'llamaLendCRVcrvUSD',
33
- LLWethCrvusd = 'llamaLendWETHcrvUSD',
34
- LLWethCrvusd2 = 'llamaLendWETHcrvUSD2',
35
- }
36
-
37
- export const LlamaLendVersions = {
38
- ...LLVersionsEth,
39
- ...LLVersionsArb,
40
- } as const;
41
-
42
- export type LlamaLendVersionsType = typeof LlamaLendVersions[keyof typeof LlamaLendVersions];
43
-
44
- export enum LlamaLendStatus {
45
- Nonexistant = 'Nonexistant',
46
- Safe = 'Safe',
47
- Risk = 'Risk',
48
- SoftLiquidating = 'SoftLiquidating',
49
- SoftLiquidated = 'SoftLiquidated',
50
- }
51
-
52
- export interface LlamaLendMarketData {
53
- chainIds: NetworkNumber[],
54
- label: string,
55
- shortLabel: string,
56
- value: LlamaLendVersionsType,
57
- collAsset: string,
58
- baseAsset: string,
59
- controllerAddress: string,
60
- vaultAddress: EthAddress,
61
- url: string,
62
- }
63
- export interface LlamaLendAssetData {
64
- symbol: string,
65
- address: string,
66
- price: string,
67
- supplyRate: string,
68
- borrowRate: string,
69
- totalSupply?: string,
70
- totalBorrow?: string,
71
- canBeSupplied?: boolean,
72
- canBeBorrowed?: boolean,
73
- shares?: string,
74
- }
75
-
76
- export type LlamaLendAssetsData = { [key: string]: LlamaLendAssetData };
77
-
78
- export interface LlamaLendGlobalMarketData {
79
- A:string,
80
- loanDiscount: string,
81
- activeBand: string,
82
- totalDebt: string,
83
- totalDebtSupplied:string,
84
- utilization:string,
85
- ammPrice: string,
86
- basePrice: string,
87
- oraclePrice: string,
88
- minted: string,
89
- redeemed: string,
90
- monetaryPolicyRate: string,
91
- ammRate: string,
92
- minBand: string,
93
- maxBand: string,
94
- borrowRate: string,
95
- lendRate: string,
96
- futureBorrowRate: string,
97
- leftToBorrow: string,
98
- bands: BandData[],
99
- assetsData: LlamaLendAssetsData,
100
- }
101
-
102
- export interface LlamaLendAggregatedPositionData {
103
- ratio: string,
104
- suppliedUsd: string,
105
- borrowedUsd: string,
106
- suppliedForYieldUsd: string,
107
- safetyRatio: string,
108
- borrowLimitUsd: string,
109
- minAllowedRatio: number,
110
- collFactor: string,
111
- leveragedType: string,
112
- leveragedAsset?: string,
113
- liquidationPrice?: string,
114
- netApy: string,
115
- incentiveUsd: string,
116
- totalInterestUsd: string,
117
- }
118
-
119
- export interface LlamaLendUsedAsset {
120
- isSupplied: boolean,
121
- supplied: string,
122
- suppliedUsd: string,
123
- borrowed: string,
124
- borrowedUsd: string,
125
- isBorrowed: boolean,
126
- symbol: string,
127
- collateral: boolean,
128
- price: string,
129
- interestRate?: string,
130
- suppliedForYield?: string,
131
- suppliedForYieldUsd?: string,
132
- shares?: string,
133
- }
134
-
135
- export interface LlamaLendUsedAssets {
136
- [key: string]: LlamaLendUsedAsset,
137
- }
138
-
139
- export interface LlamaLendUserData {
140
- debtAmount: string,
141
- health: string,
142
- healthPercent: string,
143
- priceHigh: string,
144
- priceLow: string,
145
- liquidationDiscount: string,
146
- numOfBands: string,
147
- usedAssets: LlamaLendUsedAssets,
148
- status: LlamaLendStatus,
149
- ratio: string,
150
- suppliedUsd: string,
151
- borrowedUsd: string,
152
- suppliedForYieldUsd: string,
153
- safetyRatio: string,
154
- userBands: UserBandData[],
155
- }
1
+ import { EthAddress, NetworkNumber } from './common';
2
+ import { BandData, UserBandData } from './curveUsd';
3
+
4
+ export enum LLVersionsEth {
5
+ // long only
6
+ LLWstethCrvusd = 'llamaLendwstETHcrvUSD',
7
+ LLWstethCrvusd2 = 'llamaLendwstETHcrvUSD2',
8
+ LLSusdeCrvusd = 'llamaLendsUSDecrvUSD',
9
+ LLSusdeCrvusd2 = 'llamaLendsUSDecrvUSD2',
10
+ LLWbtcCrvusd = 'llamaLendWBTCcrvUSD',
11
+ // LLPufethCrvusd = 'llamaLendPufETHcrvUSD', // temp disabled
12
+ LLUsdeCrvusd = 'llamaLendUSDecrvUSD',
13
+ LLWethCrvusd2 = 'llamaLendWETHcrvUSD2',
14
+ // long and short crv
15
+ LLCrvCrvusd = 'llamaLendCRVcrvUSD',
16
+ LLCrvusdCrv = 'llamaLendcrvUSDCRV',
17
+ // long and short tbtc
18
+ LLTbtcCrvusd = 'llamaLendTBTCcrvUSD',
19
+ LLCrvusdTbtc = 'llamaLendcrvUSDTBTC',
20
+ // long and short weth
21
+ LLWethCrvusd = 'llamaLendWETHcrvUSD',
22
+ LLCrvusdWeth = 'llamaLendcrvUSDWETH',
23
+ }
24
+
25
+ export enum LLVersionsArb {
26
+ // long only
27
+ LLArbCrvusd = 'llamaLendArbcrvUSD',
28
+ LLArbCrvusd2 = 'llamaLendArbcrvUSD2',
29
+ LLFxnCrvusd = 'llamaLendFXNcrvUSD',
30
+ LLWbtcCrvusd = 'llamaLendWBTCcrvUSD',
31
+ LLWbtcCrvusd2 = 'llamaLendWBTCcrvUSD2',
32
+ LLCrvCrvusd = 'llamaLendCRVcrvUSD',
33
+ LLWethCrvusd = 'llamaLendWETHcrvUSD',
34
+ LLWethCrvusd2 = 'llamaLendWETHcrvUSD2',
35
+ }
36
+
37
+ export const LlamaLendVersions = {
38
+ ...LLVersionsEth,
39
+ ...LLVersionsArb,
40
+ } as const;
41
+
42
+ export type LlamaLendVersionsType = typeof LlamaLendVersions[keyof typeof LlamaLendVersions];
43
+
44
+ export enum LlamaLendStatus {
45
+ Nonexistant = 'Nonexistant',
46
+ Safe = 'Safe',
47
+ Risk = 'Risk',
48
+ SoftLiquidating = 'SoftLiquidating',
49
+ SoftLiquidated = 'SoftLiquidated',
50
+ }
51
+
52
+ export interface LlamaLendMarketData {
53
+ chainIds: NetworkNumber[],
54
+ label: string,
55
+ shortLabel: string,
56
+ value: LlamaLendVersionsType,
57
+ collAsset: string,
58
+ baseAsset: string,
59
+ controllerAddress: string,
60
+ vaultAddress: EthAddress,
61
+ url: string,
62
+ }
63
+ export interface LlamaLendAssetData {
64
+ symbol: string,
65
+ address: string,
66
+ price: string,
67
+ supplyRate: string,
68
+ borrowRate: string,
69
+ totalSupply?: string,
70
+ totalBorrow?: string,
71
+ canBeSupplied?: boolean,
72
+ canBeBorrowed?: boolean,
73
+ shares?: string,
74
+ }
75
+
76
+ export type LlamaLendAssetsData = { [key: string]: LlamaLendAssetData };
77
+
78
+ export interface LlamaLendGlobalMarketData {
79
+ A:string,
80
+ loanDiscount: string,
81
+ activeBand: string,
82
+ totalDebt: string,
83
+ totalDebtSupplied:string,
84
+ utilization:string,
85
+ ammPrice: string,
86
+ basePrice: string,
87
+ oraclePrice: string,
88
+ minted: string,
89
+ redeemed: string,
90
+ monetaryPolicyRate: string,
91
+ ammRate: string,
92
+ minBand: string,
93
+ maxBand: string,
94
+ borrowRate: string,
95
+ lendRate: string,
96
+ futureBorrowRate: string,
97
+ leftToBorrow: string,
98
+ bands: BandData[],
99
+ assetsData: LlamaLendAssetsData,
100
+ }
101
+
102
+ export interface LlamaLendAggregatedPositionData {
103
+ ratio: string,
104
+ suppliedUsd: string,
105
+ borrowedUsd: string,
106
+ suppliedForYieldUsd: string,
107
+ safetyRatio: string,
108
+ borrowLimitUsd: string,
109
+ minAllowedRatio: number,
110
+ collFactor: string,
111
+ leveragedType: string,
112
+ leveragedAsset?: string,
113
+ liquidationPrice?: string,
114
+ netApy: string,
115
+ incentiveUsd: string,
116
+ totalInterestUsd: string,
117
+ }
118
+
119
+ export interface LlamaLendUsedAsset {
120
+ isSupplied: boolean,
121
+ supplied: string,
122
+ suppliedUsd: string,
123
+ borrowed: string,
124
+ borrowedUsd: string,
125
+ isBorrowed: boolean,
126
+ symbol: string,
127
+ collateral: boolean,
128
+ price: string,
129
+ interestRate?: string,
130
+ suppliedForYield?: string,
131
+ suppliedForYieldUsd?: string,
132
+ shares?: string,
133
+ }
134
+
135
+ export interface LlamaLendUsedAssets {
136
+ [key: string]: LlamaLendUsedAsset,
137
+ }
138
+
139
+ export interface LlamaLendUserData {
140
+ debtAmount: string,
141
+ health: string,
142
+ healthPercent: string,
143
+ priceHigh: string,
144
+ priceLow: string,
145
+ liquidationDiscount: string,
146
+ numOfBands: string,
147
+ usedAssets: LlamaLendUsedAssets,
148
+ status: LlamaLendStatus,
149
+ ratio: string,
150
+ suppliedUsd: string,
151
+ borrowedUsd: string,
152
+ suppliedForYieldUsd: string,
153
+ safetyRatio: string,
154
+ userBands: UserBandData[],
155
+ }
@@ -1,51 +1,51 @@
1
- import { EthAddress } from './common';
2
-
3
- export interface IlkInfo {
4
- ilkLabel: string;
5
- currentRate: string;
6
- futureRate: string;
7
- minDebt: string;
8
- globalDebtCeiling: string;
9
- globalDebtCurrent: string;
10
- assetPrice: string;
11
- liqRatio: string;
12
- liqPercent: number;
13
- stabilityFee: number;
14
- liquidationFee: string;
15
- creatableDebt: string;
16
- }
17
-
18
- export interface CdpData {
19
- owner: EthAddress,
20
- userAddress: EthAddress,
21
- id: string,
22
- urn: EthAddress,
23
- type: string,
24
- ilk: string,
25
- ilkLabel: string,
26
- asset: string,
27
- collateral: string,
28
- collateralUsd: string,
29
- futureDebt: string,
30
- debtDai: string,
31
- debtUsd: string,
32
- debtInAsset: string,
33
- debtAssetPrice: string,
34
- debtAssetMarketPrice: string,
35
- liquidationPrice: string,
36
- ratio: string,
37
- liqRatio: string,
38
- liqPercent: number,
39
- assetPrice: string,
40
- daiLabel: string,
41
- debtAsset: string,
42
- unclaimedCollateral: string,
43
- debtTooLow: boolean,
44
- minDebt: string,
45
- stabilityFee: number,
46
- creatableDebt: string,
47
- globalDebtCeiling: string,
48
- globalDebtCurrent: string,
49
- liquidationFee: string,
50
- lastUpdated: number,
1
+ import { EthAddress } from './common';
2
+
3
+ export interface IlkInfo {
4
+ ilkLabel: string;
5
+ currentRate: string;
6
+ futureRate: string;
7
+ minDebt: string;
8
+ globalDebtCeiling: string;
9
+ globalDebtCurrent: string;
10
+ assetPrice: string;
11
+ liqRatio: string;
12
+ liqPercent: number;
13
+ stabilityFee: number;
14
+ liquidationFee: string;
15
+ creatableDebt: string;
16
+ }
17
+
18
+ export interface CdpData {
19
+ owner: EthAddress,
20
+ userAddress: EthAddress,
21
+ id: string,
22
+ urn: EthAddress,
23
+ type: string,
24
+ ilk: string,
25
+ ilkLabel: string,
26
+ asset: string,
27
+ collateral: string,
28
+ collateralUsd: string,
29
+ futureDebt: string,
30
+ debtDai: string,
31
+ debtUsd: string,
32
+ debtInAsset: string,
33
+ debtAssetPrice: string,
34
+ debtAssetMarketPrice: string,
35
+ liquidationPrice: string,
36
+ ratio: string,
37
+ liqRatio: string,
38
+ liqPercent: number,
39
+ assetPrice: string,
40
+ daiLabel: string,
41
+ debtAsset: string,
42
+ unclaimedCollateral: string,
43
+ debtTooLow: boolean,
44
+ minDebt: string,
45
+ stabilityFee: number,
46
+ creatableDebt: string,
47
+ globalDebtCeiling: string,
48
+ globalDebtCurrent: string,
49
+ liquidationFee: string,
50
+ lastUpdated: number,
51
51
  }