Afonso_DiazOvertime
Updated 2025-05-07
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_id,
block_timestamp,
iff(f.value:from in ('CAOTMWRKNMV5GWSVOMWCTCM5ZZFEQFUSWNLCZXA2KAXD4YG5A4DIPNFT'), f.value:to, f.value:from) as user,
f.value:asset_code as symbol,
f.value:amount as amount,
iff(f.value:from in ('CAOTMWRKNMV5GWSVOMWCTCM5ZZFEQFUSWNLCZXA2KAXD4YG5A4DIPNFT'), 'Bridge To Stellar', 'Bridge From Stellar') as bridge_type
from
stellar.core.ez_operations
join
lateral flatten (input => asset_balance_changes) as f
where
'CAOTMWRKNMV5GWSVOMWCTCM5ZZFEQFUSWNLCZXA2KAXD4YG5A4DIPNFT' in (f.value:from, f.value:to)
and successful
and f.value:asset_type != 'native'
)
select
date_trunc('week', block_timestamp) as date,
bridge_type,
count(*) as transactions,
sum(amount) as volume_usd,
avg(amount) as average_amount_usd,
count(distinct user) as users
from
main
group by 1, 2
order by 1, 2
QueryRunArchived: QueryRun has been archived