diff --git a/dbt_subprojects/tokens/models/prices_v2/minute_inputs/prices_v2_coinpaprika_minute.sql b/dbt_subprojects/tokens/models/prices_v2/minute_inputs/prices_v2_coinpaprika_minute.sql index 4e2a1ae711f..51da3ec4883 100644 --- a/dbt_subprojects/tokens/models/prices_v2/minute_inputs/prices_v2_coinpaprika_minute.sql +++ b/dbt_subprojects/tokens/models/prices_v2/minute_inputs/prices_v2_coinpaprika_minute.sql @@ -21,7 +21,7 @@ select from {{ source('prices','usd_0003') }} as p -- todo: fix this source inner join - {{ ref('prices_trusted_tokens') }} as ptt + {{ source('prices','trusted_tokens') }} as ptt on p.token_id = ptt.token_id where 1=1 diff --git a/dbt_subprojects/tokens/models/prices_v2/minute_inputs/prices_v2_dex_minute_raw.sql b/dbt_subprojects/tokens/models/prices_v2/minute_inputs/prices_v2_dex_minute_raw.sql index f9466fbe0fb..accb4db03f7 100644 --- a/dbt_subprojects/tokens/models/prices_v2/minute_inputs/prices_v2_dex_minute_raw.sql +++ b/dbt_subprojects/tokens/models/prices_v2/minute_inputs/prices_v2_dex_minute_raw.sql @@ -18,10 +18,10 @@ WITH dex_trades_filter_and_unnest as ( d.amount_usd/d.token_bought_amount as price, d.amount_usd as volume -- in USD FROM {{ source('dex','trades') }} d - INNER JOIN {{ref('prices_trusted_tokens')}} t + INNER JOIN {{source('prices','trusted_tokens')}} t on t.blockchain = d.blockchain and t.contract_address = d.token_sold_address -- the token traded against is trusted - LEFT JOIN {{ref('prices_trusted_tokens')}} anti_t + LEFT JOIN {{source('prices','trusted_tokens')}} anti_t on anti_t.blockchain = d.blockchain and anti_t.contract_address = d.token_bought_address -- the subjected token is already in trusted WHERE d.amount_usd > 0 and token_bought_amount > 0 and token_bought_address is not null @@ -39,10 +39,10 @@ WITH dex_trades_filter_and_unnest as ( d.amount_usd/d.token_sold_amount as price, d.amount_usd as volume -- in USD FROM {{ source('dex','trades') }} d - INNER JOIN {{ref('prices_trusted_tokens')}} t + INNER JOIN {{source('prices','trusted_tokens')}} t on t.blockchain = d.blockchain and t.contract_address = d.token_bought_address -- the token traded against is trusted - LEFT JOIN {{ref('prices_trusted_tokens')}} anti_t + LEFT JOIN {{source('prices','trusted_tokens')}} anti_t on anti_t.blockchain = d.blockchain and anti_t.contract_address = d.token_sold_address -- the subjected token is already in trusted WHERE d.amount_usd > 0 and token_sold_amount > 0 and token_sold_address is not null