Skip to main content

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, v3 and v4 in real-time and across archive data since genesis.

Real-time data or the last 30 days? Use the Trading cube

For real-time trades and anything from the last 30 days, use the Trading cube: Trading.Trades returns MEV-filtered swaps with a USD price on every row. Use the EVM queries on this page for raw per-swap detail or call and event context. An EVM query without a dataset argument runs on the realtime dataset, which holds only the last few days; add dataset: combined or dataset: archive for older history.

The same schema powers our multi-chain DEX API, so these queries also run on other EVM exchanges, such as PancakeSwap or SushiSwap, once you change the DEX filter.

For Uniswap v3 positions, see the Uniswap position API examples

You can also explore Uniswap APIs on other chains:

ProductUsing this in production? See the DEX API page for plans, free trial and enterprise delivery options.

Uniswap contract addresses on Ethereum​

Core contracts on Ethereum mainnet. Every address below was read from indexed mainnet logs rather than copied from a reference, and each one is the contract that actually emits the events in the next table.

VersionContractAddress
v2Factory0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
v3Factory0x1f98431c8ad98523631ae4a59f267346ea31f984
v3NonfungiblePositionManager0xc36442b4a4522e871399cd717abdd847ab11fe88
v4PoolManager (singleton)0x000000000004444c5dc75cb358380d2e3de08a90
v4PositionManager0xbd216513d74c8cf14cf4747e6aaa6420ff64ee9e

Uniswap event signatures and topic0 hashes​

topic0 is the first log topic, the keccak-256 hash of the event signature. Use it to match raw logs when you are reading them outside Bitquery's decoded schema.

VersionEventSignaturetopic0
v2PairCreatedPairCreated(address,address,address,uint256)0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9
v2SwapSwap(address,uint256,uint256,uint256,uint256,address)0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822
v3PoolCreatedPoolCreated(address,address,uint24,int24,address)0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118
v3SwapSwap(address,address,int256,int256,uint160,uint128,int24)0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67
v4InitializeInitialize(bytes32,address,address,uint24,int24,address,uint160,int24)0xdd466e674ea557f56295e2d0218a125ea4b4f0f6f3307b95f85e6110838d6438
v4SwapSwap(bytes32,address,int128,int128,uint160,uint128,int24,uint24)0x40e9cecb9f5f1f1c5b9c97dec2917b7ee92e57ba5563708daca94dd84ad7112f
v4ModifyLiquidityModifyLiquidity(bytes32,address,int24,int24,int256,bytes32)0xf208f4912782fd25c7f114ca3723a2d5dd6f3bcc3ac8db5af63baa85f711d5ec

A topic0 does not identify Uniswap​

The v2 and v3 contracts are the most forked code on Ethereum, and a fork keeps the ABI, so it keeps the hash. Matching logs on topic0 alone gives you every fork as well as Uniswap.

SushiSwap's factory at 0xc0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac emits exactly the PairCreated signature and topic0 in the table above. On the v3 side, at least four other Ethereum factories emitted the identical PoolCreated in the last 30 days. Any indexer keyed on topic0 alone will report those as Uniswap.

To isolate Uniswap's own pools, pair the topic0 with the factory that created them, listed in the first table.

Filter decoded trades by factory​

Bitquery's decoded trades have the same catch. Trade.Dex.ProtocolName records which code a pool runs, and a fork runs the same code, so uniswap_v2 also returns SushiSwap and the other v2 forks. In Bitquery's trade data for 18 September 2026, 21% of Ethereum transactions carrying a uniswap_v2 trade touched another factory's pools, and SushiSwap's factory was in about three in five of those. Count trades rather than transactions and the share rises to 26%, because a routed swap can touch a Uniswap pool and a fork in the same transaction. The uniswap_v3 label is cleaner, under 2%, and every uniswap_v4 trade came from the PoolManager.

To keep only Uniswap's own pools, filter on the contract that owns them:

VersionFieldValue on Ethereum
v2Trade.Dex.OwnerAddress0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
v3Trade.Dex.OwnerAddress0x1f98431c8ad98523631ae4a59f267346ea31f984
v4Trade.Dex.SmartContract0x000000000004444c5dc75cb358380d2e3de08a90

OwnerAddress is the factory that deployed the pool. v4 pools have no factory, so their OwnerAddress is the zero address and the PoolManager is the SmartContract. In the Trading cube, the same contracts are Market.Address (the v2 or v3 factory) and Market.Program (the v4 PoolManager). The active traders query below uses the v3 filter.

Two more differences worth knowing​

In v2 and v3 the Swap event is emitted by the pair or pool contract itself, so the pool is identified by the log's own address, and mainnet has thousands of distinct emitters. In v4 every pool lives inside the one PoolManager, so every v4 Swap log carries the same emitter address and the pool is identified by the bytes32 PoolId in the event's first argument. Filtering v4 swaps by a pool address does not work; filter by PoolId.

Liquidity positions are represented differently in each version. v2 gives a depositor fungible ERC-20 LP tokens minted by the pair itself. v3 and v4 both issue an ERC-721: one tokenId per position, from the NonfungiblePositionManager in v3 and the PositionManager in v4.

Where they differ is which contract reports the liquidity change. The v3 manager emits IncreaseLiquidity, DecreaseLiquidity and Collect itself, so the position lifecycle is readable from that one contract. The v4 PositionManager emits no liquidity events. Its logs on Ethereum are the ERC-721 Transfer, Approval and ApprovalForAll, and the liquidity change is emitted by the PoolManager as ModifyLiquidity. Reading a v4 position therefore means joining the NFT to the PoolManager's events by PoolId.

Realtime Uniswap v1, v2, v3, v4 Trades​

Track live trades across all Uniswap versions: Run Stream

The stream filters on ProtocolName, so it also returns forks such as SushiSwap. To keep only Uniswap's own pools, use the filters in Filter decoded trades by factory.

Click to expand GraphQL subscription
subscription {
EVM(network: eth) {
DEXTrades(
where: {
Trade: {
Dex: {
ProtocolName: {
in: ["uniswap_v4", "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 include trading metrics like SMA, EMA, VWAP, and more.

The Market.Protocol filter matches forks as well. In the Trading cube, PancakeSwap V2 on BNB Chain, QuickSwap on Polygon and SushiSwap on Ethereum all carry the uniswap_v2 label. To keep Uniswap's own pools, filter Market.Address to the v2 or v3 factory, or Market.Program to the v4 PoolManager. The addresses differ by chain; Ethereum's are in Filter decoded trades by factory.

Run Stream

Click to expand GraphQL query
subscription {
Trading {
Pairs(
where: {Market: {Protocol: {in: ["uniswap_v4","uniswap_v3", "uniswap_v2", "uniswap_v1"]}}, 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 in pools labelled Uniswap v1–v4, forks included, Run query. Add the factory filters to keep Uniswap's own pools only:

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_v4", "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 in pools labelled Uniswap v1–v4, forks included (saved query). It ranks Transaction.From, the account that sent each swap, since on a sale Trade.Buyer is the pool or a router. Side.Type describes the counter-side of each trade, so bought sums the rows where Side.Type is sell. PriceAsymmetry: { lt: 0.1 } drops trades whose two sides disagree badly on value (PriceAsymmetry reference), which would otherwise inflate the USD totals:

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_v4", "uniswap_v3", "uniswap_v2", "uniswap_v1"]
}
}
PriceAsymmetry: { lt: 0.1 }
}
}
) {
Transaction {
From
}
bought: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: sell } } } }
)
sold: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: buy } } } }
)
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). As above, bought counts rows where Side.Type is sell:

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: sell } } } }
)
sold: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: buy } } } }
)
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}

Stream Latest Pool Creation on Uniswap V2, V3​

Run Stream ➤

It covers v4 as well: the PoolManager is in the contract list, and v4 pools are created by Initialize.

Run Query ➤

Click to expand GraphQL query
subscription {
EVM(network: eth) {
Events(
where: {
Log: {
SmartContract: {
in: [
"0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f"
"0x1f98431c8ad98523631ae4a59f267346ea31f984"
"0x000000000004444c5dc75cB358380D2e3dE08A90"
]
}
Signature: {
Name: { in: ["PoolCreated", "PairCreated", "Initialize"] }
}
}
}
) {
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
}
}
}
}
}
}

Latest Pools Created on Uniswap V4​

Track the last 10 Initialize events from the Uniswap V4 factory:

Click to expand GraphQL query
{
EVM(dataset: realtime, network: eth) {
Events(
orderBy: { descending: Block_Number }
limit: { count: 10 }
where: {
Log: {
SmartContract: { is: "0x000000000004444c5dc75cB358380D2e3dE08A90" }
Signature: { Name: { is: "Initialize" } }
}
}
) {
Log {
Signature {
Name
Parsed
Signature
}
SmartContract
}
Transaction {
Hash
}
Block {
Date
Number
}
Arguments {
Type
Value {
... on EVM_ABI_Address_Value_Arg {
address
}
... on EVM_ABI_Boolean_Value_Arg {
bool
}
... on EVM_ABI_Bytes_Value_Arg {
hex
}
... on EVM_ABI_BigInt_Value_Arg {
bigInteger
}
... on EVM_ABI_String_Value_Arg {
string
}
... on EVM_ABI_Integer_Value_Arg {
integer
}
}
}
}
}
}

Active Traders on Uniswap in the Last 7 Days​

Rank the 100 accounts that sent the most Uniswap v3 swaps on Ethereum in the last 7 days. It groups by Transaction.From, since Trade.Seller is often the pool, and sets dataset: combined because the default realtime dataset holds only the last few days:

