@defisaver/positions-sdk 0.0.187 → 0.0.188-dev-markets

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 (126) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +69 -69
  4. package/cjs/compoundV3/index.js +14 -9
  5. package/cjs/config/contracts.d.ts +572 -216
  6. package/cjs/config/contracts.js +34 -2
  7. package/cjs/contracts.d.ts +2 -0
  8. package/cjs/contracts.js +3 -1
  9. package/cjs/helpers/morphoBlueHelpers/index.js +49 -49
  10. package/cjs/markets/compound/index.d.ts +4 -0
  11. package/cjs/markets/compound/index.js +41 -1
  12. package/cjs/markets/compound/marketsAssets.d.ts +14 -0
  13. package/cjs/markets/compound/marketsAssets.js +17 -3
  14. package/cjs/markets/morphoBlue/index.d.ts +8 -0
  15. package/cjs/markets/morphoBlue/index.js +71 -2
  16. package/cjs/morphoBlue/index.js +27 -10
  17. package/cjs/services/priceService.d.ts +3 -0
  18. package/cjs/services/priceService.js +33 -1
  19. package/cjs/types/compound.d.ts +3 -1
  20. package/cjs/types/compound.js +2 -0
  21. package/cjs/types/contracts/generated/CUSDSv3.d.ts +441 -0
  22. package/cjs/types/contracts/generated/CUSDSv3.js +5 -0
  23. package/cjs/types/contracts/generated/CWstETHv3.d.ts +441 -0
  24. package/cjs/types/contracts/generated/CWstETHv3.js +5 -0
  25. package/cjs/types/contracts/generated/DFSFeedRegistry.d.ts +40 -0
  26. package/cjs/types/contracts/generated/DFSFeedRegistry.js +5 -0
  27. package/cjs/types/contracts/generated/WstETHPriceFeed.d.ts +39 -0
  28. package/cjs/types/contracts/generated/WstETHPriceFeed.js +5 -0
  29. package/cjs/types/contracts/generated/index.d.ts +4 -0
  30. package/cjs/types/morphoBlue.d.ts +5 -1
  31. package/cjs/types/morphoBlue.js +4 -0
  32. package/esm/compoundV3/index.js +15 -10
  33. package/esm/config/contracts.d.ts +572 -216
  34. package/esm/config/contracts.js +34 -2
  35. package/esm/contracts.d.ts +2 -0
  36. package/esm/contracts.js +2 -0
  37. package/esm/helpers/morphoBlueHelpers/index.js +49 -49
  38. package/esm/markets/compound/index.d.ts +4 -0
  39. package/esm/markets/compound/index.js +39 -1
  40. package/esm/markets/compound/marketsAssets.d.ts +14 -0
  41. package/esm/markets/compound/marketsAssets.js +16 -2
  42. package/esm/markets/morphoBlue/index.d.ts +8 -0
  43. package/esm/markets/morphoBlue/index.js +65 -1
  44. package/esm/morphoBlue/index.js +30 -13
  45. package/esm/services/priceService.d.ts +3 -0
  46. package/esm/services/priceService.js +31 -1
  47. package/esm/types/compound.d.ts +3 -1
  48. package/esm/types/compound.js +2 -0
  49. package/esm/types/contracts/generated/CUSDSv3.d.ts +441 -0
  50. package/esm/types/contracts/generated/CUSDSv3.js +4 -0
  51. package/esm/types/contracts/generated/CWstETHv3.d.ts +441 -0
  52. package/esm/types/contracts/generated/CWstETHv3.js +4 -0
  53. package/esm/types/contracts/generated/DFSFeedRegistry.d.ts +40 -0
  54. package/esm/types/contracts/generated/DFSFeedRegistry.js +4 -0
  55. package/esm/types/contracts/generated/WstETHPriceFeed.d.ts +39 -0
  56. package/esm/types/contracts/generated/WstETHPriceFeed.js +4 -0
  57. package/esm/types/contracts/generated/index.d.ts +4 -0
  58. package/esm/types/morphoBlue.d.ts +5 -1
  59. package/esm/types/morphoBlue.js +4 -0
  60. package/package.json +49 -49
  61. package/src/aaveV2/index.ts +227 -227
  62. package/src/aaveV3/index.ts +624 -624
  63. package/src/assets/index.ts +60 -60
  64. package/src/chickenBonds/index.ts +123 -123
  65. package/src/compoundV2/index.ts +220 -220
  66. package/src/compoundV3/index.ts +291 -282
  67. package/src/config/contracts.js +1079 -1047
  68. package/src/constants/index.ts +6 -6
  69. package/src/contracts.ts +132 -130
  70. package/src/curveUsd/index.ts +229 -229
  71. package/src/eulerV2/index.ts +303 -303
  72. package/src/exchange/index.ts +17 -17
  73. package/src/helpers/aaveHelpers/index.ts +198 -198
  74. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  75. package/src/helpers/compoundHelpers/index.ts +246 -246
  76. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  77. package/src/helpers/eulerHelpers/index.ts +232 -232
  78. package/src/helpers/index.ts +8 -8
  79. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  80. package/src/helpers/makerHelpers/index.ts +94 -94
  81. package/src/helpers/morphoBlueHelpers/index.ts +325 -325
  82. package/src/helpers/sparkHelpers/index.ts +150 -150
  83. package/src/index.ts +48 -48
  84. package/src/liquity/index.ts +116 -116
  85. package/src/llamaLend/index.ts +275 -275
  86. package/src/maker/index.ts +117 -117
  87. package/src/markets/aave/index.ts +152 -152
  88. package/src/markets/aave/marketAssets.ts +46 -46
  89. package/src/markets/compound/index.ts +213 -173
  90. package/src/markets/compound/marketsAssets.ts +82 -64
  91. package/src/markets/curveUsd/index.ts +69 -69
  92. package/src/markets/euler/index.ts +26 -26
  93. package/src/markets/index.ts +23 -23
  94. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  95. package/src/markets/llamaLend/index.ts +235 -235
  96. package/src/markets/morphoBlue/index.ts +878 -809
  97. package/src/markets/spark/index.ts +29 -29
  98. package/src/markets/spark/marketAssets.ts +10 -10
  99. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  100. package/src/morphoAaveV2/index.ts +256 -256
  101. package/src/morphoAaveV3/index.ts +630 -630
  102. package/src/morphoBlue/index.ts +188 -171
  103. package/src/multicall/index.ts +22 -22
  104. package/src/services/dsrService.ts +15 -15
  105. package/src/services/priceService.ts +61 -22
  106. package/src/services/utils.ts +56 -56
  107. package/src/setup.ts +8 -8
  108. package/src/spark/index.ts +461 -461
  109. package/src/staking/staking.ts +220 -220
  110. package/src/types/aave.ts +270 -270
  111. package/src/types/chickenBonds.ts +45 -45
  112. package/src/types/common.ts +84 -84
  113. package/src/types/compound.ts +131 -129
  114. package/src/types/contracts/generated/CUSDSv3.ts +685 -0
  115. package/src/types/contracts/generated/CWstETHv3.ts +685 -0
  116. package/src/types/contracts/generated/DFSFeedRegistry.ts +77 -0
  117. package/src/types/contracts/generated/WstETHPriceFeed.ts +59 -0
  118. package/src/types/contracts/generated/index.ts +4 -0
  119. package/src/types/curveUsd.ts +118 -118
  120. package/src/types/euler.ts +171 -171
  121. package/src/types/index.ts +9 -9
  122. package/src/types/liquity.ts +30 -30
  123. package/src/types/llamaLend.ts +155 -155
  124. package/src/types/maker.ts +50 -50
  125. package/src/types/morphoBlue.ts +189 -185
  126. package/src/types/spark.ts +131 -131
