John_Galtorbital command commission
    Updated 2022-06-01
    with tableU as (select
    date(block_timestamp) as date,
    fl.value:denom::string as currency,
    sum(fl.value:amount::float) / POW (10, 6) as UST
    from terra.transitions,
    lateral flatten(input => event_attributes:amount) fl
    where date > '2021-09-01'
    and event = 'commission'
    and event_attributes:validator = 'terravaloper19hflr9ay8usqxsxm4zzrsxfy3xz7hp6kv4ydnd'
    and currency = 'uusd'
    group by date, currency
    order by date, currency
    ),

    tableL as (select
    date(block_timestamp) as date,
    fl.value:denom::string as currency,
    sum(fl.value:amount::float) / POW (10, 6) as Luna
    from terra.transitions,
    lateral flatten(input => event_attributes:amount) fl
    where date > '2021-09-01'
    and event = 'commission'
    and event_attributes:validator = 'terravaloper19hflr9ay8usqxsxm4zzrsxfy3xz7hp6kv4ydnd'
    and currency = 'uluna'
    group by date, currency
    order by date, currency
    )

    select tableu.date, ust, luna,
    sum(ust) over (order by tableu.date) as cumulative_ust, sum(luna) over (order by tableu.date) as cumulative_luna
    from tableU
    inner join tableL on tableu.date = tablel.date
    where tableu.date < '2022-05-01'


    Run a query to Download Data