Skip to content

Commit

Permalink
updating models
Browse files Browse the repository at this point in the history
  • Loading branch information
SebMelendez01 committed Dec 19, 2024
1 parent c69336a commit 0302ea5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 84 deletions.
20 changes: 8 additions & 12 deletions models/artemis_wrapped/dim_artemis_wrapped.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,22 @@ categories as (
, ARRAY_TO_STRING(boomer.reason, ', ')
) as reason
from {{ref('dim_blockbuster')}} block_buster
full outer join {{ref('dim_bob_the_builder')}} bob_the_builder on lower(block_buster.address) = lower(bob_the_builder.address)
full outer join {{ref('dim_botimus_prime')}} botimus_prime on lower(block_buster.address) = lower(botimus_prime.address)
full outer join {{ref('dim_terminally_based')}} terminally_based on lower(block_buster.address) = lower(terminally_based.address)
full outer join {{ref('dim_wolf_of_wallstreet')}} wolf_of_wallstreet on lower(block_buster.address) = lower(wolf_of_wallstreet.address)
full outer join {{ref('dim_dora_the_explorer')}} dora_the_explorer on lower(block_buster.address) = lower(dora_the_explorer.address)
full outer join {{ref('dim_old_mcdonald')}} old_mcdonald on lower(block_buster.address) = lower(old_mcdonald.address)
full outer join {{ref('dim_boomer')}} boomer on lower(block_buster.address) = lower(boomer.address)
full outer join {{ref('dim_bob_the_builder')}} bob_the_builder using(address)
full outer join {{ref('dim_botimus_prime')}} botimus_prime using(address)
full outer join {{ref('dim_terminally_based')}} terminally_based using(address)
full outer join {{ref('dim_wolf_of_wallstreet')}} wolf_of_wallstreet using(address)
full outer join {{ref('dim_dora_the_explorer')}} dora_the_explorer using(address)
full outer join {{ref('dim_old_mcdonald')}} old_mcdonald using(address)
full outer join {{ref('dim_boomer')}} boomer using(address)
)

select
address
wrapped.address
, coalesce(category, 'NORMIE') as category
, reason
, total_txns
, total_txns_percent_rank as total_txns_percent_rank
, total_gas_paid
, total_gas_paid_percent_rank as total_gas_paid_percent_rank
, days_onchain
, days_onchain_percent_rank as days_onchain_percent_rank
, apps_used
, apps_used_percent_rank as apps_used_percent_rank
from {{ref('agg_artemis_wrapped_metrics')}} wrapped
left join categories on lower(wrapped.address) = lower(categories.address)
2 changes: 1 addition & 1 deletion models/artemis_wrapped/dim_rugged_rat.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{config(materialized='table')}}

select lower(address) as address, 'WOLF_OF_WALL_STREET' as category, array_agg(distinct symbol) as reason
select lower(address) as address, 'RUGGED_RAT' as category, array_agg(distinct symbol) as reason
from {{ ref('agg_solana_tokens_held') }}
where
(symbol = 'HAWKTUAH' and first_seen <= '2024-11-26')
Expand Down
7 changes: 4 additions & 3 deletions models/artemis_wrapped/dim_solana_trench_warrior.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{{config(materialized='table')}}


select lower(address) as address, 'SOLANA_TRENCH_WARRIOR' as category, array_agg(app) as reason
select lower(address) as address, 'SOLANA_TRENCH_WARRIOR' as category, sum(interactions) as reason
from {{ ref('agg_solana_app_interactions') }}
where interactions > 300 and app in ('pumpdotfun', 'raydium')
group by 1
where app in ('pumpdotfun', 'raydium')
group by 1
having reason > 300
16 changes: 5 additions & 11 deletions models/artemis_wrapped/metrics/agg_artemis_wrapped_metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,17 @@
select
address
, total_txns
, total_txns_percent_rank
, total_gas_paid
, total_gas_paid_percent_rank
, days_onchain
, days_onchain_percent_rank
, apps_used
, apps_used_percent_rank
from {{ ref('agg_base_artemis_wrapped_metrics_with_percent') }}
from {{ ref('agg_base_artemis_wrapped_metrics') }}

union all

select
address
address::string as address
, total_txns
, total_txns_percent_rank
, total_gas_paid
, total_gas_paid_percent_rank
, days_onchain
, days_onchain_percent_rank
, apps_used
, apps_used_percent_rank
from {{ ref('agg_solana_artemis_wrapped_metrics_with_percent') }}
from {{ ref('agg_solana_artemis_wrapped_metrics') }}

This file was deleted.

This file was deleted.

0 comments on commit 0302ea5

Please sign in to comment.