SniperTotal volume compaire
    Updated 2022-09-17
    with sol_token_price as (select date_trunc('day', block_timestamp) as day,
    sum(swap_to_amount)/sum(swap_from_amount) as avg_sol_price
    from solana.fact_swaps
    where
    swap_from_mint in ('So11111111111111111111111111111111111111112')
    and swap_to_mint in ('7kbnvuGBxxj8AG9qp8Scn56muWGaRaFqxg1FsRp3PaFT',
    'Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS',
    'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
    'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
    'USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX')
    and succeeded = 'TRUE'
    and swap_from_amount > 0
    and swap_to_amount > 0
    group by 1
    ),

    arbi_nft_sales_tx as (select date_trunc('day', block_timestamp) as day,
    tx_hash,
    event_inputs:from as seller,
    event_inputs:to as purchaser,
    event_inputs:tokenId as token_id,
    contract_address as nft_address,
    eth_value
    from arbitrum.core.fact_event_logs lg inner join arbitrum.core.fact_transactions tr using(tx_hash)
    where
    event_inputs:tokenId is not null
    and event_inputs:from != '0x0000000000000000000000000000000000000000'
    and eth_value>0
    and event_inputs:to !='0x0000000000000000000000000000000000000000'
    and tr.block_timestamp >= CURRENT_DATE - {{last_days}}
    and tx_status = 'SUCCESS'
    and event_name = 'Transfer'
    ),

    eth_PRICE AS (
    SELECT
    Run a query to Download Data