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='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' and block_timestamp::date < '2022-10-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='EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' and block_timestamp::date < '2022-10-01')
select inflow_amount - outflow_amount as marketcap from inflow,outflow