Skip to content

Instantly share code, notes, and snippets.

@charles-tan
Created February 21, 2024 17:46
Show Gist options
  • Save charles-tan/71f13cf5c5ef0a8f86ae3d9444fc3bcf to your computer and use it in GitHub Desktop.
Save charles-tan/71f13cf5c5ef0a8f86ae3d9444fc3bcf to your computer and use it in GitHub Desktop.
CREATE CHANGELOG eth_txns_priority_fee_analysis AS
SELECT
window_start,
window_end,
COUNT(*) AS txns_cnt,
MIN("maxPriorityFeePerGas") AS min_priority_fee,
MAX("maxPriorityFeePerGas") AS max_priority_fee,
AVG("maxPriorityFeePerGas") AS avg_priority_fee,
STDDEV_SAMP("maxPriorityFeePerGas") AS priority_fee_stddev
FROM HOP(eth_txns_filtered, SIZE 2 MINUTES, ADVANCE BY 15 SECONDS)
GROUP BY window_start, window_end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment