aave / aave/protocol-subgraphs

sAVAX oracle price

Open
#81 0 comments 1 reaction 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
On the Avalanche V3 subgraph the oracle price for sAVAX is set to 0x0 which makes the price always 0

  • The problem resides that the sAVAX oracle is not a chainlink one, so when trying to get the aggregator (normal behaviour on cl oracles) it fails, then it doesn't save it. This can be found on this line of the mapping proxy-price-provider/v3
  • A solution would be to create specific code for avalanche v3, that checks if the registered oracle is for asset sAVAX then add specific logic to get the cl oracle from the sAVAX oracle registered, to listen to its events. Then when an event of this specific oracle is triggered, the code would need to call the original sAVAX oracle to get latestAnswer.

To Reproduce
run this query:

{
  reserves(where:{symbol: "sAVAX"}) {
    underlyingAsset
    symbol
    price {
      priceSource
      priceInEth
    }
  }
}

on the Avlanche V3 subgraph

Expected behavior
Subgraph should have the correct pricing, listening to the correct oracle: https://snowtrace.io/address/0xc9245871D69BF4c36c6F2D15E0D68Ffa883FE1A7#readContract

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

Start in src/mapping/proxy-price-provider/v3.ts at line 124 and review how the Avalanche V3 mapping handles registered oracles and aggregator lookup. Reproduce the issue with the provided sAVAX reserves query, then verify that the subgraph listens to the specified oracle and reports a nonzero priceSource and priceInEth.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design, blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.