Query editor
WITHtradesWithFees AS (SELECTblock_time,block_date,volume_usd AS amount_usd,trades.version,trader_address AS tx_from,pool_address AS project_contract_address,tx_hashFROMton.dex_trades AS tradesWHEREproject = 'ston.fi'),lifetimeActivity AS (SELECTSUM(amount_usd) AS lifetimeVolumeUSD,SUM(IF(version = 1, amount_usd, NULL)) AS lifetimev1VolumeUSD,SUM(IF(version = 2, amount_usd, NULL)) AS lifetimev2VolumeUSD,COUNT(DISTINCT (tx_from)) AS lifetimeNumberOfUsers,COUNT(DISTINCT (tx_hash)) AS lifetimeNumberOfTrades,COUNT(DISTINCT (project_contract_address)) AS lifetimeNumberOfPairsTradedFROMtradesWithFees),liquidity AS (SELECTSUM(tvl_usd) AS totalLiquidityUSDFROMquery_4428063 -- Ston Pool Liquidity),projectStats AS (SELECT*,lifetimeVolumeUSD / lifetimeNumberOfUsers AS lifetimeVolumePerUser,lifetimeNumberOfTrades / lifetimeNumberOfUsers AS lifetimeNumberOfTradesPerUserFROMlifetimeActivity,liquidity)SELECT*FROMprojectStats