bachiChai Payments
    Updated 2021-09-13

    SELECT
    date_trunc('month',block_timestamp) as date_month,
    COUNT(DISTINCT tx_id) as tot_transaction_count,
    AVG(EVENT_AMOUNT) as avg_amount,
    AVG(EVENT_AMOUNT_USD) as avg_amount_usd,
    SUM(EVENT_AMOUNT) as tot_volume,
    SUM(EVENT_AMOUNT_USD) as tot_volume_usd
    FROM terra.transfers
    WHERE date_month >= DATEADD(year, -1, getdate())
    AND (event_from_address_label = 'chai' OR event_to_address_label = 'chai')
    GROUP BY date_month order by date_month desc;

    --select * from terra.transfers limit 1000;
    Run a query to Download Data