Query editor
with etherfi as (with dep as (selectdistinct("from") as users, sum(cast(value as double))/1e18 as etherfi_dep-- , hashfrom ethereum.transactionswhere to = 0x308861A430be4cce5502d0A12724771Fc6DaF216and block_time >= cast('2023-03-01' as timestamp)and success = true-- and sum(cast(value as double))/1e18 > 0group by 1), wdr as (select distinct(to) as users-- , tx_hash, sum(cast(value as double))/1e18 as etherfi_wdrfrom ethereum.traceswhere "from" = 0x308861a430be4cce5502d0a12724771fc6daf216and block_time >= cast('2023-03-01' as timestamp)and call_type = 'call'group by 1)select users, (etherfi_dep - etherfi_wdr) as etherfi_depfrom (selectcase when d.users is not null then d.userswhen w.users is not null then w.users end as users, coalesce(etherfi_dep,0) as etherfi_dep, coalesce(etherfi_wdr,0) as etherfi_wdr-- , (etherfi_dep - etherfi_wdr) as etherfi_depfrom dep as dleft join wdr as w on d.users = w.users)), devamp as (select distinct("from") as users,sum(cast(value as double))/1e18 as devamp_depfrom erc20_ethereum.evt_Transferwhere to = 0x9FFDF407cDe9a93c47611799DA23924Af3EF764Fand evt_block_time >= cast('2024-01-22' as timestamp)group by 1), pendle as (with base as (select "from" as users, hash, cast(value as double)/1e18 as pendle_depfrom ethereum.transactionsinner join (select tx_hash, cast(value as double)/1e18 as pendle_weeth_depfrom ethereum.traceswhere "from" = 0x00000000005bbb0ef59571e58418f9a4357b68a0and to = 0xac0047886a985071476a1186be89222659970d65and block_time >= cast('2024-01-01' as timestamp)and call_type = 'call'and value > cast(0 as uint256)