Query editor
-- totals, remaining, unique walletsWITH base AS (SELECTaccount,amount / 1e18 AS amount_alloc,amountRealised / 1e18 AS amount_realised,slashedAmount / 1e18 AS amount_slashedFROM TABLE (decode_evm_event(abi => '{"anonymous": false,"inputs": [{"indexed": true, "internalType": "address", "name": "account", "type": "address"},{"indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256"},{"indexed": false, "internalType": "uint256", "name": "amountRealised", "type": "uint256"},{"indexed": false, "internalType": "uint256", "name": "slashedAmount", "type": "uint256"},{"indexed": false, "internalType": "bool", "name": "isVested", "type": "bool"}],"name": "Claimed","type": "event"}',input => TABLE (SELECT block_time, tx_hash, topic0, topic1, topic2, topic3, dataFROM bnb.logsWHERE contract_address = 0x56aa6d651bfefa9207b35e508716466359bae8efAND topic0 = 0x67cad33bfde477c6739dc9adc3b22fc9eac9c1ce5f0f349d6f15351caf0698cb)))),params AS (SELECT CAST(100000000 AS DOUBLE) AS total_airdrop)SELECTCOUNT(DISTINCT account) AS unique_claimants,SUM(amount_alloc) AS total_alloc_claimed,SUM(amount_realised) AS total_realised,SUM(amount_slashed) AS total_slashed,MAX(p.total_airdrop) - SUM(amount_realised + amount_slashed) AS remaining_to_claimFROM baseCROSS JOIN params p;