indexer icon indicating copy to clipboard operation
indexer copied to clipboard

Allow enabling the Cost Model in other networks than mainnet

Open tilacog opened this issue 2 years ago • 5 comments

After the multi-network changes introduced in 668, the Cost Model feature was restricted to Ethereum Mainnet. We should find a way to enable this feature for other networks besides that.

Originally posted by @fordN in https://github.com/graphprotocol/indexer/pull/668#discussion_r1290561614

tilacog avatar Aug 11 '23 15:08 tilacog

If the roadblock is the availability of GRT/DAI uniswap pairs on other network, the agent should still allow using cost models when inject-dai=off.

madumas avatar Sep 05 '23 12:09 madumas

Gathering some notes from a quick brainstorming session with @tilacog

Tasks to do

  • [ ] Update code to support cost-models on each network: ensure data models include protocolNetwork, etc...
  • [ ] Decide and implement network agnostic approach to fetching GRT/DAI pair price

Some initial ideas for network agnostic approaches to fetching price:

  • Create a small, specific subgraph tracking the GRT/DAI or GRT/USD pairs on Uniswap (and maybe other protocols too?)
  • Simply use the GRT/DAI price from Mainnet across all networks
  • ....

fordN avatar Sep 06 '23 17:09 fordN

I think that for the purpose of the cost model we could just use the data from Ethereum. What's important is that the oracle we use has enough volume.

abarmat avatar Nov 02 '23 21:11 abarmat

Other ones to investigate: https://docs.mean.finance/v/oracles/ and https://docs.oracles.rip/content/what-is-price.html - also this one for offchain oracles https://github.com/mean-finance/sdk

abarmat avatar Nov 02 '23 21:11 abarmat

https://github.com/graphprotocol/indexer/pull/899

alex-pakalniskis avatar Jun 24 '24 21:06 alex-pakalniskis