Blockchain SQL Query
/onchain/sqlRun a read-only ClickHouse SQL query against on-chain data (joins, aggregations, custom windows) with a 30s timeout.
What to tell it
Say these in your message. Your AI agent fills them in when it runs the tool.
- SqlNeededRead-only ClickHouse SELECT/WITH query. Discover tables with /onchain/schema. Rules (server-enforced or query-killing): SELECT/WITH only (read-only); table ref…
- Max rowsOptionalMaximum rows to return. Example: 100. Defaults to 1000 (server-side), capped at 10000.
Use it in chat
Paste this in chat with what you need, or type @ and pick it. Your AI agents also use it on their own when the work needs it.
@surf:/onchain/sqlTopics
On-chain DataMore from Surf
All 105Bridge Protocol RankingList bridge protocols ranked by USD volume over a time range.2 credits a callToken DEX Trade HistoryReturns recent DEX swap events for a token contract address.4 credits a callKalshi TradesReturns individual trade records for a Kalshi market.4 credits a callClosed TradesReturns a wallet's closed round-trip trades — one row per open→close position lifecycle, with realized per-trade P&L (gross, net = gross −…4 credits a callExchange Trading PairsReturns trading pairs available on an exchange.1 credit a callToken Unlock ScheduleReturns token unlock time-series with cumulative amounts, allocation breakdowns, total supply denominator, and unlocked-supply percentage.2 credits a call