Yousefi_1994World Cup Round of 32 - USDC transfer volume correlated with network token price
    Updated 2023-01-02

    -------------------------------Parameters-------------------------------

    with fix_parameter as (
    select
    case
    when '{{Days}}' = 'All time' then 2000
    when '{{Days}}' = 'Last 30 days' then 30
    when '{{Days}}' = 'Last 60 days' then 60
    when '{{Days}}' = 'Last 90 days' then 90
    when '{{Days}}' = 'Last 180 days' then 180
    when '{{Days}}' = 'Last 360 days' then 360
    else 30
    end as time_frame
    ),

    -------------------------------Ethereum-------------------------------
    ethereum_usdc_transfers as (
    select
    block_timestamp,
    tx_hash,
    block_number,
    from_address as sender,
    to_address as receiver,
    (raw_amount / pow(10, 6)) as transfer_amount,
    'Ethereum' as chain
    from ethereum.core.ez_token_transfers, fix_parameter
    where contract_address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
    and symbol = 'USDC'
    and raw_amount::float > 0
    and from_address != '0x0000000000000000000000000000000000000000'
    and to_address != '0x0000000000000000000000000000000000000000'
    and block_timestamp >= current_date - time_frame
    ),
    eth_price_usd as (
    Run a query to Download Data