This info is for contributors who plan to use DBT to contribute to Flipside's data models. A DBT profile is not required to add tags via a seed file (to add tags, follow the instructions above).
crosschain:
target: dev
outputs:
dev:
type: snowflake
account: <ACCOUNT>
role: <ROLE>
user: <USERNAME>
password: <PASSWORD>
region: <REGION>
database: CROSSCHAIN_DEV
warehouse: <WAREHOUSE>
schema: silver
threads: 4
client_session_keep_alive: False
query_tag: <TAG>
To control the creation of UDF or SP macros with dbt run:
UPDATE_UDFS_AND_SPS
Default values are False
When True, executes all macros included in the on-run-start hooks within dbt_project.yml on model run as normal
When False, none of the on-run-start macros are executed on model run
Usage: dbt run --vars '{"UPDATE_UDFS_AND_SPS":True}' -m ...
Use a variable to heal a model incrementally:
HEAL_MODEL
Default is FALSE (Boolean)
When FALSE, logic will be negated
When TRUE, heal logic will apply
Include heal
in model tags within the config block for inclusion in the dbt_run_heal_models
workflow, e.g. tags = 'heal'
Usage: dbt run --vars '{"HEAL_MODEL":True}' -m ...
Use a variable to negate incremental logic:
silver_bridge.complete_bridge_activity
:HEAL_MODELS
Default is an empty array []
When item is included in var array [], incremental logic will be skipped for that CTE / code block
When item is not included in var array [] or does not match specified item in model, incremental logic will apply
Example set up: {% if is_incremental() and 'axelar' not in var('HEAL_MODELS') %}
Usage:
Single CTE: dbt run --vars '{"HEAL_MODELS":"axelar"}' -m ...
Multiple CTEs: dbt run --vars '{"HEAL_MODELS":["axelar","across","celer_cbridge"]}' -m ...
Use a variable to extend the incremental lookback period:
LOOKBACK
Default is a string representing the specified time interval e.g. '12 hours', '7 days' etc.
Example set up: SELECT MAX(_inserted_timestamp) - INTERVAL '{{ var("LOOKBACK", "4 hours") }}'
Usage: dbt run --vars '{"LOOKBACK":"36 hours"}' -m ...
There are 3 ways to add tags to our data!
You can use a Flipside query to create a tag set that will run on a reoccurring basis. This is a very powerful and scalable way to create a dynamic tag set that can update regularly.
To submit a Flipside query for tagging:
We will review your query and get back to you if there are any questions or changes.
Your tags query must return these 7 columns:
Column Name | Data type | Description |
---|---|---|
blockchain | string | The blockchain that the address belongs to. |
creator | string | Who created the tag. Use your Flipside username, shown in your Flipside profile URL, for tags you create. |
address | string | The address of the contract or wallet the tag describes. |
tag_name | string | Tag name (sub-category). |
tag_type | string | Tag type (high-level category). |
start_date | timestamp | Date the tag first applies. For tags that are permanent, this might be the date the address had its first behavior that warrants its tag, or the addresses' first transaction (e.g. if the tag identifies a celebrity NFT address). |
end_date | timestamp | Date the tag no longer applies (for tags that are permanent or currently active, end_date can be NULL). |
We recommend you review our docs on Tags before contributing your first tags query.
If you have a static list of addresses that need a tag, a DBT seed file is the best route. This is the most efficient method to tag a list of addresses that will not change and don't rely on a SQL query.
In order to submit a DBT seed file, we will be using a Pull Request (PR). Please see the docs on how to create a pull request! Once you are familiar with PR's, to add your tags:
silver__<name of seed file>.csv
. Please try to make the name unique, we don't want mulitple files with the same naming convention. data/
folder of the repo. We will review your seed file and get back to you if there are any questions or changes.
Your seed file must contain these 7 columns:
Column Name | Data type | Description |
---|---|---|
blockchain | string | The blockchain that the address belongs to. |
creator | string | Who created the tag. Use your Flipside username, shown in your Flipside profile URL, for tags you create. |
address | string | The address of the contract or wallet the tag describes. |
tag_name | string | Tag name (sub-category). |
tag_type | string | Tag type (high-level category). |
start_date | timestamp | Date the tag first applies. For tags that are permanent, this might be the date the address had its first behavior that warrants its tag, or the addresses' first transaction (e.g. if the tag identifies a celebrity NFT address). |
end_date | timestamp | Date the tag no longer applies (for tags that are permanent or currently active, end_date can be NULL). |
We recommend you review our docs on Tags before contributing your first tags seed file.
Flipside has a very active community and extraordinarily helpful employees. Reach out to the community, or to @gto, in Discord and someone will help you set up your tags.
When submitting, please include 3 itmes:
SQL query. Reminder, your SQL MUST include:
Column Name | Description |
---|---|
blockchain | The blockchain that the address belongs to. |
creator | Who created the tag. Use your Flipside username, shown in your Flipside profile URL, for tags you create. |
address | The address of the contract or wallet the tag describes. |
tag_name | Tag name (sub-category). |
tag_type | Tag type (high-level category). |
start_date | Date the tag first applies. For tags that are permanent, this might be the date the address had its first behavior that warrants its tag, or the addresses' first transaction (e.g. if the tag identifies a celebrity NFT address). |
end_date | Date the tag no longer applies (for tags that are permanent or currently active, end_date can be NULL). |