Query editor
WITH deposits AS (SELECT"from" AS depositor,value / POWER(10, tok.decimals) AS token_amount,value / POWER(10, tok.decimals) * p.price AS amount_usdFROMerc20_ethereum.evt_Transfer tLEFT JOIN tokens.erc20 tok ON t.contract_address = tok.contract_address AND tok.blockchain = 'ethereum'LEFT JOIN prices.usd p ON t.contract_address = p.contract_addressAND p.blockchain = 'ethereum'AND DATE_TRUNC('minute', t.evt_block_time) = p.minuteWHEREt."to" = 0xdfaa75323fb721e5f29d43859390f62cc4b600b8AND t.evt_block_time >= NOW() - INTERVAL '365' day)SELECTCOUNT(*) AS total_deposits,ROUND(SUM(amount_usd), 2) AS total_deposit_value_usd,ROUND(AVG(amount_usd), 2) AS avg_deposit_usd,COUNT(DISTINCT depositor) AS unique_depositorsFROMdepositsWHEREamount_usd < 2000000AND amount_usd > 0