LTirrelllfg_network_terra
    Updated 2022-07-07
    with luna_price as (
    select
    date_trunc('hour', block_timestamp) as datetime,
    avg(price_usd) as hourly_price
    from
    terra.oracle_prices
    where
    symbol = 'LUNA'
    and datetime > '2022-01-01'
    group by
    datetime
    ),
    ust_price as (
    select
    date_trunc('hour', block_timestamp) as datetime,
    avg(price_usd) as hourly_price
    from
    terra.oracle_prices
    where
    symbol = 'UST'
    and datetime > '2022-01-01'
    group by
    datetime
    ),
    layer_one as (
    select
    BLOCK_TIMESTAMP,
    date_trunc('hour', block_timestamp) as datetime,
    TX_ID,
    SENDER,
    RECIPIENT,
    AMOUNT,
    AMOUNT_USD,
    CURRENCY,
    CONTRACT_ADDRESS,
    CONTRACT_LABEL,
    Run a query to Download Data