@@ -0,0 +1,77 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import type BN from "bn.js";
6
+ import type { ContractOptions } from "web3-eth-contract";
7
+ import type { EventLog } from "web3-core";
8
+ import type { EventEmitter } from "events";
9
+ import type {
10
+ Callback,
11
+ PayableTransactionObject,
12
+ NonPayableTransactionObject,
13
+ BlockType,
14
+ ContractEventLog,
15
+ BaseContract,
16
+ } from "./types";
17
+
18
+ export interface EventOptions {
19
+ filter?: object;
20
+ fromBlock?: BlockType;
21
+ topics?: string[];
22
+ }
23
+
24
+ export interface DFSFeedRegistry extends BaseContract {
25
+ constructor(
26
+ jsonInterface: any[],
27
+ address?: string,
28
+ options?: ContractOptions
29
+ ): DFSFeedRegistry;
30
+ clone(): DFSFeedRegistry;
31
+ methods: {
32
+ adminVault(): NonPayableTransactionObject<string>;
33
+
34
+ aggregators(
35
+ arg0: string,
36
+ arg1: string
37
+ ): NonPayableTransactionObject<string>;
38
+
39
+ getFeed(base: string, quote: string): NonPayableTransactionObject<string>;
40
+
41
+ kill(): NonPayableTransactionObject<void>;
42
+
43
+ latestRoundData(
44
+ base: string,
45
+ quote: string
46
+ ): NonPayableTransactionObject<
47
+ [string, string, string, string, string] & {
48
+ roundId: string;
49
+ answer: string;
50
+ startedAt: string;
51
+ updatedAt: string;
52
+ answeredInRound: string;
53
+ }
54
+ >;
55
+
56
+ setFeed(
57
+ base: string,
58
+ quote: string,
59
+ aggregator: string
60
+ ): NonPayableTransactionObject<void>;
61
+
62
+ setFeeds(
63
+ bases: string[],
64
+ quotes: string[],
65
+ aggregator: string[]
66
+ ): NonPayableTransactionObject<void>;
67
+
68
+ withdrawStuckFunds(
69
+ _token: string,
70
+ _receiver: string,
71
+ _amount: number | string | BN
72
+ ): NonPayableTransactionObject<void>;
73
+ };
74
+ events: {
75
+ allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
76
+ };
77
+ }
@@ -0,0 +1,59 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import type BN from "bn.js";
6
+ import type { ContractOptions } from "web3-eth-contract";
7
+ import type { EventLog } from "web3-core";
8
+ import type { EventEmitter } from "events";
9
+ import type {
10
+ Callback,
11
+ PayableTransactionObject,
12
+ NonPayableTransactionObject,
13
+ BlockType,
14
+ ContractEventLog,
15
+ BaseContract,
16
+ } from "./types";
17
+
18
+ export interface EventOptions {
19
+ filter?: object;
20
+ fromBlock?: BlockType;
21
+ topics?: string[];
22
+ }
23
+
24
+ export interface WstETHPriceFeed extends BaseContract {
25
+ constructor(
26
+ jsonInterface: any[],
27
+ address?: string,
28
+ options?: ContractOptions
29
+ ): WstETHPriceFeed;
30
+ clone(): WstETHPriceFeed;
31
+ methods: {
32
+ decimals(): NonPayableTransactionObject<string>;
33
+
34
+ description(): NonPayableTransactionObject<string>;
35
+
36
+ latestRoundData(): NonPayableTransactionObject<
37
+ [string, string, string, string, string] & {
38
+ roundId: string;
39
+ answer: string;
40
+ startedAt: string;
41
+ updatedAt: string;
42
+ answeredInRound: string;
43
+ }
44
+ >;
45
+
46
+ stETHToETHPriceFeedDecimals(): NonPayableTransactionObject<string>;
47
+
48
+ stETHtoETHPriceFeed(): NonPayableTransactionObject<string>;
49
+
50
+ version(): NonPayableTransactionObject<string>;
51
+
52
+ wstETH(): NonPayableTransactionObject<string>;
53
+
54
+ wstETHScale(): NonPayableTransactionObject<string>;
55
+ };
56
+ events: {
57
+ allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
58
+ };
59
+ }
@@ -27,6 +27,7 @@ export type { CompV3BulkerMainnetUSDC } from "./CompV3BulkerMainnetUSDC";
27
27
  export type { CompV3View } from "./CompV3View";
