SocioCryptoUntitled Query
Updated 2022-12-19Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
›
⌄
-- Kucoin 2 '0xebb8ea128bbdff9a1780a4902a9380022371d466'
-- Binance 1 '0xacd03d601e5bb1b275bb94076ff46ed9d753435a'
SELECT a.from_address as wallet,
c.address_name as fram_Address,
b.address_name as to_address,
sum(a.raw_amount)/pow(10,18) as op_out,
count(DISTINCT a.tx_hash) as n_op_out,
avg(a.raw_amount)/pow(10,18) as avg_op_out
FROM optimism.core.fact_token_transfers a
LEFT JOIN optimism.core.dim_labels b
ON a.to_address = b.address
LEFT JOIN optimism.core.dim_labels c
ON a.from_address = c.address
WHERE b.label_type = 'cex' AND contract_address = '0x4200000000000000000000000000000000000042'
AND date_trunc('day',block_timestamp) between '2022-11-04' AND '2022-11-05'
GROUP BY wallet, b.address_name, c.address_name
ORDER BY op_out DESC
Run a query to Download Data