aave / aave/protocol-subgraphs

Prevent underflow in cumulative fields

Open
#152 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
150
Forks
130
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Due to use of scaled vs realtime balances, some calculations may be inexact for cumulative fields, if this occurs it can result in underflow in some scenarios which can permanently break fields.

In Avalanche V3 market:

{
  reserves(where: {symbol: "DAI.e"}){
    symbol
    totalLiquidity
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by tracing how the Avalanche V3 market produces the reserves query and its cumulative fields, then inspect the scaled-versus-realtime balance calculations described in the report. Done means the cumulative fields remain valid when those calculations are inexact and do not underflow in the reported scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
blockchain, data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.