@defisaver/positions-sdk 0.0.12 → 0.0.14

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 (74) hide show
  1. package/cjs/config/contracts.d.ts +183 -71
  2. package/cjs/config/contracts.js +16 -0
  3. package/cjs/markets/curveUsd/index.d.ts +2 -0
  4. package/cjs/markets/curveUsd/index.js +14 -1
  5. package/cjs/types/contracts/generated/CrvUSDtBTCAmm.d.ts +139 -0
  6. package/cjs/types/contracts/generated/CrvUSDtBTCAmm.js +5 -0
  7. package/cjs/types/contracts/generated/CrvUSDtBTCController.d.ts +204 -0
  8. package/cjs/types/contracts/generated/CrvUSDtBTCController.js +5 -0
  9. package/cjs/types/contracts/generated/index.d.ts +2 -0
  10. package/cjs/types/curveUsd.d.ts +2 -1
  11. package/cjs/types/curveUsd.js +1 -0
  12. package/esm/config/contracts.d.ts +183 -71
  13. package/esm/config/contracts.js +16 -0
  14. package/esm/markets/curveUsd/index.d.ts +2 -0
  15. package/esm/markets/curveUsd/index.js +12 -0
  16. package/esm/types/contracts/generated/CrvUSDtBTCAmm.d.ts +139 -0
  17. package/esm/types/contracts/generated/CrvUSDtBTCAmm.js +4 -0
  18. package/esm/types/contracts/generated/CrvUSDtBTCController.d.ts +204 -0
  19. package/esm/types/contracts/generated/CrvUSDtBTCController.js +4 -0
  20. package/esm/types/contracts/generated/index.d.ts +2 -0
  21. package/esm/types/curveUsd.d.ts +2 -1
  22. package/esm/types/curveUsd.js +1 -0
  23. package/package.json +40 -40
  24. package/src/aaveV2/index.ts +220 -220
  25. package/src/aaveV3/index.ts +550 -550
  26. package/src/assets/index.ts +60 -60
  27. package/src/chickenBonds/index.ts +123 -123
  28. package/src/compoundV2/index.ts +206 -206
  29. package/src/compoundV3/index.ts +269 -269
  30. package/src/config/contracts.js +635 -619
  31. package/src/constants/index.ts +3 -3
  32. package/src/contracts.ts +100 -100
  33. package/src/curveUsd/index.ts +228 -228
  34. package/src/exchange/index.ts +17 -17
  35. package/src/helpers/aaveHelpers/index.ts +134 -134
  36. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  37. package/src/helpers/compoundHelpers/index.ts +181 -181
  38. package/src/helpers/curveUsdHelpers/index.ts +32 -32
  39. package/src/helpers/index.ts +5 -5
  40. package/src/helpers/makerHelpers/index.ts +94 -94
  41. package/src/helpers/sparkHelpers/index.ts +106 -106
  42. package/src/index.ts +40 -40
  43. package/src/liquity/index.ts +103 -103
  44. package/src/maker/index.ts +101 -101
  45. package/src/markets/aave/index.ts +80 -80
  46. package/src/markets/aave/marketAssets.ts +32 -32
  47. package/src/markets/compound/index.ts +85 -85
  48. package/src/markets/compound/marketsAssets.ts +35 -35
  49. package/src/markets/curveUsd/index.ts +56 -42
  50. package/src/markets/index.ts +3 -3
  51. package/src/markets/spark/index.ts +29 -29
  52. package/src/markets/spark/marketAssets.ts +9 -9
  53. package/src/moneymarket/moneymarketCommonService.ts +75 -75
  54. package/src/morpho/markets.ts +39 -39
  55. package/src/morphoAaveV2/index.ts +254 -254
  56. package/src/morphoAaveV3/index.ts +614 -614
  57. package/src/multicall/index.ts +22 -22
  58. package/src/services/dsrService.ts +15 -15
  59. package/src/services/priceService.ts +21 -21
  60. package/src/services/utils.ts +34 -34
  61. package/src/spark/index.ts +413 -413
  62. package/src/staking/staking.ts +167 -167
  63. package/src/types/aave.ts +256 -256
  64. package/src/types/chickenBonds.ts +45 -45
  65. package/src/types/common.ts +83 -83
  66. package/src/types/compound.ts +121 -121
  67. package/src/types/contracts/generated/CrvUSDtBTCAmm.ts +286 -0
  68. package/src/types/contracts/generated/CrvUSDtBTCController.ts +397 -0
  69. package/src/types/contracts/generated/index.ts +2 -0
  70. package/src/types/curveUsd.ts +111 -110
  71. package/src/types/index.ts +6 -6
  72. package/src/types/liquity.ts +29 -29
  73. package/src/types/maker.ts +50 -50
  74. package/src/types/spark.ts +106 -106
