datavortextotals
    Updated 8 days ago
    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
    Last run: 8 days ago
    Total Swaps
    Total Traders
    Total Volume Swapped
    Total Swap Fee (NEAR)
    Total Swap Fee (USD)
    Average Swap Fee (NEAR)
    Average Swap Fee (USD)
    Average Swap Volume (USD)
    1
    108544459884121316873423.0634348775.944563175257817.1125671140.004493637820.02375221511121.321119879
    1
    111B
    345s