bigshortbets / indexer

Subsquid indexer aligned with P2P Market metadata
MIT License
1 stars 4 forks source link

Oracle prices stored in indexer #4

Closed Klapeyron closed 9 months ago

Klapeyron commented 9 months ago

Right now oracle prices are fetched from frontend via graphql query, which is then forwarded by indexer to blockchain and returned back to the frontend. With this issue we would like to try store oracle price changes, once they happen on the blockchain, so users can subscribe for them

I have in mind some path like this: For each block parsed by indexer, we track a set of all OracleKeys that occured among oracle.NewFeedData for that block. Once all events are processed, we query node via grpc for historical data specifying this block hash and OracleKeys that have been updated. Next we update the database with returned values.

In order to query data, we need to generate additional types (check here)