@defisaver/positions-sdk 0.0.96 → 0.0.98

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 (65) hide show
  1. package/README.md +63 -63
  2. package/cjs/markets/compound/marketsAssets.js +1 -1
  3. package/cjs/morphoBlue/index.d.ts +2 -1
  4. package/cjs/morphoBlue/index.js +29 -1
  5. package/esm/markets/compound/marketsAssets.js +1 -1
  6. package/esm/morphoBlue/index.d.ts +2 -1
  7. package/esm/morphoBlue/index.js +28 -1
  8. package/package.json +40 -40
  9. package/src/aaveV2/index.ts +227 -227
  10. package/src/aaveV3/index.ts +558 -558
  11. package/src/assets/index.ts +60 -60
  12. package/src/chickenBonds/index.ts +123 -123
  13. package/src/compoundV2/index.ts +219 -219
  14. package/src/compoundV3/index.ts +266 -266
  15. package/src/config/contracts.js +848 -848
  16. package/src/constants/index.ts +5 -5
  17. package/src/contracts.ts +128 -128
  18. package/src/curveUsd/index.ts +229 -229
  19. package/src/exchange/index.ts +17 -17
  20. package/src/helpers/aaveHelpers/index.ts +134 -134
  21. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  22. package/src/helpers/compoundHelpers/index.ts +181 -181
  23. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  24. package/src/helpers/index.ts +7 -7
  25. package/src/helpers/llamaLendHelpers/index.ts +45 -45
  26. package/src/helpers/makerHelpers/index.ts +94 -94
  27. package/src/helpers/morphoBlueHelpers/index.ts +56 -56
  28. package/src/helpers/sparkHelpers/index.ts +106 -106
  29. package/src/index.ts +46 -46
  30. package/src/liquity/index.ts +116 -116
  31. package/src/llamaLend/index.ts +268 -268
  32. package/src/maker/index.ts +117 -117
  33. package/src/markets/aave/index.ts +80 -80
  34. package/src/markets/aave/marketAssets.ts +24 -24
  35. package/src/markets/compound/index.ts +142 -142
  36. package/src/markets/compound/marketsAssets.ts +50 -50
  37. package/src/markets/curveUsd/index.ts +69 -69
  38. package/src/markets/index.ts +5 -5
  39. package/src/markets/llamaLend/contractAddresses.ts +95 -95
  40. package/src/markets/llamaLend/index.ts +150 -150
  41. package/src/markets/morphoBlue/index.ts +611 -611
  42. package/src/markets/spark/index.ts +29 -29
  43. package/src/markets/spark/marketAssets.ts +10 -10
  44. package/src/moneymarket/moneymarketCommonService.ts +76 -76
  45. package/src/morphoAaveV2/index.ts +256 -256
  46. package/src/morphoAaveV3/index.ts +612 -612
  47. package/src/morphoBlue/index.ts +199 -162
  48. package/src/multicall/index.ts +22 -22
  49. package/src/services/dsrService.ts +15 -15
  50. package/src/services/priceService.ts +21 -21
  51. package/src/services/utils.ts +51 -51
  52. package/src/setup.ts +8 -8
  53. package/src/spark/index.ts +424 -424
  54. package/src/staking/staking.ts +187 -187
  55. package/src/types/aave.ts +256 -256
  56. package/src/types/chickenBonds.ts +45 -45
  57. package/src/types/common.ts +84 -84
  58. package/src/types/compound.ts +128 -128
  59. package/src/types/curveUsd.ts +118 -118
  60. package/src/types/index.ts +8 -8
  61. package/src/types/liquity.ts +30 -30
  62. package/src/types/llamaLend.ts +143 -143
  63. package/src/types/maker.ts +50 -50
  64. package/src/types/morphoBlue.ts +139 -139
  65. package/src/types/spark.ts +106 -106
@@ -1,31 +1,31 @@
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
31
  }
