24 ms·
Nice work! If you're looking for a simpler way to set up complicated alerts, try Luabase (https://luabase.com/ https://luabase.com/). I wrote some SQL to get t
by mritchie712 5y ago
Nice work!
If you're looking for a simpler way to set up complicated alerts, try Luabase (https://luabase.com/ https://luabase.com/). I wrote some SQL to get the median and average gas price for the past 24 hours, but you could tweak it to do whatever you want. All the queries instantly have an API endpoint and you can send the result to destinations like over email or webhook.
with mgp as (
select
median(gas_price) as mgp,
avg(gas_price) as agp
from ethereum.transactions as t
where 1=1
and t.block_timestamp > toUInt32(now() - INTERVAL 24 HOUR)
)
select
m.mgp,
((m.mgp \* 21000) / 1e18) as mgp_in_eth,
((m.agp \* 21000) / 1e18) as agp_in_eth
from mgp as m
https://luabase.com/run/d06b57e2c4624299895e5690191c7624 https://luabase.com/run/d06b57e2c4624299895e5690191c7624