Sbhn_NPLP Terra active
    Updated 2023-02-02
    with active_wallets as ( select tx_sender,
    count(DISTINCT tx_id) as count_tx
    from terra.core.fact_transactions
    where tx_succeeded=TRUE
    group by 1
    having count_tx > {{TransactionCount}})

    select date_trunc('{{Date}}',block_timestamp) as date,
    action,
    count (Distinct tx_id) as Transactions,
    count (distinct liquidity_provider_address) as LPers,
    sum(amount/pow(10,6)) as LP_Volume
    from terra.core.fact_lp_actions
    join active_wallets on liquidity_provider_address=tx_sender
    where tx_succeeded = TRUE
    and action in ('provide_liquidity','withdraw_liquidity')
    and currency = 'uluna'
    group by 1,2
    Run a query to Download Data