Afonso_DiazOvertime
Updated 2024-11-15
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
main as (
select
tx_hash,
block_timestamp,
decoded_log:maker as maker,
decoded_log:taker as taker,
decoded_log:fee / 1e18 AS fee,
case
when decoded_log:makerAssetId = 0 then decoded_log:makerAmountFilled
when decoded_log:takerAssetId = 0 then decoded_log:takerAmountFilled
end / 1e18 as amount
from
blast.core.fact_decoded_event_logs
WHERE
contract_address in ('0x6a3796c21e733a3016bc0ba41edf763016247e72', '0x739f0331594029064c252559436edce0e468e37a')
and event_name = 'OrderFilled'
),
new_users as (
select
date_trunc('{{ period }}', min_date) as date,
count(distinct user) as new_user
from (
select
taker as user,
min(block_timestamp) as min_date
from main
group by 1
)
group by 1
),
overtime as (
select
QueryRunArchived: QueryRun has been archived