Skip to main content

New Liquidity Pools on Optimism: Real-Time New Pairs API

What it is​

A feed of every new liquidity pool and token pair on Optimism, read from the on-chain events that DEX factories emit when a liquidity pool is created. Use it for a new pairs list, a listing alert or the first step of a trading bot.

How to get it​

Query the Events cube on EVM(network: optimism). Run it as a query for the pools created so far, or change query to subscription for a live stream over WebSocket.

To use it outside the IDE you need an API token: how to generate a Bitquery API token.

How it is derived​

A new liquidity pool shows up as one of these events:

EventEmitted byVenue
InitializeUniswap v4 PoolManager 0x9a13f98cb987694c9f086b1f5eb990eea8264ec3Uniswap v4 liquidity pools
PoolCreatedVelodrome v2 factory 0xf1046053aa5682b4f9a81b5481394da16be5ff5a, Velodrome Slipstream factories 0xcc0bddb707055e04e497ab22a59c2af4391cd12f and 0xe13dd1fba721aa81a1826d9523ac9bc7d260c879, Uniswap v3 factory 0x1f98431c8ad98523631ae4a59f267346ea31f984Velodrome and Uniswap v3 style liquidity pools
PairCreatedVelodrome v1 factory 0x25cbddb98b35ab1ff77413456b31ec81a6b6b746 and other constant-product factoriesUniswap v2 style pairs

LogHeader.Address on each row is the factory or PoolManager that created the liquidity pool, so it tells you the venue.

Fields​

FieldMeaning
Log.Signature.NameThe event: Initialize, PoolCreated or PairCreated
LogHeader.AddressThe factory or PoolManager that emitted it
ArgumentsThe two tokens and the new liquidity pool address or pool id
Transaction.FromThe wallet that created the liquidity pool
Transaction.ToThe contract it called, such as a launchpad or a router
Block.TimeWhen the liquidity pool was created

Examples​

New liquidity pools created in the last day​

Every liquidity pool created since yesterday 00:00 UTC, newest first.

Run this query in the IDE

{
EVM(network: optimism) {
Events(
limit: {count: 50}
orderBy: {descending: Block_Time}
where: {
Block: {Date: {since_relative: {days_ago: 1}}}
any: [
{
LogHeader: {Address: {is: "0x9a13f98cb987694c9f086b1f5eb990eea8264ec3"}}
Log: {Signature: {Name: {is: "Initialize"}}}
}
{Log: {Signature: {Name: {in: ["PoolCreated", "PairCreated"]}}}}
]
}
) {
Block { Time Number }
Log { Signature { Name } }
LogHeader { Address }
Transaction { Hash From To }
Arguments {
Name
Value {
... on EVM_ABI_Address_Value_Arg { address }
... on EVM_ABI_BigInt_Value_Arg { bigInteger }
... on EVM_ABI_Bytes_Value_Arg { hex }
... on EVM_ABI_Boolean_Value_Arg { bool }
}
}
}
}
}

New liquidity pools live stream​

The same filter as a subscription. Each new liquidity pool is pushed when its block is indexed.

Run this stream in the IDE

subscription {
EVM(network: optimism) {
Events(
where: {
any: [
{
LogHeader: {Address: {is: "0x9a13f98cb987694c9f086b1f5eb990eea8264ec3"}}
Log: {Signature: {Name: {is: "Initialize"}}}
}
{Log: {Signature: {Name: {in: ["PoolCreated", "PairCreated"]}}}}
]
}
) {
Block { Time Number }
Log { Signature { Name } }
LogHeader { Address }
Transaction { Hash From To }
Arguments {
Name
Value {
... on EVM_ABI_Address_Value_Arg { address }
... on EVM_ABI_BigInt_Value_Arg { bigInteger }
... on EVM_ABI_Bytes_Value_Arg { hex }
... on EVM_ABI_Boolean_Value_Arg { bool }
}
}
}
}
}

New Velodrome liquidity pools in the last 30 days​

Only the liquidity pools created by the Velodrome factories. A Velodrome v2 PoolCreated event returns token0, token1, stable (true for a stable liquidity pool) and the new pool address.

Run this query in the IDE

{
EVM(network: optimism, dataset: combined) {
Events(
limit: {count: 50}
orderBy: {descending: Block_Time}
where: {
Block: {Date: {since_relative: {days_ago: 30}}}
LogHeader: {Address: {in: ["0xf1046053aa5682b4f9a81b5481394da16be5ff5a", "0xcc0bddb707055e04e497ab22a59c2af4391cd12f", "0xe13dd1fba721aa81a1826d9523ac9bc7d260c879", "0x25cbddb98b35ab1ff77413456b31ec81a6b6b746"]}}
Log: {Signature: {Name: {in: ["PoolCreated", "PairCreated"]}}}
}
) {
Block { Time Number }
Log { Signature { Name } }
LogHeader { Address }
Transaction { Hash From }
Arguments {
Name
Value {
... on EVM_ABI_Address_Value_Arg { address }
... on EVM_ABI_BigInt_Value_Arg { bigInteger }
... on EVM_ABI_Boolean_Value_Arg { bool }
}
}
}
}
}

Pitfalls​

  • The Uniswap v4 Initialize filter is pinned to the PoolManager address. Uniswap v3 style liquidity pools also emit their own Initialize when first priced, and those rows would repeat the PoolCreated rows.
  • All Uniswap v4 liquidity pools live inside the PoolManager and share its address. Tell them apart by the id argument of Initialize.
  • A new liquidity pool is not a safe token. Check the trades and holders of the token before acting on a listing.
  • For history older than the last few days, add dataset: combined to EVM and keep a Block.Date filter on the query.

FAQ​

Frequently Asked Questions

How can I track new Velodrome liquidity pools on Optimism?

Filter Events on EVM with network optimism to the Velodrome factory addresses and the PoolCreated event. Each event returns token0, token1, whether the liquidity pool is stable, and the new liquidity pool address. Run it as a subscription to get each new Velodrome liquidity pool live.

Can I get new liquidity pools on Optimism as a live stream?

Yes. Change query to subscription and the same filter pushes each new liquidity pool over WebSocket when its block is indexed.

How do I get the trades of a new liquidity pool on Optimism?

Take the liquidity pool address from the event arguments and filter DEX trades by it. The Optimism DEX Trades API page has the queries.

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.