{"uid":"cap_peIv2yk0IjsgQyVJl6Gtg","slug":"ironflow-custom-sql-query-over-hyperliquid-data-f4eb4134","name":"Ironflow Custom SQL Query over Hyperliquid Data","description":"Read-only ClickHouse SQL over Ironflow's Hyperliquid tables: every fill, trade, liquidation, funding payment, candle, open interest reading and wallet of the last year (hl.* tables; GET /v1/query/schema lists them for free). Use it when no single endpoint answers the question: custom aggregations, joins, wallet cohorts or backtest datasets. Up to 30 s and 10,000 rows a query.","url":"https://api.ironflow.sh/x402/v1/query?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["sql"],"properties":{"sql":{"type":"string","description":"One SELECT over hl.* tables"},"max_rows":{"type":"integer","description":"Most rows to return, up to 10000"}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"array"},"description":"Rows, each an array in column order"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable code: INVALID_PARAMETER, HISTORY_OUT_OF_RANGE, QUERY_WINDOW_EXCEEDED, RATE_LIMIT_EXCEEDED, NOT_FOUND, INTERNAL_ERROR"},"message":{"type":"string","description":"What went wrong and how to fix the request"},"upgrade":{"type":"object","properties":{},"description":"On a limit error: the plan or paid call that lifts it"}},"description":"Present instead of the data on a 4xx or 5xx answer."},"columns":{"type":"array","items":{"type":"string","description":"Column"},"description":"Column names"}},"description":"Query result"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_v2kvAyTmVnzR_9Xds27nR","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Executes arbitrary read-only SELECT SQL against Ironflow's full Hyperliquid dataset (fills, trades, liquidations, funding payments, candles, open interest, wallets) for the past year, returning up to 10,000 rows.","exampleAgentPrompt":"Run a SQL query on Ironflow's Hyperliquid tables to give me the top 10 wallets by total realized PnL on ETH-USD perp fills over the last 30 days — join the fills and trades tables and return up to 500 rows.","exampleUseCases":[{"title":"Wallet cohort funding payment analysis","prompt":"Query Ironflow's Hyperliquid data to find all wallets that received more than $10,000 in cumulative funding payments on BTC-USD over the past 90 days — group by wallet address and return the total funding received, sorted descending, up to 1000 rows."},{"title":"Liquidation price-level backtest dataset","prompt":"Pull me a dataset from Ironflow's hl.* tables: every long liquidation on ETH-USD in the last 6 months with the fill price, size, and timestamp — I need this for backtesting, so give me up to 10,000 rows in raw form."},{"title":"Cross-market open interest correlation","prompt":"Write a SQL query against Ironflow's Hyperliquid open interest and funding rate tables to compare hourly OI and funding for BTC-USD versus ETH-USD over the last 2 weeks — I want to see if they move together, return up to 2000 rows."}],"resultDescription":"Returns a JSON object with a 'columns' array of column name strings and a 'rows' array of arrays (each inner array is one result row in column order). On error, returns an 'error' object with a machine-readable code (e.g. INVALID_PARAMETER, HISTORY_OUT_OF_RANGE, QUERY_WINDOW_EXCEEDED, RATE_LIMIT_EXCEEDED, INTERNAL_ERROR), a human-readable message explaining what went wrong and how to fix it, and optionally an 'upgrade' object indicating how to lift the limit.","failureModes":["INVALID_PARAMETER: malformed SQL, referencing non-existent hl.* table, or missing 'sql' field","HISTORY_OUT_OF_RANGE: query references data older than one year","QUERY_WINDOW_EXCEEDED: query exceeds 30-second execution limit or 10,000 row cap","RATE_LIMIT_EXCEEDED: too many queries in a short window","INTERNAL_ERROR: ClickHouse or Ironflow infrastructure failure","Payment failure: x402 payment of $0.01 USDC not completed before query executes"],"whenToPreferThis":"Use this endpoint when no single Ironflow pre-built endpoint answers the question — specifically when you need custom aggregations, multi-table joins, wallet cohort analysis, backtest dataset construction, or any analytical query that spans multiple data types (fills + liquidations + funding). It subsumes all other Ironflow endpoints at higher cost and latency but with full SQL flexibility. Prefer dedicated endpoints for simple single-metric lookups.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T06:36:59.515Z","isFirstParty":false,"canonicalSlug":"ironflow-custom-sql-query-over-hyperliquid-data-f4eb4134"}