Query editor
-- oracle-scanner SEED build: per-asset price sources wired by Aave-fork oracles on base-- code_filter=True source_class=dex with_compound=True (source-selector only => superset of R6, not R6-confirmed)WITH src AS (SELECT contract_address AS oracle,bytearray_substring(topic1, 13, 20) AS asset,bytearray_substring(topic2, 13, 20) AS source,ROW_NUMBER() OVER (PARTITION BY contract_address, topic1ORDER BY block_number DESC, index DESC) AS rn,COUNT(*) OVER (PARTITION BY contract_address, topic1) AS n_changesFROM base.logsWHERE topic0 = 0x22c5b7b2d8561d39f7f210b6b326a1aa69f15311163082308ac4877db6339dc1AND block_time >= TIMESTAMP '{{start_date}}'AND block_time < TIMESTAMP '{{end_date}}'),feeds AS (SELECT source AS feed,COUNT(*) AS n_assets,COUNT(DISTINCT oracle) AS n_oracles,MAX(n_changes) AS n_changesFROM srcWHERE rn = 1 AND source <> 0x0000000000000000000000000000000000000000GROUP BY sourceHAVING COUNT(*) >= {{min_assets}}),compound AS (SELECT bytearray_substring(data, 45, 20) AS feed,CAST(0 AS BIGINT) AS n_assets,COUNT(DISTINCT contract_address) AS n_oracles, COUNT(*) AS n_changesFROM base.logsWHERE topic0 = 0xd52b2b9b7e9ee655fcb95d2e5b9e0c9f69e7ef2b8e9d2d0ea78402d576d22e22AND block_time >= TIMESTAMP '{{start_date}}'AND block_time < TIMESTAMP '{{end_date}}'AND bytearray_substring(data, 45, 20) <> 0x0000000000000000000000000000000000000000GROUP BY 1)SELECT f.feed, f.n_assets, f.n_oracles, f.n_changesFROM (SELECT * FROM feeds UNION ALL SELECT * FROM compound) fJOIN base.creation_traces ct ON ct.address = f.feedWHERE (bytearray_position(ct.code, 0x63054d50d4) > 0 -- getAmountOut(uint256,uint256,uint256)OR bytearray_position(ct.code, 0x6307211ef7) > 0 -- get_dy_underlying(int128,int128,uint256)OR bytearray_position(ct.code, 0x6307a2d13a) > 0 -- convertToAssets(uint256)OR bytearray_position(ct.code, 0x630902f1ac) > 0 -- getReserves()OR bytearray_position(ct.code, 0x633850c7bd) > 0 -- slot0()OR bytearray_position(ct.code, 0x635e0d443f) > 0 -- get_dy(int128,int128,uint256)OR bytearray_position(ct.code, 0x6377c7b8fc) > 0 -- getPricePerFullShare()OR bytearray_position(ct.code, 0x6399530b06) > 0 -- pricePerShare()OR bytearray_position(ct.code, 0x63bb7b8b80) > 0 -- get_virtual_price()OR bytearray_position(ct.code, 0x63cc2b27d7) > 0 -- calc_withdraw_one_coin(uint256,int128)OR bytearray_position(ct.code, 0x63d06ca61f) > 0 -- getAmountsOut(uint256,address[])OR bytearray_position(ct.code, 0x63ed8e84f3) > 0 -- calc_token_amount(uint256[2],bool)OR bytearray_position(ct.code, 0x63f7729d43) > 0 -- quoteExactInputSingle(address,address,uint24,uint256,uint160))ORDER BY f.n_assets DESC, f.n_changes DESC