latest dex trades

Returns the latest DEX trades on Ethereum, where buy currency smart contract is 0x5283…8b44, sell currency smart contract is 0x5283…8b44 and block time after 2024-11-11: block time, from, transaction hash, buy amount, buy amount in USD, buy currency name, buy currency symbol and 8 more fields.

By kirill · saved 17 December 2024 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($token: String, $from_date_time: DateTime, $to_date_time: DateTime)  {
	EVM(dataset: combined, network: eth) {
		buyside: DEXTrades(
		orderBy: {descending: Block_Time}
		where: 
		{
			Trade: {Buy: {Currency: {SmartContract: {is: $token}}, Amount: {gt: "1000"}}}, 
			Block: {Time: {after: $from_date_time, before: $to_date_time}}
		}
		) {
		Block {
			Time
		}
		Transaction {
			From
			Hash
		}
		Trade {
			Buy {
			Amount
			AmountInUSD
			Currency {
				Name
				Symbol
				SmartContract
			}
			Price
			}
			Sell {
			Amount
			AmountInUSD
			Currency {
				Name
				SmartContract
				Symbol
			}
			Price
			}
		}
		}
		sellside: DEXTrades(
		orderBy: {descending: Block_Time}
		where: 
		{
			Trade: {Sell: {Currency: {SmartContract: {is: $token}},Amount: {gt: "1000"}}},
			Block: {Time: {after: $from_date_time, before: $to_date_time}}
		}
		) {
		Block {
			Time
		}
		Transaction {
			From
			Hash
		}
		Trade {
			Buy {
			Amount
			AmountInUSD
			Currency {
				Name
				Symbol
				SmartContract
			}
			Price
			}
			Sell {
			Amount
			Amount
			Currency {
				Name
				SmartContract
				Symbol
			}
			Price
			}
		}
		}
	}
}

Variables

{
  "token": "0x5283D291DBCF85356A21bA090E6db59121208b44",
  "from_date_time": "2024-11-11T03:20:00Z", "to_date_time": "2024-12-13T14:25:23Z"
}

Similar queries