-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/paraswap-repoint-to-v6.2
- Loading branch information
Showing
257 changed files
with
2,884 additions
and
1,230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: DBT Solana sector run | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths: | ||
- solana/** | ||
- .github/workflows/solana.yml | ||
- .github/workflows/dbt_run.yml | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
dbt-run: | ||
uses: ./.github/workflows/dbt_run.yml | ||
with: | ||
project: 'solana' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
daily_spellbook/models/addresses_events/blast/addresses_events_blast_first_activity.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{ config( | ||
schema = 'addresses_events_blast' | ||
, alias = 'first_activity' | ||
, materialized = 'incremental' | ||
, file_format = 'delta' | ||
, incremental_strategy = 'append' | ||
, unique_key = ['address'] | ||
) | ||
}} | ||
|
||
SELECT 'blast' AS blockchain | ||
, et."from" AS address | ||
, MIN_BY(et."to", et.block_number) AS first_activity_to | ||
, MIN(et.block_time) AS first_block_time | ||
, MIN(et.block_number) AS first_block_number | ||
, MIN_BY(et.hash, et.block_number) AS first_tx_hash | ||
, MIN_BY(COALESCE(sig.function, CAST((bytearray_substring(et.data, 1, 4)) as VARCHAR)), et.block_number) as first_function | ||
, MIN_BY(et.value/1e18, et.block_number) as first_{{native_symbol}}_transferred | ||
FROM | ||
{{ source('blast', 'transactions') }} et | ||
LEFT JOIN ( | ||
SELECT | ||
DISTINCT id, | ||
split_part(signature,'(',1) as function | ||
FROM | ||
{{ source('abi', 'signatures') }} | ||
where type = 'function_call' | ||
AND id NOT IN (0x09779838, 0x00000000) -- for some weird reason these have duplicates functions | ||
) sig | ||
ON sig.id = bytearray_substring(et.data, 1, 4) | ||
{% if is_incremental() %} | ||
LEFT JOIN {{this}} ffb ON et."from" = ffb.address | ||
WHERE ffb.address IS NULL | ||
AND et.block_time >= date_trunc('day', now() - interval '7' day) | ||
{% endif %} | ||
|
||
GROUP BY et."from" |
14 changes: 14 additions & 0 deletions
14
daily_spellbook/models/addresses_events/blast/addresses_events_blast_first_funded_by.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{ config( | ||
schema = 'addresses_events_blast' | ||
, alias = 'first_funded_by' | ||
, materialized = 'incremental' | ||
, file_format = 'delta' | ||
, incremental_strategy = 'append' | ||
, unique_key = ['address'] | ||
) | ||
}} | ||
|
||
|
||
{{addresses_events_first_funded_by( | ||
blockchain='blast' | ||
)}} |
79 changes: 79 additions & 0 deletions
79
daily_spellbook/models/addresses_events/blast/addresses_events_blast_schema.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: addresses_events_blast_first_funded_by | ||
meta: | ||
blockchain: blast | ||
sector: addresses_events | ||
project: addresses | ||
contributors: hildobby, lgingerich | ||
config: | ||
tags: ['table', 'funded', 'addresses_events', 'blast'] | ||
description: "Table showing who first funded each blast address in ETH" | ||
tests: | ||
- check_seed: | ||
seed_file: ref('first_funded_by_seed') | ||
filter: | ||
blockchain: blast | ||
match_columns: | ||
- blockchain | ||
- address | ||
check_columns: | ||
- first_funded_by | ||
- block_number | ||
- tx_hash | ||
columns: | ||
- name: blockchain | ||
description: "Blockchain" | ||
- name: address | ||
description: "Concerned blast address" | ||
tests: | ||
- unique | ||
- name: first_funded_by | ||
description: "Which blast address first funded the address with ETH" | ||
- name: block_time | ||
description: "The block time on which the address was first funded with ETH" | ||
- name: block_number | ||
description: "The block number on which the address was first funded with ETH" | ||
- name: tx_hash | ||
description: "The transaction hash on which the address was first funded with ETH" | ||
|
||
- name: addresses_events_blast_first_activity | ||
meta: | ||
blockchain: blast | ||
sector: addresses_events | ||
project: addresses | ||
contributors: hildobby | ||
config: | ||
tags: ['table', 'activity', 'addresses_events', 'blast'] | ||
description: "Table showing first activity of each blast Mainnet address" | ||
tests: | ||
- check_seed: | ||
seed_file: ref('first_activity_seed') | ||
filter: | ||
blockchain: blast | ||
match_columns: | ||
- address | ||
check_columns: | ||
- first_activity_to | ||
- first_block_number | ||
- first_tx_hash | ||
columns: | ||
- name: blockchain | ||
description: "Blockchain" | ||
- name: address | ||
description: "Concerned blast Mainnet address" | ||
tests: | ||
- unique | ||
- name: first_activity_to | ||
description: "First transaction activity to address" | ||
- name: first_block_time | ||
description: "The block time on which the address made it's first activity" | ||
- name: first_block_number | ||
description: "The block number on which the address made it's first activity" | ||
- name: first_tx_hash | ||
description: "The transaction hash on which the address made it's first activity" | ||
- name: first_function | ||
description: "first function called by address" | ||
- name: first_eth_transferred | ||
description: "ETH transferred in transaction" |
37 changes: 37 additions & 0 deletions
37
daily_spellbook/models/addresses_events/mantle/addresses_events_mantle_first_activity.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{ config( | ||
schema = 'addresses_events_mantle' | ||
, alias = 'first_activity' | ||
, materialized = 'incremental' | ||
, file_format = 'delta' | ||
, incremental_strategy = 'append' | ||
, unique_key = ['address'] | ||
) | ||
}} | ||
|
||
SELECT 'mantle' AS blockchain | ||
, et."from" AS address | ||
, MIN_BY(et."to", et.block_number) AS first_activity_to | ||
, MIN(et.block_time) AS first_block_time | ||
, MIN(et.block_number) AS first_block_number | ||
, MIN_BY(et.hash, et.block_number) AS first_tx_hash | ||
, MIN_BY(COALESCE(sig.function, CAST((bytearray_substring(et.data, 1, 4)) as VARCHAR)), et.block_number) as first_function | ||
, MIN_BY(et.value/1e18, et.block_number) as first_{{native_symbol}}_transferred | ||
FROM | ||
{{ source('mantle', 'transactions') }} et | ||
LEFT JOIN ( | ||
SELECT | ||
DISTINCT id, | ||
split_part(signature,'(',1) as function | ||
FROM | ||
{{ source('abi', 'signatures') }} | ||
where type = 'function_call' | ||
AND id NOT IN (0x09779838, 0x00000000) -- for some weird reason these have duplicates functions | ||
) sig | ||
ON sig.id = bytearray_substring(et.data, 1, 4) | ||
{% if is_incremental() %} | ||
LEFT JOIN {{this}} ffb ON et."from" = ffb.address | ||
WHERE ffb.address IS NULL | ||
AND et.block_time >= date_trunc('day', now() - interval '7' day) | ||
{% endif %} | ||
|
||
GROUP BY et."from" |
14 changes: 14 additions & 0 deletions
14
daily_spellbook/models/addresses_events/mantle/addresses_events_mantle_first_funded_by.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{ config( | ||
schema = 'addresses_events_mantle' | ||
, alias = 'first_funded_by' | ||
, materialized = 'incremental' | ||
, file_format = 'delta' | ||
, incremental_strategy = 'append' | ||
, unique_key = ['address'] | ||
) | ||
}} | ||
|
||
|
||
{{addresses_events_first_funded_by( | ||
blockchain='mantle' | ||
)}} |
79 changes: 79 additions & 0 deletions
79
daily_spellbook/models/addresses_events/mantle/addresses_events_mantle_schema.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: addresses_events_mantle_first_funded_by | ||
meta: | ||
blockchain: mantle | ||
sector: addresses_events | ||
project: addresses | ||
contributors: hildobby | ||
config: | ||
tags: ['table', 'funded', 'addresses_events', 'mantle'] | ||
description: "Table showing who first funded each Linea address in ETH" | ||
tests: | ||
- check_seed: | ||
seed_file: ref('first_funded_by_seed') | ||
filter: | ||
blockchain: mantle | ||
match_columns: | ||
- blockchain | ||
- address | ||
check_columns: | ||
- first_funded_by | ||
- block_number | ||
- tx_hash | ||
columns: | ||
- name: blockchain | ||
description: "Blockchain" | ||
- name: address | ||
description: "Concerned mantle address" | ||
tests: | ||
- unique | ||
- name: first_funded_by | ||
description: "Which mantle address first funded the address with ETH" | ||
- name: block_time | ||
description: "The block time on which the address was first funded with ETH" | ||
- name: block_number | ||
description: "The block number on which the address was first funded with ETH" | ||
- name: tx_hash | ||
description: "The transaction hash on which the address was first funded with ETH" | ||
|
||
- name: addresses_events_mantle_first_activity | ||
meta: | ||
blockchain: mantle | ||
sector: addresses_events | ||
project: addresses | ||
contributors: hildobby | ||
config: | ||
tags: ['table', 'activity', 'addresses_events', 'mantle'] | ||
description: "Table showing first activity of each mantle Mainnet address" | ||
tests: | ||
- check_seed: | ||
seed_file: ref('first_activity_seed') | ||
filter: | ||
blockchain: mantle | ||
match_columns: | ||
- address | ||
check_columns: | ||
- first_activity_to | ||
- first_block_number | ||
- first_tx_hash | ||
columns: | ||
- name: blockchain | ||
description: "Blockchain" | ||
- name: address | ||
description: "Concerned mantle Mainnet address" | ||
tests: | ||
- unique | ||
- name: first_activity_to | ||
description: "First transaction activity to address" | ||
- name: first_block_time | ||
description: "The block time on which the address made it's first activity" | ||
- name: first_block_number | ||
description: "The block number on which the address made it's first activity" | ||
- name: first_tx_hash | ||
description: "The transaction hash on which the address made it's first activity" | ||
- name: first_function | ||
description: "first function called by address" | ||
- name: first_eth_transferred | ||
description: "ETH transferred in transaction" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.