Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Borrow Asset Value Doesn't Reflect currentTimestamp Parameter #606

Open
chananyulim1616 opened this issue Dec 25, 2024 · 0 comments
Open

Comments

@chananyulim1616
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant