shaheem query
Returns the latest DEX trade on Ethereum, where buy currency smart contract is 0x62B6…D80C, sell currency smart contract is 0xC02a…6Cc2 and pair smart contract is 0x8B26…337c: buy currency symbol, buy price, buy price in USD, buy amount, buy buyer, sell currency symbol, protocol name and 2 more fields.
What it returns
- buy currency symbol
- buy price
- buy price in USD
- buy amount
- buy buyer
- sell currency symbol
- protocol name
- block time
- block number
Filters
- buy currency smart contract is 0x62B6…D80C
- sell currency smart contract is 0xC02a…6Cc2
- pair smart contract is 0x8B26…337c
The query
query ($baseTokenAddress: String, $quoteTokenAddress: String, $pairAddress: String) {
EVM(network: eth) {
DEXTrades(
where: {Trade: {Buy: {Currency: {SmartContract: {is: $baseTokenAddress}}}, Sell: {Currency: {SmartContract: {is: $quoteTokenAddress}}}, Dex: {Pair: {SmartContract: {is: $pairAddress}}}}, TransactionStatus: {Success: true}}
limit: {count: 1}
orderBy: {descending: Block_Time}
) {
Trade {
Buy {
Currency {
Symbol
}
quotePrice: Price
basePriceUsd: PriceInUSD
Amount
Buyer
}
Sell {
Currency {
Symbol
}
}
Dex {
ProtocolName
}
}
Block {
Time
Number
}
}
}
}
Variables
{
"baseTokenAddress": "0x62B6d83d5aFBf395ece55136E7161c119a8FD80C",
"quoteTokenAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"pairAddress": "0x8B26e5793aaaD4De63b4F990fceC08F3cE65337c"
}
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