@defisaver/positions-sdk 2.1.161-portfolio-api-1-dev → 2.1.161
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/cjs/portfolio/index.d.ts +2 -2
- package/cjs/portfolio/index.js +3 -5
- package/cjs/savings/index.js +5 -2
- package/cjs/savings/morphoVaults/index.d.ts +1 -1
- package/cjs/savings/morphoVaults/index.js +56 -18
- package/cjs/savings/morphoVaults/options.d.ts +2 -0
- package/cjs/savings/morphoVaults/options.js +61 -1
- package/cjs/types/aave.d.ts +2 -15
- package/cjs/types/compound.d.ts +2 -26
- package/cjs/types/curveUsd.d.ts +1 -9
- package/cjs/types/llamaLend.d.ts +1 -12
- package/cjs/types/morphoBlue.d.ts +0 -2
- package/cjs/types/portfolio.d.ts +8 -23
- package/cjs/types/savings/morphoVaults.d.ts +10 -2
- package/cjs/types/savings/morphoVaults.js +9 -1
- package/cjs/types/spark.d.ts +1 -21
- package/esm/portfolio/index.d.ts +2 -2
- package/esm/portfolio/index.js +3 -5
- package/esm/savings/index.js +5 -2
- package/esm/savings/morphoVaults/index.d.ts +1 -1
- package/esm/savings/morphoVaults/index.js +57 -19
- package/esm/savings/morphoVaults/options.d.ts +2 -0
- package/esm/savings/morphoVaults/options.js +61 -1
- package/esm/types/aave.d.ts +2 -15
- package/esm/types/compound.d.ts +2 -26
- package/esm/types/curveUsd.d.ts +1 -9
- package/esm/types/llamaLend.d.ts +1 -12
- package/esm/types/morphoBlue.d.ts +0 -2
- package/esm/types/portfolio.d.ts +8 -23
- package/esm/types/savings/morphoVaults.d.ts +10 -2
- package/esm/types/savings/morphoVaults.js +8 -0
- package/esm/types/spark.d.ts +1 -21
- package/package.json +1 -1
- package/src/portfolio/index.ts +4 -7
- package/src/savings/index.ts +5 -2
- package/src/savings/morphoVaults/index.ts +73 -21
- package/src/savings/morphoVaults/options.ts +67 -1
- package/src/types/aave.ts +1 -18
- package/src/types/compound.ts +2 -38
- package/src/types/curveUsd.ts +1 -17
- package/src/types/llamaLend.ts +1 -19
- package/src/types/morphoBlue.ts +0 -3
- package/src/types/portfolio.ts +9 -28
- package/src/types/savings/morphoVaults.ts +11 -1
- package/src/types/spark.ts +1 -25
package/src/types/llamaLend.ts
CHANGED
|
@@ -141,13 +141,7 @@ export interface LlamaLendUsedAssets {
|
|
|
141
141
|
[key: string]: LlamaLendUsedAsset,
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
// type-check.
|
|
146
|
-
export type LlamaLendPositionAggregatedFields = Partial<Pick<LlamaLendAggregatedPositionData,
|
|
147
|
-
| 'borrowLimitUsd' | 'minAllowedRatio' | 'collFactor' | 'leveragedType' | 'leveragedAsset' | 'liquidationPrice'
|
|
148
|
-
| 'netApy' | 'incentiveUsd' | 'totalInterestUsd'>>;
|
|
149
|
-
|
|
150
|
-
export interface LlamaLendUserData extends LlamaLendPositionAggregatedFields {
|
|
144
|
+
export interface LlamaLendUserData {
|
|
151
145
|
debtAmount: string,
|
|
152
146
|
health: string,
|
|
153
147
|
healthPercent: string,
|
|
@@ -166,16 +160,4 @@ export interface LlamaLendUserData extends LlamaLendPositionAggregatedFields {
|
|
|
166
160
|
loanExists: boolean,
|
|
167
161
|
borrowRate?: string,
|
|
168
162
|
exposure: string,
|
|
169
|
-
// Fields of LlamaLendView's userData that _getLlamaLendUserData spreads in unconverted. Optional, so objects built
|
|
170
|
-
// by hand still type-check.
|
|
171
|
-
collateralPrice?: bigint,
|
|
172
|
-
marketCollateralAmount?: bigint,
|
|
173
|
-
debtTokenCollateralAmount?: bigint,
|
|
174
|
-
N?: bigint,
|
|
175
|
-
bandRange?: readonly [bigint, bigint],
|
|
176
|
-
usersBands?: readonly [readonly bigint[], readonly bigint[]],
|
|
177
|
-
collRatio?: bigint,
|
|
178
|
-
isInSoftLiquidation?: boolean,
|
|
179
|
-
debtTokenSuppliedShares?: bigint,
|
|
180
|
-
debtTokenSuppliedAssets?: bigint,
|
|
181
163
|
}
|
package/src/types/morphoBlue.ts
CHANGED
|
@@ -236,9 +236,6 @@ export interface MorphoBluePositionData {
|
|
|
236
236
|
supplyShares: string,
|
|
237
237
|
borrowShares: string,
|
|
238
238
|
exposure: string,
|
|
239
|
-
// Set by getMorphoBlueAggregatedPositionData. Optional, so objects built by hand still type-check.
|
|
240
|
-
minCollRatio?: string,
|
|
241
|
-
collLiquidationRatio?: string,
|
|
242
239
|
}
|
|
243
240
|
|
|
244
241
|
export interface MorphoBlueEarnData {
|
package/src/types/portfolio.ts
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from './aave';
|
|
4
|
-
import { AaveV4AccountData, AaveV4SpokeData, AaveV4SpokesType } from './aaveV4';
|
|
1
|
+
import { AaveV2PositionData, AaveV3PositionData, AaveVersions } from './aave';
|
|
2
|
+
import { AaveV4AccountData, AaveV4SpokesType } from './aaveV4';
|
|
5
3
|
import { EthAddress } from './common';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
} from './compound';
|
|
9
|
-
import { CrvUSDGlobalMarketData, CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
4
|
+
import { CompoundV2PositionData, CompoundV3PositionData, CompoundVersions } from './compound';
|
|
5
|
+
import { CrvUSDUserData, CrvUSDVersions } from './curveUsd';
|
|
10
6
|
import { FluidVaultData } from './fluid';
|
|
11
7
|
import { LiquityTroveInfo } from './liquity';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import { LiquityV2TroveData, LiquityV2Versions } from './liquityV2';
|
|
9
|
+
import { LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
|
|
14
10
|
import { CdpData } from './maker';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
11
|
+
import { MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
|
|
12
|
+
import { MorphoMidnightPositionData, MorphoMidnightVersions } from './morphoMidnight';
|
|
13
|
+
import { SparkPositionData, SparkVersions } from './spark';
|
|
18
14
|
|
|
19
15
|
export interface PortfolioProtocolData<T> {
|
|
20
16
|
error: string,
|
|
@@ -66,19 +62,4 @@ export interface PortfolioPositionsDataForAddress {
|
|
|
66
62
|
|
|
67
63
|
export interface PortfolioPositionsData {
|
|
68
64
|
[key: EthAddress]: PortfolioPositionsDataForAddress;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** The `markets` getPortfolioData returns: every market it read, by protocol, keyed by market or spoke. */
|
|
72
|
-
export interface PortfolioMarketsData {
|
|
73
|
-
morphoMarketsData: Record<string, MorphoBlueMarketInfo>;
|
|
74
|
-
morphoMidnightMarketsData: Record<string, MorphoMidnightMarketInfo>;
|
|
75
|
-
compoundV3MarketsData: Record<string, CompoundV3MarketsData>;
|
|
76
|
-
sparkMarketsData: Record<string, SparkMarketsData>;
|
|
77
|
-
aaveV3MarketsData: Record<string, AaveV3MarketData>;
|
|
78
|
-
aaveV2MarketsData: Record<string, AaveV2MarketData>;
|
|
79
|
-
compoundV2MarketsData: Record<string, CompoundV2MarketsData>;
|
|
80
|
-
crvUsdMarketsData: Record<string, CrvUSDGlobalMarketData>;
|
|
81
|
-
llamaLendMarketsData: Record<string, LlamaLendGlobalMarketData>;
|
|
82
|
-
liquityV2MarketsData: Record<string, LiquityV2MarketData>;
|
|
83
|
-
aaveV4SpokesData: Record<string, AaveV4SpokeData>;
|
|
84
65
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EthAddress } from '../common';
|
|
1
|
+
import { EthAddress, NetworkNumber } from '../common';
|
|
2
2
|
|
|
3
3
|
export enum MorphoVaultType {
|
|
4
4
|
MorphoVaultFlagshipEth = 'morpho_vault_flagship_eth',
|
|
@@ -21,6 +21,14 @@ export enum MorphoVaultType {
|
|
|
21
21
|
MorphoVaultSmokehouseUSDT = 'morpho_vault_smokehouse_usdt',
|
|
22
22
|
MorphoVaultSmokehouseUSDC = 'morpho_vault_smokehouse_usdc',
|
|
23
23
|
MorphoVaultSmokehouseDAI = 'morpho_vault_smokehouse_dai',
|
|
24
|
+
// Vault V2
|
|
25
|
+
MorphoVaultGauntletUSDGPremium = 'morpho_vault_gauntlet_usdg_premium',
|
|
26
|
+
MorphoVaultSteakhouseUSDGPro = 'morpho_vault_steakhouse_usdg_pro',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export enum MorphoVaultVersion {
|
|
30
|
+
V1 = 1,
|
|
31
|
+
V2 = 2,
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
export interface MorphoVault {
|
|
@@ -28,6 +36,8 @@ export interface MorphoVault {
|
|
|
28
36
|
name: string;
|
|
29
37
|
address: EthAddress;
|
|
30
38
|
asset: string;
|
|
39
|
+
network: NetworkNumber;
|
|
40
|
+
version: MorphoVaultVersion;
|
|
31
41
|
deploymentBlock: number;
|
|
32
42
|
isLegacy: boolean;
|
|
33
43
|
}
|
package/src/types/spark.ts
CHANGED
|
@@ -57,22 +57,6 @@ export interface SparkAssetData extends MMAssetData {
|
|
|
57
57
|
eModeCategory: number,
|
|
58
58
|
liquidationBonus: string,
|
|
59
59
|
liquidationRatio: string,
|
|
60
|
-
// Set by _getSparkMarketsData. Optional, so objects built by hand still type-check.
|
|
61
|
-
debtCeilingForIsolationMode?: string,
|
|
62
|
-
isSiloed?: boolean,
|
|
63
|
-
isolationModeTotalDebt?: string,
|
|
64
|
-
isolationModeBorrowingEnabled?: boolean,
|
|
65
|
-
assetId?: number,
|
|
66
|
-
borrowRateStable?: string,
|
|
67
|
-
supplyCap?: string,
|
|
68
|
-
isInactive?: boolean,
|
|
69
|
-
isFrozen?: boolean,
|
|
70
|
-
isPaused?: boolean,
|
|
71
|
-
canBeWithdrawn?: boolean,
|
|
72
|
-
canBePayBacked?: boolean,
|
|
73
|
-
disabledStableBorrowing?: boolean,
|
|
74
|
-
isFlashLoanEnabled?: boolean,
|
|
75
|
-
aTokenAddress?: EthAddress,
|
|
76
60
|
}
|
|
77
61
|
|
|
78
62
|
export interface SparkAssetsData {
|
|
@@ -131,15 +115,7 @@ export interface SparkAggregatedPositionData {
|
|
|
131
115
|
exposure: string,
|
|
132
116
|
}
|
|
133
117
|
|
|
134
|
-
|
|
135
|
-
* Fields sparkGetAggregatedPositionData adds to every Spark position at runtime, on top of those declared below.
|
|
136
|
-
* Optional, so code that builds a position by hand keeps compiling.
|
|
137
|
-
*/
|
|
138
|
-
export type SparkPositionAggregatedFields = Partial<Omit<SparkAggregatedPositionData,
|
|
139
|
-
| keyof MMPositionData | 'ratio' | 'collRatio' | 'suppliedUsd' | 'borrowedUsd' | 'borrowLimitUsd'
|
|
140
|
-
| 'suppliedCollateralUsd' | 'incentiveUsd' | 'totalInterestUsd'>>;
|
|
141
|
-
|
|
142
|
-
export interface SparkPositionData extends MMPositionData, SparkPositionAggregatedFields {
|
|
118
|
+
export interface SparkPositionData extends MMPositionData {
|
|
143
119
|
ratio: string,
|
|
144
120
|
minRatio: string,
|
|
145
121
|
collRatio: string,
|