KeyrockBalance Overtime
    Updated 2023-11-24
    WITH USER_DATA AS (
    select
    block_timestamp,
    user_address,
    balance * pow(10,(-1) * 16) as balance
    from
    ethereum.core.fact_eth_balances
    where
    user_address = lower('0x4ec2DcdFb3c165dA62DD1367cB42fe7551524984')
    ORDER by
    BLOCK_TIMESTAMP DESC
    )
    SELECT
    AVG(BALANCE) AS avg_balance,
    MEDIAN(BALANCE) AS median_balance,
    MAX(BALANCE) AS max_balance,
    MIN(BALANCE) AS min_balance,
    COUNT(*) AS total_transactions,
    MIN(BLOCK_TIMESTAMP) as start_date,
    MAX(BLOCK_TIMESTAMP) as end_date,
    TIMESTAMPDIFF(day, start_date, end_date) as active_days
    FROM
    USER_DATA


    Run a query to Download Data