Query editor
WITH base AS (SELECT *FROM TABLE (decode_evm_event (abi => '{"anonymous": false,"inputs": [{"indexed": true,"internalType": "address","name": "owner","type": "address"},{"indexed": false,"internalType": "uint256","name": "lockStart","type": "uint256"},{"indexed": false,"internalType": "uint256","name": "amount","type": "uint256"},{"indexed": false,"internalType": "uint256","name": "duration","type": "uint256"}],"name": "DepositWithDuration","type": "event"}',input => TABLE (SELECT * FROM mantle.logsWHERE 1=1AND contract_address = 0xed884f0460a634c69dbb7def54858465808aacefAND topic0 = 0x71a810dd86885cd9fea6e9b97fe8287ec71dd6475db601e9b925679c9f3ec3d1))))SELECTCASEWHEN duration / 86400 = 0 THEN '0 days'WHEN duration / 86400 > 0 AND duration / 86400 <= 50 THEN '50 days'WHEN duration / 86400 > 50 AND duration / 86400 <= 100 THEN '100 days'WHEN duration / 86400 > 100 AND duration / 86400 <= 200 THEN '200 days'ELSE '300 days'END AS Duration,SUM(amount / 1e18) AS Total_locked_amountFROM baseGROUP BY 1ORDER BY 1;