Skip to content

Commit

Permalink
Chains: Linea (#176)
Browse files Browse the repository at this point in the history
* adding ez linea metrics

* updating linea models
  • Loading branch information
SebMelendez01 authored Jun 14, 2024
1 parent a247bb9 commit e48500e
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 4 deletions.
53 changes: 53 additions & 0 deletions models/projects/linea/core/ez_linea_metrics.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{{
config(
materialized="table",
snowflake_warehouse="LINEA",
database="linea",
schema="core",
alias="ez_metrics",
)
}}

with
fundamental_data as (
select
date
, txns
, daa as dau
, gas_usd as fees
, gas as fees_native
, revenue
, revenue_native
, l1_data_cost
, l1_data_cost_native
from {{ ref("fact_linea_txns") }}
left join {{ ref("fact_linea_daa") }} using (date)
left join {{ ref("fact_linea_gas_gas_usd_revenue") }} using (date)
)
, github_data as ({{ get_github_metrics("linea") }})
, contract_data as ({{ get_contract_metrics("linea") }})
, defillama_data as ({{ get_defillama_metrics("linea") }})
select
fundamental_data.date
, 'linea' as chain
, txns
, dau
, fees
, fees_native
, revenue
, revenue_native
, l1_data_cost
, l1_data_cost_native
, tvl
, dex_volumes
, weekly_commits_core_ecosystem
, weekly_commits_sub_ecosystem
, weekly_developers_core_ecosystem
, weekly_developers_sub_ecosystem
, weekly_contracts_deployed
, weekly_contract_deployers
from fundamental_data
left join github_data using (date)
left join contract_data using (date)
left join defillama_data using (date)
where fundamental_data.date < to_date(sysdate())
2 changes: 1 addition & 1 deletion models/staging/linea/fact_linea_daa.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized="table") }}
{{ config(materialized="table", snowflake_warehouse="LINEA") }}
select
to_timestamp(block_timestamp)::date as date,
coalesce(count(distinct from_address), 0) as daa,
Expand Down
2 changes: 1 addition & 1 deletion models/staging/linea/fact_linea_gas_gas_usd_revenue.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized="table") }}
{{ config(materialized="table", snowflake_warehouse="LINEA") }}
with
prices as ({{ get_coingecko_price_with_latest("ethereum") }}),
linea_submission_and_finalization_transactions as (
Expand Down
2 changes: 1 addition & 1 deletion models/staging/linea/fact_linea_transactions.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized="table") }}
{{ config(materialized="table", snowflake_warehouse="LINEA") }}
with
raw_transactions_with_columns as (
select
Expand Down
2 changes: 1 addition & 1 deletion models/staging/linea/fact_linea_txns.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized="table") }}
{{ config(materialized="table", snowflake_warehouse="LINEA") }}
select
to_timestamp(block_timestamp)::date as date,
coalesce(count(*), 0) as txns,
Expand Down

0 comments on commit e48500e

Please sign in to comment.