8000 Available liquidity calculation · Issue #579 · aave/aave-utilities · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Available liquidity calculation #579
Open
@Argeare5

Description

@Argeare5

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 .

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

      0