Afonso_Diaznear-18-234
Updated 2023-03-17
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
t0 as (
select
signer_id as new_user
from near.social.fact_addkey_events
where signer_id not in ('events_v1.near', 'contribut3.near', 'events_v2.near')
group by 1
having min(block_timestamp) between '{{ start_date }}' and '{{ end_date }}'
),
t1 as (
select
hour::date as day,
token_address,
symbol,
decimals,
avg(price) as price_usd
from ethereum.core.fact_hourly_token_prices
group by 1, 2, 3, 4
),
t2 as (
select
block_timestamp,
tx_hash,
(raw_amount * price_usd) / pow(10, decimals) as amount,
origin_from_address,
symbol,
decimals,
raw_amount
from ethereum.core.fact_token_transfers
join ethereum.core.fact_event_logs
using(tx_hash)
left join t1
on contract_address = token_address
and block_timestamp::date = day
Run a query to Download Data