FlipsideCrypto / crosschain-models

MIT License
4 stars 6 forks source link

Profile Set Up

How to Set Up a DBT Profile for this Repo

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).

Use the following within profiles.yml


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>

Variables

To control the creation of UDF or SP macros with dbt run:

Use a variable to heal a model incrementally:

Use a variable to negate incremental logic:

Use a variable to extend the incremental lookback period:

How to Add Tags to Flipside's Data

There are 3 ways to add tags to our data!

1. Add a SQL statement to our GitHub

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.

2. Add a DBT seed file to our GitHub

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:

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.

3. I know what I want but I don't know how to tag

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:

DBT Learning Resources: