getTokenPoolPrice
Returns the latest DEX trade on Ethereum, where buy currency smart contract is 0x8c1b…6549, sell currency smart contract is 0xc02a…6cc2 and pair smart contract is 0x: average of trade buy price.
What it returns
- average of trade buy price
Filters
- buy currency smart contract is 0x8c1b…6549
- sell currency smart contract is 0xc02a…6cc2
- pair smart contract is 0x
The query
query getTokenPoolPrice(
$dataset: dataset_arg_enum!
$network: evm_network
$tokenAddress: String!
$sideTokenAddress: String!
$pairAddress: String!
) {
EVM(network: $network, dataset: $dataset) {
DEXTrades(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Trade: {
Buy: { Currency: { SmartContract: { is: $tokenAddress } } }
Sell: { Currency: { SmartContract: { is: $sideTokenAddress } } }
Dex: { Pair: { SmartContract: { is: $pairAddress } } }
}
TransactionStatus: { Success: true }
}
) {
AveragePrice: average(of: Trade_Buy_Price)
}
}
}
Variables
{
"dataset": "combined",
"network": "eth",
"pairAddress": "0x",
"tokenAddress": "0x8c1bed5b9a0928467c9b1341da1d7bd5e10b6549",
"sideTokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}
Similar queries
- Latest Curve DEX swaps on Ethereum · Ethereum · DEXTrades
- Top Curve liquidity pools by 24h volume on Ethereum · Ethereum · DEXTrades
- STRN_TOKEN_MULTIPLE_DECIMALS_DEX_TRADES · Ethereum · DEXTrades
- USDT DECIMAL SHOWING 0 · Ethereum · DEXTrades
- Trades - 0xEE61159E8A72A08371c52D62c19Efd0C7914f917 · Ethereum · DEXTrades