Skip to content
Dune Analytics

@k06a / BZX Admin Drainage

SQL query

1SELECT
2    block_time as time,
3    CASE
4        WHEN "to" = '\x18240bd9c07fa6156ce3f3f61921cc82b2619157' THEN 'iBZRX'
5        WHEN "to" = '\x463538705e7d22aa7f03ebf8ab09b067e1001b54' THEN 'iLINK'
6        WHEN "to" = '\x6b093998d36f2c7f0cc359441fbb24cc629d5ff0' THEN 'iDAI'
7        WHEN "to" = '\x32e4c68b3a4a813b710595aeba7f6b7604ab9c15' THEN 'iUSDC'
8        WHEN "to" = '\x7e9997a38a439b2be7ed9c9c4628391d3e055d48' THEN 'iUSDT'
9        WHEN "to" = '\xb983e01458529665007ff7e0cddecdb74b967eb6' THEN 'iETH'
10        ELSE CONCAT('0x', ENCODE("to", 'hex'))
11    END as token,
12    bytea2numeric(substring("input", 37, 32)) / CASE
13        WHEN "to" = '\x18240bd9c07fa6156ce3f3f61921cc82b2619157' THEN 1e18 -- iBZRX
14        WHEN "to" = '\x463538705e7d22aa7f03ebf8ab09b067e1001b54' THEN 1e18 -- iLINK
15        WHEN "to" = '\x6b093998d36f2c7f0cc359441fbb24cc629d5ff0' THEN 1e18 -- iDAI
16        WHEN "to" = '\x32e4c68b3a4a813b710595aeba7f6b7604ab9c15' THEN 1e6  -- iUSDC
17        WHEN "to" = '\x7e9997a38a439b2be7ed9c9c4628391d3e055d48' THEN 1e6  -- iUSDT
18        WHEN "to" = '\xb983e01458529665007ff7e0cddecdb74b967eb6' THEN 1e18 -- iETH
19        ELSE 1e18
20    END as value,
21    CONCAT('0x', ENCODE(substring("input", 17, 20), 'hex')) as user,
22    CONCAT('0x', ENCODE(tx_hash, 'hex')) as tx_hash
23FROM ethereum.traces
24WHERE substring("input" from 1 for 4) = '\xb87868f4' -- ???
25  AND array_length(trace_address, 1) IS NULL...

SQL query results

Loading