@defisaver/positions-sdk 2.1.160-shifter-v2-dev → 2.1.161-portfolio-api-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.
Files changed (118) hide show
  1. package/cjs/aaveV2/index.js +0 -2
  2. package/cjs/curveUsd/index.d.ts +2 -5
  3. package/cjs/curveUsd/index.js +15 -30
  4. package/cjs/fluid/index.d.ts +0 -5
  5. package/cjs/fluid/index.js +1 -36
  6. package/cjs/helpers/aaveHelpers/index.js +0 -3
  7. package/cjs/helpers/aaveV4Helpers/index.js +0 -1
  8. package/cjs/helpers/compoundHelpers/index.js +0 -2
  9. package/cjs/helpers/curveUsdHelpers/index.d.ts +1 -3
  10. package/cjs/helpers/curveUsdHelpers/index.js +2 -16
  11. package/cjs/helpers/fluidHelpers/index.js +0 -1
  12. package/cjs/helpers/liquityV2Helpers/index.js +0 -1
  13. package/cjs/helpers/llamaLendHelpers/index.js +0 -2
  14. package/cjs/helpers/makerHelpers/index.d.ts +1 -1
  15. package/cjs/helpers/makerHelpers/index.js +2 -2
  16. package/cjs/helpers/morphoBlueHelpers/index.js +0 -2
  17. package/cjs/helpers/morphoMidnightHelpers/index.js +0 -2
  18. package/cjs/helpers/sparkHelpers/index.js +0 -1
  19. package/cjs/liquity/index.js +2 -16
  20. package/cjs/maker/index.d.ts +2 -7
  21. package/cjs/maker/index.js +12 -45
  22. package/cjs/markets/index.d.ts +0 -1
  23. package/cjs/markets/index.js +1 -3
  24. package/cjs/portfolio/index.d.ts +1 -5
  25. package/cjs/portfolio/index.js +7 -277
  26. package/cjs/staking/staking.d.ts +0 -20
  27. package/cjs/staking/staking.js +1 -19
  28. package/cjs/types/aave.d.ts +15 -4
  29. package/cjs/types/aaveV4.d.ts +0 -1
  30. package/cjs/types/compound.d.ts +26 -4
  31. package/cjs/types/curveUsd.d.ts +9 -7
  32. package/cjs/types/fluid.d.ts +0 -1
  33. package/cjs/types/liquity.d.ts +0 -4
  34. package/cjs/types/liquityV2.d.ts +0 -2
  35. package/cjs/types/llamaLend.d.ts +12 -1
  36. package/cjs/types/maker.d.ts +0 -4
  37. package/cjs/types/morphoBlue.d.ts +2 -2
  38. package/cjs/types/morphoMidnight.d.ts +0 -1
  39. package/cjs/types/portfolio.d.ts +10 -26
  40. package/cjs/types/spark.d.ts +21 -3
  41. package/esm/aaveV2/index.js +0 -2
  42. package/esm/curveUsd/index.d.ts +2 -5
  43. package/esm/curveUsd/index.js +15 -30
  44. package/esm/fluid/index.d.ts +0 -5
  45. package/esm/fluid/index.js +0 -33
  46. package/esm/helpers/aaveHelpers/index.js +0 -3
  47. package/esm/helpers/aaveV4Helpers/index.js +0 -1
  48. package/esm/helpers/compoundHelpers/index.js +0 -2
  49. package/esm/helpers/curveUsdHelpers/index.d.ts +1 -3
  50. package/esm/helpers/curveUsdHelpers/index.js +2 -16
  51. package/esm/helpers/fluidHelpers/index.js +0 -1
  52. package/esm/helpers/liquityV2Helpers/index.js +0 -1
  53. package/esm/helpers/llamaLendHelpers/index.js +0 -2
  54. package/esm/helpers/makerHelpers/index.d.ts +1 -1
  55. package/esm/helpers/makerHelpers/index.js +2 -2
  56. package/esm/helpers/morphoBlueHelpers/index.js +0 -2
  57. package/esm/helpers/morphoMidnightHelpers/index.js +0 -2
  58. package/esm/helpers/sparkHelpers/index.js +0 -1
  59. package/esm/liquity/index.js +2 -16
  60. package/esm/maker/index.d.ts +2 -7
  61. package/esm/maker/index.js +13 -44
  62. package/esm/markets/index.d.ts +0 -1
  63. package/esm/markets/index.js +0 -1
  64. package/esm/portfolio/index.d.ts +1 -5
  65. package/esm/portfolio/index.js +10 -279
  66. package/esm/staking/staking.d.ts +0 -20
  67. package/esm/staking/staking.js +0 -17
  68. package/esm/types/aave.d.ts +15 -4
  69. package/esm/types/aaveV4.d.ts +0 -1
  70. package/esm/types/compound.d.ts +26 -4
  71. package/esm/types/curveUsd.d.ts +9 -7
  72. package/esm/types/fluid.d.ts +0 -1
  73. package/esm/types/liquity.d.ts +0 -4
  74. package/esm/types/liquityV2.d.ts +0 -2
  75. package/esm/types/llamaLend.d.ts +12 -1
  76. package/esm/types/maker.d.ts +0 -4
  77. package/esm/types/morphoBlue.d.ts +2 -2
  78. package/esm/types/morphoMidnight.d.ts +0 -1
  79. package/esm/types/portfolio.d.ts +10 -26
  80. package/esm/types/spark.d.ts +21 -3
  81. package/package.json +1 -1
  82. package/src/aaveV2/index.ts +0 -2
  83. package/src/curveUsd/index.ts +16 -33
  84. package/src/fluid/index.ts +0 -40
  85. package/src/helpers/aaveHelpers/index.ts +0 -3
  86. package/src/helpers/aaveV4Helpers/index.ts +0 -1
  87. package/src/helpers/compoundHelpers/index.ts +0 -2
  88. package/src/helpers/curveUsdHelpers/index.ts +2 -23
  89. package/src/helpers/fluidHelpers/index.ts +0 -1
  90. package/src/helpers/liquityV2Helpers/index.ts +0 -1
  91. package/src/helpers/llamaLendHelpers/index.ts +0 -2
  92. package/src/helpers/makerHelpers/index.ts +1 -2
  93. package/src/helpers/morphoBlueHelpers/index.ts +0 -2
  94. package/src/helpers/morphoMidnightHelpers/index.ts +0 -2
  95. package/src/helpers/sparkHelpers/index.ts +0 -1
  96. package/src/liquity/index.ts +2 -17
  97. package/src/maker/index.ts +29 -77
  98. package/src/markets/index.ts +1 -2
  99. package/src/portfolio/index.ts +8 -261
  100. package/src/staking/staking.ts +0 -28
  101. package/src/types/aave.ts +18 -4
  102. package/src/types/aaveV4.ts +0 -1
  103. package/src/types/compound.ts +38 -4
  104. package/src/types/curveUsd.ts +17 -8
  105. package/src/types/fluid.ts +0 -1
  106. package/src/types/liquity.ts +0 -6
  107. package/src/types/liquityV2.ts +0 -2
  108. package/src/types/llamaLend.ts +19 -1
  109. package/src/types/maker.ts +0 -6
  110. package/src/types/morphoBlue.ts +3 -2
  111. package/src/types/morphoMidnight.ts +0 -1
  112. package/src/types/portfolio.ts +12 -31
  113. package/src/types/spark.ts +25 -3
  114. package/cjs/markets/maker/index.d.ts +0 -1
  115. package/cjs/markets/maker/index.js +0 -13
  116. package/esm/markets/maker/index.d.ts +0 -1
  117. package/esm/markets/maker/index.js +0 -10
  118. package/src/markets/maker/index.ts +0 -10
