datavortextotals
Updated 2024-12-11
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 usd_conversion AS (
SELECT
AVG(price) AS near_price_usd
FROM
near.price.ez_prices_hourly
WHERE
symbol = 'NEAR'
AND hour >= '2024-01-01'
AND hour <= '2024-12-31'
),
swaps_with_gas AS (
SELECT
s.tx_hash,
s.trader,
t.transaction_fee,
s.amount_in_usd,
s.block_timestamp
FROM
near.defi.ez_dex_swaps s
JOIN near.core.fact_transactions t ON s.tx_hash = t.tx_hash
WHERE
s.block_timestamp >= '2024-01-01'
AND s.block_timestamp <= '2024-12-31'
AND t.tx_succeeded = TRUE
),
swaps_with_price AS (
SELECT
s.tx_hash,
s.trader,
s.transaction_fee,
s.amount_in_usd,
s.block_timestamp,
u.near_price_usd
FROM
swaps_with_gas s
CROSS JOIN usd_conversion u
QueryRunArchived: QueryRun has been archived