Subscriptions (WebSockets) require a Growth or Enterprise plan. Learn more.
Example Response
Usage Guidelines
- Subscribe by
id(formatpairAddress:networkId) to stream unconfirmed transactions for a specific pair - Alternatively, use
address+networkIdto identify the pair - Solana only — this subscription streams events from unconfirmed (pending) transactions for the lowest possible latency
- Set
quoteTokentotoken0ortoken1to control which token is treated as the base for display - The
datafield uses a union type — use inline fragments (... on UnconfirmedSwapEventData) to access swap-specific fields likepriceUsdandamountNonLiquidityToken - Liquidity events (
Mint,Burn) returnUnconfirmedLiquidityChangeEventDatawithamount0/amount1fields instead - Use this for latency-sensitive applications where seeing unconfirmed trades is more important than finality
Troubleshooting Tips
When should I use this vs onEventsCreated?
When should I use this vs onEventsCreated?
Use
onUnconfirmedEventsCreated when you need the fastest possible trade feed on Solana and can tolerate the data being unconfirmed. Use onEventsCreated for confirmed, finalized events with richer metadata like walletAge, walletLabels, and sandwich attack labels. Most applications should use onEventsCreated.Can unconfirmed events change after they're received?
Can unconfirmed events change after they're received?
Yes. Since the data is from unconfirmed transactions, events can fail, be reordered, or be dropped before finalization. Treat unconfirmed events as provisional.
Why is the data field a union type?
Why is the data field a union type?
The
data field returns different shapes depending on the event type. Swap events return UnconfirmedSwapEventData with price and amount fields, while liquidity events (Mint/Burn) return UnconfirmedLiquidityChangeEventData with amount0/amount1 fields. Use inline fragments to query the fields you need.Is this available on chains other than Solana?
Is this available on chains other than Solana?
No. Unconfirmed event data is currently only available on Solana (networkId: 1399811149).