flipsidecryptoTest 4 Gra
Updated 2024-02-16
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 payouts as (
SELECT
b.quest_id,
sum(token_amount) as total_payout
FROM flipside_analytics.quests_data.user_payments a
join flipside_analytics.quests_data.user_quest_status b
on a.reward_source_id = b.ID
WHERE a.reward_source = 'USER_QUEST_STATUS'
GROUP BY 1
),
volume as (
SELECT
b.chain,
b.slug,
a.quest_id,
a.currency,
count(*) as num_completions,
count(distinct tx_id) as total_txs,
count(distinct user_address) as total_users,
sum(a.token_volume) as total_token_volume,
sum(a.fee_volume) as total_fee_volume,
total_token_volume + total_fee_volume as total_volume
FROM flipside_analytics.quests_data.quest_outputs a
LEFT JOIN flipside_analytics.quests_data.quests b
on a.quest_id = b.id
WHERE valid = TRUE and b.chain is not null and b.chain != 'polygon' and slug not like 'beta-%' and b.ends_at > '2024-01-30'
and b.starts_at < current_Date
and b.__hevo__marked_deleted = FALSE
GROUP BY 1,2,3,4
)
SELECT
a.chain,
a.slug,
a.quest_id,
a.currency,
a.num_completions,
QueryRunArchived: QueryRun has been archived