Skip to content

Borrow Asset Value Doesn't Reflect currentTimestamp Parameter #606

@chananyulim1616

Description

@chananyulim1616

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions