Query editor
WITH label AS (SELECT max_by(name, updated_at) AS name, address, 'contract' AS address_typeFROM labels.contractsGROUP BY 2UNION ALLSELECT name, address, 'EOA' AS address_typeFROM labels.ens), vesting_tx AS (SELECTDATE_TRUNC('day', block_time) as block_date, DATE_TRUNC('hour', block_time) AS block_hour, block_time, varbinary_ltrim(topic1) AS account, tx_hash, varbinary_to_uint256(SUBSTRING(data FROM 1 FOR 32)) AS category, varbinary_to_uint256(SUBSTRING(data FROM 33 FOR 32)) / 1e18 AS vesting_amt, SUM(varbinary_to_uint256(SUBSTRING(data FROM 33 FOR 32)) / 1e18) OVER (ORDER BY block_time) AS cumulative_vesting_amt, SUM(varbinary_to_uint256(SUBSTRING(data FROM 33 FOR 32)) / 1e18) OVER (ORDER BY DATE_TRUNC('hour', block_time)) AS cumulative_vesting_amt_hourFROM ethereum.logsWHERE contract_address = 0x74B4f6A2E579D730aAcb9dD23cfbbAEb95029583 -- Vesting ContractAND topic0 = 0xf6210e85403e2a8a76f9c473d03069abc3c4dc598d7e0a652f33f4c87338565b -- VestActivated), wallet_count AS (SELECT COUNT(DISTINCT account) AS vested_walletsFROM vesting_tx), allo as (SELECTblock_date, block_hour, block_time, account, CONCAT('<a href="https://etherscan.io/address/', CAST(account AS varchar), '" target="_blank">', CAST(account AS varchar), '</a>') AS address_link, CONCAT('<a href="https://etherscan.io/tx/', CAST(tx_hash AS varchar), '" target="_blank">', CAST(tx_hash AS varchar), '</a>') AS tx_link, category, w.vested_wallets, vesting_amt, cumulative_vesting_amt, cumulative_vesting_amt * 0.2 / 1000000000 AS expected_unlock_sep_25, cumulative_vesting_amt * 0.2 / 100000000000 * 100 AS unlock_percentage, cumulative_vesting_amt_hour, cumulative_vesting_amt / 1000000000 AS cumulative_vesting_amt_BFROM vesting_txCROSS JOIN wallet_count wORDER BY block_time DESC)select a.account, a.vesting_amt, a.unlock_percentage, unlock_percentage * (vesting_amt/100),b.total_balance, total_balance - (unlock_percentage * (vesting_amt/100) )as difference,b.is_public_salefrom allo aleft join query_5717793 bon a.account = b.Addressorder by vesting_amt desc