Unit Zero LabsPYTH First day Stats copy
Updated 2024-04-24
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
›
⌄
-- forked from kida / PYTH First day Stats @ https://flipsidecrypto.xyz/kida/q/RSS19aau82pf/pyth-first-day-stats
with claims as (
select
tx_to as claimer,
sum(amount) as claimed_amount
from solana.core.fact_transfers
where tx_from = '75WTeS4ZKruLJH4mz6omtbMNz8H9HEG1kY4G6VNQLX5i' -- claim source
and mint = 'HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3'
and block_timestamp >= '2023-11-20' -- 2023-11-20 first day
and block_timestamp < '2023-11-21 11:00' -- 2023-11-20 first day, 2 weeks
group by 1
),
liquidity_txs as (
select
tx_id
from solana.defi.fact_liquidity_pool_actions
where mint = 'HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3'
and block_timestamp >= '2023-11-20' -- 2023-11-20 first day
and block_timestamp < '2023-11-21 11:00' -- 2023-11-20 first day, 2 weeks
),
agg_liquidity as (
select
claimer,
claimed_amount,
sum(case
when action = 'withdraw' then amount
else 0
end) as liquidity_removed,
sum(case
when action = 'deposit' then amount
else 0
end) as liquidity_provided,
liquidity_provided - liquidity_removed as net_liquidity_provided,
QueryRunArchived: QueryRun has been archived