Query editor
withfluid_blockchains as (withblockchains(blockchain) as (values('ethereum'), ('arbitrum'), ('base'), ('polygon'), ('plasma'))select *from blockchains), logoperate_raw as (selectblock_time, tx_hash, index as event_index-- , blockchain, varbinary_substring(topic1, 13, 20) as user_address, varbinary_substring(topic2, 13, 20) as token_address, varbinary_to_int256(varbinary_substring(data, 1, 32)) as supply_amount, varbinary_to_int256(varbinary_substring(data, 33, 32)) as borrow_amount, varbinary_substring(varbinary_substring(data, 65, 32), 13, 20) as withdraw_to, varbinary_substring(varbinary_substring(data, 97, 32), 13, 20) as borrow_to, varbinary_to_uint256(varbinary_substring(data, 129, 32)) as total_amounts, varbinary_to_uint256(varbinary_substring(data, 161, 32)) as exchange_prices_and_config, varbinary_to_uint256(0xff) as x8, varbinary_to_uint256(0x3fff) as X14, varbinary_to_uint256(0x7fff) as X15, varbinary_to_uint256(0xffff) as X16, varbinary_to_uint256(0xffffff) as X24, varbinary_to_uint256(0xffffffffffffffff) as X64, 8 as default_exponent_size, varbinary_to_uint256(0xff) as default_exponent_maskfrom arbitrum.logswhere 1=1-- and block_time >= timestamp '2025-10-01'and contract_address = 0x52Aa899454998Be5b000Ad077a46Bbe360F4e497and topic0 = 0x4d93b232a24e82b284ced7461bf4deacffe66759d5c24513e6f29e571ad78d15-- and blockchain in (select blockchain from fluid_blockchains)), logoperate_decoded_step1 as (select*, bitwise_and(exchange_prices_and_config, X16) /1e4 as borrow_rate, bitwise_and(bitwise_right_shift(exchange_prices_and_config, 16), X14) / 1e4 as fee, bitwise_and(bitwise_right_shift(