shadilWithdraw to my wallet or to my Bentobox?
Updated 2022-04-27
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
with med_risks as (
SELECT address from ethereum.contracts
where name = 'KashiPairMediumRiskV1'
),
all_withdraws as (
select
COUNT(DISTINCT e1.tx_id) as counter_total
from ethereum.udm_events e1
join ethereum.udm_events e2
on e1.block_timestamp = e2.block_timestamp
and e1.tx_id = e2.tx_id
and lower(e2.contract_address) in (SELECT lower(address) from med_risks) -- '0x2cba6ab6574646badc84f0544d05059e57a5dc42'
where
e1.block_timestamp::date >= CURRENT_DATE - 90
and e1.event_name = 'LogWithdraw'
),
to_wallet as (
select
COUNT(DISTINCT e1.tx_id) as counter_to_wallet
from ethereum.udm_events e1
join ethereum.udm_events e2
on e1.block_timestamp = e2.block_timestamp
and e1.tx_id = e2.tx_id
and e2.event_name = 'LogRemoveAsset'
and lower(e2.contract_address) in (SELECT lower(address) from med_risks) -- sample '0x2cba6ab6574646badc84f0544d05059e57a5dc42'
join ethereum.udm_events e3
on e1.block_timestamp = e3.block_timestamp
and e1.tx_id = e3.tx_id
and e3.from_address = '0xf5bce5077908a1b7370b9ae04adc565ebd643966'
and e3.to_address = e3.origin_address
where
e1.block_timestamp::date >= CURRENT_DATE - 90
and e1.event_name = 'LogWithdraw'
-- and e1.tx_id = '0x3ccab6033d4f44feaaa08f9109720a121f0c686a8ca9552b6b1627700e20eb74' sample trx
)
Run a query to Download Data