Sbhn_NPUntitled Query
Updated 2023-01-28Copy Reference Fork
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
›
⌄
--credit : https://app.flipsidecrypto.com/velocity/queries/cd1e5fe1-fdc0-4fed-be9e-3713a415505c
with new_users as (
select
tx_sender as wallet_address,
min(block_timestamp)::date as creation_date
from terra.core.fact_transactions
group by wallet_address
),
new_user_list as (
select
wallet_address,
creation_date
from new_users
),
transfer_luna_from_user as (
select
date_trunc('day',block_timestamp) as day,
sender as address,
- (sum(amount))/1e6 as amount
from terra.core.ez_transfers
where currency = 'uluna'
and tx_succeeded = true
and block_timestamp>= '2023-01-07' and block_timestamp <= '2023-01-21'
group by day, address
),
transfer_luna_to_user as (
select
date_trunc('day',block_timestamp) as day,
receiver as address,
(sum(amount))/1e6 as amount
from terra.core.ez_transfers
where currency = 'uluna'
and tx_succeeded = true
and block_timestamp>= '2023-01-07' and block_timestamp <= '2023-01-21'
group by day, address
),
Run a query to Download Data