sushiswap-subgraph icon indicating copy to clipboard operation
sushiswap-subgraph copied to clipboard

Doesnt this always return zero?

Open chrisfranko opened this issue 3 years ago • 0 comments

https://github.com/sushiswap/sushiswap-subgraph/blob/ee7afb21040d22c588e5df6da4817a5f7cc97c58/src/exchange/pricing.ts#L93

Ive added a logger here and it always seems to return zero. Like, always always.

This function seems to only be called in 2 places.

https://github.com/sushiswap/sushiswap-subgraph/blob/master/src/exchange/mappings/pair.ts#L338

and

https://github.com/sushiswap/sushiswap-subgraph/blob/master/src/exchange/mappings/pair.ts#L339

So unless im missing something, if derivedETH is never set anywhere else, itll do this expensive loop only to get a value and multiple it by another token with a derivedETH of 0, and there for always be zero.

chrisfranko avatar Mar 08 '21 21:03 chrisfranko