protocol-subgraphs
protocol-subgraphs copied to clipboard
sAVAX oracle price
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