SocioCryptoDiversity Score - tx_fee
    Updated 2023-04-13
    with swap as (
    SELECT trader as wallet,
    count(DISTINCT tx_id) as n_txns
    FROM terra.core.ez_swaps
    WHERE tx_succeeded = 'TRUE'
    AND date_trunc('day', block_timestamp) between current_date -60 AND CURRENT_DATE - 30
    GROUP BY wallet
    ),
    staking as (
    SELECT delegator_address as wallet,
    count(DISTINCT tx_id) as n_txns
    FROM terra.core.ez_staking
    WHERE tx_succeeded = 'TRUE'
    AND date_trunc('day', block_timestamp) between current_date -60 AND CURRENT_DATE - 30
    GROUP BY wallet
    ),
    transfers_sender as (
    SELECT sender as wallet,
    count(DISTINCT tx_id) as txns
    FROM terra.core.ez_transfers
    WHERE tx_succeeded = 'TRUE'
    AND date_trunc('day', block_timestamp) between current_date -60 AND CURRENT_DATE - 30
    GROUP BY wallet
    ),
    transfers_receiver as (
    SELECT receiver as wallet,
    count(DISTINCT tx_id) as txns
    FROM terra.core.ez_transfers
    WHERE tx_succeeded = 'TRUE'
    AND date_trunc('day', block_timestamp) between current_date -60 AND CURRENT_DATE - 30
    GROUP BY wallet
    ),
    lp_action as (
    SELECT liquidity_provider_address as wallet,
    count(DISTINCT tx_id) as txns
    FROM terra.core.fact_lp_actions
    Run a query to Download Data