-- forked from MLDZMN / Mech request by traders 2 copy @ https://flipsidecrypto.xyz/MLDZMN/q/mi8BeqlXGo5F/mech-request-by-traders-2-copy
with t2 as (select
*
from crosschain.olas.fact_mech_activity
)
select
count(*) as no_payments,
sum(AMOUNT) as total_xdai,
sum(AMOUNT_USD) as total_usd,
total_usd / count(distinct BLOCK_TIMESTAMP::date) as avg_usd_per_day
from gnosis.core.ez_native_transfers
where tx_hash in (select tx_hash from t2)