Query editor
with distinct_from AS(SELECT DISTINCT tx_fromFROM ethereum.logsWHERE contract_address = 0xdAC17F958D2ee523a2206206994597C13D831ec7)SELECTblock_date-- , tx_hash, COUNT(DISTINCT tx_from) AS active_user_num, COUNT(tx_from) AS tx_num, SUM(CASE WHEN (bytearray_to_uint256(bytearray_substring(data, 3, 32)) / 1e6) < 1E12THEN (bytearray_to_uint256(bytearray_substring(data, 3, 32)) / 1e6)ELSE 0 END) AS amount-- , bytearray_to_uint256(bytearray_substring(data, 3, 32)) / 1e6 AS amountFROM ethereum.logsWHERE contract_address = 0xdAC17F958D2ee523a2206206994597C13D831ec7AND block_date >= DATE('2023-7-1') AND block_date < DATE_TRUNC('day', NOW())GROUP BY 1ORDER BY 1