Query editor
WITH dates AS (SELECTcast('2021-10-19 22:00' as timestamp) as start_date,current_timestamp as end_date), botto_burnt AS (SELECTSUM(value * power(10, -18)) as botto_burntFROM botto_ethereum.Botto_evt_TransferWHERE evt_block_time >= (SELECT start_date FROM dates)AND evt_block_time < (SELECT end_date FROM dates)AND contract_address = 0x9dfad1b7102d46b1b197b90095b5c4e9f5845bbaAND "from" = 0x39c0aa77b2f4283bc5dd6b2bc707c3a6bc025391AND "to" = 0x000000000000000000000000000000000000dead), botto AS (SELECT100000000 as initial_supply, (SELECT botto_burnt FROM botto_burnt) as burnt), non_circulating_addresses AS (SELECT 0xaf1e1c2eb21e4b977517bc651a7046c723b49809 as address -- Team Vesting (Multisig)UNIONSELECT 0x19cd3998f106ecc40ee7668c19c47e18b491e8a6 as address --GovernanceUNIONSELECT 0x35bb964878d7b6ddfa69cf0b97ee63fa3c9d9b49 as address -- Treasury (Multisig)UNIONSELECT 0xf8515cae6915838543bcd7756f39268ce8f853fd as address -- Liquidity MiningUNIONSELECT 0x000000000000000000000000000000000000dead as address -- Burnt), non_circulating_botto AS (SELECTdistinct(address) as holder, sum(amount) * power(10, -18) as bottoFROM (-- flow inSELECT"to" as address, cast(value as int256) as amountFROM erc20_ethereum.evt_TransferWHERE contract_address = 0x9dfad1b7102d46b1b197b90095b5c4e9f5845bbaAND "to" IN (SELECT address FROM non_circulating_addresses)-- flow outUNION ALLSELECT"from" as address, -cast(value as int256) as amountFROM erc20_ethereum.evt_TransferWHERE contract_address = 0x9dfad1b7102d46b1b197b90095b5c4e9f5845bbaAND "from" IN (SELECT address FROM non_circulating_addresses))GROUP BY 1)SELECT