prbhvgupta2023-11-23 06:31 PM
Updated 2023-11-23
999
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 transfers as (
select
date(block_timestamp) as date,
trf.CONTRACT_ADDRESS as token_contract_address,
trf.TX_HASH as transaction_hash,
trf.FROM_ADDRESS as "from",
trf.TO_ADDRESS as "to",
cast(trf. RAW_AMOUNT as double) as value
from base.core.fact_token_transfers trf
where 1=1
--trf.{{topics_length_column}} = 3
and trf.CONTRACT_ADDRESS in
('0x833589fcd6edb6e08f4c7c32d4f71b54bda02913',
'0x50c5725949a6f0c72e6c4a641f24049a917db0cb')
),
transfer_in as (
select
date,
token_contract_address,
transaction_hash,
"to" as address,
sum(cast(value as double)) as amount_in
from transfers
-- AND cast(value as double) > 0
group by 1,2,3,4
),
transfer_out as (
select
date,
token_contract_address,
transaction_hash,
"from" as address,
sum(cast(value as double)) as amount_out
Run a query to Download Data