aave-utilities icon indicating copy to clipboard operation
aave-utilities copied to clipboard

Borrow Asset Value Doesn't Reflect currentTimestamp Parameter

Open chananyulim1616 opened this issue 10 months ago • 1 comments

When using the userSummary method, I noticed that changing the currentTimestamp parameter does not affect the value of the borrowed assets (unexpected behavior). However, the value of supplied assets changes correctly as expected.

Here’s the relevant code snippet:

const currentTimestamp = dayjs().unix();

const formattedReserves = formatReservesAndIncentives({
  reserves: reservesArray,
  currentTimestamp,
  marketReferenceCurrencyDecimals:
    baseCurrencyData.marketReferenceCurrencyDecimals,
  marketReferencePriceInUsd:
    baseCurrencyData.marketReferenceCurrencyPriceInUsd,
  reserveIncentives,
});

const userSummary = formatUserSummary({
  currentTimestamp,
  marketReferencePriceInUsd:
    baseCurrencyData.marketReferenceCurrencyPriceInUsd,
  marketReferenceCurrencyDecimals:
    baseCurrencyData.marketReferenceCurrencyDecimals,
  userReserves: userReservesArray,
  formattedReserves,
  userEmodeCategoryId: userReserves.userEmodeCategoryId,
});

The currentTimestamp correctly updates the value for supplied assets but does not impact the value for borrowed assets. This seems inconsistent. Could you confirm if this is a bug or if I'm missing something in the implementation?

chananyulim1616 avatar Dec 25 '24 20:12 chananyulim1616