bergDaily Stablecoins swap numbers per asset on Raydium at 2 weeks ago
    Updated 2022-12-08
    select
    a.block_timestamp::date "Date",
    b.symbol "Symbol",
    count(distinct tx_id) "Swaps Count",
    count(distinct swapper) "Swappers Count",
    sum(swap_from_amount) "Volume (USD)",
    avg(swap_from_amount) "Average Volume (USD)",
    median(swap_from_amount) "Median Amount (USD)",
    sum("Swaps Count") over (partition by "Symbol" order by "Date" asc) as "Comulative Swaps Count",
    sum("Swappers Count") over (partition by "Symbol" order by "Date" asc) as "Comulative Swappers Count",
    sum("Volume (USD)") over (partition by "Symbol" order by "Date" asc) as "Comulative Volume (USD)"
    from solana.core.fact_swaps a
    join crosschain.core.dim_asset_metadata b
    on a.swap_from_mint = b.token_address
    where a.block_timestamp >= current_date - interval '2 weeks'
    and swap_program = 'raydium v4'
    and platform = 'solana'
    and b.symbol in ('USDT', 'USDC', 'DAI', 'BUSD')
    and a.succeeded = 1
    group by 1, 2
    order by 1
    Run a query to Download Data