@defisaver/positions-sdk 0.0.198 → 0.0.199-dev-2
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 +69 -69
- package/cjs/config/contracts.d.ts +126 -4
- package/cjs/config/contracts.js +14 -0
- package/cjs/contracts.d.ts +1 -0
- package/cjs/contracts.js +2 -1
- package/cjs/helpers/index.d.ts +1 -0
- package/cjs/helpers/index.js +2 -1
- package/cjs/helpers/liquityV2Helpers/index.d.ts +12 -0
- package/cjs/helpers/liquityV2Helpers/index.js +63 -0
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +3 -1
- package/cjs/liquityV2/index.d.ts +18 -0
- package/cjs/liquityV2/index.js +184 -0
- package/cjs/markets/aave/marketAssets.js +2 -4
- package/cjs/markets/index.d.ts +1 -0
- package/cjs/markets/index.js +3 -1
- package/cjs/markets/liquityV2/index.d.ts +10 -0
- package/cjs/markets/liquityV2/index.js +47 -0
- package/cjs/moneymarket/moneymarketCommonService.js +1 -1
- package/cjs/types/contracts/generated/LiquityV2CollSurplusPool.d.ts +64 -0
- package/cjs/types/contracts/generated/LiquityV2CollSurplusPool.js +5 -0
- package/cjs/types/contracts/generated/LiquityV2TroveNFT.d.ts +73 -0
- package/cjs/types/contracts/generated/LiquityV2TroveNFT.js +5 -0
- package/cjs/types/contracts/generated/LiquityV2View.d.ts +244 -0
- package/cjs/types/contracts/generated/LiquityV2View.js +5 -0
- package/cjs/types/contracts/generated/index.d.ts +3 -0
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +1 -0
- package/cjs/types/liquityV2.d.ts +111 -0
- package/cjs/types/liquityV2.js +24 -0
- package/esm/config/contracts.d.ts +126 -4
- package/esm/config/contracts.js +14 -0
- package/esm/contracts.d.ts +1 -0
- package/esm/contracts.js +1 -0
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +1 -0
- package/esm/helpers/liquityV2Helpers/index.d.ts +12 -0
- package/esm/helpers/liquityV2Helpers/index.js +55 -0
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/liquityV2/index.d.ts +18 -0
- package/esm/liquityV2/index.js +173 -0
- package/esm/markets/aave/marketAssets.js +2 -4
- package/esm/markets/index.d.ts +1 -0
- package/esm/markets/index.js +1 -0
- package/esm/markets/liquityV2/index.d.ts +10 -0
- package/esm/markets/liquityV2/index.js +40 -0
- package/esm/moneymarket/moneymarketCommonService.js +1 -1
- package/esm/types/contracts/generated/LiquityV2CollSurplusPool.d.ts +64 -0
- package/esm/types/contracts/generated/LiquityV2CollSurplusPool.js +4 -0
- package/esm/types/contracts/generated/LiquityV2TroveNFT.d.ts +73 -0
- package/esm/types/contracts/generated/LiquityV2TroveNFT.js +4 -0
- package/esm/types/contracts/generated/LiquityV2View.d.ts +244 -0
- package/esm/types/contracts/generated/LiquityV2View.js +4 -0
- package/esm/types/contracts/generated/index.d.ts +3 -0
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/esm/types/liquityV2.d.ts +111 -0
- package/esm/types/liquityV2.js +21 -0
- package/package.json +49 -49
- package/src/aaveV2/index.ts +227 -227
- package/src/aaveV3/index.ts +625 -625
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +220 -220
- package/src/compoundV3/index.ts +291 -291
- package/src/config/contracts.js +1109 -1095
- package/src/constants/index.ts +6 -6
- package/src/contracts.ts +133 -132
- package/src/curveUsd/index.ts +229 -229
- package/src/eulerV2/index.ts +303 -303
- package/src/exchange/index.ts +17 -17
- package/src/helpers/aaveHelpers/index.ts +198 -198
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +246 -246
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +232 -232
- package/src/helpers/index.ts +10 -9
- package/src/helpers/liquityV2Helpers/index.ts +80 -0
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/morphoBlueHelpers/index.ts +365 -365
- package/src/helpers/sparkHelpers/index.ts +150 -150
- package/src/index.ts +50 -48
- package/src/liquity/index.ts +116 -116
- package/src/liquityV2/index.ts +220 -0
- package/src/llamaLend/index.ts +275 -275
- package/src/maker/index.ts +117 -117
- package/src/markets/aave/index.ts +152 -152
- package/src/markets/aave/marketAssets.ts +44 -46
- package/src/markets/compound/index.ts +213 -213
- package/src/markets/compound/marketsAssets.ts +82 -82
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/index.ts +24 -24
- package/src/markets/liquityV2/index.ts +44 -0
- 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 +10 -10
- package/src/moneymarket/moneymarketCommonService.ts +80 -80
- package/src/morphoAaveV2/index.ts +256 -256
- package/src/morphoAaveV3/index.ts +631 -631
- package/src/morphoBlue/index.ts +204 -204
- package/src/multicall/index.ts +22 -22
- package/src/services/dsrService.ts +15 -15
- package/src/services/priceService.ts +62 -62
- package/src/services/utils.ts +56 -56
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +461 -461
- package/src/staking/staking.ts +220 -220
- package/src/types/aave.ts +271 -271
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +84 -84
- package/src/types/compound.ts +131 -131
- package/src/types/contracts/generated/LiquityV2CollSurplusPool.ts +130 -0
- package/src/types/contracts/generated/LiquityV2TroveNFT.ts +150 -0
- package/src/types/contracts/generated/LiquityV2View.ts +315 -0
- package/src/types/contracts/generated/index.ts +3 -0
- package/src/types/curveUsd.ts +118 -118
- package/src/types/euler.ts +171 -171
- package/src/types/index.ts +10 -9
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +119 -0
- package/src/types/llamaLend.ts +155 -155
- package/src/types/maker.ts +50 -50
- package/src/types/morphoBlue.ts +192 -192
- package/src/types/spark.ts +131 -131
package/src/types/euler.ts
CHANGED
|
@@ -1,172 +1,172 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MMPositionData, NetworkNumber,
|
|
3
|
-
} from './common';
|
|
4
|
-
|
|
5
|
-
export enum EulerV2Versions {
|
|
6
|
-
eUSDC2 = 'eUSDC-2',
|
|
7
|
-
eWETH2 = 'eWETH-2',
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export enum EulerV2VaultType {
|
|
11
|
-
Escrow = 'Escrow',
|
|
12
|
-
Governed = 'Governed',
|
|
13
|
-
Ungoverned = 'Ungoverned',
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface EulerV2Market {
|
|
17
|
-
chainIds: NetworkNumber[],
|
|
18
|
-
label: string,
|
|
19
|
-
shortLabel: string,
|
|
20
|
-
asset: string,
|
|
21
|
-
value: EulerV2Versions,
|
|
22
|
-
secondLabel: string,
|
|
23
|
-
marketAddress: string,
|
|
24
|
-
// icon: Function,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface EulerV2PositionData extends MMPositionData {
|
|
28
|
-
ratio: string,
|
|
29
|
-
minRatio: string,
|
|
30
|
-
borrowedUsd: string,
|
|
31
|
-
borrowLimitUsd: string,
|
|
32
|
-
incentiveUsd: string,
|
|
33
|
-
totalInterestUsd: string,
|
|
34
|
-
isSubscribedToAutomation?: boolean,
|
|
35
|
-
automationResubscribeRequired?: boolean,
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface EulerV2AssetData {
|
|
39
|
-
vaultAddress: string,
|
|
40
|
-
vaultSymbol: string
|
|
41
|
-
sortIndex?: number
|
|
42
|
-
liquidationRatio: string
|
|
43
|
-
cash: string
|
|
44
|
-
supplyCap: string
|
|
45
|
-
assetAddress: string
|
|
46
|
-
decimals: string
|
|
47
|
-
symbol: string
|
|
48
|
-
price: string
|
|
49
|
-
borrowCap: string
|
|
50
|
-
canBeBorrowed: boolean
|
|
51
|
-
canBeSupplied: boolean
|
|
52
|
-
incentiveSupplyApy?: string
|
|
53
|
-
incentiveSupplyToken?: string
|
|
54
|
-
totalBorrow: string
|
|
55
|
-
collateralFactor: string
|
|
56
|
-
borrowRate: string
|
|
57
|
-
supplyRate: string
|
|
58
|
-
utilization: string
|
|
59
|
-
governorAdmin: string
|
|
60
|
-
vaultType: EulerV2VaultType
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface EulerV2UsedAsset {
|
|
64
|
-
isSupplied: boolean
|
|
65
|
-
isBorrowed: boolean
|
|
66
|
-
supplied: string
|
|
67
|
-
suppliedUsd: string
|
|
68
|
-
borrowed: string
|
|
69
|
-
borrowedUsd: string
|
|
70
|
-
symbol: string
|
|
71
|
-
collateral: boolean
|
|
72
|
-
vaultAddress: string
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface EulerV2MarketInfoData {
|
|
76
|
-
name: string,
|
|
77
|
-
symbol: string,
|
|
78
|
-
decimals: string,
|
|
79
|
-
vaultAddress: string,
|
|
80
|
-
irm: string,
|
|
81
|
-
creator: string,
|
|
82
|
-
governorAdmin: string,
|
|
83
|
-
unitOfAccount: string,
|
|
84
|
-
unitOfAccountUsdPrice: string,
|
|
85
|
-
isInUSD: boolean,
|
|
86
|
-
oracle: string,
|
|
87
|
-
collaterals: string[],
|
|
88
|
-
isEscrow: boolean,
|
|
89
|
-
isGoverned: boolean,
|
|
90
|
-
vaultType: EulerV2VaultType,
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export type EulerV2AssetsData = { [key: string]: EulerV2AssetData };
|
|
94
|
-
export type EulerV2UsedAssets = { [key: string]: EulerV2UsedAsset };
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
export interface EulerV2CollateralInfo {
|
|
98
|
-
lltv: string
|
|
99
|
-
borrowLtv: string
|
|
100
|
-
totalBorrows: string
|
|
101
|
-
cash: string
|
|
102
|
-
supplyCap: string
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface EulerV2MarketData {
|
|
106
|
-
name: string
|
|
107
|
-
symbol: string
|
|
108
|
-
decimals: number
|
|
109
|
-
|
|
110
|
-
totalSupplyShares: string
|
|
111
|
-
cash: string
|
|
112
|
-
totalBorrows: string
|
|
113
|
-
totalAssets: string
|
|
114
|
-
supplyCap: string
|
|
115
|
-
borrowCap: string
|
|
116
|
-
|
|
117
|
-
collaterals: string[]
|
|
118
|
-
|
|
119
|
-
badDebtSocializationEnabled: boolean
|
|
120
|
-
|
|
121
|
-
unitOfAccount: string
|
|
122
|
-
oracle: string
|
|
123
|
-
assetPrice: string
|
|
124
|
-
|
|
125
|
-
interestRate: string
|
|
126
|
-
irm: string
|
|
127
|
-
|
|
128
|
-
creator: string
|
|
129
|
-
|
|
130
|
-
governorAdmin: string
|
|
131
|
-
|
|
132
|
-
interestFee: string
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export interface EulerV2FullMarketData {
|
|
136
|
-
marketData: EulerV2MarketInfoData
|
|
137
|
-
assetsData: EulerV2AssetsData
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export interface EulerV2AccountData {
|
|
141
|
-
owner: string
|
|
142
|
-
inLockDownMode: boolean
|
|
143
|
-
inPermitDisabledMode: boolean
|
|
144
|
-
|
|
145
|
-
borrowVault: string
|
|
146
|
-
borrowAmountInUnit: string
|
|
147
|
-
|
|
148
|
-
collaterals: string[] // all collaterals user has enabled on main evc contract (globally - not only collaterals for his borrow market)
|
|
149
|
-
collateralAmountsInUnit: string[] // only amounts used as collateral for his debt (empty array if no debt)
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface EulerV2AggregatedPositionData {
|
|
153
|
-
suppliedUsd: string,
|
|
154
|
-
suppliedCollateralUsd: string,
|
|
155
|
-
borrowedUsd: string,
|
|
156
|
-
borrowLimitUsd: string,
|
|
157
|
-
liquidationLimitUsd: string,
|
|
158
|
-
leftToBorrowUsd: string,
|
|
159
|
-
ratio: string,
|
|
160
|
-
collRatio: string,
|
|
161
|
-
netApy: string,
|
|
162
|
-
incentiveUsd: string,
|
|
163
|
-
totalInterestUsd: string,
|
|
164
|
-
liqRatio: string,
|
|
165
|
-
liqPercent: string,
|
|
166
|
-
leveragedType: string,
|
|
167
|
-
leveragedAsset?: string,
|
|
168
|
-
leveragedLsdAssetRatio?: string,
|
|
169
|
-
liquidationPrice?: string,
|
|
170
|
-
minRatio: string,
|
|
171
|
-
minDebt: string,
|
|
1
|
+
import {
|
|
2
|
+
MMPositionData, NetworkNumber,
|
|
3
|
+
} from './common';
|
|
4
|
+
|
|
5
|
+
export enum EulerV2Versions {
|
|
6
|
+
eUSDC2 = 'eUSDC-2',
|
|
7
|
+
eWETH2 = 'eWETH-2',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum EulerV2VaultType {
|
|
11
|
+
Escrow = 'Escrow',
|
|
12
|
+
Governed = 'Governed',
|
|
13
|
+
Ungoverned = 'Ungoverned',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface EulerV2Market {
|
|
17
|
+
chainIds: NetworkNumber[],
|
|
18
|
+
label: string,
|
|
19
|
+
shortLabel: string,
|
|
20
|
+
asset: string,
|
|
21
|
+
value: EulerV2Versions,
|
|
22
|
+
secondLabel: string,
|
|
23
|
+
marketAddress: string,
|
|
24
|
+
// icon: Function,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface EulerV2PositionData extends MMPositionData {
|
|
28
|
+
ratio: string,
|
|
29
|
+
minRatio: string,
|
|
30
|
+
borrowedUsd: string,
|
|
31
|
+
borrowLimitUsd: string,
|
|
32
|
+
incentiveUsd: string,
|
|
33
|
+
totalInterestUsd: string,
|
|
34
|
+
isSubscribedToAutomation?: boolean,
|
|
35
|
+
automationResubscribeRequired?: boolean,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface EulerV2AssetData {
|
|
39
|
+
vaultAddress: string,
|
|
40
|
+
vaultSymbol: string
|
|
41
|
+
sortIndex?: number
|
|
42
|
+
liquidationRatio: string
|
|
43
|
+
cash: string
|
|
44
|
+
supplyCap: string
|
|
45
|
+
assetAddress: string
|
|
46
|
+
decimals: string
|
|
47
|
+
symbol: string
|
|
48
|
+
price: string
|
|
49
|
+
borrowCap: string
|
|
50
|
+
canBeBorrowed: boolean
|
|
51
|
+
canBeSupplied: boolean
|
|
52
|
+
incentiveSupplyApy?: string
|
|
53
|
+
incentiveSupplyToken?: string
|
|
54
|
+
totalBorrow: string
|
|
55
|
+
collateralFactor: string
|
|
56
|
+
borrowRate: string
|
|
57
|
+
supplyRate: string
|
|
58
|
+
utilization: string
|
|
59
|
+
governorAdmin: string
|
|
60
|
+
vaultType: EulerV2VaultType
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface EulerV2UsedAsset {
|
|
64
|
+
isSupplied: boolean
|
|
65
|
+
isBorrowed: boolean
|
|
66
|
+
supplied: string
|
|
67
|
+
suppliedUsd: string
|
|
68
|
+
borrowed: string
|
|
69
|
+
borrowedUsd: string
|
|
70
|
+
symbol: string
|
|
71
|
+
collateral: boolean
|
|
72
|
+
vaultAddress: string
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface EulerV2MarketInfoData {
|
|
76
|
+
name: string,
|
|
77
|
+
symbol: string,
|
|
78
|
+
decimals: string,
|
|
79
|
+
vaultAddress: string,
|
|
80
|
+
irm: string,
|
|
81
|
+
creator: string,
|
|
82
|
+
governorAdmin: string,
|
|
83
|
+
unitOfAccount: string,
|
|
84
|
+
unitOfAccountUsdPrice: string,
|
|
85
|
+
isInUSD: boolean,
|
|
86
|
+
oracle: string,
|
|
87
|
+
collaterals: string[],
|
|
88
|
+
isEscrow: boolean,
|
|
89
|
+
isGoverned: boolean,
|
|
90
|
+
vaultType: EulerV2VaultType,
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type EulerV2AssetsData = { [key: string]: EulerV2AssetData };
|
|
94
|
+
export type EulerV2UsedAssets = { [key: string]: EulerV2UsedAsset };
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
export interface EulerV2CollateralInfo {
|
|
98
|
+
lltv: string
|
|
99
|
+
borrowLtv: string
|
|
100
|
+
totalBorrows: string
|
|
101
|
+
cash: string
|
|
102
|
+
supplyCap: string
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface EulerV2MarketData {
|
|
106
|
+
name: string
|
|
107
|
+
symbol: string
|
|
108
|
+
decimals: number
|
|
109
|
+
|
|
110
|
+
totalSupplyShares: string
|
|
111
|
+
cash: string
|
|
112
|
+
totalBorrows: string
|
|
113
|
+
totalAssets: string
|
|
114
|
+
supplyCap: string
|
|
115
|
+
borrowCap: string
|
|
116
|
+
|
|
117
|
+
collaterals: string[]
|
|
118
|
+
|
|
119
|
+
badDebtSocializationEnabled: boolean
|
|
120
|
+
|
|
121
|
+
unitOfAccount: string
|
|
122
|
+
oracle: string
|
|
123
|
+
assetPrice: string
|
|
124
|
+
|
|
125
|
+
interestRate: string
|
|
126
|
+
irm: string
|
|
127
|
+
|
|
128
|
+
creator: string
|
|
129
|
+
|
|
130
|
+
governorAdmin: string
|
|
131
|
+
|
|
132
|
+
interestFee: string
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface EulerV2FullMarketData {
|
|
136
|
+
marketData: EulerV2MarketInfoData
|
|
137
|
+
assetsData: EulerV2AssetsData
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface EulerV2AccountData {
|
|
141
|
+
owner: string
|
|
142
|
+
inLockDownMode: boolean
|
|
143
|
+
inPermitDisabledMode: boolean
|
|
144
|
+
|
|
145
|
+
borrowVault: string
|
|
146
|
+
borrowAmountInUnit: string
|
|
147
|
+
|
|
148
|
+
collaterals: string[] // all collaterals user has enabled on main evc contract (globally - not only collaterals for his borrow market)
|
|
149
|
+
collateralAmountsInUnit: string[] // only amounts used as collateral for his debt (empty array if no debt)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface EulerV2AggregatedPositionData {
|
|
153
|
+
suppliedUsd: string,
|
|
154
|
+
suppliedCollateralUsd: string,
|
|
155
|
+
borrowedUsd: string,
|
|
156
|
+
borrowLimitUsd: string,
|
|
157
|
+
liquidationLimitUsd: string,
|
|
158
|
+
leftToBorrowUsd: string,
|
|
159
|
+
ratio: string,
|
|
160
|
+
collRatio: string,
|
|
161
|
+
netApy: string,
|
|
162
|
+
incentiveUsd: string,
|
|
163
|
+
totalInterestUsd: string,
|
|
164
|
+
liqRatio: string,
|
|
165
|
+
liqPercent: string,
|
|
166
|
+
leveragedType: string,
|
|
167
|
+
leveragedAsset?: string,
|
|
168
|
+
leveragedLsdAssetRatio?: string,
|
|
169
|
+
liquidationPrice?: string,
|
|
170
|
+
minRatio: string,
|
|
171
|
+
minDebt: string,
|
|
172
172
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export * from './aave';
|
|
2
|
-
export * from './compound';
|
|
3
|
-
export * from './spark';
|
|
4
|
-
export * from './curveUsd';
|
|
5
|
-
export * from './liquity';
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
1
|
+
export * from './aave';
|
|
2
|
+
export * from './compound';
|
|
3
|
+
export * from './spark';
|
|
4
|
+
export * from './curveUsd';
|
|
5
|
+
export * from './liquity';
|
|
6
|
+
export * from './liquityV2';
|
|
7
|
+
export * from './maker';
|
|
8
|
+
export * from './chickenBonds';
|
|
9
|
+
export * from './morphoBlue';
|
|
10
|
+
export * from './llamaLend';
|
|
10
11
|
export * from './euler';
|
package/src/types/liquity.ts
CHANGED
|
@@ -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
|
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { EthAddress, NetworkNumber } from './common';
|
|
2
|
+
|
|
3
|
+
export enum LiquityV2Versions {
|
|
4
|
+
LiquityV2Eth = 'liquityv2eth',
|
|
5
|
+
LiquityV2WstEth = 'liquityv2wsteth',
|
|
6
|
+
LiquityV2REth = 'liquityv2reth',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export enum LIQUITY_V2_TROVE_STATUS_ENUM {
|
|
10
|
+
nonExistent,
|
|
11
|
+
active,
|
|
12
|
+
closedByOwner,
|
|
13
|
+
closedByLiquidation,
|
|
14
|
+
zombie,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const LIQUITY_V2_STATUS_MAPPING = {
|
|
18
|
+
nonExistent: 'Non existent',
|
|
19
|
+
active: 'Active',
|
|
20
|
+
closedByOwner: 'Closed',
|
|
21
|
+
closedByLiquidation: 'Liquidated',
|
|
22
|
+
zombie: 'Zombie',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export interface LiquityV2MarketInfo {
|
|
26
|
+
chainIds: NetworkNumber[],
|
|
27
|
+
label: string,
|
|
28
|
+
shortLabel: string,
|
|
29
|
+
url: string,
|
|
30
|
+
value: LiquityV2Versions,
|
|
31
|
+
debtToken: string,
|
|
32
|
+
collateralToken: string,
|
|
33
|
+
marketAddress: string,
|
|
34
|
+
protocolName: string,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface LiquityV2AssetData {
|
|
38
|
+
symbol: string,
|
|
39
|
+
address: string,
|
|
40
|
+
price: string,
|
|
41
|
+
incentiveSupplyApy?: string,
|
|
42
|
+
incentiveSupplyToken?: string,
|
|
43
|
+
totalSupply: string,
|
|
44
|
+
totalBorrow: string,
|
|
45
|
+
canBeSupplied: boolean,
|
|
46
|
+
canBeBorrowed: boolean,
|
|
47
|
+
leftToBorrowGlobal: string,
|
|
48
|
+
leftToWithdrawGlobal: string,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export type LiquityV2AssetsData = { [key: string]: LiquityV2AssetData };
|
|
52
|
+
|
|
53
|
+
export interface InnerLiquityV2MarketData {
|
|
54
|
+
minCollRatio: string,
|
|
55
|
+
totalCollRatio: string,
|
|
56
|
+
criticalCollRatio: string,
|
|
57
|
+
isUnderCollateralized: boolean,
|
|
58
|
+
hintHelperAddress: EthAddress,
|
|
59
|
+
troveNFTAddress: EthAddress,
|
|
60
|
+
borrowerOperationsAddress: EthAddress,
|
|
61
|
+
troveManagerAddress: EthAddress,
|
|
62
|
+
stabilityPoolAddress: EthAddress,
|
|
63
|
+
collSurplusPoolAddress: EthAddress,
|
|
64
|
+
activePoolAddress: EthAddress,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface LiquityV2MarketData {
|
|
68
|
+
assetsData: LiquityV2AssetsData,
|
|
69
|
+
marketData: InnerLiquityV2MarketData,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface LiquityV2UsedAsset {
|
|
73
|
+
symbol: string,
|
|
74
|
+
collateral?: boolean,
|
|
75
|
+
supplied: string,
|
|
76
|
+
suppliedUsd: string,
|
|
77
|
+
borrowed: string,
|
|
78
|
+
borrowedUsd: string,
|
|
79
|
+
isSupplied: boolean,
|
|
80
|
+
isBorrowed: boolean,
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type LiquityV2UsedAssets = { [key: string]: LiquityV2UsedAsset };
|
|
84
|
+
|
|
85
|
+
export interface LiquityV2AggregatedTroveData {
|
|
86
|
+
suppliedUsd: string,
|
|
87
|
+
borrowedUsd: string,
|
|
88
|
+
borrowLimitUsd: string,
|
|
89
|
+
leftToBorrowUsd: string,
|
|
90
|
+
netApy: string,
|
|
91
|
+
incentiveUsd: string,
|
|
92
|
+
totalInterestUsd: string,
|
|
93
|
+
leveragedType: string,
|
|
94
|
+
leveragedAsset: string,
|
|
95
|
+
liquidationPrice: string,
|
|
96
|
+
ratio: string,
|
|
97
|
+
collRatio: string,
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface LiquityV2TroveData {
|
|
101
|
+
usedAssets: LiquityV2UsedAssets,
|
|
102
|
+
troveId: string,
|
|
103
|
+
ratio: string,
|
|
104
|
+
collRatio: string,
|
|
105
|
+
interestRate: string,
|
|
106
|
+
leftToBorrowUsd: string,
|
|
107
|
+
borrowLimitUsd: string,
|
|
108
|
+
suppliedUsd: string,
|
|
109
|
+
borrowedUsd: string,
|
|
110
|
+
netApy: string,
|
|
111
|
+
incentiveUsd: string,
|
|
112
|
+
totalInterestUsd: string,
|
|
113
|
+
interestBatchManager: EthAddress,
|
|
114
|
+
troveStatus: string,
|
|
115
|
+
leveragedType: string,
|
|
116
|
+
leveragedAsset: string,
|
|
117
|
+
liquidationPrice: string,
|
|
118
|
+
debtInFront: string,
|
|
119
|
+
}
|