Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Doesnt this always return zero? #41

Open
chrisfranko opened this issue Mar 8, 2021 · 0 comments
Open

Doesnt this always return zero? #41

chrisfranko opened this issue Mar 8, 2021 · 0 comments

Comments

@chrisfranko
Copy link

export function findEthPerToken(token: Token): BigDecimal {

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant