Latest price of a token on bsc
Historical data This query uses the realtime dataset (the default), which holds only a recent window - hours to days depending on the cube. For older data add a dataset to the top-level element: EVM(network: $network, dataset: combined) archive full history combined archive + realtime in one resu
What it returns
- block time
- owner address
- protocol family
- protocol name
- currency symbol
- smart contract
- currency name
- trade price
- amount in USD
- trade amount
- side type
- side currency symbol
- side smart contract
- side currency name
- side amount in USD
- side amount
Filters
- side currency smart contract is 0x55d3…7955
- currency smart contract is 0x711b…f308
- side amount is above 0
- trade price is above 0
The query
# Historical data
# This query uses the realtime dataset (the default), which holds only a
# recent window - hours to days depending on the cube.
#
# For older data add a dataset to the top-level element:
#
# EVM(network: $network, dataset: combined)
#
# archive full history
# combined archive + realtime in one result
#
# Archive and combined need the historical data add-on:
# https://bitquery.io/pricing
#
# Datasets: https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#
query LatestTrades($network: evm_network, $token: String, $base: String) {
EVM(network: $network) {
DEXTradeByTokens(
orderBy: {descending: Block_Time}
limit: {count: 50}
where: {Trade: {Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $base}}}, Currency: {SmartContract: {is: $token}}, Price: {gt: 0}}}
) {
Block {
allTime: Time
}
Trade {
Dex {
OwnerAddress
ProtocolFamily
ProtocolName
}
Currency {
Symbol
SmartContract
Name
}
Price
AmountInUSD
Amount
Side {
Type
Currency {
Symbol
SmartContract
Name
}
AmountInUSD
Amount
}
}
}
}
}
Variables
{
"network": "bsc",
"token": "0x711bfe972465a1e9182766ad67aff3c80a0cf308",
"base": "0x55d398326f99059ff775485246999027b3197955"
}
Similar queries
- bStocks 3am: QQQB 30-day DEX volume · BNB Chain · DEXTradeByTokens
- bStocks 3am: tokenized Tesla 30-day volume · BNB Chain · DEXTradeByTokens
- bsc token ohlcv · BNB Chain · DEXTradeByTokens
- optimized query to get pools data · Ethereum · DEXTradeByTokens
- KTI_primeiros_trades · BNB Chain · DEXTradeByTokens