@@ -1,143 +1,143 @@
1
- import { EthAddress, NetworkNumber } from './common';
2
- import { BandData, UserBandData } from './curveUsd';
3
-
4
- export enum LLVersionsEth {
5
- // long only
6
- LLWstethCrvusd = 'llamaLendwstETHcrvUSD',
7
- LLSusdeCrvusd = 'llamaLendsUSDecrvUSD',
8
- // long and short crv
9
- LLCrvCrvusd = 'llamaLendCRVcrvUSD',
10
- LLCrvusdCrv = 'llamaLendcrvUSDCRV',
11
- // long and short tbtc
12
- LLTbtcCrvusd = 'llamaLendTBTCcrvUSD',
13
- LLCrvusdTbtc = 'llamaLendcrvUSDTBTC',
14
- // long and short weth
15
- LLWethCrvusd = 'llamaLendWETHcrvUSD',
16
- LLCrvusdWeth = 'llamaLendcrvUSDWETH',
17
- }
18
-
19
- export enum LLVersionsArb {
20
- // long only
21
- LLArbCrvusd = 'llamaLendArbcrvUSD',
22
- LLFxnCrvusd = 'llamaLendFXNcrvUSD',
23
- LLWbtcCrvusd = 'llamaLendWBTCcrvUSD',
24
- LLCrvCrvusd = 'llamaLendCRVcrvUSD',
25
- LLWethCrvusd = 'llamaLendWETHcrvUSD',
26
- }
27
-
28
- export const LlamaLendVersions = {
29
- ...LLVersionsEth,
30
- ...LLVersionsArb,
31
- } as const;
32
-
33
- export type LlamaLendVersionsType = typeof LlamaLendVersions[keyof typeof LlamaLendVersions];
34
-
35
- export enum LlamaLendStatus {
36
- Nonexistant = 'Nonexistant',
37
- Safe = 'Safe',
38
- Risk = 'Risk',
39
- SoftLiquidating = 'SoftLiquidating',
40
- SoftLiquidated = 'SoftLiquidated',
41
- }
42
-
43
- export interface LlamaLendMarketData {
44
- chainIds: NetworkNumber[],
45
- label: string,
46
- shortLabel: string,
47
- value: LlamaLendVersionsType,
48
- collAsset: string,
49
- baseAsset: string,
50
- controllerAddress: string,
51
- vaultAddress: EthAddress,
52
- url: string,
53
- }
54
- export interface LlamaLendAssetData {
55
- symbol: string,
56
- address: string,
57
- price: string,
58
- supplyRate: string,
59
- borrowRate: string,
60
- totalSupply?: string,
61
- totalBorrow?: string,
62
- canBeSupplied?: boolean,
63
- canBeBorrowed?: boolean,
64
- shares?: string,
65
- }
66
-
67
- export type LlamaLendAssetsData = { [key: string]: LlamaLendAssetData };
68
-
69
- export interface LlamaLendGlobalMarketData {
70
- A:string,
71
- loanDiscount: string,
72
- activeBand: string,
73
- totalDebt: string,
74
- totalDebtSupplied:string,
75
- utilization:string,
76
- ammPrice: string,
77
- basePrice: string,
78
- oraclePrice: string,
79
- minted: string,
80
- redeemed: string,
81
- monetaryPolicyRate: string,
82
- ammRate: string,
83
- minBand: string,
84
- maxBand: string,
85
- borrowRate: string,
86
- lendRate: string,
87
- futureBorrowRate: string,
88
- leftToBorrow: string,
89
- bands: BandData[],
90
- assetsData: LlamaLendAssetsData,
91
- }
92
-
93
- export interface LlamaLendAggregatedPositionData {
94
- ratio: string,
95
- suppliedUsd: string,
96
- borrowedUsd: string,
97
- suppliedForYieldUsd: string,
98
- safetyRatio: string,
99
- borrowLimitUsd: string,
100
- minAllowedRatio: number,
101
- collFactor: string,
102
- leveragedType: string,
103
- leveragedAsset?: string,
104
- liquidationPrice?: string,
105
- }
106
-
107
- export interface LlamaLendUsedAsset {
108
- isSupplied: boolean,
109
- supplied: string,
110
- suppliedUsd: string,
111
- borrowed: string,
112
- borrowedUsd: string,
113
- isBorrowed: boolean,
114
- symbol: string,
115
- collateral: boolean,
116
- price: string,
117
- interestRate?: string,
118
- suppliedForYield?: string,
119
- suppliedForYieldUsd?: string,
120
- shares?: string,
121
- }
122
-
123
- export interface LlamaLendUsedAssets {
124
- [key: string]: LlamaLendUsedAsset,
125
- }
126
-
127
- export interface LlamaLendUserData {
128
- debtAmount: string,
129
- health: string,
130
- healthPercent: string,
131
- priceHigh: string,
132
- priceLow: string,
133
- liquidationDiscount: string,
134
- numOfBands: string,
135
- usedAssets: LlamaLendUsedAssets,
136
- status: LlamaLendStatus,
137
- ratio: string,
138
- suppliedUsd: string,
139
- borrowedUsd: string,
140
- suppliedForYieldUsd: string,
141
- safetyRatio: string,
142
- userBands: UserBandData[],
143
- }
1
+ import { EthAddress, NetworkNumber } from './common';
2
+ import { BandData, UserBandData } from './curveUsd';
3
+
4
+ export enum LLVersionsEth {
5
+ // long only
6
+ LLWstethCrvusd = 'llamaLendwstETHcrvUSD',
7
+ LLSusdeCrvusd = 'llamaLendsUSDecrvUSD',
8
+ // long and short crv
9
+ LLCrvCrvusd = 'llamaLendCRVcrvUSD',
10
+ LLCrvusdCrv = 'llamaLendcrvUSDCRV',
11
+ // long and short tbtc
12
+ LLTbtcCrvusd = 'llamaLendTBTCcrvUSD',
13
+ LLCrvusdTbtc = 'llamaLendcrvUSDTBTC',
14
+ // long and short weth
15
+ LLWethCrvusd = 'llamaLendWETHcrvUSD',
16
+ LLCrvusdWeth = 'llamaLendcrvUSDWETH',
17
+ }
18
+
19
+ export enum LLVersionsArb {
20
+ // long only
21
+ LLArbCrvusd = 'llamaLendArbcrvUSD',
22
+ LLFxnCrvusd = 'llamaLendFXNcrvUSD',
23
+ LLWbtcCrvusd = 'llamaLendWBTCcrvUSD',
24
+ LLCrvCrvusd = 'llamaLendCRVcrvUSD',
25
+ LLWethCrvusd = 'llamaLendWETHcrvUSD',
26
+ }
27
+
28
+ export const LlamaLendVersions = {
29
+ ...LLVersionsEth,
30
+ ...LLVersionsArb,
31
+ } as const;
32
+
33
+ export type LlamaLendVersionsType = typeof LlamaLendVersions[keyof typeof LlamaLendVersions];
34
+
35
+ export enum LlamaLendStatus {
36
+ Nonexistant = 'Nonexistant',
37
+ Safe = 'Safe',
38
+ Risk = 'Risk',
39
+ SoftLiquidating = 'SoftLiquidating',
40
+ SoftLiquidated = 'SoftLiquidated',
41
+ }
42
+
43
+ export interface LlamaLendMarketData {
44
+ chainIds: NetworkNumber[],
45
+ label: string,
46
+ shortLabel: string,
47
+ value: LlamaLendVersionsType,
48
+ collAsset: string,
49
+ baseAsset: string,
50
+ controllerAddress: string,
51
+ vaultAddress: EthAddress,
52
+ url: string,
53
+ }
54
+ export interface LlamaLendAssetData {
55
+ symbol: string,
56
+ address: string,
57
+ price: string,
58
+ supplyRate: string,
59
+ borrowRate: string,
60
+ totalSupply?: string,
61
+ totalBorrow?: string,
62
+ canBeSupplied?: boolean,
63
+ canBeBorrowed?: boolean,
64
+ shares?: string,
65
+ }
66
+
67
+ export type LlamaLendAssetsData = { [key: string]: LlamaLendAssetData };
68
+
69
+ export interface LlamaLendGlobalMarketData {
70
+ A:string,
71
+ loanDiscount: string,
72
+ activeBand: string,
73
+ totalDebt: string,
74
+ totalDebtSupplied:string,
75
+ utilization:string,
76
+ ammPrice: string,
77
+ basePrice: string,
78
+ oraclePrice: string,
79
+ minted: string,
80
+ redeemed: string,
81
+ monetaryPolicyRate: string,
82
+ ammRate: string,
83
+ minBand: string,
84
+ maxBand: string,
85
+ borrowRate: string,
86
+ lendRate: string,
87
+ futureBorrowRate: string,
88
+ leftToBorrow: string,
89
+ bands: BandData[],
90
+ assetsData: LlamaLendAssetsData,
91
+ }
92
+
93
+ export interface LlamaLendAggregatedPositionData {
94
+ ratio: string,
95
+ suppliedUsd: string,
96
+ borrowedUsd: string,
97
+ suppliedForYieldUsd: string,
98
+ safetyRatio: string,
99
+ borrowLimitUsd: string,
100
+ minAllowedRatio: number,
101
+ collFactor: string,
102
+ leveragedType: string,
103
+ leveragedAsset?: string,
104
+ liquidationPrice?: string,
105
+ }
106
+
107
+ export interface LlamaLendUsedAsset {
108
+ isSupplied: boolean,
109
+ supplied: string,
110
+ suppliedUsd: string,
111
+ borrowed: string,
112
+ borrowedUsd: string,
113
+ isBorrowed: boolean,
114
+ symbol: string,
115
+ collateral: boolean,
116
+ price: string,
117
+ interestRate?: string,
118
+ suppliedForYield?: string,
119
+ suppliedForYieldUsd?: string,
120
+ shares?: string,
121
+ }
122
+
123
+ export interface LlamaLendUsedAssets {
124
+ [key: string]: LlamaLendUsedAsset,
125
+ }
126
+
127
+ export interface LlamaLendUserData {
128
+ debtAmount: string,
129
+ health: string,
130
+ healthPercent: string,
131
+ priceHigh: string,
132
+ priceLow: string,
133
+ liquidationDiscount: string,
134
+ numOfBands: string,
135
+ usedAssets: LlamaLendUsedAssets,
136
+ status: LlamaLendStatus,
137
+ ratio: string,
138
+ suppliedUsd: string,
139
+ borrowedUsd: string,
140
+ suppliedForYieldUsd: string,
141
+ safetyRatio: string,
142
+ userBands: UserBandData[],
143
+ }
@@ -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
  }