Query editor
SELECT date_trunc('week', block_date) w, count(*) n,avg(CASE WHEN bytearray_to_uint256(bytearray_substring(data,37,32)) = UINT256 '0' THEN 1.0 ELSE 0 END) z,avg(CASE WHEN bytearray_to_uint256(bytearray_substring(data,37,32)) < UINT256 '10000' THEN 1.0 ELSE 0 END) lt001,avg(CASE WHEN bytearray_to_uint256(bytearray_substring(data,37,32)) < UINT256 '1000000' THEN 1.0 ELSE 0 END) lt1,approx_percentile(CAST(bytearray_to_uint256(bytearray_substring(data,37,32)) AS double)/1e6, 0.5) medFROM tron.transactions WHERE block_date BETWEEN DATE '2022-08-29' AND DATE '2023-02-05'AND "to" = 0xa614f803b6fd780986a42c78ec9c7f77e6ded13c AND bytearray_substring(data,1,4)=0xa9059cbb AND success AND bytearray_length(data)>=68GROUP BY 1 ORDER BY 1