Query editor
SELECTo.address, sum(o.value) as balance, EXTRACT(DAY FROM sum(o.value*(now() - o.block_time))/sum(o.value)) as weighted_age_utxo_daysFROM bitcoin.outputs oLEFT JOIN bitcoin.inputs iON i.spent_tx_id = o.tx_idAND o.index = i.spent_output_numberWHERE i.spent_tx_id is null --output is not spentAND o.type != 'nulldata' -- could also check script_asm NOT LIKE '%OP_RETURN%'AND o.address is not null -- bunch of undecoded scripts right now that we're going to ignore.GROUP BY 1ORDER BY 2 descLIMIT 1000