Yousefi_1994Specific Project - Daily Transactions
    Updated 2023-09-07
    with parameter_settings as (
    select
    case
    when '{{Days}}' = 'Last Month' then 30
    when '{{Days}}' = 'Last 2 Month' then 60
    when '{{Days}}' = 'Last 3 Month' then 90
    when '{{Days}}' = 'Last 6 Month' then 180
    when '{{Days}}' = 'Last Year' then 365
    when '{{Days}}' = 'All Time' then 2000
    else 30
    end as time_frame
    ),
    near_project_list as (
    select
    address,
    lower(project_name) as project_name
    from near.core.dim_address_labels
    where project_name is not null
    ),
    final_result_4 as (
    select
    block_timestamp,
    tx_hash,
    tx_receiver,
    tx_signer,
    transaction_fee * pow(10, -24) as fee,
    project_list.project_name as project_name
    from near.core.fact_transactions transactions
    join near_project_list project_list
    on project_list.address = transactions.tx_receiver
    where tx_status = 'Success'
    and block_timestamp::date >= current_date - (select time_frame from parameter_settings)
    and lower(project_name) = lower('{{Specific_Project}}')
    ),
    final_result_5 as (
    select
    Run a query to Download Data