Skip to main content

Velodrome API on Optimism: Live Trades, Pools, VELO Price and Traders

Velodrome is the busiest DEX on Optimism by trade count. Bitquery indexes it as two protocols: velodrome_v2, the classic stable and volatile pools, and velodrome_slipstream, the concentrated-liquidity pools. Both share ProtocolFamily Velodrome, so one filter covers the whole DEX. The two behave very differently: v2 has hundreds of pools and a lot of small automated trades, while Slipstream has a few dozen pools that carry nearly all the USD volume. The Slipstream page goes deeper on those pools. Every example runs in the IDE on a free account. Examples use the Trading cube, which adds the trader, USD amounts and the pool address on every row for the last month or so; the last example uses the chain-level DEXTrades cube. A few swaps in thin pools carry absurd USD values, so every USD sum here caps a single trade with AmountsInUsd: { Quote: { lt: 10000000 } }. The VELO token is 0x9560e827af36c94d2ac33a39bce1fe78631088db.

Live Velodrome swaps on Optimism

One message per swap across both Velodrome protocols: side, trader, both amounts in USD, the pool and the protocol. Saved stream here.

subscription VelodromeLiveTradesOptimism {
Trading {
Trades(
where: {
Pair: { Market: { Network: { is: "Optimism" }, ProtocolFamily: { is: "Velodrome" } } }
}
) {
Block {
Time
}
Side
Trader {
Address
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
PriceInUsd
Pair {
Token {
Symbol
Address
}
QuoteToken {
Symbol
Address
}
Pool {
Address
}
Market {
Protocol
}
}
TransactionHeader {
Hash
}
}
}
}

Velodrome v2 vs Slipstream

Group the last day by protocol to see the split: trades, unique traders, active pools and USD volume. Saved query here.

query VelodromeV2VsSlipstreamOptimism {
Trading {
Trades(
where: {
Pair: { Market: { Network: { is: "Optimism" }, ProtocolFamily: { is: "Velodrome" } } }
Block: { Time: { since_relative: { hours_ago: 24 } } }
AmountsInUsd: { Quote: { lt: 10000000 } }
}
orderBy: { descendingByField: "volumeUsd" }
) {
Pair {
Market {
Protocol
}
}
count
traders: uniq(of: Trader_Address)
pools: uniq(of: Pair_Pool_Address)
volumeUsd: sum(of: AmountsInUsd_Quote)
}
}
}

Top Velodrome pools by volume

Pools ranked by USD volume over the last day, with the protocol, both tokens, trade count and traders. This is where a pool address for the other queries comes from. Saved query here.

query VelodromeTopPoolsOptimism {
Trading {
Trades(
where: {
Pair: { Market: { Network: { is: "Optimism" }, ProtocolFamily: { is: "Velodrome" } } }
Block: { Time: { since_relative: { hours_ago: 24 } } }
AmountsInUsd: { Quote: { lt: 10000000 } }
}
orderBy: { descendingByField: "volumeUsd" }
limit: { count: 20 }
) {
Pair {
Pool {
Address
}
Market {
Protocol
}
Token {
Symbol
Address
}
QuoteToken {
Symbol
Address
}
}
count
traders: uniq(of: Trader_Address)
volumeUsd: sum(of: AmountsInUsd_Quote)
}
}
}

Latest VELO price

The newest VELO trades carry the price in USD, the quote token, the pool and the market cap. Saved query here.

query VeloTokenPriceOptimism {
Trading {
Trades(
where: {
Pair: {
Market: { Network: { is: "Optimism" } }
Token: { Address: { is: "0x9560e827af36c94d2ac33a39bce1fe78631088db" } }
}
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
orderBy: { descending: Block_Time }
limit: { count: 10 }
) {
Block {
Time
}
Side
PriceInUsd
Amounts {
Base
}
AmountsInUsd {
Quote
}
Pair {
QuoteToken {
Symbol
}
Pool {
Address
}
Market {
Protocol
}
}
Supply {
MarketCap
}
}
}
}

Top traders on Velodrome

Wallets ranked by USD volume over the last day, with the number of pools each one touched. Order by count instead to surface the high-frequency bots. Saved query here.

query VelodromeTopTradersOptimism {
Trading {
Trades(
where: {
Pair: { Market: { Network: { is: "Optimism" }, ProtocolFamily: { is: "Velodrome" } } }
Block: { Time: { since_relative: { hours_ago: 24 } } }
AmountsInUsd: { Quote: { lt: 10000000 } }
}
orderBy: { descendingByField: "volumeUsd" }
limit: { count: 25 }
) {
Trader {
Address
}
count
pools: uniq(of: Pair_Pool_Address)
volumeUsd: sum(of: AmountsInUsd_Quote)
}
}
}

Latest swaps of one v2 pool

The chain-level DEXTrades cube filtered on the protocol and the pool contract, here VELO/WETH 0x58e6433a6903886e440ddf519ecc573c4046a6b2. Use this cube with dataset: combined on the EVM root for history older than the Trading cube keeps. Saved query here.

query VelodromeV2PoolSwapsOptimism {
EVM(network: optimism) {
DEXTrades(
where: {
Trade: {
Dex: {
ProtocolName: { is: "velodrome_v2" }
SmartContract: { is: "0x58e6433a6903886e440ddf519ecc573c4046a6b2" }
}
}
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
orderBy: { descending: Block_Time }
limit: { count: 20 }
) {
Block {
Time
}
Transaction {
Hash
From
}
Trade {
Buy {
Amount
AmountInUSD
Currency {
Symbol
SmartContract
}
}
Sell {
Amount
AmountInUSD
Currency {
Symbol
SmartContract
}
}
Dex {
ProtocolName
SmartContract
}
}
}
}
}

Frequently Asked Questions

How do I filter Velodrome trades on Optimism?

In the Trading cube filter Pair.Market.ProtocolFamily on Velodrome for the whole DEX, or Pair.Market.Protocol on velodrome_v2 or velodrome_slipstream for one side. In DEXTrades the same names are in Trade.Dex.ProtocolFamily and Trade.Dex.ProtocolName.

What is the difference between velodrome_v2 and velodrome_slipstream?

velodrome_v2 is the classic stable and volatile pools. velodrome_slipstream is the concentrated-liquidity pools. v2 has many more pools and small trades; Slipstream carries most of the USD volume.

How do I get the pool address of a Velodrome pair?

Run the top pools query. Pair.Pool.Address in the Trading cube and Trade.Dex.SmartContract in DEXTrades are the pool contract.

What is the VELO token address on Optimism?

0x9560e827af36c94d2ac33a39bce1fe78631088db.

Can I stream Velodrome trades in real time?

Yes. The live swaps example is a GraphQL subscription over WebSocket. Any query on this page becomes a stream by changing query to subscription and dropping limit and orderBy.

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.