Query editor
WITH plat_fees AS (select ((bytearray_to_uint256(bytearray_substring(data, 1 + 32 * 4, 32))) / 1e18) as appFee,tx_from as tx_fromfrom base.logswhere topic0 = 0x069a3131d4d72dbdcb40a0d8ff0aa58f71096c2726da05e3ed2608ddf1e93228and contract_address = 0x428aeF7fB31E4E86162D62d4530a4dd7232D953Dunion allselect ((bytearray_to_uint256(bytearray_substring(data, 1 + 32 * 4, 32))) / 1e18) as appFee,tx_from as tx_fromfrom base.logswhere topic0 = 0x58d64bdf8bc9e2ab45691bd838283f536381da0d63e5370b131650a085f846c6and contract_address = 0x428aeF7fB31E4E86162D62d4530a4dd7232D953D),aggregate AS (select sum(appFee) as fee_per_customer, tx_from from plat_feesgroup bytx_fromorder byfee_per_customer DESC)select sum(fee_per_customer) / count(tx_from) from aggregate