Query editor
with decoded as (selectheight, time, mint_reward, total_fees,bytearray_to_bigint(bits) as bits_int,lower(from_utf8(coinbase, '?')) as cbfrom bitcoin.blockswhere height >= 817709),tagged as (selectheight, time, mint_reward, total_fees,(bits_int / 16777216) * 16777216 + (bits_int % 16777216) as nat_emission,casewhen cb like '%antpool%' then 'AntPool'when cb like '%f2pool%' or cb like '%🐟%' then 'F2Pool'when cb like '%viabtc%' then 'ViaBTC'when cb like '%spiderpool%' then 'SpiderPool'when cb like '%luxor%' then 'Luxor'when cb like '%foundry%' then 'Foundry USA'when cb like '%secpool%' then 'SECPOOL'when cb like '%mara%' or cb like '%made in usa%' then 'MARA Pool'when cb like '%nicehash%' then 'NiceHash'when cb like '%ocean%' then 'OCEAN'when cb like '%slush%' or cb like '%braiins%' then 'Braiins Pool'when cb like '%binance%' then 'Binance Pool'when cb like '%btc.com%' or cb like '%btccom%' then 'BTC.com'when cb like '%poolin%' then 'Poolin'when cb like '%ultimus%' then 'ULTIMUSPOOL'when cb like '%whitepool%' then 'WhitePool'when cb like '%sbicrypto%' or cb like '%sbi crypto%' then 'SBI Crypto'else 'Unknown'end as poolfrom decoded), addr(address, pool) as (values ('3GdjWJdkJhtkxRZ3Ns1LstaoHNMBW8XsvU','Mining Squared'),('3AvXzTUat4p6Qf6ZLnRNvB3mDLjp3fNmjJ','Mining Squared'),('bc1q75t4wewkmf3l9qg097zvtlh05v5pdz6699kv8k','Innopolis Tech'),('1DnPPFQPrfyNTiHPXhDFyqNnW9T62GEhB1','GDPool'),('3KZDwmJHB6QJ13QPXHaW7SS3yTESFPZoxb','Carbon Negative'),('33SAB6pzbhEGPbfY6NVgRDV7jVfspZ3A3Z','Carbon Negative'),('3554kSaWNnP3B49Xyybert7gmxq2YSnfnx','RedRock Pool'),('1AfPSq5ZbqBaxU5QAayLQJMcXV8HZt92eq','Mining-Dutch'),('34qGNFx6uQv6SzjYPbYVWtjvuy5DSGugt8','Est3lar'),('3JP3zF7LoeoAotqkNGdvX5szUyNPwd937d','BitFuFuPool')), byaddr as (select o.block_height as height, min(a.pool) as pool from bitcoin.outputs o join addr a on a.address = o.address join bitcoin.transactions t on t.id = o.tx_id and t.block_height = o.block_height and t.is_coinbase where o.block_height >= 817709 group by 1)select g.height, g.time, coalesce(case when g.pool = 'Unknown' then b.pool end, g.pool) as pool, g.nat_emission, g.pool in ('AntPool','F2Pool','ViaBTC','SpiderPool','Luxor') as pool_adopted, g.height >= 885588 as miner_credited, g.mint_reward, g.total_fees from tagged g left join byaddr b on b.height = g.height order by g.height desc