Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token price not being displayed or accounted #412

Open
kroggen opened this issue Sep 17, 2021 · 3 comments
Open

Token price not being displayed or accounted #412

kroggen opened this issue Sep 17, 2021 · 3 comments

Comments

@kroggen
Copy link

kroggen commented Sep 17, 2021

For many coins the Uniswap Pool and the Trade are not showing the price of the token, even being so easy to calculate the price using the current rate of exchange with the other token (eg WETH)

I guess there is no need for an external "oracle" for this purpose, but if there is one, after the oracle returns 0 or null as the price for the token on the pair, its price can then be calculated using the above simple method.

This is also happening when displaying the TVL (total value locked), it is showing the value of only ETH locked:

Screen Shot 2021-09-17 at 20 27 41

Screen Shot 2021-09-17 at 22 57 34

Also when adding liquidity, it only shows the value related to ETH or USDT, not the other token. Sometimes it appears as 0 (zero) total value added when adding only the other token on the pair:

Screen Shot 2021-09-17 at 20 22 27

Screen Shot 2021-09-17 at 20 23 23

Screen Shot 2021-09-17 at 22 57 49

Example:

https://info.uniswap.org/#/pools/0x8c2f778589b08dbd5857be26b604dc5c42861732

@kroggen
Copy link
Author

kroggen commented Sep 17, 2021

Now I am suspecting that this bug is on TheGraph, as their results are used on these sites

@justindomingue justindomingue transferred this issue from Uniswap/interface Sep 17, 2021
@kroggen
Copy link
Author

kroggen commented Sep 17, 2021

This issue was moved to info-v2 but it is happening on v3

And indeed, the values already come zeroed from the TheGraph API, from the uniswap-v3 module:

https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3

The token value is zeroed on poolDayDatas, transactions and many other requests...

Example:

When sending this request:

{
  "operationName": "tokens",
  "variables": {},
  "query": "query tokens {\n  tokens(\n    where: {id_in: [\"0x1559fa1b8f28238fd5d76d9f434ad86fd20d1559\"]}\n    block: {number: 13199668}\n    orderBy: totalValueLockedUSD\n    orderDirection: desc\n    subgraphError: allow\n  ) {\n    id\n    symbol\n    name\n    derivedETH\n    volumeUSD\n    volume\n    txCount\n    totalValueLocked\n    feesUSD\n    totalValueLockedUSD\n    __typename\n  }\n}\n"
}

The API returns:

{
  "data": {
    "tokens": [
      {
        "__typename": "Token",
        "derivedETH": "0",
        "feesUSD": "62056.63454676765890574577989388061",
        "id": "0x1559fa1b8f28238fd5d76d9f434ad86fd20d1559",
        "name": "Eden",
        "symbol": "EDEN",
        "totalValueLocked": "13179.623235071167538178",
        "totalValueLockedUSD": "0",      <-----------
        "txCount": "1863",
        "volume": "1255330.880892956011740054",
        "volumeUSD": "6235732.072187121969391931381996764"
      }
    ]
  }
}

With another coin:

{
  "data": {
    "tokens": [
      {
        "__typename": "Token",
        "derivedETH": "0",
        "feesUSD": "12491.15690999098388894178363751412",
        "id": "0x799ebfabe77a6e34311eeee9825190b9ece32824",
        "name": "BTRST",
        "symbol": "BTRST",
        "totalValueLocked": "248582.01862144848681035",
        "totalValueLockedUSD": "0",      <-----------
        "txCount": "459",
        "volume": "138138.64523260177497591",
        "volumeUSD": "1249115.690999098388894178363751412"
      }
    ]
  }
}

@kroggen
Copy link
Author

kroggen commented Sep 17, 2021

Another effect of this is in the Liquidity graph:

When we hover the mouse to the right and left sides of the red line it always shows ETH locked, no the other token amount locked.

Check here:

https://info.uniswap.org/#/pools/0x2138a12520c9b45bb4b2c742923b514d5f662fec

With tokens that have normal price, the chart shows ETH locked in one side of the red line (current rate or position) and the amount of the other token locked on the other side (when hovering the mouse)

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

No branches or pull requests

1 participant