@@ -1,30 +1,30 @@
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,
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
30
  }
@@ -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
  }
@@ -1,107 +1,107 @@
1
- import { EModeCategoryData, EModeCategoryDataMapping } from './aave';
2
- import {
3
- MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
4
- } from './common';
5
-
6
- export enum SparkVersions {
7
- SparkV1 = 'v1default',
8
- }
9
-
10
- export interface SparkMarketData {
11
- chainIds: NetworkNumber[],
12
- label: string,
13
- shortLabel: string,
14
- url: string,
15
- value: SparkVersions,
16
- assets: readonly string[],
17
- provider: '' | 'SparkPoolAddressesProvider',
18
- providerAddress: string,
19
- lendingPool: 'SparkLendingPool',
20
- lendingPoolAddress: string,
21
- protocolData: '' | 'SparkProtocolDataProvider',
22
- protocolDataAddress: string
23
- subVersionLabel?: string
24
- // icon: Function,
25
- protocolName: string,
26
- disabled?: boolean,
27
- }
28
-
29
- export interface SparkAssetData extends MMAssetData {
30
- totalBorrowVar: string,
31
- sortIndex?: number,
32
- usageAsCollateralEnabled: boolean,
33
- isIsolated: boolean,
34
- eModeCategory: number,
35
- eModeCategoryData: EModeCategoryData,
36
- liquidationRatio: string,
37
- }
38
-
39
- export interface SparkAssetsData {
40
- [token: string]: SparkAssetData,
41
- }
42
-
43
- export type SparkMarketsData = { assetsData: SparkAssetsData };
44
-
45
- export interface SparkUsedAsset extends MMUsedAsset {
46
- stableBorrowRate: string,
47
- borrowedStable: string,
48
- borrowedVariable: string,
49
- borrowedUsdStable: string,
50
- borrowedUsdVariable: string,
51
- stableLimit: string,
52
- variableLimit: string,
53
- limit: string,
54
- eModeCategory: number,
55
- }
56
-
57
- export interface SparkUsedAssets {
58
- [token: string]: SparkUsedAsset,
59
- }
60
-
61
- export interface SparkHelperCommon {
62
- usedAssets: SparkUsedAssets,
63
- eModeCategory: number,
64
- eModeCategories?: object,
65
- assetsData: SparkAssetsData,
66
- selectedMarket?: SparkMarketData,
67
- network?: NetworkNumber,
68
- }
69
-
70
- export interface SparkAggregatedPositionData {
71
- suppliedUsd: string,
72
- suppliedCollateralUsd: string,
73
- borrowedUsd: string,
74
- borrowLimitUsd: string,
75
- liquidationLimitUsd: string,
76
- leftToBorrowUsd: string,
77
- ratio: string,
78
- collRatio: string,
79
- netApy: string,
80
- incentiveUsd: string,
81
- totalInterestUsd: string,
82
- liqRatio: string,
83
- liqPercent: string,
84
- leveragedType: string,
85
- leveragedAsset?: string,
86
- leveragedLsdAssetRatio?: string,
87
- liquidationPrice?: string,
88
- }
89
-
90
- export interface SparkPositionData extends MMPositionData {
91
- ratio: string,
92
- minRatio: string,
93
- collRatio: string,
94
- borrowedUsd: string,
95
- borrowLimitUsd: string,
96
- suppliedCollateralUsd: string,
97
- incentiveUsd: string,
98
- totalInterestUsd: string,
99
- isSubscribedToAutomation?: boolean,
100
- automationResubscribeRequired?: boolean,
101
- totalSupplied: string,
102
- usedAssets: SparkUsedAssets,
103
- eModeCategory: number,
104
- isInIsolationMode: boolean,
105
- isInSiloedMode: boolean,
106
- eModeCategories: { [key: number]: EModeCategoryDataMapping },
1
+ import { EModeCategoryData, EModeCategoryDataMapping } from './aave';
2
+ import {
3
+ MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
4
+ } from './common';
5
+
6
+ export enum SparkVersions {
7
+ SparkV1 = 'v1default',
8
+ }
9
+
10
+ export interface SparkMarketData {
11
+ chainIds: NetworkNumber[],
12
+ label: string,
13
+ shortLabel: string,
14
+ url: string,
15
+ value: SparkVersions,
16
+ assets: readonly string[],
17
+ provider: '' | 'SparkPoolAddressesProvider',
18
+ providerAddress: string,
19
+ lendingPool: 'SparkLendingPool',
20
+ lendingPoolAddress: string,
21
+ protocolData: '' | 'SparkProtocolDataProvider',
22
+ protocolDataAddress: string
23
+ subVersionLabel?: string
24
+ // icon: Function,
25
+ protocolName: string,
26
+ disabled?: boolean,
27
+ }
28
+
29
+ export interface SparkAssetData extends MMAssetData {
30
+ totalBorrowVar: string,
31
+ sortIndex?: number,
32
+ usageAsCollateralEnabled: boolean,
33
+ isIsolated: boolean,
34
+ eModeCategory: number,
35
+ eModeCategoryData: EModeCategoryData,
36
+ liquidationRatio: string,
37
+ }
38
+
39
+ export interface SparkAssetsData {
40
+ [token: string]: SparkAssetData,
41
+ }
42
+
43
+ export type SparkMarketsData = { assetsData: SparkAssetsData };
44
+
45
+ export interface SparkUsedAsset extends MMUsedAsset {
46
+ stableBorrowRate: string,
47
+ borrowedStable: string,
48
+ borrowedVariable: string,
49
+ borrowedUsdStable: string,
50
+ borrowedUsdVariable: string,
51
+ stableLimit: string,
52
+ variableLimit: string,
53
+ limit: string,
54
+ eModeCategory: number,
55
+ }
56
+
57
+ export interface SparkUsedAssets {
58
+ [token: string]: SparkUsedAsset,
59
+ }
60
+
61
+ export interface SparkHelperCommon {
62
+ usedAssets: SparkUsedAssets,
63
+ eModeCategory: number,
64
+ eModeCategories?: object,
65
+ assetsData: SparkAssetsData,
66
+ selectedMarket?: SparkMarketData,
67
+ network?: NetworkNumber,
68
+ }
69
+
70
+ export interface SparkAggregatedPositionData {
71
+ suppliedUsd: string,
72
+ suppliedCollateralUsd: string,
73
+ borrowedUsd: string,
74
+ borrowLimitUsd: string,
75
+ liquidationLimitUsd: string,
76
+ leftToBorrowUsd: string,
77
+ ratio: string,
78
+ collRatio: string,
79
+ netApy: string,
80
+ incentiveUsd: string,
81
+ totalInterestUsd: string,
82
+ liqRatio: string,
83
+ liqPercent: string,
84
+ leveragedType: string,
85
+ leveragedAsset?: string,
86
+ leveragedLsdAssetRatio?: string,
87
+ liquidationPrice?: string,
88
+ }
89
+
90
+ export interface SparkPositionData extends MMPositionData {
91
+ ratio: string,
92
+ minRatio: string,
93
+ collRatio: string,
94
+ borrowedUsd: string,
95
+ borrowLimitUsd: string,
96
+ suppliedCollateralUsd: string,
97
+ incentiveUsd: string,
98
+ totalInterestUsd: string,
99
+ isSubscribedToAutomation?: boolean,
100
+ automationResubscribeRequired?: boolean,
101
+ totalSupplied: string,
102
+ usedAssets: SparkUsedAssets,
103
+ eModeCategory: number,
104
+ isInIsolationMode: boolean,
105
+ isInSiloedMode: boolean,
106
+ eModeCategories: { [key: number]: EModeCategoryDataMapping },
107
107
  }