Click to expand GraphQL query
query ActiveUniswapTraders {
EVM(network: eth, dataset: combined) {
DEXTradeByTokens(
where: {
Trade: {
Dex: {
OwnerAddress: { is: "0x1f98431c8ad98523631ae4a59f267346ea31f984" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
limit: { count: 100 }
orderBy: { descendingByField: "tradeCount" }
) {
Transaction {
From
}
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. ProtocolFamily: "Uniswap" also matches SushiSwap's WETH/USDC pools; filter Market.Address or Market.Program instead when you need Uniswap's own pools.

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. Like the price example above, it filters ProtocolFamily, so fork pools are included.

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 about Kafka streaming concepts

Contact us on our telegram channel for a trial credentials.

Frequently Asked Questions

How do I query Uniswap trades on Ethereum?

Query EVM.DEXTrades with network eth and filter Trade.Dex.OwnerAddress to the v2 factory (0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f) or the v3 factory (0x1f98431c8ad98523631ae4a59f267346ea31f984), or Trade.Dex.SmartContract to the v4 PoolManager (0x000000000004444c5dc75cb358380d2e3de08a90). Filtering on Trade.Dex.ProtocolName alone also returns forks such as SushiSwap.

Can I get pool-level OHLC for Uniswap pairs?

Yes. Use DEXTradeByTokens with interval aggregation on the pair or token mint.

Does Bitquery support Uniswap v4?

Yes, on all eight networks listed in this FAQ. The Uniswap v4 API page covers v4-specific pool and hook fields.

What is the Uniswap V2 factory address on Ethereum?

0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f. It emits PairCreated(address,address,address,uint256) with topic0 0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9 every time a new v2 pair is deployed.

What is the Uniswap V3 factory address on Ethereum?

0x1f98431c8ad98523631ae4a59f267346ea31f984. It emits PoolCreated(address,address,uint24,int24,address) with topic0 0x783cca1c0412dd0d695e784568c96da2e9c22ff989357a2e8b1d9b2b4e6b7118.

What is the Uniswap V4 PoolManager address on Ethereum?

0x000000000004444c5dc75cb358380d2e3de08a90. v4 is a singleton: every v4 pool lives inside this one contract, so it emits every v4 Swap, Initialize and ModifyLiquidity event on Ethereum.

What is the Uniswap V2 PairCreated event signature?

PairCreated(address,address,address,uint256). The arguments are token0, token1, the new pair contract address, and the running count of pairs created. Its topic0 is 0x0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9.

What is the topic0 for a Uniswap V3 swap?

0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67, the hash of Swap(address,address,int256,int256,uint160,uint128,int24). The v2 equivalent is 0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822 and the v4 one is 0x40e9cecb9f5f1f1c5b9c97dec2917b7ee92e57ba5563708daca94dd84ad7112f.

Are Uniswap V3 liquidity positions NFTs?

Yes. Each v3 position is an ERC-721 token minted by the NonfungiblePositionManager at 0xc36442b4a4522e871399cd717abdd847ab11fe88, which also emits IncreaseLiquidity, DecreaseLiquidity and Collect for that tokenId. v4 positions are also ERC-721, minted by the PositionManager at 0xbd216513d74c8cf14cf4747e6aaa6420ff64ee9e. v2 uses fungible ERC-20 LP tokens instead.

Why can't I filter Uniswap v4 swaps by pool address?

Because v4 has no per-pool contract. All pools are held by the single PoolManager, so every v4 Swap log has the same emitter address and identifies its pool by the bytes32 PoolId in the event's first argument. Filter on PoolId rather than on a contract address.

Which chains does Bitquery cover Uniswap on?

Eight networks: Ethereum, BNB Smart Chain, Base, Polygon, Arbitrum, Optimism, Arc and Robinhood Chain. On 18 September 2026 each one carried trades through Uniswap's own v2 and v3 factories and its v4 PoolManager; Uniswap v1 only ever ran on Ethereum. The schema is the same on all eight, so a query moves between them by switching the network argument, but the factory and PoolManager addresses differ by chain. On some chains most transactions labelled uniswap_v2 go through forks: on BNB Smart Chain under 0.5% went through Uniswap's own v2 factory, and more than nine in ten through PancakeSwap V2.

Is Uniswap v4 used outside Ethereum?

Yes, and on some chains it is already the busiest version. Counting only Uniswap's own contracts, v4 carried more transactions than v2 and v3 combined on Robinhood Chain, Arc and BNB Smart Chain on both 17 and 18 September 2026. On Ethereum, v3 still carries more than v4.

Can I identify Uniswap trades by the event topic0 alone?

No. v2 and v3 are heavily forked and a fork keeps the ABI, so it keeps the same topic0. SushiSwap's factory at 0xc0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac emits the identical PairCreated signature, and at least four other Ethereum factories emitted the identical v3 PoolCreated in the last 30 days. Match the topic0 together with the factory that created the pool. In Bitquery's decoded trades, filter Trade.Dex.OwnerAddress to the factory, or Trade.Dex.SmartContract to the v4 PoolManager; Trade.Dex.ProtocolName alone also matches forks.

Build with Bitquery

Ready to run this in production?

Get an API key and run these queries in minutes, or talk to us about plans and enterprise delivery.