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

What does this even do?

Open chrisfranko opened this issue 3 years ago • 4 comments

https://github.com/Uniswap/uniswap-v2-subgraph/blob/9692685423f9a16fa30a2cf08ceeff69fcdd8367/src/mappings/pricing.ts#L71

Ive ran test after test and it always returns 0.

token.derivedETH seems to only be set here

https://github.com/Uniswap/uniswap-v2-subgraph/blob/master/src/mappings/core.ts#L241

and its set by this function https://github.com/Uniswap/uniswap-v2-subgraph/blob/9692685423f9a16fa30a2cf08ceeff69fcdd8367/src/mappings/pricing.ts#L71

but this function references ANOTHER token.derivedETH, but if it never gets set anywhere its always 0, because something times zero is always zero. This function is everywhere.

Is it getting set somewhere else that im unaware of?

chrisfranko avatar Mar 08 '21 21:03 chrisfranko

Just come across this while looking why it's zero.

The derivedETH for BNB is 0 but I see it on etherscan as 0.137450 Eth and I know it's not 0, so what's wrong here?

{
 token(id: "0xb8c77482e45f1f44de1745f52c74426c631bdd52") {
   name
   symbol
   decimals
   derivedETH
 }
}
{
  "data": {
    "token": {
      "name": "BNB",
      "symbol": "BNB",
      "decimals": "18",
      "derivedETH": "0"
    }
  }
}

99hops avatar Apr 07 '22 12:04 99hops

I'm facing the same issue - the derivedETH is always 0. @chrisfranko have you managed to workaround the problem?

okalenyk avatar Oct 01 '23 18:10 okalenyk

That was a long time ago for me and I cant remember now

On Sun, 1 Oct 2023 at 14:39, Oleh Kalenyk @.***> wrote:

I'm facing the same issue - the derivedETH is always 0. @chrisfranko https://github.com/chrisfranko have you managed to workaround the problem?

— Reply to this email directly, view it on GitHub https://github.com/Uniswap/v2-subgraph/issues/82#issuecomment-1742163914, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3BBMKU7HAT4J5O4KRMAHTX5G2F5ANCNFSM4Y2FI3PA . You are receiving this because you were mentioned.Message ID: @.***>

chrisfranko avatar Oct 01 '23 19:10 chrisfranko

Hopefully it will help someone who is looking for the answear.

I've been facing the same issue and spent a couple of days figuring out the reason.

So the issue is the addresses you provide all over the place to the graph, like WETH_ADDRESS and USDC_WETH_PAIR. You should provide them in lower case to make sure IDs in the graph are equal to the addresses provided, e.g.:

The address 0xa510358AA96eB9D09b84a8D9037EF51F010DA086 should become '0xa510358aa96eb9d09b84a8d9037ef51f010da086' and so on.

@chrisfranko possibly it will be interesting for you, just in case).

okalenyk avatar Oct 02 '23 07:10 okalenyk