Afonso_DiazTotal
Updated 2024-10-10
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
pricet as (
select
hour::date as date,
avg(price) as flow_price_usd
from
flow.price.ez_prices_hourly
where
symbol = 'FLOW'
group by 1
),
main as (
select
tx_id,
block_timestamp,
nvl(event_data:buyer, b.proposer) as buyer,
iff(event_data:salePaymentVaultType ilike '%DapperUtilityCoin%', 'USDC', 'FLOW') as symbol,
event_data:salePrice as price,
price * iff(symbol = 'USDC', 1, flow_price_usd) as price_usd,
event_data:commissionAmount as commision_amount,
commision_amount * iff(symbol = 'USDC', 1, flow_price_usd) as commission_amount_usd
from
flow.core.fact_events a
left join
pricet on date = block_timestamp::date
join
flow.core.fact_transactions b
using(tx_id)
where
nvl(event_data:nftType:typeID, event_data:nftType) = 'A.8b148183c28ff88f.Gaia.NFT'
and event_data:purchased = 'true'
and event_type = 'ListingCompleted'
and price > 0
)
QueryRunArchived: QueryRun has been archived