Accessing decentralized exchange (DEX) data on Ethereum has never been easier. With powerful GraphQL APIs, developers and analysts can retrieve granular, real-time trading information across major DEX protocols such as Uniswap, Balancer, Kyber, and more. Whether you're building analytics dashboards, monitoring market movements, or conducting blockchain research, Ethereum DEX GraphQL APIs offer the flexibility and precision needed for deep insights.
These APIs support over 18 Ethereum-based DEX platforms and deliver critical metrics including trade history, OHLC (Open-High-Low-Close) data, trading volume trends, and token pair performance—all through customizable queries.
👉 Generate powerful blockchain insights with flexible API tools today.
Core Features of Ethereum DEX GraphQL APIs
GraphQL is a query language that allows you to request only the data you need—no more, no less. This makes it ideal for handling complex blockchain datasets efficiently. The Ethereum DEX GraphQL endpoint enables users to:
- Retrieve trades from specific DEX protocols
- Filter by token pairs using smart contract addresses
- Aggregate trading volume over time
- Generate OHLC data for charting price movements
- Sort and limit results dynamically
All queries are executed against a unified schema accessible via the GraphQL playground, where you can test and refine your requests in real time.
The base endpoint for all queries is: https://graphql.bitquery.io/
This same infrastructure supports over 20 blockchains, making it a scalable solution for multi-chain analysis.
Top DEX Protocols by Trade Volume
To identify the most active decentralized exchanges on Ethereum, use the following query to list DEXs ranked by the total number of trades:
{
ethereum(network: ethereum) {
dexTrades(options: { limit: 100, desc: "trades" }) {
protocol
started: minimum(of: date)
trades: count
}
}
}What This Query Returns
This returns a sorted list of DEX protocols based on trade count, along with the earliest recorded trade date. For example:
[
{
"protocol": "Uniswap v2",
"started": "2020-05-05",
"trades": 24836192
},
{
"protocol": "IDEX",
"started": "2017-09-27",
"trades": 11819652
}
]This insight helps assess protocol popularity and longevity in the DeFi ecosystem.
Latest Trades on a Specific DEX Protocol
To monitor recent activity on a particular exchange like Uniswap v2, use filtering by protocol name:
{
ethereum(network: ethereum) {
dexTrades(
options: { limit: 10, desc: "trades" }
protocol: { is: "Uniswap v2" }
) {
protocol
buyCurrency {
symbol
address
}
buyAmount
sellCurrency {
symbol
address
}
sellAmount
trades: count
}
}
}Sample Output
{
"protocol": "Uniswap v2",
"buyCurrency": {
"symbol": "USDT",
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7"
},
"buyAmount": 1842158918.31,
"sellCurrency": {
"symbol": "WETH",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
},
"sellAmount": 4977863.83,
"trades": 379716
}This data reveals dominant trading pairs and liquidity trends.
Fetching Latest Trades for a Token Pair
To drill down into a specific trading pair—such as USDT-WETH—you must reference the tokens' contract addresses:
{
ethereum(network: ethereum) {
dexTrades(
options: { limit: 10, desc: ["block.height", "tradeIndex"] }
protocol: { is: "Uniswap v2" }
buyCurrency: { is: "0xdac17f958d2ee523a2206206994597c13d831ec7" }
sellCurrency: { is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" }
) {
block {
height
timestamp {
iso8601
}
}
transaction {
hash
}
tradeIndex
buyCurrency {
symbol
address
}
buyAmount
sellCurrency {
symbol
address
}
sellAmount
maker {
address
annotation
}
taker {
address
annotation
}
protocol
smartContract {
address {
address
annotation
}
contractType
}
}
}
}This level of detail supports advanced use cases like arbitrage detection, front-running analysis, or wallet tracking.
OHLC Data for Price Charting
OHLC (Open-High-Low-Close) data is essential for technical analysis and candlestick chart generation. You can generate OHLC metrics at custom intervals—second, minute, hour, day, month, or year.
Here’s how to get 5-minute OHLC data for USDT-WETH on Uniswap v2:
{
ethereum(network: ethereum) {
dexTrades(
options: { limit: 10, asc: "timeInterval.minute" }
protocol: { is: "Uniswap v2" }
date: { is: "2020-10-10" }
buyCurrency: { is: "0xdac17f958d2ee523a2206206994597c13d831ec7" }
sellCurrency: { is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" }
) {
timeInterval {
minute(count: 5)
}
buyCurrency {
symbol
address
}
buyAmount
sellCurrency {
symbol
address
}
sellAmount
trades: count
maximum_price: price(calculate: maximum)
minimum_price: price(calculate: minimum)
open_price: minimum(of: block, get: price)
close_price: maximum(of: block, get: price)
}
}
}👉 Visualize live DEX market dynamics with real-time API access.
Monthly Trading Volume for a Token
To analyze long-term adoption or liquidity trends of a token like USDT, aggregate trading volume across all DEXs monthly:
{
ethereum(network: ethereum) {
dexTrades(
options: { asc: "date.date" }
buyOrSellCurrency: { is: "0xdac17f958d2ee523a2206206994597c13d831ec7" }
) {
date {
date(format: "%Y-%m")
}
amount
currency {
symbol
}
}
}
}This query returns monthly totals showing how trading demand evolves over time—useful for market analysts and investors.
Frequently Asked Questions
Q: What are the core keywords in this article?
A: The primary SEO keywords are Ethereum DEX APIs, GraphQL API examples, DEX trading data, OHLC blockchain data, Uniswap trade history, token pair analytics, smart contract address lookup, and real-time DEX volume.
Q: Why use GraphQL instead of REST for blockchain data?
A: GraphQL allows precise data fetching—no over-fetching or under-fetching. It’s especially effective for nested blockchain structures, reducing bandwidth and improving performance.
Q: Can I get data for tokens not listed by symbol?
A: Yes, but only via their smart contract address. The API does not recognize token symbols directly; always use verified contract addresses.
Q: Is historical DEX data available?
A: Absolutely. The API provides full historical access to trades dating back to each protocol's launch on Ethereum.
Q: Which DEX protocols are supported?
A: Over 18 protocols including Uniswap (all versions), Balancer, Kyber, 0x, IDEX, SushiSwap, Curve Finance, and more.
Q: How do I test these queries without coding?
A: Use the interactive GraphQL Playground at https://graphql.bitquery.io/ to build and execute queries visually.
Ready to dive deeper into decentralized finance analytics?
👉 Explore powerful blockchain data tools with flexible query capabilities.