@@ -70,6 +70,8 @@ export interface CompoundAssetData extends MMAssetData {
70
70
  }
71
71
 
72
72
  export interface CompoundV2AssetData extends CompoundAssetData {
73
+ // Set by _getCompoundV2MarketsData. Optional, so objects built by hand still type-check.
74
+ exchangeRate?: string,
73
75
  }
74
76
  export interface CompoundV3AssetData extends CompoundAssetData {
75
77
  borrowCollateralFactor: string,
@@ -81,6 +83,20 @@ export interface CompoundV3AssetData extends CompoundAssetData {
81
83
  supplyCap: string,
82
84
  priceInBaseAsset: string,
83
85
  canBeWithdrawn: boolean,
86
+ // The rest are set by formatMarketData and formatBaseData, which also spread in the view contract's raw asset
87
+ // data. Optional, so objects built by hand still type-check.
88
+ tokenAddr?: EthAddress,
89
+ // The base asset's only.
90
+ isBase?: boolean,
91
+ baseBorrowMin?: string,
92
+ baseTrackingBorrowRewardsSpeed?: string,
93
+ baseTrackingSupplyRewardsSpeed?: string,
94
+ borrowIndex?: string,
95
+ supplyIndex?: string,
96
+ trackingBorrowIndex?: string,
97
+ trackingSupplyIndex?: string,
98
+ rewardSupplySpeed?: string,
99
+ rewardBorrowSpeed?: string,
84
100
  }
85
101
 
86
102
  export interface CompoundAssetsData<T> {
@@ -112,7 +128,6 @@ export interface CompoundAggregatedPositionData {
112
128
  leftToBorrowUsd: string,
113
129
  ratio: string,
114
130
  collRatio: string,
115
- safetyRatio: string,
116
131
  netApy: string,
117
132
  incentiveUsd: string,
118
133
  totalInterestUsd: string,
@@ -133,7 +148,6 @@ export interface CompoundAggregatedPositionData {
133
148
  export interface CompoundPositionData extends MMPositionData {
134
149
  ratio: string,
135
150
  minRatio: string,
136
- safetyRatio?: string,
137
151
  suppliedUsd: string,
138
152
  borrowedUsd: string,
139
153
  borrowLimitUsd: string,
@@ -143,10 +157,30 @@ export interface CompoundPositionData extends MMPositionData {
143
157
  automationResubscribeRequired?: boolean,
144
158
  }
145
159
 
146
- export interface CompoundV2PositionData extends CompoundPositionData {
160
+ /**
161
+ * Fields getCompoundV2AggregatedData adds to every Compound V2 position at runtime — a subset of
162
+ * CompoundAggregatedPositionData. Optional, so code that builds a position by hand keeps compiling.
163
+ */
164
+ export type CompoundV2PositionAggregatedFields = Partial<Pick<CompoundAggregatedPositionData,
165
+ | 'suppliedCollateralUsd' | 'liquidationLimitUsd' | 'leftToBorrowUsd' | 'collRatio' | 'leveragedType'
166
+ | 'leveragedAsset' | 'liquidationPrice'>>;
167
+
168
+ /**
169
+ * Fields getCompoundV3AggregatedData adds to every Compound V3 position at runtime, on top of those declared in
170
+ * CompoundPositionData. Optional, so code that builds a position by hand keeps compiling.
171
+ */
172
+ export type CompoundV3PositionAggregatedFields = Partial<Omit<CompoundAggregatedPositionData,
173
+ | keyof MMPositionData | 'ratio' | 'minRatio' | 'suppliedUsd' | 'borrowedUsd' | 'borrowLimitUsd' | 'incentiveUsd'
174
+ | 'totalInterestUsd'>>;
175
+
176
+ export interface CompoundV2PositionData extends CompoundPositionData, CompoundV2PositionAggregatedFields {
147
177
  usedAssets: CompoundV2UsedAssets,
178
+ // Always false: _getCompoundV2AccountData starts from EMPTY_COMPOUND_DATA, which carries it.
179
+ borrowStableSupplyUnstable?: boolean,
148
180
  }
149
181
 
150
- export interface CompoundV3PositionData extends CompoundPositionData {
182
+ export interface CompoundV3PositionData extends CompoundPositionData, CompoundV3PositionAggregatedFields {
151
183
  usedAssets: CompoundV3UsedAssets,
184
+ // Whether the user's smart wallet is allowed to manage the account on Comet (Comet.isAllowed).
185
+ isAllowed?: boolean,
152
186
  }
@@ -66,6 +66,9 @@ export interface CrvUSDGlobalMarketData {
66
66
  leftToBorrow: string,
67
67
  bands: BandData[],
68
68
  loanDiscount: string;
69
+ // crvUSDView's globalData field that _getCurveUsdGlobalData spreads in unconverted. Optional, so objects built by
70
+ // hand still type-check.
71
+ A?: bigint,
69
72
  }
70
73
 
71
74
  export interface CrvUSDAggregatedPositionData {
@@ -80,10 +83,6 @@ export interface CrvUSDAggregatedPositionData {
80
83
  collFactor: string,
81
84
  leveragedType: LeverageType,
82
85
  exposure: string,
83
- // Yearly net return (%) on the position's equity: market borrow rate on crvUSD debt vs native yield of staked collateral.
84
- netApy: string,
85
- totalInterestUsd: string,
86
- incentiveUsd: string,
87
86
  leveragedAsset?: string,
88
87
  liquidationPrice?: string,
89
88
  }
@@ -105,7 +104,12 @@ export interface CrvUSDUsedAssets {
105
104
  [key: string]: CrvUSDUsedAsset,
106
105
  }
107
106
 
108
- export interface CrvUSDUserData {
107
+ // Set by getCrvUsdAggregatedData, which _getCurveUsdUserData spreads in. Optional, so objects built by hand still
108
+ // type-check.
109
+ export type CrvUSDPositionAggregatedFields = Partial<Pick<CrvUSDAggregatedPositionData,
110
+ | 'borrowLimitUsd' | 'minAllowedRatio' | 'collFactor' | 'leveragedType' | 'leveragedAsset' | 'liquidationPrice'>>;
111
+
112
+ export interface CrvUSDUserData extends CrvUSDPositionAggregatedFields {
109
113
  debtAmount: string,
110
114
  health: string,
111
115
  healthPercent: string,
@@ -127,7 +131,12 @@ export interface CrvUSDUserData {
127
131
  collateralPrice: string,
128
132
  collRatio: string,
129
133
  exposure: string,
130
- netApy: string,
131
- totalInterestUsd: string,
132
- incentiveUsd: string,
134
+ // Fields of crvUSDView's userData that _getCurveUsdUserData spreads in unconverted. Optional, so objects built by
135
+ // hand still type-check.
136
+ marketCollateralAmount?: bigint,
137
+ curveUsdCollateralAmount?: bigint,
138
+ N?: bigint,
139
+ bandRange?: readonly [bigint, bigint],
140
+ usersBands?: readonly [readonly bigint[], readonly bigint[]],
141
+ isInSoftLiquidation?: boolean,
133
142
  }
@@ -344,7 +344,6 @@ export interface FluidAggregatedVaultData {
344
344
  merklBorrowIncentives: IncentiveData[],
345
345
  ratio: string,
346
346
  collRatio: string,
347
- safetyRatio: string,
348
347
  minRatio: string,
349
348
  totalInterestUsd: string,
350
349
  leveragedType?: LeverageType,
@@ -26,13 +26,7 @@ export interface LiquityTroveInfo {
26
26
  totalETH: string,
27
27
  totalLUSD: string,
28
28
  minCollateralRatio: number,
29
- // Collateral ratio rebased so 100 sits on `minCollateralRatio` (normalised safety ratio).
30
- safetyRatio: string,
31
29
  priceForRecovery: string,
32
30
  debtInFront: string,
33
31
  exposure: string,
34
- // Always '0' for Liquity v1: LUSD debt is interest free (one-off borrowing fee only) and ETH collateral earns no yield.
35
- netApy: string,
36
- totalInterestUsd: string,
37
- incentiveUsd: string,
38
32
  }
@@ -104,7 +104,6 @@ export interface LiquityV2AggregatedTroveData {
104
104
  liquidationPrice: string,
105
105
  ratio: string,
106
106
  collRatio: string,
107
- safetyRatio: string,
108
107
  exposure: string,
109
108
  }
110
109
 
@@ -113,7 +112,6 @@ export interface LiquityV2TroveData {
113
112
  troveId: string,
114
113
  ratio: string,
115
114
  collRatio: string,
116
- safetyRatio?: string,
117
115
  liqRatio: string,
118
116
  borrowLimitRatio: string,
119
117
  interestRate: string,
@@ -141,7 +141,13 @@ export interface LlamaLendUsedAssets {
141
141
  [key: string]: LlamaLendUsedAsset,
142
142
  }
143
143
 
144
- export interface LlamaLendUserData {
144
+ // Set by getLlamaLendAggregatedData, which _getLlamaLendUserData spreads in. Optional, so objects built by hand still
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 {
145
151
  debtAmount: string,
146
152
  health: string,
147
153
  healthPercent: string,
@@ -160,4 +166,16 @@ export interface LlamaLendUserData {
160
166
  loanExists: boolean,
161
167
  borrowRate?: string,
162
168
  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,
163
181
  }
@@ -47,8 +47,6 @@ export interface CdpData {
47
47
  debtAssetMarketPrice: string,
48
48
  liquidationPrice: string,
49
49
  ratio: string,
50
- // Collateral ratio rebased so 100 sits on `liqPercent` (normalised safety ratio).
51
- safetyRatio: string,
52
50
  liqRatio: string,
53
51
  liqPercent: number,
54
52
  assetPrice: string,
@@ -64,8 +62,4 @@ export interface CdpData {
64
62
  liquidationFee: string,
65
63
  lastUpdated: number,
66
64
  exposure: string,
67
- // Yearly net return (%) on the vault's equity: stability fee on DAI debt vs native yield of staked collateral.
68
- netApy: string,
69
- totalInterestUsd: string,
70
- incentiveUsd: string,
71
65
  }
@@ -206,7 +206,6 @@ export interface MorphoBlueAggregatedPositionData {
206
206
  totalInterestUsd: string,
207
207
  ltv: string,
208
208
  ratio: string,
209
- safetyRatio: string, // borrowLimitUsd / borrowedUsd as a percentage (100 = liquidation)
210
209
  leveragedType: LeverageType,
211
210
  leveragedAsset?: string,
212
211
  currentVolatilePairRatio?: string,
@@ -230,7 +229,6 @@ export interface MorphoBluePositionData {
230
229
  totalInterestUsd: string,
231
230
  ltv: string,
232
231
  ratio: string,
233
- safetyRatio?: string,
234
232
  leveragedType: LeverageType,
235
233
  leveragedAsset?: string,
236
234
  currentVolatilePairRatio?: string,
@@ -238,6 +236,9 @@ export interface MorphoBluePositionData {
238
236
  supplyShares: string,
239
237
  borrowShares: string,
240
238
  exposure: string,
239
+ // Set by getMorphoBlueAggregatedPositionData. Optional, so objects built by hand still type-check.
240
+ minCollRatio?: string,
241
+ collLiquidationRatio?: string,
241
242
  }
242
243
 
243
244
  export interface MorphoBlueEarnData {
@@ -191,7 +191,6 @@ export interface MorphoMidnightAggregatedPositionData {
191
191
  ltv: string,
192
192
  ratio: string, // health ratio as a percentage (from MidnightView.ratio, 1e18-scaled)
193
193
  healthRatio: string, // liquidationLimitUsd / borrowedUsd
194
- safetyRatio: string, // borrowLimitUsd / borrowedUsd as a percentage (100 = liquidation)
195
194
  leveragedType: LeverageType,
196
195
  leveragedAsset?: string,
197
196
  currentVolatilePairRatio?: string,
@@ -1,20 +1,16 @@
1
- import {
2
- AaveV2MarketData, AaveV2PositionData, AaveV3MarketData, AaveV3PositionData, AaveVersions,
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
- CompoundV2MarketsData, CompoundV2PositionData, CompoundV3MarketsData, CompoundV3PositionData, CompoundVersions,
8
- } from './compound';
9
- import { CrvUSDGlobalMarketData, CrvUSDUserData, CrvUSDVersions } from './curveUsd';
10
- import { FluidMarketData, FluidVaultData } from './fluid';
4
+ import { CompoundV2PositionData, CompoundV3PositionData, CompoundVersions } from './compound';
5
+ import { CrvUSDUserData, CrvUSDVersions } from './curveUsd';
6
+ import { FluidVaultData } from './fluid';
11
7
  import { LiquityTroveInfo } from './liquity';
12
- import { LiquityV2MarketData, LiquityV2TroveData, LiquityV2Versions } from './liquityV2';
13
- import { LlamaLendGlobalMarketData, LlamaLendUserData, LlamaLendVersionsType } from './llamaLend';
14
- import { CdpData, IlkInfo } from './maker';
15
- import { MorphoBlueMarketInfo, MorphoBluePositionData, MorphoBlueVersions } from './morphoBlue';
16
- import { MorphoMidnightMarketInfo, MorphoMidnightPositionData, MorphoMidnightVersions } from './morphoMidnight';
17
- import { SparkMarketsData, SparkPositionData, SparkVersions } from './spark';
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 { 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
- export interface PortfolioMarketsData {
71
- morphoMarketsData: Record<string, MorphoBlueMarketInfo>;
72
- morphoMidnightMarketsData: Record<string, MorphoMidnightMarketInfo>;
73
- compoundV3MarketsData: Record<string, CompoundV3MarketsData>;
74
- sparkMarketsData: Record<string, SparkMarketsData>;
75
- aaveV3MarketsData: Record<string, AaveV3MarketData>;
76
- aaveV2MarketsData: Record<string, AaveV2MarketData>;
77
- compoundV2MarketsData: Record<string, CompoundV2MarketsData>;
78
- crvUsdMarketsData: Record<string, CrvUSDGlobalMarketData>;
79
- llamaLendMarketsData: Record<string, LlamaLendGlobalMarketData>;
80
- liquityV2MarketsData: Record<string, LiquityV2MarketData>;
81
- aaveV4SpokesData: Record<string, AaveV4SpokeData>;
82
- fluidMarketsData: Record<string, FluidMarketData>;
83
- makerMarketsData: Record<string, IlkInfo>;
84
- }
65
+ }
@@ -57,6 +57,22 @@ 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,
60
76
  }
61
77
 
62
78
  export interface SparkAssetsData {
@@ -99,7 +115,6 @@ export interface SparkAggregatedPositionData {
99
115
  leftToBorrowUsd: string,
100
116
  ratio: string,
101
117
  collRatio: string,
102
- safetyRatio: string,
103
118
  netApy: string,
104
119
  incentiveUsd: string,
105
120
  totalInterestUsd: string,
@@ -116,11 +131,18 @@ export interface SparkAggregatedPositionData {
116
131
  exposure: string,
117
132
  }
118
133
 
119
- export interface SparkPositionData extends MMPositionData {
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 {
120
143
  ratio: string,
121
144
  minRatio: string,
122
145
  collRatio: string,
123
- safetyRatio?: string,
124
146
  suppliedUsd: string,
125
147
  borrowedUsd: string,
126
148
  borrowLimitUsd: string,
@@ -1 +0,0 @@
1
- export declare const MakerActiveIlks: string[];
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MakerActiveIlks = void 0;
4
- exports.MakerActiveIlks = [
5
- 'ETH-A',
6
- 'ETH-B',
7
- 'ETH-C',
8
- 'WSTETH-A',
9
- 'WSTETH-B',
10
- 'WBTC-A',
11
- 'WBTC-B',
12
- 'WBTC-C',
13
- ];
@@ -1 +0,0 @@
1
- export declare const MakerActiveIlks: string[];
@@ -1,10 +0,0 @@
1
- export const MakerActiveIlks = [
2
- 'ETH-A',
3
- 'ETH-B',
4
- 'ETH-C',
5
- 'WSTETH-A',
6
- 'WSTETH-B',
7
- 'WBTC-A',
8
- 'WBTC-B',
9
- 'WBTC-C',
10
- ];
@@ -1,10 +0,0 @@
1
- export const MakerActiveIlks: string[] = [
2
- 'ETH-A',
3
- 'ETH-B',
4
- 'ETH-C',
5
- 'WSTETH-A',
6
- 'WSTETH-B',
7
- 'WBTC-A',
8
- 'WBTC-B',
9
- 'WBTC-C',
10
- ];