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

Negative values for borrowedReservesCount in User schema #77

Open
AntonioMarsella opened this issue Jun 29, 2022 · 1 comment
Open

Negative values for borrowedReservesCount in User schema #77

AntonioMarsella opened this issue Jun 29, 2022 · 1 comment

Comments

@AntonioMarsella
Copy link

There are occurrences of negative values for borrowedReservesCount field in the User schema.

To Reproduce
On the playground https://thegraph.com/hosted-service/subgraph/aave/protocol-v2?version=current the borrowedReservesCount can be a negative value.

{
  users (where: {borrowedReservesCount_lt:0}) {
    id
		borrowedReservesCount
    reserves {
      reserve {
        name
      }
      currentTotalDebt
      currentATokenBalance
    }
  }
}

Expected behavior
The borrowedReservesCount should be always >=0. I assumed that a negative value meant that no reserves have been used for borrowing, however by querying

{
  users (where: {borrowedReservesCount_lt:0}) {
    id
		borrowedReservesCount
    reserves (where: {currentTotalDebt_gt:0}) {
      reserve {
        name
      }
      currentTotalDebt
      currentATokenBalance
    }
  }
}

you can see that there are reserves with non zero debt (e.g.

 {
        "id": "0x0360414fa5e5846f687096c82e1434151743e886",
        "borrowedReservesCount": -1,
        "reserves": [
          {
            "reserve": {
              "name": "USD Coin"
            },
            "currentTotalDebt": "488152768",
            "currentATokenBalance": "0"
          }
        ]
      }
@sakulstra
Copy link
Contributor

honestly I think this should just be removed completely 😅 it's a bit unnecessary bloat on the subgraph

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

2 participants