with outflow as (select sum(amount) as outflow_amount from solana.core.fact_transfers t,solana.core.dim_labels l
where t.TX_TO = l.address and mint='Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' and block_timestamp::date < '2022-07-01')
, inflow as (select sum(amount) as inflow_amount from solana.core.fact_transfers t,solana.core.dim_labels l
where t.TX_FROM = l.address and mint='Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' and block_timestamp::date < '2022-07-01')
select inflow_amount - outflow_amount as marketcap from inflow,outflow