@defisaver/positions-sdk 0.0.28 → 0.0.30-dev
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 +926 -42
- package/cjs/config/contracts.js +176 -46
- package/cjs/contracts.d.ts +1 -1
- package/cjs/contracts.js +21 -4
- package/cjs/curveUsd/index.js +1 -1
- package/cjs/helpers/curveUsdHelpers/index.d.ts +2 -1
- package/cjs/helpers/curveUsdHelpers/index.js +25 -17
- package/cjs/markets/aave/marketAssets.d.ts +9 -5
- package/cjs/markets/aave/marketAssets.js +16 -23
- package/cjs/markets/compound/marketsAssets.d.ts +11 -5
- package/cjs/markets/compound/marketsAssets.js +17 -19
- package/cjs/markets/spark/marketAssets.d.ts +3 -2
- package/cjs/markets/spark/marketAssets.js +5 -5
- package/cjs/moneymarket/moneymarketCommonService.js +1 -1
- package/cjs/morphoAaveV3/index.js +0 -2
- package/cjs/services/utils.d.ts +4 -0
- package/cjs/services/utils.js +13 -1
- package/cjs/types/contracts/generated/CrvUSDView.d.ts +30 -4
- package/cjs/types/contracts/generated/MorphoAaveV3ProxyEthMarket.d.ts +1 -0
- package/cjs/types/curveUsd.d.ts +6 -0
- package/esm/config/contracts.d.ts +926 -42
- package/esm/config/contracts.js +176 -46
- package/esm/contracts.d.ts +1 -1
- package/esm/contracts.js +21 -4
- package/esm/curveUsd/index.js +1 -1
- package/esm/helpers/curveUsdHelpers/index.d.ts +2 -1
- package/esm/helpers/curveUsdHelpers/index.js +26 -18
- package/esm/markets/aave/marketAssets.d.ts +9 -5
- package/esm/markets/aave/marketAssets.js +15 -22
- package/esm/markets/compound/marketsAssets.d.ts +11 -5
- package/esm/markets/compound/marketsAssets.js +16 -18
- package/esm/markets/spark/marketAssets.d.ts +3 -2
- package/esm/markets/spark/marketAssets.js +4 -4
- package/esm/moneymarket/moneymarketCommonService.js +1 -1
- package/esm/morphoAaveV3/index.js +0 -2
- package/esm/services/utils.d.ts +4 -0
- package/esm/services/utils.js +11 -0
- package/esm/types/contracts/generated/CrvUSDView.d.ts +30 -4
- package/esm/types/contracts/generated/MorphoAaveV3ProxyEthMarket.d.ts +1 -0
- package/esm/types/curveUsd.d.ts +6 -0
- package/package.json +40 -40
- package/src/aaveV2/index.ts +226 -226
- package/src/aaveV3/index.ts +561 -561
- 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 +275 -275
- package/src/config/contracts.js +803 -676
- package/src/constants/index.ts +3 -3
- package/src/contracts.ts +120 -126
- package/src/curveUsd/index.ts +228 -228
- 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 -32
- package/src/helpers/index.ts +5 -5
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/sparkHelpers/index.ts +106 -106
- package/src/index.ts +40 -40
- package/src/liquity/index.ts +116 -116
- package/src/maker/index.ts +101 -101
- package/src/markets/aave/index.ts +80 -80
- package/src/markets/aave/marketAssets.ts +24 -32
- package/src/markets/compound/index.ts +141 -141
- package/src/markets/compound/marketsAssets.ts +48 -46
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/index.ts +3 -3
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +10 -9
- package/src/moneymarket/moneymarketCommonService.ts +75 -75
- package/src/morpho/markets.ts +39 -39
- package/src/morphoAaveV2/index.ts +255 -255
- package/src/morphoAaveV3/index.ts +619 -619
- 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 +48 -35
- package/src/spark/index.ts +422 -422
- package/src/staking/staking.ts +167 -167
- package/src/types/aave.ts +256 -256
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +83 -83
- package/src/types/compound.ts +128 -128
- package/src/types/contracts/generated/CrvUSDView.ts +43 -8
- package/src/types/contracts/generated/MorphoAaveV3ProxyEthMarket.ts +2 -0
- package/src/types/curveUsd.ts +118 -112
- package/src/types/index.ts +6 -6
- package/src/types/liquity.ts +30 -30
- package/src/types/maker.ts +50 -50
- package/src/types/spark.ts +106 -106
- package/yarn-error.log +64 -0
package/src/types/common.ts
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
// General
|
|
2
|
-
export type EthAddress = string;
|
|
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
|
-
}
|
|
13
|
-
export type Networkish = string | NetworkNumber;
|
|
14
|
-
|
|
15
|
-
// Common
|
|
16
|
-
export interface MMAssetData {
|
|
17
|
-
symbol: string,
|
|
18
|
-
supplyRate: string,
|
|
19
|
-
borrowRate: string,
|
|
20
|
-
price: string,
|
|
21
|
-
collateralFactor: string,
|
|
22
|
-
underlyingTokenAddress: string,
|
|
23
|
-
marketLiquidity: string,
|
|
24
|
-
utilization: string,
|
|
25
|
-
borrowCap: string,
|
|
26
|
-
totalSupply: string,
|
|
27
|
-
canBeBorrowed: boolean,
|
|
28
|
-
canBeSupplied: boolean,
|
|
29
|
-
totalBorrow: string,
|
|
30
|
-
incentiveBorrowApy?: string,
|
|
31
|
-
incentiveBorrowToken?: string,
|
|
32
|
-
incentiveSupplyApy?: string,
|
|
33
|
-
incentiveSupplyToken?: string,
|
|
34
|
-
borrowRateP2P?: string,
|
|
35
|
-
supplyRateP2P?: string,
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface MMAssetsData {
|
|
39
|
-
[token: string]: MMAssetData,
|
|
40
|
-
}
|
|
41
|
-
export interface MMMarketData {
|
|
42
|
-
assetsData: MMAssetData[],
|
|
43
|
-
}
|
|
44
|
-
export interface MMUsedAsset {
|
|
45
|
-
symbol: string,
|
|
46
|
-
supplied: string,
|
|
47
|
-
suppliedUsd: string,
|
|
48
|
-
isSupplied: boolean,
|
|
49
|
-
borrowed: string,
|
|
50
|
-
borrowedUsd: string,
|
|
51
|
-
isBorrowed: boolean,
|
|
52
|
-
debt: string,
|
|
53
|
-
supplyRate?: string,
|
|
54
|
-
borrowRate?: string,
|
|
55
|
-
discountedBorrowRate?: string,
|
|
56
|
-
stableBorrowRate?: 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,
|
|
1
|
+
// General
|
|
2
|
+
export type EthAddress = string;
|
|
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
|
+
}
|
|
13
|
+
export type Networkish = string | NetworkNumber;
|
|
14
|
+
|
|
15
|
+
// Common
|
|
16
|
+
export interface MMAssetData {
|
|
17
|
+
symbol: string,
|
|
18
|
+
supplyRate: string,
|
|
19
|
+
borrowRate: string,
|
|
20
|
+
price: string,
|
|
21
|
+
collateralFactor: string,
|
|
22
|
+
underlyingTokenAddress: string,
|
|
23
|
+
marketLiquidity: string,
|
|
24
|
+
utilization: string,
|
|
25
|
+
borrowCap: string,
|
|
26
|
+
totalSupply: string,
|
|
27
|
+
canBeBorrowed: boolean,
|
|
28
|
+
canBeSupplied: boolean,
|
|
29
|
+
totalBorrow: string,
|
|
30
|
+
incentiveBorrowApy?: string,
|
|
31
|
+
incentiveBorrowToken?: string,
|
|
32
|
+
incentiveSupplyApy?: string,
|
|
33
|
+
incentiveSupplyToken?: string,
|
|
34
|
+
borrowRateP2P?: string,
|
|
35
|
+
supplyRateP2P?: string,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface MMAssetsData {
|
|
39
|
+
[token: string]: MMAssetData,
|
|
40
|
+
}
|
|
41
|
+
export interface MMMarketData {
|
|
42
|
+
assetsData: MMAssetData[],
|
|
43
|
+
}
|
|
44
|
+
export interface MMUsedAsset {
|
|
45
|
+
symbol: string,
|
|
46
|
+
supplied: string,
|
|
47
|
+
suppliedUsd: string,
|
|
48
|
+
isSupplied: boolean,
|
|
49
|
+
borrowed: string,
|
|
50
|
+
borrowedUsd: string,
|
|
51
|
+
isBorrowed: boolean,
|
|
52
|
+
debt: string,
|
|
53
|
+
supplyRate?: string,
|
|
54
|
+
borrowRate?: string,
|
|
55
|
+
discountedBorrowRate?: string,
|
|
56
|
+
stableBorrowRate?: 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
84
|
}
|
package/src/types/compound.ts
CHANGED
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
|
|
3
|
-
} from './common';
|
|
4
|
-
|
|
5
|
-
export enum CompoundVersions {
|
|
6
|
-
'CompoundV2' = 'v2',
|
|
7
|
-
'CompoundV3USDC' = 'v3-USDC',
|
|
8
|
-
'CompoundV3USDCe' = 'v3-USDC.e',
|
|
9
|
-
'CompoundV3ETH' = 'v3-ETH',
|
|
10
|
-
'CompoundV3USDbC' = 'v3-USDbC',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface CompoundBulkerOptions {
|
|
14
|
-
supply: number | string,
|
|
15
|
-
withdraw: number | string,
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface CompoundMarketData {
|
|
19
|
-
chainIds: NetworkNumber[],
|
|
20
|
-
label: string,
|
|
21
|
-
shortLabel: string,
|
|
22
|
-
value: CompoundVersions,
|
|
23
|
-
baseAsset: string,
|
|
24
|
-
collAssets: readonly string[],
|
|
25
|
-
baseMarket: string,
|
|
26
|
-
baseMarketAddress: string,
|
|
27
|
-
secondLabel: string,
|
|
28
|
-
bulkerName: string,
|
|
29
|
-
bulkerAddress: string,
|
|
30
|
-
bulkerOptions: CompoundBulkerOptions,
|
|
31
|
-
// icon: Function,
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface CompoundUsedAsset extends MMUsedAsset {
|
|
35
|
-
collateral: boolean,
|
|
36
|
-
limit?: string,
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface CompoundV2UsedAsset extends CompoundUsedAsset {
|
|
40
|
-
}
|
|
41
|
-
export interface CompoundV3UsedAsset extends CompoundUsedAsset {
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface CompoundUsedAssets<T> {
|
|
45
|
-
[token: string]: T,
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export type CompoundV2UsedAssets = CompoundUsedAssets<CompoundV2UsedAsset>;
|
|
49
|
-
export type CompoundV3UsedAssets = CompoundUsedAssets<CompoundV3UsedAsset>;
|
|
50
|
-
|
|
51
|
-
export interface CompoundAssetData extends MMAssetData {
|
|
52
|
-
supplyCapAlternative?: string,
|
|
53
|
-
totalSupplyAlternative?: string,
|
|
54
|
-
priceAlternative?: string,
|
|
55
|
-
sortIndex?: number,
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface CompoundV2AssetData extends CompoundAssetData {
|
|
59
|
-
}
|
|
60
|
-
export interface CompoundV3AssetData extends CompoundAssetData {
|
|
61
|
-
borrowCollateralFactor: string,
|
|
62
|
-
liquidateCollateralFactor: string,
|
|
63
|
-
minDebt: string,
|
|
64
|
-
liquidationRatio: string,
|
|
65
|
-
supplyCap: string,
|
|
66
|
-
priceInBaseAsset: string,
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface CompoundAssetsData<T> {
|
|
70
|
-
[token: string]: T
|
|
71
|
-
}
|
|
72
|
-
export type CompoundV2AssetsData = CompoundAssetsData<CompoundV2AssetData>;
|
|
73
|
-
export type CompoundV3AssetsData = CompoundAssetsData<CompoundV3AssetData>;
|
|
74
|
-
|
|
75
|
-
export type CompoundMarketsData<T> = { assetsData: T };
|
|
76
|
-
export type CompoundV2MarketsData = CompoundMarketsData<CompoundV2AssetsData>;
|
|
77
|
-
export type CompoundV3MarketsData = CompoundMarketsData<CompoundV3AssetsData>;
|
|
78
|
-
|
|
79
|
-
export interface BaseAdditionalAssetData {
|
|
80
|
-
totalBorrow: string,
|
|
81
|
-
utilization: string,
|
|
82
|
-
marketLiquidity: string,
|
|
83
|
-
rewardSupplySpeed: string,
|
|
84
|
-
rewardBorrowSpeed: string,
|
|
85
|
-
minDebt: string,
|
|
86
|
-
isBase: boolean,
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface CompoundAggregatedPositionData {
|
|
90
|
-
suppliedUsd: string,
|
|
91
|
-
suppliedCollateralUsd: string,
|
|
92
|
-
borrowedUsd: string,
|
|
93
|
-
borrowLimitUsd: string,
|
|
94
|
-
liquidationLimitUsd: string,
|
|
95
|
-
leftToBorrowUsd: string,
|
|
96
|
-
ratio: string,
|
|
97
|
-
collRatio: string,
|
|
98
|
-
netApy: string,
|
|
99
|
-
incentiveUsd: string,
|
|
100
|
-
totalInterestUsd: string,
|
|
101
|
-
liqRatio: string,
|
|
102
|
-
liqPercent: string,
|
|
103
|
-
leveragedType: string,
|
|
104
|
-
leveragedAsset?: string,
|
|
105
|
-
leveragedLsdAssetRatio?: string,
|
|
106
|
-
liquidationPrice?: string,
|
|
107
|
-
minRatio: string,
|
|
108
|
-
debtTooLow: boolean,
|
|
109
|
-
minDebt: string,
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export interface CompoundPositionData extends MMPositionData {
|
|
113
|
-
ratio: string,
|
|
114
|
-
minRatio: string,
|
|
115
|
-
borrowedUsd: string,
|
|
116
|
-
borrowLimitUsd: string,
|
|
117
|
-
incentiveUsd: string,
|
|
118
|
-
totalInterestUsd: string,
|
|
119
|
-
isSubscribedToAutomation?: boolean,
|
|
120
|
-
automationResubscribeRequired?: boolean,
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export interface CompoundV2PositionData extends CompoundPositionData {
|
|
124
|
-
usedAssets: CompoundV2UsedAssets,
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface CompoundV3PositionData extends CompoundPositionData {
|
|
128
|
-
usedAssets: CompoundV3UsedAssets,
|
|
1
|
+
import {
|
|
2
|
+
MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
|
|
3
|
+
} from './common';
|
|
4
|
+
|
|
5
|
+
export enum CompoundVersions {
|
|
6
|
+
'CompoundV2' = 'v2',
|
|
7
|
+
'CompoundV3USDC' = 'v3-USDC',
|
|
8
|
+
'CompoundV3USDCe' = 'v3-USDC.e',
|
|
9
|
+
'CompoundV3ETH' = 'v3-ETH',
|
|
10
|
+
'CompoundV3USDbC' = 'v3-USDbC',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface CompoundBulkerOptions {
|
|
14
|
+
supply: number | string,
|
|
15
|
+
withdraw: number | string,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface CompoundMarketData {
|
|
19
|
+
chainIds: NetworkNumber[],
|
|
20
|
+
label: string,
|
|
21
|
+
shortLabel: string,
|
|
22
|
+
value: CompoundVersions,
|
|
23
|
+
baseAsset: string,
|
|
24
|
+
collAssets: readonly string[],
|
|
25
|
+
baseMarket: string,
|
|
26
|
+
baseMarketAddress: string,
|
|
27
|
+
secondLabel: string,
|
|
28
|
+
bulkerName: string,
|
|
29
|
+
bulkerAddress: string,
|
|
30
|
+
bulkerOptions: CompoundBulkerOptions,
|
|
31
|
+
// icon: Function,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface CompoundUsedAsset extends MMUsedAsset {
|
|
35
|
+
collateral: boolean,
|
|
36
|
+
limit?: string,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface CompoundV2UsedAsset extends CompoundUsedAsset {
|
|
40
|
+
}
|
|
41
|
+
export interface CompoundV3UsedAsset extends CompoundUsedAsset {
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface CompoundUsedAssets<T> {
|
|
45
|
+
[token: string]: T,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type CompoundV2UsedAssets = CompoundUsedAssets<CompoundV2UsedAsset>;
|
|
49
|
+
export type CompoundV3UsedAssets = CompoundUsedAssets<CompoundV3UsedAsset>;
|
|
50
|
+
|
|
51
|
+
export interface CompoundAssetData extends MMAssetData {
|
|
52
|
+
supplyCapAlternative?: string,
|
|
53
|
+
totalSupplyAlternative?: string,
|
|
54
|
+
priceAlternative?: string,
|
|
55
|
+
sortIndex?: number,
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface CompoundV2AssetData extends CompoundAssetData {
|
|
59
|
+
}
|
|
60
|
+
export interface CompoundV3AssetData extends CompoundAssetData {
|
|
61
|
+
borrowCollateralFactor: string,
|
|
62
|
+
liquidateCollateralFactor: string,
|
|
63
|
+
minDebt: string,
|
|
64
|
+
liquidationRatio: string,
|
|
65
|
+
supplyCap: string,
|
|
66
|
+
priceInBaseAsset: string,
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface CompoundAssetsData<T> {
|
|
70
|
+
[token: string]: T
|
|
71
|
+
}
|
|
72
|
+
export type CompoundV2AssetsData = CompoundAssetsData<CompoundV2AssetData>;
|
|
73
|
+
export type CompoundV3AssetsData = CompoundAssetsData<CompoundV3AssetData>;
|
|
74
|
+
|
|
75
|
+
export type CompoundMarketsData<T> = { assetsData: T };
|
|
76
|
+
export type CompoundV2MarketsData = CompoundMarketsData<CompoundV2AssetsData>;
|
|
77
|
+
export type CompoundV3MarketsData = CompoundMarketsData<CompoundV3AssetsData>;
|
|
78
|
+
|
|
79
|
+
export interface BaseAdditionalAssetData {
|
|
80
|
+
totalBorrow: string,
|
|
81
|
+
utilization: string,
|
|
82
|
+
marketLiquidity: string,
|
|
83
|
+
rewardSupplySpeed: string,
|
|
84
|
+
rewardBorrowSpeed: string,
|
|
85
|
+
minDebt: string,
|
|
86
|
+
isBase: boolean,
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface CompoundAggregatedPositionData {
|
|
90
|
+
suppliedUsd: string,
|
|
91
|
+
suppliedCollateralUsd: string,
|
|
92
|
+
borrowedUsd: string,
|
|
93
|
+
borrowLimitUsd: string,
|
|
94
|
+
liquidationLimitUsd: string,
|
|
95
|
+
leftToBorrowUsd: string,
|
|
96
|
+
ratio: string,
|
|
97
|
+
collRatio: string,
|
|
98
|
+
netApy: string,
|
|
99
|
+
incentiveUsd: string,
|
|
100
|
+
totalInterestUsd: string,
|
|
101
|
+
liqRatio: string,
|
|
102
|
+
liqPercent: string,
|
|
103
|
+
leveragedType: string,
|
|
104
|
+
leveragedAsset?: string,
|
|
105
|
+
leveragedLsdAssetRatio?: string,
|
|
106
|
+
liquidationPrice?: string,
|
|
107
|
+
minRatio: string,
|
|
108
|
+
debtTooLow: boolean,
|
|
109
|
+
minDebt: string,
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface CompoundPositionData extends MMPositionData {
|
|
113
|
+
ratio: string,
|
|
114
|
+
minRatio: string,
|
|
115
|
+
borrowedUsd: string,
|
|
116
|
+
borrowLimitUsd: string,
|
|
117
|
+
incentiveUsd: string,
|
|
118
|
+
totalInterestUsd: string,
|
|
119
|
+
isSubscribedToAutomation?: boolean,
|
|
120
|
+
automationResubscribeRequired?: boolean,
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface CompoundV2PositionData extends CompoundPositionData {
|
|
124
|
+
usedAssets: CompoundV2UsedAssets,
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface CompoundV3PositionData extends CompoundPositionData {
|
|
128
|
+
usedAssets: CompoundV3UsedAssets,
|
|
129
129
|
}
|
|
@@ -159,7 +159,9 @@ export declare namespace CurveUsdView {
|
|
|
159
159
|
number | string | BN,
|
|
160
160
|
number | string | BN,
|
|
161
161
|
[number | string | BN, number | string | BN],
|
|
162
|
-
[number | string | BN[], number | string | BN[]]
|
|
162
|
+
[number | string | BN[], number | string | BN[]],
|
|
163
|
+
number | string | BN,
|
|
164
|
+
boolean
|
|
163
165
|
]
|
|
164
166
|
| {
|
|
165
167
|
loanExists: boolean;
|
|
@@ -174,6 +176,8 @@ export declare namespace CurveUsdView {
|
|
|
174
176
|
health: number | string | BN;
|
|
175
177
|
bandRange: [number | string | BN, number | string | BN];
|
|
176
178
|
usersBands: [number | string | BN[], number | string | BN[]];
|
|
179
|
+
collRatio: number | string | BN;
|
|
180
|
+
isInSoftLiquidation: boolean;
|
|
177
181
|
};
|
|
178
182
|
|
|
179
183
|
export type UserDataStructOutputArray = [
|
|
@@ -188,7 +192,9 @@ export declare namespace CurveUsdView {
|
|
|
188
192
|
string,
|
|
189
193
|
string,
|
|
190
194
|
[string, string],
|
|
191
|
-
[string[], string[]]
|
|
195
|
+
[string[], string[]],
|
|
196
|
+
string,
|
|
197
|
+
boolean
|
|
192
198
|
];
|
|
193
199
|
export type UserDataStructOutputStruct = {
|
|
194
200
|
loanExists: boolean;
|
|
@@ -203,6 +209,8 @@ export declare namespace CurveUsdView {
|
|
|
203
209
|
health: string;
|
|
204
210
|
bandRange: [string, string];
|
|
205
211
|
usersBands: [string[], string[]];
|
|
212
|
+
collRatio: string;
|
|
213
|
+
isInSoftLiquidation: boolean;
|
|
206
214
|
};
|
|
207
215
|
export type UserDataStructOutput = UserDataStructOutputArray &
|
|
208
216
|
UserDataStructOutputStruct;
|
|
@@ -216,6 +224,10 @@ export interface CrvUSDView extends BaseContract {
|
|
|
216
224
|
): CrvUSDView;
|
|
217
225
|
clone(): CrvUSDView;
|
|
218
226
|
methods: {
|
|
227
|
+
WBTC_HEALTH_ZAP(): NonPayableTransactionObject<string>;
|
|
228
|
+
|
|
229
|
+
WBTC_MARKET(): NonPayableTransactionObject<string>;
|
|
230
|
+
|
|
219
231
|
createLoanData(
|
|
220
232
|
market: string,
|
|
221
233
|
collateral: number | string | BN,
|
|
@@ -228,18 +240,32 @@ export interface CrvUSDView extends BaseContract {
|
|
|
228
240
|
n: number | string | BN
|
|
229
241
|
): NonPayableTransactionObject<CurveUsdView.BandStructOutput>;
|
|
230
242
|
|
|
231
|
-
|
|
243
|
+
getBandsData(
|
|
244
|
+
market: string,
|
|
245
|
+
from: number | string | BN,
|
|
246
|
+
to: number | string | BN
|
|
247
|
+
): NonPayableTransactionObject<CurveUsdView.BandStructOutput[]>;
|
|
248
|
+
|
|
249
|
+
getBandsDataForPosition(
|
|
232
250
|
market: string,
|
|
233
251
|
collateral: number | string | BN,
|
|
234
252
|
debt: number | string | BN,
|
|
235
253
|
N: number | string | BN
|
|
236
254
|
): NonPayableTransactionObject<CurveUsdView.BandStructOutput[]>;
|
|
237
255
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
256
|
+
getCollAmountsFromAMM(
|
|
257
|
+
_controllerAddress: string,
|
|
258
|
+
_user: string
|
|
259
|
+
): NonPayableTransactionObject<
|
|
260
|
+
[string, string] & { crvUsdAmount: string; collAmount: string }
|
|
261
|
+
>;
|
|
262
|
+
|
|
263
|
+
getCollateralRatio(
|
|
264
|
+
_user: string,
|
|
265
|
+
_controllerAddr: string
|
|
266
|
+
): NonPayableTransactionObject<
|
|
267
|
+
[string, boolean] & { collRatio: string; isInSoftLiquidation: boolean }
|
|
268
|
+
>;
|
|
243
269
|
|
|
244
270
|
globalData(
|
|
245
271
|
market: string
|
|
@@ -254,6 +280,10 @@ export interface CrvUSDView extends BaseContract {
|
|
|
254
280
|
numBands: number | string | BN
|
|
255
281
|
): NonPayableTransactionObject<string>;
|
|
256
282
|
|
|
283
|
+
isControllerValid(
|
|
284
|
+
_controllerAddr: string
|
|
285
|
+
): NonPayableTransactionObject<boolean>;
|
|
286
|
+
|
|
257
287
|
maxBorrow(
|
|
258
288
|
market: string,
|
|
259
289
|
collateral: number | string | BN,
|
|
@@ -270,6 +300,11 @@ export interface CrvUSDView extends BaseContract {
|
|
|
270
300
|
market: string,
|
|
271
301
|
user: string
|
|
272
302
|
): NonPayableTransactionObject<CurveUsdView.UserDataStructOutput>;
|
|
303
|
+
|
|
304
|
+
userMaxWithdraw(
|
|
305
|
+
_controllerAddress: string,
|
|
306
|
+
_user: string
|
|
307
|
+
): NonPayableTransactionObject<string>;
|
|
273
308
|
};
|
|
274
309
|
events: {
|
|
275
310
|
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
@@ -217,6 +217,8 @@ export interface MorphoAaveV3ProxyEthMarket extends BaseContract {
|
|
|
217
217
|
): MorphoAaveV3ProxyEthMarket;
|
|
218
218
|
clone(): MorphoAaveV3ProxyEthMarket;
|
|
219
219
|
methods: {
|
|
220
|
+
marketsCreated(): NonPayableTransactionObject<string[]>;
|
|
221
|
+
|
|
220
222
|
approveManager(
|
|
221
223
|
manager: string,
|
|
222
224
|
isAllowed: boolean
|