Query editor
SELECTab.block,o.address,SUM(o.value) AS balanceFROMbitcoin.outputs oLEFT JOINbitcoin.inputs iON i.spent_tx_id = o.tx_idAND o.index = i.spent_output_numberINNER JOINdune.casey_btc.dataset_miningrewards ab -- Reference your uploaded tableON o.address = ab.addressWHEREi.spent_tx_id IS NULL -- Output is not spent (UTXO)AND o.type != 'nulldata' -- Exclude OP_RETURN outputsAND o.address IS NOT NULL -- Ignore undecoded scriptsGROUP BYab.block,o.addressORDER BYab.block ASC,balance DESC;