Query editor
with-- lpd as (select bytearray_ltrim(topic1) as user, bytearray_to_uint256(data) as amount FROM arbitrum.logs where contract_address=0x840a2b33cc38305cc1fe1d5afbc21d19aa3a80d7 AND topic0=0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c AND block_time < TIMESTAMP'2024-01-11'),-- lpw as (select bytearray_ltrim(topic1) as user, bytearray_to_uint256(data) as amount FROM arbitrum.logs where contract_address=0x840a2b33cc38305cc1fe1d5afbc21d19aa3a80d7 AND topic0=0x884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364 AND block_time < TIMESTAMP'2024-01-11'),-- lpdeposits as( select user,amount/1e18 as amount from lpd),-- lpwithdrawals as( select user,-amount/1e18 as amount from lpw),-- lpboth as( select user,amount from lpdeposits union all select user,amount from lpwithdrawals )-- lpd as (select bytearray_ltrim(topic1) as user, bytearray_to_uint256(data) as amount FROM arbitrum.logs where contract_address=0xfCA8A446346A50f7BaC1a57F56bd02822F452c8e AND topic0=0x9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d AND block_number < 169186811),-- lpw as (select bytearray_ltrim(topic1) as user, bytearray_to_uint256(data) as amount FROM arbitrum.logs where contract_address=0xfCA8A446346A50f7BaC1a57F56bd02822F452c8e AND topic0=0x7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5 AND block_number < 169186811),-- lpdeposits as( select user,amount/1e18 as amount from lpd),-- lpwithdrawals as( select user,-amount/1e18 as amount from lpw),-- lpboth as( select user,amount from lpdeposits union all select user,amount from lpwithdrawals )-- select sum(amount)as amount,user from lpboth group by user order by 1 desclpd as (select bytearray_ltrim(topic1) as user, bytearray_to_uint256(data) as amount FROM arbitrum.logs where contract_address=0xCC835D13543CEC819AC0226Dd9Ff35b6312b8FCa AND topic0=0x9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d AND block_number < 169186811),lpw as (select bytearray_ltrim(topic1) as user, bytearray_to_uint256(data) as amount FROM arbitrum.logs where contract_address=0xCC835D13543CEC819AC0226Dd9Ff35b6312b8FCa AND topic0=0x7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5 AND block_number < 169186811),lpdeposits as( select user,amount/1e18 as amount from lpd),lpwithdrawals as( select user,-amount/1e18 as amount from lpw),lpboth as( select user,amount from lpdeposits union all select user,amount from lpwithdrawals ),lpfinal as (select user,sum(amount)as amount from lpboth group by user order by 1 desc)SELECT user, amount from lpfinal where amount > 1