ValiMohammadiSolana-TotalUser
    Updated 2023-02-16
    with The_CEX_Address as (
    select
    address ,
    project_name,
    blockchain
    from crosschain.address_labels
    where label_subtype = 'hot_wallet'
    and blockchain in ('solana')
    ),
    Info_Solana as
    (
    select
    date(block_timestamp) as date,
    date_trunc('week',block_timestamp) as week_date,
    tx_id as tx_hash,
    project_name ,
    tx_to as user ,
    amount,
    mint
    from solana.core.fact_transfers FT join The_CEX_Address CA on FT.tx_from = CA.address
    where block_timestamp::date >= CURRENT_DATE - 90
    and tx_to not in (select address from The_CEX_Address)) ,

    sol_label as
    (
    select
    date,
    week_date,
    tx_hash,
    project_name ,
    user ,
    label ,
    amount,
    address
    from Info_Solana a join solana.core.dim_labels b on a.mint = b.address
    ),
    Run a query to Download Data