Afonso_DiazOvertime
Updated 2024-10-13
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 mints as (
select
tx_hash,
block_timestamp,
sender as minter,
event_data:coin_fee_amount/1e8 as fee_amount,
event_data:mod_minted/1e8 as mod_minted,
case
when event_type ilike '%0xf22bede237a07e121b56d91a491eb7bcdfd1f5907926a9e58338f964a01b17fa::asset::USDC%' then 'zUSDC'
when event_type ilike '%0x5e156f1207d0ebfa19a9eeff00d62a282278fb8719f4fab3a586a0a2c0fffbea::coin::T%' then 'whUSDC'
end as symbol
from aptos.core.fact_events events
join aptos.core.fact_transactions transactions
using (tx_hash)
where events.payload_function = '0x6f986d146e4a90b828d8c12c14b6f4e003fdff11a8eecceceb63744363eaac01::psm_scripts::mint'
and event_module = 'psm'
and event_resource like 'MODMintEvent%'
and success = 1
),
overtime as (
select
date_trunc('{{ period }}', block_timestamp) as date,
count(distinct tx_hash) as transactions,
count(distinct minter) as minters,
sum(fee_amount) as fee_volume,
avg(fee_amount) as average_fee_volume,
sum(mod_minted) as mod_minted_volume,
avg(mod_minted) as average_mod_minted_amount
from mints
group by 1
),
new_users as (
select
date_trunc('{{ period }}', min_date) as date,
QueryRunArchived: QueryRun has been archived