SELECT
SENDER,
COUNT(*) AS number_of_transactions,
SUM(amount/POW(10, decimal)) AS total_sent_amount,
AVG(amount/POW(10, decimal)) AS average_transaction_amount
FROM
axelar.core.fact_transfers
WHERE
TX_SUCCEEDED = TRUE
GROUP BY
SENDER
HAVING
COUNT(*) > 100 AND AVG(amount/POW(10, decimal)) > 1000
ORDER BY
number_of_transactions DESC,
total_sent_amount DESC;