Query editor
-- totals and uniquesWITH 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 = 0x56aa6d651bfefa9207b35e508716466359bae8ef)))WHERE account IS NOT NULL)SELECTCOUNT(*) AS total_claims,COUNT(DISTINCT account) AS unique_claimants,SUM(amount_alloc) AS total_alloc_claimed,SUM(amount_realised) AS total_realised,SUM(slashedAmount / 1e18) AS total_slashed_raw_units, -- safety checkSUM(amount_slashed) AS total_slashedFROM (SELECTaccount,amount_alloc,amount_realised,amount_slashed,0 AS slashedAmountFROM base) s;