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

Available liquidity calculation #579

Open
Argeare5 opened this issue Apr 5, 2024 · 0 comments
Open

Available liquidity calculation #579

Argeare5 opened this issue Apr 5, 2024 · 0 comments

Comments

@Argeare5
Copy link

Argeare5 commented Apr 5, 2024

Bug Report

Package name / version

@aave/math-utils / 1.28.0

Description

I discovered that the calculation of availableLiquidity in tokens (not in dollars) does not take into account the Borrow cap calculation.

Steps to reproduce

Just console log the data received from this function https://github.com/aave/aave-utilities/blob/master/packages/math-utils/src/formatters/reserve/index.ts#L417

You'll see that availableLiquidity param returned raw from the contract regardless of this calculation https://github.com/aave/aave-utilities/blob/master/packages/math-utils/src/formatters/reserve/index.ts#L138C9-L138C27

Expected behavior

I believe that it should return processed from this function, taking into account the calculation (like the availableLiquidityUSD). I also think it makes sense to add these Math.max(availableLiquidity, 0) to availableLiquidity param as you already did in your UI:https://github.com/aave/interface/blob/main/src/modules/reserve-overview/ReserveTopDetails.tsx#L58 .

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