0

I've forked Uniswap v2 contracts including WETH, and Deployed on Rinkeby. the functionality of Creating Pools, adding and removing liquidity works fine.

Now to get the stats like TVL, Volume, 24hr volume, 7-day volume, etc I 'v forked the subgraph code of this repo https://github.com/ArchTaqi/uniswap-v2-subgraph/tree/rinkeby and deployed it for rinkbey with added my factory contract and WETH address (that was passed to Router address of uniswap),

Afterward, I created a couple of Pairs of ERC-20 tokens, adding Liq. Now when I get stats from Subgraph it returns the token data but Zero in VolumeUSD, VolumeETH, and ReserveETH.


{
  "data": {
    "uniswapFactories": [
      {
        "id": "0xe7f16Be722602d5d12d3a1f5cFd91D34d8bbC0AC",
        "pairCount": 7,
        "totalVolumeUSD": "0",
        "totalVolumeETH": "0"
      }
    ]
  }
}

and 

    {
  "data": {
    "pair": {
      "token0": {
        "id": "0x061d0c9f280781da4d550539bf43339a05be3e59",
        "symbol": "OTG",
        "name": "Octagon",
        "derivedETH": "0"
      },
      "token1": {
        "id": "0x33d499d24c5b0dba57860ec56dd3a79161073184",
        "symbol": "WETH",
        "name": "Wrapped Ether",
        "derivedETH": "0"
      },
      "reserve0": "1000",
      "reserve1": "1",
      "reserveUSD": "0",
      "trackedReserveETH": "0",
      "token0Price": "1000",
      "token1Price": "0.001",
      "volumeUSD": "0",
      "txCount": "1",
      "totalSupply": "31.622776601683792319",
      "reserveETH": "0"
    }
  }
}

See in above response totalVolumeUSD, totalVolumeETH, derivedETH, reserveETH, volumeUSD, reserveUSD is all zero.

I've also Created ETH, DAI pair added ETH, DAI and ETH/DAI addresses in the code. https://github.com/zsulocal/uniswap-v2-subgraph/compare/master...ArchTaqi:uniswap-v2-subgraph:rinkeby

But still getting Zero values, What's wrong here?

2

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.