Here is CHEQ/USDT token 0xa305f3aad48e285c002a2dbadbbba58fea10ad45 on Uniswap V3
On all screeners I see current price is 0.1137 USDT (like https://dexscreener.com/ethereum/0xa305f3aad48e285c002a2dbadbbba58fea10ad45).
Playground to check: https://thegraph.com/hosted-service/subgraph/uniswap/uniswap-v3
The problem is I'm getting derivedETH=0 on almost any block (only on blocks around 18631700 it's not 0), although it does not equal zero. Why? How can I get current price in USD or ETH with graph?
{
token(id: "0x70edf1c215d0ce69e7f16fd4e6276ba0d99d4de7") {
id
symbol
name
decimals
totalSupply
volume
volumeUSD
untrackedVolumeUSD
totalValueLocked
feesUSD
txCount
derivedETH
}
bundles(first: 5) {
id
ethPriceUSD
}
}
Okey, let's try pool request (0xa305f3aad48e285c002a2dbadbbba58fea10ad45 is pair contract):
{
pool(id: "0xa305f3aad48e285c002a2dbadbbba58fea10ad45") {
tick
token0 {
symbol
id
decimals
derivedETH
txCount
}
token1 {
symbol
id
decimals
derivedETH
txCount
}
feeTier
sqrtPrice
liquidity
}
}
Result has also "derivedETH": "0"
{
"data": {
"pool": {
"tick": "-90820",
"token0": {
"symbol": "CHEQ",
"id": "0x70edf1c215d0ce69e7f16fd4e6276ba0d99d4de7",
"decimals": "9",
"derivedETH": "0",
"txCount": "6827"
},
"token1": {
"symbol": "USDT",
"id": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"decimals": "6",
"derivedETH": "0.0002559071351455432255621805254727805",
"txCount": "6869581"
},
"feeTier": "3000",
"sqrtPrice": "844988916207015749935427513",
"liquidity": "46412668995545"
}
}
}