@defisaver/positions-sdk 2.1.43 → 2.1.44
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/compoundV2/index.js +1 -1
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/cjs/savings/morphoVaults/index.js +17 -17
- package/esm/compoundV2/index.js +1 -1
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/savings/morphoVaults/index.js +17 -17
- package/package.json +48 -48
- package/src/aaveV2/index.ts +240 -240
- package/src/aaveV3/index.ts +625 -625
- package/src/aaveV3/merit.ts +97 -97
- package/src/aaveV3/merkl.ts +74 -74
- package/src/claiming/aaveV3.ts +154 -154
- package/src/claiming/compV3.ts +22 -22
- package/src/claiming/ethena.ts +61 -61
- package/src/claiming/index.ts +12 -12
- package/src/claiming/king.ts +66 -66
- package/src/claiming/morphoBlue.ts +118 -118
- package/src/claiming/spark.ts +225 -225
- package/src/compoundV2/index.ts +244 -244
- package/src/compoundV3/index.ts +274 -274
- package/src/config/contracts.ts +1295 -1295
- package/src/constants/index.ts +10 -10
- package/src/contracts.ts +171 -171
- package/src/curveUsd/index.ts +254 -254
- package/src/eulerV2/index.ts +324 -324
- package/src/exchange/index.ts +25 -25
- package/src/fluid/index.ts +1800 -1800
- package/src/helpers/aaveHelpers/index.ts +187 -187
- package/src/helpers/compoundHelpers/index.ts +283 -283
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +222 -222
- package/src/helpers/fluidHelpers/index.ts +326 -326
- package/src/helpers/index.ts +10 -10
- package/src/helpers/liquityV2Helpers/index.ts +82 -82
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +52 -52
- package/src/helpers/morphoBlueHelpers/index.ts +396 -396
- package/src/helpers/sparkHelpers/index.ts +158 -158
- package/src/index.ts +49 -49
- package/src/liquity/index.ts +159 -159
- package/src/liquityV2/index.ts +703 -703
- package/src/llamaLend/index.ts +305 -305
- package/src/maker/index.ts +223 -223
- package/src/markets/aave/index.ts +118 -118
- package/src/markets/aave/marketAssets.ts +54 -54
- package/src/markets/compound/index.ts +243 -243
- package/src/markets/compound/marketsAssets.ts +97 -97
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/fluid/index.ts +2900 -2900
- 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 +971 -971
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +12 -12
- package/src/moneymarket/moneymarketCommonService.ts +85 -85
- package/src/morphoBlue/index.ts +274 -274
- package/src/portfolio/index.ts +598 -598
- package/src/savings/index.ts +95 -95
- package/src/savings/makerDsr/index.ts +53 -53
- package/src/savings/makerDsr/options.ts +9 -9
- package/src/savings/morphoVaults/index.ts +80 -80
- package/src/savings/morphoVaults/options.ts +193 -193
- package/src/savings/skyOptions/index.ts +95 -95
- package/src/savings/skyOptions/options.ts +10 -10
- package/src/savings/sparkSavingsVaults/index.ts +60 -60
- package/src/savings/sparkSavingsVaults/options.ts +35 -35
- package/src/savings/yearnV3Vaults/index.ts +61 -61
- package/src/savings/yearnV3Vaults/options.ts +55 -55
- package/src/savings/yearnVaults/index.ts +73 -73
- package/src/savings/yearnVaults/options.ts +32 -32
- package/src/services/priceService.ts +278 -278
- package/src/services/utils.ts +115 -115
- package/src/services/viem.ts +34 -34
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +458 -458
- package/src/staking/eligibility.ts +53 -53
- package/src/staking/index.ts +1 -1
- package/src/staking/staking.ts +186 -186
- package/src/types/aave.ts +196 -196
- package/src/types/claiming.ts +114 -114
- package/src/types/common.ts +107 -107
- package/src/types/compound.ts +144 -144
- package/src/types/curveUsd.ts +123 -123
- package/src/types/euler.ts +175 -175
- package/src/types/fluid.ts +483 -483
- package/src/types/index.ts +14 -14
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +126 -126
- package/src/types/llamaLend.ts +159 -159
- package/src/types/maker.ts +63 -63
- package/src/types/merit.ts +1 -1
- package/src/types/merkl.ts +70 -70
- package/src/types/morphoBlue.ts +200 -200
- package/src/types/portfolio.ts +60 -60
- package/src/types/savings/index.ts +23 -23
- package/src/types/savings/makerDsr.ts +13 -13
- package/src/types/savings/morphoVaults.ts +32 -32
- package/src/types/savings/sky.ts +14 -14
- package/src/types/savings/sparkSavingsVaults.ts +15 -15
- package/src/types/savings/yearnV3Vaults.ts +17 -17
- package/src/types/savings/yearnVaults.ts +14 -14
- package/src/types/spark.ts +134 -134
- package/src/umbrella/index.ts +69 -69
- package/src/umbrella/umbrellaUtils.ts +29 -29
package/src/types/portfolio.ts
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { AaveV2PositionData, AaveV3PositionData, AaveVersions } from './aave';
|
|
2
|
-
import { EthAddress } from './common';
|
|
3
|
-
import { CompoundV2PositionData, CompoundV3PositionData, CompoundVersions } from './compound';
|
|
4
|
-
import { CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
5
|
-
import { EulerV2PositionData, EulerV2Versions } from './euler';
|
|
6
|
-
import { FluidVaultData } from './fluid';
|
|
7
|
-
import { LiquityTroveInfo } from './liquity';
|
|
8
|
-
import { LiquityV2TroveData, LiquityV2Versions } from './liquityV2';
|
|
9
|
-
import { LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
10
|
-
import { CdpData } from './maker';
|
|
11
|
-
import { MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
12
|
-
import { SparkPositionData, SparkVersions } from './spark';
|
|
13
|
-
|
|
14
|
-
export interface PortfolioProtocolData<T> {
|
|
15
|
-
error: string,
|
|
16
|
-
data: T | null,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface PortfolioPositionsDataForAddress {
|
|
20
|
-
aaveV3: {
|
|
21
|
-
[key in AaveVersions]?: PortfolioProtocolData<AaveV3PositionData>;
|
|
22
|
-
};
|
|
23
|
-
morphoBlue: {
|
|
24
|
-
[key in MorphoBlueVersions]?: PortfolioProtocolData<MorphoBluePositionData>;
|
|
25
|
-
};
|
|
26
|
-
compoundV3: {
|
|
27
|
-
[key in CompoundVersions]?: PortfolioProtocolData<CompoundV3PositionData>;
|
|
28
|
-
};
|
|
29
|
-
spark: {
|
|
30
|
-
[key in SparkVersions]?: PortfolioProtocolData<SparkPositionData>;
|
|
31
|
-
};
|
|
32
|
-
eulerV2: {
|
|
33
|
-
[key in EulerV2Versions]?: Record<EthAddress, PortfolioProtocolData<EulerV2PositionData>>;
|
|
34
|
-
};
|
|
35
|
-
maker: {
|
|
36
|
-
[key: string]: PortfolioProtocolData<CdpData>;
|
|
37
|
-
};
|
|
38
|
-
aaveV2: {
|
|
39
|
-
[key in AaveVersions]?: PortfolioProtocolData<AaveV2PositionData>;
|
|
40
|
-
};
|
|
41
|
-
compoundV2: {
|
|
42
|
-
[key in CompoundVersions]?: PortfolioProtocolData<CompoundV2PositionData>;
|
|
43
|
-
};
|
|
44
|
-
liquity: PortfolioProtocolData<LiquityTroveInfo> | {};
|
|
45
|
-
crvUsd: {
|
|
46
|
-
[key in CrvUSDVersions]?: PortfolioProtocolData<CrvUSDUserData>;
|
|
47
|
-
};
|
|
48
|
-
llamaLend: {
|
|
49
|
-
[key in LlamaLendVersionsType]?: PortfolioProtocolData<LlamaLendUserData>;
|
|
50
|
-
};
|
|
51
|
-
fluid: {
|
|
52
|
-
error: string;
|
|
53
|
-
data: {
|
|
54
|
-
[key: string]: FluidVaultData;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface PortfolioPositionsData {
|
|
60
|
-
[key: EthAddress]: PortfolioPositionsDataForAddress;
|
|
1
|
+
import { AaveV2PositionData, AaveV3PositionData, AaveVersions } from './aave';
|
|
2
|
+
import { EthAddress } from './common';
|
|
3
|
+
import { CompoundV2PositionData, CompoundV3PositionData, CompoundVersions } from './compound';
|
|
4
|
+
import { CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
5
|
+
import { EulerV2PositionData, EulerV2Versions } from './euler';
|
|
6
|
+
import { FluidVaultData } from './fluid';
|
|
7
|
+
import { LiquityTroveInfo } from './liquity';
|
|
8
|
+
import { LiquityV2TroveData, LiquityV2Versions } from './liquityV2';
|
|
9
|
+
import { LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
10
|
+
import { CdpData } from './maker';
|
|
11
|
+
import { MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
12
|
+
import { SparkPositionData, SparkVersions } from './spark';
|
|
13
|
+
|
|
14
|
+
export interface PortfolioProtocolData<T> {
|
|
15
|
+
error: string,
|
|
16
|
+
data: T | null,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface PortfolioPositionsDataForAddress {
|
|
20
|
+
aaveV3: {
|
|
21
|
+
[key in AaveVersions]?: PortfolioProtocolData<AaveV3PositionData>;
|
|
22
|
+
};
|
|
23
|
+
morphoBlue: {
|
|
24
|
+
[key in MorphoBlueVersions]?: PortfolioProtocolData<MorphoBluePositionData>;
|
|
25
|
+
};
|
|
26
|
+
compoundV3: {
|
|
27
|
+
[key in CompoundVersions]?: PortfolioProtocolData<CompoundV3PositionData>;
|
|
28
|
+
};
|
|
29
|
+
spark: {
|
|
30
|
+
[key in SparkVersions]?: PortfolioProtocolData<SparkPositionData>;
|
|
31
|
+
};
|
|
32
|
+
eulerV2: {
|
|
33
|
+
[key in EulerV2Versions]?: Record<EthAddress, PortfolioProtocolData<EulerV2PositionData>>;
|
|
34
|
+
};
|
|
35
|
+
maker: {
|
|
36
|
+
[key: string]: PortfolioProtocolData<CdpData>;
|
|
37
|
+
};
|
|
38
|
+
aaveV2: {
|
|
39
|
+
[key in AaveVersions]?: PortfolioProtocolData<AaveV2PositionData>;
|
|
40
|
+
};
|
|
41
|
+
compoundV2: {
|
|
42
|
+
[key in CompoundVersions]?: PortfolioProtocolData<CompoundV2PositionData>;
|
|
43
|
+
};
|
|
44
|
+
liquity: PortfolioProtocolData<LiquityTroveInfo> | {};
|
|
45
|
+
crvUsd: {
|
|
46
|
+
[key in CrvUSDVersions]?: PortfolioProtocolData<CrvUSDUserData>;
|
|
47
|
+
};
|
|
48
|
+
llamaLend: {
|
|
49
|
+
[key in LlamaLendVersionsType]?: PortfolioProtocolData<LlamaLendUserData>;
|
|
50
|
+
};
|
|
51
|
+
fluid: {
|
|
52
|
+
error: string;
|
|
53
|
+
data: {
|
|
54
|
+
[key: string]: FluidVaultData;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface PortfolioPositionsData {
|
|
60
|
+
[key: EthAddress]: PortfolioPositionsDataForAddress;
|
|
61
61
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { EthAddress } from '../common';
|
|
2
|
-
import { MakerDsrType } from './makerDsr';
|
|
3
|
-
import { MorphoVaultType } from './morphoVaults';
|
|
4
|
-
import { SkySavingsType } from './sky';
|
|
5
|
-
import { SparkSavingsVaultType } from './sparkSavingsVaults';
|
|
6
|
-
import { YearnV3VaultType } from './yearnV3Vaults';
|
|
7
|
-
import { YearnVaultType } from './yearnVaults';
|
|
8
|
-
|
|
9
|
-
export * from './morphoVaults';
|
|
10
|
-
export * from './yearnVaults';
|
|
11
|
-
export * from './makerDsr';
|
|
12
|
-
export * from './sky';
|
|
13
|
-
export * from './sparkSavingsVaults';
|
|
14
|
-
export * from './yearnV3Vaults';
|
|
15
|
-
|
|
16
|
-
export interface SavingsVaultData {
|
|
17
|
-
poolSize: string,
|
|
18
|
-
liquidity: string,
|
|
19
|
-
supplied: Record<EthAddress, string>,
|
|
20
|
-
asset: string,
|
|
21
|
-
optionType: string,
|
|
22
|
-
}
|
|
23
|
-
|
|
1
|
+
import { EthAddress } from '../common';
|
|
2
|
+
import { MakerDsrType } from './makerDsr';
|
|
3
|
+
import { MorphoVaultType } from './morphoVaults';
|
|
4
|
+
import { SkySavingsType } from './sky';
|
|
5
|
+
import { SparkSavingsVaultType } from './sparkSavingsVaults';
|
|
6
|
+
import { YearnV3VaultType } from './yearnV3Vaults';
|
|
7
|
+
import { YearnVaultType } from './yearnVaults';
|
|
8
|
+
|
|
9
|
+
export * from './morphoVaults';
|
|
10
|
+
export * from './yearnVaults';
|
|
11
|
+
export * from './makerDsr';
|
|
12
|
+
export * from './sky';
|
|
13
|
+
export * from './sparkSavingsVaults';
|
|
14
|
+
export * from './yearnV3Vaults';
|
|
15
|
+
|
|
16
|
+
export interface SavingsVaultData {
|
|
17
|
+
poolSize: string,
|
|
18
|
+
liquidity: string,
|
|
19
|
+
supplied: Record<EthAddress, string>,
|
|
20
|
+
asset: string,
|
|
21
|
+
optionType: string,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
24
|
export type SavingsData = Partial<Record<MorphoVaultType | YearnVaultType | MakerDsrType | SkySavingsType | SparkSavingsVaultType | YearnV3VaultType, SavingsVaultData>>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { EthAddress } from '../common';
|
|
2
|
-
|
|
3
|
-
export enum MakerDsrType {
|
|
4
|
-
MakerDsrVault = 'maker_dsr',
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface MakerDsrVault {
|
|
8
|
-
type: MakerDsrType;
|
|
9
|
-
name: string;
|
|
10
|
-
address: EthAddress;
|
|
11
|
-
asset: string;
|
|
12
|
-
deploymentBlock: number;
|
|
13
|
-
isLegacy: boolean;
|
|
1
|
+
import { EthAddress } from '../common';
|
|
2
|
+
|
|
3
|
+
export enum MakerDsrType {
|
|
4
|
+
MakerDsrVault = 'maker_dsr',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface MakerDsrVault {
|
|
8
|
+
type: MakerDsrType;
|
|
9
|
+
name: string;
|
|
10
|
+
address: EthAddress;
|
|
11
|
+
asset: string;
|
|
12
|
+
deploymentBlock: number;
|
|
13
|
+
isLegacy: boolean;
|
|
14
14
|
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { EthAddress } from '../common';
|
|
2
|
-
|
|
3
|
-
export enum MorphoVaultType {
|
|
4
|
-
MorphoVaultFlagshipEth = 'morpho_vault_flagship_eth',
|
|
5
|
-
MorphoVaultGauntletUSDCCore = 'morpho_vault_gauntlet_usdc_core',
|
|
6
|
-
MorphoVaultGauntletUSDCPrime = 'morpho_vault_gauntlet_usdc_prime',
|
|
7
|
-
MorphoVaultRe7Weth = 'morpho_vault_re7_weth',
|
|
8
|
-
MorphoVaultGauntletWETHCore = 'morpho_vault_gauntlet_weth_core',
|
|
9
|
-
MorphoVaultGauntletWETHPrime = 'morpho_vault_gauntlet_weth_prime',
|
|
10
|
-
MorphoVaultBoostedUSDC = 'morpho_vault_usual_boosted_usdc',
|
|
11
|
-
MorphoVaultFlagshipUSDT = 'morpho_vault_flagship_usdt',
|
|
12
|
-
MorphoVaultGauntletUSDACore = 'morpho_vault_gauntlet_usda_core',
|
|
13
|
-
MorphoVaultGauntletUSDTPrime = 'morpho_vault_gauntlet_usdt_prime',
|
|
14
|
-
MorphoVaultGauntletResolvUSDC = 'morpho_vault_gauntlet_resolv_usdc',
|
|
15
|
-
// Steakhouse
|
|
16
|
-
MorphoVaultSteakhouseUSDT = 'morpho_vault_steakhouse_usdt',
|
|
17
|
-
MorphoVaultSteakhouseUSDC = 'morpho_vault_steakhouse_usdc',
|
|
18
|
-
MorphoVaultSteakhouseETH = 'morpho_vault_steakhouse_eth',
|
|
19
|
-
MorphoVaultSteakhousePYUSD = 'morpho_vault_steakhouse_pyusd',
|
|
20
|
-
// Smokehouse
|
|
21
|
-
MorphoVaultSmokehouseUSDT = 'morpho_vault_smokehouse_usdt',
|
|
22
|
-
MorphoVaultSmokehouseUSDC = 'morpho_vault_smokehouse_usdc',
|
|
23
|
-
MorphoVaultSmokehouseDAI = 'morpho_vault_smokehouse_dai',
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface MorphoVault {
|
|
27
|
-
type: MorphoVaultType;
|
|
28
|
-
name: string;
|
|
29
|
-
address: EthAddress;
|
|
30
|
-
asset: string;
|
|
31
|
-
deploymentBlock: number;
|
|
32
|
-
isLegacy: boolean;
|
|
1
|
+
import { EthAddress } from '../common';
|
|
2
|
+
|
|
3
|
+
export enum MorphoVaultType {
|
|
4
|
+
MorphoVaultFlagshipEth = 'morpho_vault_flagship_eth',
|
|
5
|
+
MorphoVaultGauntletUSDCCore = 'morpho_vault_gauntlet_usdc_core',
|
|
6
|
+
MorphoVaultGauntletUSDCPrime = 'morpho_vault_gauntlet_usdc_prime',
|
|
7
|
+
MorphoVaultRe7Weth = 'morpho_vault_re7_weth',
|
|
8
|
+
MorphoVaultGauntletWETHCore = 'morpho_vault_gauntlet_weth_core',
|
|
9
|
+
MorphoVaultGauntletWETHPrime = 'morpho_vault_gauntlet_weth_prime',
|
|
10
|
+
MorphoVaultBoostedUSDC = 'morpho_vault_usual_boosted_usdc',
|
|
11
|
+
MorphoVaultFlagshipUSDT = 'morpho_vault_flagship_usdt',
|
|
12
|
+
MorphoVaultGauntletUSDACore = 'morpho_vault_gauntlet_usda_core',
|
|
13
|
+
MorphoVaultGauntletUSDTPrime = 'morpho_vault_gauntlet_usdt_prime',
|
|
14
|
+
MorphoVaultGauntletResolvUSDC = 'morpho_vault_gauntlet_resolv_usdc',
|
|
15
|
+
// Steakhouse
|
|
16
|
+
MorphoVaultSteakhouseUSDT = 'morpho_vault_steakhouse_usdt',
|
|
17
|
+
MorphoVaultSteakhouseUSDC = 'morpho_vault_steakhouse_usdc',
|
|
18
|
+
MorphoVaultSteakhouseETH = 'morpho_vault_steakhouse_eth',
|
|
19
|
+
MorphoVaultSteakhousePYUSD = 'morpho_vault_steakhouse_pyusd',
|
|
20
|
+
// Smokehouse
|
|
21
|
+
MorphoVaultSmokehouseUSDT = 'morpho_vault_smokehouse_usdt',
|
|
22
|
+
MorphoVaultSmokehouseUSDC = 'morpho_vault_smokehouse_usdc',
|
|
23
|
+
MorphoVaultSmokehouseDAI = 'morpho_vault_smokehouse_dai',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface MorphoVault {
|
|
27
|
+
type: MorphoVaultType;
|
|
28
|
+
name: string;
|
|
29
|
+
address: EthAddress;
|
|
30
|
+
asset: string;
|
|
31
|
+
deploymentBlock: number;
|
|
32
|
+
isLegacy: boolean;
|
|
33
33
|
}
|
package/src/types/savings/sky.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { EthAddress } from '../common';
|
|
2
|
-
|
|
3
|
-
export enum SkySavingsType {
|
|
4
|
-
SkySavings = 'sky_savings',
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface SkySavingsOption {
|
|
8
|
-
type: SkySavingsType;
|
|
9
|
-
name: string;
|
|
10
|
-
asset: string;
|
|
11
|
-
address: EthAddress;
|
|
12
|
-
isLegacy: boolean;
|
|
13
|
-
deploymentBlock: number;
|
|
14
|
-
}
|
|
1
|
+
import { EthAddress } from '../common';
|
|
2
|
+
|
|
3
|
+
export enum SkySavingsType {
|
|
4
|
+
SkySavings = 'sky_savings',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface SkySavingsOption {
|
|
8
|
+
type: SkySavingsType;
|
|
9
|
+
name: string;
|
|
10
|
+
asset: string;
|
|
11
|
+
address: EthAddress;
|
|
12
|
+
isLegacy: boolean;
|
|
13
|
+
deploymentBlock: number;
|
|
14
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { EthAddress } from '../common';
|
|
2
|
-
|
|
3
|
-
export enum SparkSavingsVaultType {
|
|
4
|
-
SparkSavingsUSDC = 'spark_savings_usdc',
|
|
5
|
-
SparkSavingsUSDT = 'spark_savings_usdt',
|
|
6
|
-
SparkSavingsETH = 'spark_savings_eth',
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface SparkSavingsVault {
|
|
10
|
-
type: SparkSavingsVaultType;
|
|
11
|
-
name: string;
|
|
12
|
-
address: EthAddress;
|
|
13
|
-
asset: string;
|
|
14
|
-
deploymentBlock: number;
|
|
15
|
-
isLegacy: boolean;
|
|
1
|
+
import { EthAddress } from '../common';
|
|
2
|
+
|
|
3
|
+
export enum SparkSavingsVaultType {
|
|
4
|
+
SparkSavingsUSDC = 'spark_savings_usdc',
|
|
5
|
+
SparkSavingsUSDT = 'spark_savings_usdt',
|
|
6
|
+
SparkSavingsETH = 'spark_savings_eth',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface SparkSavingsVault {
|
|
10
|
+
type: SparkSavingsVaultType;
|
|
11
|
+
name: string;
|
|
12
|
+
address: EthAddress;
|
|
13
|
+
asset: string;
|
|
14
|
+
deploymentBlock: number;
|
|
15
|
+
isLegacy: boolean;
|
|
16
16
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { EthAddress } from '../common';
|
|
2
|
-
|
|
3
|
-
export enum YearnV3VaultType {
|
|
4
|
-
YearnVaultV3USDC = 'yearn_v3_vault_usdc',
|
|
5
|
-
YearnVaultV3USDS = 'yearn_v3_vault_usds',
|
|
6
|
-
YearnVaultV3USDT = 'yearn_v3_vault_usdt',
|
|
7
|
-
YearnVaultV3DAI = 'yearn_v3_vault_dai',
|
|
8
|
-
YearnVaultV3WETH_1 = 'yearn_v3_vault_weth_1',
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface YearnV3Vault {
|
|
12
|
-
type: YearnV3VaultType;
|
|
13
|
-
address: EthAddress;
|
|
14
|
-
asset: string;
|
|
15
|
-
name: string;
|
|
16
|
-
deploymentBlock: number;
|
|
17
|
-
isLegacy: boolean;
|
|
1
|
+
import { EthAddress } from '../common';
|
|
2
|
+
|
|
3
|
+
export enum YearnV3VaultType {
|
|
4
|
+
YearnVaultV3USDC = 'yearn_v3_vault_usdc',
|
|
5
|
+
YearnVaultV3USDS = 'yearn_v3_vault_usds',
|
|
6
|
+
YearnVaultV3USDT = 'yearn_v3_vault_usdt',
|
|
7
|
+
YearnVaultV3DAI = 'yearn_v3_vault_dai',
|
|
8
|
+
YearnVaultV3WETH_1 = 'yearn_v3_vault_weth_1',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface YearnV3Vault {
|
|
12
|
+
type: YearnV3VaultType;
|
|
13
|
+
address: EthAddress;
|
|
14
|
+
asset: string;
|
|
15
|
+
name: string;
|
|
16
|
+
deploymentBlock: number;
|
|
17
|
+
isLegacy: boolean;
|
|
18
18
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { EthAddress } from '../common';
|
|
2
|
-
|
|
3
|
-
export enum YearnVaultType {
|
|
4
|
-
YearnVaultDAI = 'yearn_vault_dai',
|
|
5
|
-
YearnVaultUSDC = 'yearn_vault_usdc',
|
|
6
|
-
YearnVaultUSDT = 'yearn_vault_usdt',
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface YearnVault {
|
|
10
|
-
type: YearnVaultType;
|
|
11
|
-
address: EthAddress;
|
|
12
|
-
asset: string;
|
|
13
|
-
deploymentBlock: number;
|
|
14
|
-
isLegacy: boolean;
|
|
1
|
+
import { EthAddress } from '../common';
|
|
2
|
+
|
|
3
|
+
export enum YearnVaultType {
|
|
4
|
+
YearnVaultDAI = 'yearn_vault_dai',
|
|
5
|
+
YearnVaultUSDC = 'yearn_vault_usdc',
|
|
6
|
+
YearnVaultUSDT = 'yearn_vault_usdt',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface YearnVault {
|
|
10
|
+
type: YearnVaultType;
|
|
11
|
+
address: EthAddress;
|
|
12
|
+
asset: string;
|
|
13
|
+
deploymentBlock: number;
|
|
14
|
+
isLegacy: boolean;
|
|
15
15
|
}
|
package/src/types/spark.ts
CHANGED
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
import { EModeCategoriesData } from './aave';
|
|
2
|
-
import {
|
|
3
|
-
EthAddress,
|
|
4
|
-
IncentiveData,
|
|
5
|
-
MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
|
|
6
|
-
} from './common';
|
|
7
|
-
|
|
8
|
-
export enum SparkVersions {
|
|
9
|
-
SparkV1 = 'v1default',
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface SparkEModeCategoryData {
|
|
13
|
-
label: string,
|
|
14
|
-
liquidationBonus: string,
|
|
15
|
-
liquidationRatio: string,
|
|
16
|
-
collateralFactor: string,
|
|
17
|
-
priceSource: string,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface SparkEModeCategoryDataMapping {
|
|
21
|
-
enteringTerms: boolean[],
|
|
22
|
-
canEnterCategory: boolean,
|
|
23
|
-
id: number,
|
|
24
|
-
enabledData: {
|
|
25
|
-
ratio: string,
|
|
26
|
-
liqRatio: string,
|
|
27
|
-
liqPercent: string,
|
|
28
|
-
collRatio: string,
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface SparkMarketData {
|
|
33
|
-
chainIds: NetworkNumber[],
|
|
34
|
-
label: string,
|
|
35
|
-
shortLabel: string,
|
|
36
|
-
url: string,
|
|
37
|
-
value: SparkVersions,
|
|
38
|
-
assets: readonly string[],
|
|
39
|
-
provider: '' | 'SparkPoolAddressesProvider',
|
|
40
|
-
providerAddress: EthAddress,
|
|
41
|
-
lendingPool: 'SparkLendingPool',
|
|
42
|
-
lendingPoolAddress: EthAddress,
|
|
43
|
-
protocolData: '' | 'SparkProtocolDataProvider',
|
|
44
|
-
protocolDataAddress: EthAddress,
|
|
45
|
-
subVersionLabel?: string
|
|
46
|
-
// icon: Function,
|
|
47
|
-
protocolName: string,
|
|
48
|
-
disabled?: boolean,
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface SparkAssetData extends MMAssetData {
|
|
52
|
-
totalBorrowVar: string,
|
|
53
|
-
sortIndex?: number,
|
|
54
|
-
usageAsCollateralEnabled: boolean,
|
|
55
|
-
isIsolated: boolean,
|
|
56
|
-
eModeCategory: number,
|
|
57
|
-
liquidationBonus: string,
|
|
58
|
-
liquidationRatio: string,
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface SparkAssetsData {
|
|
62
|
-
[token: string]: SparkAssetData,
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export type SparkMarketsData = { assetsData: SparkAssetsData, eModeCategoriesData: EModeCategoriesData };
|
|
66
|
-
|
|
67
|
-
export interface SparkUsedAsset extends MMUsedAsset {
|
|
68
|
-
stableBorrowRate: string,
|
|
69
|
-
borrowedStable: string,
|
|
70
|
-
borrowedVariable: string,
|
|
71
|
-
borrowedUsdStable: string,
|
|
72
|
-
borrowedUsdVariable: string,
|
|
73
|
-
stableLimit: string,
|
|
74
|
-
variableLimit: string,
|
|
75
|
-
limit: string,
|
|
76
|
-
eModeCategory: number,
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface SparkUsedAssets {
|
|
80
|
-
[token: string]: SparkUsedAsset,
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export interface SparkHelperCommon {
|
|
84
|
-
usedAssets: SparkUsedAssets,
|
|
85
|
-
eModeCategory: number,
|
|
86
|
-
eModeCategoriesData?: EModeCategoriesData,
|
|
87
|
-
assetsData: SparkAssetsData,
|
|
88
|
-
selectedMarket?: SparkMarketData,
|
|
89
|
-
network?: NetworkNumber,
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface SparkAggregatedPositionData {
|
|
93
|
-
suppliedUsd: string,
|
|
94
|
-
suppliedCollateralUsd: string,
|
|
95
|
-
borrowedUsd: string,
|
|
96
|
-
borrowLimitUsd: string,
|
|
97
|
-
liquidationLimitUsd: string,
|
|
98
|
-
leftToBorrowUsd: string,
|
|
99
|
-
ratio: string,
|
|
100
|
-
collRatio: string,
|
|
101
|
-
netApy: string,
|
|
102
|
-
incentiveUsd: string,
|
|
103
|
-
totalInterestUsd: string,
|
|
104
|
-
liqRatio: string,
|
|
105
|
-
liqPercent: string,
|
|
106
|
-
leveragedType: string,
|
|
107
|
-
leveragedAsset?: string,
|
|
108
|
-
leveragedLsdAssetRatio?: string,
|
|
109
|
-
liquidationPrice?: string,
|
|
110
|
-
minCollRatio: string,
|
|
111
|
-
collLiquidationRatio: string,
|
|
112
|
-
healthRatio: string;
|
|
113
|
-
minHealthRatio: string;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface SparkPositionData extends MMPositionData {
|
|
117
|
-
ratio: string,
|
|
118
|
-
minRatio: string,
|
|
119
|
-
collRatio: string,
|
|
120
|
-
suppliedUsd: string,
|
|
121
|
-
borrowedUsd: string,
|
|
122
|
-
borrowLimitUsd: string,
|
|
123
|
-
suppliedCollateralUsd: string,
|
|
124
|
-
incentiveUsd: string,
|
|
125
|
-
totalInterestUsd: string,
|
|
126
|
-
isSubscribedToAutomation?: boolean,
|
|
127
|
-
automationResubscribeRequired?: boolean,
|
|
128
|
-
totalSupplied: string,
|
|
129
|
-
usedAssets: SparkUsedAssets,
|
|
130
|
-
eModeCategory: number,
|
|
131
|
-
isInIsolationMode: boolean,
|
|
132
|
-
isInSiloedMode: boolean,
|
|
133
|
-
eModeCategories: { [key: number]: SparkEModeCategoryDataMapping },
|
|
134
|
-
}
|
|
1
|
+
import { EModeCategoriesData } from './aave';
|
|
2
|
+
import {
|
|
3
|
+
EthAddress,
|
|
4
|
+
IncentiveData,
|
|
5
|
+
MMAssetData, MMPositionData, MMUsedAsset, NetworkNumber,
|
|
6
|
+
} from './common';
|
|
7
|
+
|
|
8
|
+
export enum SparkVersions {
|
|
9
|
+
SparkV1 = 'v1default',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface SparkEModeCategoryData {
|
|
13
|
+
label: string,
|
|
14
|
+
liquidationBonus: string,
|
|
15
|
+
liquidationRatio: string,
|
|
16
|
+
collateralFactor: string,
|
|
17
|
+
priceSource: string,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface SparkEModeCategoryDataMapping {
|
|
21
|
+
enteringTerms: boolean[],
|
|
22
|
+
canEnterCategory: boolean,
|
|
23
|
+
id: number,
|
|
24
|
+
enabledData: {
|
|
25
|
+
ratio: string,
|
|
26
|
+
liqRatio: string,
|
|
27
|
+
liqPercent: string,
|
|
28
|
+
collRatio: string,
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface SparkMarketData {
|
|
33
|
+
chainIds: NetworkNumber[],
|
|
34
|
+
label: string,
|
|
35
|
+
shortLabel: string,
|
|
36
|
+
url: string,
|
|
37
|
+
value: SparkVersions,
|
|
38
|
+
assets: readonly string[],
|
|
39
|
+
provider: '' | 'SparkPoolAddressesProvider',
|
|
40
|
+
providerAddress: EthAddress,
|
|
41
|
+
lendingPool: 'SparkLendingPool',
|
|
42
|
+
lendingPoolAddress: EthAddress,
|
|
43
|
+
protocolData: '' | 'SparkProtocolDataProvider',
|
|
44
|
+
protocolDataAddress: EthAddress,
|
|
45
|
+
subVersionLabel?: string
|
|
46
|
+
// icon: Function,
|
|
47
|
+
protocolName: string,
|
|
48
|
+
disabled?: boolean,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface SparkAssetData extends MMAssetData {
|
|
52
|
+
totalBorrowVar: string,
|
|
53
|
+
sortIndex?: number,
|
|
54
|
+
usageAsCollateralEnabled: boolean,
|
|
55
|
+
isIsolated: boolean,
|
|
56
|
+
eModeCategory: number,
|
|
57
|
+
liquidationBonus: string,
|
|
58
|
+
liquidationRatio: string,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface SparkAssetsData {
|
|
62
|
+
[token: string]: SparkAssetData,
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type SparkMarketsData = { assetsData: SparkAssetsData, eModeCategoriesData: EModeCategoriesData };
|
|
66
|
+
|
|
67
|
+
export interface SparkUsedAsset extends MMUsedAsset {
|
|
68
|
+
stableBorrowRate: string,
|
|
69
|
+
borrowedStable: string,
|
|
70
|
+
borrowedVariable: string,
|
|
71
|
+
borrowedUsdStable: string,
|
|
72
|
+
borrowedUsdVariable: string,
|
|
73
|
+
stableLimit: string,
|
|
74
|
+
variableLimit: string,
|
|
75
|
+
limit: string,
|
|
76
|
+
eModeCategory: number,
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface SparkUsedAssets {
|
|
80
|
+
[token: string]: SparkUsedAsset,
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface SparkHelperCommon {
|
|
84
|
+
usedAssets: SparkUsedAssets,
|
|
85
|
+
eModeCategory: number,
|
|
86
|
+
eModeCategoriesData?: EModeCategoriesData,
|
|
87
|
+
assetsData: SparkAssetsData,
|
|
88
|
+
selectedMarket?: SparkMarketData,
|
|
89
|
+
network?: NetworkNumber,
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface SparkAggregatedPositionData {
|
|
93
|
+
suppliedUsd: string,
|
|
94
|
+
suppliedCollateralUsd: string,
|
|
95
|
+
borrowedUsd: string,
|
|
96
|
+
borrowLimitUsd: string,
|
|
97
|
+
liquidationLimitUsd: string,
|
|
98
|
+
leftToBorrowUsd: string,
|
|
99
|
+
ratio: string,
|
|
100
|
+
collRatio: string,
|
|
101
|
+
netApy: string,
|
|
102
|
+
incentiveUsd: string,
|
|
103
|
+
totalInterestUsd: string,
|
|
104
|
+
liqRatio: string,
|
|
105
|
+
liqPercent: string,
|
|
106
|
+
leveragedType: string,
|
|
107
|
+
leveragedAsset?: string,
|
|
108
|
+
leveragedLsdAssetRatio?: string,
|
|
109
|
+
liquidationPrice?: string,
|
|
110
|
+
minCollRatio: string,
|
|
111
|
+
collLiquidationRatio: string,
|
|
112
|
+
healthRatio: string;
|
|
113
|
+
minHealthRatio: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface SparkPositionData extends MMPositionData {
|
|
117
|
+
ratio: string,
|
|
118
|
+
minRatio: string,
|
|
119
|
+
collRatio: string,
|
|
120
|
+
suppliedUsd: string,
|
|
121
|
+
borrowedUsd: string,
|
|
122
|
+
borrowLimitUsd: string,
|
|
123
|
+
suppliedCollateralUsd: string,
|
|
124
|
+
incentiveUsd: string,
|
|
125
|
+
totalInterestUsd: string,
|
|
126
|
+
isSubscribedToAutomation?: boolean,
|
|
127
|
+
automationResubscribeRequired?: boolean,
|
|
128
|
+
totalSupplied: string,
|
|
129
|
+
usedAssets: SparkUsedAssets,
|
|
130
|
+
eModeCategory: number,
|
|
131
|
+
isInIsolationMode: boolean,
|
|
132
|
+
isInSiloedMode: boolean,
|
|
133
|
+
eModeCategories: { [key: number]: SparkEModeCategoryDataMapping },
|
|
134
|
+
}
|