SocioCryptoTERRA - add operations wallet
    Updated 2023-05-23
    WITH days as (
    SELECT DISTINCT date_trunc('day',block_timestamp) as date
    FROM terra.core.ez_transfers
    WHERE date>='2022-11-01'
    ),
    sent as (
    SELECT date_Trunc('day',block_timestamp) as date,
    currency as symbol,
    sum(amount)/pow(10,6) as vol,
    sum(vol)over(ORDER BY date) as cum,
    count(DISTINCT receiver) as n_address,
    count(DISTINCT tx_id) as n_payments
    FROM terra.core.ez_transfers
    WHERE sender = 'terra1v0yhsvk9gzwglu27c02md9z9kmg0vqgrf4q433'
    GROUP BY date, symbol
    ),
    received as (
    SELECT date_Trunc('day',block_timestamp) as date,
    currency as symbol,
    sum(amount)/pow(10,6) as vol,
    sum(vol)over(ORDER BY date) as cum,
    count(DISTINCT sender) as n_address,
    count(DISTINCT tx_id) as n_payments
    FROM terra.core.ez_transfers
    WHERE receiver = 'terra1v0yhsvk9gzwglu27c02md9z9kmg0vqgrf4q433'
    GROUP BY date, symbol
    ),
    price as (
    SELECT date_trunc('day',block_timestamp) as date,
    median(to_amount/from_amount) as luna_price
    FROM terra.core.ez_swaps
    WHERE from_currency = 'uluna' and to_currency = 'ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4'
    GROUP by date
    )


    Run a query to Download Data