Query editor
with s as ( select tx_from from zksync.logs where topic2=0x01000021a88a3dee3b0944ff9cbf36cb51c26df19b404d38a115a2a2e3ee5b88),t as (select distinct tx_from, hash, data from zksync.transactionsinner join s on zksync.transactions."from"=tx_from and(to=0xd33a17c883d5aa79470cd2522abb213dc4017e01or to=0x7642e38867860d4512fcce1116e2fb539c5cdd21or to=0xbe5f5c11c832451e428d3bb603cc52650c008421or to=0xd1dcbcd06102a3520bbf9b3bf353fda310df0864or to=0x8edb1da9442cbc2dc39d90e5edc4b376f3299623or to=0x62438d9f7eaacd984c1efa76643cdcd44bb07b6cor to=0xf100ff84b363af74e3fcdff554e3da3309159458or to=0xe5716ad6873f7d9919b0a72f5b33570f77c1a615or to=0x1353b2bc10d589807185dc7989d68da251d3d91eor to=0x4424440ae75bb062bc75d77ab1de770eb60be59f)),LP_tokens as (values (0xd33a17c883d5aa79470cd2522abb213dc4017e01), (0x7642e38867860d4512fcce1116e2fb539c5cdd21), (0xbe5f5c11c832451e428d3bb603cc52650c008421), (0xd1dcbcd06102a3520bbf9b3bf353fda310df0864), (0x8edb1da9442cbc2dc39d90e5edc4b376f3299623), (0x62438d9f7eaacd984c1efa76643cdcd44bb07b6c), (0xf100ff84b363af74e3fcdff554e3da3309159458),(0xe5716ad6873f7d9919b0a72f5b33570f77c1a615), (0x1353b2bc10d589807185dc7989d68da251d3d91e), (0x4424440ae75bb062bc75d77ab1de770eb60be59f)),candidates as (select "from", count(distinct to) as pairs, sum(txns) from(select "from", to, count(*) as txns from (select distinct "from", to from zksync.transactions where "from" in (select tx_from from t) and to in (select * from LP_tokens)) group by 1, 2) where "from" not in (select "from" from query_3736868) group by 1)select "from", count(*) as txs from(select * from zksync.transactions where "from" = to and "from" in (select "from" from candidates where pairs=4{{num_of_lp_token_thresold}}) and type!='Priority') group by 1