Query editor
WITH inputs AS (SELECTdate_trunc('hour', t.block_time) AS hour,i.script_pub_key.address AS address,i.value / 1e8 AS btcFROM bitcoin.transactions tCROSS JOIN UNNEST(t.input) AS i(value,coinbase,height,tx_id,output_number,script_pub_key,script_signature,sequence,witness_data)WHERE t.block_time >= NOW() - INTERVAL '24' hourAND i.script_pub_key.address IS NOT NULL),outputs AS (SELECTdate_trunc('hour', t.block_time) AS hour,o.script_pub_key.address AS address,o.value / 1e8 AS btcFROM bitcoin.transactions tCROSS JOIN UNNEST(t.output) AS o(index,script_pub_key,value)WHERE t.block_time >= NOW() - INTERVAL '24' hourAND o.script_pub_key.address IS NOT NULL),exchange_labels AS (SELECTfrom_utf8(address) AS address_txtFROM labels.owner_addressesWHERE blockchain = 'bitcoin'AND owner_key IS NOT NULL),inflow AS (SELECTo.hour,SUM(o.btc) AS inflow_btcFROM outputs oJOIN exchange_labels lON o.address = l.address_txtGROUP BY 1),outflow AS (SELECTi.hour,SUM(i.btc) AS outflow_btcFROM inputs iJOIN exchange_labels lON i.address = l.address_txtGROUP BY 1),hours AS (