with single_asset_txs as (
select
tx_id
from
osmosis.core.fact_liquidity_provider_actions
where action = 'pool_joined' and tx_status = 'SUCCEEDED'
group by tx_id
having
count(*)=1
), both_assets_txs as (
select
tx_id
from
osmosis.core.fact_liquidity_provider_actions
where
action = 'pool_joined' and tx_status = 'SUCCEEDED'
group by
tx_id
having count(*)>1
), token_prices as (
select
date(recorded_at) as day,
address,
symbol,
avg(price) as token_price_usd
from
osmosis.core.dim_prices a join osmosis.core.dim_labels b on a.symbol = b.project_name
where
symbol != 'IOV'
group by
1, 2, 3
)
select
sum(price_usd) as total
from (
select