Query editor
WITH first_transfers AS (SELECTaddress,amountFROM (SELECTdst as address,wad/1e18 as amount,ROW_NUMBER() OVER (PARTITION BY dst ORDER BY evt_block_time) as rnFROM weth_base.WETH9_evt_TransferWHERE dst IN (SELECT agent FROM swan_base.Swan_evt_AgentCreated)) tWHERE rn = 1),initial_balance AS (SELECT SUM(COALESCE(ft.amount, 0)) as total_initial_balanceFROM swan_base.Swan_evt_AgentCreated sLEFT JOIN first_transfers ft ON s.agent = ft.address),listed_total AS (SELECT SUM(price / POWER(10, 18)) as total_priceFROM (SELECT price FROM swan_base.Swan_evt_ArtifactListedUNION ALLSELECT price FROM swan_base.Swan_evt_ArtifactRelisted) combined_listings)SELECT(SELECT total_initial_balance FROM initial_balance) +(SELECT total_price FROM listed_total) as combined_total;