28
28
  export type { CompoundLoanInfo } from "./CompoundLoanInfo";
29
29
  export type { Comptroller } from "./Comptroller";
30
+ export type { DFSFeedRegistry } from "./DFSFeedRegistry";
30
31
  export type { ETHPriceFeed } from "./ETHPriceFeed";
31
32
  export type { Erc20 } from "./Erc20";
32
33
  export type { EulerV2View } from "./EulerV2View";
@@ -61,11 +62,14 @@ export type { SparkView } from "./SparkView";
61
62
  export type { TroveManager } from "./TroveManager";
62
63
  export type { USDCPriceFeed } from "./USDCPriceFeed";
63
64
  export type { UniMulticall } from "./UniMulticall";
65
+ export type { WstETHPriceFeed } from "./WstETHPriceFeed";
64
66
  export type { CETHv3 } from "./CETHv3";
65
67
  export type { CUSDCev3 } from "./CUSDCev3";
66
68
  export type { CUSDCv3 } from "./CUSDCv3";
69
+ export type { CUSDSv3 } from "./CUSDSv3";
67
70
  export type { CUSDTv3 } from "./CUSDTv3";
68
71
  export type { CUSDbCv3 } from "./CUSDbCv3";
72
+ export type { CWstETHv3 } from "./CWstETHv3";
69
73
  export type { CrvUSDETHAmm } from "./CrvUSDETHAmm";
