@defisaver/positions-sdk 0.0.186 → 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 (78) hide show
  1. package/cjs/compoundV3/index.js +14 -9
  2. package/cjs/config/contracts.d.ts +670 -228
  3. package/cjs/config/contracts.js +41 -5
  4. package/cjs/contracts.d.ts +2 -0
  5. package/cjs/contracts.js +3 -1
  6. package/cjs/helpers/morphoBlueHelpers/index.d.ts +42 -1
  7. package/cjs/helpers/morphoBlueHelpers/index.js +203 -20
  8. package/cjs/markets/compound/index.d.ts +4 -0
  9. package/cjs/markets/compound/index.js +41 -1
  10. package/cjs/markets/compound/marketsAssets.d.ts +14 -0
  11. package/cjs/markets/compound/marketsAssets.js +17 -3
  12. package/cjs/markets/morphoBlue/index.d.ts +8 -0
  13. package/cjs/markets/morphoBlue/index.js +71 -2
  14. package/cjs/morphoBlue/index.js +27 -10
  15. package/cjs/services/priceService.d.ts +3 -0
  16. package/cjs/services/priceService.js +33 -1
  17. package/cjs/types/compound.d.ts +3 -1
  18. package/cjs/types/compound.js +2 -0
  19. package/cjs/types/contracts/generated/CUSDSv3.d.ts +441 -0
  20. package/cjs/types/contracts/generated/CUSDSv3.js +5 -0
  21. package/cjs/types/contracts/generated/CWstETHv3.d.ts +441 -0
  22. package/cjs/types/contracts/generated/CWstETHv3.js +5 -0
  23. package/cjs/types/contracts/generated/DFSFeedRegistry.d.ts +40 -0
  24. package/cjs/types/contracts/generated/DFSFeedRegistry.js +5 -0
  25. package/cjs/types/contracts/generated/MorphoBlueView.d.ts +5 -5
  26. package/cjs/types/contracts/generated/WstETHPriceFeed.d.ts +39 -0
  27. package/cjs/types/contracts/generated/WstETHPriceFeed.js +5 -0
  28. package/cjs/types/contracts/generated/index.d.ts +4 -0
  29. package/cjs/types/morphoBlue.d.ts +37 -1
  30. package/cjs/types/morphoBlue.js +4 -0
  31. package/esm/compoundV3/index.js +15 -10
  32. package/esm/config/contracts.d.ts +670 -228
  33. package/esm/config/contracts.js +41 -5
  34. package/esm/contracts.d.ts +2 -0
  35. package/esm/contracts.js +2 -0
  36. package/esm/helpers/morphoBlueHelpers/index.d.ts +42 -1
  37. package/esm/helpers/morphoBlueHelpers/index.js +200 -20
  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/MorphoBlueView.d.ts +5 -5
  56. package/esm/types/contracts/generated/WstETHPriceFeed.d.ts +39 -0
  57. package/esm/types/contracts/generated/WstETHPriceFeed.js +4 -0
  58. package/esm/types/contracts/generated/index.d.ts +4 -0
  59. package/esm/types/morphoBlue.d.ts +37 -1
  60. package/esm/types/morphoBlue.js +4 -0
  61. package/package.json +2 -2
  62. package/src/compoundV3/index.ts +20 -11
  63. package/src/config/contracts.js +41 -5
  64. package/src/contracts.ts +2 -0
  65. package/src/helpers/morphoBlueHelpers/index.ts +228 -19
  66. package/src/markets/compound/index.ts +42 -2
  67. package/src/markets/compound/marketsAssets.ts +20 -2
  68. package/src/markets/morphoBlue/index.ts +70 -1
  69. package/src/morphoBlue/index.ts +33 -16
  70. package/src/services/priceService.ts +41 -2
  71. package/src/types/compound.ts +2 -0
  72. package/src/types/contracts/generated/CUSDSv3.ts +685 -0
  73. package/src/types/contracts/generated/CWstETHv3.ts +685 -0
  74. package/src/types/contracts/generated/DFSFeedRegistry.ts +77 -0
  75. package/src/types/contracts/generated/MorphoBlueView.ts +9 -5
  76. package/src/types/contracts/generated/WstETHPriceFeed.ts +59 -0
  77. package/src/types/contracts/generated/index.ts +4 -0
  78. package/src/types/morphoBlue.ts +35 -0
@@ -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
+ }
@@ -87,22 +87,19 @@ export type MarketStructOutput = MarketStructOutputArray &
87
87
 
