@defisaver/positions-sdk 0.0.98 → 0.0.100
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/README.md +63 -63
- package/cjs/config/contracts.d.ts +361 -15
- package/cjs/config/contracts.js +37 -15
- package/cjs/helpers/morphoBlueHelpers/index.d.ts +9 -2
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -1
- package/cjs/maker/index.js +1 -1
- package/cjs/morphoBlue/index.js +4 -27
- package/cjs/types/contracts/generated/AaveV3View.d.ts +29 -2
- package/cjs/types/contracts/generated/MorphoBlueView.d.ts +61 -0
- package/cjs/types/contracts/generated/SparkView.d.ts +29 -2
- package/esm/config/contracts.d.ts +361 -15
- package/esm/config/contracts.js +37 -15
- package/esm/helpers/morphoBlueHelpers/index.d.ts +9 -2
- package/esm/helpers/morphoBlueHelpers/index.js +62 -0
- package/esm/maker/index.js +1 -1
- package/esm/morphoBlue/index.js +4 -27
- package/esm/types/contracts/generated/AaveV3View.d.ts +29 -2
- package/esm/types/contracts/generated/MorphoBlueView.d.ts +61 -0
- package/esm/types/contracts/generated/SparkView.d.ts +29 -2
- package/package.json +41 -40
- package/src/aaveV2/index.ts +227 -227
- package/src/aaveV3/index.ts +558 -558
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +219 -219
- package/src/compoundV3/index.ts +266 -266
- package/src/config/contracts.js +871 -848
- package/src/constants/index.ts +5 -5
- package/src/contracts.ts +128 -128
- package/src/curveUsd/index.ts +229 -229
- package/src/exchange/index.ts +17 -17
- package/src/helpers/aaveHelpers/index.ts +134 -134
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +181 -181
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/index.ts +7 -7
- package/src/helpers/llamaLendHelpers/index.ts +45 -45
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/morphoBlueHelpers/index.ts +117 -56
- package/src/helpers/sparkHelpers/index.ts +106 -106
- package/src/index.ts +46 -46
- package/src/liquity/index.ts +116 -116
- package/src/llamaLend/index.ts +268 -268
- package/src/maker/index.ts +117 -117
- package/src/markets/aave/index.ts +80 -80
- package/src/markets/aave/marketAssets.ts +24 -24
- package/src/markets/compound/index.ts +142 -142
- package/src/markets/compound/marketsAssets.ts +50 -50
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/index.ts +5 -5
- package/src/markets/llamaLend/contractAddresses.ts +95 -95
- package/src/markets/llamaLend/index.ts +150 -150
- package/src/markets/morphoBlue/index.ts +611 -611
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +10 -10
- package/src/moneymarket/moneymarketCommonService.ts +76 -76
- package/src/morphoAaveV2/index.ts +256 -256
- package/src/morphoAaveV3/index.ts +612 -612
- package/src/morphoBlue/index.ts +171 -199
- package/src/multicall/index.ts +22 -22
- package/src/services/dsrService.ts +15 -15
- package/src/services/priceService.ts +21 -21
- package/src/services/utils.ts +51 -51
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +424 -424
- package/src/staking/staking.ts +187 -187
- package/src/types/aave.ts +256 -256
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +84 -84
- package/src/types/compound.ts +128 -128
- package/src/types/contracts/generated/AaveV3View.ts +43 -3
- package/src/types/contracts/generated/MorphoBlueView.ts +87 -0
- package/src/types/contracts/generated/SparkView.ts +43 -3
- package/src/types/curveUsd.ts +118 -118
- package/src/types/index.ts +8 -8
- package/src/types/liquity.ts +30 -30
- package/src/types/llamaLend.ts +143 -143
- package/src/types/maker.ts +50 -50
- package/src/types/morphoBlue.ts +139 -139
- package/src/types/spark.ts +106 -106
|
@@ -22,6 +22,41 @@ export interface EventOptions {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export declare namespace SparkView {
|
|
25
|
+
export type LiquidityChangeParamsStruct =
|
|
26
|
+
| [string, number | string | BN, number | string | BN]
|
|
27
|
+
| {
|
|
28
|
+
reserveAddress: string;
|
|
29
|
+
liquidityAdded: number | string | BN;
|
|
30
|
+
liquidityTaken: number | string | BN;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type LiquidityChangeParamsStructOutputArray = [string, string, string];
|
|
34
|
+
export type LiquidityChangeParamsStructOutputStruct = {
|
|
35
|
+
reserveAddress: string;
|
|
36
|
+
liquidityAdded: string;
|
|
37
|
+
liquidityTaken: string;
|
|
38
|
+
};
|
|
39
|
+
export type LiquidityChangeParamsStructOutput =
|
|
40
|
+
LiquidityChangeParamsStructOutputArray &
|
|
41
|
+
LiquidityChangeParamsStructOutputStruct;
|
|
42
|
+
|
|
43
|
+
export type EstimatedRatesStruct =
|
|
44
|
+
| [string, number | string | BN, number | string | BN]
|
|
45
|
+
| {
|
|
46
|
+
reserveAddress: string;
|
|
47
|
+
supplyRate: number | string | BN;
|
|
48
|
+
variableBorrowRate: number | string | BN;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type EstimatedRatesStructOutputArray = [string, string, string];
|
|
52
|
+
export type EstimatedRatesStructOutputStruct = {
|
|
53
|
+
reserveAddress: string;
|
|
54
|
+
supplyRate: string;
|
|
55
|
+
variableBorrowRate: string;
|
|
56
|
+
};
|
|
57
|
+
export type EstimatedRatesStructOutput = EstimatedRatesStructOutputArray &
|
|
58
|
+
EstimatedRatesStructOutputStruct;
|
|
59
|
+
|
|
25
60
|
export type TokenInfoFullStruct =
|
|
26
61
|
| [
|
|
27
62
|
string,
|
|
@@ -177,6 +212,7 @@ export declare namespace SparkView {
|
|
|
177
212
|
number | string | BN,
|
|
178
213
|
number | string | BN,
|
|
179
214
|
string[],
|
|
215
|
+
boolean[],
|
|
180
216
|
string[],
|
|
181
217
|
number | string | BN[],
|
|
182
218
|
number | string | BN[],
|
|
@@ -192,6 +228,7 @@ export declare namespace SparkView {
|
|
|
192
228
|
ratio: number | string | BN;
|
|
193
229
|
eMode: number | string | BN;
|
|
194
230
|
collAddr: string[];
|
|
231
|
+
enabledAsColl: boolean[];
|
|
195
232
|
borrowAddr: string[];
|
|
196
233
|
collAmounts: number | string | BN[];
|
|
197
234
|
borrowStableAmounts: number | string | BN[];
|
|
@@ -208,6 +245,7 @@ export declare namespace SparkView {
|
|
|
208
245
|
string,
|
|
209
246
|
string,
|
|
210
247
|
string[],
|
|
248
|
+
boolean[],
|
|
211
249
|
string[],
|
|
212
250
|
string[],
|
|
213
251
|
string[],
|
|
@@ -223,6 +261,7 @@ export declare namespace SparkView {
|
|
|
223
261
|
ratio: string;
|
|
224
262
|
eMode: string;
|
|
225
263
|
collAddr: string[];
|
|
264
|
+
enabledAsColl: boolean[];
|
|
226
265
|
borrowAddr: string[];
|
|
227
266
|
collAmounts: string[];
|
|
228
267
|
borrowStableAmounts: string[];
|
|
@@ -315,9 +354,10 @@ export interface SparkView extends BaseContract {
|
|
|
315
354
|
methods: {
|
|
316
355
|
SPARK_REFERRAL_CODE(): NonPayableTransactionObject<string>;
|
|
317
356
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
357
|
+
getApyAfterValuesEstimation(
|
|
358
|
+
_market: string,
|
|
359
|
+
_reserveParams: SparkView.LiquidityChangeParamsStruct[]
|
|
360
|
+
): NonPayableTransactionObject<SparkView.EstimatedRatesStructOutput[]>;
|
|
321
361
|
|
|
322
362
|
getAssetPrice(
|
|
323
363
|
_market: string,
|
package/src/types/curveUsd.ts
CHANGED
|
@@ -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
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './aave';
|
|
2
|
-
export * from './compound';
|
|
3
|
-
export * from './spark';
|
|
4
|
-
export * from './curveUsd';
|
|
5
|
-
export * from './liquity';
|
|
6
|
-
export * from './maker';
|
|
7
|
-
export * from './chickenBonds';
|
|
8
|
-
export * from './morphoBlue';
|
|
1
|
+
export * from './aave';
|
|
2
|
+
export * from './compound';
|
|
3
|
+
export * from './spark';
|
|
4
|
+
export * from './curveUsd';
|
|
5
|
+
export * from './liquity';
|
|
6
|
+
export * from './maker';
|
|
7
|
+
export * from './chickenBonds';
|
|
8
|
+
export * from './morphoBlue';
|
|
9
9
|
export * from './llamaLend';
|
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
|
}
|
package/src/types/llamaLend.ts
CHANGED
|
@@ -1,143 +1,143 @@
|
|
|
1
|
-
import { EthAddress, NetworkNumber } from './common';
|
|
2
|
-
import { BandData, UserBandData } from './curveUsd';
|
|
3
|
-
|
|
4
|
-
export enum LLVersionsEth {
|
|
5
|
-
// long only
|
|
6
|
-
LLWstethCrvusd = 'llamaLendwstETHcrvUSD',
|
|
7
|
-
LLSusdeCrvusd = 'llamaLendsUSDecrvUSD',
|
|
8
|
-
// long and short crv
|
|
9
|
-
LLCrvCrvusd = 'llamaLendCRVcrvUSD',
|
|
10
|
-
LLCrvusdCrv = 'llamaLendcrvUSDCRV',
|
|
11
|
-
// long and short tbtc
|
|
12
|
-
LLTbtcCrvusd = 'llamaLendTBTCcrvUSD',
|
|
13
|
-
LLCrvusdTbtc = 'llamaLendcrvUSDTBTC',
|
|
14
|
-
// long and short weth
|
|
15
|
-
LLWethCrvusd = 'llamaLendWETHcrvUSD',
|
|
16
|
-
LLCrvusdWeth = 'llamaLendcrvUSDWETH',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export enum LLVersionsArb {
|
|
20
|
-
// long only
|
|
21
|
-
LLArbCrvusd = 'llamaLendArbcrvUSD',
|
|
22
|
-
LLFxnCrvusd = 'llamaLendFXNcrvUSD',
|
|
23
|
-
LLWbtcCrvusd = 'llamaLendWBTCcrvUSD',
|
|
24
|
-
LLCrvCrvusd = 'llamaLendCRVcrvUSD',
|
|
25
|
-
LLWethCrvusd = 'llamaLendWETHcrvUSD',
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const LlamaLendVersions = {
|
|
29
|
-
...LLVersionsEth,
|
|
30
|
-
...LLVersionsArb,
|
|
31
|
-
} as const;
|
|
32
|
-
|
|
33
|
-
export type LlamaLendVersionsType = typeof LlamaLendVersions[keyof typeof LlamaLendVersions];
|
|
34
|
-
|
|
35
|
-
export enum LlamaLendStatus {
|
|
36
|
-
Nonexistant = 'Nonexistant',
|
|
37
|
-
Safe = 'Safe',
|
|
38
|
-
Risk = 'Risk',
|
|
39
|
-
SoftLiquidating = 'SoftLiquidating',
|
|
40
|
-
SoftLiquidated = 'SoftLiquidated',
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface LlamaLendMarketData {
|
|
44
|
-
chainIds: NetworkNumber[],
|
|
45
|
-
label: string,
|
|
46
|
-
shortLabel: string,
|
|
47
|
-
value: LlamaLendVersionsType,
|
|
48
|
-
collAsset: string,
|
|
49
|
-
baseAsset: string,
|
|
50
|
-
controllerAddress: string,
|
|
51
|
-
vaultAddress: EthAddress,
|
|
52
|
-
url: string,
|
|
53
|
-
}
|
|
54
|
-
export interface LlamaLendAssetData {
|
|
55
|
-
symbol: string,
|
|
56
|
-
address: string,
|
|
57
|
-
price: string,
|
|
58
|
-
supplyRate: string,
|
|
59
|
-
borrowRate: string,
|
|
60
|
-
totalSupply?: string,
|
|
61
|
-
totalBorrow?: string,
|
|
62
|
-
canBeSupplied?: boolean,
|
|
63
|
-
canBeBorrowed?: boolean,
|
|
64
|
-
shares?: string,
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export type LlamaLendAssetsData = { [key: string]: LlamaLendAssetData };
|
|
68
|
-
|
|
69
|
-
export interface LlamaLendGlobalMarketData {
|
|
70
|
-
A:string,
|
|
71
|
-
loanDiscount: string,
|
|
72
|
-
activeBand: string,
|
|
73
|
-
totalDebt: string,
|
|
74
|
-
totalDebtSupplied:string,
|
|
75
|
-
utilization:string,
|
|
76
|
-
ammPrice: string,
|
|
77
|
-
basePrice: string,
|
|
78
|
-
oraclePrice: string,
|
|
79
|
-
minted: string,
|
|
80
|
-
redeemed: string,
|
|
81
|
-
monetaryPolicyRate: string,
|
|
82
|
-
ammRate: string,
|
|
83
|
-
minBand: string,
|
|
84
|
-
maxBand: string,
|
|
85
|
-
borrowRate: string,
|
|
86
|
-
lendRate: string,
|
|
87
|
-
futureBorrowRate: string,
|
|
88
|
-
leftToBorrow: string,
|
|
89
|
-
bands: BandData[],
|
|
90
|
-
assetsData: LlamaLendAssetsData,
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface LlamaLendAggregatedPositionData {
|
|
94
|
-
ratio: string,
|
|
95
|
-
suppliedUsd: string,
|
|
96
|
-
borrowedUsd: string,
|
|
97
|
-
suppliedForYieldUsd: string,
|
|
98
|
-
safetyRatio: string,
|
|
99
|
-
borrowLimitUsd: string,
|
|
100
|
-
minAllowedRatio: number,
|
|
101
|
-
collFactor: string,
|
|
102
|
-
leveragedType: string,
|
|
103
|
-
leveragedAsset?: string,
|
|
104
|
-
liquidationPrice?: string,
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export interface LlamaLendUsedAsset {
|
|
108
|
-
isSupplied: boolean,
|
|
109
|
-
supplied: string,
|
|
110
|
-
suppliedUsd: string,
|
|
111
|
-
borrowed: string,
|
|
112
|
-
borrowedUsd: string,
|
|
113
|
-
isBorrowed: boolean,
|
|
114
|
-
symbol: string,
|
|
115
|
-
collateral: boolean,
|
|
116
|
-
price: string,
|
|
117
|
-
interestRate?: string,
|
|
118
|
-
suppliedForYield?: string,
|
|
119
|
-
suppliedForYieldUsd?: string,
|
|
120
|
-
shares?: string,
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export interface LlamaLendUsedAssets {
|
|
124
|
-
[key: string]: LlamaLendUsedAsset,
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface LlamaLendUserData {
|
|
128
|
-
debtAmount: string,
|
|
129
|
-
health: string,
|
|
130
|
-
healthPercent: string,
|
|
131
|
-
priceHigh: string,
|
|
132
|
-
priceLow: string,
|
|
133
|
-
liquidationDiscount: string,
|
|
134
|
-
numOfBands: string,
|
|
135
|
-
usedAssets: LlamaLendUsedAssets,
|
|
136
|
-
status: LlamaLendStatus,
|
|
137
|
-
ratio: string,
|
|
138
|
-
suppliedUsd: string,
|
|
139
|
-
borrowedUsd: string,
|
|
140
|
-
suppliedForYieldUsd: string,
|
|
141
|
-
safetyRatio: string,
|
|
142
|
-
userBands: UserBandData[],
|
|
143
|
-
}
|
|
1
|
+
import { EthAddress, NetworkNumber } from './common';
|
|
2
|
+
import { BandData, UserBandData } from './curveUsd';
|
|
3
|
+
|
|
4
|
+
export enum LLVersionsEth {
|
|
5
|
+
// long only
|
|
6
|
+
LLWstethCrvusd = 'llamaLendwstETHcrvUSD',
|
|
7
|
+
LLSusdeCrvusd = 'llamaLendsUSDecrvUSD',
|
|
8
|
+
// long and short crv
|
|
9
|
+
LLCrvCrvusd = 'llamaLendCRVcrvUSD',
|
|
10
|
+
LLCrvusdCrv = 'llamaLendcrvUSDCRV',
|
|
11
|
+
// long and short tbtc
|
|
12
|
+
LLTbtcCrvusd = 'llamaLendTBTCcrvUSD',
|
|
13
|
+
LLCrvusdTbtc = 'llamaLendcrvUSDTBTC',
|
|
14
|
+
// long and short weth
|
|
15
|
+
LLWethCrvusd = 'llamaLendWETHcrvUSD',
|
|
16
|
+
LLCrvusdWeth = 'llamaLendcrvUSDWETH',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export enum LLVersionsArb {
|
|
20
|
+
// long only
|
|
21
|
+
LLArbCrvusd = 'llamaLendArbcrvUSD',
|
|
22
|
+
LLFxnCrvusd = 'llamaLendFXNcrvUSD',
|
|
23
|
+
LLWbtcCrvusd = 'llamaLendWBTCcrvUSD',
|
|
24
|
+
LLCrvCrvusd = 'llamaLendCRVcrvUSD',
|
|
25
|
+
LLWethCrvusd = 'llamaLendWETHcrvUSD',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const LlamaLendVersions = {
|
|
29
|
+
...LLVersionsEth,
|
|
30
|
+
...LLVersionsArb,
|
|
31
|
+
} as const;
|
|
32
|
+
|
|
33
|
+
export type LlamaLendVersionsType = typeof LlamaLendVersions[keyof typeof LlamaLendVersions];
|
|
34
|
+
|
|
35
|
+
export enum LlamaLendStatus {
|
|
36
|
+
Nonexistant = 'Nonexistant',
|
|
37
|
+
Safe = 'Safe',
|
|
38
|
+
Risk = 'Risk',
|
|
39
|
+
SoftLiquidating = 'SoftLiquidating',
|
|
40
|
+
SoftLiquidated = 'SoftLiquidated',
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface LlamaLendMarketData {
|
|
44
|
+
chainIds: NetworkNumber[],
|
|
45
|
+
label: string,
|
|
46
|
+
shortLabel: string,
|
|
47
|
+
value: LlamaLendVersionsType,
|
|
48
|
+
collAsset: string,
|
|
49
|
+
baseAsset: string,
|
|
50
|
+
controllerAddress: string,
|
|
51
|
+
vaultAddress: EthAddress,
|
|
52
|
+
url: string,
|
|
53
|
+
}
|
|
54
|
+
export interface LlamaLendAssetData {
|
|
55
|
+
symbol: string,
|
|
56
|
+
address: string,
|
|
57
|
+
price: string,
|
|
58
|
+
supplyRate: string,
|
|
59
|
+
borrowRate: string,
|
|
60
|
+
totalSupply?: string,
|
|
61
|
+
totalBorrow?: string,
|
|
62
|
+
canBeSupplied?: boolean,
|
|
63
|
+
canBeBorrowed?: boolean,
|
|
64
|
+
shares?: string,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export type LlamaLendAssetsData = { [key: string]: LlamaLendAssetData };
|
|
68
|
+
|
|
69
|
+
export interface LlamaLendGlobalMarketData {
|
|
70
|
+
A:string,
|
|
71
|
+
loanDiscount: string,
|
|
72
|
+
activeBand: string,
|
|
73
|
+
totalDebt: string,
|
|
74
|
+
totalDebtSupplied:string,
|
|
75
|
+
utilization:string,
|
|
76
|
+
ammPrice: string,
|
|
77
|
+
basePrice: string,
|
|
78
|
+
oraclePrice: string,
|
|
79
|
+
minted: string,
|
|
80
|
+
redeemed: string,
|
|
81
|
+
monetaryPolicyRate: string,
|
|
82
|
+
ammRate: string,
|
|
83
|
+
minBand: string,
|
|
84
|
+
maxBand: string,
|
|
85
|
+
borrowRate: string,
|
|
86
|
+
lendRate: string,
|
|
87
|
+
futureBorrowRate: string,
|
|
88
|
+
leftToBorrow: string,
|
|
89
|
+
bands: BandData[],
|
|
90
|
+
assetsData: LlamaLendAssetsData,
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface LlamaLendAggregatedPositionData {
|
|
94
|
+
ratio: string,
|
|
95
|
+
suppliedUsd: string,
|
|
96
|
+
borrowedUsd: string,
|
|
97
|
+
suppliedForYieldUsd: string,
|
|
98
|
+
safetyRatio: string,
|
|
99
|
+
borrowLimitUsd: string,
|
|
100
|
+
minAllowedRatio: number,
|
|
101
|
+
collFactor: string,
|
|
102
|
+
leveragedType: string,
|
|
103
|
+
leveragedAsset?: string,
|
|
104
|
+
liquidationPrice?: string,
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface LlamaLendUsedAsset {
|
|
108
|
+
isSupplied: boolean,
|
|
109
|
+
supplied: string,
|
|
110
|
+
suppliedUsd: string,
|
|
111
|
+
borrowed: string,
|
|
112
|
+
borrowedUsd: string,
|
|
113
|
+
isBorrowed: boolean,
|
|
114
|
+
symbol: string,
|
|
115
|
+
collateral: boolean,
|
|
116
|
+
price: string,
|
|
117
|
+
interestRate?: string,
|
|
118
|
+
suppliedForYield?: string,
|
|
119
|
+
suppliedForYieldUsd?: string,
|
|
120
|
+
shares?: string,
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface LlamaLendUsedAssets {
|
|
124
|
+
[key: string]: LlamaLendUsedAsset,
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface LlamaLendUserData {
|
|
128
|
+
debtAmount: string,
|
|
129
|
+
health: string,
|
|
130
|
+
healthPercent: string,
|
|
131
|
+
priceHigh: string,
|
|
132
|
+
priceLow: string,
|
|
133
|
+
liquidationDiscount: string,
|
|
134
|
+
numOfBands: string,
|
|
135
|
+
usedAssets: LlamaLendUsedAssets,
|
|
136
|
+
status: LlamaLendStatus,
|
|
137
|
+
ratio: string,
|
|
138
|
+
suppliedUsd: string,
|
|
139
|
+
borrowedUsd: string,
|
|
140
|
+
suppliedForYieldUsd: string,
|
|
141
|
+
safetyRatio: string,
|
|
142
|
+
userBands: UserBandData[],
|
|
143
|
+
}
|