Doesnt this always return zero?
chrisfranko opened this issue · 0 comments
chrisfranko commented
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.