adriaparcerisasFlow NFT Wallet Behavior Comparison
Updated 2022-07-16Copy 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
›
⌄
-- defining whales those users who move more than 50k in a day
WITH
flow_price as (
SELECT
trunc(timestamp,'day') as date,
avg(PRICE_USD) as flow_price
from flow.core.fact_prices
where SYMBOL = 'FLOW' and timestamp>=current_date - INTERVAL '2 MONTHS'
GROUP BY 1
),
sol_price as (
select
trunc(block_timestamp,'day') as date,
avg(swap_to_amount) / avg(swap_from_amount) as sol_price
from solana.fact_swaps
where swap_from_mint = 'So11111111111111111111111111111111111111112'
and swap_to_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
and swap_to_amount > 0
and swap_from_amount > 0
and block_timestamp >= current_date - INTERVAL '2 MONTHS'
group by 1
),
flow_whales as (
select
trunc(block_timestamp,'day') as date,
buyer as wallet,
sum(case when CURRENCY = 'A.1654653399040a61.FlowToken' then price*flow_price else price end) as volume_moved
from flow.core.fact_nft_sales x
join flow_price y on trunc(x.block_timestamp,'day') = y.date
where block_timestamp >= current_date - INTERVAL '2 MONTHS'
group by 1,2
),
final_flow as (
SELECT
date,
Run a query to Download Data