Query editor
with evt_logs as (SELECTblock_time, tx_hash, bytearray_ltrim(topic1) as l1TokenAddress, bytearray_ltrim(topic2) as l2TokenAddress, bytearray_ltrim(topic3) as _from, bytearray_ltrim(bytearray_substring(data, 1, 32)) as _to, cast(bytearray_to_int256(bytearray_substring(data, 1+32, 32)) as DOUBLE)/1e18 as amountFROMethereum.logsWHEREcontract_address = 0x99c9fc46f92e8a1c0dec1b1747d010903e884be1ANDtopic0 = 0x718594027abd4eaed59f95162563e0cc6d0e8d5b86b1c7be8b1b0ac3343d0396ANDbytearray_ltrim(topic1) = 0x163f8C2467924be0ae7B5347228CABF260318753ANDblock_time >= TIMESTAMP '2023-07-19 00:00:00'), daily_amount as (SELECTdate_trunc('hour', block_time) as block_date, SUM(amount) as amountFROMevt_logsGROUP BY 1)SELECTblock_date, amount, SUM(amount) OVER (ORDER BY block_date) as accumulate_amount, (SELECT SUM(amount) FROM evt_logs) as total_amountFROMdaily_amountORDER BY block_date