@1delta/margin-fetcher 0.0.80 → 0.0.81
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/dist/index.js
CHANGED
|
@@ -10903,7 +10903,7 @@ function createBaseTypeUserState(payload, lenderData, totalDeposits24h = 0, tota
|
|
|
10903
10903
|
for (let i = 0; i < assetKeys.length; i++) {
|
|
10904
10904
|
const asset = assetKeys[i];
|
|
10905
10905
|
if (!lenderData?.[asset]) continue;
|
|
10906
|
-
const { depositsUSD, debtStableUSD, debtUSD,
|
|
10906
|
+
const { depositsUSD, debtStableUSD, debtUSD, collateralEnabled } = payload.lendingPositions["0"][asset];
|
|
10907
10907
|
const {
|
|
10908
10908
|
depositRate,
|
|
10909
10909
|
stakingYield,
|
|
@@ -10928,7 +10928,7 @@ function createBaseTypeUserState(payload, lenderData, totalDeposits24h = 0, tota
|
|
|
10928
10928
|
);
|
|
10929
10929
|
stakingDepositAccrual += (stakingYield ?? 0) * depositsUSD;
|
|
10930
10930
|
stakingBorrowAccrual += (stakingYield ?? 0) * (debtStableUSD + debtUSD);
|
|
10931
|
-
if (
|
|
10931
|
+
if (collateralEnabled) {
|
|
10932
10932
|
collateral += (lenderData[asset].config[mode]?.collateralFactor ?? 1) * depositsUSD;
|
|
10933
10933
|
borrowDiscountedCollateral += (lenderData[asset].config[mode]?.borrowCollateralFactor ?? 1) * depositsUSD;
|
|
10934
10934
|
}
|
|
@@ -16826,7 +16826,7 @@ var getInitUserDataConverter = (lender, chainId, account, prices, pricesHist, le
|
|
|
16826
16826
|
debtStableUSD: 0,
|
|
16827
16827
|
depositsUSD: price * Number(deposits),
|
|
16828
16828
|
debtUSD: price * Number(debt),
|
|
16829
|
-
|
|
16829
|
+
collateralEnabled: true,
|
|
16830
16830
|
isAllowed: entry.approved.toLowerCase() === brokerAddress.toLowerCase()
|
|
16831
16831
|
}
|
|
16832
16832
|
};
|
|
@@ -16917,7 +16917,7 @@ var getCompoundV3UserDataConverter = (lender, chainId, account, prices, pricesHi
|
|
|
16917
16917
|
// populate values for totals
|
|
16918
16918
|
debtStable: "0",
|
|
16919
16919
|
debtStableUSD: 0,
|
|
16920
|
-
collateralEnabled:
|
|
16920
|
+
collateralEnabled: false,
|
|
16921
16921
|
// user depos raw
|
|
16922
16922
|
depositsRaw
|
|
16923
16923
|
// flag for allowance
|
|
@@ -17224,7 +17224,7 @@ function createMorphoEntryFromMarketWithLens(balanceInfo, chainId, market, lende
|
|
|
17224
17224
|
debtStableUSD: 0,
|
|
17225
17225
|
debtUSD: Number(borrowDec) * priceLoan,
|
|
17226
17226
|
stableBorrowRate: "0",
|
|
17227
|
-
|
|
17227
|
+
collateralEnabled: false,
|
|
17228
17228
|
claimableRewards: 0
|
|
17229
17229
|
};
|
|
17230
17230
|
const key = toOracleKey(collateralAssetMeta?.assetGroup) ?? toGenericPriceKey(collateralAddress, chainId);
|
|
@@ -17241,7 +17241,7 @@ function createMorphoEntryFromMarketWithLens(balanceInfo, chainId, market, lende
|
|
|
17241
17241
|
debtStableUSD: 0,
|
|
17242
17242
|
debtUSD: 0,
|
|
17243
17243
|
stableBorrowRate: "0",
|
|
17244
|
-
|
|
17244
|
+
collateralEnabled: true,
|
|
17245
17245
|
claimableRewards: 0
|
|
17246
17246
|
};
|
|
17247
17247
|
return {
|