Query editor
WITH v1_vaults_deprecated AS (SELECT 'eth' AS network, 0xeAbBfca72F8a8bf14C4ac59e69ECB2eB69F0811C AS address, 'ETH_USDC' AS name UNION ALLSELECT 'eth', 0xbEC491FeF7B4f666b270F9D5E5C3f443cBf20991, 'ETH_USDT' UNION ALLSELECT 'eth', 0xA0F83Fc5885cEBc0420ce7C7b139Adc80c4F4D91, 'wstETH_ETH' UNION ALLSELECT 'eth', 0x51197586F6A9e2571868b6ffaef308f3bdfEd3aE, 'wstETH_USDC' UNION ALLSELECT 'eth', 0x1c2bB46f36561bc4F05A94BD50916496aa501078, 'wstETH_USDT' UNION ALLSELECT 'eth', 0x40D9b8417E6E1DcD358f04E3328bCEd061018A82, 'weETH_wstETH' UNION ALLSELECT 'eth', 0x4045720a33193b4Fe66c94DFbc8D37B0b4D9B469, 'sUSDe_USDC' UNION ALLSELECT 'eth', 0xBFADEA65591235f38809076e14803Ac84AcF3F97, 'sUSDe_USDT' UNION ALLSELECT 'eth', 0xf55B8e9F0c51Ace009f4b41d03321675d4C643b3, 'weETH_USDC' UNION ALLSELECT 'eth', 0xdF16AdaF80584b2723F3BA1Eb7a601338Ba18c4e, 'weETH_USDT'),liquidation_events AS (SELECTl.tx_hash,l.topic0,varbinary_ltrim(CAST(varbinary_substring(l.data, 1, 32) AS varbinary)) AS liquidator,varbinary_to_uint256(varbinary_substring(l.data, 33, 32)) AS colAmt,varbinary_to_uint256(varbinary_substring(l.data, 65, 32)) AS debtAmt,varbinary_ltrim(CAST(varbinary_substring(l.data, 97, 32) AS varbinary)) AS to,v.name AS vaultFROMethereum.logs lJOINv1_vaults_deprecated v ON l.contract_address = v.addressWHEREl.topic0 = 0x80fd9cc6b1821f4a510e45ffce6852ea3404807b5d3d833ffa85664408afcb66)SELECTCOUNT(DISTINCT tx_hash) AS liquidation_events,COUNT(tx_hash) AS positions_liquidatedFROM liquidation_events;