@defisaver/positions-sdk 2.0.12 → 2.0.13
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.
- package/.mocharc.json +4 -4
- package/.nvmrc +1 -1
- package/README.md +64 -64
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/package.json +47 -47
- package/src/aaveV2/index.ts +236 -236
- package/src/aaveV3/index.ts +488 -488
- package/src/compoundV2/index.ts +240 -240
- package/src/compoundV3/index.ts +270 -270
- package/src/config/contracts.ts +1107 -1107
- package/src/constants/index.ts +6 -6
- package/src/contracts.ts +107 -107
- package/src/curveUsd/index.ts +250 -250
- package/src/eulerV2/index.ts +314 -314
- package/src/exchange/index.ts +25 -25
- package/src/fluid/index.ts +1568 -1568
- package/src/helpers/aaveHelpers/index.ts +170 -170
- package/src/helpers/compoundHelpers/index.ts +261 -261
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +259 -259
- package/src/helpers/fluidHelpers/index.ts +324 -324
- package/src/helpers/index.ts +10 -10
- package/src/helpers/liquityV2Helpers/index.ts +80 -80
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +52 -52
- package/src/helpers/morphoBlueHelpers/index.ts +390 -390
- package/src/helpers/sparkHelpers/index.ts +155 -155
- package/src/index.ts +45 -45
- package/src/liquity/index.ts +104 -104
- package/src/liquityV2/index.ts +408 -408
- package/src/llamaLend/index.ts +296 -296
- package/src/maker/index.ts +223 -223
- package/src/markets/aave/index.ts +116 -116
- package/src/markets/aave/marketAssets.ts +49 -49
- package/src/markets/compound/index.ts +227 -227
- package/src/markets/compound/marketsAssets.ts +90 -90
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/fluid/index.ts +2456 -2456
- package/src/markets/index.ts +25 -25
- package/src/markets/liquityV2/index.ts +102 -102
- package/src/markets/llamaLend/contractAddresses.ts +141 -141
- package/src/markets/llamaLend/index.ts +235 -235
- package/src/markets/morphoBlue/index.ts +895 -895
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +11 -11
- package/src/moneymarket/moneymarketCommonService.ts +80 -80
- package/src/morphoBlue/index.ts +222 -222
- package/src/portfolio/index.ts +285 -285
- package/src/services/priceService.ts +159 -159
- package/src/services/utils.ts +63 -63
- package/src/services/viem.ts +32 -32
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +456 -456
- package/src/staking/staking.ts +193 -193
- package/src/types/aave.ts +194 -194
- package/src/types/common.ts +88 -88
- package/src/types/compound.ts +136 -136
- package/src/types/curveUsd.ts +121 -121
- package/src/types/euler.ts +174 -174
- package/src/types/fluid.ts +450 -450
- package/src/types/index.ts +11 -11
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +126 -126
- package/src/types/llamaLend.ts +157 -157
- package/src/types/maker.ts +63 -63
- package/src/types/morphoBlue.ts +194 -194
- package/src/types/portfolio.ts +60 -60
- package/src/types/spark.ts +137 -137
package/src/types/aave.ts
CHANGED
|
@@ -1,194 +1,194 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
|
|
3
|
-
} from './common';
|
|
4
|
-
|
|
5
|
-
export enum AaveVersions {
|
|
6
|
-
AaveV1 = 'v1',
|
|
7
|
-
AaveV2 = 'v2default',
|
|
8
|
-
AaveV3 = 'v3default',
|
|
9
|
-
AaveV3Lido = 'v3lido',
|
|
10
|
-
AaveV3Etherfi = 'v3etherfi',
|
|
11
|
-
}
|
|
12
|
-
export type AaveMarketInfo = {
|
|
13
|
-
chainIds: NetworkNumber[],
|
|
14
|
-
label: string,
|
|
15
|
-
shortLabel: string,
|
|
16
|
-
url: string,
|
|
17
|
-
value: AaveVersions,
|
|
18
|
-
assets: readonly string[],
|
|
19
|
-
provider: '' | 'LendingPoolAddressesProvider' | 'AaveV3PoolAddressesProvider' | 'AaveV3LidoPoolAddressesProvider' | 'AaveV3EtherfiPoolAddressesProvider',
|
|
20
|
-
providerAddress: `0x${string}`,
|
|
21
|
-
lendingPool: '' | 'AaveLendingPoolV2' | 'AaveV3LendingPool' | 'AaveV3LidoLendingPool' | 'AaveV3EtherfiLendingPool',
|
|
22
|
-
lendingPoolAddress: string,
|
|
23
|
-
protocolData: '' | 'AaveProtocolDataProvider' | 'AaveV3ProtocolDataProvider' | 'AaveV3LidoProtocolDataProvider' | 'AaveV3EtherfiProtocolDataProvider',
|
|
24
|
-
protocolDataAddress: string
|
|
25
|
-
subVersionLabel?: string
|
|
26
|
-
protocolName: string,
|
|
27
|
-
disabled?: boolean,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export interface EModeCategoryData {
|
|
31
|
-
label: string,
|
|
32
|
-
id: number,
|
|
33
|
-
liquidationBonus: string,
|
|
34
|
-
liquidationRatio: string,
|
|
35
|
-
collateralFactor: string,
|
|
36
|
-
borrowableBitmap?: string,
|
|
37
|
-
collateralBitmap?: string,
|
|
38
|
-
collateralAssets: string[],
|
|
39
|
-
borrowAssets: string[],
|
|
40
|
-
}
|
|
41
|
-
export interface EModeCategoryDataMapping {
|
|
42
|
-
enteringTerms: boolean[],
|
|
43
|
-
canEnterCategory: boolean,
|
|
44
|
-
id: number,
|
|
45
|
-
enabledData: {
|
|
46
|
-
ratio: string,
|
|
47
|
-
liqRatio: string,
|
|
48
|
-
liqPercent: string,
|
|
49
|
-
collRatio: string,
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface AaveAssetData extends MMAssetData {
|
|
54
|
-
sortIndex?: number,
|
|
55
|
-
isIsolated?: boolean,
|
|
56
|
-
usageAsCollateralEnabled: boolean,
|
|
57
|
-
isInactive: boolean,
|
|
58
|
-
canBeWithdrawn: boolean,
|
|
59
|
-
canBePayBacked: boolean,
|
|
60
|
-
liquidationRatio: string,
|
|
61
|
-
supplyCap: string,
|
|
62
|
-
disabledStableBorrowing: boolean,
|
|
63
|
-
borrowRateStable: string,
|
|
64
|
-
totalBorrowVar: string,
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
export interface AaveV2AssetData extends AaveAssetData {
|
|
69
|
-
priceInEth: string,
|
|
70
|
-
isFrozen: boolean,
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface IncentiveData {
|
|
74
|
-
token: string,
|
|
75
|
-
apy: string,
|
|
76
|
-
incentiveKind?: 'staking' | 'reward';
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface AaveV3AssetData extends AaveAssetData {
|
|
80
|
-
isIsolated: boolean,
|
|
81
|
-
isSiloed: boolean,
|
|
82
|
-
debtCeilingForIsolationMode: string,
|
|
83
|
-
isolationModeTotalDebt: string,
|
|
84
|
-
isolationModeBorrowingEnabled: boolean,
|
|
85
|
-
supplyRateP2P?: string,
|
|
86
|
-
borrowRateP2P?: string,
|
|
87
|
-
isFrozen: boolean,
|
|
88
|
-
isPaused: boolean,
|
|
89
|
-
isFlashLoanEnabled: boolean,
|
|
90
|
-
assetId: string | number | null,
|
|
91
|
-
liquidationBonus: string,
|
|
92
|
-
supplyIncentives?: IncentiveData[];
|
|
93
|
-
borrowIncentives?: IncentiveData[];
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export type EModeCategoriesData = Record<number, EModeCategoryData>;
|
|
97
|
-
|
|
98
|
-
export type AaveAssetsData<T> = { [key: string]: T };
|
|
99
|
-
|
|
100
|
-
export type AaveV2AssetsData = AaveAssetsData<AaveV2AssetData>;
|
|
101
|
-
|
|
102
|
-
export type AaveV2MarketData = { assetsData: AaveV2AssetsData };
|
|
103
|
-
|
|
104
|
-
export type AaveV3AssetsData = AaveAssetsData<AaveV3AssetData>;
|
|
105
|
-
|
|
106
|
-
export type AaveV3MarketData = { assetsData: AaveV3AssetsData, eModeCategoriesData: EModeCategoriesData };
|
|
107
|
-
|
|
108
|
-
export interface AaveUsedAsset extends MMUsedAsset {
|
|
109
|
-
stableBorrowRate: string,
|
|
110
|
-
borrowedStable: string,
|
|
111
|
-
borrowedVariable: string,
|
|
112
|
-
borrowedUsdStable: string,
|
|
113
|
-
borrowedUsdVariable: string,
|
|
114
|
-
stableLimit: string,
|
|
115
|
-
variableLimit: string,
|
|
116
|
-
limit: string,
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export interface AaveV2UsedAsset extends AaveUsedAsset {
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export interface AaveV3UsedAsset extends AaveUsedAsset {
|
|
123
|
-
supplyRate: string,
|
|
124
|
-
borrowRate: string,
|
|
125
|
-
interestMode: string,
|
|
126
|
-
collateral: boolean,
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export type AaveUsedAssets<T> = { [key: string]: T };
|
|
130
|
-
|
|
131
|
-
export type AaveV2UsedAssets = AaveUsedAssets<AaveV2UsedAsset>;
|
|
132
|
-
|
|
133
|
-
export type AaveV3UsedAssets = AaveUsedAssets<AaveV3UsedAsset>;
|
|
134
|
-
|
|
135
|
-
export interface AavePositionData extends MMPositionData {
|
|
136
|
-
ratio: string,
|
|
137
|
-
minRatio: string,
|
|
138
|
-
collRatio: string,
|
|
139
|
-
suppliedUsd: string,
|
|
140
|
-
borrowedUsd: string,
|
|
141
|
-
borrowLimitUsd: string,
|
|
142
|
-
suppliedCollateralUsd: string,
|
|
143
|
-
incentiveUsd: string,
|
|
144
|
-
totalInterestUsd: string,
|
|
145
|
-
isSubscribedToAutomation?: boolean,
|
|
146
|
-
automationResubscribeRequired?: boolean,
|
|
147
|
-
totalSupplied: string,
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export interface AaveV2PositionData extends AavePositionData {
|
|
151
|
-
usedAssets: AaveV2UsedAssets,
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export interface AaveV3PositionData extends AavePositionData {
|
|
155
|
-
usedAssets: AaveV3UsedAssets,
|
|
156
|
-
eModeCategory: number,
|
|
157
|
-
isInIsolationMode: boolean,
|
|
158
|
-
isInSiloedMode: boolean,
|
|
159
|
-
eModeCategories: { [key: number]: EModeCategoryDataMapping },
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export interface AaveV3AggregatedPositionData {
|
|
163
|
-
suppliedUsd: string,
|
|
164
|
-
suppliedCollateralUsd: string,
|
|
165
|
-
borrowedUsd: string,
|
|
166
|
-
borrowLimitUsd: string,
|
|
167
|
-
liquidationLimitUsd: string,
|
|
168
|
-
leftToBorrowUsd: string,
|
|
169
|
-
ratio: string,
|
|
170
|
-
collRatio: string,
|
|
171
|
-
netApy: string,
|
|
172
|
-
incentiveUsd: string,
|
|
173
|
-
totalInterestUsd: string,
|
|
174
|
-
liqRatio: string,
|
|
175
|
-
liqPercent: string,
|
|
176
|
-
leveragedType: string,
|
|
177
|
-
leveragedAsset?: string,
|
|
178
|
-
leveragedLsdAssetRatio?: string,
|
|
179
|
-
liquidationPrice?: string,
|
|
180
|
-
minCollRatio?: string,
|
|
181
|
-
collLiquidationRatio?: string,
|
|
182
|
-
healthRatio?: string,
|
|
183
|
-
minHealthRatio?: string,
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export interface AaveHelperCommon {
|
|
187
|
-
usedAssets: any,
|
|
188
|
-
eModeCategory: number,
|
|
189
|
-
eModeCategories?: { [key: number]: EModeCategoryDataMapping },
|
|
190
|
-
eModeCategoriesData?: EModeCategoriesData,
|
|
191
|
-
assetsData: any,
|
|
192
|
-
selectedMarket: Partial<AaveMarketInfo>,
|
|
193
|
-
network?: NetworkNumber,
|
|
194
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
|
|
3
|
+
} from './common';
|
|
4
|
+
|
|
5
|
+
export enum AaveVersions {
|
|
6
|
+
AaveV1 = 'v1',
|
|
7
|
+
AaveV2 = 'v2default',
|
|
8
|
+
AaveV3 = 'v3default',
|
|
9
|
+
AaveV3Lido = 'v3lido',
|
|
10
|
+
AaveV3Etherfi = 'v3etherfi',
|
|
11
|
+
}
|
|
12
|
+
export type AaveMarketInfo = {
|
|
13
|
+
chainIds: NetworkNumber[],
|
|
14
|
+
label: string,
|
|
15
|
+
shortLabel: string,
|
|
16
|
+
url: string,
|
|
17
|
+
value: AaveVersions,
|
|
18
|
+
assets: readonly string[],
|
|
19
|
+
provider: '' | 'LendingPoolAddressesProvider' | 'AaveV3PoolAddressesProvider' | 'AaveV3LidoPoolAddressesProvider' | 'AaveV3EtherfiPoolAddressesProvider',
|
|
20
|
+
providerAddress: `0x${string}`,
|
|
21
|
+
lendingPool: '' | 'AaveLendingPoolV2' | 'AaveV3LendingPool' | 'AaveV3LidoLendingPool' | 'AaveV3EtherfiLendingPool',
|
|
22
|
+
lendingPoolAddress: string,
|
|
23
|
+
protocolData: '' | 'AaveProtocolDataProvider' | 'AaveV3ProtocolDataProvider' | 'AaveV3LidoProtocolDataProvider' | 'AaveV3EtherfiProtocolDataProvider',
|
|
24
|
+
protocolDataAddress: string
|
|
25
|
+
subVersionLabel?: string
|
|
26
|
+
protocolName: string,
|
|
27
|
+
disabled?: boolean,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export interface EModeCategoryData {
|
|
31
|
+
label: string,
|
|
32
|
+
id: number,
|
|
33
|
+
liquidationBonus: string,
|
|
34
|
+
liquidationRatio: string,
|
|
35
|
+
collateralFactor: string,
|
|
36
|
+
borrowableBitmap?: string,
|
|
37
|
+
collateralBitmap?: string,
|
|
38
|
+
collateralAssets: string[],
|
|
39
|
+
borrowAssets: string[],
|
|
40
|
+
}
|
|
41
|
+
export interface EModeCategoryDataMapping {
|
|
42
|
+
enteringTerms: boolean[],
|
|
43
|
+
canEnterCategory: boolean,
|
|
44
|
+
id: number,
|
|
45
|
+
enabledData: {
|
|
46
|
+
ratio: string,
|
|
47
|
+
liqRatio: string,
|
|
48
|
+
liqPercent: string,
|
|
49
|
+
collRatio: string,
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface AaveAssetData extends MMAssetData {
|
|
54
|
+
sortIndex?: number,
|
|
55
|
+
isIsolated?: boolean,
|
|
56
|
+
usageAsCollateralEnabled: boolean,
|
|
57
|
+
isInactive: boolean,
|
|
58
|
+
canBeWithdrawn: boolean,
|
|
59
|
+
canBePayBacked: boolean,
|
|
60
|
+
liquidationRatio: string,
|
|
61
|
+
supplyCap: string,
|
|
62
|
+
disabledStableBorrowing: boolean,
|
|
63
|
+
borrowRateStable: string,
|
|
64
|
+
totalBorrowVar: string,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
export interface AaveV2AssetData extends AaveAssetData {
|
|
69
|
+
priceInEth: string,
|
|
70
|
+
isFrozen: boolean,
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface IncentiveData {
|
|
74
|
+
token: string,
|
|
75
|
+
apy: string,
|
|
76
|
+
incentiveKind?: 'staking' | 'reward';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface AaveV3AssetData extends AaveAssetData {
|
|
80
|
+
isIsolated: boolean,
|
|
81
|
+
isSiloed: boolean,
|
|
82
|
+
debtCeilingForIsolationMode: string,
|
|
83
|
+
isolationModeTotalDebt: string,
|
|
84
|
+
isolationModeBorrowingEnabled: boolean,
|
|
85
|
+
supplyRateP2P?: string,
|
|
86
|
+
borrowRateP2P?: string,
|
|
87
|
+
isFrozen: boolean,
|
|
88
|
+
isPaused: boolean,
|
|
89
|
+
isFlashLoanEnabled: boolean,
|
|
90
|
+
assetId: string | number | null,
|
|
91
|
+
liquidationBonus: string,
|
|
92
|
+
supplyIncentives?: IncentiveData[];
|
|
93
|
+
borrowIncentives?: IncentiveData[];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type EModeCategoriesData = Record<number, EModeCategoryData>;
|
|
97
|
+
|
|
98
|
+
export type AaveAssetsData<T> = { [key: string]: T };
|
|
99
|
+
|
|
100
|
+
export type AaveV2AssetsData = AaveAssetsData<AaveV2AssetData>;
|
|
101
|
+
|
|
102
|
+
export type AaveV2MarketData = { assetsData: AaveV2AssetsData };
|
|
103
|
+
|
|
104
|
+
export type AaveV3AssetsData = AaveAssetsData<AaveV3AssetData>;
|
|
105
|
+
|
|
106
|
+
export type AaveV3MarketData = { assetsData: AaveV3AssetsData, eModeCategoriesData: EModeCategoriesData };
|
|
107
|
+
|
|
108
|
+
export interface AaveUsedAsset extends MMUsedAsset {
|
|
109
|
+
stableBorrowRate: string,
|
|
110
|
+
borrowedStable: string,
|
|
111
|
+
borrowedVariable: string,
|
|
112
|
+
borrowedUsdStable: string,
|
|
113
|
+
borrowedUsdVariable: string,
|
|
114
|
+
stableLimit: string,
|
|
115
|
+
variableLimit: string,
|
|
116
|
+
limit: string,
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface AaveV2UsedAsset extends AaveUsedAsset {
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface AaveV3UsedAsset extends AaveUsedAsset {
|
|
123
|
+
supplyRate: string,
|
|
124
|
+
borrowRate: string,
|
|
125
|
+
interestMode: string,
|
|
126
|
+
collateral: boolean,
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export type AaveUsedAssets<T> = { [key: string]: T };
|
|
130
|
+
|
|
131
|
+
export type AaveV2UsedAssets = AaveUsedAssets<AaveV2UsedAsset>;
|
|
132
|
+
|
|
133
|
+
export type AaveV3UsedAssets = AaveUsedAssets<AaveV3UsedAsset>;
|
|
134
|
+
|
|
135
|
+
export interface AavePositionData extends MMPositionData {
|
|
136
|
+
ratio: string,
|
|
137
|
+
minRatio: string,
|
|
138
|
+
collRatio: string,
|
|
139
|
+
suppliedUsd: string,
|
|
140
|
+
borrowedUsd: string,
|
|
141
|
+
borrowLimitUsd: string,
|
|
142
|
+
suppliedCollateralUsd: string,
|
|
143
|
+
incentiveUsd: string,
|
|
144
|
+
totalInterestUsd: string,
|
|
145
|
+
isSubscribedToAutomation?: boolean,
|
|
146
|
+
automationResubscribeRequired?: boolean,
|
|
147
|
+
totalSupplied: string,
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface AaveV2PositionData extends AavePositionData {
|
|
151
|
+
usedAssets: AaveV2UsedAssets,
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface AaveV3PositionData extends AavePositionData {
|
|
155
|
+
usedAssets: AaveV3UsedAssets,
|
|
156
|
+
eModeCategory: number,
|
|
157
|
+
isInIsolationMode: boolean,
|
|
158
|
+
isInSiloedMode: boolean,
|
|
159
|
+
eModeCategories: { [key: number]: EModeCategoryDataMapping },
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface AaveV3AggregatedPositionData {
|
|
163
|
+
suppliedUsd: string,
|
|
164
|
+
suppliedCollateralUsd: string,
|
|
165
|
+
borrowedUsd: string,
|
|
166
|
+
borrowLimitUsd: string,
|
|
167
|
+
liquidationLimitUsd: string,
|
|
168
|
+
leftToBorrowUsd: string,
|
|
169
|
+
ratio: string,
|
|
170
|
+
collRatio: string,
|
|
171
|
+
netApy: string,
|
|
172
|
+
incentiveUsd: string,
|
|
173
|
+
totalInterestUsd: string,
|
|
174
|
+
liqRatio: string,
|
|
175
|
+
liqPercent: string,
|
|
176
|
+
leveragedType: string,
|
|
177
|
+
leveragedAsset?: string,
|
|
178
|
+
leveragedLsdAssetRatio?: string,
|
|
179
|
+
liquidationPrice?: string,
|
|
180
|
+
minCollRatio?: string,
|
|
181
|
+
collLiquidationRatio?: string,
|
|
182
|
+
healthRatio?: string,
|
|
183
|
+
minHealthRatio?: string,
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface AaveHelperCommon {
|
|
187
|
+
usedAssets: any,
|
|
188
|
+
eModeCategory: number,
|
|
189
|
+
eModeCategories?: { [key: number]: EModeCategoryDataMapping },
|
|
190
|
+
eModeCategoriesData?: EModeCategoriesData,
|
|
191
|
+
assetsData: any,
|
|
192
|
+
selectedMarket: Partial<AaveMarketInfo>,
|
|
193
|
+
network?: NetworkNumber,
|
|
194
|
+
}
|
package/src/types/common.ts
CHANGED
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
// General
|
|
2
|
-
export type EthAddress = HexString;
|
|
3
|
-
export type Blockish = number | 'latest';
|
|
4
|
-
export type AssetSymbol = string;
|
|
5
|
-
export type Amount = string | number;
|
|
6
|
-
|
|
7
|
-
export enum NetworkNumber {
|
|
8
|
-
Eth = 1,
|
|
9
|
-
Opt = 10,
|
|
10
|
-
Arb = 42161,
|
|
11
|
-
Base = 8453,
|
|
12
|
-
Linea = 59144,
|
|
13
|
-
}
|
|
14
|
-
export type Networkish = string | NetworkNumber;
|
|
15
|
-
|
|
16
|
-
// Common
|
|
17
|
-
export interface MMAssetData {
|
|
18
|
-
symbol: string,
|
|
19
|
-
supplyRate: string,
|
|
20
|
-
borrowRate: string,
|
|
21
|
-
price: string,
|
|
22
|
-
collateralFactor: string,
|
|
23
|
-
underlyingTokenAddress: string,
|
|
24
|
-
marketLiquidity: string,
|
|
25
|
-
utilization: string,
|
|
26
|
-
borrowCap: string,
|
|
27
|
-
totalSupply: string,
|
|
28
|
-
canBeBorrowed: boolean,
|
|
29
|
-
canBeSupplied: boolean,
|
|
30
|
-
totalBorrow: string,
|
|
31
|
-
incentiveBorrowApy?: string,
|
|
32
|
-
incentiveBorrowToken?: string,
|
|
33
|
-
incentiveSupplyApy?: string,
|
|
34
|
-
incentiveSupplyToken?: string,
|
|
35
|
-
borrowRateP2P?: string,
|
|
36
|
-
supplyRateP2P?: string,
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface MMAssetsData {
|
|
40
|
-
[token: string]: MMAssetData,
|
|
41
|
-
}
|
|
42
|
-
export interface MMMarketData {
|
|
43
|
-
assetsData: MMAssetData[],
|
|
44
|
-
}
|
|
45
|
-
export interface MMUsedAsset {
|
|
46
|
-
symbol: string,
|
|
47
|
-
supplied: string,
|
|
48
|
-
suppliedUsd: string,
|
|
49
|
-
isSupplied: boolean,
|
|
50
|
-
borrowed: string,
|
|
51
|
-
borrowedUsd: string,
|
|
52
|
-
isBorrowed: boolean,
|
|
53
|
-
stableBorrowRate?: string,
|
|
54
|
-
debt?: string,
|
|
55
|
-
supplyRate?: string,
|
|
56
|
-
borrowRate?: string,
|
|
57
|
-
interestMode?: string,
|
|
58
|
-
collateral?: boolean,
|
|
59
|
-
}
|
|
60
|
-
export interface MMUsedAssets {
|
|
61
|
-
[token: string]: MMUsedAsset,
|
|
62
|
-
}
|
|
63
|
-
export interface MMUsedAssetWStableB extends MMUsedAsset {
|
|
64
|
-
stableBorrowRate: string,
|
|
65
|
-
borrowedStable: string,
|
|
66
|
-
borrowedVariable: string,
|
|
67
|
-
borrowedUsdStable: string,
|
|
68
|
-
borrowedUsdVariable: string,
|
|
69
|
-
interestMode: string,
|
|
70
|
-
}
|
|
71
|
-
export interface MMPositionData {
|
|
72
|
-
usedAssets: any,
|
|
73
|
-
netApy: string,
|
|
74
|
-
lastUpdated: number,
|
|
75
|
-
// ...
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export type Balances = Record<AssetSymbol, Amount>;
|
|
79
|
-
export interface PositionBalances {
|
|
80
|
-
collateral?: Balances,
|
|
81
|
-
debt?: Balances,
|
|
82
|
-
selling?: Balances,
|
|
83
|
-
deposited?: Balances,
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export type EthereumProvider = { request(...args: any): Promise<any> }; // TODO
|
|
87
|
-
|
|
88
|
-
export type HexString = `0x${string}`;
|
|
1
|
+
// General
|
|
2
|
+
export type EthAddress = HexString;
|
|
3
|
+
export type Blockish = number | 'latest';
|
|
4
|
+
export type AssetSymbol = string;
|
|
5
|
+
export type Amount = string | number;
|
|
6
|
+
|
|
7
|
+
export enum NetworkNumber {
|
|
8
|
+
Eth = 1,
|
|
9
|
+
Opt = 10,
|
|
10
|
+
Arb = 42161,
|
|
11
|
+
Base = 8453,
|
|
12
|
+
Linea = 59144,
|
|
13
|
+
}
|
|
14
|
+
export type Networkish = string | NetworkNumber;
|
|
15
|
+
|
|
16
|
+
// Common
|
|
17
|
+
export interface MMAssetData {
|
|
18
|
+
symbol: string,
|
|
19
|
+
supplyRate: string,
|
|
20
|
+
borrowRate: string,
|
|
21
|
+
price: string,
|
|
22
|
+
collateralFactor: string,
|
|
23
|
+
underlyingTokenAddress: string,
|
|
24
|
+
marketLiquidity: string,
|
|
25
|
+
utilization: string,
|
|
26
|
+
borrowCap: string,
|
|
27
|
+
totalSupply: string,
|
|
28
|
+
canBeBorrowed: boolean,
|
|
29
|
+
canBeSupplied: boolean,
|
|
30
|
+
totalBorrow: string,
|
|
31
|
+
incentiveBorrowApy?: string,
|
|
32
|
+
incentiveBorrowToken?: string,
|
|
33
|
+
incentiveSupplyApy?: string,
|
|
34
|
+
incentiveSupplyToken?: string,
|
|
35
|
+
borrowRateP2P?: string,
|
|
36
|
+
supplyRateP2P?: string,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface MMAssetsData {
|
|
40
|
+
[token: string]: MMAssetData,
|
|
41
|
+
}
|
|
42
|
+
export interface MMMarketData {
|
|
43
|
+
assetsData: MMAssetData[],
|
|
44
|
+
}
|
|
45
|
+
export interface MMUsedAsset {
|
|
46
|
+
symbol: string,
|
|
47
|
+
supplied: string,
|
|
48
|
+
suppliedUsd: string,
|
|
49
|
+
isSupplied: boolean,
|
|
50
|
+
borrowed: string,
|
|
51
|
+
borrowedUsd: string,
|
|
52
|
+
isBorrowed: boolean,
|
|
53
|
+
stableBorrowRate?: string,
|
|
54
|
+
debt?: string,
|
|
55
|
+
supplyRate?: string,
|
|
56
|
+
borrowRate?: string,
|
|
57
|
+
interestMode?: string,
|
|
58
|
+
collateral?: boolean,
|
|
59
|
+
}
|
|
60
|
+
export interface MMUsedAssets {
|
|
61
|
+
[token: string]: MMUsedAsset,
|
|
62
|
+
}
|
|
63
|
+
export interface MMUsedAssetWStableB extends MMUsedAsset {
|
|
64
|
+
stableBorrowRate: string,
|
|
65
|
+
borrowedStable: string,
|
|
66
|
+
borrowedVariable: string,
|
|
67
|
+
borrowedUsdStable: string,
|
|
68
|
+
borrowedUsdVariable: string,
|
|
69
|
+
interestMode: string,
|
|
70
|
+
}
|
|
71
|
+
export interface MMPositionData {
|
|
72
|
+
usedAssets: any,
|
|
73
|
+
netApy: string,
|
|
74
|
+
lastUpdated: number,
|
|
75
|
+
// ...
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type Balances = Record<AssetSymbol, Amount>;
|
|
79
|
+
export interface PositionBalances {
|
|
80
|
+
collateral?: Balances,
|
|
81
|
+
debt?: Balances,
|
|
82
|
+
selling?: Balances,
|
|
83
|
+
deposited?: Balances,
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type EthereumProvider = { request(...args: any): Promise<any> }; // TODO
|
|
87
|
+
|
|
88
|
+
export type HexString = `0x${string}`;
|