Query editor
with decodes as (SELECToutput_value, from_utf8(from_hex(substr(cast(t.hex as varchar), position('2270223a20226272632d323022' in cast(t.hex as varchar)),position('7d6821' in cast(t.hex as varchar))-position('2270223a20226272632d323022' in cast(t.hex as varchar)) --start from portion where standard ends)))) as test, t.block_time as mint_time, t.block_height, t.size, t.virtual_size, t.fee*1e8 as fee, t.fee*1e8/t.virtual_size as sat_byte, t.output[1].script_pub_key.address as minter_address, t.index, t.id as tx_id, from_utf8(from_hex(regexp_extract(cast(hex as varchar), '7b2(?:[^7]|7[^bd])*7d(?=[06])'))) as test4FROM bitcoin.transactions twhere t.block_height > 767429AND cast(t.hex as varchar) LIKE '%0063036f726401%'and cast(t.hex as varchar) LIKE '%226272632d323022%'and MOD(length(regexp_extract(cast(hex as varchar), '7b2(?:[^7]|7[^bd])*7d(?=[06])')),2) = 0 -- improve regex)select date_trunc('day', mint_time) as day, avg(sat_byte) as avg_sat_byte, sum(fee/1e8) as total_btc_fee, count(*) as count_mints, min(mint_time) as first_mint_time, max(mint_time) as last_mint_timefrom decodeswhere test4 like '%brc-20%'group by 1order by 1;