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. Queries on the archive or combined dataset need an archive add-on; the free trial is real-time only. 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)
}
}
}