sagharkarigeneral state
    Updated 2025-04-06
    WITH base_data AS (
    SELECT
    tx_id,
    swapper,
    swap_from_amount_usd,
    swap_to_amount_usd,
    block_timestamp
    FROM solana.marinade.ez_swaps
    WHERE succeeded = TRUE
    AND block_timestamp >= DATE '2025-01-01'
    AND (
    swap_from_mint = 'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So' OR
    swap_to_mint = 'mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So'
    )
    ),
    volumes AS (
    SELECT
    COUNT(DISTINCT tx_id) AS total_swaps,
    COUNT(DISTINCT swapper) AS unique_swappers,
    SUM(swap_from_amount_usd + swap_to_amount_usd) / 2 AS total_volume_usd
    FROM base_data
    ),
    monthly_weeks AS (
    SELECT
    COUNT(DISTINCT DATE_TRUNC('month', block_timestamp)) AS active_months,
    COUNT(DISTINCT DATE_TRUNC('week', block_timestamp)) AS active_weeks
    FROM base_data
    )

    SELECT
    v.total_swaps,
    v.unique_swappers,
    v.total_volume_usd,
    v.total_volume_usd / v.total_swaps AS avg_volume_per_tx,
    v.total_volume_usd / v.unique_swappers AS avg_volume_per_swapper,
    v.total_volume_usd / mw.active_months AS avg_monthly_volume_usd,
    Last run: 21 days ago
    TOTAL_SWAPS
    UNIQUE_SWAPPERS
    TOTAL_VOLUME_USD
    AVG_VOLUME_PER_TX
    AVG_VOLUME_PER_SWAPPER
    AVG_MONTHLY_VOLUME_USD
    AVG_WEEKLY_VOLUME_USD
    1
    11544251605441551415813.421343.8861887269663.492957818387853953.355110815415.244286
    1
    93B
    5s