Tony_Intel2023-08-01 10:29 PM
Updated 2023-08-01
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
›
⌄
select sum(raw_amount*price/pow(10, decimals)) as volume, count(distinct origin_from_address) as user_count, count(distinct tx_hash) as tx_count, date_trunc('week', block_timestamp) as date, 'Arbitrum' as blockchain, 'New order' as type
from arbitrum.core.fact_token_transfers t
join arbitrum.core.fact_hourly_token_prices p
on p.token_address = t.contract_address
and date_trunc('hour', t.block_timestamp) = p.hour
where origin_to_address = '0x54df9e11c7933a9ca3bd1e540b63da15edae40bf' and to_address = '0x54df9e11c7933a9ca3bd1e540b63da15edae40bf' and origin_function_signature = '0x53410e7b'
group by 4, 5, 6
union all
select sum(raw_amount*price/pow(10, decimals)) as volume, count(distinct origin_from_address) as user_count, count(distinct tx_hash) as tx_count, date_trunc('week', block_timestamp) as date, 'Polygon' as blockchain, 'New order' as type
from polygon.core.fact_token_transfers t
join polygon.core.fact_hourly_token_prices p
on p.token_address = t.contract_address
and date_trunc('hour', t.block_timestamp) = p.hour
where origin_to_address = '0x54df9e11c7933a9ca3bd1e540b63da15edae40bf' and to_address = '0x54df9e11c7933a9ca3bd1e540b63da15edae40bf' and origin_function_signature = '0x53410e7b'
group by 4, 5, 6
union all
select sum(raw_amount*price/pow(10, decimals)) as volume, count(distinct origin_from_address) as user_count, count(distinct tx_hash) as tx_count, date_trunc('week', block_timestamp) as date, 'Ethereum' as blockchain, 'New order' as type
from ethereum.core.fact_token_transfers t
join ethereum.core.fact_hourly_token_prices p
on p.token_address = t.contract_address
and date_trunc('hour', t.block_timestamp) = p.hour
where origin_to_address = '0x54df9e11c7933a9ca3bd1e540b63da15edae40bf' and to_address = '0x54df9e11c7933a9ca3bd1e540b63da15edae40bf' and origin_function_signature = '0x53410e7b'
group by 4, 5, 6
union all
select sum(raw_amount*price/pow(10, decimals)) as volume, count(distinct origin_from_address) as user_count, count(distinct tx_hash) as tx_count, date_trunc('week', block_timestamp) as date, 'Arbitrum' as blockchain, 'Cancel order' as type
from arbitrum.core.fact_token_transfers t
join arbitrum.core.fact_hourly_token_prices p
on p.token_address = t.contract_address
and date_trunc('hour', t.block_timestamp) = p.hour
where origin_to_address = '0x54df9e11c7933a9ca3bd1e540b63da15edae40bf' and from_address = '0x54df9e11c7933a9ca3bd1e540b63da15edae40bf' and origin_function_signature = '0x8ac9972f'
Run a query to Download Data