Uniswap API
Uniswap is a decentralized exchange on Ethereum for trading ERC-20 tokens. Bitquery’s APIs support Uniswap trades, pool creations, and active user metrics across v1, v2, and v3 in real-time and across archive data since genesis.
You can also explore Uniswap APIs on other chains:
Realtime Uniswap v1, v2, v3 Trades
Track live trades across all Uniswap versions: Run Stream
Click to expand GraphQL subscription
subscription {
EVM(network: eth) {
DEXTrades(
where: {
Trade: {
Dex: {
ProtocolName: { in: ["uniswap_v3", "uniswap_v2", "uniswap_v1"] }
}
}
}
) {
Block {
Number
Time
}
Transaction {
From
To
Hash
}
Trade {
Dex {
Delegated
DelegatedTo
OwnerAddress
Pair {
Decimals
Name
SmartContract
}
ProtocolFamily
ProtocolName
ProtocolVersion
SmartContract
}
Buy {
Amount
Buyer
Currency {
Name
Symbol
SmartContract
}
Seller
Price
}
Sell {
Amount
Buyer
Currency {
Name
SmartContract
Symbol
}
Seller
Price
}
}
}
}
}
TradingView OHLC Stream on Uniswap Across Chains
The new Price Index Stream helps you get token-level, pair-level, and market-level OHLC data for 1 sec interval( or higher), in real-time across all chains. These also includes trading metrics like SMA, EMA, VWAP, and more.
Click to expand GraphQL query
subscription {
Trading {
Pairs(
where: {Market: {Protocol: {in: ["uniswap_v3", "uniswap_v2"]}}, Interval: {Time: {Duration: {eq: 1}}}}
) {
Currency {
Name
Id
}
Market {
Name
NetworkBid
Network
Address
}
Price {
IsQuotedInUsd
Average {
Mean
}
}
QuoteCurrency {
Id
Symbol
Name
}
QuoteToken {
Symbol
Name
Id
NetworkBid
Network
Did
Address
}
Token {
Name
Id
NetworkBid
}
}
}
}
Latest Trades of a Pair on Uniswap
Retrieve the 50 most recent WETH/USDC trades on Uniswap v1–v3:
Click to expand GraphQL query
query LatestTrades {
EVM(network: eth) {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 50 }
where: {
Trade: {
Side: {
Amount: { gt: "0" }
Currency: {
SmartContract: {
is: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
}
}
}
Currency: {
SmartContract: { is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" }
}
Dex: {
ProtocolName: { in: ["uniswap_v3", "uniswap_v2", "uniswap_v1"] }
}
}
}
) {
Block {
allTime: Time
}
Trade {
Dex {
OwnerAddress
ProtocolFamily
ProtocolName
}
Currency {
Symbol
SmartContract
Name
}
Price
AmountInUSD
Amount
Side {
Type
Currency {
Symbol
SmartContract
Name
}
AmountInUSD
Amount
}
}
}
}
}
Top Traders of a Token
Identify the top 100 USDC traders by USD volume on Uniswap v1–v3:
Click to expand GraphQL query
query topTraders {
EVM(network: eth) {
DEXTradeByTokens(
orderBy: { descendingByField: "volumeUsd" }
limit: { count: 100 }
where: {
Trade: {
Currency: {
SmartContract: { is: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" }
}
Dex: {
ProtocolName: { in: ["uniswap_v3", "uniswap_v2", "uniswap_v1"] }
}
}
}
) {
Trade {
Buyer
}
bought: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: buy } } } }
)
sold: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: sell } } } }
)
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
Uniswap v2 Pair Trade Stats
Get CHEFDOG/WETH v2 pooled stats (volume, bought, sold):
Click to expand GraphQL query
query pairTopTraders {
EVM(network: eth, dataset: combined) {
DEXTradeByTokens(
orderBy: { descendingByField: "volumeUsd" }
limit: { count: 100 }
where: {
Trade: {
Dex: {
Pair: {
SmartContract: {
is: "0x4ba1970f8d2dda96ebfbc466943fb0dfaab18c75"
}
}
}
}
}
) {
Trade {
Dex {
OwnerAddress
ProtocolFamily
ProtocolName
}
}
bought: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: buy } } } }
)
sold: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: sell } } } }
)
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
Stream Latest Pool Creation on Uniswap V2, V3
Click to expand GraphQL query
subscription {
EVM(network: eth) {
Events(
where: {
Log: {
SmartContract: {
in: [
"0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f"
"0x1f98431c8ad98523631ae4a59f267346ea31f984"
]
}
Signature: { Name: { in: ["PoolCreated", "PairCreated"] } }
}
}
) {
Log {
SmartContract
}
Transaction {
Hash
}
Arguments {
Type
Value {
... on EVM_ABI_Boolean_Value_Arg {
bool
}
... on EVM_ABI_Bytes_Value_Arg {
hex
}
... on EVM_ABI_BigInt_Value_Arg {
bigInteger
}
... on EVM_ABI_Address_Value_Arg {
address
}
... on EVM_ABI_String_Value_Arg {
string
}
... on EVM_ABI_Integer_Value_Arg {
integer
}
}
Name
}
Block {
Time
}
}
}
}
Latest Pools Created on Uniswap V2
Track the last 10 PairCreated
events from the Uniswap V2 factory:
Click to expand GraphQL query
{
EVM(dataset: combined, network: eth) {
Events(
orderBy: { descending: Block_Number }
limit: { count: 10 }
where: {
Log: {
SmartContract: { is: "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f" }
Signature: { Name: { is: "PairCreated" } }
}
}
) {
Log {
Signature {
Name
Parsed
Signature
}
SmartContract
}
Transaction {
Hash
}
Block {
Date
Number
}
Arguments {
Type
Value {
... on EVM_ABI_Address_Value_Arg {
address
}
}
}
}
}
}
Active Traders on Uniswap in the Last 7 Days
Identify the top 100 active Uniswap v3 traders since April 1, 2025:
Click to expand GraphQL query
query ActiveUniswapTraders {
EVM(dataset: archive, network: eth) {
DEXTradeByTokens(
where: {
Trade: {
Dex: {
OwnerAddress: { is: "0x1f98431c8ad98523631ae4a59f267346ea31f984" }
}
}
Block: { Date: { after: "2025-04-01" } }
}
limit: { count: 100 }
orderBy: { descendingByField: "tradeCount" }
) {
Trader: Trade {
Seller
}
tradeCount: count
uniqueTokens: count(distinct: Trade_Currency_SmartContract)
}
}
}
Get Latest Trading Price for a Uniswap Token Pair
We launched the Price Index in August 2025, allowing you to track price for any onchain token pair.
Here's an example of tracking Uniswap token pair trading price.
Uniswap Token Pair Price API Run Query ➤
Click to expand GraphQL query
query MyQuery {
Trading(dataset: realtime) {
Pairs(
where: {
Token: { Address: { is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" } }
QuoteToken: {
Address: { is: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" }
}
Market: {
Network: { is: "Ethereum" }
ProtocolFamily: { is: "Uniswap" }
}
Interval: { Time: { Duration: { eq: 60 } } }
}
orderBy: { descending: Block_Time }
limit: { count: 1 }
) {
Block {
Time
}
Price {
Average {
Mean
SimpleMoving
WeightedSimpleMoving
ExponentialMoving
}
}
Market {
Address
ProtocolFamily
Protocol
Program
}
}
}
}
Get OHLC for a Pair on Uniswap
Run Query to get 1 minute
OHLC data for a given pair of currencies
Click to expand GraphQL query
query MyQuery {
Trading(dataset: realtime) {
Pairs(
where: {
Token: { Address: { is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" } }
QuoteToken: {
Address: { is: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" }
}
Market: {
Network: { is: "Ethereum" }
ProtocolFamily: { is: "Uniswap" }
}
Interval: { Time: { Duration: { eq: 60 } } }
}
orderBy: { descending: Interval_Time_End }
) {
Interval {
Time {
Start
End
}
}
Price {
Ohlc {
Open
High
Low
Close
}
}
Market {
Address
ProtocolFamily
Protocol
Program
}
QuoteToken {
Address
Name
Symbol
}
Token {
Address
Name
Symbol
}
}
}
}
Uniswap Kafka Streams
You can get Uniswap data with sub-second latency via Kafka Streams. Read more here
Contact us on our telegram channel for a trial credentials.
```