88
88
  export declare namespace MorphoBlueView {
89
89
  export type LiquidityChangeParamsStruct =
90
- | [MarketParamsStruct, boolean, number | string | BN, number | string | BN]
90
+ | [boolean, number | string | BN, number | string | BN]
91
91
  | {
92
- marketParams: MarketParamsStruct;
93
92
  isBorrowOperation: boolean;
94
93
  liquidityAdded: number | string | BN;
95
94
  liquidityRemoved: number | string | BN;
96
95
  };
97
96
 
98
97
  export type LiquidityChangeParamsStructOutputArray = [
99
- MarketParamsStructOutput,
100
98
  boolean,
101
99
  string,
102
100
  string
103
101
  ];
104
102
  export type LiquidityChangeParamsStructOutputStruct = {
105
- marketParams: MarketParamsStructOutput;
106
103
  isBorrowOperation: boolean;
107
104
  liquidityAdded: string;
108
105
  liquidityRemoved: string;
@@ -202,10 +199,17 @@ export interface MorphoBlueView extends BaseContract {
202
199
  ): MorphoBlueView;
203
200
  clone(): MorphoBlueView;
204
201
  methods: {
202
+ LEGACY_MORPHO_TOKEN(): NonPayableTransactionObject<string>;
203
+
205
204
  MORPHO_BLUE_ADDRESS(): NonPayableTransactionObject<string>;
206
205
 
206
+ MORPHO_TOKEN_WRAPPER(): NonPayableTransactionObject<string>;
207
+
208
+ PUBLIC_ALLOCATOR(): NonPayableTransactionObject<string>;
209
+
207
210
  getApyAfterValuesEstimation(
208
- params: MorphoBlueView.LiquidityChangeParamsStruct
211
+ _marketParams: MarketParamsStruct,
212
+ _params: MorphoBlueView.LiquidityChangeParamsStruct[]
209
213
  ): NonPayableTransactionObject<
210
214
  [string, MarketStructOutput] & {
211
215
  borrowRate: string;
@@ -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";
@@ -21,6 +21,7 @@ export enum MorphoBlueVersions {
21
21
  MorphoBlueCbBTCEth_915 = 'morphobluecbbtceth', // cbBTC/Eth
22
22
  MorphoBlueCbBTCUSDC_860 = 'morphobluecbbtcusdc', // cbBTC/USDC
23
23
  MorphoBlueSUSDeUSDC_915 = 'morphobluesusdeusdc_915', // sUSDe/USDC
24
+ MorphoBlueLBTCWBTC_945 = 'morphobluelbtcwbtc_945', // LBTC/WBTC
24
25
  // ezETH/ETH
25
26
  MorphoBlueEzEthEth_860 = 'morphoblueezetheth_860',
26
27
  MorphoBlueEzEthEth_945 = 'morphoblueezetheth_945',
@@ -57,6 +58,9 @@ export enum MorphoBlueVersions {
57
58
  MorphoBlueCbBTCEth_915_Base = 'morphobluecbbtceth_915_base',
58
59
  MorphoBlueCbBTCUSDC_860_Base = 'morphobluecbbtcusdc_860_base',
59
60
  MorphoBlueWsuperOETHbWETH_915_Base = 'morphobluewsuperoethbweth_915_base',
61
+ MorphoBlueLBTCCbBTC_945_Base = 'morphobluelbtccbbtc_945_base', // LBTC/cbBTC
62
+ MorphoBlueWstEthEURC_860_Base = 'morphobluewstetheurc_860_base', // wstETH/EURC
63
+ MorphoBlueCbBTCEURC_860_Base = 'morphobluecbbtceurc_860_base', // cbBTC/EURC
60
64
  }
61
65
 
62
66
  export enum MorphoBlueOracleType {
@@ -152,3 +156,34 @@ export interface MorphoBluePositionData {
152
156
  supplyShares: string,
153
157
  borrowShares: string,
154
158
  }
159
+
160
+ export interface MorphoBlueVault {
161
+ address: string,
162
+ }
163
+
164
+ export interface MorphoBlueAllocationMarket {
165
+ loanAsset: { address: string },
166
+ collateralAsset: { address: string },
167
+ oracle: { address: string },
168
+ irmAddress: string,
169
+ lltv: string,
170
+ uniqueKey: string,
171
+ }
172
+
173
+ export interface MorphoBluePublicAllocatorItem {
174
+ vault: MorphoBlueVault,
175
+ assets: string,
176
+ allocationMarket: MorphoBlueAllocationMarket,
177
+ }
178
+
179
+ export interface MorphoBlueAllocatorMarketState {
180
+ borrowAssets: string,
181
+ supplyAssets: string,
182
+ }
183
+
184
+ export interface MorphoBlueRealloactionMarketData {
185
+ reallocatableLiquidityAssets: string,
186
+ targetBorrowUtilization: string,
187
+ publicAllocatorSharedLiquidity: MorphoBluePublicAllocatorItem[],
188
+ state: MorphoBlueAllocatorMarketState,
189
+ }