Query editor
-- ETH/USD hourly. Prefers the Fables ETH/USDG pool's own swaps, and falls back to Dune's curated-- WETH series for the hours before that pool existed. Without the fallback every PROLOGUE swap from-- 17 to 19 August is dropped, which is more than half of them.WITH eth_ref AS (SELECT date_trunc('hour', timestamp) AS h, avg(price) AS eth_usdFROM prices.hourWHERE blockchain = 'ethereum'AND contract_address = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2AND timestamp >= TIMESTAMP '2026-08-14'GROUP BY 1),eth_pool AS (SELECT date_trunc('hour', evt_block_time) AS h,avg(abs(CAST(amount1 AS double))/1e6 / NULLIF(abs(CAST(amount0 AS double))/1e18, 0)) AS eth_usdFROM uniswap_v4_robinhood.poolmanager_evt_swapWHERE id = 0xbac3aa3b91584a53a579b3c999a56756e954e59247e497bad1d25a4334bde551AND amount0 <> 0 AND amount1 <> 0GROUP BY 1),eth_px AS (SELECT r.h, COALESCE(p.eth_usd, r.eth_usd) AS eth_usdFROM eth_ref r LEFT JOIN eth_pool p ON p.h = r.h),pro AS (SELECT sw.evt_block_time,abs(CAST(sw.amount0 AS double))/1e18 * e.eth_usd AS vol_usd,abs(CAST(sw.amount0 AS double))/1e18 * e.eth_usd/ NULLIF(abs(CAST(sw.amount1 AS double))/1e18, 0) AS pxFROM uniswap_v4_robinhood.poolmanager_evt_swap swJOIN eth_px e ON e.h = date_trunc('hour', sw.evt_block_time)WHERE sw.id = 0x8651e656738064177752a395dbde2b2a9e3fc469edc2a9212e6060c0990bb7ebAND sw.amount0 <> 0 AND sw.amount1 <> 0),fee AS (SELECT sum(CAST(bytearray_to_uint256(bytearray_substring(l.data, 1, 32)) AS double)/1e18) AS eth,sum(CAST(bytearray_to_uint256(bytearray_substring(l.data, 1, 32)) AS double)/1e18 * e.eth_usd) AS usdFROM robinhood.logs lJOIN eth_px e ON e.h = date_trunc('hour', l.block_time)WHERE l.contract_address = 0xd35e9ca72f64c7f93be30fad67524323396b36d7AND l.topic0 = 0xa13569eccad8e9d7eed1a66b1944fe2a6ff946072c636c0a8c5af0ac6c24be5bAND bytearray_substring(l.data, 97, 32) = 0x000000000000000000000000b9972ca7188e511174947e3936a5315ac7073277)SELECT(SELECT px FROM pro ORDER BY evt_block_time DESC LIMIT 1) AS prologue_price_usd,(SELECT sum(vol_usd) FROM pro) AS prologue_volume_usd,(SELECT count(*) FROM pro) AS prologue_swaps,(SELECT usd FROM fee) AS creator_fee_usd,(SELECT eth FROM fee) AS creator_fee_eth