70
74
  export type { CrvUSDETHController } from "./CrvUSDETHController";
71
75
  export type { CrvUSDFactory } from "./CrvUSDFactory";
@@ -1,119 +1,119 @@
1
- import { NetworkNumber } from './common';
2
-
3
- export enum CrvUSDVersions {
4
- 'crvUSDwstETH' = 'wstETH',
5
- 'crvUSDWBTC' = 'WBTC',
6
- 'crvUSDETH' = 'ETH',
7
- 'crvUSDtBTC' = 'tBTC',
8
- 'crvUSDsfrxETH' = 'sfrxETH',
9
- }
10
-
11
- export enum CrvUSDStatus {
12
- Nonexistant = 'Nonexistant',
13
- Safe = 'Safe',
14
- Risk = 'Risk',
15
- SoftLiquidating = 'SoftLiquidating',
16
- SoftLiquidated = 'SoftLiquidated',
17
- }
18
-
19
- export interface CrvUSDMarketData {
20
- chainIds: NetworkNumber[],
21
- label: string,
22
- shortLabel: string,
23
- value: CrvUSDVersions,
24
- collAsset: string,
25
- baseAsset: string,
26
- controllerAddress: string,
27
- ammAddress: string,
28
- createCollAssets: string[],
29
- }
30
-
31
- export interface BandData {
32
- id: string,
33
- collAmount: string,
34
- debtAmount: string,
35
- lowPrice: string,
36
- highPrice: string,
37
- }
38
-
39
- export interface UserBandData {
40
- id: string,
41
- collAmount: string,
42
- debtAmount: string,
43
- lowPrice: string,
44
- highPrice: string,
45
- userDebtAmount: string,
46
- userCollAmount: string,
47
- }
48
-
49
- export interface CrvUSDGlobalMarketData {
50
- collateral: string,
51
- decimals: string,
52
- activeBand: string,
53
- totalDebt: string,
54
- ammPrice: string,
55
- basePrice: string,
56
- oraclePrice: string,
57
- minted: string,
58
- redeemed: string,
59
- monetaryPolicyRate: string,
60
- ammRate: string,
61
- minBand: string,
62
- maxBand: string,
63
- debtCeiling: string,
64
- borrowRate: string,
65
- futureBorrowRate: string,
66
- leftToBorrow: string,
67
- bands: BandData[],
68
- }
69
-
70
- export interface CrvUSDAggregatedPositionData {
71
- ratio: string,
72
- supplied: string,
73
- suppliedUsd: string,
74
- borrowedUsd: string,
75
- borrowed: string,
76
- safetyRatio: string,
77
- borrowLimitUsd: string,
78
- minAllowedRatio: number,
79
- collFactor: string,
80
- leveragedType: string,
81
- leveragedAsset?: string,
82
- liquidationPrice?: string,
83
- }
84
-
85
- export interface CrvUSDUsedAsset {
86
- isSupplied: boolean,
87
- supplied: string,
88
- suppliedUsd: string,
89
- borrowed: string,
90
- borrowedUsd: string,
91
- isBorrowed: boolean,
92
- symbol: string,
93
- collateral: boolean,
94
- price: string,
95
- interestRate?: string,
96
- }
97
-
98
- export interface CrvUSDUsedAssets {
99
- [key: string]: CrvUSDUsedAsset,
100
- }
101
-
102
- export interface CrvUSDUserData {
103
- debtAmount: string,
104
- health: string,
105
- healthPercent: string,
106
- priceHigh: string,
107
- priceLow: string,
108
- liquidationDiscount: string,
109
- numOfBands: string,
110
- usedAssets: CrvUSDUsedAssets,
111
- status: CrvUSDStatus,
112
- ratio: string,
113
- supplied: string,
114
- suppliedUsd: string,
115
- borrowedUsd: string,
116
- borrowed: string,
117
- safetyRatio: string,
118
- userBands: UserBandData[],
1
+ import { NetworkNumber } from './common';
2
+
3
+ export enum CrvUSDVersions {
4
+ 'crvUSDwstETH' = 'wstETH',
5
+ 'crvUSDWBTC' = 'WBTC',
6
+ 'crvUSDETH' = 'ETH',
7
+ 'crvUSDtBTC' = 'tBTC',
8
+ 'crvUSDsfrxETH' = 'sfrxETH',
9
+ }
10
+
11
+ export enum CrvUSDStatus {
12
+ Nonexistant = 'Nonexistant',
13
+ Safe = 'Safe',
14
+ Risk = 'Risk',
15
+ SoftLiquidating = 'SoftLiquidating',
16
+ SoftLiquidated = 'SoftLiquidated',
17
+ }
18
+
19
+ export interface CrvUSDMarketData {
20
+ chainIds: NetworkNumber[],
21
+ label: string,
22
+ shortLabel: string,
23
+ value: CrvUSDVersions,
24
+ collAsset: string,
25
+ baseAsset: string,
26
+ controllerAddress: string,
27
+ ammAddress: string,
28
+ createCollAssets: string[],
29
+ }
30
+
31
+ export interface BandData {
32
+ id: string,
33
+ collAmount: string,
34
+ debtAmount: string,
35
+ lowPrice: string,
36
+ highPrice: string,
37
+ }
38
+
39
+ export interface UserBandData {
40
+ id: string,
41
+ collAmount: string,
42
+ debtAmount: string,
43
+ lowPrice: string,
44
+ highPrice: string,
45
+ userDebtAmount: string,
46
+ userCollAmount: string,
47
+ }
48
+
49
+ export interface CrvUSDGlobalMarketData {
50
+ collateral: string,
51
+ decimals: string,
52
+ activeBand: string,
53
+ totalDebt: string,
54
+ ammPrice: string,
55
+ basePrice: string,
56
+ oraclePrice: string,
57
+ minted: string,
58
+ redeemed: string,
59
+ monetaryPolicyRate: string,
60
+ ammRate: string,
61
+ minBand: string,
62
+ maxBand: string,
63
+ debtCeiling: string,
64
+ borrowRate: string,
65
+ futureBorrowRate: string,
66
+ leftToBorrow: string,
67
+ bands: BandData[],
68
+ }
69
+
70
+ export interface CrvUSDAggregatedPositionData {
71
+ ratio: string,
72
+ supplied: string,
73
+ suppliedUsd: string,
74
+ borrowedUsd: string,
75
+ borrowed: string,
76
+ safetyRatio: string,
77
+ borrowLimitUsd: string,
78
+ minAllowedRatio: number,
79
+ collFactor: string,
80
+ leveragedType: string,
81
+ leveragedAsset?: string,
82
+ liquidationPrice?: string,
83
+ }
84
+
85
+ export interface CrvUSDUsedAsset {
86
+ isSupplied: boolean,
87
+ supplied: string,
88
+ suppliedUsd: string,
89
+ borrowed: string,
90
+ borrowedUsd: string,
91
+ isBorrowed: boolean,
92
+ symbol: string,
93
+ collateral: boolean,
94
+ price: string,
95
+ interestRate?: string,
96
+ }
97
+
98
+ export interface CrvUSDUsedAssets {
99
+ [key: string]: CrvUSDUsedAsset,
100
+ }
101
+
102
+ export interface CrvUSDUserData {
103
+ debtAmount: string,
104
+ health: string,
105
+ healthPercent: string,
106
+ priceHigh: string,
107
+ priceLow: string,
108
+ liquidationDiscount: string,
109
+ numOfBands: string,
110
+ usedAssets: CrvUSDUsedAssets,
111
+ status: CrvUSDStatus,
112
+ ratio: string,
113
+ supplied: string,
114
+ suppliedUsd: string,
115
+ borrowedUsd: string,
116
+ borrowed: string,
117
+ safetyRatio: string,
118
+ userBands: UserBandData[],
119
119
  }