diff --git a/.github/workflows/dbt_alter_all_gha_tasks.yml b/.github/workflows/dbt_alter_all_gha_tasks.yml new file mode 100644 index 00000000..086327dd --- /dev/null +++ b/.github/workflows/dbt_alter_all_gha_tasks.yml @@ -0,0 +1,27 @@ +name: dbt_alter_all_gha_tasks +run-name: dbt_alter_all_gha_tasks + +on: + workflow_dispatch: + branches: + - "main" + inputs: + task_action: + type: choice + description: Action to perform on all tasks + required: true + options: + - RESUME + - SUSPEND + default: RESUME + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_alter_all_gha_tasks.yml@pre-release/v4-beta + with: + task_action: ${{ inputs.task_action }} + target: prod + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_alter_gha_task.yml b/.github/workflows/dbt_alter_gha_task.yml deleted file mode 100644 index 0d4008ec..00000000 --- a/.github/workflows/dbt_alter_gha_task.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: dbt_alter_gha_task -run-name: dbt_alter_gha_task - -on: - workflow_dispatch: - branches: - - "main" - inputs: - workflow_name: - type: string - description: Name of the workflow to perform the action on, no .yml extension - required: true - task_action: - type: choice - description: Action to perform - required: true - options: - - SUSPEND - - RESUME - default: SUSPEND - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - called_workflow_template: - uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_alter_gha_tasks.yml@AN-4374/upgrade-dbt-1.7 - with: - workflow_name: | - ${{ inputs.workflow_name }} - task_action: | - ${{ inputs.task_action }} - environment: workflow_prod - secrets: inherit - - notify-failure: - needs: [called_workflow_template] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_alter_gha_tasks.yml b/.github/workflows/dbt_alter_gha_tasks.yml new file mode 100644 index 00000000..be92ee58 --- /dev/null +++ b/.github/workflows/dbt_alter_gha_tasks.yml @@ -0,0 +1,32 @@ +name: dbt_alter_gha_tasks +run-name: dbt_alter_gha_tasks + +on: + workflow_dispatch: + branches: + - "main" + inputs: + workflow_name: + type: string + description: Name of the workflow to perform the action on, no .yml extension + required: true + task_action: + type: choice + description: Action to perform + required: true + options: + - SUSPEND + - RESUME + default: SUSPEND + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_alter_gha_tasks.yml@pre-release/v4-beta + with: + workflow_name: ${{ inputs.workflow_name }} + task_action: ${{ inputs.task_action }} + target: prod + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_deploy_new_workflows.yml b/.github/workflows/dbt_deploy_new_workflows.yml new file mode 100644 index 00000000..a9a877d3 --- /dev/null +++ b/.github/workflows/dbt_deploy_new_workflows.yml @@ -0,0 +1,19 @@ +name: dbt_deploy_new_workflows +run-name: dbt_deploy_new_workflows + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Deploy New Github Actions + command: | + make deploy_new_gha_tasks DBT_TARGET=prod + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_docs_update.yml b/.github/workflows/dbt_docs_update.yml index b4b38c97..10ec0ba2 100644 --- a/.github/workflows/dbt_docs_update.yml +++ b/.github/workflows/dbt_docs_update.yml @@ -5,75 +5,10 @@ on: branches: - "main" -env: - USE_VARS: "${{ vars.USE_VARS }}" - DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}" - DBT_VERSION: "${{ vars.DBT_VERSION }}" - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: refresh ddl for datashare - run: | - cnt=$(dbt ls -m fsc_utils.datashare._datashare___create_gold | wc -l ); if [ $cnt -eq 1 ]; then dbt run -m fsc_utils.datashare._datashare___create_gold; fi; - - name: checkout docs branch - run: | - git checkout -B docs origin/main - - name: generate dbt docs - run: dbt docs generate -t prod - - - name: move files to docs directory - run: | - mkdir -p ./docs - cp target/{catalog.json,manifest.json,index.html} docs/ - - name: clean up target directory - run: dbt clean - - - name: check for changes - run: git status - - - name: stage changed files - run: git add . - - - name: commit changed files - run: | - git config user.email "abc@xyz" - git config user.name "github-actions" - git commit -am "Auto-update docs" - - name: push changes to docs - run: | - git push -f --set-upstream origin docs - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_docs_update.yml@pre-release/v4-beta + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_integration_test.yml b/.github/workflows/dbt_integration_test.yml index 6fdabb3b..d0d53855 100644 --- a/.github/workflows/dbt_integration_test.yml +++ b/.github/workflows/dbt_integration_test.yml @@ -3,39 +3,20 @@ run-name: ${{ github.event.inputs.branch }} on: workflow_dispatch: + branches: + - "main" inputs: environment: - required: true type: string + required: true concurrency: ${{ github.workflow }} jobs: - prepare_vars: - runs-on: ubuntu-latest - environment: - name: ${{ inputs.environment }} - outputs: - warehouse: ${{ steps.set_outputs.outputs.warehouse }} - steps: - - name: Set warehouse output - id: set_outputs - run: | - echo "warehouse=${{ vars.WAREHOUSE }}" >> $GITHUB_OUTPUT - called_workflow_template: - needs: prepare_vars - uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt.yml@main + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_integration_test.yml@pre-release/v4-beta with: - command: > + target: ${{ inputs.environment }} + command: | dbt test --selector 'integration_tests' - environment: ${{ inputs.environment }} - warehouse: ${{ needs.prepare_vars.outputs.warehouse }} - secrets: inherit - - notify-failure: - needs: [called_workflow_template] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_abi_refresh.yml b/.github/workflows/dbt_run_abi_refresh.yml deleted file mode 100644 index 35e78625..00000000 --- a/.github/workflows/dbt_run_abi_refresh.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: dbt_run_abi_refresh -run-name: dbt_run_abi_refresh - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: Update ABI models - run: | - dbt run -m "ethereum_models,tag:abis" - - - name: Kick off decoded history, if there are new ABIs from users - run: | - dbt run-operation run_decoded_history - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_adhoc.yml b/.github/workflows/dbt_run_adhoc.yml index 7ff2437c..30a34811 100644 --- a/.github/workflows/dbt_run_adhoc.yml +++ b/.github/workflows/dbt_run_adhoc.yml @@ -1,13 +1,13 @@ name: dbt_run_adhoc -run-name: dbt_run_adhoc +run-name: ${{ inputs.dbt_command }} on: workflow_dispatch: branches: - "main" inputs: - environment: - type: choice + target: + type: choice description: DBT Run Environment required: true options: @@ -15,61 +15,29 @@ on: - prod default: dev warehouse: - type: choice + type: choice description: Snowflake warehouse - required: true + required: true options: - DBT - DBT_CLOUD - DBT_EMERGENCY - DBT_MEGA - - BACKFILL default: DBT dbt_command: type: string - description: "DBT Run Command" + description: 'DBT Run Command' required: true - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ inputs.warehouse }}" - SCHEMA: "${{ vars.SCHEMA }}" - + concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_${{ inputs.environment }} - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - ${{ inputs.dbt_command }} - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + warehouse: ${{ inputs.warehouse }} + target: ${{ inputs.target }} + command_name: Run DBT Command + command: ${{ inputs.dbt_command }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_dev_refresh.yml b/.github/workflows/dbt_run_dev_refresh.yml index 77f5ec0c..938995c3 100644 --- a/.github/workflows/dbt_run_dev_refresh.yml +++ b/.github/workflows/dbt_run_dev_refresh.yml @@ -3,81 +3,13 @@ run-name: dbt_run_dev_refresh on: workflow_dispatch: - schedule: - # Runs "Monday at 4:00 UTC" (see https://crontab.guru) - - cron: "0 4 * * 1" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" + branches: + - "main" concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs_refresh: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run-operation run_sp_create_prod_clone - - notify-failure: - needs: [run_dbt_jobs_refresh] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - run_dbt_jobs_udfs: - runs-on: ubuntu-latest - needs: run_dbt_jobs_refresh - environment: - name: workflow_dev - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: Run Recreate UDFs - run: | - dbt run-operation fsc_utils.create_evm_streamline_udfs --vars '{"UPDATE_UDFS_AND_SPS":True}' -t dev - dbt run -s livequery_models.deploy.core._live --vars '{"UPDATE_UDFS_AND_SPS":True}' -t dev - - notify-failure2: - needs: [run_dbt_jobs_udfs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_dev_refresh.yml@pre-release/v4-beta + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_full_observability.yml b/.github/workflows/dbt_run_full_observability.yml index 665ce5ae..ebfc1547 100644 --- a/.github/workflows/dbt_run_full_observability.yml +++ b/.github/workflows/dbt_run_full_observability.yml @@ -3,50 +3,21 @@ run-name: dbt_run_full_observability on: workflow_dispatch: - schedule: - # Runs “At 00:00 on day-of-month 1.” (see https://crontab.guru) - - cron: "0 0 1 * *" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - + branches: + - "main" + concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod_2xl + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + warehouse: DBT_EMERGENCY + command_name: Run Observability Models + command: | + dbt run --threads 2 --vars '{"MAIN_OBSERV_FULL_TEST_ENABLED":True}' -m "fsc_evm,tag:observability" + secrets: inherit + - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run --threads 2 --vars '{"OBSERV_FULL_TEST":True}' -m "ethereum_models,tag:observability" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_heal_models.yml b/.github/workflows/dbt_run_heal_models.yml index 80ba61fc..6eaf50fe 100644 --- a/.github/workflows/dbt_run_heal_models.yml +++ b/.github/workflows/dbt_run_heal_models.yml @@ -3,50 +3,17 @@ run-name: dbt_run_heal_models on: workflow_dispatch: - schedule: - # Runs at 04:55 on Wednesday (see https://crontab.guru) - - cron: "55 4 * * 3" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - + branches: + - "main" + concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "ethereum_models,tag:heal" --vars '{"HEAL_MODEL":True}' - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Heal Models + command: | + dbt run -m "$PROJECT_NAME,tag:heal" --vars '{"HEAL_MODEL":True}' + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_nft_list.yml b/.github/workflows/dbt_run_nft_list.yml index 894f4a49..8675ba22 100644 --- a/.github/workflows/dbt_run_nft_list.yml +++ b/.github/workflows/dbt_run_nft_list.yml @@ -3,50 +3,17 @@ run-name: dbt_run_nft_list on: workflow_dispatch: - schedule: - # At minute 0 past hour 0 and 12. (see https://crontab.guru) - - cron: "0 0,12 * * *" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" + branches: + - "main" concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "ethereum_models,tag:nft_list" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Curated Models + command: | + dbt run -m "ethereum_models,tag:nft_list" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_nft_reads.yml b/.github/workflows/dbt_run_nft_reads.yml index 76100e79..3dbd45c7 100644 --- a/.github/workflows/dbt_run_nft_reads.yml +++ b/.github/workflows/dbt_run_nft_reads.yml @@ -3,50 +3,17 @@ run-name: dbt_run_nft_reads on: workflow_dispatch: - schedule: - # At minute 0. (see https://crontab.guru) - - cron: "0 * * * *" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" + branches: + - "main" concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "ethereum_models,tag:nft_reads" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Curated Models + command: | + dbt run -m "ethereum_models,tag:nft_reads" + secrets: inherit diff --git a/.github/workflows/dbt_run_operation_reorg.yml b/.github/workflows/dbt_run_operation_reorg.yml deleted file mode 100644 index 010aabba..00000000 --- a/.github/workflows/dbt_run_operation_reorg.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: dbt_run_operation_reorg -run-name: dbt_run_operation_reorg - -on: - workflow_dispatch: - schedule: - # Runs at minute 55 every Sunday (see https://crontab.guru) - - cron: "55 0 * * 0" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: List reorg models - id: list_models - run: | - reorg_model_list=$(dbt list --select "ethereum_models,tag:reorg" --resource-type model --output name | grep '__' | awk -F'.' '{print $NF}' | tr '\n' ',' | sed 's/,$//') - echo "model_list=$reorg_model_list" >> $GITHUB_OUTPUT - - - name: Execute block_reorg macro - run: | - dbt run-operation fsc_utils.block_reorg --args "{reorg_model_list: '${{ steps.list_models.outputs.model_list }}', hours: '169'}" && awk '/SQL status/ {print; next} /DELETE FROM/{getline; print} /\/\* {/ {print}' logs/dbt.log - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_scheduled_abis.yml b/.github/workflows/dbt_run_scheduled_abis.yml new file mode 100644 index 00000000..30bdc012 --- /dev/null +++ b/.github/workflows/dbt_run_scheduled_abis.yml @@ -0,0 +1,23 @@ +name: dbt_run_scheduled_abis +run-name: dbt_run_scheduled_abis + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run ABI Models + command: | + dbt run -m "fsc_evm,tag:silver,tag:abis" "fsc_evm,tag:gold,tag:abis" + command_name_2: Kick off decoded logs history, if there are new user submitted ABIs + command_2: | + dbt run-operation fsc_evm.run_decoded_logs_history + dbt run-operation run_decoded_traces_history + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled_beacon.yml b/.github/workflows/dbt_run_scheduled_beacon.yml index 903f4f1c..a0c75957 100644 --- a/.github/workflows/dbt_run_scheduled_beacon.yml +++ b/.github/workflows/dbt_run_scheduled_beacon.yml @@ -6,46 +6,14 @@ on: branches: - "main" -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "ethereum_models,tag:beacon" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Beacon Models + command: | + dbt run -m "ethereum_models,tag:beacon" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled_curated.yml b/.github/workflows/dbt_run_scheduled_curated.yml index 6ea72ff8..61d9d16b 100644 --- a/.github/workflows/dbt_run_scheduled_curated.yml +++ b/.github/workflows/dbt_run_scheduled_curated.yml @@ -6,46 +6,14 @@ on: branches: - "main" -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "ethereum_models,tag:curated" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Curated Models + command: | + dbt run -m "$PROJECT_NAME,tag:curated" "fsc_evm,tag:curated" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled_decoder.yml b/.github/workflows/dbt_run_scheduled_decoder.yml new file mode 100644 index 00000000..401d1bac --- /dev/null +++ b/.github/workflows/dbt_run_scheduled_decoder.yml @@ -0,0 +1,19 @@ +name: dbt_run_scheduled_decoder +run-name: dbt_run_scheduled_decoder + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Decoder Models + command: | + dbt run -m "fsc_evm,tag:bronze,tag:decoded_logs" "fsc_evm,tag:silver,tag:decoded_logs" "fsc_evm,tag:gold,tag:decoded_logs" "ethereum_models,tag:bronze,tag:decoded_traces" "ethereum_models,tag:silver,tag:decoded_traces" "ethereum_models,tag:gold,tag:decoded_traces" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled_main.yml b/.github/workflows/dbt_run_scheduled_main.yml new file mode 100644 index 00000000..7db7c999 --- /dev/null +++ b/.github/workflows/dbt_run_scheduled_main.yml @@ -0,0 +1,19 @@ +name: dbt_run_scheduled_main +run-name: dbt_run_scheduled_main + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Main Models + command: | + dbt run -m "fsc_evm,tag:bronze,tag:core" "fsc_evm,tag:silver,tag:core" "fsc_evm,tag:gold,tag:core" "fsc_evm,tag:silver,tag:prices" "fsc_evm,tag:gold,tag:prices" "fsc_evm,tag:silver,tag:labels" "fsc_evm,tag:gold,tag:labels" "fsc_evm,tag:streamline,tag:decoded_logs,tag:realtime" "ethereum_models,tag:silver,tag:balances" "ethereum_models,tag:gold,tag:balances" "ethereum_models,tag:silver,tag:reads" "ethereum_models,tag:gold,tag:reads" "fsc_evm,tag:streamline,tag:decoded_logs,tag:complete" "fsc_evm,tag:streamline,tag:abis,tag:realtime" "fsc_evm,tag:streamline,tag:abis,tag:complete" "ethereum_models,tag:streamline_balances_realtime" "ethereum_models,tag:streamline_balances_complete" "ethereum_models,tag:streamline_decoded_traces_complete" "ethereum_models,tag:streamline_decoded_traces_realtime" --vars '{"STREAMLINE_INVOKE_STREAMS":True}' + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled_non_realtime.yml b/.github/workflows/dbt_run_scheduled_non_realtime.yml deleted file mode 100644 index 2f20fcc6..00000000 --- a/.github/workflows/dbt_run_scheduled_non_realtime.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: dbt_run_scheduled_non_realtime -run-name: dbt_run_scheduled_non_realtime - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "ethereum_models,tag:non_realtime" "ethereum_models,tag:realtime" "ethereum_models,tag:streamline_decoded_logs_realtime" "ethereum_models,tag:streamline_decoded_logs_complete" "ethereum_models,tag:streamline_balances_realtime" "ethereum_models,tag:streamline_balances_complete" "ethereum_models,tag:streamline_decoded_traces_complete" "ethereum_models,tag:streamline_decoded_traces_realtime" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_scheduled_scores.yml b/.github/workflows/dbt_run_scheduled_scores.yml new file mode 100644 index 00000000..5c2f0f9e --- /dev/null +++ b/.github/workflows/dbt_run_scheduled_scores.yml @@ -0,0 +1,20 @@ + +name: dbt_run_scheduled_scores +run-name: dbt_run_scheduled_scores + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Scores Models + command: | + dbt run -m "fsc_evm,tag:scores" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_abis.yml b/.github/workflows/dbt_run_streamline_abis.yml deleted file mode 100644 index 2b022886..00000000 --- a/.github/workflows/dbt_run_streamline_abis.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: dbt_run_streamline_abis -run-name: dbt_run_streamline_abis - -on: - workflow_dispatch: - schedule: - # Runs “At minute 20 past every 2nd hour from 1 through 23.” (see https://crontab.guru) - - cron: "20 1-23/2 * * *" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "ethereum_models,tag:streamline_abis_realtime" "ethereum_models,tag:streamline_abis_complete" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_streamline_beacon.yml b/.github/workflows/dbt_run_streamline_beacon.yml index 86b13d1b..3827bec6 100644 --- a/.github/workflows/dbt_run_streamline_beacon.yml +++ b/.github/workflows/dbt_run_streamline_beacon.yml @@ -6,46 +6,11 @@ on: branches: - "main" -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "ethereum_models,tag:streamline_beacon_realtime" "ethereum_models,tag:streamline_beacon_complete" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Beacon Models + command: | + dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "ethereum_models,tag:streamline_beacon_realtime" "ethereum_models,tag:streamline_beacon_complete" + secrets: inherit diff --git a/.github/workflows/dbt_run_streamline_chainhead.yml b/.github/workflows/dbt_run_streamline_chainhead.yml index d2e8f047..efa0176c 100644 --- a/.github/workflows/dbt_run_streamline_chainhead.yml +++ b/.github/workflows/dbt_run_streamline_chainhead.yml @@ -6,50 +6,15 @@ on: branches: - "main" -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "ethereum_models,tag:streamline_core_complete" "ethereum_models,tag:streamline_core_realtime" "ethereum_models,tag:streamline_core_complete_receipts" "ethereum_models,tag:streamline_core_realtime_receipts" "ethereum_models,tag:streamline_core_complete_confirm_blocks" "ethereum_models,tag:streamline_core_realtime_confirm_blocks" - - - name: Run Chainhead Tests - run: | - dbt test -m "ethereum_models,tag:chainhead" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Chainhead Models + command: | + dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "fsc_evm,tag:chainhead" "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts_by_hash" + dbt test -m "fsc_evm,tag:chainhead" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_decoded_logs_history.yml b/.github/workflows/dbt_run_streamline_decoded_logs_history.yml deleted file mode 100644 index 44137bf2..00000000 --- a/.github/workflows/dbt_run_streamline_decoded_logs_history.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: dbt_run_streamline_decoded_logs_history -run-name: dbt_run_streamline_decoded_logs_history - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: Update complete table - run: | - dbt run -m "ethereum_models,tag:streamline_decoded_logs_complete" - - - name: Decode historical logs - run: | - dbt run-operation decoded_logs_history --vars '{"STREAMLINE_INVOKE_STREAMS":True}' - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_streamline_decoded_traces_history.yml b/.github/workflows/dbt_run_streamline_decoded_traces_history.yml deleted file mode 100644 index 8facb7bb..00000000 --- a/.github/workflows/dbt_run_streamline_decoded_traces_history.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: dbt_run_streamline_decoded_traces_history -run-name: dbt_run_streamline_decoded_traces_history - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Update complete table - run: | - dbt run -m "fsc_evm,tag:streamline_decoded_traces_complete" - - name: Decode historical traces - run: | - dbt run-operation decoded_traces_history --args '{"backfill_mode": false}' --vars '{"STREAMLINE_INVOKE_STREAMS":True}' - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_streamline_decoder.yml b/.github/workflows/dbt_run_streamline_decoder.yml deleted file mode 100644 index 70f04ed0..00000000 --- a/.github/workflows/dbt_run_streamline_decoder.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: dbt_run_streamline_decoder -run-name: dbt_run_streamline_decoder - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "ethereum_models,tag:decoded_logs" "ethereum_models,tag:decoded_traces" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_streamline_decoder_history.yml b/.github/workflows/dbt_run_streamline_decoder_history.yml new file mode 100644 index 00000000..72f82665 --- /dev/null +++ b/.github/workflows/dbt_run_streamline_decoder_history.yml @@ -0,0 +1,23 @@ +name: dbt_run_streamline_decoder_history +run-name: dbt_run_streamline_decoder_history + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Decoder Complete + command: | + dbt run -m "fsc_evm,tag:streamline,tag:decoded_logs,tag:complete" "ethereum_models,tag:streamline,tag:decoded_traces" + command_name_2: Run Streamline Decoder History + command_2: | + dbt run-operation fsc_evm.decoded_logs_history --vars '{"STREAMLINE_INVOKE_STREAMS":True}' + dbt run-operation decoded_traces_history --vars '{"STREAMLINE_INVOKE_STREAMS":True}' + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_history.yml b/.github/workflows/dbt_run_streamline_history.yml new file mode 100644 index 00000000..08dfbc65 --- /dev/null +++ b/.github/workflows/dbt_run_streamline_history.yml @@ -0,0 +1,19 @@ +name: dbt_run_streamline_history +run-name: dbt_run_streamline_history + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run History Models + command: | + dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:history" --exclude "fsc_evm,tag:receipts_by_hash" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_history_adhoc.yml b/.github/workflows/dbt_run_streamline_history_adhoc.yml deleted file mode 100644 index 6058f7cb..00000000 --- a/.github/workflows/dbt_run_streamline_history_adhoc.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: dbt_run_streamline_history_adhoc -run-name: dbt_run_streamline_history_adhoc - -on: - workflow_dispatch: - branches: - - "main" - inputs: - environment: - type: choice - description: DBT Run Environment - required: true - options: - - dev - - prod - - prod_backfill - default: dev - warehouse: - type: choice - description: Snowflake warehouse - required: true - options: - - DBT - - DBT_CLOUD - - DBT_EMERGENCY - default: DBT - dbt_command: - type: choice - description: DBT Run Command - required: true - options: - - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "ethereum_models,tag:streamline_core_complete" "ethereum_models,tag:streamline_core_history" "ethereum_models,tag:streamline_core_complete_receipts" "ethereum_models,tag:streamline_core_history_receipts" "ethereum_models,tag:streamline_core_complete_confirm_blocks" "ethereum_models,tag:streamline_core_history_confirm_blocks" - - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "ethereum_models,tag:streamline_beacon_history" "ethereum_models,tag:streamline_beacon_complete" - - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "ethereum_models,tag:streamline_balances_history" "ethereum_models,tag:streamline_balances_complete" - - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "ethereum_models,tag:streamline_abis_history" "ethereum_models,tag:streamline_abis_complete" - - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "ethereum_models,tag:streamline_reads_history" "ethereum_models,tag:streamline_reads_complete tag:streamline_reads_curated" -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ inputs.warehouse }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_${{ inputs.environment }} - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10.x" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - ${{ inputs.dbt_command }} - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_streamline_reads.yml b/.github/workflows/dbt_run_streamline_reads.yml index 3aecff7c..09737627 100644 --- a/.github/workflows/dbt_run_streamline_reads.yml +++ b/.github/workflows/dbt_run_streamline_reads.yml @@ -3,50 +3,14 @@ run-name: dbt_run_streamline_reads on: workflow_dispatch: - schedule: - # Runs “At minute 40 past every 2nd hour from 1 through 23.” (see https://crontab.guru) - - cron: "40 1-23/2 * * *" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} + branches: + - "main" jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "ethereum_models,tag:streamline_reads_curated" "ethereum_models,tag:streamline_reads_realtime" "ethereum_models,tag:streamline_reads_complete" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run History Models + command: | + dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "ethereum_models,tag:streamline_reads_curated" "ethereum_models,tag:streamline_reads_realtime" "ethereum_models,tag:streamline_reads_complete" + secrets: inherit diff --git a/.github/workflows/dbt_temp_balances_catchup.yml b/.github/workflows/dbt_temp_balances_catchup.yml deleted file mode 100644 index f2d3ae46..00000000 --- a/.github/workflows/dbt_temp_balances_catchup.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: dbt_temp_balances_catchup -run-name: dbt_temp_balances_catchup - -on: - workflow_dispatch: - schedule: - # Runs at minute 21 every hour - - cron: "21 * * * *" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_test - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m models/streamline/silver/balances/history/streamline__token_balances_history.sql models/streamline/silver/balances/complete/streamline__complete_token_balances.sql - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_test_beacon.yml b/.github/workflows/dbt_test_beacon.yml index 46f17508..cac4ca68 100644 --- a/.github/workflows/dbt_test_beacon.yml +++ b/.github/workflows/dbt_test_beacon.yml @@ -3,50 +3,17 @@ run-name: dbt_test_beacon on: workflow_dispatch: - schedule: - # Runs "at 9:05 UTC" (see https://crontab.guru) - - cron: "5 9 * * *" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" + branches: + - "main" concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_test - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt test -m "ethereum_models,tag:beacon" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + target: test + command_name: Run Beacon Tests + command: dbt test -m "ethereum_models,tag:beacon" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_test_daily.yml b/.github/workflows/dbt_test_daily.yml index 8f20336c..eaa96352 100644 --- a/.github/workflows/dbt_test_daily.yml +++ b/.github/workflows/dbt_test_daily.yml @@ -1,52 +1,23 @@ -name: dbt_test_daily +name: dbt_test_daily run-name: dbt_test_daily on: workflow_dispatch: - schedule: - # Runs "at 9:00 UTC" (see https://crontab.guru) - - cron: "0 9 * * *" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - + branches: + - "main" + concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_test - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt test --exclude "ethereum_models,tag:full_test" "ethereum_models,tag:recent_test" "ethereum_models,tag:beacon" "ethereum_models,tag:gha_tasks" livequery_models - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + target: test + command_name: Build Daily Testing Views + command: | + dbt run -m "fsc_evm,tag:daily_test" + command_name_2: Run Daily Tests (all tests excluding full, recent and misc. others) + command_2: | + dbt test --exclude "fsc_evm,tag:full_test" "fsc_evm,tag:recent_test" "fsc_evm,tag:gha_tasks" livequery_models + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_test_intraday.yml b/.github/workflows/dbt_test_intraday.yml index c0fdcf88..4823fcd9 100644 --- a/.github/workflows/dbt_test_intraday.yml +++ b/.github/workflows/dbt_test_intraday.yml @@ -5,48 +5,17 @@ on: workflow_dispatch: branches: - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - + concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_test - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "ethereum_models,tag:observability" - dbt test -m "ethereum_models,tag:recent_test" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + target: test + command_name: Run Observability & Recent Tests + command: | + dbt run -m "fsc_evm,tag:observability" + dbt test -m "fsc_evm,tag:recent_test" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_test_monthly.yml b/.github/workflows/dbt_test_monthly.yml index e33ab7a0..cf47c459 100644 --- a/.github/workflows/dbt_test_monthly.yml +++ b/.github/workflows/dbt_test_monthly.yml @@ -3,49 +3,21 @@ run-name: dbt_test_monthly on: workflow_dispatch: - schedule: - # Runs “28th of month at 12AM” (see https://crontab.guru) - - cron: "0 0 28 * *" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - + branches: + - "main" + concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_test - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v1 - with: - python-version: "3.7.x" - - - name: install dependencies - run: | - pip3 install dbt-snowflake==${{ vars.DBT_VERSION }} cli_passthrough requests click - dbt deps - - name: Run DBT Jobs - run: | - dbt test --select "ethereum_models,tag:full_test" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + warehouse: DBT_EMERGENCY + command_name: Build Full Testing Views + command: | + dbt run -m "fsc_evm,tag:full_test" + command_name_2: Run Full Tests + command_2: | + dbt test -m "fsc_evm,tag:full_test" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/slack_notify.yml b/.github/workflows/slack_notify.yml deleted file mode 100644 index 2dc6d146..00000000 --- a/.github/workflows/slack_notify.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Slack Notification -on: - workflow_call: - secrets: - SLACK_WEBHOOK_URL: - required: true - -jobs: - notify: - runs-on: ubuntu-latest - environment: workflow_prod - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Install dependencies - run: pip install requests - - - name: Send Slack notification - run: python python/slack_alert.py - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.gitignore b/.gitignore index f5073a0e..19abe798 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,4 @@ logs/ .env .user.yml dbt-env/ -package-lock.yml \ No newline at end of file +/package-lock.yml \ No newline at end of file diff --git a/Makefile b/Makefile index fa36111d..92ccf34c 100644 --- a/Makefile +++ b/Makefile @@ -1,49 +1,109 @@ -SHELL := /bin/bash +DBT_TARGET ?= dev +RECEIPTS_BY_HASH_ENABLED ?= false -dbt-console: - docker-compose run dbt_console +cleanup_time: + @set -e; \ + rm -f package-lock.yml && dbt clean && dbt deps -refresh_package: - rm -f package-lock.yml - dbt clean - dbt deps - dbt run-operation fsc_utils.create_evm_streamline_udfs --vars '{UPDATE_UDFS_AND_SPS: true}' --target dev-admin +deploy_gha_workflows_table: + @set -e; \ + echo "Collecting workflow names..." ; \ + WORKFLOW_VALUES="" ; \ + for file in $$(find .github/workflows -name "*.yml" -type f); do \ + filename=$$(basename "$$file" .yml) ; \ + if [ -z "$$WORKFLOW_VALUES" ]; then \ + WORKFLOW_VALUES="('$$filename')" ; \ + else \ + WORKFLOW_VALUES="$$WORKFLOW_VALUES,('$$filename')" ; \ + fi ; \ + done ; \ + echo "Found workflows: $$WORKFLOW_VALUES" ; \ + dbt run-operation create_workflow_table --args "{\"workflow_values\": \"$$WORKFLOW_VALUES\"}" -t $(DBT_TARGET) -realtime: - dbt run -m models/streamline/silver/decoder/realtime/streamline__decode_traces_realtime.sql --vars '{"STREAMLINE_INVOKE_STREAMS":True,"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":True"}' --target dev-admin - dbt run -m models/streamline/bronze/decoder/bronze__streamline_decoded_traces.sql --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":True}' --target dev-admin - dbt run -m models/silver/core/silver__decoded_traces.sql +deploy_gha_tasks: + @set -e; \ + make deploy_gha_workflows_table DBT_TARGET=$(DBT_TARGET); \ + dbt run -s livequery_models.deploy.marketplace.github --vars '{"UPDATE_UDFS_AND_SPS":True}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:gha_tasks" --full-refresh -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.create_gha_tasks --vars '{"RESUME_GHA_TASKS":True}' -t $(DBT_TARGET) -realtime_logs: - dbt run -m models/streamline/silver/decoder/realtime/streamline__decode_logs_realtime.sql --vars '{"STREAMLINE_INVOKE_STREAMS":True,"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":True"}' --target dev-admin - dbt run -m models/streamline/bronze/decoder/bronze__streamline_decoded_logs.sql --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":True}' --target dev-admin - dbt run -m models/silver/core/silver__decoded_logs.sql +deploy_new_gha_tasks: + @set -e; \ + make deploy_gha_workflows_table DBT_TARGET=$(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:gha_tasks" --full-refresh -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.create_gha_tasks --vars '{"RESUME_GHA_TASKS":True}' -t $(DBT_TARGET) -history: - dbt run -m models/streamline/silver/decoder/history/traces/range_1/streamline__decode_traces_history_011667449_011706397.sql --vars '{"STREAMLINE_INVOKE_STREAMS":True,"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":True"}' --target dev-admin - dbt run -m models/streamline/bronze/decoder/bronze__streamline_decoded_traces.sql --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":True}' --target dev-admin - dbt run -m models/silver/core/silver__decoded_traces.sql +deploy_livequery: + @set -e; \ + dbt run-operation fsc_evm.drop_livequery_schemas --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run -m livequery_models.deploy.core --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.livequery_grants --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET) -history_logs: - dbt run -m models/streamline/silver/decoder/history/event_logs/range_0/streamline__decode_logs_history_016532020_016560020.sql --vars '{"STREAMLINE_INVOKE_STREAMS":True,"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":True"}' --target dev-admin - dbt run -m models/streamline/bronze/decoder/bronze__streamline_decoded_logs.sql --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":True}' --target dev-admin - dbt run -m models/silver/core/silver__decoded_logs.sql +deploy_chain_phase_1: + @set -e; \ + dbt run -m livequery_models.deploy.core --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.livequery_grants --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.create_evm_streamline_udfs --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.call_sample_rpc_node -t $(DBT_TARGET); \ + if [ "$(DBT_TARGET)" != "prod" ]; then \ + if [ "$(RECEIPTS_BY_HASH_ENABLED)" = "true" ]; then \ + dbt run -m "fsc_evm,tag:phase_1" --exclude "fsc_evm,tag:receipts" --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true, "MAIN_SL_NEW_BUILD_ENABLED": true, "GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET); \ + dbt test -m "fsc_evm,tag:chainhead"; \ + dbt run -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts" "fsc_evm,tag:confirm_blocks" --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "STREAMLINE_INVOKE_STREAMS":True, "MAIN_SL_TESTING_LIMIT": 500}' -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_1" --exclude "fsc_evm,tag:receipts_by_hash" --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true, "MAIN_SL_NEW_BUILD_ENABLED": true, "GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET); \ + dbt test -m "fsc_evm,tag:chainhead"; \ + dbt run -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts_by_hash" "fsc_evm,tag:confirm_blocks" --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "STREAMLINE_INVOKE_STREAMS":True, "MAIN_SL_TESTING_LIMIT": 500}' -t $(DBT_TARGET); \ + fi; \ + else \ + if [ "$(RECEIPTS_BY_HASH_ENABLED)" = "true" ]; then \ + dbt run -m "fsc_evm,tag:phase_1" --exclude "fsc_evm,tag:receipts" --full-refresh --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET); \ + dbt test -m "fsc_evm,tag:chainhead"; \ + dbt run -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts" "fsc_evm,tag:confirm_blocks" --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "STREAMLINE_INVOKE_STREAMS":True}' -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_1" --exclude "fsc_evm,tag:receipts_by_hash" --full-refresh --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET); \ + dbt test -m "fsc_evm,tag:chainhead"; \ + dbt run -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts_by_hash" "fsc_evm,tag:confirm_blocks" --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "STREAMLINE_INVOKE_STREAMS":True}' -t $(DBT_TARGET); \ + fi; \ + fi; \ + echo "# wait ~10 minutes"; \ + echo "# run deploy_chain_phase_2" -load_new: - dbt run -m models/silver/core/silver__blocks.sql - dbt run -m models/silver/core/silver__transactions.sql - dbt run -m models/silver/core/silver__receipts.sql - dbt run -m models/silver/core/silver__logs.sql - dbt run -m models/silver/core/silver__traces.sql +deploy_chain_phase_2: + @set -e; \ + if [ "$(DBT_TARGET)" != "prod" ]; then \ + dbt run -m "fsc_evm,tag:phase_2" --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true, "GLOBAL_STREAMLINE_FR_ENABLED": true, "GLOBAL_BRONZE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true, "GLOBAL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:streamline,tag:abis,tag:realtime" "fsc_evm,tag:streamline,tag:abis,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True, "DECODER_SL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_2" --full-refresh --vars '{"GLOBAL_STREAMLINE_FR_ENABLED": true, "GLOBAL_BRONZE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true, "GLOBAL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:streamline,tag:abis,tag:realtime" "fsc_evm,tag:streamline,tag:abis,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True, "DECODER_SL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + fi; \ + echo "# wait ~10 minutes"; \ + echo "# run deploy_chain_phase_3" -load_abi: - dbt run -m models/silver/core/silver__relevant_contracts.sql - dbt run -m models/silver/core/silver__created_contracts.sql - dbt run -m models/silver/abis --exclude models/silver/abis/event_logs +deploy_chain_phase_3: + @set -e; \ + if [ "$(DBT_TARGET)" != "prod" ]; then \ + dbt run -m "fsc_evm,tag:phase_2" --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:phase_3" --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true, "GLOBAL_STREAMLINE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true, "GLOBAL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:silver,tag:abis" "fsc_evm,tag:streamline,tag:decoded_logs,tag:realtime" "fsc_evm,tag:streamline,tag:decoded_logs,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True, "DECODER_SL_TESTING_LIMIT": 500}' -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_2" -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:phase_3" --full-refresh --vars '{"GLOBAL_STREAMLINE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true, "GLOBAL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:silver,tag:abis" "fsc_evm,tag:streamline,tag:decoded_logs,tag:realtime" "fsc_evm,tag:streamline,tag:decoded_logs,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -t $(DBT_TARGET); \ + fi; \ + echo "# wait ~10 minutes"; \ + echo "# run deploy_chain_phase_4" -load_new_and_abi: - make load_new - make load_abi - -.PHONY: dbt-console refresh_package +deploy_chain_phase_4: + @set -e; \ + if [ "$(DBT_TARGET)" != "prod" ]; then \ + dbt run -m "fsc_evm,tag:phase_3" --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:phase_4" --full-refresh -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_3" -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:phase_4" --full-refresh -t $(DBT_TARGET); \ + make deploy_gha_tasks DBT_TARGET=$(DBT_TARGET); \ + fi; \ +.PHONY: cleanup_time deploy_gha_workflows_table deploy_gha_tasks deploy_new_gha_tasks deploy_livequery deploy_chain_phase_1 deploy_chain_phase_2 deploy_chain_phase_3 deploy_chain_phase_4 \ No newline at end of file diff --git a/data/github_actions__workflows.csv b/data/github_actions__workflows.csv deleted file mode 100644 index 86b71545..00000000 --- a/data/github_actions__workflows.csv +++ /dev/null @@ -1,11 +0,0 @@ -workflow_name,workflow_schedule -dbt_run_scheduled_non_realtime,"8,38 * * * *" -dbt_run_streamline_chainhead,"0,20,40 * * * *" -dbt_run_streamline_decoder,"14,44 * * * *" -dbt_run_scheduled_curated,"30 */4 * * *" -dbt_run_scheduled_beacon,"10 */2 * * *" -dbt_run_streamline_beacon,"55 */1 * * *" -dbt_test_intraday,"55 */4 * * *" -dbt_run_streamline_decoded_logs_history,"42 9 * * 6" -dbt_run_streamline_decoded_traces_history,"5 22 * * 6" -dbt_run_abi_refresh,"29 23 * * *" \ No newline at end of file diff --git a/data/observability__exclusion_list.csv b/data/observability__exclusion_list.csv new file mode 100644 index 00000000..220c41f1 --- /dev/null +++ b/data/observability__exclusion_list.csv @@ -0,0 +1,92 @@ +block_number +3804951 +3804282 +3805213 +3805274 +3805144 +3804909 +3804375 +3805171 +3805210 +3804357 +3804917 +3805111 +3805195 +3804880 +3805005 +3804985 +3805056 +3805047 +3805177 +3805129 +3804887 +3804982 +3804898 +3804931 +3804939 +3805099 +3805119 +3805027 +3804885 +3805174 +3804945 +3805147 +3804005 +3805207 +3804216 +3805224 +3805042 +3805126 +3805141 +3805091 +3804347 +3805247 +3805132 +3805262 +3804934 +3804958 +3804962 +3804299 +3804906 +3804953 +3805228 +3805016 +3805222 +3805064 +3805072 +3804222 +3805115 +3805279 +3804874 +3804913 +3804992 +3805084 +3805258 +3805157 +3804893 +3805061 +3805019 +3804973 +3804920 +3805230 +3804901 +3805266 +3805038 +3804969 +3805190 +3805200 +3805153 +3805067 +3804865 +3804988 +3804975 +3804926 +3805010 +3804315 +3804309 +3805272 +3805249 +3804227 +3805202 +3805033 +3805022 \ No newline at end of file diff --git a/dbt_project.yml b/dbt_project.yml index b1f899bd..34b3c6b3 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -17,6 +17,8 @@ test-paths: ["tests"] seed-paths: ["data"] macro-paths: ["macros"] snapshot-paths: ["snapshots"] +docs-paths: + ["dbt_packages/fsc_evm/doc_descriptions", "models/doc_descriptions", "models"] target-path: "target" # directory which will store compiled SQL files clean-targets: # directories to be removed by `dbt clean` @@ -24,19 +26,11 @@ clean-targets: # directories to be removed by `dbt clean` - "dbt_modules" - "dbt_packages" -models: - +copy_grants: true - +persist_docs: - relation: true - columns: true - +on_schema_change: "append_new_columns" - tests: +store_failures: true # all tests on-run-start: - "{{ create_sps() }}" - - "{{ sp_create_load_nft_metadata() }}" - "{{ create_udfs() }}" on-run-end: @@ -56,6 +50,67 @@ query-comment: # Configuring models # Full documentation: https://docs.getdbt.com/docs/configuring-models +models: + ethereum_models: # replace with the name of the chain + +copy_grants: true + +persist_docs: + relation: true + columns: true + +on_schema_change: "append_new_columns" + livequery_models: + +materialized: ephemeral + fsc_evm: + +enabled: false # disable fsc_evm package by default + +copy_grants: true + +persist_docs: + relation: true + columns: true + +on_schema_change: "append_new_columns" + main_package: + +enabled: false # disable top level package by default, enabled subpackages as needed + admin: + +enabled: true + core: + +enabled: true # enable subpackages, as needed + bronze: + +enabled: false + token_reads: + +enabled: true + github_actions: + +enabled: true + labels: + +enabled: true + observability: + +enabled: true + prices: + +enabled: true + utils: + +enabled: true + decoder_package: + +enabled: false + abis: + +enabled: false + gold: + +enabled: true + silver: + +enabled: true + streamline: + +enabled: true + decoded_logs: + +enabled: false + gold: + +enabled: true + silver: + +enabled: true + streamline: + +enabled: true + curated_package: + +enabled: false + stats: + +enabled: true + scores_package: + +enabled: false + # In this example config, we tell dbt to build all models in the example/ directory # as tables. These settings can be overridden in the individual model files # using the `{{ config(...) }}` macro. @@ -68,11 +123,9 @@ vars: STREAMLINE_RUN_HISTORY: False UPDATE_SNOWFLAKE_TAGS: True WAIT: 0 - OBSERV_FULL_TEST: False HEAL_MODEL: False HEAL_MODELS: [] LOAD_CUSTOM_FUNCTIONS: False - START_GHA_TASKS: False #### STREAMLINE 2.0 BEGIN #### @@ -98,67 +151,4 @@ vars: - INTERNAL_DEV - DBT_CLOUD_ETHEREUM -#### STREAMLINE 2.0 END #### - -#### FSC_EVM BEGIN #### -# Visit https://github.com/FlipsideCrypto/fsc-evm/wiki for more information on required and optional variables - - ### GLOBAL VARIABLES BEGIN ### - ## REQUIRED - GLOBAL_PROD_DB_NAME: 'ethereum' - GLOBAL_NODE_SECRET_PATH: 'Vault/prod/ethereum/quicknode/ethereum_mainnet' - GLOBAL_BLOCKS_PER_HOUR: 300 - GLOBAL_USES_STREAMLINE_V1: True - - ### GLOBAL VARIABLES END ### - - ### MAIN_PACKAGE VARIABLES BEGIN ### - - ### CORE ### - ## REQUIRED - - BLOCKS_TRANSACTIONS_REALTIME_EXTERNAL_TABLE: 'blocks_v2' - BLOCKS_TRANSACTIONS_HISTORY_EXTERNAL_TABLE: 'blocks_v2' - TRACES_REALTIME_EXTERNAL_TABLE: 'traces_v2' - TRACES_HISTORY_EXTERNAL_TABLE: 'traces_v2' - RECEIPTS_REALTIME_EXTERNAL_TABLE: 'receipts_v2' - RECEIPTS_HISTORY_EXTERNAL_TABLE: 'receipts_v2' - CONFIRM_BLOCKS_REALTIME_EXTERNAL_TABLE: 'confirm_blocks_v2' - CONFIRM_BLOCKS_HISTORY_EXTERNAL_TABLE: 'confirm_blocks_v2' - - ## OPTIONAL - # GOLD_FULL_REFRESH: True - # SILVER_FULL_REFRESH: True - # BRONZE_FULL_REFRESH: True - - # BLOCKS_COMPLETE_FULL_REFRESH: True - # CONFIRM_BLOCKS_COMPLETE_FULL_REFRESH: True - # TRACES_COMPLETE_FULL_REFRESH: True - # RECEIPTS_COMPLETE_FULL_REFRESH: True - # TRANSACTIONS_COMPLETE_FULL_REFRESH: True - - # BLOCKS_TRANSACTIONS_REALTIME_TESTING_LIMIT: 3 - # BLOCKS_TRANSACTIONS_HISTORY_TESTING_LIMIT: 3 - # TRACES_REALTIME_TESTING_LIMIT: 3 - # TRACES_HISTORY_TESTING_LIMIT: 3 - # RECEIPTS_REALTIME_TESTING_LIMIT: 3 - # RECEIPTS_HISTORY_TESTING_LIMIT: 3 - # CONFIRM_BLOCKS_REALTIME_TESTING_LIMIT: 3 - # CONFIRM_BLOCKS_HISTORY_TESTING_LIMIT: 3 - - # ### MAIN_PACKAGE VARIABLES END ### - - # ### DECODER_PACKAGE VARIABLES BEGIN ### - - # ## REQUIRED - - # ## OPTIONAL - - # DECODED_LOGS_COMPLETE_FULL_REFRESH: True - - # DECODED_LOGS_REALTIME_TESTING_LIMIT: 3 - # DECODED_LOGS_HISTORY_SQL_LIMIT: 1 #limit per monthly range - - ### DECODER_PACKAGE VARIABLES END ### - -#### FSC_EVM END #### \ No newline at end of file +#### STREAMLINE 2.0 END #### \ No newline at end of file diff --git a/macros/create_udfs.sql b/macros/create_udfs.sql index 60ebef33..b2436087 100644 --- a/macros/create_udfs.sql +++ b/macros/create_udfs.sql @@ -1,42 +1,9 @@ {% macro create_udfs() %} - {% if var("UPDATE_UDFS_AND_SPS") %} + {% if var("UPDATE_UDFS_AND_SPS", false) %} {% set sql %} CREATE schema if NOT EXISTS silver; - {{ create_udf_transform_logs( - schema = 'silver' - ) }} - {{ create_udtf_get_base_table( - schema = "streamline" - ) }} - {% endset %} {% do run_query(sql) %} - {% if target.database != "ETHEREUM_COMMUNITY_DEV" %} - {% set sql %} - {{ create_udf_get_chainhead() }} - {{ create_udf_get_beacon_chainhead() }} - {{ create_udf_call_eth_node() }} - {{ create_udf_call_node() }} - {{ create_udf_call_read_batching() }} - {{ create_udf_api() }} - {{ create_udf_load_nft_metadata() }} - {{ create_udf_get_token_balances() }} - {{ create_udf_get_eth_balances() }} - {{ create_udf_get_reads() }} - {{ create_udf_get_contract_abis() }} - {{ create_udf_get_blocks() }} - {{ create_udf_get_transactions() }} - {{ create_udf_get_beacon_blocks() }} - {{ create_udf_decode_array_string() }} - {{ create_udf_decode_array_object() }} - {{ create_udf_rest_api() }} - {{ create_udf_bulk_decode_logs() }} - {{ create_udf_bulk_decode_traces() }} - {{ create_udf_json_rpc() }} - - {% endset %} - {% do run_query(sql) %} - {% endif %} {{- fsc_utils.create_udfs() -}} {% endif %} -{% endmacro %} +{% endmacro %} \ No newline at end of file diff --git a/macros/decoder/decoded_logs_history.sql b/macros/decoder/decoded_logs_history.sql deleted file mode 100644 index 4fe2282d..00000000 --- a/macros/decoder/decoded_logs_history.sql +++ /dev/null @@ -1,124 +0,0 @@ -{% macro decoded_logs_history(backfill_mode=false) %} - - {%- set params = { - "sql_limit": var("DECODED_LOGS_HISTORY_SQL_LIMIT", 8000000), - "producer_batch_size": var("DECODED_LOGS_HISTORY_PRODUCER_BATCH_SIZE", 400000), - "worker_batch_size": var("DECODED_LOGS_HISTORY_WORKER_BATCH_SIZE", 100000) - } -%} - - {% set wait_time = var("DECODED_LOGS_HISTORY_WAIT_TIME", 60) %} - {% set find_months_query %} - SELECT - DISTINCT date_trunc('month', block_timestamp)::date as month - FROM {{ ref('core__fact_blocks') }} - ORDER BY month ASC - {% endset %} - {% set results = run_query(find_months_query) %} - - {% if execute %} - {% set months = results.columns[0].values() %} - - {% for month in months %} - {% set view_name = 'decoded_logs_history_' ~ month.strftime('%Y_%m') %} - - {% set create_view_query %} - create or replace view streamline.{{view_name}} as ( - WITH target_blocks AS ( - SELECT - block_number - FROM {{ ref('core__fact_blocks') }} - WHERE date_trunc('month', block_timestamp) = '{{month}}'::timestamp - ), - new_abis AS ( - SELECT - abi, - parent_contract_address, - event_signature, - start_block, - end_block - FROM {{ ref('silver__complete_event_abis') }} - {% if not backfill_mode %} - WHERE inserted_timestamp > dateadd('day', -30, sysdate()) - {% endif %} - ), - existing_logs_to_exclude AS ( - SELECT _log_id - FROM {{ ref('streamline__decoded_logs_complete') }} l - INNER JOIN target_blocks b using (block_number) - ), - candidate_logs AS ( - SELECT - l.block_number, - l.tx_hash, - l.event_index, - l.contract_address, - l.topics, - l.data, - concat(l.tx_hash::string, '-', l.event_index::string) as _log_id - FROM target_blocks b - INNER JOIN {{ ref('core__fact_event_logs') }} l using (block_number) - WHERE l.tx_status = 'SUCCESS' and date_trunc('month', l.block_timestamp) = '{{month}}'::timestamp - ) - SELECT - l.block_number, - l._log_id, - A.abi, - OBJECT_CONSTRUCT( - 'topics', l.topics, - 'data', l.data, - 'address', l.contract_address - ) AS data - FROM candidate_logs l - INNER JOIN new_abis A - ON A.parent_contract_address = l.contract_address - AND A.event_signature = l.topics[0]::STRING - AND l.block_number BETWEEN A.start_block AND A.end_block - WHERE NOT EXISTS ( - SELECT 1 - FROM existing_logs_to_exclude e - WHERE e._log_id = l._log_id - ) - LIMIT {{ params.sql_limit }} - ) - {% endset %} - {# Create the view #} - {% do run_query(create_view_query) %} - {{ log("Created view for month " ~ month.strftime('%Y-%m'), info=True) }} - {% if var("STREAMLINE_INVOKE_STREAMS", false) %} - {# Check if rows exist first #} - {% set check_rows_query %} - SELECT EXISTS(SELECT 1 FROM streamline.{{view_name}} LIMIT 1) - {% endset %} - - {% set results = run_query(check_rows_query) %} - {% set has_rows = results.columns[0].values()[0] %} - - {% if has_rows %} - {# Invoke streamline, if rows exist to decode #} - {% set decode_query %} - SELECT - streamline.udf_bulk_decode_logs_v2( - PARSE_JSON( - $${ "external_table": "decoded_logs", - "producer_batch_size": {{ params.producer_batch_size }}, - "sql_limit": {{ params.sql_limit }}, - "sql_source": "{{view_name}}", - "worker_batch_size": {{ params.worker_batch_size }} }$$ - ) - ); - {% endset %} - - {% do run_query(decode_query) %} - {{ log("Triggered decoding for month " ~ month.strftime('%Y-%m'), info=True) }} - {# Call wait since we actually did some decoding #} - {% do run_query("call system$wait(" ~ wait_time ~ ")") %} - {{ log("Completed wait after decoding for month " ~ month.strftime('%Y-%m'), info=True) }} - {% else %} - {{ log("No rows to decode for month " ~ month.strftime('%Y-%m'), info=True) }} - {% endif %} - {% endif %} - - {% endfor %} - {% endif %} - -{% endmacro %} \ No newline at end of file diff --git a/macros/decoder/run_decoded_history.sql b/macros/decoder/run_decoded_traces_history.sql similarity index 67% rename from macros/decoder/run_decoded_history.sql rename to macros/decoder/run_decoded_traces_history.sql index 2ca60453..faeade61 100644 --- a/macros/decoder/run_decoded_history.sql +++ b/macros/decoder/run_decoded_traces_history.sql @@ -1,4 +1,4 @@ -{% macro run_decoded_history() %} +{% macro run_decoded_traces_history() %} {% set check_for_new_user_abis_query %} SELECT 1 @@ -11,14 +11,6 @@ WHERE {% if execute %} {% set new_user_abis = results.columns [0].values() [0] %} {% if new_user_abis %} - {% set invoke_logs_query %} - SELECT - github_actions.workflow_dispatches( - 'FlipsideCrypto', - '{{ blockchain }}' || '-models', - 'dbt_run_streamline_decoded_logs_history.yml', - NULL - ) {% endset %} {% set invoke_traces_query %} SELECT github_actions.workflow_dispatches( @@ -27,7 +19,6 @@ WHERE 'dbt_run_streamline_decoded_traces_history.yml', NULL ) {% endset %} - {% do run_query(invoke_logs_query) %} {% do run_query(invoke_traces_query) %} {% endif %} {% endif %} diff --git a/macros/fsc_evm_temp/decoder_package/streamline_external_table_queries_decoder.sql b/macros/fsc_evm_temp/decoder_package/streamline_external_table_queries_decoder.sql deleted file mode 100644 index 318a3daa..00000000 --- a/macros/fsc_evm_temp/decoder_package/streamline_external_table_queries_decoder.sql +++ /dev/null @@ -1,101 +0,0 @@ -{% macro streamline_external_table_query_decoder( - source_name, - source_version - ) %} - - {% if source_version != '' %} - {% set source_version = '_' ~ source_version.lower() %} - {% endif %} - - WITH meta AS ( - SELECT - job_created_time AS _inserted_timestamp, - file_name, - CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 6), '_', 1) AS INTEGER) AS _partition_by_block_number, - TO_DATE( - concat_ws('-', SPLIT_PART(file_name, '/', 3), SPLIT_PART(file_name, '/', 4), SPLIT_PART(file_name, '/', 5)) - ) AS _partition_by_created_date - FROM - TABLE( - information_schema.external_table_file_registration_history( - start_time => DATEADD('day', -3, CURRENT_TIMESTAMP()), - table_name => '{{ source( "bronze_streamline", source_name ~ source_version) }}') - ) A - ) - SELECT - block_number, - id :: STRING AS id, - DATA, - metadata, - b.file_name, - _inserted_timestamp, - s._partition_by_block_number AS _partition_by_block_number, - s._partition_by_created_date AS _partition_by_created_date - FROM - {{ source( - "bronze_streamline", - source_name ~ source_version - ) }} - s - JOIN meta b - ON b.file_name = metadata$filename - AND b._partition_by_block_number = s._partition_by_block_number - AND b._partition_by_created_date = s._partition_by_created_date - WHERE - b._partition_by_block_number = s._partition_by_block_number - AND b._partition_by_created_date = s._partition_by_created_date - AND s._partition_by_created_date >= DATEADD('day', -2, CURRENT_TIMESTAMP()) - AND DATA :error IS NULL - AND DATA IS NOT NULL -{% endmacro %} - - -{% macro streamline_external_table_query_decoder_fr( - source_name, - source_version - ) %} - - {% if source_version != '' %} - {% set source_version = '_' ~ source_version.lower() %} - {% endif %} - - WITH meta AS ( - SELECT - registered_on AS _inserted_timestamp, - file_name, - CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 6), '_', 1) AS INTEGER) AS _partition_by_block_number, - TO_DATE( - concat_ws('-', SPLIT_PART(file_name, '/', 3), SPLIT_PART(file_name, '/', 4), SPLIT_PART(file_name, '/', 5)) - ) AS _partition_by_created_date - FROM - TABLE( - information_schema.external_table_files( - table_name => '{{ source( "bronze_streamline", source_name ~ source_version) }}' - ) - ) A - ) -SELECT - block_number, - id :: STRING AS id, - DATA, - metadata, - b.file_name, - _inserted_timestamp, - s._partition_by_block_number AS _partition_by_block_number, - s._partition_by_created_date AS _partition_by_created_date -FROM - {{ source( - "bronze_streamline", - source_name ~ source_version - ) }} - s - JOIN meta b - ON b.file_name = metadata$filename - AND b._partition_by_block_number = s._partition_by_block_number - AND b._partition_by_created_date = s._partition_by_created_date -WHERE - b._partition_by_block_number = s._partition_by_block_number - AND b._partition_by_created_date = s._partition_by_created_date - AND DATA :error IS NULL - AND DATA IS NOT NULL -{% endmacro %} diff --git a/macros/fsc_evm_temp/main_package/bronze/streamline_external_table_queries.sql b/macros/fsc_evm_temp/main_package/bronze/streamline_external_table_queries.sql deleted file mode 100644 index 7d9460e3..00000000 --- a/macros/fsc_evm_temp/main_package/bronze/streamline_external_table_queries.sql +++ /dev/null @@ -1,141 +0,0 @@ -{% macro streamline_external_table_query( - source_name, - source_version, - partition_function, - balances, - block_number, - uses_receipts_by_hash - ) %} - - {% if source_version != '' %} - {% set source_version = '_' ~ source_version.lower() %} - {% endif %} - - WITH meta AS ( - SELECT - job_created_time AS _inserted_timestamp, - file_name, - {{ partition_function }} AS partition_key - FROM - TABLE( - information_schema.external_table_file_registration_history( - start_time => DATEADD('day', -3, CURRENT_TIMESTAMP()), - table_name => '{{ source( "bronze_streamline", source_name ~ source_version) }}') - ) A - ) - SELECT - s.*, - b.file_name, - b._inserted_timestamp - - {% if balances %}, - r.block_timestamp :: TIMESTAMP AS block_timestamp - {% endif %} - - {% if block_number %}, - COALESCE( - s.value :"BLOCK_NUMBER" :: STRING, - s.metadata :request :"data" :id :: STRING, - PARSE_JSON( - s.metadata :request :"data" - ) :id :: STRING - ) :: INT AS block_number - {% endif %} - {% if uses_receipts_by_hash %}, - s.value :"TX_HASH" :: STRING AS tx_hash - {% endif %} - FROM - {{ source( - "bronze_streamline", - source_name ~ source_version - ) }} - s - JOIN meta b - ON b.file_name = metadata$filename - AND b.partition_key = s.partition_key - - {% if balances %} - JOIN {{ ref('_block_ranges') }} - r - ON r.block_number = COALESCE( - s.value :"BLOCK_NUMBER" :: INT, - s.value :"block_number" :: INT - ) - {% endif %} - WHERE - b.partition_key = s.partition_key - AND DATA :error :code IS NULL - AND DATA IS NOT NULL -{% endmacro %} - -{% macro streamline_external_table_query_fr( - source_name, - source_version, - partition_function, - partition_join_key, - balances, - block_number, - uses_receipts_by_hash - ) %} - - {% if source_version != '' %} - {% set source_version = '_' ~ source_version.lower() %} - {% endif %} - - WITH meta AS ( - SELECT - registered_on AS _inserted_timestamp, - file_name, - {{ partition_function }} AS partition_key - FROM - TABLE( - information_schema.external_table_files( - table_name => '{{ source( "bronze_streamline", source_name ~ source_version) }}' - ) - ) A - ) -SELECT - s.*, - b.file_name, - b._inserted_timestamp - - {% if balances %}, - r.block_timestamp :: TIMESTAMP AS block_timestamp -{% endif %} - -{% if block_number %}, - COALESCE( - s.value :"BLOCK_NUMBER" :: STRING, - s.value :"block_number" :: STRING, - s.metadata :request :"data" :id :: STRING, - PARSE_JSON( - s.metadata :request :"data" - ) :id :: STRING - ) :: INT AS block_number -{% endif %} -{% if uses_receipts_by_hash %}, - s.value :"TX_HASH" :: STRING AS tx_hash -{% endif %} -FROM - {{ source( - "bronze_streamline", - source_name ~ source_version - ) }} - s - JOIN meta b - ON b.file_name = metadata$filename - AND b.partition_key = s.{{ partition_join_key }} - - {% if balances %} - JOIN {{ ref('_block_ranges') }} - r - ON r.block_number = COALESCE( - s.value :"BLOCK_NUMBER" :: INT, - s.value :"block_number" :: INT - ) - {% endif %} -WHERE - b.partition_key = s.{{ partition_join_key }} - AND DATA :error :code IS NULL - AND DATA IS NOT NULL -{% endmacro %} diff --git a/macros/fsc_evm_temp/main_package/logging/bronze.sql b/macros/fsc_evm_temp/main_package/logging/bronze.sql deleted file mode 100644 index b367deb5..00000000 --- a/macros/fsc_evm_temp/main_package/logging/bronze.sql +++ /dev/null @@ -1,36 +0,0 @@ -{% macro log_bronze_details(source_name, source_version, model_type, partition_function, partition_join_key, block_number, uses_receipts_by_hash) %} - -{% if source_version != '' %} - {% set source_version = '_' ~ source_version.lower() %} -{% endif %} -{% if model_type != '' %} - {% set model_type = '_' ~ model_type %} -{% endif %} - -{%- if flags.WHICH == 'compile' and execute -%} - - {{ log("=== Current Variable Settings ===", info=True) }} - {{ log(source_name ~ model_type ~ '_PARTITION_FUNCTION: ' ~ partition_function, info=True) }} - {{ log(source_name ~ model_type ~ '_PARTITION_JOIN_KEY: ' ~ partition_join_key, info=True) }} - {{ log(source_name ~ model_type ~ '_BLOCK_NUMBER: ' ~ block_number, info=True) }} - {% if uses_receipts_by_hash %} - {{ log("USES_RECEIPTS_BY_HASH: " ~ uses_receipts_by_hash, info=True) }} - {% endif %} - - {{ log("", info=True) }} - {{ log("=== Source Details ===", info=True) }} - {{ log("Source: " ~ source('bronze_streamline', source_name.lower() ~ source_version.lower()), info=True) }} - {{ log("", info=True) }} - - {% set config_log = '\n' %} - {% set config_log = config_log ~ '\n=== DBT Model Config ===\n'%} - {% set config_log = config_log ~ '\n{{ config (\n' %} - {% set config_log = config_log ~ ' materialized = "' ~ config.get('materialized') ~ '",\n' %} - {% set config_log = config_log ~ ' tags = ' ~ config.get('tags') | tojson ~ '\n' %} - {% set config_log = config_log ~ ') }}\n' %} - {{ log(config_log, info=True) }} - {{ log("", info=True) }} - -{%- endif -%} - -{% endmacro %} \ No newline at end of file diff --git a/macros/fsc_evm_temp/main_package/logging/complete.sql b/macros/fsc_evm_temp/main_package/logging/complete.sql deleted file mode 100644 index 3637b41e..00000000 --- a/macros/fsc_evm_temp/main_package/logging/complete.sql +++ /dev/null @@ -1,29 +0,0 @@ -{% macro log_complete_details(post_hook, full_refresh_type, uses_receipts_by_hash) %} - -{%- if flags.WHICH == 'compile' and execute -%} - - {% if uses_receipts_by_hash %} - - {{ log("=== Current Variable Settings ===", info=True) }} - {{ log("USES_RECEIPTS_BY_HASH: " ~ uses_receipts_by_hash, info=True) }} - - {% endif %} - - {% set config_log = '\n' %} - {% set config_log = config_log ~ '\n=== DBT Model Config ===\n'%} - {% set config_log = config_log ~ '\n{{ config (\n' %} - {% set config_log = config_log ~ ' materialized = "' ~ config.get('materialized') ~ '",\n' %} - {% set config_log = config_log ~ ' unique_key = "' ~ config.get('unique_key') ~ '",\n' %} - {% set config_log = config_log ~ ' cluster_by = "' ~ config.get('cluster_by') ~ '",\n' %} - {% set config_log = config_log ~ ' merge_update_columns = ' ~ config.get('merge_update_columns') | tojson ~ ',\n' %} - {% set config_log = config_log ~ ' post_hook = "' ~ post_hook ~ '",\n' %} - {% set config_log = config_log ~ ' incremental_predicates = ' ~ config.get('incremental_predicates') | tojson ~ ',\n' %} - {% set config_log = config_log ~ ' full_refresh = ' ~ full_refresh_type ~ ',\n' %} - {% set config_log = config_log ~ ' tags = ' ~ config.get('tags') | tojson ~ '\n' %} - {% set config_log = config_log ~ ') }}\n' %} - {{ log(config_log, info=True) }} - {{ log("", info=True) }} - -{%- endif -%} - -{% endmacro %} \ No newline at end of file diff --git a/macros/fsc_evm_temp/main_package/logging/logging.sql b/macros/fsc_evm_temp/main_package/logging/logging.sql deleted file mode 100644 index f3686852..00000000 --- a/macros/fsc_evm_temp/main_package/logging/logging.sql +++ /dev/null @@ -1,36 +0,0 @@ -{% macro log_model_details(vars=false, params=false) %} - -{%- if execute -%} -/* -DBT Model Config: -{{ model.config | tojson(indent=2) }} -*/ - -{% if vars is not false %} - -{% if var('LOG_MODEL_DETAILS', false) %} -{{ log( vars | tojson(indent=2), info=True) }} -{% endif %} -/* -Variables: -{{ vars | tojson(indent=2) }} -*/ -{% endif %} - -{% if params is not false %} - -{% if var('LOG_MODEL_DETAILS', false) %} -{{ log( params | tojson(indent=2), info=True) }} -{% endif %} -/* -Parameters: -{{ params | tojson(indent=2) }} -*/ -{% endif %} - -/* -Raw Code: -{{ model.raw_code }} -*/ -{%- endif -%} -{% endmacro %} \ No newline at end of file diff --git a/macros/fsc_evm_temp/main_package/logging/requests.sql b/macros/fsc_evm_temp/main_package/logging/requests.sql deleted file mode 100644 index 85cbbda1..00000000 --- a/macros/fsc_evm_temp/main_package/logging/requests.sql +++ /dev/null @@ -1,55 +0,0 @@ -{% macro log_streamline_details(model_name, model_type, node_url, model_quantum_state, sql_limit, testing_limit, order_by_clause, new_build, streamline_params, uses_receipts_by_hash, method, method_params, min_block=0) %} - -{%- if flags.WHICH == 'compile' and execute -%} - - {{ log("=== Current Variable Settings ===", info=True) }} - {{ log("START_UP_BLOCK: " ~ min_block, info=True) }} - {{ log("", info=True) }} - - {{ log("=== API Details ===", info=True) }} - - {{ log("NODE_URL: " ~ node_url, info=True) }} - {{ log("NODE_SECRET_PATH: " ~ var('GLOBAL_NODE_SECRET_PATH'), info=True) }} - {{ log("", info=True) }} - - {{ log("=== Current Variable Settings ===", info=True) }} - - {{ log((model_name ~ '_' ~ model_type ~ '_model_quantum_state').upper() ~ ': ' ~ model_quantum_state, info=True) }} - {{ log((model_name ~ '_' ~ model_type ~ '_sql_limit').upper() ~ ': ' ~ sql_limit, info=True) }} - {{ log((model_name ~ '_' ~ model_type ~ '_testing_limit').upper() ~ ': ' ~ testing_limit, info=True) }} - {{ log((model_name ~ '_' ~ model_type ~ '_order_by_clause').upper() ~ ': ' ~ order_by_clause, info=True) }} - {{ log((model_name ~ '_' ~ model_type ~ '_new_build').upper() ~ ': ' ~ new_build, info=True) }} - {{ log('USES_RECEIPTS_BY_HASH' ~ ': ' ~ uses_receipts_by_hash, info=True) }} - {{ log("", info=True) }} - - {{ log("=== RPC Details ===", info=True) }} - - {{ log(model_name ~ ": {", info=True) }} - {{ log(" method: '" ~ method ~ "',", info=True) }} - {{ log(" method_params: " ~ method_params, info=True) }} - {{ log("}", info=True) }} - {{ log("", info=True) }} - - {% set params_str = streamline_params | tojson %} - {% set params_formatted = params_str | replace('{', '{\n ') | replace('}', '\n }') | replace(', ', ',\n ') %} - - {# Clean up the method_params formatting #} - {% set params_formatted = params_formatted | replace('"method_params": "', '"method_params": "') | replace('\\n', ' ') | replace('\\u0027', "'") %} - - {% set config_log = '\n' %} - {% set config_log = config_log ~ '\n=== DBT Model Config ===\n'%} - {% set config_log = config_log ~ '\n{{ config (\n' %} - {% set config_log = config_log ~ ' materialized = "' ~ config.get('materialized') ~ '",\n' %} - {% set config_log = config_log ~ ' post_hook = fsc_utils.if_data_call_function_v2(\n' %} - {% set config_log = config_log ~ ' func = "streamline.udf_bulk_rest_api_v2",\n' %} - {% set config_log = config_log ~ ' target = "' ~ this.schema ~ '.' ~ this.identifier ~ '",\n' %} - {% set config_log = config_log ~ ' params = ' ~ params_formatted ~ '\n' %} - {% set config_log = config_log ~ ' ),\n' %} - {% set config_log = config_log ~ ' tags = ' ~ config.get('tags') | tojson ~ '\n' %} - {% set config_log = config_log ~ ') }}\n' %} - {{ log(config_log, info=True) }} - {{ log("", info=True) }} - -{%- endif -%} - -{% endmacro %} \ No newline at end of file diff --git a/macros/fsc_evm_temp/main_package/streamline/set_default_variables.sql b/macros/fsc_evm_temp/main_package/streamline/set_default_variables.sql deleted file mode 100644 index 598c3b95..00000000 --- a/macros/fsc_evm_temp/main_package/streamline/set_default_variables.sql +++ /dev/null @@ -1,47 +0,0 @@ -{% macro set_default_variables_streamline(model_name, model_type) %} - -{%- set node_url = var('GLOBAL_NODE_URL', '{Service}/{Authentication}') -%} -{%- set node_secret_path = var('GLOBAL_NODE_SECRET_PATH', '') -%} -{%- set model_quantum_state = var((model_name ~ '_' ~ model_type ~ '_quantum_state').upper(), 'streamline') -%} -{%- set testing_limit = var((model_name ~ '_' ~ model_type ~ '_testing_limit').upper(), none) -%} -{%- set new_build = var((model_name ~ '_' ~ model_type ~ '_new_build').upper(), false) -%} -{%- set default_order = 'ORDER BY partition_key DESC, block_number DESC' if model_type.lower() == 'realtime' - else 'ORDER BY partition_key ASC, block_number ASC' -%} -{%- set order_by_clause = var((model_name ~ '_' ~ model_type ~ '_order_by_clause').upper(), default_order) -%} -{%- set uses_receipts_by_hash = var('GLOBAL_USES_RECEIPTS_BY_HASH', false) -%} - -{%- set variables = { - 'node_url': node_url, - 'node_secret_path': node_secret_path, - 'model_quantum_state': model_quantum_state, - 'testing_limit': testing_limit, - 'new_build': new_build, - 'order_by_clause': order_by_clause, - 'uses_receipts_by_hash': uses_receipts_by_hash -} -%} - -{{ return(variables) }} - -{% endmacro %} - -{% macro set_default_variables_bronze(source_name, model_type) %} - -{%- set partition_function = var(source_name ~ model_type ~ '_PARTITION_FUNCTION', - "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 4), '_', 1) AS INTEGER)") --%} -{%- set partition_join_key = var(source_name ~ model_type ~ '_PARTITION_JOIN_KEY', 'partition_key') -%} -{%- set block_number = var(source_name ~ model_type ~ '_BLOCK_NUMBER', true) -%} -{%- set balances = var(source_name ~ model_type ~ '_BALANCES', false) -%} -{%- set uses_receipts_by_hash = var('GLOBAL_USES_RECEIPTS_BY_HASH', false) -%} - -{%- set variables = { - 'partition_function': partition_function, - 'partition_join_key': partition_join_key, - 'block_number': block_number, - 'balances': balances, - 'uses_receipts_by_hash': uses_receipts_by_hash -} -%} - -{{ return(variables) }} - -{% endmacro %} \ No newline at end of file diff --git a/macros/fsc_evm_temp/main_package/streamline/set_streamline_parameters.sql b/macros/fsc_evm_temp/main_package/streamline/set_streamline_parameters.sql deleted file mode 100644 index 6b6e5ff9..00000000 --- a/macros/fsc_evm_temp/main_package/streamline/set_streamline_parameters.sql +++ /dev/null @@ -1,60 +0,0 @@ -{% macro set_streamline_parameters(model_name, model_type, multiplier=1) %} - -{%- set rpc_config_details = { - "blocks_transactions": { - "method": 'eth_getBlockByNumber', - "method_params": 'ARRAY_CONSTRUCT(utils.udf_int_to_hex(block_number), TRUE)', - "exploded_key": ['result', 'result.transactions'] - }, - "receipts_by_hash": { - "method": 'eth_getTransactionReceipt', - "method_params": 'ARRAY_CONSTRUCT(tx_hash)' - }, - "receipts": { - "method": 'eth_getBlockReceipts', - "method_params": 'ARRAY_CONSTRUCT(utils.udf_int_to_hex(block_number))', - "exploded_key": ['result'], - "lambdas": 2 - - }, - "traces": { - "method": 'debug_traceBlockByNumber', - "method_params": "ARRAY_CONSTRUCT(utils.udf_int_to_hex(block_number), OBJECT_CONSTRUCT('tracer', 'callTracer', 'timeout', '120s'))", - "exploded_key": ['result'], - "lambdas": 2 - }, - "confirm_blocks": { - "method": 'eth_getBlockByNumber', - "method_params": 'ARRAY_CONSTRUCT(utils.udf_int_to_hex(block_number), FALSE)' - } -} -%} - -{%- set rpc_config = rpc_config_details[model_name.lower()] -%} - -{%- set params = { - "external_table": var((model_name ~ '_' ~ model_type ~ '_external_table').upper(), model_name.lower()), - "sql_limit": var((model_name ~ '_' ~ model_type ~ '_sql_limit').upper(), 2 * var('GLOBAL_BLOCKS_PER_HOUR',0) * multiplier), - "producer_batch_size": var((model_name ~ '_' ~ model_type ~ '_producer_batch_size').upper(), 2 * var('GLOBAL_BLOCKS_PER_HOUR',0) * multiplier), - "worker_batch_size": var( - (model_name ~ '_' ~ model_type ~ '_worker_batch_size').upper(), - (2 * var('GLOBAL_BLOCKS_PER_HOUR',0) * multiplier) // (rpc_config.get('lambdas', 1)) - ), - "sql_source": (model_name ~ '_' ~ model_type).lower(), - "method": rpc_config['method'], - "method_params": rpc_config['method_params'] -} -%} - -{%- if rpc_config.get('exploded_key') is not none -%} - {%- do params.update({"exploded_key": tojson(rpc_config['exploded_key'])}) -%} -{%- endif -%} - -{%- if rpc_config.get('lambdas') is not none -%} - {%- do params.update({"lambdas": rpc_config['lambdas']}) -%} -{%- endif -%} - -{{ return(params) }} - -{% endmacro %} - - - diff --git a/macros/grant_data_share_statement.sql b/macros/grant_data_share_statement.sql deleted file mode 100644 index eff53fe0..00000000 --- a/macros/grant_data_share_statement.sql +++ /dev/null @@ -1,7 +0,0 @@ -{% macro grant_data_share_statement(table_name, resource_type) %} - {% if target.database == 'ETHEREUM' %} - GRANT SELECT ON {{ resource_type }} ETHEREUM.CORE.{{ table_name }} TO SHARE "FLIPSIDE_ETHEREUM"; - {% else %} - select 1; -- hooks will error if they don't have valid SQL in them, this handles that! - {% endif %} -{% endmacro %} \ No newline at end of file diff --git a/macros/lookback.sql b/macros/lookback.sql deleted file mode 100644 index 129795b9..00000000 --- a/macros/lookback.sql +++ /dev/null @@ -1,12 +0,0 @@ -{% macro lookback() %} - {% if execute and is_incremental() %} - {% set query %} - SELECT - MAX(_inserted_timestamp) :: DATE - 3 - FROM - {{ this }}; -{% endset %} - {% set last_week = run_query(query).columns [0] [0] %} - {% do return(last_week) %} - {% endif %} -{% endmacro %} diff --git a/macros/sp_create_load_nft_metadata.sql b/macros/sp_create_load_nft_metadata.sql deleted file mode 100644 index 83ebd184..00000000 --- a/macros/sp_create_load_nft_metadata.sql +++ /dev/null @@ -1,32 +0,0 @@ -{% macro sp_create_load_nft_metadata() %} - {% if var("UPDATE_UDFS_AND_SPS") %} - {% set sql %} - CREATE OR REPLACE PROCEDURE silver.sp_run_load_nft_metadata() - RETURNS variant - LANGUAGE SQL - AS - $$ - DECLARE - RESULT VARCHAR; - row_cnt INTEGER; - BEGIN - row_cnt:= ( - SELECT - COUNT(1) - FROM - silver.nft_metadata_api_requests - ); - if ( - row_cnt > 0 - ) THEN RESULT:= ( - SELECT - silver.udf_load_nft_metadata() - ); - ELSE RESULT:= NULL; - END if; - RETURN RESULT; - END; - $${% endset %} - {% do run_query(sql) %} - {% endif %} -{% endmacro %} diff --git a/macros/fsc_evm_temp/_legacy/streamline_decoder_complete_v0.sql b/macros/streamline/bronze/streamline_decoder_complete_v0.sql similarity index 100% rename from macros/fsc_evm_temp/_legacy/streamline_decoder_complete_v0.sql rename to macros/streamline/bronze/streamline_decoder_complete_v0.sql diff --git a/macros/fsc_evm_temp/_legacy/streamline_external_table_query_v0.sql b/macros/streamline/bronze/streamline_external_table_query_v0.sql similarity index 89% rename from macros/fsc_evm_temp/_legacy/streamline_external_table_query_v0.sql rename to macros/streamline/bronze/streamline_external_table_query_v0.sql index 68219bb9..7f149971 100644 --- a/macros/fsc_evm_temp/_legacy/streamline_external_table_query_v0.sql +++ b/macros/streamline/bronze/streamline_external_table_query_v0.sql @@ -27,11 +27,11 @@ {% if block_number %}, COALESCE( - s.value :"BLOCK_NUMBER" :: INT, - s.metadata :request :"data" :id :: INT, - PARSE_JSON( + TRY_TO_NUMBER(s.value :"BLOCK_NUMBER" :: STRING), + TRY_TO_NUMBER(s.metadata :request :"data" :id :: STRING), + TRY_TO_NUMBER(PARSE_JSON( s.metadata :request :"data" - ) :id :: INT + ) :id :: STRING) ) AS block_number {% endif %} FROM @@ -48,8 +48,8 @@ JOIN {{ ref('_block_ranges') }} r ON r.block_number = COALESCE( - s.value :"BLOCK_NUMBER" :: INT, - s.value :"block_number" :: INT + TRY_TO_NUMBER(s.value :"BLOCK_NUMBER" :: STRING), + TRY_TO_NUMBER(s.value :"block_number" :: STRING) ) {% endif %} WHERE @@ -88,12 +88,12 @@ SELECT {% if block_number %}, COALESCE( - s.value :"BLOCK_NUMBER" :: INT, - s.value :"block_number" :: INT, - s.metadata :request :"data" :id :: INT, - PARSE_JSON( + TRY_TO_NUMBER(s.value :"BLOCK_NUMBER" :: STRING), + TRY_TO_NUMBER(s.value :"block_number" :: STRING), + TRY_TO_NUMBER(s.metadata :request :"data" :id :: STRING), + TRY_TO_NUMBER(PARSE_JSON( s.metadata :request :"data" - ) :id :: INT + ) :id :: STRING) ) AS block_number {% endif %} FROM @@ -110,8 +110,8 @@ FROM JOIN {{ ref('_block_ranges') }} r ON r.block_number = COALESCE( - s.value :"BLOCK_NUMBER" :: INT, - s.value :"block_number" :: INT + TRY_TO_NUMBER(s.value :"BLOCK_NUMBER" :: STRING), + TRY_TO_NUMBER(s.value :"block_number" :: STRING) ) {% endif %} WHERE diff --git a/macros/streamline/models.sql b/macros/streamline/models.sql deleted file mode 100644 index aaa1290f..00000000 --- a/macros/streamline/models.sql +++ /dev/null @@ -1,66 +0,0 @@ -{% macro decode_traces_history( - start, - stop - ) %} - -WITH look_back AS ( - - SELECT - block_number - FROM - {{ ref("_24_hour_lookback") }} -) -SELECT - t.block_number, - t.tx_hash, - t.trace_index, - _call_id, - A.abi AS abi, - A.function_name AS function_name, - CASE - WHEN TYPE = 'DELEGATECALL' THEN from_address - ELSE to_address - END AS abi_address, - t.input AS input, - COALESCE( - t.output, - '0x' - ) AS output -FROM - {{ ref("silver__traces") }} - t - INNER JOIN {{ ref("silver__complete_function_abis") }} A - ON A.parent_contract_address = abi_address - AND LEFT( - t.input, - 10 - ) = LEFT( - A.function_signature, - 10 - ) - AND t.block_number BETWEEN A.start_block - AND A.end_block -WHERE - (t.block_number BETWEEN {{ start }} AND {{ stop }}) - and t.block_number < ( - SELECT - block_number - FROM - look_back - ) - AND t.block_number IS NOT NULL - AND _call_id NOT IN ( - SELECT - _call_id - FROM - {{ ref("streamline__complete_decode_traces") }} - WHERE - (block_number BETWEEN {{ start }} AND {{ stop }}) - and block_number < ( - SELECT - block_number - FROM - look_back - )) - -{% endmacro %} \ No newline at end of file diff --git a/macros/streamline/run_decoded_traces_history.sql b/macros/streamline/run_decoded_traces_history.sql deleted file mode 100644 index 2f85e6b9..00000000 --- a/macros/streamline/run_decoded_traces_history.sql +++ /dev/null @@ -1,30 +0,0 @@ -{% macro run_decoded_traces_history() %} - -{% set blockchain = var('GLOBAL_PROD_DB_NAME','ethereum').lower() %} - -{% set check_for_new_user_abis_query %} - select 1 - from {{ ref('silver__user_verified_abis') }} - where _inserted_timestamp::date = sysdate()::date -{% endset %} - -{% set results = run_query(check_for_new_user_abis_query) %} - -{% if execute %} - {% set new_user_abis = results.columns[0].values()[0] %} - - {% if new_user_abis %} - {% set invoke_workflow_query %} - SELECT - github_actions.workflow_dispatches( - 'FlipsideCrypto', - '{{ blockchain }}' ~ '-models', - 'dbt_run_streamline_decoded_traces_history.yml', - NULL - ) - {% endset %} - - {% do run_query(invoke_workflow_query) %} - {% endif %} -{% endif %} -{% endmacro %} \ No newline at end of file diff --git a/macros/streamline/sp_get_beacon_blocks_history.sql b/macros/streamline/sp_get_beacon_blocks_history.sql deleted file mode 100644 index c986f01a..00000000 --- a/macros/streamline/sp_get_beacon_blocks_history.sql +++ /dev/null @@ -1,26 +0,0 @@ -{% macro create_sp_get_beacon_blocks_history() %} - {% set sql %} - CREATE - OR REPLACE PROCEDURE streamline.sp_get_beacon_blocks_history() returns variant LANGUAGE SQL AS $$ -DECLARE - RESULT variant; -row_cnt INTEGER; -BEGIN - row_cnt:= ( - SELECT - COUNT(1) - FROM - {{ ref('streamline__beacon_blocks_history') }} - ); -if ( - row_cnt > 0 - ) THEN RESULT:= ( - SELECT - streamline.udf_get_beacon_blocks() - ); - ELSE RESULT:= NULL; -END if; -RETURN RESULT; -END;$$ {% endset %} -{% do run_query(sql) %} -{% endmacro %} diff --git a/macros/streamline/sp_get_beacon_blocks_realtime.sql b/macros/streamline/sp_get_beacon_blocks_realtime.sql deleted file mode 100644 index e2437c0c..00000000 --- a/macros/streamline/sp_get_beacon_blocks_realtime.sql +++ /dev/null @@ -1,26 +0,0 @@ -{% macro create_sp_get_beacon_blocks_realtime() %} - {% set sql %} - CREATE - OR REPLACE PROCEDURE streamline.sp_get_beacon_blocks_realtime() returns variant LANGUAGE SQL AS $$ -DECLARE - RESULT variant; -row_cnt INTEGER; -BEGIN - row_cnt:= ( - SELECT - COUNT(1) - FROM - {{ ref('streamline__beacon_blocks_realtime') }} - ); -if ( - row_cnt > 0 - ) THEN RESULT:= ( - SELECT - streamline.udf_get_beacon_blocks() - ); - ELSE RESULT:= NULL; -END if; -RETURN RESULT; -END;$$ {% endset %} -{% do run_query(sql) %} -{% endmacro %} diff --git a/macros/streamline/sp_get_blocks_history.sql b/macros/streamline/sp_get_blocks_history.sql deleted file mode 100644 index ec02e054..00000000 --- a/macros/streamline/sp_get_blocks_history.sql +++ /dev/null @@ -1,26 +0,0 @@ -{% macro create_sp_get_blocks_history() %} - {% set sql %} - CREATE - OR REPLACE PROCEDURE streamline.sp_get_blocks_history() returns variant LANGUAGE SQL AS $$ -DECLARE - RESULT variant; -row_cnt INTEGER; -BEGIN - row_cnt:= ( - SELECT - COUNT(1) - FROM - {{ ref('streamline__blocks_history') }} - ); -if ( - row_cnt > 0 - ) THEN RESULT:= ( - SELECT - streamline.udf_get_blocks() - ); - ELSE RESULT:= NULL; -END if; -RETURN RESULT; -END;$$ {% endset %} -{% do run_query(sql) %} -{% endmacro %} diff --git a/macros/streamline/sp_get_blocks_realtime.sql b/macros/streamline/sp_get_blocks_realtime.sql deleted file mode 100644 index 4f95d2be..00000000 --- a/macros/streamline/sp_get_blocks_realtime.sql +++ /dev/null @@ -1,26 +0,0 @@ -{% macro create_sp_get_blocks_realtime() %} - {% set sql %} - CREATE - OR REPLACE PROCEDURE streamline.sp_get_blocks_realtime() returns variant LANGUAGE SQL AS $$ -DECLARE - RESULT variant; -row_cnt INTEGER; -BEGIN - row_cnt:= ( - SELECT - COUNT(1) - FROM - {{ ref('streamline__blocks_realtime') }} - ); -if ( - row_cnt > 0 - ) THEN RESULT:= ( - SELECT - streamline.udf_get_blocks() - ); - ELSE RESULT:= NULL; -END if; -RETURN RESULT; -END;$$ {% endset %} -{% do run_query(sql) %} -{% endmacro %} diff --git a/macros/streamline/sp_get_contract_abis_history.sql b/macros/streamline/sp_get_contract_abis_history.sql deleted file mode 100644 index c80d2716..00000000 --- a/macros/streamline/sp_get_contract_abis_history.sql +++ /dev/null @@ -1,26 +0,0 @@ -{% macro create_sp_get_contract_abis_history() %} - {% set sql %} - CREATE - OR REPLACE PROCEDURE streamline.sp_get_contract_abis_history() returns variant LANGUAGE SQL AS $$ -DECLARE - RESULT variant; -row_cnt INTEGER; -BEGIN - row_cnt:= ( - SELECT - COUNT(1) - FROM - {{ ref('streamline__contract_abis_history') }} - ); -if ( - row_cnt > 0 - ) THEN RESULT:= ( - SELECT - streamline.udf_get_contract_abis() - ); - ELSE RESULT:= NULL; -END if; -RETURN RESULT; -END;$$ {% endset %} -{% do run_query(sql) %} -{% endmacro %} diff --git a/macros/streamline/sp_get_contract_abis_realtime.sql b/macros/streamline/sp_get_contract_abis_realtime.sql deleted file mode 100644 index a713c571..00000000 --- a/macros/streamline/sp_get_contract_abis_realtime.sql +++ /dev/null @@ -1,26 +0,0 @@ -{% macro create_sp_get_contract_abis_realtime() %} - {% set sql %} - CREATE - OR REPLACE PROCEDURE streamline.sp_get_contract_abis_realtime() returns variant LANGUAGE SQL AS $$ -DECLARE - RESULT variant; -row_cnt INTEGER; -BEGIN - row_cnt:= ( - SELECT - COUNT(1) - FROM - {{ ref('streamline__contract_abis_realtime') }} - ); -if ( - row_cnt > 0 - ) THEN RESULT:= ( - SELECT - streamline.udf_get_contract_abis() - ); - ELSE RESULT:= NULL; -END if; -RETURN RESULT; -END;$$ {% endset %} -{% do run_query(sql) %} -{% endmacro %} diff --git a/macros/streamline/sp_get_contract_reads_history.sql b/macros/streamline/sp_get_contract_reads_history.sql deleted file mode 100644 index b86214dd..00000000 --- a/macros/streamline/sp_get_contract_reads_history.sql +++ /dev/null @@ -1,26 +0,0 @@ -{% macro create_sp_get_contract_reads_history() %} - {% set sql %} - CREATE - OR REPLACE PROCEDURE streamline.sp_get_contract_reads_history() returns variant LANGUAGE SQL AS $$ -DECLARE - RESULT variant; -row_cnt INTEGER; -BEGIN - row_cnt:= ( - SELECT - COUNT(1) - FROM - {{ ref('streamline__contract_reads_history') }} - ); -if ( - row_cnt > 0 - ) THEN RESULT:= ( - SELECT - streamline.udf_get_contract_reads() - ); - ELSE RESULT:= NULL; -END if; -RETURN RESULT; -END;$$ {% endset %} -{% do run_query(sql) %} -{% endmacro %} diff --git a/macros/streamline/sp_get_contract_reads_realtime.sql b/macros/streamline/sp_get_contract_reads_realtime.sql deleted file mode 100644 index 82144cdf..00000000 --- a/macros/streamline/sp_get_contract_reads_realtime.sql +++ /dev/null @@ -1,26 +0,0 @@ -{% macro create_sp_get_contract_reads_realtime() %} - {% set sql %} - CREATE - OR REPLACE PROCEDURE streamline.sp_get_contract_reads_realtime() returns variant LANGUAGE SQL AS $$ -DECLARE - RESULT variant; -row_cnt INTEGER; -BEGIN - row_cnt:= ( - SELECT - COUNT(1) - FROM - {{ ref('streamline__contract_reads_realtime') }} - ); -if ( - row_cnt > 0 - ) THEN RESULT:= ( - SELECT - streamline.udf_get_contract_reads() - ); - ELSE RESULT:= NULL; -END if; -RETURN RESULT; -END;$$ {% endset %} -{% do run_query(sql) %} -{% endmacro %} diff --git a/macros/streamline/sp_get_transactions_history.sql b/macros/streamline/sp_get_transactions_history.sql deleted file mode 100644 index e61db527..00000000 --- a/macros/streamline/sp_get_transactions_history.sql +++ /dev/null @@ -1,26 +0,0 @@ -{% macro create_sp_get_transactions_history() %} - {% set sql %} - CREATE - OR REPLACE PROCEDURE streamline.sp_get_transactions_history() returns variant LANGUAGE SQL AS $$ -DECLARE - RESULT variant; -row_cnt INTEGER; -BEGIN - row_cnt:= ( - SELECT - COUNT(1) - FROM - {{ ref('streamline__transactions_history') }} - ); -if ( - row_cnt > 0 - ) THEN RESULT:= ( - SELECT - streamline.udf_get_transactions() - ); - ELSE RESULT:= NULL; -END if; -RETURN RESULT; -END;$$ {% endset %} -{% do run_query(sql) %} -{% endmacro %} diff --git a/macros/streamline/sp_get_transactions_realtime.sql b/macros/streamline/sp_get_transactions_realtime.sql deleted file mode 100644 index cf9ce31e..00000000 --- a/macros/streamline/sp_get_transactions_realtime.sql +++ /dev/null @@ -1,26 +0,0 @@ -{% macro create_sp_get_transactions_realtime() %} - {% set sql %} - CREATE - OR REPLACE PROCEDURE streamline.sp_get_transactions_realtime() returns variant LANGUAGE SQL AS $$ -DECLARE - RESULT variant; -row_cnt INTEGER; -BEGIN - row_cnt:= ( - SELECT - COUNT(1) - FROM - {{ ref('streamline__transactions_realtime') }} - ); -if ( - row_cnt > 0 - ) THEN RESULT:= ( - SELECT - streamline.udf_get_transactions() - ); - ELSE RESULT:= NULL; -END if; -RETURN RESULT; -END;$$ {% endset %} -{% do run_query(sql) %} -{% endmacro %} diff --git a/macros/streamline/streamline_udfs.sql b/macros/streamline/streamline_udfs.sql deleted file mode 100644 index e85539f5..00000000 --- a/macros/streamline/streamline_udfs.sql +++ /dev/null @@ -1,203 +0,0 @@ -{% macro create_udf_get_token_balances() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_get_token_balances( - json variant - ) returns text api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/bulk_get_token_balances' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/bulk_get_token_balances' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_get_eth_balances() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_get_eth_balances( - json variant - ) returns text api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/bulk_get_eth_balances' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/bulk_get_eth_balances' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_get_reads() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_get_reads( - json variant - ) returns text api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/bulk_get_reads' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/bulk_get_reads' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_get_contract_abis() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_get_contract_abis() returns text api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/bulk_get_contract_abis' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/bulk_get_contract_abis' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_get_blocks() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_get_blocks( - json variant - ) returns text api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/bulk_get_blocks' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/bulk_get_blocks' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_get_transactions() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_get_transactions( - json variant - ) returns text api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/bulk_get_transactions' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/bulk_get_transactions' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_get_beacon_blocks() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_get_beacon_blocks( - json variant - ) returns text api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/bulk_get_beacon_blocks' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/bulk_get_beacon_blocks' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_get_chainhead() %} - CREATE EXTERNAL FUNCTION IF NOT EXISTS streamline.udf_get_chainhead() returns variant api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/get_chainhead' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/get_chainhead' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_get_beacon_chainhead() %} - CREATE EXTERNAL FUNCTION IF NOT EXISTS streamline.udf_get_beacon_chainhead() returns variant api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/get_beacon_chainhead' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/get_beacon_chainhead' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_call_eth_node() %} - CREATE EXTERNAL FUNCTION IF NOT EXISTS streamline.udf_json_rpc_call( - DATA ARRAY - ) returns variant api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/call_eth_node' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/call_eth_node' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_call_node() %} - CREATE EXTERNAL FUNCTION IF NOT EXISTS streamline.udf_call_node( - DATA ARRAY - ) returns variant api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/call_node' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/call_node' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_call_read_batching() %} - CREATE EXTERNAL FUNCTION IF NOT EXISTS streamline.udf_json_rpc_read_calls( - node_url VARCHAR, - headers OBJECT, - calls ARRAY - ) returns variant api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/call_read_batching' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/call_read_batching' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_api() %} - CREATE EXTERNAL FUNCTION IF NOT EXISTS streamline.udf_api( - method VARCHAR, - url VARCHAR, - headers OBJECT, - DATA OBJECT - ) returns variant api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/udf_api' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/udf_api' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_decode_array_string() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_decode( - abi ARRAY, - DATA STRING - ) returns ARRAY api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/decode_function' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/decode_function' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_decode_array_object() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_decode( - abi ARRAY, - DATA OBJECT - ) returns ARRAY api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/decode_log' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/decode_log' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_bulk_decode_logs() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_bulk_decode_logs( - json OBJECT - ) returns ARRAY api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/bulk_decode_logs' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/bulk_decode_logs' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_bulk_decode_traces() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_bulk_decode_traces( - json OBJECT - ) returns ARRAY api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/bulk_decode_traces' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/bulk_decode_traces' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_rest_api() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_rest_api( - json OBJECT - ) returns ARRAY api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/bulk_get_rest_api' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/bulk_get_rest_api' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_json_rpc() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_json_rpc( - json OBJECT - ) returns ARRAY api_integration = aws_ethereum_api AS {% if target.name == "prod" %} - 'https://e03pt6v501.execute-api.us-east-1.amazonaws.com/prod/bulk_get_json_rpc' - {% else %} - 'https://mryeusnrob.execute-api.us-east-1.amazonaws.com/dev/bulk_get_json_rpc' - {%- endif %}; -{% endmacro %} \ No newline at end of file diff --git a/macros/udf_load_nft_metadata.sql b/macros/udf_load_nft_metadata.sql deleted file mode 100644 index fd2ed66e..00000000 --- a/macros/udf_load_nft_metadata.sql +++ /dev/null @@ -1,8 +0,0 @@ -{% macro create_udf_load_nft_metadata() %} - CREATE - OR REPLACE EXTERNAL FUNCTION silver.udf_load_nft_metadata() returns text api_integration = aws_nft_metadata_api_dev AS {% if target.name == "prod" -%} - 'https://6gh4ncj0ig.execute-api.us-east-1.amazonaws.com/prod/bulk_load_nft_metadata/ethereum' - {% else %} - 'https://rtcsra1z35.execute-api.us-east-1.amazonaws.com/dev/bulk_load_nft_metadata/ethereum' - {%- endif %}; -{% endmacro %} diff --git a/macros/utils.sql b/macros/utils.sql deleted file mode 100644 index 14de2a46..00000000 --- a/macros/utils.sql +++ /dev/null @@ -1,78 +0,0 @@ -{% macro if_data_call_function( - func, - target - ) %} - {% if var( - "STREAMLINE_INVOKE_STREAMS" - ) %} - {% if execute %} - {{ log( - "Running macro `if_data_call_function`: Calling udf " ~ func ~ " on " ~ target, - True - ) }} - {% endif %} - SELECT - {{ func }} - WHERE - EXISTS( - SELECT - 1 - FROM - {{ target }} - LIMIT - 1 - ) - {% else %} - {% if execute %} - {{ log( - "Running macro `if_data_call_function`: NOOP", - False - ) }} - {% endif %} - SELECT - NULL - {% endif %} -{% endmacro %} - -{% macro if_data_call_wait() %} - {% if var( - "STREAMLINE_INVOKE_STREAMS" - ) %} - {% set query %} - SELECT - 1 - WHERE - EXISTS( - SELECT - 1 - FROM - {{ model.schema ~ "." ~ model.alias }} - LIMIT - 1 - ) {% endset %} - {% if execute %} - {% set results = run_query( - query - ) %} - {% if results %} - {{ log( - "Waiting...", - info = True - ) }} - - {% set wait_query %} - SELECT - system$wait( - {{ var( - "WAIT", - 600 - ) }} - ) {% endset %} - {% do run_query(wait_query) %} - {% else %} - SELECT - NULL; - {% endif %} - {% endif %} - {% endif %} -{% endmacro %} \ No newline at end of file diff --git a/models/doc_descriptions/general/__overview__.md b/models/__overview__.md similarity index 83% rename from models/doc_descriptions/general/__overview__.md rename to models/__overview__.md index c49720c9..cf9e26f6 100644 --- a/models/doc_descriptions/general/__overview__.md +++ b/models/__overview__.md @@ -31,13 +31,10 @@ There is more information on how to use dbt docs in the last section of this doc **Fact Tables:** - [fact_blocks](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.core__fact_blocks) -- [fact_contract_reads](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.core__fact_contract_reads) -- [fact_decoded_event_logs](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.core__fact_decoded_event_logs) - [fact_decoded_traces](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.core__fact_decoded_traces) - [fact_eth_balances](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.core__fact_eth_balances) - [fact_event_logs](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.core__fact_event_logs) - [fact_token_balances](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.core__fact_token_balances) -- [fact_token_transfers](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.core__fact_token_transfers) - [fact_traces](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.core__fact_traces) - [fact_transactions](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.core__fact_transactions) @@ -74,7 +71,6 @@ There is more information on how to use dbt docs in the last section of this doc ### NFT Tables (ethereum.nft) - [dim_nft_collection_metadata](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.nft__dim_nft_collection_metadata) -- [ez_nft_mints](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.nft__ez_nft_mints) - [ez_nft_sales](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.nft__ez_nft_sales) - [ez_nft_transfers](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.nft__ez_nft_transfers) - [ez_lending_liquidations](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.nft__ez_lending_liquidations) @@ -87,18 +83,6 @@ There is more information on how to use dbt docs in the last section of this doc - [ez_core_metrics_hourly](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.stats__ez_core_metrics_hourly) -### Aave Tables (ethereum.aave) - -- [ez_borrows](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.aave__ez_borrows) -- [ez_deposits](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.aave__ez_deposits) -- [ez_flashloans](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.aave__ez_flashloans) -- [ez_liquidations](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.aave__ez_liquidations) -- [ez_market_stats](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.aave__ez_market_stats) -- [ez_proposals](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.aave__ez_proposals) -- [ez_repayments](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.aave__ez_repayments) -- [ez_votes](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.aave__ez_votes) -- [ez_withdraws](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.aave__ez_withdraws) - ### Beacon Chain Tables (ethereum.beacon_chain) - [fact_blocks](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.beacon_chain__fact_blocks) @@ -119,17 +103,6 @@ There is more information on how to use dbt docs in the last section of this doc - [fact_renewals](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.ens__fact_renewals) - [fact_transfers](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.ens__fact_transfers) -### Maker Tables (ethereum.maker) - -- [ez_delegations](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.maker__ez_delegations) -- [ez_deposits](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.maker__ez_deposits) -- [ez_flash_loans](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.maker__ez_flash_loans) -- [ez_governance_votes](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.maker__ez_governance_votes) -- [ez_liquidations](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.maker__ez_liquidations) -- [ez_repayments](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.maker__ez_repayments) -- [ez_vault_creation](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.maker__ez_vault_creation) -- [ez_withdrawals](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.maker__ez_withdrawals) - ### Uniswap v3 Tables (ethereum.uniswapv3) - [ez_lp_actions](https://flipsidecrypto.github.io/ethereum-models/#!/model/model.ethereum_models.uniswapv3__ez_lp_actions) diff --git a/models/beacon_chain/gold/beacon_chain__ez_deposits.sql b/models/beacon_chain/gold/beacon_chain__ez_deposits.sql index c7a9bf6d..fc60b863 100644 --- a/models/beacon_chain/gold/beacon_chain__ez_deposits.sql +++ b/models/beacon_chain/gold/beacon_chain__ez_deposits.sql @@ -2,7 +2,8 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'DEFI' } } } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'DEFI' } } }, + tags = ['gold','beacon','ez'] ) }} SELECT diff --git a/models/beacon_chain/gold/beacon_chain__ez_deposits.yml b/models/beacon_chain/gold/beacon_chain__ez_deposits.yml index b99dfd95..d321929e 100644 --- a/models/beacon_chain/gold/beacon_chain__ez_deposits.yml +++ b/models/beacon_chain/gold/beacon_chain__ez_deposits.yml @@ -4,11 +4,11 @@ models: description: This convenience table contains information about the deposits made to the beacon chain, alongside address labels for analysis purposes. Deposit activity in this table is derived from the `DepositEvent` on the `BeaconDepositContract - 0x00000000219ab540356cbb839cbe05303d7705fa` in `ethereum.core.fact_event_logs`. For more info, please visit [The Ethereum Organization](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/). columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_tx_hash") }}' + description: '{{ doc("evm_tx_hash") }}' - name: EVENT_INDEX description: The index of the deposit event within the transaction. - name: DEPOSIT_AMOUNT @@ -40,8 +40,8 @@ models: - name: DEPOSIT_INDEX description: The index of the deposit. - name: EZ_DEPOSITS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/beacon_chain/gold/beacon_chain__ez_withdrawals.sql b/models/beacon_chain/gold/beacon_chain__ez_withdrawals.sql index 9f3f9b83..3e322b12 100644 --- a/models/beacon_chain/gold/beacon_chain__ez_withdrawals.sql +++ b/models/beacon_chain/gold/beacon_chain__ez_withdrawals.sql @@ -2,7 +2,8 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'DEFI' } } } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'DEFI' } } }, + tags = ['gold','beacon','ez'] ) }} SELECT diff --git a/models/beacon_chain/gold/beacon_chain__ez_withdrawals.yml b/models/beacon_chain/gold/beacon_chain__ez_withdrawals.yml index 61025c05..d33b8821 100644 --- a/models/beacon_chain/gold/beacon_chain__ez_withdrawals.yml +++ b/models/beacon_chain/gold/beacon_chain__ez_withdrawals.yml @@ -4,11 +4,11 @@ models: description: This convenience table contains information about the withdrawals made from the beacon chain, alongside address labels for analysis purposes. Withdrawal activity in this table is derived directly from the `withdrawals` object in the `eth_getBlockByNumber` Ethereum JSON-RPC Method, where block_number represents the block on Ethereum Mainnet and slot_number corresponds to the Beacon Chain slot that the withdrawal was executed in. For more info, please visit [The Ethereum Organization](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/). columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: BLOCK_HASH - description: '{{ doc("eth_blocks_hash") }}' + description: '{{ doc("evm_blocks_hash") }}' - name: WITHDRAWAL_AMOUNT description: The amount of the withdrawal. - name: WITHDRAWAL_ADDRESS @@ -26,12 +26,12 @@ models: - name: VALIDATOR_INDEX description: The index of the validator associated with the withdrawal. - name: SLOT_NUMBER - description: '{{ doc("eth_slot_number") }}' + description: '{{ doc("evm_slot_number") }}' - name: EPOCH_NUMBER - description: '{{ doc("eth_epoch_number") }}' + description: '{{ doc("evm_epoch_number") }}' - name: EZ_WITHDRAWALS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/beacon_chain/gold/beacon_chain__fact_attestations.sql b/models/beacon_chain/gold/beacon_chain__fact_attestations.sql index 5d7cf3c0..ac49d49b 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_attestations.sql +++ b/models/beacon_chain/gold/beacon_chain__fact_attestations.sql @@ -1,7 +1,8 @@ {{ config( materialized = 'view', persist_docs ={ "relation": true, - "columns": true } + "columns": true }, + tags = ['gold','beacon'] ) }} SELECT diff --git a/models/beacon_chain/gold/beacon_chain__fact_attestations.yml b/models/beacon_chain/gold/beacon_chain__fact_attestations.yml index 884055ec..d9b23c82 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_attestations.yml +++ b/models/beacon_chain/gold/beacon_chain__fact_attestations.yml @@ -1,15 +1,15 @@ version: 2 models: - name: beacon_chain__fact_attestations - description: '{{ doc("attestations_table_doc") }}' + description: '{{ doc("evm_attestations_table_doc") }}' columns: - name: SLOT_NUMBER - description: '{{ doc("eth_slot_number") }}' + description: '{{ doc("evm_slot_number") }}' - name: SLOT_TIMESTAMP - description: '{{ doc("eth_slot_timestamp") }}' + description: '{{ doc("evm_slot_timestamp") }}' - name: EPOCH_NUMBER - description: '{{ doc("eth_epoch_number") }}' + description: '{{ doc("evm_epoch_number") }}' - name: ATTESTATION_SLOT description: 'The slot number in which the validator is attesting on' - name: ATTESTATION_INDEX @@ -29,8 +29,8 @@ models: - name: ATTESTATION_SIGNATURE description: 'A BLS signature that aggregates the signatures of individual validators' - name: FACT_ATTESTATIONS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/beacon_chain/gold/beacon_chain__fact_blob_sidecars.sql b/models/beacon_chain/gold/beacon_chain__fact_blob_sidecars.sql index 27cf5d46..dfe02978 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_blob_sidecars.sql +++ b/models/beacon_chain/gold/beacon_chain__fact_blob_sidecars.sql @@ -1,7 +1,8 @@ {{ config( materialized = 'view', persist_docs ={ "relation": true, - "columns": true } + "columns": true }, + tags = ['gold','beacon'] ) }} SELECT diff --git a/models/beacon_chain/gold/beacon_chain__fact_blob_sidecars.yml b/models/beacon_chain/gold/beacon_chain__fact_blob_sidecars.yml index 78332e1a..056e31e9 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_blob_sidecars.yml +++ b/models/beacon_chain/gold/beacon_chain__fact_blob_sidecars.yml @@ -27,8 +27,8 @@ models: - name: SIGNATURE description: The signature hash of the message object. - name: FACT_BLOB_SIDECAR_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/beacon_chain/gold/beacon_chain__fact_blocks.sql b/models/beacon_chain/gold/beacon_chain__fact_blocks.sql index 0e45edf9..b7ff5c26 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_blocks.sql +++ b/models/beacon_chain/gold/beacon_chain__fact_blocks.sql @@ -1,7 +1,8 @@ {{ config( materialized = 'view', persist_docs ={ "relation": true, - "columns": true } + "columns": true }, + tags = ['gold','beacon'] ) }} SELECT diff --git a/models/beacon_chain/gold/beacon_chain__fact_blocks.yml b/models/beacon_chain/gold/beacon_chain__fact_blocks.yml index 252fd2c6..727742c4 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_blocks.yml +++ b/models/beacon_chain/gold/beacon_chain__fact_blocks.yml @@ -1,15 +1,15 @@ version: 2 models: - name: beacon_chain__fact_blocks - description: '{{ doc("beacon_blocks_table_doc") }}' + description: '{{ doc("evm_beacon_blocks_table_doc") }}' columns: - name: SLOT_NUMBER - description: '{{ doc("eth_slot_number") }}' + description: '{{ doc("evm_slot_number") }}' - name: EPOCH_NUMBER - description: '{{ doc("eth_epoch_number") }}' + description: '{{ doc("evm_epoch_number") }}' - name: SLOT_TIMESTAMP - description: '{{ doc("eth_slot_timestamp") }}' + description: '{{ doc("evm_slot_timestamp") }}' - name: PROPOSER_INDEX description: 'Index of the validator that proposed the block for the slot.' - name: PARENT_ROOT @@ -49,10 +49,10 @@ models: - name: EXCESS_BLOB_GAS description: A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing. - name: FACT_BLOCKS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' - name: BLOCK_INCLUDED description: 'Boolean flag that indicates whether a block was included for a specific slot, TRUE, or if it is missing/skipped/forked, FALSE.' diff --git a/models/beacon_chain/gold/beacon_chain__fact_deposits.sql b/models/beacon_chain/gold/beacon_chain__fact_deposits.sql index 9eca473c..94386e63 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_deposits.sql +++ b/models/beacon_chain/gold/beacon_chain__fact_deposits.sql @@ -1,7 +1,8 @@ {{ config( materialized = 'view', persist_docs ={ "relation": true, - "columns": true } + "columns": true }, + tags = ['gold','beacon'] ) }} SELECT diff --git a/models/beacon_chain/gold/beacon_chain__fact_deposits.yml b/models/beacon_chain/gold/beacon_chain__fact_deposits.yml index 3d0bf5b5..2e74fa44 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_deposits.yml +++ b/models/beacon_chain/gold/beacon_chain__fact_deposits.yml @@ -1,15 +1,15 @@ version: 2 models: - name: beacon_chain__fact_deposits - description: '{{ doc("beacon_deposits_table_doc") }}' + description: '{{ doc("evm_beacon_deposits_table_doc") }}' columns: - name: SLOT_NUMBER - description: '{{ doc("eth_slot_number") }}' + description: '{{ doc("evm_slot_number") }}' - name: SLOT_TIMESTAMP - description: '{{ doc("eth_slot_timestamp") }}' + description: '{{ doc("evm_slot_timestamp") }}' - name: EPOCH_NUMBER - description: '{{ doc("eth_epoch_number") }}' + description: '{{ doc("evm_epoch_number") }}' - name: DEPOSIT_AMOUNT description: 'Decimal adjusted Ether deposit amount.' - name: PUBKEY @@ -21,8 +21,8 @@ models: - name: PROOFS description: 'The merkle path to the deposit root. In other words, the merkle proof against the current state.eth1_data.root in the BeaconState. Note that the + 1 in the vector length is due to the SSZ length mixed into the root.' - name: FACT_DEPOSITS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/beacon_chain/gold/beacon_chain__fact_validator_balances.sql b/models/beacon_chain/gold/beacon_chain__fact_validator_balances.sql index ea25c68f..b640d0b6 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_validator_balances.sql +++ b/models/beacon_chain/gold/beacon_chain__fact_validator_balances.sql @@ -1,7 +1,8 @@ {{ config( materialized = 'view', persist_docs ={ "relation": true, - "columns": true } + "columns": true }, + tags = ['gold','beacon'] ) }} SELECT diff --git a/models/beacon_chain/gold/beacon_chain__fact_validator_balances.yml b/models/beacon_chain/gold/beacon_chain__fact_validator_balances.yml index e34f2564..34029ba8 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_validator_balances.yml +++ b/models/beacon_chain/gold/beacon_chain__fact_validator_balances.yml @@ -1,13 +1,13 @@ version: 2 models: - name: beacon_chain__fact_validator_balances - description: '{{ doc("beacon_validator_balances_table_doc") }}' + description: '{{ doc("evm_beacon_validator_balances_table_doc") }}' columns: - name: BLOCK_NUMBER description: Deprecating soon! The name of this column will be replaced with slot_number. The values remain the same and are currently accurate, representative of the Beacon Chain Slot Number. Please migrate queries to the new column by 11/13/23. - name: SLOT_NUMBER - description: '{{ doc("eth_slot_number") }}' + description: '{{ doc("evm_slot_number") }}' - name: STATE_ID description: 'The hash-tree-root of the BeaconState.' - name: INDEX @@ -15,8 +15,8 @@ models: - name: BALANCE description: 'Balance of Validator' - name: FACT_VALIDATOR_BALANCES_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/beacon_chain/gold/beacon_chain__fact_validators.sql b/models/beacon_chain/gold/beacon_chain__fact_validators.sql index bee3eb54..5120a6f7 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_validators.sql +++ b/models/beacon_chain/gold/beacon_chain__fact_validators.sql @@ -1,7 +1,8 @@ {{ config( materialized = 'view', persist_docs ={ "relation": true, - "columns": true } + "columns": true }, + tags = ['gold','beacon'] ) }} SELECT diff --git a/models/beacon_chain/gold/beacon_chain__fact_validators.yml b/models/beacon_chain/gold/beacon_chain__fact_validators.yml index ca959068..d0b7c685 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_validators.yml +++ b/models/beacon_chain/gold/beacon_chain__fact_validators.yml @@ -1,13 +1,13 @@ version: 2 models: - name: beacon_chain__fact_validators - description: '{{ doc("beacon_validators_doc") }}' + description: '{{ doc("evm_beacon_validators_doc") }}' columns: - name: BLOCK_NUMBER description: Deprecating soon! The name of this column will be replaced with slot_number. The values remain the same and are currently accurate, representative of the Beacon Chain Slot Number. Please migrate queries to the new column by 11/13/23. - name: SLOT_NUMBER - description: '{{ doc("eth_slot_number") }}' + description: '{{ doc("evm_slot_number") }}' - name: STATE_ID description: 'The hash-tree-root of the BeaconState.' - name: INDEX @@ -19,11 +19,11 @@ models: - name: ACTIVATION_ELIGIBILITY_EPOCH description: 'Refers to pending validators. The deposit has been recognized by the ETH2 chain at the timestamp of “Eligible for activation”. If there is a queue of pending validators, an estimated timestamp for activation is calculated' - name: ACTIVATION_EPOCH - description: '{{ doc("eth_epoch_number") }}' + description: '{{ doc("evm_epoch_number") }}' - name: EFFECTIVE_BALANCE description: 'The effective Balance represents a value calculated by the current balance. It is used to determine the size of a reward or penalty a validator receives. The effective balance can **never be higher than 32 ETH.' - name: EXIT_EPOCH - description: '{{ doc("eth_epoch_number") }}' + description: '{{ doc("evm_epoch_number") }}' - name: PUBKEY description: 'Validator public key.' - name: SLASHED @@ -35,8 +35,8 @@ models: - name: VALIDATOR_DETAILS description: 'Information about the validator' - name: FACT_VALIDATORS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/beacon_chain/gold/beacon_chain__fact_withdrawals.sql b/models/beacon_chain/gold/beacon_chain__fact_withdrawals.sql index 1c0d351b..4e7d15aa 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_withdrawals.sql +++ b/models/beacon_chain/gold/beacon_chain__fact_withdrawals.sql @@ -1,7 +1,8 @@ {{ config( materialized = 'view', persist_docs ={ "relation": true, - "columns": true } + "columns": true }, + tags = ['gold','beacon'] ) }} SELECT diff --git a/models/beacon_chain/gold/beacon_chain__fact_withdrawals.yml b/models/beacon_chain/gold/beacon_chain__fact_withdrawals.yml index cebba177..468b9dff 100644 --- a/models/beacon_chain/gold/beacon_chain__fact_withdrawals.yml +++ b/models/beacon_chain/gold/beacon_chain__fact_withdrawals.yml @@ -5,11 +5,11 @@ models: columns: - name: SLOT_NUMBER - description: '{{ doc("eth_slot_number") }}' + description: '{{ doc("evm_slot_number") }}' - name: SLOT_TIMESTAMP - description: '{{ doc("eth_slot_timestamp") }}' + description: '{{ doc("evm_slot_timestamp") }}' - name: EPOCH_NUMBER - description: '{{ doc("eth_epoch_number") }}' + description: '{{ doc("evm_epoch_number") }}' - name: WITHDRAWAL_AMOUNT description: The amount of ETH that was withdrawn from the beacon chain. - name: WITHDRAWAL_ADDRESS @@ -19,8 +19,8 @@ models: - name: VALIDATOR_INDEX description: The index of the validator that made the withdrawal. - name: FACT_WITHDRAWALS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/beacon_chain/silver/silver__beacon_attestations.sql b/models/beacon_chain/silver/silver__beacon_attestations.sql index 095c3507..2f2176cb 100644 --- a/models/beacon_chain/silver/silver__beacon_attestations.sql +++ b/models/beacon_chain/silver/silver__beacon_attestations.sql @@ -4,7 +4,7 @@ cluster_by = ['slot_timestamp::date'], merge_exclude_columns = ["inserted_timestamp"], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(aggregation_bits,beacon_block_root,source_root,target_root,attestation_signature)", - tags = ['beacon'] + tags = ['silver','beacon'] ) }} SELECT diff --git a/models/beacon_chain/silver/silver__beacon_blocks.sql b/models/beacon_chain/silver/silver__beacon_blocks.sql index c7913a21..4022dc70 100644 --- a/models/beacon_chain/silver/silver__beacon_blocks.sql +++ b/models/beacon_chain/silver/silver__beacon_blocks.sql @@ -6,7 +6,7 @@ post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(slot_number,parent_root,state_root,randao_reveal,graffiti,eth1_block_hash,eth1_deposit_root,signature,block_included)", incremental_predicates = ["dynamic_range", "slot_number"], full_refresh = false, - tags = ['beacon'] + tags = ['silver','beacon'] ) }} SELECT diff --git a/models/beacon_chain/silver/silver__beacon_deposits.sql b/models/beacon_chain/silver/silver__beacon_deposits.sql index 544807b9..0003bfce 100644 --- a/models/beacon_chain/silver/silver__beacon_deposits.sql +++ b/models/beacon_chain/silver/silver__beacon_deposits.sql @@ -4,7 +4,7 @@ cluster_by = ['slot_timestamp::date'], merge_exclude_columns = ["inserted_timestamp"], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(pubkey,signature,withdrawal_credentials)", - tags = ['beacon'] + tags = ['silver','beacon'] ) }} WITH beacon_blocks AS ( diff --git a/models/beacon_chain/silver/silver__beacon_validators.sql b/models/beacon_chain/silver/silver__beacon_validators.sql index c1515c1e..d54753d1 100644 --- a/models/beacon_chain/silver/silver__beacon_validators.sql +++ b/models/beacon_chain/silver/silver__beacon_validators.sql @@ -6,7 +6,7 @@ cluster_by = "ROUND(block_number, -3)", post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(id, state_id, pubkey, slashed, withdrawal_credentials)", incremental_predicates = ["dynamic_range", "block_number"], - tags = ['beacon'] + tags = ['silver','beacon'] ) }} SELECT diff --git a/models/beacon_chain/silver/silver__beacon_withdrawals.sql b/models/beacon_chain/silver/silver__beacon_withdrawals.sql index a28a56ee..dfe9482b 100644 --- a/models/beacon_chain/silver/silver__beacon_withdrawals.sql +++ b/models/beacon_chain/silver/silver__beacon_withdrawals.sql @@ -4,7 +4,7 @@ cluster_by = ['slot_timestamp::date'], merge_exclude_columns = ["inserted_timestamp"], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(address)", - tags = ['beacon'] + tags = ['silver','beacon'] ) }} SELECT diff --git a/models/beacon_chain/silver/silver__blob_sidecars.sql b/models/beacon_chain/silver/silver__blob_sidecars.sql index 8a618708..81367b71 100644 --- a/models/beacon_chain/silver/silver__blob_sidecars.sql +++ b/models/beacon_chain/silver/silver__blob_sidecars.sql @@ -5,7 +5,7 @@ cluster_by = "ROUND(slot_number, -3)", merge_exclude_columns = ["inserted_timestamp"], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(blob,kzg_commitment,kzg_proof,body_root,parent_root,state_root,signature)", - tags = ['beacon'] + tags = ['silver','beacon'] ) }} WITH old_base AS ( diff --git a/models/beacon_chain/silver/silver__eth_staking_deposits.sql b/models/beacon_chain/silver/silver__eth_staking_deposits.sql index 9ac7e8b0..23fece42 100644 --- a/models/beacon_chain/silver/silver__eth_staking_deposits.sql +++ b/models/beacon_chain/silver/silver__eth_staking_deposits.sql @@ -4,7 +4,7 @@ unique_key = "block_number", cluster_by = "block_timestamp::date", post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, depositor, deposit_address, platform_address, contract_address, pubkey, withdrawal_credentials, withdrawal_type, withdrawal_address, signature), SUBSTRING(depositor, deposit_address, platform_address, withdrawal_type)", - tags = ['beacon','reorg'] + tags = ['silver','beacon'] ) }} WITH deposit_evt AS ( diff --git a/models/beacon_chain/silver/silver__eth_staking_withdrawals.sql b/models/beacon_chain/silver/silver__eth_staking_withdrawals.sql index e0b0c11f..ee9a176d 100644 --- a/models/beacon_chain/silver/silver__eth_staking_withdrawals.sql +++ b/models/beacon_chain/silver/silver__eth_staking_withdrawals.sql @@ -4,7 +4,7 @@ cluster_by = "block_timestamp::date", merge_exclude_columns = ["inserted_timestamp"], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(block_hash,withdrawal_address,withdrawals_root), SUBSTRING(withdrawal_address)", - tags = ['beacon'] + tags = ['silver','beacon'] ) }} WITH withdrawal_blocks AS ( diff --git a/models/bronze/api_udf/contracts/bronze_api__contract_reads.sql b/models/bronze/api_udf/contracts/bronze_api__contract_reads.sql deleted file mode 100644 index 9240c999..00000000 --- a/models/bronze/api_udf/contracts/bronze_api__contract_reads.sql +++ /dev/null @@ -1,130 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'contract_address', - full_refresh = false, - tags = ['non_realtime'] -) }} - -WITH base AS ( - - SELECT - contract_address, - latest_event_block AS latest_block - FROM - {{ ref('silver__relevant_contracts') }} - WHERE - total_event_count >= 25 - -{% if is_incremental() %} -AND contract_address NOT IN ( - SELECT - contract_address - FROM - {{ this }} -) -{% endif %} -ORDER BY - total_event_count DESC -LIMIT - 500 -), function_sigs AS ( - SELECT - '0x313ce567' AS function_sig, - 'decimals' AS function_name - UNION - SELECT - '0x06fdde03', - 'name' - UNION - SELECT - '0x95d89b41', - 'symbol' -), -all_reads AS ( - SELECT - * - FROM - base - JOIN function_sigs - ON 1 = 1 -), -ready_reads AS ( - SELECT - contract_address, - latest_block, - function_sig, - RPAD( - function_sig, - 64, - '0' - ) AS input, - utils.udf_json_rpc_call( - 'eth_call', - [{'to': contract_address, 'from': null, 'data': input}, utils.udf_int_to_hex(latest_block)], - concat_ws( - '-', - contract_address, - input, - latest_block - ) - ) AS rpc_request - FROM - all_reads -), -batch_reads AS ( - SELECT - ARRAY_AGG(rpc_request) AS batch_rpc_request - FROM - ready_reads -), -node_call AS ( - SELECT - *, - live.udf_api( - 'POST', - CONCAT( - '{service}', - '/', - '{Authentication}' - ),{}, - batch_rpc_request, - 'Vault/prod/ethereum/quicknode/mainnet' - ) AS response - FROM - batch_reads - WHERE - EXISTS ( - SELECT - 1 - FROM - ready_reads - LIMIT - 1 - ) -), flat_responses AS ( - SELECT - VALUE :id :: STRING AS call_id, - VALUE :result :: STRING AS read_result - FROM - node_call, - LATERAL FLATTEN ( - input => response :data - ) -) -SELECT - SPLIT_PART( - call_id, - '-', - 1 - ) AS contract_address, - SPLIT_PART( - call_id, - '-', - 3 - ) AS block_number, - LEFT(SPLIT_PART(call_id, '-', 2), 10) AS function_sig, - NULL AS function_input, - read_result, - SYSDATE() :: TIMESTAMP AS _inserted_timestamp -FROM - flat_responses diff --git a/models/bronze/api_udf/contracts/bronze_api__contract_reads.yml b/models/bronze/api_udf/contracts/bronze_api__contract_reads.yml deleted file mode 100644 index 5a22c4bb..00000000 --- a/models/bronze/api_udf/contracts/bronze_api__contract_reads.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: 2 -models: - - name: bronze_api__contract_reads - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - CONTRACT_ADDRESS - - FUNCTION_SIG - - columns: - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ \ No newline at end of file diff --git a/models/bronze/labels/bronze__labels.sql b/models/bronze/labels/bronze__labels.sql deleted file mode 100644 index f8a9c94d..00000000 --- a/models/bronze/labels/bronze__labels.sql +++ /dev/null @@ -1,25 +0,0 @@ -{{ config( - materialized = 'view' -) }} - -SELECT - system_created_at, - insert_date, - blockchain, - address, - creator, - label_type, - label_subtype, - address_name, - project_name, - _is_deleted, - modified_timestamp, - labels_combined_id -FROM - {{ source( - 'crosschain_silver', - 'labels_combined' - ) }} -WHERE - blockchain = 'ethereum' - AND address LIKE '0x%' diff --git a/models/bronze/api_udf/nft/bronze_api__nft_metadata_list_backdoor.sql b/models/bronze/nft/bronze_api__nft_metadata_list_backdoor.sql similarity index 100% rename from models/bronze/api_udf/nft/bronze_api__nft_metadata_list_backdoor.sql rename to models/bronze/nft/bronze_api__nft_metadata_list_backdoor.sql diff --git a/models/bronze/api_udf/nft/bronze_api__nft_metadata_list_filter.sql b/models/bronze/nft/bronze_api__nft_metadata_list_filter.sql similarity index 96% rename from models/bronze/api_udf/nft/bronze_api__nft_metadata_list_filter.sql rename to models/bronze/nft/bronze_api__nft_metadata_list_filter.sql index 3f891915..1098513d 100644 --- a/models/bronze/api_udf/nft/bronze_api__nft_metadata_list_filter.sql +++ b/models/bronze/nft/bronze_api__nft_metadata_list_filter.sql @@ -1,13 +1,13 @@ {{ config( materialized = 'table', unique_key = 'nft_address', - tags = ['nft_list'] + tags = ['bronze','nft','nft_list'] ) }} WITH daily_trending_list AS ( SELECT - nft_address, + contract_address AS nft_address, SUM(price_usd) AS sale_usd FROM {{ ref('nft__ez_nft_sales') }} @@ -42,7 +42,7 @@ mints AS ( nft_address, COUNT(1) AS mint_count FROM - {{ ref('nft__ez_nft_mints') }} + {{ ref('silver__nft_mints') }} WHERE nft_address IN ( SELECT diff --git a/models/bronze/api_udf/nft/bronze_api__nft_metadata_list_request.sql b/models/bronze/nft/bronze_api__nft_metadata_list_request.sql similarity index 95% rename from models/bronze/api_udf/nft/bronze_api__nft_metadata_list_request.sql rename to models/bronze/nft/bronze_api__nft_metadata_list_request.sql index 6226ee05..61475d50 100644 --- a/models/bronze/api_udf/nft/bronze_api__nft_metadata_list_request.sql +++ b/models/bronze/nft/bronze_api__nft_metadata_list_request.sql @@ -1,7 +1,7 @@ {{ config( materialized = 'incremental', unique_key = 'collection_page', - tags = ['nft_list'] + tags = ['bronze','nft','nft_list'] ) }} WITH nft_list AS ( @@ -43,14 +43,14 @@ nft_mints AS ( SELECT nft_address, COUNT( - DISTINCT tokenid + DISTINCT tokenId ) AS mint_count, 1 AS start_page, CEIL( mint_count / 100 ) AS end_page FROM - {{ ref('nft__ez_nft_mints') }} + {{ ref('silver__nft_mints') }} INNER JOIN nft_list USING (nft_address) GROUP BY nft_address diff --git a/models/bronze/api_udf/nft/bronze_api__nft_metadata_reads_new.sql b/models/bronze/nft/bronze_api__nft_metadata_reads_new.sql similarity index 96% rename from models/bronze/api_udf/nft/bronze_api__nft_metadata_reads_new.sql rename to models/bronze/nft/bronze_api__nft_metadata_reads_new.sql index a1a83278..1fd47b54 100644 --- a/models/bronze/api_udf/nft/bronze_api__nft_metadata_reads_new.sql +++ b/models/bronze/nft/bronze_api__nft_metadata_reads_new.sql @@ -1,7 +1,7 @@ {{ config( materialized = 'incremental', unique_key = 'collection_page', - tags = ['nft_reads'], + tags = ['bronze','nft','nft_reads'], full_refresh = false ) }} diff --git a/models/bronze/api_udf/nft/original_500_collection/bronze_api__nft_metadata_list.sql b/models/bronze/nft/original_500_collection/bronze_api__nft_metadata_list.sql similarity index 96% rename from models/bronze/api_udf/nft/original_500_collection/bronze_api__nft_metadata_list.sql rename to models/bronze/nft/original_500_collection/bronze_api__nft_metadata_list.sql index 6bbb60ed..3777a488 100644 --- a/models/bronze/api_udf/nft/original_500_collection/bronze_api__nft_metadata_list.sql +++ b/models/bronze/nft/original_500_collection/bronze_api__nft_metadata_list.sql @@ -30,14 +30,14 @@ nft_mints AS ( SELECT nft_address, COUNT( - DISTINCT tokenid + DISTINCT tokenId ) AS mint_count, 1 AS start_page, CEIL( mint_count / 100 ) AS end_page FROM - {{ ref('nft__ez_nft_mints') }} + {{ ref('silver__nft_mints') }} INNER JOIN top_nft_collection USING (nft_address) GROUP BY nft_address diff --git a/models/bronze/api_udf/nft/original_500_collection/bronze_api__nft_metadata_reads.sql b/models/bronze/nft/original_500_collection/bronze_api__nft_metadata_reads.sql similarity index 97% rename from models/bronze/api_udf/nft/original_500_collection/bronze_api__nft_metadata_reads.sql rename to models/bronze/nft/original_500_collection/bronze_api__nft_metadata_reads.sql index 6692810a..3c8003cb 100644 --- a/models/bronze/api_udf/nft/original_500_collection/bronze_api__nft_metadata_reads.sql +++ b/models/bronze/nft/original_500_collection/bronze_api__nft_metadata_reads.sql @@ -1,7 +1,7 @@ {{ config( materialized = 'incremental', unique_key = 'collection_page', - tags = ['nft_metadata'] + tags = ['bronze','nft','nft_metadata'] ) }} WITH raw AS ( diff --git a/models/bronze/prices/bronze__complete_native_asset_metadata.sql b/models/bronze/prices/bronze__complete_native_asset_metadata.sql deleted file mode 100644 index 9e99933a..00000000 --- a/models/bronze/prices/bronze__complete_native_asset_metadata.sql +++ /dev/null @@ -1,26 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - asset_id, - symbol, - NAME, - decimals, - blockchain, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_native_asset_metadata_id, - _invocation_id -FROM - {{ source( - 'crosschain_silver', - 'complete_native_asset_metadata' - ) }} -WHERE - blockchain = 'ethereum' - AND symbol = 'ETH' diff --git a/models/bronze/prices/bronze__complete_native_prices.sql b/models/bronze/prices/bronze__complete_native_prices.sql deleted file mode 100644 index 614c0904..00000000 --- a/models/bronze/prices/bronze__complete_native_prices.sql +++ /dev/null @@ -1,29 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - HOUR, - asset_id, - symbol, - NAME, - decimals, - price, - blockchain, - is_imputed, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_native_prices_id, - _invocation_id -FROM - {{ source( - 'crosschain_silver', - 'complete_native_prices' - ) }} -WHERE - blockchain = 'ethereum' - AND symbol = 'ETH' diff --git a/models/bronze/prices/bronze__complete_provider_asset_metadata.sql b/models/bronze/prices/bronze__complete_provider_asset_metadata.sql deleted file mode 100644 index 20fbaaba..00000000 --- a/models/bronze/prices/bronze__complete_provider_asset_metadata.sql +++ /dev/null @@ -1,25 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - asset_id, - token_address, - NAME, - symbol, - platform, - platform_id, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_provider_asset_metadata_id, - _invocation_id -FROM - {{ source( - 'crosschain_silver', - 'complete_provider_asset_metadata' - ) }} -WHERE - platform = 'Ethereum' -- platforms specific to Ethereum diff --git a/models/bronze/prices/bronze__complete_provider_prices.sql b/models/bronze/prices/bronze__complete_provider_prices.sql deleted file mode 100644 index 28ed5660..00000000 --- a/models/bronze/prices/bronze__complete_provider_prices.sql +++ /dev/null @@ -1,24 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - asset_id, - recorded_hour, - OPEN, - high, - low, - CLOSE, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_provider_prices_id, - _invocation_id -FROM - {{ source( - 'crosschain_silver', - 'complete_provider_prices' - ) }} --- prices for all ids \ No newline at end of file diff --git a/models/bronze/prices/bronze__complete_token_asset_metadata.sql b/models/bronze/prices/bronze__complete_token_asset_metadata.sql deleted file mode 100644 index 26d629df..00000000 --- a/models/bronze/prices/bronze__complete_token_asset_metadata.sql +++ /dev/null @@ -1,28 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - token_address, - asset_id, - symbol, - NAME, - decimals, - blockchain, - blockchain_name, - blockchain_id, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_token_asset_metadata_id, - _invocation_id -FROM - {{ source( - 'crosschain_silver', - 'complete_token_asset_metadata' - ) }} -WHERE - blockchain = 'ethereum' \ No newline at end of file diff --git a/models/bronze/prices/bronze__complete_token_prices.sql b/models/bronze/prices/bronze__complete_token_prices.sql deleted file mode 100644 index 3fcc0cc0..00000000 --- a/models/bronze/prices/bronze__complete_token_prices.sql +++ /dev/null @@ -1,31 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - HOUR, - token_address, - asset_id, - symbol, - NAME, - decimals, - price, - blockchain, - blockchain_name, - blockchain_id, - is_imputed, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_token_prices_id, - _invocation_id -FROM - {{ source( - 'crosschain_silver', - 'complete_token_prices' - ) }} -WHERE - blockchain = 'ethereum' diff --git a/models/doc_descriptions/Borrowing/Borrow_symbol.md b/models/doc_descriptions/Borrowing/Borrow_symbol.md deleted file mode 100644 index 6d5e0592..00000000 --- a/models/doc_descriptions/Borrowing/Borrow_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs borrow_symbol %} - -The symbol of the asset/collateral that is payed or received, depending on the action - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Borrowing/action.md b/models/doc_descriptions/Borrowing/action.md deleted file mode 100644 index 13dc91bd..00000000 --- a/models/doc_descriptions/Borrowing/action.md +++ /dev/null @@ -1,8 +0,0 @@ -{% docs borrow_action %} - -The action that the user is taking. - Borrow: user is borrowing an asset - Repay: user is repaying the asset that they have borrowed in a previous loan - Add collateral: user is depositing collateral for their loan. This happens some times in the same transaction as the borrowing transaction and some times in a separate transaction. - Remove collateral: user is withdrawing collateral. This happens some times in the same transaction as the borrowing transaction and some times in a separate transaction. -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Borrowing/amount.md b/models/doc_descriptions/Borrowing/amount.md deleted file mode 100644 index 16b2cbea..00000000 --- a/models/doc_descriptions/Borrowing/amount.md +++ /dev/null @@ -1,9 +0,0 @@ -{% docs borrow_amount %} - -The meaning depends on the action: -Borrow: The amount of the asset that the user is borrowing or -Repay: The amount of the asset that the user is repaying -Add collateral: The amount of collateral that the user is depositing -Remove collateral: The amount of collateral that the user is withdrawing - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Borrowing/amount_usd.md b/models/doc_descriptions/Borrowing/amount_usd.md deleted file mode 100644 index feac2c9e..00000000 --- a/models/doc_descriptions/Borrowing/amount_usd.md +++ /dev/null @@ -1,8 +0,0 @@ -{% docs borrow_amount_usd %} - -The meaning depends on the action: -Borrow: The amount of the asset in USD that the user is borrowing or -Repay: The amount of the asset in USD that the user is repaying -Add collateral: The amount of collateral in USD that the user is depositing -Remove collateral: The amount of collateral in USD that the user is withdrawing -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Borrowing/asset.md b/models/doc_descriptions/Borrowing/asset.md deleted file mode 100644 index 236f8b1c..00000000 --- a/models/doc_descriptions/Borrowing/asset.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs borrow_asset %} - -The address of the asset/collateral token that is being borrowed/repayed/deposited etc. depending on the action - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/Lending_pool_address.md b/models/doc_descriptions/Lending/Lending_pool_address.md deleted file mode 100644 index ad265557..00000000 --- a/models/doc_descriptions/Lending/Lending_pool_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_pool_address %} - -The address of the lending pool. For sushi this will be the address of the kashi pair. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/Lending_symbol.md b/models/doc_descriptions/Lending/Lending_symbol.md deleted file mode 100644 index e0ad325e..00000000 --- a/models/doc_descriptions/Lending/Lending_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_symbol %} - -The symbol of the asset that is lent or withdrawn, depending on the action - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/action.md b/models/doc_descriptions/Lending/action.md deleted file mode 100644 index 08615f5f..00000000 --- a/models/doc_descriptions/Lending/action.md +++ /dev/null @@ -1,7 +0,0 @@ -{% docs action %} - -The action that the user is taking. - Deposit: user is depositing funds to be used for lending - Withdraw: user has changed their mind and are no longer willing to lend, so they withdraw their asset - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/amount.md b/models/doc_descriptions/Lending/amount.md deleted file mode 100644 index 2f21c8bb..00000000 --- a/models/doc_descriptions/Lending/amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs amount %} - -The amount of the asset that the user is depositing or withdrawing, depending on the action. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/amount_usd.md b/models/doc_descriptions/Lending/amount_usd.md deleted file mode 100644 index dee7a3c7..00000000 --- a/models/doc_descriptions/Lending/amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs amount_usd %} - -The amount of the asset that the user is depositing or withdrawing, depending on the action. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/asset.md b/models/doc_descriptions/Lending/asset.md deleted file mode 100644 index 8e4dc6a0..00000000 --- a/models/doc_descriptions/Lending/asset.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs asset %} - -The address of the asset (token) that is being deposited/withdrawn, depending on the action - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/lender.md b/models/doc_descriptions/Lending/lender.md deleted file mode 100644 index 7931f209..00000000 --- a/models/doc_descriptions/Lending/lender.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs depositor %} - -Its the address of the user who is depositing for lending or withdrawing, depending on the action. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_borrow_rate_mode.md b/models/doc_descriptions/aave/aave_borrow_rate_mode.md deleted file mode 100644 index 7186b3e2..00000000 --- a/models/doc_descriptions/aave/aave_borrow_rate_mode.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_borrow_rate_mode %} - -The rate mode the user is swapping from. Stable: 1, Variable: 2. Borrowers can switch between the stable and variable rate at any time. Stable rates act as a fixed rate in the short-term, but can be re-balanced in the long-term in response to changes in market conditions. The variable rate is the rate based on the offer and demand in Aave. The stable rate, as its name indicates, will remain pretty stable and its the best option to plan how much interest you will have to pay. The variable rate will change over time and could be the optimal rate depending on market conditions. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_borrow_rate_stable.md b/models/doc_descriptions/aave/aave_borrow_rate_stable.md deleted file mode 100644 index 718959c6..00000000 --- a/models/doc_descriptions/aave/aave_borrow_rate_stable.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_borrow_rate_stable %} - -The stable interest rate for borrowing assets. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_borrow_rate_variable.md b/models/doc_descriptions/aave/aave_borrow_rate_variable.md deleted file mode 100644 index abaa1b1f..00000000 --- a/models/doc_descriptions/aave/aave_borrow_rate_variable.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_borrow_rate_variable %} - -The variable interest rate for borrowing assets. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_collateral_aave_token.md b/models/doc_descriptions/aave/aave_collateral_aave_token.md deleted file mode 100644 index 7e419488..00000000 --- a/models/doc_descriptions/aave/aave_collateral_aave_token.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_collateral_aave_token %} - -The Aave interest bearing token that's burned when a liquidation occurs. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_collateral_asset.md b/models/doc_descriptions/aave/aave_collateral_asset.md deleted file mode 100644 index 98acd96a..00000000 --- a/models/doc_descriptions/aave/aave_collateral_asset.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_collateral_asset %} - -The asset provided as collateral, which can be liquidated. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_data_provider.md b/models/doc_descriptions/aave/aave_data_provider.md deleted file mode 100644 index 6acedd85..00000000 --- a/models/doc_descriptions/aave/aave_data_provider.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_data_provider %} - -The Aave protocol data provider contract address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_debt_aave_token.md b/models/doc_descriptions/aave/aave_debt_aave_token.md deleted file mode 100644 index cbfe9340..00000000 --- a/models/doc_descriptions/aave/aave_debt_aave_token.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_debt_aave_token %} - -The interest bearing Aave token representing the debt. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_debt_asset.md b/models/doc_descriptions/aave/aave_debt_asset.md deleted file mode 100644 index 112e51fe..00000000 --- a/models/doc_descriptions/aave/aave_debt_asset.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_debt_asset %} - -The debt asset, which the user borrowed. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_debt_to_cover_amount.md b/models/doc_descriptions/aave/aave_debt_to_cover_amount.md deleted file mode 100644 index e3ff82b1..00000000 --- a/models/doc_descriptions/aave/aave_debt_to_cover_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_debt_to_cover_amount %} - -The amount of debt the user must cover. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_debt_to_cover_amount_usd.md b/models/doc_descriptions/aave/aave_debt_to_cover_amount_usd.md deleted file mode 100644 index f0cb4be8..00000000 --- a/models/doc_descriptions/aave/aave_debt_to_cover_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_debt_to_cover_amount_usd %} - -The amount of debt the user must cover, valued in USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_depositor_address.md b/models/doc_descriptions/aave/aave_depositor_address.md deleted file mode 100644 index 1fb048ad..00000000 --- a/models/doc_descriptions/aave/aave_depositor_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_depositor_address %} - -The depositor's address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_end_voting_period.md b/models/doc_descriptions/aave/aave_end_voting_period.md deleted file mode 100644 index 429410c3..00000000 --- a/models/doc_descriptions/aave/aave_end_voting_period.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_end_voting_period %} - -The block number in which the voting period ends. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_flashloan_amount.md b/models/doc_descriptions/aave/aave_flashloan_amount.md deleted file mode 100644 index eaac2fa4..00000000 --- a/models/doc_descriptions/aave/aave_flashloan_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_flashloan_amount %} - -The amount of assets flash loaned. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_flashloan_amount_usd.md b/models/doc_descriptions/aave/aave_flashloan_amount_usd.md deleted file mode 100644 index 35b913b3..00000000 --- a/models/doc_descriptions/aave/aave_flashloan_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_flashloan_amount_usd %} - -The value of the flash loan amount, in USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_governance_contract.md b/models/doc_descriptions/aave/aave_governance_contract.md deleted file mode 100644 index 8667b982..00000000 --- a/models/doc_descriptions/aave/aave_governance_contract.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_governance_contract %} - -The governance contract address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_initiator_address.md b/models/doc_descriptions/aave/aave_initiator_address.md deleted file mode 100644 index e8d4b8e1..00000000 --- a/models/doc_descriptions/aave/aave_initiator_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_initiator_address %} - -The address that initiated the flash loan. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_issued_tokens.md b/models/doc_descriptions/aave/aave_issued_tokens.md deleted file mode 100644 index 96a226f6..00000000 --- a/models/doc_descriptions/aave/aave_issued_tokens.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_issued_tokens %} - -The amount of tokens that the user is depositing. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_lending_pool_contract.md b/models/doc_descriptions/aave/aave_lending_pool_contract.md deleted file mode 100644 index bac2b862..00000000 --- a/models/doc_descriptions/aave/aave_lending_pool_contract.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_lending_pool_contract %} - -The address of the lending pool. This changes based on the Aave version. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_liquidated_amount.md b/models/doc_descriptions/aave/aave_liquidated_amount.md deleted file mode 100644 index bf2c6b59..00000000 --- a/models/doc_descriptions/aave/aave_liquidated_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_liquidated_amount %} - -The amount of asset liquidated. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_liquidated_amount_usd.md b/models/doc_descriptions/aave/aave_liquidated_amount_usd.md deleted file mode 100644 index ec3cfd1b..00000000 --- a/models/doc_descriptions/aave/aave_liquidated_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_liquidated_amount_usd %} - -The value of the liquidated asset, in USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_liquidator.md b/models/doc_descriptions/aave/aave_liquidator.md deleted file mode 100644 index 9c8435ae..00000000 --- a/models/doc_descriptions/aave/aave_liquidator.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_liquidator %} - -The address that initiated the liquidation call. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_market.md b/models/doc_descriptions/aave/aave_market.md deleted file mode 100644 index 39ae2fd2..00000000 --- a/models/doc_descriptions/aave/aave_market.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_market %} - -The asset contract for the applicable Aave market. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_payer.md b/models/doc_descriptions/aave/aave_payer.md deleted file mode 100644 index b7553475..00000000 --- a/models/doc_descriptions/aave/aave_payer.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_payer %} - -The address that initiated the repayment. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_premium_amount.md b/models/doc_descriptions/aave/aave_premium_amount.md deleted file mode 100644 index 27bf2260..00000000 --- a/models/doc_descriptions/aave/aave_premium_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_premium_amount %} - -The flash loan fee, currently 0.09%, changeable via the normal governance process. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_premium_amount_usd.md b/models/doc_descriptions/aave/aave_premium_amount_usd.md deleted file mode 100644 index 1456e2f7..00000000 --- a/models/doc_descriptions/aave/aave_premium_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_premium_amount_usd %} - -The flash loan fee, valued in USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_proposal_id.md b/models/doc_descriptions/aave/aave_proposal_id.md deleted file mode 100644 index 3687d169..00000000 --- a/models/doc_descriptions/aave/aave_proposal_id.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_proposal_id %} - -The unique ID representing a proposal. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_proposal_tx.md b/models/doc_descriptions/aave/aave_proposal_tx.md deleted file mode 100644 index 35504d3c..00000000 --- a/models/doc_descriptions/aave/aave_proposal_tx.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_proposal_tx %} - -The transaction confirming a proposal submission. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_proposer.md b/models/doc_descriptions/aave/aave_proposer.md deleted file mode 100644 index 730b34c6..00000000 --- a/models/doc_descriptions/aave/aave_proposer.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_proposer %} - -The user's address that submitted the proposal. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_repayed_tokens.md b/models/doc_descriptions/aave/aave_repayed_tokens.md deleted file mode 100644 index c28f36ff..00000000 --- a/models/doc_descriptions/aave/aave_repayed_tokens.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_repayed_tokens %} - -The amount of tokens repaid. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_repayed_usd.md b/models/doc_descriptions/aave/aave_repayed_usd.md deleted file mode 100644 index 36078109..00000000 --- a/models/doc_descriptions/aave/aave_repayed_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_repayed_usd %} - -The value of repaid tokens, in USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_stable_debt_token_address.md b/models/doc_descriptions/aave/aave_stable_debt_token_address.md deleted file mode 100644 index 915daa74..00000000 --- a/models/doc_descriptions/aave/aave_stable_debt_token_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_stable_debt_token_address %} - -Debt tokens are interest-accruing tokens that are minted and burned on borrow and repay, representing a debt to the protocol with a stable interest rate. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_start_voting_period.md b/models/doc_descriptions/aave/aave_start_voting_period.md deleted file mode 100644 index e8848c59..00000000 --- a/models/doc_descriptions/aave/aave_start_voting_period.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_start_voting_period %} - -The block number in which the voting period begins. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_status.md b/models/doc_descriptions/aave/aave_status.md deleted file mode 100644 index e8c3dfaf..00000000 --- a/models/doc_descriptions/aave/aave_status.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_status %} - -The proposal's status. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_supplied_usd.md b/models/doc_descriptions/aave/aave_supplied_usd.md deleted file mode 100644 index f33cb428..00000000 --- a/models/doc_descriptions/aave/aave_supplied_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_supplied_usd %} - -The value of the asset in USD that the user is depositing. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_supply_rate.md b/models/doc_descriptions/aave/aave_supply_rate.md deleted file mode 100644 index 4f5f509c..00000000 --- a/models/doc_descriptions/aave/aave_supply_rate.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_supply_rate %} - -The interest rate for supplying assets to the protocol. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_support.md b/models/doc_descriptions/aave/aave_support.md deleted file mode 100644 index 6d6394a9..00000000 --- a/models/doc_descriptions/aave/aave_support.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_support %} - -A value indicating their vote (For: true, Against: false). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_target_address.md b/models/doc_descriptions/aave/aave_target_address.md deleted file mode 100644 index e51a89c2..00000000 --- a/models/doc_descriptions/aave/aave_target_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_target_address %} - -The address receiving the flash loan. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_targets.md b/models/doc_descriptions/aave/aave_targets.md deleted file mode 100644 index 0d1ff450..00000000 --- a/models/doc_descriptions/aave/aave_targets.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_targets %} - -List of the targeted addresses by proposal transactions. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_token.md b/models/doc_descriptions/aave/aave_token.md deleted file mode 100644 index fb29661d..00000000 --- a/models/doc_descriptions/aave/aave_token.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_token %} - -The Aave interest bearing token contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_total_liquidity_token.md b/models/doc_descriptions/aave/aave_total_liquidity_token.md deleted file mode 100644 index c0a64e75..00000000 --- a/models/doc_descriptions/aave/aave_total_liquidity_token.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_total_liquidity_token %} - -The total supply of liquidity tokens. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_total_liquidity_usd.md b/models/doc_descriptions/aave/aave_total_liquidity_usd.md deleted file mode 100644 index e6189a8a..00000000 --- a/models/doc_descriptions/aave/aave_total_liquidity_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_total_liquidity_usd %} - -The total value of liquidity tokens, in USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_total_stable_debt_token.md b/models/doc_descriptions/aave/aave_total_stable_debt_token.md deleted file mode 100644 index f96aa680..00000000 --- a/models/doc_descriptions/aave/aave_total_stable_debt_token.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_total_stable_debt_token %} - -The total supply of debt tokens, representing a debt to the protocol with a stable interest rate. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_total_stable_debt_usd.md b/models/doc_descriptions/aave/aave_total_stable_debt_usd.md deleted file mode 100644 index 860c47c1..00000000 --- a/models/doc_descriptions/aave/aave_total_stable_debt_usd.md +++ /dev/null @@ -1,4 +0,0 @@ -{% docs aave_total_stable_debt_usd %} - -The total USD value of debt tokens, representing a debt to the protocol with a stable interest rate. -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_total_variable_debt_token.md b/models/doc_descriptions/aave/aave_total_variable_debt_token.md deleted file mode 100644 index d436aed9..00000000 --- a/models/doc_descriptions/aave/aave_total_variable_debt_token.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_total_variable_debt_token %} - -The total supply of debt tokens, representing a debt to the protocol with a variable interest rate. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_total_variable_debt_usd.md b/models/doc_descriptions/aave/aave_total_variable_debt_usd.md deleted file mode 100644 index f9f635ea..00000000 --- a/models/doc_descriptions/aave/aave_total_variable_debt_usd.md +++ /dev/null @@ -1,4 +0,0 @@ -{% docs aave_total_variable_debt_usd %} - -The total USD value of debt tokens, representing a debt to the protocol with a variable interest rate. -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_utilization_rate.md b/models/doc_descriptions/aave/aave_utilization_rate.md deleted file mode 100644 index c2980788..00000000 --- a/models/doc_descriptions/aave/aave_utilization_rate.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_utilization_rate %} - -The percentage of assets loaned out. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_variable_debt_token_address.md b/models/doc_descriptions/aave/aave_variable_debt_token_address.md deleted file mode 100644 index a411279c..00000000 --- a/models/doc_descriptions/aave/aave_variable_debt_token_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_variable_debt_token_address %} - -Debt tokens are interest-accruing tokens that are minted and burned on borrow and repay, representing a debt to the protocol with a variable interest rate. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_version.md b/models/doc_descriptions/aave/aave_version.md deleted file mode 100644 index 20d9f346..00000000 --- a/models/doc_descriptions/aave/aave_version.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_version %} - -The contract version of Aave. Example: Aave AMM, Aave v1, Aave v2 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_voter.md b/models/doc_descriptions/aave/aave_voter.md deleted file mode 100644 index e891cf4e..00000000 --- a/models/doc_descriptions/aave/aave_voter.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_voter %} - -The voter's address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_voting_power.md b/models/doc_descriptions/aave/aave_voting_power.md deleted file mode 100644 index 450e723a..00000000 --- a/models/doc_descriptions/aave/aave_voting_power.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_voting_power %} - -The voter's voting power proportional to the sum of their balance of AAVE and/or stkAAVE. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_withdrawn_tokens.md b/models/doc_descriptions/aave/aave_withdrawn_tokens.md deleted file mode 100644 index d6c862a7..00000000 --- a/models/doc_descriptions/aave/aave_withdrawn_tokens.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_withdrawn_tokens %} - -The amount of tokens withdrawn. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/aave_withdrawn_usd.md b/models/doc_descriptions/aave/aave_withdrawn_usd.md deleted file mode 100644 index 4fd1874b..00000000 --- a/models/doc_descriptions/aave/aave_withdrawn_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_withdrawn_usd %} - -The value of withdrawn tokens, in USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/stkaave_rate_supply.md b/models/doc_descriptions/aave/stkaave_rate_supply.md deleted file mode 100644 index 6e162df0..00000000 --- a/models/doc_descriptions/aave/stkaave_rate_supply.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs stkaave_rate_supply %} - -The stkAAVE rate for supplying assets to the protocol. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/stkaave_rate_variable_borrow.md b/models/doc_descriptions/aave/stkaave_rate_variable_borrow.md deleted file mode 100644 index be3b6aca..00000000 --- a/models/doc_descriptions/aave/stkaave_rate_variable_borrow.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs stkaave_rate_variable_borrow %} - -The stkAAVE variable rate for borrowing assets. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/table descriptions/aave_borrows_table_doc.md b/models/doc_descriptions/aave/table descriptions/aave_borrows_table_doc.md deleted file mode 100644 index b30666e8..00000000 --- a/models/doc_descriptions/aave/table descriptions/aave_borrows_table_doc.md +++ /dev/null @@ -1,6 +0,0 @@ -{% docs aave_borrows_table_doc %} - -Aave.ez_borrows contains transactions where users borrowed assets via the Aave protocol. In order to borrow assets, a user must first deposit their preferred asset and amount as collateral. Borrowers can choose either a stable or variable borrow rate. For more information, see column descriptions. - - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/table descriptions/aave_deposits_table_doc.md b/models/doc_descriptions/aave/table descriptions/aave_deposits_table_doc.md deleted file mode 100644 index de545b34..00000000 --- a/models/doc_descriptions/aave/table descriptions/aave_deposits_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_deposits_table_doc %} - -Aave.ez_deposits contains transactions where users deposited into the Aave protocol. A user deposits their preferred asset and amount. After depositing, users earn passive income based on the market borrowing demand. Additionally, depositing allows users to borrow by using their deposited assets as a collateral. Any interest earned by depositing funds helps offset the interest rate accumulated by borrowing. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/table descriptions/aave_flashloans_table_doc.md b/models/doc_descriptions/aave/table descriptions/aave_flashloans_table_doc.md deleted file mode 100644 index c56885fe..00000000 --- a/models/doc_descriptions/aave/table descriptions/aave_flashloans_table_doc.md +++ /dev/null @@ -1,6 +0,0 @@ -{% docs aave_flashloans_table_doc %} - -Aave.ez_flashloans contains flash loan transactions where a borrower executes an -undercollateralised, one-block liquidity loan. Flash loans are a feature designed for developers, due to the technical knowledge required to execute one. Flash Loans allow you to borrow any available amount of assets without providing any collateral, as long as the liquidity is returned to the protocol within one block transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/table descriptions/aave_liquidations_table_doc.md b/models/doc_descriptions/aave/table descriptions/aave_liquidations_table_doc.md deleted file mode 100644 index 1d69c48d..00000000 --- a/models/doc_descriptions/aave/table descriptions/aave_liquidations_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_liquidations_table_doc %} - -Aave.ez_liquidatons contains transactions in which a borrower's collateral asset is liquidated. Liquidations occur when a borrower's health factor goes below 1 due to their collateral value not properly covering their loan/debt value. This might happen when the collateral decreases in value or the borrowed debt increases in value against each other. This collateral vs loan value ratio is shown in the health factor. In a liquidation, up to 50% of a borrower's debt is repaid and that value + liquidation fee is taken from the collateral available, so after a liquidation the amount liquidated from one's debt is repaid. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/table descriptions/aave_market_stats_table_doc.md b/models/doc_descriptions/aave/table descriptions/aave_market_stats_table_doc.md deleted file mode 100644 index c14f03d7..00000000 --- a/models/doc_descriptions/aave/table descriptions/aave_market_stats_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_market_stats_table_doc %} - -Aave.ez_market_stats details market statistics for Aave markets by block hour. These include reserves, token addresses, token prices, borrow and supply rates, the utilization rate, and total supplies of liquidity and debt tokens. For more information, see column descriptions. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/table descriptions/aave_proposals_table_doc.md b/models/doc_descriptions/aave/table descriptions/aave_proposals_table_doc.md deleted file mode 100644 index e07b8bc9..00000000 --- a/models/doc_descriptions/aave/table descriptions/aave_proposals_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_proposals_table_doc %} - -Aave.ez_proposals contains transactions in which Aave improvement proposals are submitted for governance voting. AAVE and/or stkAAVE token holders receive governance powers. Proposal power gives access to creating and sustaining a proposal. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/table descriptions/aave_repayments_table_doc.md b/models/doc_descriptions/aave/table descriptions/aave_repayments_table_doc.md deleted file mode 100644 index 4ac811b2..00000000 --- a/models/doc_descriptions/aave/table descriptions/aave_repayments_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_repayments_table_doc %} - -Aave.ez_repayments contains transactions in which a borrower repays their loan (debt). Loans are repaid in the same asset borrowed, plus accrued interest. Borrowers can also use their collateral to repay in version 2 of Aave Protocol. Borrowers can pay back their loan based on the USD price as they can borrow any of the available stable coins (USDC, DAI, USDT, etc.). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/table descriptions/aave_votes_table_doc.md b/models/doc_descriptions/aave/table descriptions/aave_votes_table_doc.md deleted file mode 100644 index 6ba494ce..00000000 --- a/models/doc_descriptions/aave/table descriptions/aave_votes_table_doc.md +++ /dev/null @@ -1,6 +0,0 @@ -{% docs aave_votes_table_doc %} - -Aave.ez_votes contains Aave governance voting transactions. AAVE and/or stkAAVE token holders receive governance powers proportionally to the sum of their balance. Voting power is used to vote for or against existing proposals. - - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/aave/table descriptions/aave_withdraws_table_doc.md b/models/doc_descriptions/aave/table descriptions/aave_withdraws_table_doc.md deleted file mode 100644 index 4201f74a..00000000 --- a/models/doc_descriptions/aave/table descriptions/aave_withdraws_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs aave_withdraws_table_doc %} - -Aave.ez_withdraws contains transactions in which a user withdraws liquidity from the Aave protocol. Users can use their “aTokens" as liquidity without withdrawing. They need to make sure there is enough liquidity (not borrowed) in order to withdraw, if this is not the case, users need to wait for more liquidity from depositors or borrowers repaying. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/balances/current_bal_table_doc.md b/models/doc_descriptions/balances/current_bal_table_doc.md deleted file mode 100644 index a52c5869..00000000 --- a/models/doc_descriptions/balances/current_bal_table_doc.md +++ /dev/null @@ -1,7 +0,0 @@ -{% docs current_bal_table_doc %} - -This table contains the current, non 0, balances for wallets on the Ethereum Blockchain. Symbol, name, and price are joined where possible. Prices are calculated as of the last activity date and as of the most recently recorded hourly price. ERC721s are included. - -Please note - the underlying data for this is large. If you want your query to run quickly, please use filters as much as possible. Using at least `last_activity_block_timestamp::date` as a filter will lead to optimal query performance. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/balances/daily_balances_table_doc.md b/models/doc_descriptions/balances/daily_balances_table_doc.md deleted file mode 100644 index af58c642..00000000 --- a/models/doc_descriptions/balances/daily_balances_table_doc.md +++ /dev/null @@ -1,13 +0,0 @@ -{% docs daily_balances_table_doc %} - -READ THIS! - -TLDR - You MUST use filters when interacting with this view. At a minimum, the `balance_date` must be filtered. Use `ez_balance_diffs` if possible. Only activity 2020+ is included. - -This view contains the average daily balance of every wallet, for every token, including ERC721s. Previous balances are carried forward on days without activity. - -This is an absolutely massive view, which is why filters must be applied if you do not want your query to time out. Balance_date is a requirement, but other filters will also be helpful for query performance. Data before 2020 has been excluded for performance sake. Wallets with activity before Jan 1 2020 may be represented incorrectly. You can find these older records in `ez_balance_diffs`. - -`ez_balance_diffs` will have the best query performance of the balances tables, please use it if possible. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/balances/diffs_table_doc.md b/models/doc_descriptions/balances/diffs_table_doc.md deleted file mode 100644 index a6696151..00000000 --- a/models/doc_descriptions/balances/diffs_table_doc.md +++ /dev/null @@ -1,123 +0,0 @@ -{% docs diffs_table_doc %} - -This table contains the block level balance changes for both tokens (including ERC721s) and Native ETH on the Ethereum Blockchain for all wallets and contracts. If a token or Native ETH is moved, we will read the balance of the involved wallets at that block, and carry forward the previous balance into the current record. Symbol, name, and price are joined where possible. ERC721s are included. - -Please note - the underlying data for this is large. If you want your query to run quickly, please use filters as much as possible. Using at least `block_timestamp::date` as a filter will lead to optimal query performance. - -If you want to take this data and make it daily, you can do so with the query below. You must use a `block_timestamp::date` filter here at a minimum. Other filters will help query runtime. - -```sql -WITH base_table AS ( - SELECT - block_timestamp :: DATE AS balance_date, - CASE - WHEN symbol = 'ETH' THEN 'ETH' - ELSE contract_address - END AS contract_address, - user_address, - symbol, - current_bal - FROM - ethereum.core.ez_balance_diffs - WHERE - block_timestamp :: DATE >= '' --user input - AND user_address = '' --user input - AND ( - contract_address = '' --user input - OR symbol = 'ETH' - ) -), -all_days AS ( - SELECT - date_day AS balance_date - FROM - ethereum.core.dim_dates -), -address_ranges AS ( - SELECT - user_address, - contract_address, - symbol, - MIN( - balance_date :: DATE - ) AS min_block_date, - CURRENT_DATE() :: DATE AS max_block_date - FROM - base_table - GROUP BY - user_address, - contract_address, - symbol, - max_block_date -), -all_dates AS ( - SELECT - C.balance_date, - A.user_address, - A.contract_address, - A.symbol - FROM - all_days C - LEFT JOIN address_ranges A - ON C.full_balance_date BETWEEN A.min_block_date - AND A.max_block_date - WHERE - A.user_address IS NOT NULL -), -eth_balances AS ( - SELECT - user_address, - contract_address, - balance_date, - current_bal, - TRUE AS daily_activity - FROM - base_table -), -balance_tmp AS ( - SELECT - d.balance_date, - d.user_address, - d.contract_address, - d.symbol, - b.current_bal, - b.daily_activity - FROM - all_dates d - LEFT JOIN eth_balances b - ON d.balance_date = b.balance_date - AND d.user_address = b.user_address - AND d.contract_address = b.contract_address -), -FINAL AS ( - SELECT - balance_date, - user_address, - contract_address, - symbol, - LAST_VALUE( - current_bal ignore nulls - ) over( - PARTITION BY user_address, - contract_address - ORDER BY - balance_date ASC rows unbounded preceding - ) AS balance, - CASE - WHEN daily_activity IS NULL THEN FALSE - ELSE TRUE - END AS daily_activity - FROM - balance_tmp -) -SELECT - * -FROM - FINAL -WHERE - balance <> 0 -ORDER BY - balance_date DESC, - contract_address -``` -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/beacon_chain/attestations_table_doc.md b/models/doc_descriptions/beacon_chain/attestations_table_doc.md deleted file mode 100644 index 373163ed..00000000 --- a/models/doc_descriptions/beacon_chain/attestations_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs attestations_table_doc %} - -Validators are expected to create, sign and broadcast an attestation during every epoch. Data in this table contains details around these attestations. For more info, please visit [The Ethereum Organization](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/attestations/) - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/beacon_chain/beacon_blocks_table_doc.md b/models/doc_descriptions/beacon_chain/beacon_blocks_table_doc.md deleted file mode 100644 index 97dfa4d7..00000000 --- a/models/doc_descriptions/beacon_chain/beacon_blocks_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs beacon_blocks_table_doc %} - -This table contains data around block formation from the consensus layer of the Ethereum 2.0 protocol. For more info, please visit [The Ethereum Organization](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/) - -{% enddocs %} diff --git a/models/doc_descriptions/beacon_chain/beacon_committees_table_doc.md b/models/doc_descriptions/beacon_chain/beacon_committees_table_doc.md deleted file mode 100644 index efd54d8e..00000000 --- a/models/doc_descriptions/beacon_chain/beacon_committees_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs beacon_committees_table_doc %} - -This table contains information about the committees of validators. For more info, please visit [The Ethereum Organization](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/) - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/beacon_chain/beacon_deposits_table_doc.md b/models/doc_descriptions/beacon_chain/beacon_deposits_table_doc.md deleted file mode 100644 index be8e89c9..00000000 --- a/models/doc_descriptions/beacon_chain/beacon_deposits_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs beacon_deposits_table_doc %} - -This table contains information about the deposits made to the beacon chain. For more info, please visit [The Ethereum Organization](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/) - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/beacon_chain/beacon_validator_balances_table_doc.md b/models/doc_descriptions/beacon_chain/beacon_validator_balances_table_doc.md deleted file mode 100644 index 525feee0..00000000 --- a/models/doc_descriptions/beacon_chain/beacon_validator_balances_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs beacon_validator_balances_table_doc %} - -This table contains information about the balances of validators. For more info, please visit [The Ethereum Organization](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/) - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/beacon_chain/beacon_validators_doc.md b/models/doc_descriptions/beacon_chain/beacon_validators_doc.md deleted file mode 100644 index 3d0611b3..00000000 --- a/models/doc_descriptions/beacon_chain/beacon_validators_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs beacon_validators_doc %} - -This table contains information about the validators. For more info, please visit [The Ethereum Organization](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/) - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/beacon_chain/eth_epoch_number.md b/models/doc_descriptions/beacon_chain/eth_epoch_number.md deleted file mode 100644 index 6826f2ad..00000000 --- a/models/doc_descriptions/beacon_chain/eth_epoch_number.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_epoch_number %} - -A period of 32 slots, each slot being 12 seconds, totalling 6.4 minutes. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/beacon_chain/eth_slot_number.md b/models/doc_descriptions/beacon_chain/eth_slot_number.md deleted file mode 100644 index bf0705bb..00000000 --- a/models/doc_descriptions/beacon_chain/eth_slot_number.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_slot_number %} - -The Beacon Chain slot this block represents. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/beacon_chain/eth_slot_timestamp.md b/models/doc_descriptions/beacon_chain/eth_slot_timestamp.md deleted file mode 100644 index 2288de05..00000000 --- a/models/doc_descriptions/beacon_chain/eth_slot_timestamp.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_slot_timestamp %} - -Timestamp of Beacon Chain slot. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/beacon_chain/eth_state_id.md b/models/doc_descriptions/beacon_chain/eth_state_id.md deleted file mode 100644 index 60e90921..00000000 --- a/models/doc_descriptions/beacon_chain/eth_state_id.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_state_id %} - -The hash-tree-root of the BeaconState. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/beacon_chain/eth_validators.md b/models/doc_descriptions/beacon_chain/eth_validators.md deleted file mode 100644 index f9644b11..00000000 --- a/models/doc_descriptions/beacon_chain/eth_validators.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_validators %} - -Validators who have submitted their attestation and have been included by the block proposer. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_block_header_json.md b/models/doc_descriptions/blocks/eth_block_header_json.md deleted file mode 100644 index d6f4ea1b..00000000 --- a/models/doc_descriptions/blocks/eth_block_header_json.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_block_header_json %} - -This JSON column contains the block header details. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_blockchain.md b/models/doc_descriptions/blocks/eth_blockchain.md deleted file mode 100644 index 96aa9d75..00000000 --- a/models/doc_descriptions/blocks/eth_blockchain.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_blockchain %} - -The blockchain on which transactions are being confirmed. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_blocks_hash.md b/models/doc_descriptions/blocks/eth_blocks_hash.md deleted file mode 100644 index 0784bc0c..00000000 --- a/models/doc_descriptions/blocks/eth_blocks_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_blocks_hash %} - -The hash of the block header for a given block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_blocks_nonce.md b/models/doc_descriptions/blocks/eth_blocks_nonce.md deleted file mode 100644 index a8c68987..00000000 --- a/models/doc_descriptions/blocks/eth_blocks_nonce.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_blocks_nonce %} - -Block nonce is a value used during mining to demonstrate proof of work for a given block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_blocks_table_doc.md b/models/doc_descriptions/blocks/eth_blocks_table_doc.md deleted file mode 100644 index 90ab6e89..00000000 --- a/models/doc_descriptions/blocks/eth_blocks_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_blocks_table_doc %} - -This table contains block level data for the Ethereum Blockchain. This table can be used to analyze trends at a block level, for example gas fees vs. total transactions over time. For more information, please see [Etherscan Resources](https://etherscan.io/directory/Learning_Resources/Ethereum) or [The Ethereum Organization](https://ethereum.org/en/developers/docs/blocks/) - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_difficulty.md b/models/doc_descriptions/blocks/eth_difficulty.md deleted file mode 100644 index 903dfa76..00000000 --- a/models/doc_descriptions/blocks/eth_difficulty.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_difficulty %} - -The effort required to mine the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_extra_data.md b/models/doc_descriptions/blocks/eth_extra_data.md deleted file mode 100644 index 26488386..00000000 --- a/models/doc_descriptions/blocks/eth_extra_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_extra_data %} - -Any data included by the miner for a given block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_gas_limit.md b/models/doc_descriptions/blocks/eth_gas_limit.md deleted file mode 100644 index b3817aa1..00000000 --- a/models/doc_descriptions/blocks/eth_gas_limit.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_gas_limit %} - -Total gas limit provided by all transactions in the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_gas_used.md b/models/doc_descriptions/blocks/eth_gas_used.md deleted file mode 100644 index f8fe18c0..00000000 --- a/models/doc_descriptions/blocks/eth_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_gas_used %} - -Total gas used in the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_miner.md b/models/doc_descriptions/blocks/eth_miner.md deleted file mode 100644 index fe983647..00000000 --- a/models/doc_descriptions/blocks/eth_miner.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_miner %} - -Miner who successfully added a given block to the blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_network.md b/models/doc_descriptions/blocks/eth_network.md deleted file mode 100644 index 8d447abe..00000000 --- a/models/doc_descriptions/blocks/eth_network.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_network %} - -The network on the blockchain used by a transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_parent_hash.md b/models/doc_descriptions/blocks/eth_parent_hash.md deleted file mode 100644 index a78e2596..00000000 --- a/models/doc_descriptions/blocks/eth_parent_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_parent_hash %} - -The hash of the block from which a given block is generated. Also known as the parent block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_receipts_root.md b/models/doc_descriptions/blocks/eth_receipts_root.md deleted file mode 100644 index 3c7c8ef1..00000000 --- a/models/doc_descriptions/blocks/eth_receipts_root.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_receipts_root %} - -The root of the state trie. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_sha3_uncles.md b/models/doc_descriptions/blocks/eth_sha3_uncles.md deleted file mode 100644 index 9a2af7df..00000000 --- a/models/doc_descriptions/blocks/eth_sha3_uncles.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_sha3_uncles %} - -The mechanism which Ethereum Javascript RLP encodes an empty string. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_size.md b/models/doc_descriptions/blocks/eth_size.md deleted file mode 100644 index e4b47647..00000000 --- a/models/doc_descriptions/blocks/eth_size.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_size %} - -Block size, which is determined by a given block's gas limit. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_total_difficulty.md b/models/doc_descriptions/blocks/eth_total_difficulty.md deleted file mode 100644 index a72cb0fb..00000000 --- a/models/doc_descriptions/blocks/eth_total_difficulty.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_total_difficulty %} - -Total difficulty of the chain at a given block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_tx_count.md b/models/doc_descriptions/blocks/eth_tx_count.md deleted file mode 100644 index 8dba31b4..00000000 --- a/models/doc_descriptions/blocks/eth_tx_count.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_count %} - -Total number of transactions within a block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/eth_uncle_blocks.md b/models/doc_descriptions/blocks/eth_uncle_blocks.md deleted file mode 100644 index 447f24a0..00000000 --- a/models/doc_descriptions/blocks/eth_uncle_blocks.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_uncle_blocks %} - -Uncle blocks occur when two blocks are mined and broadcasted at the same time, with the same block number. The block validated across the most nodes will be added to the primary chain, and the other one becomes an uncle block. Miners do receive rewards for uncle blocks. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/bridge/evm_bridge_activity.md b/models/doc_descriptions/bridge/evm_bridge_activity.md deleted file mode 100644 index 82ea3dce..00000000 --- a/models/doc_descriptions/bridge/evm_bridge_activity.md +++ /dev/null @@ -1,83 +0,0 @@ -{% docs evm_bridge_table_doc %} - -A convenience table that aggregates bridge activity from event_logs, traces and transfers, including bridge deposits and transfers sent from the following protocols: ACROSS, ALLBRIDGE, AXELAR, CELER, CBRIDGE, DLN, DEBRIDGE, EYWA, HOP, MESON, MULTICHAIN, NATIVE, STARGATE, SYMBIOSIS, SYNAPSE, WORMHOLE along with other helpful columns, including an amount USD where available. Note, this table only includes records for the protocols listed above with live, onchain bridge activity and may not represent the complete bridging picture. - -{% enddocs %} - -{% docs evm_bridge_platform %} - -The platform or protocol from which the bridge transaction or event originates. - -{% enddocs %} - -{% docs evm_bridge_origin_from %} - -The from address where the transaction originated from. This may be an EOA or contract address, however in most cases this is the user that initiated the bridge deposit or transfer. - -{% enddocs %} - -{% docs evm_bridge_sender %} - -The address that initiated the bridge deposit or transfer. This address is the sender of the tokens/assets being bridged to the destination chain. This may be an EOA or contract address. - -{% enddocs %} - -{% docs evm_bridge_receiver %} - -The designated address set to receive the deposit or transfer. This may be an EOA or contract address. - -{% enddocs %} - -{% docs evm_bridge_destination_chain_receiver %} - -The designated address set to receive the bridged tokens on the target chain after the completion of the bridge transaction. For non-evm chains, the hex address is decoded/encoded to match the data format of the destination chain, where possible. This may be an EOA or contract address. - -{% enddocs %} - -{% docs evm_bridge_destination_chain %} - -The name of the blockchain network to which the assets are being bridged. It could be any EVM compatible chain or other blockchain networks that the bridging protocol supports. - -{% enddocs %} - -{% docs evm_bridge_destination_chain_id %} - -The numeric identifier associated with the destination blockchain network. This is specific to the chain and helps in uniquely identifying it. - -{% enddocs %} - -{% docs evm_bridge_address %} - -The address of the contract responsible for handling the bridge deposit or transfer. This contract mediates the transfer and ensures that assets are sent and received appropriately. - -{% enddocs %} - -{% docs evm_bridge_token_address %} - -The address associated with the token that is being bridged. It provides a unique identifier for the token within its origin blockchain. - -{% enddocs %} - -{% docs evm_bridge_token_symbol %} - -The symbol representing the token being bridged. This provides a shorthand representation of the token. - -{% enddocs %} - -{% docs evm_bridge_amount_unadj %} - -The raw, non-decimal adjusted amount of tokens involved in the bridge transaction. - -{% enddocs %} - -{% docs evm_bridge_amount %} - -The decimal adjusted amount of tokens involved in the bridge transaction, where available. - -{% enddocs %} - -{% docs evm_bridge_amount_usd %} - -The value of the bridged tokens in USD at the time of the bridge transaction, where available. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/complete_lending/complete_lending_column_docs.md b/models/doc_descriptions/complete_lending/complete_lending_column_docs.md deleted file mode 100644 index 47abca4f..00000000 --- a/models/doc_descriptions/complete_lending/complete_lending_column_docs.md +++ /dev/null @@ -1,381 +0,0 @@ -{% docs complete_lending_borrow_rate_mode %} - -The rate mode the user is swapping from. Stable: 1, Variable: 2. Borrowers can switch between the stable and variable rate at any time. Stable rates act as a fixed rate in the short-term, but can be re-balanced in the long-term in response to changes in market conditions. The variable rate is the rate based on the offer and demand. The stable rate, as its name indicates, will remain pretty stable and its the best option to plan how much interest you will have to pay. The variable rate will change over time and could be the optimal rate depending on market conditions. - -{% enddocs %} - -{% docs complete_lending_borrow_rate_stable %} - -The stable interest rate for borrowing assets. - -{% enddocs %} - -{% docs complete_lending_borrow_rate_variable %} - -The variable interest rate for borrowing assets. - -{% enddocs %} - -{% docs complete_lending_collateral_complete_lending_token %} - -The interest bearing token that's burned when a liquidation occurs. - -{% enddocs %} - -{% docs complete_lending_collateral_asset %} - -The asset provided as collateral, which can be liquidated. - -{% enddocs %} - -{% docs complete_lending_data_provider %} - -The protocol data provider contract address. - -{% enddocs %} - -{% docs complete_lending_debt_complete_lending_token %} - -The interest bearing token representing the debt. - -{% enddocs %} - -{% docs complete_lending_debt_asset %} - -The debt asset, which the user borrowed. - -{% enddocs %} - -{% docs complete_lending_debt_to_cover_amount %} - -The amount of debt the user must cover. - -{% enddocs %} - -{% docs complete_lending_debt_to_cover_amount_usd %} - -The amount of debt the user must cover, valued in USD. - -{% enddocs %} - -{% docs complete_lending_depositor_address %} - -The depositor's address. - -{% enddocs %} - -{% docs complete_lending_end_voting_period %} - -The block number in which the voting period ends. - -{% enddocs %} - -{% docs complete_lending_flashloan_amount %} - -The amount of assets flash loaned. - -{% enddocs %} - -{% docs complete_lending_flashloan_amount_usd %} - -The value of the flash loan amount, in USD. - -{% enddocs %} - -{% docs complete_lending_governance_contract %} - -The governance contract address. - -{% enddocs %} - -{% docs complete_lending_initiator_address %} - -The address that initiated the flash loan. - -{% enddocs %} - -{% docs complete_lending_issued_tokens %} - -The amount of tokens that the user is depositing. - -{% enddocs %} - -{% docs complete_lending_lending_pool_contract %} - -The address of the lending pool. - -{% enddocs %} - -{% docs complete_lending_liquidated_amount %} - -The amount of asset liquidated. - -{% enddocs %} - -{% docs complete_lending_liquidated_amount_usd %} - -The value of the liquidated asset, in USD. - -{% enddocs %} - -{% docs complete_lending_liquidator %} - -The address that initiated the liquidation call. - -{% enddocs %} - -{% docs complete_lending_market %} - -The asset contract for the applicable market. - -{% enddocs %} - -{% docs complete_lending_payer %} - -The address that initiated the repayment. - -{% enddocs %} - -{% docs complete_lending_premium_amount %} - -The flash loan fee, changeable via the normal governance process, decimal adjusted. - -{% enddocs %} - -{% docs complete_lending_premium_amount_usd %} - -The flash loan fee, valued in USD. - -{% enddocs %} - -{% docs complete_lending_proposal_id %} - -The unique ID representing a proposal. - -{% enddocs %} - -{% docs complete_lending_proposal_tx %} - -The transaction confirming a proposal submission. - -{% enddocs %} - -{% docs complete_lending_proposer %} - -The user's address that submitted the proposal. - -{% enddocs %} - -{% docs complete_lending_repayed_tokens %} - -The amount of tokens repaid. - -{% enddocs %} - -{% docs complete_lending_repayed_usd %} - -The value of repaid tokens, in USD. - -{% enddocs %} - -{% docs complete_lending_stable_debt_token_address %} - -Debt tokens are interest-accruing tokens that are minted and burned on borrow and repay, representing a debt to the protocol with a stable interest rate. - -{% enddocs %} - -{% docs complete_lending_start_voting_period %} - -The block number in which the voting period begins. - -{% enddocs %} - -{% docs complete_lending_status %} - -The proposal's status. - -{% enddocs %} - -{% docs complete_lending_supplied_usd %} - -The value of the asset in USD that the user is depositing. - -{% enddocs %} - -{% docs complete_lending_supply_rate %} - -The interest rate for supplying assets to the protocol. - -{% enddocs %} - -{% docs complete_lending_support %} - -A value indicating their vote (For: true, Against: false). - -{% enddocs %} - -{% docs complete_lending_target_address %} - -The address receiving the flash loan. - -{% enddocs %} - -{% docs complete_lending_targets %} - -List of the targeted addresses by proposal transactions. - -{% enddocs %} - -{% docs complete_lending_token %} - -The interest bearing token contract. - -{% enddocs %} - -{% docs complete_lending_total_liquidity_token %} - -The total supply of liquidity tokens. - -{% enddocs %} - -{% docs complete_lending_total_liquidity_usd %} - -The total value of liquidity tokens, in USD. - -{% enddocs %} - -{% docs complete_lending_total_stable_debt_token %} - -The total supply of debt tokens, representing a debt to the protocol with a stable interest rate. - -{% enddocs %} - -{% docs complete_lending_total_stable_debt_usd %} - -The total USD value of debt tokens, representing a debt to the protocol with a stable interest rate. -{% enddocs %} - -{% docs complete_lending_total_variable_debt_token %} - -The total supply of debt tokens, representing a debt to the protocol with a variable interest rate. - -{% enddocs %} - -{% docs complete_lending_total_variable_debt_usd %} - -The total USD value of debt tokens, representing a debt to the protocol with a variable interest rate. -{% enddocs %} - -{% docs complete_lending_utilization_rate %} - -The percentage of assets loaned out. - -{% enddocs %} - -{% docs complete_lending_variable_debt_token_address %} - -Debt tokens are interest-accruing tokens that are minted and burned on borrow and repay, representing a debt to the protocol with a variable interest rate. - -{% enddocs %} - -{% docs complete_lending_version %} - -The contract version. Example: Aave AMM, Aave v1, Aave v2 - -{% enddocs %} - -{% docs complete_lending_withdrawn_tokens %} - -The amount of tokens withdrawn. - -{% enddocs %} - -{% docs complete_lending_withdrawn_usd %} - -The value of withdrawn tokens, in USD. - -{% enddocs %} - -{% docs complete_lending_platform %} - -The specific protocol where lending event occurred. - -{% enddocs %} - -{% docs complete_lending_protocol_token %} - -The protocol's specific lending asset token, ie cWBTC or aETHUni. - -{% enddocs %} - -{% docs complete_lending_borrower %} - -Address that initiated the borrow event. - -{% enddocs %} - -{% docs complete_lending_amount %} - -The decimal adjusted amount of tokens involved in the lending transaction, where available. - -{% enddocs %} - -{% docs complete_lending_amount_usd %} - -The value of the tokens in USD at the time of the lending transaction, where available. - -{% enddocs %} - -{% docs complete_lending_token_address %} - -The address of the token associated with the lending action. - -{% enddocs %} - -{% docs complete_lending_token_symbol %} - -The symbol of the token associated with the lending action. - -{% enddocs %} - -{% docs complete_lending_depositor %} - -Address that initiated a deposit event. - -{% enddocs %} - -{% docs complete_lending_amount_unadj %} - -The non-decimal adjusted amount of tokens involved in the lending transaction. - -{% enddocs %} - -{% docs complete_lending_premium_amount_unadj %} - -The flash loan fee, changeable via the normal governance process, non-decimal adjusted. - -{% enddocs %} - -{% docs complete_lending_flashloan_amount_unadj %} - -The amount of assets flash loaned, non-decimal adjusted. - -{% enddocs %} - -{% docs complete_lending_flashloan_token %} - -The flashloaned token address. - -{% enddocs %} - -{% docs complete_lending_flashloan_token_symbol %} - -The flashloaned token symbol - -{% enddocs %} - -{% docs borrower %} - -Its the address of the user who is Borrowing or repaying the loan, depending on the action. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/complete_lending/complete_lending_table_docs.md b/models/doc_descriptions/complete_lending/complete_lending_table_docs.md deleted file mode 100644 index 7ee5c5be..00000000 --- a/models/doc_descriptions/complete_lending/complete_lending_table_docs.md +++ /dev/null @@ -1,36 +0,0 @@ -{% docs complete_lending_borrows_table_doc %} - -This table contains transactions where users borrowed assets across AAVE, COMPOUND, CREAM, FLUX, FRAXLEND, MORPHO, RADIANT, SILO, SPARK, STRIKE, STURDY, and UWU protocols. In order to borrow assets, a user must first deposit their preferred asset and amount as collateral. MORPHO required trace-level curation; as a result, certain columns exclusive to event logs, such as event index, will contain NULL values. - - -{% enddocs %} - -{% docs complete_lending_deposits_table_doc %} - -This table contains deposit transactions across AAVE, COMPOUND, CREAM, FLUX, FRAXLEND, MORPHO, RADIANT, SILO, SPARK, STRIKE, STURDY, and UWU protocols. A user deposits their preferred asset and amount. After depositing, users earn passive income based on the market borrowing demand. Additionally, depositing allows users to borrow by using their deposited assets as a collateral. Any interest earned by depositing funds helps offset the interest rate accumulated by borrowing. MORPHO required trace-level curation; as a result, certain columns exclusive to event logs, such as event index, will contain NULL values. - -{% enddocs %} - -{% docs complete_lending_flashloans_table_doc %} - -This table contains flash loan transactions across AAVE, MORPHO, RADIANT, SPARK, AND UWU protocols. Flash loans are a feature designed for developers, due to the technical knowledge required to execute one. Flash Loans allow you to borrow any available amount of assets without providing any collateral, as long as the liquidity is returned to the protocol within one block transaction. - -{% enddocs %} - -{% docs complete_lending_liquidations_table_doc %} - -This table contains transactions in which a borrower's collateral asset is liquidated across AAVE, COMPOUND, CREAM, FLUX, FRAXLEND, MORPHO, RADIANT, SILO, SPARK, STRIKE, STURDY, and UWU protocols. Liquidations occur when a borrower's health factor goes below 1 due to their collateral value not properly covering their loan/debt value. This might happen when the collateral decreases in value or the borrowed debt increases in value against each other. This collateral vs loan value ratio is shown in the health factor. In a liquidation, up to 50% of a borrower's debt is repaid and that value + liquidation fee is taken from the collateral available, so after a liquidation the amount liquidated from one's debt is repaid. - -{% enddocs %} - -{% docs complete_lending_repayments_table_doc %} - -This table contains transactions in which a borrower repays their loan (debt) across the AAVE, COMPOUND, CREAM, FLUX, FRAXLEND, MORPHO, RADIANT, SILO, SPARK, STRIKE, STURDY, and UWU protocols. Loans are repaid in the same asset borrowed, plus accrued interest. Borrowers can pay back their loan based on the USD price as they can borrow any of the available stable coins (USDC, DAI, USDT, etc.). MORPHO required trace-level curation; as a result, certain columns exclusive to event logs, such as event index, will contain NULL values. - -{% enddocs %} - -{% docs complete_lending_withdraws_table_doc %} - -This table contains transactions in which a user withdraws liquidity across the AAVE, COMPOUND, CREAM, FLUX, FRAXLEND, MORPHO, RADIANT, SILO, SPARK, STRIKE, STURDY, and UWU protocols. Users need to make sure there is enough liquidity (not borrowed) in order to withdraw, if this is not the case, users need to wait for more liquidity from depositors or borrowers repaying. MORPHO required trace-level curation; as a result, certain columns exclusive to event logs, such as event index, will contain NULL values. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/all_ctoken.md b/models/doc_descriptions/compound/all_ctoken.md deleted file mode 100644 index e2aab4ce..00000000 --- a/models/doc_descriptions/compound/all_ctoken.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_ctoken %} - -Address of the Compound token. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/all_ctoken_symbol.md b/models/doc_descriptions/compound/all_ctoken_symbol.md deleted file mode 100644 index 1aa75a4e..00000000 --- a/models/doc_descriptions/compound/all_ctoken_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_ctoken_symbol %} - -Symbol of the Compound token. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/borrows_borrower.md b/models/doc_descriptions/compound/borrows_borrower.md deleted file mode 100644 index b36075ff..00000000 --- a/models/doc_descriptions/compound/borrows_borrower.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs borrows_borrower %} - -Address that initiated a borrow event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/borrows_borrows_contract_address.md b/models/doc_descriptions/compound/borrows_borrows_contract_address.md deleted file mode 100644 index 5059ba14..00000000 --- a/models/doc_descriptions/compound/borrows_borrows_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs borrows_contract_address %} - -Address of borrowed token. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/borrows_borrows_contract_symbol.md b/models/doc_descriptions/compound/borrows_borrows_contract_symbol.md deleted file mode 100644 index f28592a3..00000000 --- a/models/doc_descriptions/compound/borrows_borrows_contract_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs borrows_contract_symbol %} - -Symbol of borrowed token. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/borrows_loan_amount.md b/models/doc_descriptions/compound/borrows_loan_amount.md deleted file mode 100644 index 9faf0db0..00000000 --- a/models/doc_descriptions/compound/borrows_loan_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs borrows_loan_amount %} - -Native amount of borrow (decimal adjusted). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/borrows_loan_amount_usd.md b/models/doc_descriptions/compound/borrows_loan_amount_usd.md deleted file mode 100644 index 3ba03a97..00000000 --- a/models/doc_descriptions/compound/borrows_loan_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs borrows_loan_amount_usd %} - -The equivalent borrow amount in USD. Note this is computed by taking the average hourly price around the time of the tx event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/borrows_table_doc.md b/models/doc_descriptions/compound/borrows_table_doc.md deleted file mode 100644 index b4b9c746..00000000 --- a/models/doc_descriptions/compound/borrows_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs borrows_table_doc %} - -Borrows exist within the compound schema, as compound.ez_borrows - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/comp_asset_table_doc.md b/models/doc_descriptions/compound/comp_asset_table_doc.md deleted file mode 100644 index 9224fe42..00000000 --- a/models/doc_descriptions/compound/comp_asset_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs comp_asset_table_doc %} - -Contains details, such as decimals, name, and other relevant contract metadata for Compound assets. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/comp_ctoken_decimals.md b/models/doc_descriptions/compound/comp_ctoken_decimals.md deleted file mode 100644 index dc482603..00000000 --- a/models/doc_descriptions/compound/comp_ctoken_decimals.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs comp_ctoken_decimals %} - -The cToken decimals. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/comp_ctoken_name.md b/models/doc_descriptions/compound/comp_ctoken_name.md deleted file mode 100644 index ca2d5273..00000000 --- a/models/doc_descriptions/compound/comp_ctoken_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs comp_ctoken_name %} - -The cToken name. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/comp_ctoken_symbol.md b/models/doc_descriptions/compound/comp_ctoken_symbol.md deleted file mode 100644 index 507cd2c2..00000000 --- a/models/doc_descriptions/compound/comp_ctoken_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs comp_ctoken_symbol %} - -The cToken symbol. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/comp_redeemer.md b/models/doc_descriptions/compound/comp_redeemer.md deleted file mode 100644 index 1f7eb8d5..00000000 --- a/models/doc_descriptions/compound/comp_redeemer.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs comp_redeemer %} - -Address of the redeemer. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/comp_underlying.md b/models/doc_descriptions/compound/comp_underlying.md deleted file mode 100644 index 0159751f..00000000 --- a/models/doc_descriptions/compound/comp_underlying.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs comp_underlying %} - -The underlying asset for the cToken. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/comp_underlying_decimals.md b/models/doc_descriptions/compound/comp_underlying_decimals.md deleted file mode 100644 index 934ef32f..00000000 --- a/models/doc_descriptions/compound/comp_underlying_decimals.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs comp_underlying_decimals %} - -The underlying asset decimals. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/comp_underlying_name.md b/models/doc_descriptions/compound/comp_underlying_name.md deleted file mode 100644 index 6ca2b29d..00000000 --- a/models/doc_descriptions/compound/comp_underlying_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs comp_underlying_name %} - -The underlying asset name. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/comp_underlying_symbol.md b/models/doc_descriptions/compound/comp_underlying_symbol.md deleted file mode 100644 index ad48e901..00000000 --- a/models/doc_descriptions/compound/comp_underlying_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs comp_underlying_symbol %} - -The underlying asset symbol. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/deposits_issued_ctokens.md b/models/doc_descriptions/compound/deposits_issued_ctokens.md deleted file mode 100644 index 8e29b0c9..00000000 --- a/models/doc_descriptions/compound/deposits_issued_ctokens.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs deposits_issued_ctokens %} - -Amount of cToken issued for providing liquidity. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/deposits_supplied_base_asset.md b/models/doc_descriptions/compound/deposits_supplied_base_asset.md deleted file mode 100644 index 6f07b6f1..00000000 --- a/models/doc_descriptions/compound/deposits_supplied_base_asset.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs deposits_supplied_base_asset %} - -Native amount provided as liquidity (decimal adjusted). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/deposits_supplied_base_asset_usd.md b/models/doc_descriptions/compound/deposits_supplied_base_asset_usd.md deleted file mode 100644 index a9324024..00000000 --- a/models/doc_descriptions/compound/deposits_supplied_base_asset_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs deposits_supplied_base_asset_usd %} - -The equivalent liquidity amount in USD. Note this is computed by taking the average hourly price around the time of the tx event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/deposits_supplied_contract_addr.md b/models/doc_descriptions/compound/deposits_supplied_contract_addr.md deleted file mode 100644 index 39ae6d0d..00000000 --- a/models/doc_descriptions/compound/deposits_supplied_contract_addr.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs deposits_supplied_contract_addr %} - -Address of token provided liquidity for. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/deposits_supplied_symbol.md b/models/doc_descriptions/compound/deposits_supplied_symbol.md deleted file mode 100644 index 02118b87..00000000 --- a/models/doc_descriptions/compound/deposits_supplied_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs deposits_supplied_symbol %} - -Symbol of token provided liquidity for. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/deposits_supplier.md b/models/doc_descriptions/compound/deposits_supplier.md deleted file mode 100644 index db2c116a..00000000 --- a/models/doc_descriptions/compound/deposits_supplier.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs deposits_supplier %} - -Address of liquidity provider. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/deposits_table_doc.md b/models/doc_descriptions/compound/deposits_table_doc.md deleted file mode 100644 index 5e94d68f..00000000 --- a/models/doc_descriptions/compound/deposits_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs deposits_table_doc %} - -Deposits exist within the compound schema, as compound.ez_deposits - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/liquidations_ctokens_seized.md b/models/doc_descriptions/compound/liquidations_ctokens_seized.md deleted file mode 100644 index b40e5ef2..00000000 --- a/models/doc_descriptions/compound/liquidations_ctokens_seized.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs liquidations_ctokens_seized %} - -cToken collateral held by the insolvent borrower that is taken by the liquidator. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/liquidations_liquidation_amount.md b/models/doc_descriptions/compound/liquidations_liquidation_amount.md deleted file mode 100644 index 586eb7a2..00000000 --- a/models/doc_descriptions/compound/liquidations_liquidation_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs liquidations_liquidation_amount %} - -Native amount liquidated (decimal adjusted). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/liquidations_liquidation_contract_address.md b/models/doc_descriptions/compound/liquidations_liquidation_contract_address.md deleted file mode 100644 index 56208e5c..00000000 --- a/models/doc_descriptions/compound/liquidations_liquidation_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs liquidations_liquidation_contract_address %} - -Address of liquidated token. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/liquidations_liquidation_contract_symbol.md b/models/doc_descriptions/compound/liquidations_liquidation_contract_symbol.md deleted file mode 100644 index 96540b03..00000000 --- a/models/doc_descriptions/compound/liquidations_liquidation_contract_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs liquidations_liquidation_contract_symbol %} - -Symbol of liquidated token. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/liquidations_liquidations_amount_usd.md b/models/doc_descriptions/compound/liquidations_liquidations_amount_usd.md deleted file mode 100644 index ed15eb71..00000000 --- a/models/doc_descriptions/compound/liquidations_liquidations_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs liquidations_liquidations_amount_usd %} - -The equivalent liquidated amount in USD. Note this is computed by taking the average hourly price around the time of the tx event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/liquidations_liquidator.md b/models/doc_descriptions/compound/liquidations_liquidator.md deleted file mode 100644 index e530d9c5..00000000 --- a/models/doc_descriptions/compound/liquidations_liquidator.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs liquidations_liquidator %} - -Address that got liquidated. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/liquidations_table_doc.md b/models/doc_descriptions/compound/liquidations_table_doc.md deleted file mode 100644 index e6475a63..00000000 --- a/models/doc_descriptions/compound/liquidations_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs liquidations_table_doc %} - -Liquidations exist within the compound schema, as compound.ez_liquidations - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats.underlying_contract.md b/models/doc_descriptions/compound/market_stats.underlying_contract.md deleted file mode 100644 index 2626dcdd..00000000 --- a/models/doc_descriptions/compound/market_stats.underlying_contract.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_underlying_contract %} - -Address of the underlying token the market serves (i.e. USDC). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_block_hour.md b/models/doc_descriptions/compound/market_stats_block_hour.md deleted file mode 100644 index d061458c..00000000 --- a/models/doc_descriptions/compound/market_stats_block_hour.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_block_hour %} - -Market stats are aggregated by hour in UTC. date_trunc(‘hour’,block_timestamp) for joins on other tables. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_borrows_apy.md b/models/doc_descriptions/compound/market_stats_borrows_apy.md deleted file mode 100644 index 02d6aea4..00000000 --- a/models/doc_descriptions/compound/market_stats_borrows_apy.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_borrow_apy %} - -The borrower’s APY in terms of the underlying asset. It depends on the exchange rate between the cToken/underlying token (cUSDC/USDC). This is interest paid by the borrower on their loan. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_borrows_token_amount.md b/models/doc_descriptions/compound/market_stats_borrows_token_amount.md deleted file mode 100644 index bdc730b3..00000000 --- a/models/doc_descriptions/compound/market_stats_borrows_token_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_borrows_token_amount %} - -Amount borrowed from the market. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_borrows_usd.md b/models/doc_descriptions/compound/market_stats_borrows_usd.md deleted file mode 100644 index 9d4b693b..00000000 --- a/models/doc_descriptions/compound/market_stats_borrows_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_borrows_usd %} - -Borrows converted to USD values as of the hour recorded. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_comp_apy_borrow.md b/models/doc_descriptions/compound/market_stats_comp_apy_borrow.md deleted file mode 100644 index 1d7ffe78..00000000 --- a/models/doc_descriptions/compound/market_stats_comp_apy_borrow.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_comp_apy_borrow %} - -The APY one can expect based on COMP governance tokens distributed (which in turn can be staked elsewhere, or used in voting). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_comp_apy_supply.md b/models/doc_descriptions/compound/market_stats_comp_apy_supply.md deleted file mode 100644 index 3d9267d6..00000000 --- a/models/doc_descriptions/compound/market_stats_comp_apy_supply.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_comp_apy_supply %} - -The APY one can expect based on COMP governance tokens distributed (which in turn can be staked elsewhere, or used in voting). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_comp_price.md b/models/doc_descriptions/compound/market_stats_comp_price.md deleted file mode 100644 index 03dbf61f..00000000 --- a/models/doc_descriptions/compound/market_stats_comp_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_comp_price %} - -The price of the COMP governance token. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_comp_speed.md b/models/doc_descriptions/compound/market_stats_comp_speed.md deleted file mode 100644 index ed24d8c4..00000000 --- a/models/doc_descriptions/compound/market_stats_comp_speed.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_comp_speed %} - -COMP is a governance token distributed equally to both suppliers and borrowers (the idea being the users of the protocol are also the ones who should be able to vote on governance actions). Comp speed controls the rate at which comp is distributed to users of the market, per block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_comp_speed_usd.md b/models/doc_descriptions/compound/market_stats_comp_speed_usd.md deleted file mode 100644 index c59395d8..00000000 --- a/models/doc_descriptions/compound/market_stats_comp_speed_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_comp_speed_usd %} - -Comp distributed to markets converted to USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_contract_name.md b/models/doc_descriptions/compound/market_stats_contract_name.md deleted file mode 100644 index 22c16069..00000000 --- a/models/doc_descriptions/compound/market_stats_contract_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_contract_name %} - -market/cToken name - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_ctoken_price.md b/models/doc_descriptions/compound/market_stats_ctoken_price.md deleted file mode 100644 index 213f81db..00000000 --- a/models/doc_descriptions/compound/market_stats_ctoken_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_ctoken_price %} - -Price of the cToken (i.e. cUSDC). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_reserves_token_amount.md b/models/doc_descriptions/compound/market_stats_reserves_token_amount.md deleted file mode 100644 index a690978e..00000000 --- a/models/doc_descriptions/compound/market_stats_reserves_token_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_reserves_token_amount %} - -Reserves are amounts set aside by the market that can be used/affected by governance actions through proposals voted on by COMP holders. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_reserves_usd.md b/models/doc_descriptions/compound/market_stats_reserves_usd.md deleted file mode 100644 index c6c74718..00000000 --- a/models/doc_descriptions/compound/market_stats_reserves_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_reserves_usd %} - -Reserves converted to USD values as of the hour recorded. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_supply_apy.md b/models/doc_descriptions/compound/market_stats_supply_apy.md deleted file mode 100644 index 3942ae2f..00000000 --- a/models/doc_descriptions/compound/market_stats_supply_apy.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_supply_apy %} - -The supplier’s APY in terms of the underlying asset. It depends on the exchange rate between the cToken/underlying token (cUSDC/USDC). This is interest paid to the supplier for their stake. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_supply_token_amount.md b/models/doc_descriptions/compound/market_stats_supply_token_amount.md deleted file mode 100644 index e80e4ec6..00000000 --- a/models/doc_descriptions/compound/market_stats_supply_token_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_supply_token_amount %} - -Amount (in terms of the cToken) supplied to the market through suppliers. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_supply_usd.md b/models/doc_descriptions/compound/market_stats_supply_usd.md deleted file mode 100644 index ee3a8f85..00000000 --- a/models/doc_descriptions/compound/market_stats_supply_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_supply_usd %} - -Supply converted to USD values as of the hour recorded. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_table_doc.md b/models/doc_descriptions/compound/market_stats_table_doc.md deleted file mode 100644 index e03a1247..00000000 --- a/models/doc_descriptions/compound/market_stats_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_table_doc %} - -Market Stats exist within the compound schema, as compound.ez_market_stats - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_token_price.md b/models/doc_descriptions/compound/market_stats_token_price.md deleted file mode 100644 index ae08494e..00000000 --- a/models/doc_descriptions/compound/market_stats_token_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_token_price %} - -Price of the underlying token (i.e. USDC). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/market_stats_underlying_symbol.md b/models/doc_descriptions/compound/market_stats_underlying_symbol.md deleted file mode 100644 index c109c267..00000000 --- a/models/doc_descriptions/compound/market_stats_underlying_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs market_stats_underlying_symbol %} - -Symbol of the underlying token the market serves. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/redemptions_received_amount.md b/models/doc_descriptions/compound/redemptions_received_amount.md deleted file mode 100644 index bae9fa7b..00000000 --- a/models/doc_descriptions/compound/redemptions_received_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs redemptions_received_amount %} - -Native amount provided as liquidity (decimal adjusted). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/redemptions_received_amount_usd.md b/models/doc_descriptions/compound/redemptions_received_amount_usd.md deleted file mode 100644 index d73b5051..00000000 --- a/models/doc_descriptions/compound/redemptions_received_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs redemptions_received_amount_usd %} - -The equivalent liquidity amount in USD. Note this is computed by taking the average hourly price around the time of the tx event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/redemptions_received_contract_address.md b/models/doc_descriptions/compound/redemptions_received_contract_address.md deleted file mode 100644 index ba3d66f3..00000000 --- a/models/doc_descriptions/compound/redemptions_received_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs redemptions_received_contract_address %} - -Address of token refunded as part of the redemption. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/redemptions_received_contract_symbol.md b/models/doc_descriptions/compound/redemptions_received_contract_symbol.md deleted file mode 100644 index 87787ac0..00000000 --- a/models/doc_descriptions/compound/redemptions_received_contract_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs redemptions_received_contract_symbol %} - -Symbol of token refunded as part of the redemption. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/redemptions_redeem_ctoken.md b/models/doc_descriptions/compound/redemptions_redeem_ctoken.md deleted file mode 100644 index e696340c..00000000 --- a/models/doc_descriptions/compound/redemptions_redeem_ctoken.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs redemptions_redeemed_ctoken %} - -cToken deposited to redeem - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/redemptions_table_doc.md b/models/doc_descriptions/compound/redemptions_table_doc.md deleted file mode 100644 index d6a60464..00000000 --- a/models/doc_descriptions/compound/redemptions_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs redemptions_table_doc %} - -Redemptions exist within the compound schema, as compound.ez_redemptions - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/repayments_payer.md b/models/doc_descriptions/compound/repayments_payer.md deleted file mode 100644 index 6b85fb0e..00000000 --- a/models/doc_descriptions/compound/repayments_payer.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs repayments_payer %} - -Address of user that paid out the loan - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/repayments_repay_contract_address.md b/models/doc_descriptions/compound/repayments_repay_contract_address.md deleted file mode 100644 index d3d9dae6..00000000 --- a/models/doc_descriptions/compound/repayments_repay_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs repayments_repay_contract_address %} - -Address of token refunded as part of the redemption - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/repayments_repay_contract_symbol.md b/models/doc_descriptions/compound/repayments_repay_contract_symbol.md deleted file mode 100644 index 63c52df8..00000000 --- a/models/doc_descriptions/compound/repayments_repay_contract_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs repayments_repay_contract_symbol %} - -Symbol of token refunded as part of the redemption - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/repayments_repayed_amount.md b/models/doc_descriptions/compound/repayments_repayed_amount.md deleted file mode 100644 index 0c06a5d4..00000000 --- a/models/doc_descriptions/compound/repayments_repayed_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs repayments_repayed_amount %} - -Native amount repaid on loan (decimal adjusted) - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/repayments_repayed_amount_usd.md b/models/doc_descriptions/compound/repayments_repayed_amount_usd.md deleted file mode 100644 index 335cd282..00000000 --- a/models/doc_descriptions/compound/repayments_repayed_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs repayments_repayed_amount_usd %} - -The equivalent repaid amount in USD. Note this is computed by taking the average hourly price around the time of the tx event - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/compound/repayments_table_doc.md b/models/doc_descriptions/compound/repayments_table_doc.md deleted file mode 100644 index 8794a80a..00000000 --- a/models/doc_descriptions/compound/repayments_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs repayments_table_doc %} - -Repayments exist within the compound schema, as compound.ez_repayments - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/eth_contracts_block_number.md b/models/doc_descriptions/contracts/eth_contracts_block_number.md deleted file mode 100644 index f9c213bd..00000000 --- a/models/doc_descriptions/contracts/eth_contracts_block_number.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_contracts_block_number %} - -The block number at which the contract was read and details recorded. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/eth_contracts_block_time.md b/models/doc_descriptions/contracts/eth_contracts_block_time.md deleted file mode 100644 index 18a2e4a6..00000000 --- a/models/doc_descriptions/contracts/eth_contracts_block_time.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_contracts_block_time %} - -The block timestamp at which the contract was read and details recorded. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/eth_contracts_contract_address.md b/models/doc_descriptions/contracts/eth_contracts_contract_address.md deleted file mode 100644 index 3847cea8..00000000 --- a/models/doc_descriptions/contracts/eth_contracts_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_contracts_contract_address %} - -The unique Ethereum address of the deployed contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/eth_contracts_metadata.md b/models/doc_descriptions/contracts/eth_contracts_metadata.md deleted file mode 100644 index 456617d4..00000000 --- a/models/doc_descriptions/contracts/eth_contracts_metadata.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_contracts_metadata %} - -This JSON column contains other relevant details for each contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/eth_contracts_name.md b/models/doc_descriptions/contracts/eth_contracts_name.md deleted file mode 100644 index a888da33..00000000 --- a/models/doc_descriptions/contracts/eth_contracts_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_contracts_name %} - -The name of the deployed contract. Please note this is not necessarily unique. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/eth_contracts_symbol.md b/models/doc_descriptions/contracts/eth_contracts_symbol.md deleted file mode 100644 index 75a57bd2..00000000 --- a/models/doc_descriptions/contracts/eth_contracts_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_contracts_symbol %} - -The symbol used to represent this contract. Please note this is not necessarily unique. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/eth_contracts_table_doc.md b/models/doc_descriptions/contracts/eth_contracts_table_doc.md deleted file mode 100644 index d11c5d14..00000000 --- a/models/doc_descriptions/contracts/eth_contracts_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_contracts_table_doc %} - -This table contains contract details for contracts deployed on the Ethereum blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/eth_creator_address.md b/models/doc_descriptions/contracts/eth_creator_address.md deleted file mode 100644 index 381c4cf9..00000000 --- a/models/doc_descriptions/contracts/eth_creator_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_creator_address %} - -The address of the contract creator. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/eth_logic_address.md b/models/doc_descriptions/contracts/eth_logic_address.md deleted file mode 100644 index 2012b742..00000000 --- a/models/doc_descriptions/contracts/eth_logic_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_logic_address %} - -The logic address, where applicable. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/eth_system_created_at.md b/models/doc_descriptions/contracts/eth_system_created_at.md deleted file mode 100644 index e227db8c..00000000 --- a/models/doc_descriptions/contracts/eth_system_created_at.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_system_created_at %} - -Internal column. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/eth_token_convention.md b/models/doc_descriptions/contracts/eth_token_convention.md deleted file mode 100644 index b496b227..00000000 --- a/models/doc_descriptions/contracts/eth_token_convention.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_token_convention %} - -The token standard utilized by this contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/dex_lp_deprecation.md b/models/doc_descriptions/dex/dex_lp_deprecation.md deleted file mode 100644 index 8cf03d73..00000000 --- a/models/doc_descriptions/dex/dex_lp_deprecation.md +++ /dev/null @@ -1,6 +0,0 @@ -{% docs dex_lp_deprecation %} - -Deprecating soon: This table will be upgraded to include liquidity pools for all applicable dexes. Please migrate queries to `defi.dim_dex_liquidity_pools`. This table will be deprecated on 08/17/2023. - -{% enddocs %} - diff --git a/models/doc_descriptions/dex/eth_dex_creation_block.md b/models/doc_descriptions/dex/eth_dex_creation_block.md deleted file mode 100644 index 96d5c47d..00000000 --- a/models/doc_descriptions/dex/eth_dex_creation_block.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_creation_block %} - -The block number of when this pool was created. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_creation_time.md b/models/doc_descriptions/dex/eth_dex_creation_time.md deleted file mode 100644 index 31935bf4..00000000 --- a/models/doc_descriptions/dex/eth_dex_creation_time.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_creation_time %} - -The block timestamp of when this pool was created. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_creation_tx.md b/models/doc_descriptions/dex/eth_dex_creation_tx.md deleted file mode 100644 index fec40c0d..00000000 --- a/models/doc_descriptions/dex/eth_dex_creation_tx.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_creation_tx %} - -The transaction where this contract was created. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_factory_address.md b/models/doc_descriptions/dex/eth_dex_factory_address.md deleted file mode 100644 index db5ad7d6..00000000 --- a/models/doc_descriptions/dex/eth_dex_factory_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_factory_address %} - -The address that created or deployed this pool, where available. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_lp_decimals.md b/models/doc_descriptions/dex/eth_dex_lp_decimals.md deleted file mode 100644 index 8ed344d6..00000000 --- a/models/doc_descriptions/dex/eth_dex_lp_decimals.md +++ /dev/null @@ -1,15 +0,0 @@ -{% docs eth_dex_lp_decimals %} - -The # of decimals for the token included in the liquidity pool, as a JSON object, where available. - -Query example to access the key:value pairing within the object: -SELECT - DISTINCT pool_address AS unique_pools, - tokens :token0 :: STRING AS token0, - symbols: token0 :: STRING AS token0_symbol, - decimals: token0 :: STRING AS token0_decimal -FROM ethereum.defi.dim_dex_liquidity_pools -WHERE token0_decimal = 6 -; - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_lp_symbols.md b/models/doc_descriptions/dex/eth_dex_lp_symbols.md deleted file mode 100644 index 869bb45a..00000000 --- a/models/doc_descriptions/dex/eth_dex_lp_symbols.md +++ /dev/null @@ -1,15 +0,0 @@ -{% docs eth_dex_lp_symbols %} - -The symbol for the token included in the liquidity pool, as a JSON object, where available. - -Query example to access the key:value pairing within the object: -SELECT - DISTINCT pool_address AS unique_pools, - tokens :token0 :: STRING AS token0, - symbols: token0 :: STRING AS token0_symbol, - decimals: token0 :: STRING AS token0_decimal -FROM ethereum.defi.dim_dex_liquidity_pools -WHERE token0_symbol = 'WETH' -; - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_lp_table_doc.md b/models/doc_descriptions/dex/eth_dex_lp_table_doc.md deleted file mode 100644 index 507a9812..00000000 --- a/models/doc_descriptions/dex/eth_dex_lp_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_lp_table_doc %} - -This table contains details on decentralized exchange (DEX) liquidity pools (LP) on the Ethereum blockchain, including the tokens, symbols and decimals within each pool alongside the following protocols: BALANCER, CURVE, DODO, FRAXSWAP, KYBERSWAP, MAVERICK, PANCAKESWAP, SHIBASWAP, SUSHISWAP, UNISWAP, TRADER JOE, VERSE . - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_lp_tokens.md b/models/doc_descriptions/dex/eth_dex_lp_tokens.md deleted file mode 100644 index 38341f5c..00000000 --- a/models/doc_descriptions/dex/eth_dex_lp_tokens.md +++ /dev/null @@ -1,15 +0,0 @@ -{% docs eth_dex_lp_tokens %} - -The address for the token included in the liquidity pool, as a JSON object. - -Query example to access the key:value pairing within the object: -SELECT - DISTINCT pool_address AS unique_pools, - tokens :token0 :: STRING AS token0, - symbols: token0 :: STRING AS token0_symbol, - decimals: token0 :: STRING AS token0_decimal -FROM ethereum.defi.dim_dex_liquidity_pools -WHERE token0 = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' -; - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_platform.md b/models/doc_descriptions/dex/eth_dex_platform.md deleted file mode 100644 index f6411070..00000000 --- a/models/doc_descriptions/dex/eth_dex_platform.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_platform %} - -The protocol or platform that the liquidity pool belongs to or swap occurred on. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_pool_address.md b/models/doc_descriptions/dex/eth_dex_pool_address.md deleted file mode 100644 index 1d4192d4..00000000 --- a/models/doc_descriptions/dex/eth_dex_pool_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_pool_address %} - -The contract address for the liquidity pool. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_pool_name.md b/models/doc_descriptions/dex/eth_dex_pool_name.md deleted file mode 100644 index 2fc289a4..00000000 --- a/models/doc_descriptions/dex/eth_dex_pool_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_pool_name %} - -The name of the liquidity pool, where available. In some cases, the pool name is a concatenation of symbols or token addresses. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_swaps_amount_in.md b/models/doc_descriptions/dex/eth_dex_swaps_amount_in.md deleted file mode 100644 index 8b1cf24a..00000000 --- a/models/doc_descriptions/dex/eth_dex_swaps_amount_in.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_amount_in %} - -The amount of tokens put into the swap. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_swaps_amount_in_unadj.md b/models/doc_descriptions/dex/eth_dex_swaps_amount_in_unadj.md deleted file mode 100644 index 0f82b78d..00000000 --- a/models/doc_descriptions/dex/eth_dex_swaps_amount_in_unadj.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_amount_in_unadj %} - -The non-decimal adjusted amount of tokens put into the swap. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_swaps_amount_in_usd.md b/models/doc_descriptions/dex/eth_dex_swaps_amount_in_usd.md deleted file mode 100644 index bfa46fd0..00000000 --- a/models/doc_descriptions/dex/eth_dex_swaps_amount_in_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_amount_in_usd %} - -The value of the swapped tokens in USD at the time of the transaction, where available. If there is a variance of 75% or greater in USD swap values or one side of the swap's USD value is NULL, then both amount_in_usd and amount_out_usd will be set to NULL. This avoids falsely overstating USD swap volumes for low-liquidity token pairings or incorrectly reported prices. To get USD values in these scenarios anyway, please re-join the `price.ez_prices_hourly` table. Note, this logic does not apply for the chain's Native asset. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_swaps_amount_out.md b/models/doc_descriptions/dex/eth_dex_swaps_amount_out.md deleted file mode 100644 index 34aab5ee..00000000 --- a/models/doc_descriptions/dex/eth_dex_swaps_amount_out.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_amount_out %} - -The amount of tokens taken out of or received from the swap. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_swaps_amount_out_unadj.md b/models/doc_descriptions/dex/eth_dex_swaps_amount_out_unadj.md deleted file mode 100644 index 0b225578..00000000 --- a/models/doc_descriptions/dex/eth_dex_swaps_amount_out_unadj.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_amount_out_unadj %} - -The non-decimal adjusted amount of tokens taken out of or received from the swap. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_swaps_amount_out_usd.md b/models/doc_descriptions/dex/eth_dex_swaps_amount_out_usd.md deleted file mode 100644 index 3b528371..00000000 --- a/models/doc_descriptions/dex/eth_dex_swaps_amount_out_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_amount_out_usd %} - -The value of the swapped tokens in USD at the time of the transaction, where available. If there is a variance of 75% or greater in USD swap values or one side of the swap's USD value is NULL, then both amount_in_usd and amount_out_usd will be set to NULL. This avoids falsely overstating USD swap volumes for low-liquidity token pairings or incorrectly reported prices. To get USD values in these scenarios anyway, please re-join the `price.ez_prices_hourly` table. Note, this logic does not apply for the chain's Native asset. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_swaps_sender.md b/models/doc_descriptions/dex/eth_dex_swaps_sender.md deleted file mode 100644 index 03a3abfc..00000000 --- a/models/doc_descriptions/dex/eth_dex_swaps_sender.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_sender %} - -The Router is the Sender in the swap function. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_swaps_symbol_in.md b/models/doc_descriptions/dex/eth_dex_swaps_symbol_in.md deleted file mode 100644 index 0f931bcf..00000000 --- a/models/doc_descriptions/dex/eth_dex_swaps_symbol_in.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_symbol_in %} - -The symbol of the token sent for swap. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_swaps_symbol_out.md b/models/doc_descriptions/dex/eth_dex_swaps_symbol_out.md deleted file mode 100644 index d440b24b..00000000 --- a/models/doc_descriptions/dex/eth_dex_swaps_symbol_out.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_symbol_out %} - -The symbol of the token being swapped to. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_swaps_token_In.md b/models/doc_descriptions/dex/eth_dex_swaps_token_In.md deleted file mode 100644 index a55bca2b..00000000 --- a/models/doc_descriptions/dex/eth_dex_swaps_token_In.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_token_in %} - -The address of the token sent for swap. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_swaps_token_out.md b/models/doc_descriptions/dex/eth_dex_swaps_token_out.md deleted file mode 100644 index 4695dc90..00000000 --- a/models/doc_descriptions/dex/eth_dex_swaps_token_out.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_token_out %} - -The address of the token being swapped to. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_swaps_tx_to.md b/models/doc_descriptions/dex/eth_dex_swaps_tx_to.md deleted file mode 100644 index 89e354cd..00000000 --- a/models/doc_descriptions/dex/eth_dex_swaps_tx_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_tx_to %} - -The tx_to is the address who receives the swapped token. This corresponds to the "to" field in the swap function. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_token0.md b/models/doc_descriptions/dex/eth_dex_token0.md deleted file mode 100644 index 76758f81..00000000 --- a/models/doc_descriptions/dex/eth_dex_token0.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_token0 %} - -Token 0 is the first token in the pair, and will show up first within the event logs for relevant transactions. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_dex_token1.md b/models/doc_descriptions/dex/eth_dex_token1.md deleted file mode 100644 index 40ec8c4e..00000000 --- a/models/doc_descriptions/dex/eth_dex_token1.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_token1 %} - -Token 1 is the second token in the pair, and will show up second within the event logs for relevant transactions. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex/eth_ez_dex_swaps_table_doc.md b/models/doc_descriptions/dex/eth_ez_dex_swaps_table_doc.md deleted file mode 100644 index baa67883..00000000 --- a/models/doc_descriptions/dex/eth_ez_dex_swaps_table_doc.md +++ /dev/null @@ -1,6 +0,0 @@ -{% docs eth_ez_dex_swaps_table_doc %} - -This table currently contains swap events from the ```fact_event_logs``` table for SUSHI, UNISWAP, CURVE, SYNTHETIX, BALANCER, DODO, FRAX, HASHFLOW, KYBERSWAP, MAVERICK, PANCAKESWAP, SHIBASWAP, TRADER JOE, VERSE AND WOOFI along with other helpful columns including an amount USD where possible. Other dexes coming soon! -Note: A rule has been put in place to null out the amount_USD if that number is too divergent between amount_in_USD and amount_out_usd. This can happen for swaps of less liquid tokens during very high fluctuation of price. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/eth_event_index.md b/models/doc_descriptions/event_logs/eth_event_index.md deleted file mode 100644 index 28592dcd..00000000 --- a/models/doc_descriptions/event_logs/eth_event_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_event_index %} - -Event number within a transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/eth_event_inputs.md b/models/doc_descriptions/event_logs/eth_event_inputs.md deleted file mode 100644 index 1d7abb06..00000000 --- a/models/doc_descriptions/event_logs/eth_event_inputs.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_event_inputs %} - -The decoded event inputs for a given event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/eth_event_name.md b/models/doc_descriptions/event_logs/eth_event_name.md deleted file mode 100644 index be3e4fdb..00000000 --- a/models/doc_descriptions/event_logs/eth_event_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_event_name %} - -The decoded event name for a given event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/eth_event_removed.md b/models/doc_descriptions/event_logs/eth_event_removed.md deleted file mode 100644 index 150f3a6d..00000000 --- a/models/doc_descriptions/event_logs/eth_event_removed.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_event_removed %} - -Whether the event has been removed from the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/eth_log_id_events.md b/models/doc_descriptions/event_logs/eth_log_id_events.md deleted file mode 100644 index 4910c53c..00000000 --- a/models/doc_descriptions/event_logs/eth_log_id_events.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_log_id_events %} - -This is the primary key for this table. This is a concatenation of the transaction hash and the event index at which the event occurred. This field can be used within other event based tables such as ```fact_transfers``` & ```ez_token_transfers```. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/eth_logs_contract_address.md b/models/doc_descriptions/event_logs/eth_logs_contract_address.md deleted file mode 100644 index 942c96a0..00000000 --- a/models/doc_descriptions/event_logs/eth_logs_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_logs_contract_address %} - -The address interacted with for a given event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/eth_logs_contract_name.md b/models/doc_descriptions/event_logs/eth_logs_contract_name.md deleted file mode 100644 index 116e021b..00000000 --- a/models/doc_descriptions/event_logs/eth_logs_contract_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_logs_contract_name %} - -The name of the contract or token, where possible. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/eth_logs_data.md b/models/doc_descriptions/event_logs/eth_logs_data.md deleted file mode 100644 index c3328ce2..00000000 --- a/models/doc_descriptions/event_logs/eth_logs_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_logs_data %} - -The un-decoded event data. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/eth_logs_table_doc.md b/models/doc_descriptions/event_logs/eth_logs_table_doc.md deleted file mode 100644 index cd1eb0df..00000000 --- a/models/doc_descriptions/event_logs/eth_logs_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_logs_table_doc %} - -This table contains flattened event logs from transactions on the Ethereum Blockchain. Transactions may have multiple events, which are denoted by the event index for a transaction hash. Therefore, this table is unique on the combination of transaction hash and event index. Please see `fact_decoded_event_logs` or `ez_decoded_event_logs` for the decoded event logs. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/eth_logs_tx_hash.md b/models/doc_descriptions/event_logs/eth_logs_tx_hash.md deleted file mode 100644 index b4634fb0..00000000 --- a/models/doc_descriptions/event_logs/eth_logs_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_logs_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. This field will not be unique in this table, as a given transaction can include multiple events. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/eth_topics.md b/models/doc_descriptions/event_logs/eth_topics.md deleted file mode 100644 index f135c252..00000000 --- a/models/doc_descriptions/event_logs/eth_topics.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_topics %} - -The un-decoded event input topics. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/L1_submission_fields.md b/models/doc_descriptions/fsc_evm/L1_submission_fields.md deleted file mode 100644 index 828272ab..00000000 --- a/models/doc_descriptions/fsc_evm/L1_submission_fields.md +++ /dev/null @@ -1,90 +0,0 @@ -{% docs evm_batch_size %} - -Total transactions included within the batch on the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_max_block %} - -The max block on the OP stack L2 chain this batch relates to. - -{% enddocs %} - -{% docs evm_min_block %} - -The min block on the OP stack L2 chain this batch relates to. - -{% enddocs %} - -{% docs evm_batch_root %} - -Root of the batch, either for submission or state on the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_block_no %} - -The Ethereum block number that contained the batch from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_block_time %} - -The timestamp of the Ethereum block that contained this batch from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_fee %} - -The L1 portion of fees paid. - -{% enddocs %} - -{% docs evm_l1_fee_scalar %} - -This value covers the change in L1 gas price between the time the transaction is submitted and when it is published from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_gas_price %} - -The gas price for L1 transactions when the transaction was processed from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_gas_used %} - -The gas used on L1 to publish the transaction from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_state_batch %} - -The batch index of when this block was included in the Ethereum state root. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_state_tx_hash %} - -The L1 tx hash of when this block was included in the Ethereum state root. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_sub_batch %} - -The batch index of when this block was submitted to L1. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_sub_tx_hash %} - -The L1 tx hash of when this block was submitted to L1. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_prev_total_elements %} - -Confirmed blocks prior to this batch on the OP stack L2 chain. - -{% enddocs %} - diff --git a/models/doc_descriptions/fsc_evm/blocks.md b/models/doc_descriptions/fsc_evm/blocks.md deleted file mode 100644 index 896609b5..00000000 --- a/models/doc_descriptions/fsc_evm/blocks.md +++ /dev/null @@ -1,158 +0,0 @@ -{% docs evm_blocks_table_doc %} - -This table contains block level data for this EVM blockchain. This table can be used to analyze trends at a block level, for example gas fees vs. total transactions over time. For more information, please see [Etherscan Resources](https://etherscan.io/directory/Learning_Resources/Ethereum) or [The Ethereum Organization](https://ethereum.org/en/developers/docs/blocks/) - -{% enddocs %} - - -{% docs evm_block_header_json %} - -This JSON column contains the block header details. - -{% enddocs %} - - -{% docs evm_blockchain %} - -The blockchain on which transactions are being confirmed. - -{% enddocs %} - - -{% docs evm_blocks_hash %} - -The hash of the block header for a given block. - -{% enddocs %} - - -{% docs evm_blocks_nonce %} - -Block nonce is a value used during mining to demonstrate proof of work for a given block. - -{% enddocs %} - - -{% docs evm_difficulty %} - -The effort required to mine the block. - -{% enddocs %} - - -{% docs evm_extra_data %} - -Any data included by the miner for a given block. - -{% enddocs %} - - -{% docs evm_gas_limit %} - -Total gas limit provided by all transactions in the block. - -{% enddocs %} - - -{% docs evm_gas_used %} - -Total gas used in the block. - -{% enddocs %} - -{% docs evm_network %} - -The network on the blockchain used by a transaction. - -{% enddocs %} - - -{% docs evm_parent_hash %} - -The hash of the block from which a given block is generated. Also known as the parent block. - -{% enddocs %} - - -{% docs evm_receipts_root %} - -The root of the state trie. - -{% enddocs %} - - -{% docs evm_sha3_uncles %} - -The mechanism which Ethereum Javascript RLP encodes an empty string. - -{% enddocs %} - - -{% docs evm_size %} - -Block size, which is determined by a given block's gas limit. - -{% enddocs %} - - -{% docs evm_total_difficulty %} - -Total difficulty of the chain at a given block. - -{% enddocs %} - - -{% docs evm_tx_count %} - -Total number of transactions within a block. - -{% enddocs %} - - -{% docs evm_uncle_blocks %} - -Uncle blocks occur when two blocks are mined and broadcasted at the same time, with the same block number. The block validated across the most nodes will be added to the primary chain, and the other one becomes an uncle block. Miners do receive rewards for uncle blocks. - -{% enddocs %} - -{% docs evm_miner %} - -The address of the beneficiary to whom the mining rewards were given - -{% enddocs %} - -{% docs evm_state_root %} - -The root of the final state trie of the block - -{% enddocs %} - -{% docs evm_transactions_root %} - -The root of the transaction trie of the block - -{% enddocs %} - -{% docs evm_logs_bloom %} - -The bloom filter for the logs of the block. - -{% enddocs %} - -{% docs evm_mix_hash %} - -A string of a 256-bit hash encoded as a hexadecimal - -{% enddocs %} - -{% docs evm_base_fee_per_gas %} - -A string of the base fee encoded in hexadecimal format. Please note that this response field will not be included in a block requested before the EIP-1559 upgrade - -{% enddocs %} - -{% docs evm_withdrawals_root %} - -The root of the withdrawals trie. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/complete_general.md b/models/doc_descriptions/fsc_evm/complete_general.md deleted file mode 100644 index 77e2b353..00000000 --- a/models/doc_descriptions/fsc_evm/complete_general.md +++ /dev/null @@ -1,65 +0,0 @@ -{% docs evm_block_number %} - -Also known as block height. The block number, which indicates the length of the blockchain, increases after the addition of each new block. - -{% enddocs %} - -{% docs evm_block_timestamp %} - -The date and time at which the block was produced. - -{% enddocs %} - -{% docs evm_from_address %} - -The sending address of this transaction. - -{% enddocs %} - -{% docs evm_ingested_at %} - -Internal column. - -{% enddocs %} - -{% docs evm_to_address %} - -The receiving address of this transaction. This can be a contract address. - -{% enddocs %} - -{% docs evm_pk %} - -The unique identifier for each row in the table. - -{% enddocs %} - -{% docs evm_inserted_timestamp %} - -The UTC timestamp at which the row was inserted into the table. - -{% enddocs %} - -{% docs evm_modified_timestamp %} - -The UTC timestamp at which the row was last modified. - -{% enddocs %} - -{% docs evm_precise_amount_unadjusted %} - -The precise, unadjusted amount of the transaction. This is returned as a string to avoid precision loss. - -{% enddocs %} - -{% docs evm_precise_amount_adjusted %} - -The precise, adjusted amount of the transaction. This is returned as a string to avoid precision loss. - -{% enddocs %} - -{% docs evm_value_hex %} - -The value of the transaction in hexadecimal format. - -{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/event_logs.md b/models/doc_descriptions/fsc_evm/event_logs.md deleted file mode 100644 index 52c8e0cc..00000000 --- a/models/doc_descriptions/fsc_evm/event_logs.md +++ /dev/null @@ -1,95 +0,0 @@ -{% docs evm_logs_table_doc %} - -This table contains flattened event logs from transactions on this EVM blockchain. Transactions may have multiple events, which are denoted by the event index for a transaction hash. Therefore, this table is unique on the combination of transaction hash and event index. Please see `fact_decoded_event_logs` or `ez_decoded_event_logs` for the decoded event logs. - -{% enddocs %} - - -{% docs evm_event_index %} - -Event number within a transaction. - -{% enddocs %} - - -{% docs evm_event_inputs %} - -The decoded event inputs for a given event. - -{% enddocs %} - -{% docs evm_event_removed %} - -Whether the event has been removed from the transaction. - -{% enddocs %} - - -{% docs evm_log_id_events %} - -This is the primary key for this table. This is a concatenation of the transaction hash and the event index at which the event occurred. This field can be used within other event based tables such as ```fact_transfers``` & ```ez_token_transfers```. - -{% enddocs %} - - -{% docs evm_logs_contract_address %} - -The address interacted with for a given event. - -{% enddocs %} - - -{% docs evm_logs_contract_name %} - -The name of the contract or token, where possible. - -{% enddocs %} - - -{% docs evm_logs_data %} - -The un-decoded event data. - -{% enddocs %} - - -{% docs evm_logs_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. This field will not be unique in this table, as a given transaction can include multiple events. - -{% enddocs %} - - -{% docs evm_topics %} - -The un-decoded event input topics. - -{% enddocs %} - - -{% docs evm_topic_0 %} - -The first topic of the event, which is a unique identifier for the event. - -{% enddocs %} - - -{% docs evm_topic_1 %} - -The second topic of the event, if applicable. - -{% enddocs %} - - -{% docs evm_topic_2 %} - -The third topic of the event, if applicable. - -{% enddocs %} - - -{% docs evm_topic_3 %} - -The fourth topic of the event, if applicable. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/evm_deprecations.md b/models/doc_descriptions/fsc_evm/evm_deprecations.md deleted file mode 100644 index e5d22836..00000000 --- a/models/doc_descriptions/fsc_evm/evm_deprecations.md +++ /dev/null @@ -1,252 +0,0 @@ -{% docs evm_column_deprecation_notice %} - -This column is being deprecated for standardization purposes. Please update your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_hash %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `block_hash` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_block_hash %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - - -{% docs evm_column_deprecation_notice_position %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `tx_position` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_tx_status %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `tx_succeeded` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_chain_id %} - -This column is being removed for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_identifier %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `trace_address` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_trace_status %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `trace_succeeded` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_log_id %} - -This column is being removed for standardization purposes. Please remove or update your queries with `CONCAT(tx_hash, '_', event_index)` to reconstruct `_log_id` by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_inserted_timestamp %} - -This column is being removed for standardization purposes. Please update your queries to use the `modified_timestamp` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_blockchain %} - -This column is being removed for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_block_header_json %} - -This column is being removed for standardization purposes and will be replaced with new columns associated with the keys extracted from this json. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_table_deprecation_notice %} - -This table is being deprecated for standardization purposes. Please update your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_table_deprecation_notice_fact_decoded_event_logs %} - -This table is being deprecated for standardization purposes. Please update your queries to use `ez_decoded_event_logs` instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_table_deprecation_notice_fact_decoded_traces %} - -This table is being deprecated for standardization purposes. Please update your queries to use `ez_decoded_traces` instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_table_deprecation_notice_fact_token_transfers %} - -This table is being deprecated for standardization purposes. Please update your queries to use `ez_token_transfers` instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_state_root_tx_hash %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_state_root_batch_index %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_submission_tx_hash %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_submission_batch_index %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_submission_details %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_data %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_deposit_nonce %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_deposit_receipt_version %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_token_price %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_has_price %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_has_decimal %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_nft_address %} - -This column is being removed for standardization purposes. Please update your queries to use the `contract_address` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_tokenid %} - -This column is being removed for standardization purposes. Please update your queries to use the `token_id` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_erc1155_value %} - -This column is being removed for standardization purposes. Please update your queries to use the `quantity` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_project_name %} - -This column is being removed for standardization purposes. Please update your queries to use the `name` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_loanid %} - -This column is being removed for standardization purposes. Please update your queries to use the `loan_id` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_tokenid_name %} - -This column is being removed for standardization purposes. Please update your queries to use the `token_id_name` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_tokenid_description %} - -This column is being removed for standardization purposes. Please update your queries to use the `token_id_description` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_tokenid_image_url %} - -This column is being removed for standardization purposes. Please update your queries to use the `token_id_image_url` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_nft_address_tokenid %} - -This column is being removed for standardization purposes. Please update your queries to use the `nft_address_token_id` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_nft_from_address %} - -This column is being removed for standardization purposes. Please update your queries to use the `from_address` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_nft_to_address %} - -This column is being removed for standardization purposes. Please update your queries to use the `to_address` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_mint_price_eth %} - -This column is being removed for standardization purposes. Please update your queries to use the `mint_price_native` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_event_type %} - -This column is being removed for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_fact_decoded_traces_id %} - -This column is being removed for standardization purposes. Please update your queries to use the `ez_decoded_traces_id` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_contract_metadata %} - -This column is being removed for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/l2.md b/models/doc_descriptions/fsc_evm/l2.md deleted file mode 100644 index b4bc2a41..00000000 --- a/models/doc_descriptions/fsc_evm/l2.md +++ /dev/null @@ -1,89 +0,0 @@ -{% docs evm_l2_ez_data_availability_table %} - -This table contains the data availability submissions for various L2 chains, including Optimistic Rollups (OP Stack and Arbitrum) and ZK Rollups (Scroll). - -{% enddocs %} - -{% docs evm_l2_chain %} - -The name of the L2 chain. - -{% enddocs %} - -{% docs evm_l2_chain_category %} - -The category of the L2 chain. - -{% enddocs %} - -{% docs evm_l2_data_availability_address %} - -The address where the data availability submission was made to. - -{% enddocs %} - -{% docs evm_l2_submission_type %} - -The type of the data availability submission. - -{% enddocs %} - -{% docs evm_l2_blob_count %} - -The number of blobs submitted in this transaction. - -{% enddocs %} - -{% docs evm_l2_blob_gas_used %} - -The total amount of blob gas used in this transaction. - -{% enddocs %} - -{% docs evm_l2_blob_gas_price %} - -The price paid per unit of blob gas, denominated in wei. - -{% enddocs %} - -{% docs evm_l2_blob_fee %} - -The total blob fee paid for this transaction, denominated in ETH. - -{% enddocs %} - -{% docs evm_l2_ez_state_validation_table %} - -This table contains the state validation for various L2 chains, including Optimistic Rollups (OP Stack) and Optimium (Mantle). - -{% enddocs %} - -{% docs evm_l2_state_validation_address %} - -The address where the state validation was made to. - -{% enddocs %} - -{% docs evm_l2_state_validation_type %} - -The type of the state validation. - -{% enddocs %} - -{% docs evm_l2_state_validation_data %} - -The data of the state validation. - -{% enddocs %} - -{% docs evm_l2_state_validation_data_type %} - -The data type of the state validation. - -{% enddocs %} - -{% docs evm_l2_state_validation_data_json %} - -The JSON data of the state validation based on the validation type. - -{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/nft.md b/models/doc_descriptions/fsc_evm/nft.md deleted file mode 100644 index 85016e33..00000000 --- a/models/doc_descriptions/fsc_evm/nft.md +++ /dev/null @@ -1,601 +0,0 @@ -{% docs evm_nft_events_table_doc %} - -This table contains NFT sales on this EVM blockchain. More NFT marketplaces will be added over time. - -{% enddocs %} - - -{% docs evm_ez_nft_sales_table_doc %} - -This table contains NFT sale events from various marketplaces. - -{% enddocs %} - - -{% docs evm_ez_nft_mint_table_doc %} - -This table contains NFT mint events, defined as NFT transfers from a burn address to an address, on this EVM blockchain. - -{% enddocs %} - -{% docs evm_ez_nft_transfer_table_doc %} - -This table contains NFT transfer events on this EVM blockchain. - -{% enddocs %} - -{% docs evm_lending_repayments_table_doc %} - -This table contains repayment events for loans backed by collateralized NFTs on this EVM blockchain. Events in this table can be a full repayment either by the borrower to get their collateral back or by a new lender to repay the borrower's previous loan. The latter is labeled as refinance where the same borrower takes on a new loan from a new lender and repays the past loan. The NFT collateral is still locked in this scenario. - -{% enddocs %} - -{% docs evm_nft_aggregator_name %} - -The name of the aggregator platform where the sale took place. If the sale did not take place via an aggregator platform, then the value will be null. - -{% enddocs %} - -{% docs evm_nft_amount %} - -The total amount, specified by the mint token address, used as payment to mint the specified number of NFTs corresponding to this token id. - -{% enddocs %} - -{% docs evm_nft_amount_usd %} - -The USD value of amount. - -{% enddocs %} - -{% docs evm_nft_block_no %} - -The block number at which the NFT event occurred. - -{% enddocs %} - -{% docs evm_nft_blocktime %} - -The block timestamp at which the NFT event occurred. - -{% enddocs %} - -{% docs evm_nft_buyer_address %} - -The address of the buyer of the NFT in the transaction. - -{% enddocs %} - -{% docs evm_nft_creator_fee %} - -The decimal adjusted amount of fees paid to the NFT collection as royalty payments for this NFT event in the transaction's currency. - -{% enddocs %} - -{% docs evm_nft_creator_fee_usd %} - -The amount of fees paid to the NFT collection as royalty payments for this NFT event in US dollars. - -{% enddocs %} - -{% docs evm_nft_currency_address %} - -The token contract address for this NFT event. This will be the native asset for native transactions. - -{% enddocs %} - -{% docs evm_nft_currency_symbol %} - -The token symbol for this NFT event. - -{% enddocs %} - -{% docs evm_nft_erc1155_value %} - -If the NFT is an ERC-1155 contract, this field may be one or greater, representing the number of tokens. If it is not an ERC-1155 token, this value will be null. - -{% enddocs %} - -{% docs evm_nft_event_index %} - -The event number within a transaction. - -{% enddocs %} - -{% docs evm_nft_event_type %} - -The type of NFT event in this transaction, either sale, bid_won, redeem, or mint. - -{% enddocs %} - -{% docs evm_nft_from_address %} - -The sending address of the NFT in the transaction. - -{% enddocs %} - -{% docs evm_nft_intra_event_index %} - -The order of events within a single event index. This is primarily used for ERC1155 NFT batch transfer events. - -{% enddocs %} - -{% docs evm_nft_metadata %} - -The token metadata for this NFT. This may be blank for many NFTs. We are working to expand this field. - -{% enddocs %} - -{% docs evm_nft_mint_count %} - -The number of NFTs minted in this event. - -{% enddocs %} - -{% docs evm_nft_mint_price %} - -The price paid in the native asset to mint the NFT(s). - -{% enddocs %} - -{% docs evm_nft_mint_price_usd %} - -The price paid in US dollars to mint the NFT(s). - -{% enddocs %} - -{% docs evm_nft_mints_symbol %} - -The symbol of the token supplied to mint the NFT, if applicable. This field may not handle all edge cases. - -{% enddocs %} - -{% docs evm_nft_mints_token_address %} - -The contract address of the token supplied to mint the NFT, if applicable. This field may not handle all edge cases. - -{% enddocs %} - -{% docs evm_nft_mints_token_price %} - -The decimal adjusted amount of tokens supplied within the same transaction to mint the NFT. This field may not handle all edge cases. - -{% enddocs %} - -{% docs evm_nft_mints_token_price_usd %} - -The amount of tokens supplied in US dollars within the same transaction to mint the NFT. This field may not handle all edge cases. - -{% enddocs %} - -{% docs evm_nft_nft_address %} - -The contract address of the NFT. - -{% enddocs %} - -{% docs evm_nft_origin_from %} - -The from address of this transaction. In most cases, this is the NFT buyer. However, for some more complex transactions, it may not be the NFT buyer. - -{% enddocs %} - -{% docs evm_nft_origin_sig %} - -The function signature of this transaction. - -{% enddocs %} - -{% docs evm_nft_origin_to %} - -The to address of this transaction. In most cases, this is the exchange contract. However, for some more complex NFT events, such as aggregate buys with tools, this may not be the exchange address. - -{% enddocs %} - -{% docs evm_nft_platform_address %} - -The address of the exchange used for the transaction. - -{% enddocs %} - -{% docs evm_nft_platform_exchange_version %} - -The version of the exchange contract used for the transaction. - -{% enddocs %} - -{% docs evm_nft_platform_fee %} - -The decimal adjusted amount of fees paid to the platform for this NFT event in the transaction's currency. There are cases where there are fees paid to multiple marketplaces. In those cases, the fee in the platform_fee column will only reflect the platform fee related to the platform exchange contract. - -{% enddocs %} - -{% docs evm_nft_platform_fee_usd %} - -The amount of fees paid to the platform for this NFT event in US dollars. There are cases where there are fees paid to multiple marketplaces. In those cases, the fee in the platform_fee column will only reflect the platform fee related to the platform exchange contract. - -{% enddocs %} - -{% docs evm_nft_platform_name %} - -The name of the exchange used for the trade. - -{% enddocs %} - -{% docs evm_nft_price %} - -The total price of the NFT, in the currency in which the transaction occurred and decimal adjusted where possible. Please note that the price of the NFT, after subtracting total fees, may not represent the net amount paid to the seller in all cases. You may refer to the platform fee description for more info. - -{% enddocs %} - -{% docs evm_nft_price_usd %} - -The total price of the NFT in US dollars. This will be 0 for tokens without a decimal adjustment or hourly price. Please note that the price of the NFT, after subtracting total fees, may not represent the net amount paid to the seller in all cases. You may refer to the platform fee description for more info. - -{% enddocs %} - -{% docs evm_nft_project_name %} - -The name of the NFT project. This field, along with metadata, will be filled in over time. - -{% enddocs %} - -{% docs evm_nft_seller_address %} - -The address of the seller of the NFT in the transaction. - -{% enddocs %} - -{% docs evm_nft_to_address %} - -The receiving address of the NFT in the transaction. - -{% enddocs %} - -{% docs evm_nft_tokenid %} - -The token ID for this NFT contract. - -{% enddocs %} - -{% docs evm_nft_total_fees %} - -The total amount of fees paid relating to the NFT purchase in the transaction currency. This includes royalty payments to creators and platform fees. Please note, this does not include the gas fee. - -{% enddocs %} - -{% docs evm_nft_total_fees_usd %} - -The total amount of fees paid relating to the NFT purchase in US dollars. This includes royalty payments to creators and platform fees. Please note, this does not include the gas fee. - -{% enddocs %} - -{% docs evm_nft_tx_fee %} - -The gas fee for this transaction in the native asset. - -{% enddocs %} - -{% docs evm_nft_tx_fee_usd %} - -The gas fee for this transaction in US dollars. - -{% enddocs %} - -{% docs evm_nft_tx_hash %} - -The transaction hash for the NFT event. This is not necessarily unique in this table as a transaction may contain multiple NFT events. - -{% enddocs %} - -{% docs evm_nft_lending_liquidations_table_doc %} - -This table contains liquidation events for loans backed by collateralized NFTs on this EVM blockchain. This typically means the lender of the loan closes the loan and receives the NFT collateral. - -{% enddocs %} - -{% docs evm_platform_address %} - -The contract address of the platform's lending contract. - -{% enddocs %} - -{% docs evm_platform_name %} - -The name of the platform. - -{% enddocs %} - -{% docs evm_platform_exchange_version %} - -The version of the platform's lending contract. - -{% enddocs %} - -{% docs evm_loanid %} - -The ID associated with the loan, often times tied to the borrower's address and collateral. This ID can be used as a unique identifier when tracking active loans. However, note that refinances can happen while still maintaining the same loanId. For some platforms, loanids of previously paid loans are reused hence they can't be reliably used as a unique identifier without appropriate timestamp filters. Instead, use the unique_loan_id column. - -{% enddocs %} - -{% docs evm_unique_loan_id %} - -The unique ID that can be used to represent a loan within the same platform. For the same loan, the value of this ID will remain the same across the loans taken, liquidations and repayment tables. For some platforms where the lender is issued a promissory note, the lender can send this note to any address, making the receiver the new lender. However, the unique_loan_id still remains the same although the final lender is different. The unique_loan_id changes only if the loanId and lender changes which would also indicate the previous loan has been fully paid off. - -{% enddocs %} - -{% docs evm_lender_address %} - -The address that gives out a loan to the borrower. When a loan is issued, a promissory note (an ERC721) is issued to the lender. The lender can transfer this note to any address which makes any receiving address the new lender. - -{% enddocs %} - -{% docs evm_borrower_address %} - -The address that receives the loan and has an NFT locked as collateral. - -{% enddocs %} - -{% docs evm_nft_address %} - -The address of the NFT used as collateral. - -{% enddocs %} - -{% docs evm_tokenid %} - -The tokenId of the NFT used as collateral. - -{% enddocs %} - -{% docs evm_loan_token_address %} - -The contract address of what the loan is denominated in. This could be either the native asset or other tokens. - -{% enddocs %} - -{% docs evm_loan_token_symbol %} - -The symbol of the loan token address. - -{% enddocs %} - -{% docs evm_principal_unadj %} - -The principal amount of the loan taken with unadjusted decimal places. - -{% enddocs %} - -{% docs evm_principal %} - -The principal amount of the loan taken with adjusted decimal places. - -{% enddocs %} - -{% docs evm_principal_usd %} - -The principal amount of the loan taken in USD terms. - -{% enddocs %} - -{% docs evm_interest_rate %} - -The non-annualized rate charged by the lender on the principal amount of the loan denominated in percentage (%). For fixed term loans, it is calculated by taking the difference between total debt and principal amount divided by principal amount. For perpetual term loans, interest rate is usually on an annual basis and total debt is calculated prorated. - -{% enddocs %} - -{% docs evm_apr %} - -The annualized interest rate denominated in percentage (%). - -{% enddocs %} - -{% docs evm_loan_term_type %} - -The type of loan terms, could be either a fixed loan or a perpetual loan. A fixed term loan has a fixed repayment date while a perpetual loan does not. - -{% enddocs %} - -{% docs evm_loan_start_timestamp %} - -The timestamp of when the loan offer is accepted. - -{% enddocs %} - -{% docs evm_loan_due_timestamp %} - -The timestamp of when the loan is due. For perpetual term loan, the value will be null. - -{% enddocs %} - -{% docs evm_loan_tenure %} - -The tenure of the loan denominated in seconds. For perpetual term loan, the value will be null. - -{% enddocs %} - -{% docs evm_lending_loans %} - -This table contains NFT lending events for loans backed by collateralized NFTs on this EVM blockchain. This could be depositing an NFT and taking out a loan or using the Buy Now Pay Later (BNPL) feature to take a loan out of the newly bought NFT. This NFT will remain locked until the loan is cleared. - -{% enddocs %} - -{% docs evm_nft_lending_event_type %} - -There are 2 types of loan creation events. It can either be a new loan or a refinance of an existing loan. Note that renegotiation events are categorized as refinance events in this table. Old loans are repaid and new loan ids are reissued so these would be new loan entries in this table. - -{% enddocs %} - -{% docs evm_debt_unadj %} - -The total debt of the loan (principal amount plus interests) with unadjusted decimal places. - -{% enddocs %} - -{% docs evm_debt %} - -The total debt of the loan (principal amount plus interests) with adjusted decimal places. - -{% enddocs %} - -{% docs evm_debt_usd %} - -The total debt of the loan (principal amount plus interests) in USD terms. - -{% enddocs %} - -{% docs evm_platform_fee_unadj %} - -The fee charged by the lending platform with unadjusted decimal places. - -{% enddocs %} - -{% docs evm_platform_fee %} - -The fee charged by the lending platform with adjusted decimal places. - -{% enddocs %} - -{% docs evm_platform_fee_usd %} - -The fee charged by the lending platform in USD terms. - -{% enddocs %} - -{% docs evm_mev_arbitrage %} - -This table contains the financial metrics from NFT arbitrage transactions including cost, revenue and profits. - -{% enddocs %} - -{% docs evm_mev_searcher %} - -The address of the MEV finder, taken from the origin address that initiated the transaction. - -{% enddocs %} - -{% docs evm_mev_contract %} - -The contract address that the MEV searcher uses to execute mev transactions, taken from the origin to address of the transaction. - -{% enddocs %} - -{% docs evm_cost_usd %} - -The total cost in USD to purchase the NFT(s) in the transaction. - -{% enddocs %} - -{% docs evm_revenue_usd %} - -The total revenue in USD from selling the NFT(s) and other related tokens in the transaction. - -{% enddocs %} - -{% docs evm_miner_tip_usd %} - -The total amount in USD sent to the block miner/builder as a tip to include the transaction in the block. - -{% enddocs %} - -{% docs evm_profit_usd %} - -The remainder in USD after subtracting cost, miner tip and transaction fee from revenue. - -{% enddocs %} - -{% docs evm_funding_source %} - -The source of the funds used to perform the arbitrage. Currently there are three sources. Existing funds indicate that the user uses funds that are already in their balance while flash loan and flash swaps indicate that the user took a flash loan in the transaction. - -{% enddocs %} - -{% docs evm_arbitrage_direction %} - -The direction in which the arbitrage is performed. There are two possibilities of origin and destination: pool and marketplace. Pool represents marketplaces where users swap from a pool whereas marketplace represents regular marketplaces that are not pool-based. - -{% enddocs %} - -{% docs evm_fact_mev_arbitrage_events %} - -This table contains information about the NFTs involved in arbitrage transactions, documenting events from both the buy and sell sides. - -{% enddocs %} - -{% docs evm_trade_side %} - -The side of the trade that this event represents. This can be either buy or sell. Buy would represent the events where NFTs are bought while sell would present the events where the bought NFTs are sold. Note that the number of events for buy and sell may not be the same for a given transaction. - -{% enddocs %} - -{% docs evm_dim_nft_collection_metadata %} - -This table contains the metadata for popular NFT collections on this EVM blockchain. - -{% enddocs %} - -{% docs evm_nft_blockchain %} - -Blockchain where the NFT metadata is retrieved from. - -{% enddocs %} - -{% docs evm_collection_name %} - -The name for this NFT collection. - -{% enddocs %} - -{% docs evm_tokenid_name %} - -The name for this specific tokenId. This may be the same for all tokenIds within the same collection. - -{% enddocs %} - -{% docs evm_traits %} - -The traits for this tokenId in a key-value pair format. - -{% enddocs %} - -{% docs evm_tokenid_description %} - -The description for this specific tokenId. This may be the same for all tokenIds within the same collection. - -{% enddocs %} - -{% docs evm_tokenid_image_url %} - -The url of the image for this tokenId. - -{% enddocs %} - -{% docs evm_nft_address_tokenid %} - -The concatenation of NFT address and tokenId. - -{% enddocs %} - -{% docs evm_nft_token_standard %} - -The standard of the token, either erc721 or erc1155. - -{% enddocs %} - -{% docs evm_nft_is_mint %} - -Whether the transaction is a mint. - -{% enddocs %} - -{% docs evm_nft_quantity %} - -The quantity of the NFTs minted in the transaction. - -{% enddocs %} - -{% docs evm_nft_token_transfer_type %} - -The type of token and NFT transfer event, for example `erc721_Transfer`, `erc1155_TransferSingle`, or `erc1155_TransferBatch`. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/traces.md b/models/doc_descriptions/fsc_evm/traces.md deleted file mode 100644 index c6b601e1..00000000 --- a/models/doc_descriptions/fsc_evm/traces.md +++ /dev/null @@ -1,136 +0,0 @@ -{% docs evm_traces_table_doc %} - -This table contains flattened trace data for internal contract calls. User-defined functions (UDFs) are available to decode hex encoded fields, including `utils.udf_hex_to_int()`. - -{% enddocs %} - - -{% docs evm_traces_block_no %} - -The block number of this transaction. - -{% enddocs %} - - -{% docs evm_traces_blocktime %} - -The block timestamp of this transaction. - -{% enddocs %} - - -{% docs evm_traces_call_data %} - -The raw JSON data for this trace. - -{% enddocs %} - - -{% docs evm_traces_value %} - -The amount of the native asset transferred in this trace. - -{% enddocs %} - - -{% docs evm_traces_from %} - -The sending address of this trace. This is not necessarily the from address of the transaction. - -{% enddocs %} - - -{% docs evm_traces_gas %} - -The gas supplied for this trace. - -{% enddocs %} - - -{% docs evm_traces_gas_used %} - -The gas used for this trace. - -{% enddocs %} - - -{% docs evm_traces_identifier %} - -This field represents the position and type of the trace within the transaction. - -{% enddocs %} - - -{% docs evm_trace_index %} - -The index of the trace within the transaction. - -{% enddocs %} - - -{% docs evm_traces_input %} - -The input data for this trace. - -{% enddocs %} - - -{% docs evm_traces_output %} - -The output data for this trace. - -{% enddocs %} - - -{% docs evm_sub_traces %} - -The amount of nested sub traces for this trace. - -{% enddocs %} - - -{% docs evm_traces_to %} - -The receiving address of this trace. This is not necessarily the to address of the transaction. - -{% enddocs %} - - -{% docs evm_traces_tx_hash %} - -The transaction hash for the trace. Please note, this is not necessarily unique in this table as transactions frequently have multiple traces. - -{% enddocs %} - - -{% docs evm_traces_type %} - -The type of internal transaction. Common trace types are `CALL`, `DELEGATECALL`, and `STATICCALL`. - -{% enddocs %} - -{% docs evm_trace_succeeded %} - -The boolean value representing if the trace succeeded. - -{% enddocs %} - -{% docs evm_trace_error_reason %} - -The reason for the trace failure, if any. - -{% enddocs %} - -{% docs evm_trace_address %} - -The trace address for this trace. - -{% enddocs %} - - -{% docs evm_revert_reason %} - -The reason for the revert, if available. - -{% enddocs %} - diff --git a/models/doc_descriptions/fsc_evm/transactions.md b/models/doc_descriptions/fsc_evm/transactions.md deleted file mode 100644 index ec61ce70..00000000 --- a/models/doc_descriptions/fsc_evm/transactions.md +++ /dev/null @@ -1,207 +0,0 @@ -{% docs evm_tx_table_doc %} - -This table contains transaction level data for this EVM blockchain. Each transaction will have a unique transaction hash, along with transaction fees and a value transferred in the native asset when applicable. Transactions may be native asset transfers or interactions with contract addresses. For more information, please see [The Ethereum Organization - Transactions](https://ethereum.org/en/developers/docs/transactions/) - -Below are the specific native tokens that correspond to each EVM chain: - -| Status | Description | -|------------|-------------| -| ETHEREUM | ETH | -| BINANCE | BNB | -| POLYGON | POL | -| AVALANCHE | AVAX | -| ARBITRUM | ETH | -| OPTIMISM | ETH | -| GNOSIS | xDAI | -| KAIA | KLAY | -| SEI | SEI | -| CORE | CORE | - -{% enddocs %} - - -{% docs evm_cumulative_gas_used %} - -The total amount of gas used when this transaction was executed in the block. - -{% enddocs %} - - -{% docs evm_tx_block_hash %} - -Block hash is a unique 66-character identifier that is generated when a block is produced. - -{% enddocs %} - - -{% docs evm_tx_fee %} - -Amount paid to validate the transaction in the native asset. - -{% enddocs %} - - -{% docs evm_tx_gas_limit %} - -Maximum amount of gas allocated for the transaction. - -{% enddocs %} - - -{% docs evm_tx_gas_price %} - -Cost per unit of gas in Gwei. - -{% enddocs %} - - -{% docs evm_tx_gas_used %} - -Gas used by the transaction. - -{% enddocs %} - - -{% docs evm_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. - -{% enddocs %} - - -{% docs evm_tx_input_data %} - -This column contains additional data for this transaction, and is commonly used as part of a contract interaction or as a message to the recipient. - -{% enddocs %} - - -{% docs evm_tx_json %} - -This JSON column contains the transaction details, including event logs. - -{% enddocs %} - - -{% docs evm_tx_nonce %} - -The number of transactions sent from a given address. - -{% enddocs %} - - -{% docs evm_tx_origin_sig %} - -The function signature of the call that triggered this transaction. - -{% enddocs %} - -{% docs evm_origin_sig %} - -The function signature of the contract call that triggered this transaction. - -{% enddocs %} - - -{% docs evm_tx_position %} - -The position of the transaction within the block. - -{% enddocs %} - - -{% docs evm_tx_status %} - -Status of the transaction. - -{% enddocs %} - - -{% docs evm_value %} - -The value transacted in the native asset. - -{% enddocs %} - - -{% docs evm_effective_gas_price %} - -The total base charge plus tip paid for each unit of gas, in Gwei. - -{% enddocs %} - -{% docs evm_max_fee_per_gas %} - -The maximum fee per gas of the transaction, in Gwei. - -{% enddocs %} - - -{% docs evm_max_priority_fee_per_gas %} - -The maximum priority fee per gas of the transaction, in Gwei. - -{% enddocs %} - - -{% docs evm_r %} - -The r value of the transaction signature. - -{% enddocs %} - - -{% docs evm_s %} - -The s value of the transaction signature. - -{% enddocs %} - - -{% docs evm_v %} - -The v value of the transaction signature. - -{% enddocs %} - -{% docs evm_tx_succeeded %} - -Whether the transaction was successful, returned as a boolean. - -{% enddocs %} - -{% docs evm_tx_fee_precise %} - -The precise amount of the transaction fee. This is returned as a string to avoid precision loss. - -{% enddocs %} - -{% docs evm_tx_type %} - -The type of transaction. - -{% enddocs %} - -{% docs evm_mint %} - -The minting event associated with the transaction - -{% enddocs %} - -{% docs evm_source_hash %} - -The hash of the source transaction that created this transaction - -{% enddocs %} - -{% docs evm_eth_value %} - -The eth value for the transaction - -{% enddocs %} - -{% docs evm_chain_id %} - -The unique identifier for the chain the transaction was executed on. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/transfers.md b/models/doc_descriptions/fsc_evm/transfers.md deleted file mode 100644 index 583947ad..00000000 --- a/models/doc_descriptions/fsc_evm/transfers.md +++ /dev/null @@ -1,167 +0,0 @@ -{% docs evm_transfers_table_doc %} - -This table contains all native asset transfers, including equivalent USD amounts. The origin addresses correspond to the to and from addresses from the `fact_transactions` table. The `identifier` and `tx_hash` columns relate this table back to `fact_traces`, which contains more details on the transfers. - -Below are the specific native tokens that correspond to each EVM chain: - -| Status | Description | -|------------|-------------| -| ETHEREUM | ETH | -| BINANCE | BNB | -| POLYGON | POL | -| AVALANCHE | AVAX | -| ARBITRUM | ETH | -| OPTIMISM | ETH | -| GNOSIS | xDAI | -| KAIA | KLAY | - -{% enddocs %} - - -{% docs evm_transfer_table_doc %} - -This table contains all events in the `fact_token_transfers` table, along with joined columns such as token price, symbol, and decimals where possible that allow for easier analysis of token transfer events. Please note native asset transfers are not included here. - -{% enddocs %} - - -{% docs evm_fact_token_transfers_table_doc %} - -This fact-based table contains emitted event logs for ERC-20 Token Transfers (e.g. `Transfer`: topic_0 = `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`). The contract address is the token transferred, and the raw amount field is the amount of tokens transferred. The values in this table are not decimal adjusted, instead please use `core.dim_contracts` or `core.ez_token_transfers` to reference decimals or decimal adjusted values. This table does not contain ERC-721 and ERC-1155 token transfers, instead please use `nft.ez_nft_transfers`. Additionally, this table does not contain transfers of the chain's native asset, instead please use `core.ez_native_transfers`. - -{% enddocs %} - - -{% docs evm_ez_token_transfers_table_doc %} - -This convenience table contains emitted event logs for ERC-20 Token Transfers (e.g. `Transfer`: topic_0 = `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`), including decimal adjusted values, USD values, and other helpful token metadata where available for each transfer event. The contract address is the token transferred, and the raw amount field is the amount of tokens transferred. Note, this table does not contain ERC-721 and ERC-1155 token transfers, instead please use `nft.ez_nft_transfers`. Additionally, this table does not contain transfers of the chain's native asset, instead please use `core.ez_native_transfers`. - -{% enddocs %} - - -{% docs evm_ez_native_transfers_table_doc %} - -This convenience table contains all transfers for the chain's native asset, sourced from internal traces (`core.fact_traces`), and includes decimal adjusted and USD values where available. The origin addresses correspond to the to and from addresses in the `core.fact_transactions` table. Note, this table does not contain ERC-721 and ERC-1155 token transfers, instead please use `nft.ez_nft_transfers`. - -{% enddocs %} - - -{% docs evm_amount %} - -Native asset value transferred, this is imported from the fsc-evm package. - -{% enddocs %} - - -{% docs evm_amount_usd %} - -Native asset value transferred, in USD. - -{% enddocs %} - - -{% docs evm_log_id_transfers %} - -This is the primary key for this table. This is a concatenation of the transaction hash and the event index at which the transfer event occurred. This field can be used to find more details on the event within the `fact_event_logs` table. - -{% enddocs %} - - -{% docs evm_origin_from %} - -The from address at the transaction level. - -{% enddocs %} - - -{% docs evm_origin_to %} - -The to address at the transaction level. - -{% enddocs %} - - -{% docs evm_transfer_amount %} - -The decimal transformed amount for this token. Tokens without a decimal adjustment will be nulled out here. - -{% enddocs %} - - -{% docs evm_transfer_amount_precise %} - -The decimal transformed amount for this token returned as a string to preserve precision. Tokens without a decimal adjustment will be nulled out here. - -{% enddocs %} - - -{% docs evm_transfer_amount_usd %} - -The amount in US dollars for this transfer at the time of the transfer. Tokens without a decimal adjustment or price will be nulled out here. - -{% enddocs %} - - -{% docs evm_transfer_contract_address %} - -Contract address of the token being transferred. - -{% enddocs %} - - -{% docs evm_transfer_from_address %} - -The sending address of this transfer. - -{% enddocs %} - - -{% docs evm_transfer_has_decimal %} - -Whether or not our contracts model contains the necessary decimal adjustment for this token. - -{% enddocs %} - - -{% docs evm_transfer_has_price %} - -Whether or not our prices model contains this hourly token price. - -{% enddocs %} - - -{% docs evm_transfer_raw_amount %} - -The amount of tokens transferred. This value is not decimal adjusted. - -{% enddocs %} - - -{% docs evm_transfer_raw_amount_precise %} - -The amount of tokens transferred returned as a string to preserve precision. This value is not decimal adjusted. - -{% enddocs %} - - -{% docs evm_transfer_to_address %} - -The receiving address of this transfer. This can be a contract address. - -{% enddocs %} - - -{% docs evm_transfer_token_price %} - -The price, if available, for this token at the transfer time. - -{% enddocs %} - - -{% docs evm_transfer_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. This will not be unique in this table as a transaction could include multiple transfer events. - -{% enddocs %} - - diff --git a/models/doc_descriptions/general/deprecation.md b/models/doc_descriptions/general/deprecation.md deleted file mode 100644 index 337b78c5..00000000 --- a/models/doc_descriptions/general/deprecation.md +++ /dev/null @@ -1,11 +0,0 @@ -{% docs internal_column %} - -Deprecated. This column is no longer used. Please remove from your query by Jan. 10 2024.' - -{% enddocs %} - -{% docs amount_deprecation %} - -This column is being deprecated for standardization purposes on Jan. 10 2024. Please use the equivalent column without the native asset prefix. For example, use `amount` instead of `avax_amount`. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/eth_block_number.md b/models/doc_descriptions/general/eth_block_number.md deleted file mode 100644 index 9926a733..00000000 --- a/models/doc_descriptions/general/eth_block_number.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_block_number %} - -Also known as block height. The block number, which indicates the length of the blockchain, increases after the addition of each new block. - -{% enddocs %} diff --git a/models/doc_descriptions/general/eth_block_timestamp.md b/models/doc_descriptions/general/eth_block_timestamp.md deleted file mode 100644 index 7ec1929c..00000000 --- a/models/doc_descriptions/general/eth_block_timestamp.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_block_timestamp %} - -The date and time at which the block was produced. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/eth_decimals.md b/models/doc_descriptions/general/eth_decimals.md deleted file mode 100644 index faae2977..00000000 --- a/models/doc_descriptions/general/eth_decimals.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_decimals %} - -The number of decimal places this contract needs adjusted where token values exist. For example, use the decimal field to correctly transform raw amounts in ```fact_token_transfers```. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/eth_from_address.md b/models/doc_descriptions/general/eth_from_address.md deleted file mode 100644 index 0978b47c..00000000 --- a/models/doc_descriptions/general/eth_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_from_address %} - -The sending address of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/eth_ingested_at.md b/models/doc_descriptions/general/eth_ingested_at.md deleted file mode 100644 index 877f1ecc..00000000 --- a/models/doc_descriptions/general/eth_ingested_at.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_ingested_at %} - -Internal column. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/eth_to_address.md b/models/doc_descriptions/general/eth_to_address.md deleted file mode 100644 index 20744474..00000000 --- a/models/doc_descriptions/general/eth_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_to_address %} - -The receiving address of this transaction. This can be a contract address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/export_columns.md b/models/doc_descriptions/general/export_columns.md deleted file mode 100644 index 848af449..00000000 --- a/models/doc_descriptions/general/export_columns.md +++ /dev/null @@ -1,19 +0,0 @@ -{% docs pk %} - -The unique identifier for each row in the table. - -{% enddocs %} - -{% docs inserted_timestamp %} - -The utc timestamp at which the row was inserted into the table. - -{% enddocs %} - -{% docs modified_timestamp %} - -The utc timestamp at which the row was last modified. - -{% enddocs %} - - diff --git a/models/doc_descriptions/general/precise_amounts.md b/models/doc_descriptions/general/precise_amounts.md deleted file mode 100644 index 96a815cb..00000000 --- a/models/doc_descriptions/general/precise_amounts.md +++ /dev/null @@ -1,17 +0,0 @@ -{% docs precise_amount_unadjusted %} - -The precise, unadjusted amount of the transaction. This is returned as a string to avoid precision loss. - -{% enddocs %} - -{% docs precise_amount_adjusted %} - -The precise, adjusted amount of the transaction. This is returned as a string to avoid precision loss. - -{% enddocs %} - -{% docs tx_fee_precise %} - -The precise amount of the transaction fee. This is returned as a string to avoid precision loss. - -{% enddocs %} diff --git a/models/doc_descriptions/labels/eth_label.md b/models/doc_descriptions/labels/eth_label.md deleted file mode 100644 index 41a0910b..00000000 --- a/models/doc_descriptions/labels/eth_label.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_label %} - -The label for this address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/eth_label_address.md b/models/doc_descriptions/labels/eth_label_address.md deleted file mode 100644 index c9118a58..00000000 --- a/models/doc_descriptions/labels/eth_label_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_label_address %} - -Address that the label is for. This is the field that should be used to join other tables with labels. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/eth_label_address_name.md b/models/doc_descriptions/labels/eth_label_address_name.md deleted file mode 100644 index b4638b23..00000000 --- a/models/doc_descriptions/labels/eth_label_address_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_label_address_name %} - -The most granular label for this address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/eth_label_blockchain.md b/models/doc_descriptions/labels/eth_label_blockchain.md deleted file mode 100644 index 43604412..00000000 --- a/models/doc_descriptions/labels/eth_label_blockchain.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_label_blockchain %} - -The name of the blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/eth_label_creator.md b/models/doc_descriptions/labels/eth_label_creator.md deleted file mode 100644 index 2f70540f..00000000 --- a/models/doc_descriptions/labels/eth_label_creator.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_label_creator %} - -The name of the creator of the label. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/eth_label_subtype.md b/models/doc_descriptions/labels/eth_label_subtype.md deleted file mode 100644 index 9b28ee56..00000000 --- a/models/doc_descriptions/labels/eth_label_subtype.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_label_subtype %} - -A sub-category nested within label type providing further detail. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/eth_label_type.md b/models/doc_descriptions/labels/eth_label_type.md deleted file mode 100644 index 55ece488..00000000 --- a/models/doc_descriptions/labels/eth_label_type.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_label_type %} - -A high-level category describing the addresses main function or ownership. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/eth_labels_table_doc.md b/models/doc_descriptions/labels/eth_labels_table_doc.md deleted file mode 100644 index 76465ef3..00000000 --- a/models/doc_descriptions/labels/eth_labels_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_labels_table %} - -This table contains labels for addresses on the Ethereum Blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/table_dim_labels.md b/models/doc_descriptions/labels/table_dim_labels.md deleted file mode 100644 index 10e72c4d..00000000 --- a/models/doc_descriptions/labels/table_dim_labels.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs table_dim_labels %} - -The labels table is a store of one-to-one address identifiers, or an address name. Labels are broken out into a "type" (such as cex, dex, dapp, games, etc.) and a "subtype" (ex: contract_deployer, hot_wallet, token_contract, etc.) in order to help classify each address name into similar groups. Our labels are sourced from many different places, but can primarily be grouped into two categories: automatic and manual. Automatic labels are continuously labeled based on certain criteria, such as a known contract deploying another contract, behavior based algorithms for finding deposit wallets, and consistent data pulls of custom protocol APIs. Manual labels are done periodically to find addresses that cannot be found programmatically such as finding new protocol addresses, centralized exchange hot wallets, or trending addresses. Labels can also be added by our community by using our add-a-label tool (https://science.flipsidecrypto.xyz/add-a-label/) or on-chain with near (https://near.social/lord1.near/widget/Form) and are reviewed by our labels team. A label can be removed by our labels team if it is found to be incorrect or no longer relevant; this generally will only happen for mislabeled deposit wallets. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/maker/eth_maker_docs.md b/models/doc_descriptions/maker/eth_maker_docs.md deleted file mode 100644 index 07414135..00000000 --- a/models/doc_descriptions/maker/eth_maker_docs.md +++ /dev/null @@ -1,195 +0,0 @@ -{% docs maker_ilk %} - -The collateral type of the CDP. - -{% enddocs %} - -{% docs maker_urn_address %} - -A specific CDP. - -{% enddocs %} - -{% docs maker_art %} - -Normalized outstanding stablecoin debt. - -{% enddocs %} - -{% docs maker_ink %} - -Collateral balance. - -{% enddocs %} - -{% docs maker_tab %} - -Total dai wanted from the auction / total dai to be raised (in flip auction) - -{% enddocs %} - -{% docs maker_id %} - -ID of the auction in the Flipper - -{% enddocs %} - -{% docs maker_cdp %} - -The CDP vault number. - -{% enddocs %} - -{% docs maker_fact_cat_bite %} - -The Cat is the system's liquidation agent: it enables keepers to mark positions as unsafe and send them to be auctioned. - -{% enddocs %} - -{% docs maker_fact_vat_file %} - -Admin function to modify the system parameters. - -{% enddocs %} - -{% docs maker_fact_vat_flux %} - -Transfers of internal collateral balance of collateral type ilk within Vat from src to dst address. - -{% enddocs %} - -{% docs maker_fact_vat_fold %} - -Fold increases rate of a collateral type i to proportionally increase the outstanding debt of all its vaults, typically to assess the stability fee. It also increases the dai balance of address u to add a surplus to the Vow contract. - -{% enddocs %} - -{% docs maker_rate %} - -Stablecoin debt multiplier (accumulated stability fees) - -{% enddocs %} - -{% docs maker_fact_vat_fork %} - -Moves locked collateral and/or outstanding debt from one vault src to another vault dst by dink and dart amounts. - -This is a public function that can be called by an address that is authorized by both src and dst vaults. - -{% enddocs %} - -{% docs maker_vat_fork_dink %} - -Amount of collateral to exchange. - -{% enddocs %} - -{% docs maker_vat_fork_dart %} - -Amount of stablecoin debt to exchange. - -{% enddocs %} - -{% docs maker_vat_frob_dink %} - -Change in collateral. - -{% enddocs %} - -{% docs maker_vat_frob_dart %} - -Change in debt. - -{% enddocs %} - -{% docs maker_fact_vat_frob %} - -Manipulates the locked collateral and outstanding debt balance of a vault u with collateral balance from address v and dai balance of address w - -Positive dink and dart values add to the existing balances while negative value subtract from them. - -{% enddocs %} - -{% docs maker_fact_vat_move %} - -Used to transfer internal dai balance of user within Vat to another address. - -{% enddocs %} - -{% docs maker_rad %} - -DAI amount. - -{% enddocs %} - -{% docs maker_fact_vat_slip %} - -Used to modify the internal collateral balance of a collateral type within Vat. - -{% enddocs %} - -{% docs maker_fact_pot_exit %} - -Used when users want to "exit" their Dai from the Pot. - -{% enddocs %} - -{% docs maker_fact_pot_join %} - -Used when users want to join their Dai to the Pot. - -{% enddocs %} - -{% docs maker_fact_vat_suck %} - -Generates dai on address u and accounted as bad debt on address v without opening a vault. - -{% enddocs %} - -{% docs maker_fact_urns %} - -Urn addresses are read by calling the urns function on the CDP manager contract for each created vault. - -{% enddocs %} - -{% docs maker_fact_dog_bark %} - -This is the v1 liquidation function. Recent liquidations use the Cat contract. - -{% enddocs %} - -{% docs maker_fact_dai_join_join %} - -Enters collateral into the system. - -{% enddocs %} - -{% docs maker_fact_dai_join_exit %} - -Removes collateral into the system. - -{% enddocs %} - -{% docs maker_fact_cdp_newcdp %} - -Creates a new CDP. - -{% enddocs %} - -{% docs maker_fact_cdp_move %} - -Transfers of DAI from the cdp address to a dst address. - -{% enddocs %} - -{% docs maker_fact_cdp_frob %} - -Modifications of the collateral and debt balance of a CDP. - -{% enddocs %} - -{% docs maker_fact_cdp_flux %} - -Wad amounts of CDP collateral from the cdp address to a dst address. - -{% enddocs %} diff --git a/models/doc_descriptions/nft/nft_aggregator_name.md b/models/doc_descriptions/nft/nft_aggregator_name.md deleted file mode 100644 index 6a1b73a9..00000000 --- a/models/doc_descriptions/nft/nft_aggregator_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_aggregator_name%} - -The name of the aggregator platform where the sale took place. If the sale did not take place via an aggregator platform, then the value will be null. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_amount.md b/models/doc_descriptions/nft/nft_amount.md deleted file mode 100644 index 1c974f76..00000000 --- a/models/doc_descriptions/nft/nft_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_amount%} - -The total amount, specified by the mint token address, used as payment to mint the specified number of NFTs corresponding to this token id. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_amount_usd.md b/models/doc_descriptions/nft/nft_amount_usd.md deleted file mode 100644 index 1a76bb79..00000000 --- a/models/doc_descriptions/nft/nft_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_amount_usd%} - -The USD value of 'amount'. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_block_no.md b/models/doc_descriptions/nft/nft_block_no.md deleted file mode 100644 index 5f56a54f..00000000 --- a/models/doc_descriptions/nft/nft_block_no.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_block_no %} - -The block number at which the NFT event occurred. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_blocktime.md b/models/doc_descriptions/nft/nft_blocktime.md deleted file mode 100644 index 10802389..00000000 --- a/models/doc_descriptions/nft/nft_blocktime.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_blocktime %} - -The block timestamp at which the NFT event occurred. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_buyer_address.md b/models/doc_descriptions/nft/nft_buyer_address.md deleted file mode 100644 index eeb9c3d8..00000000 --- a/models/doc_descriptions/nft/nft_buyer_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_buyer_address %} - -The address of the buyer of the NFT in the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_creator_fee.md b/models/doc_descriptions/nft/nft_creator_fee.md deleted file mode 100644 index 27fa2f8d..00000000 --- a/models/doc_descriptions/nft/nft_creator_fee.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_creator_fee %} - -The decimal adjusted amount of fees paid to the NFT collection as royalty payments for this NFT event in the transaction's currency. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_creator_fee_usd.md b/models/doc_descriptions/nft/nft_creator_fee_usd.md deleted file mode 100644 index 22c9396a..00000000 --- a/models/doc_descriptions/nft/nft_creator_fee_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_creator_fee_usd %} - -The amount of fees paid to the NFT collection as royalty payments for this NFT event in US dollars. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_currency_address.md b/models/doc_descriptions/nft/nft_currency_address.md deleted file mode 100644 index a853435a..00000000 --- a/models/doc_descriptions/nft/nft_currency_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_currency_address %} - -The token contract address for this NFT event. This will be `ETH` for native ETH transactions. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_currency_symbol.md b/models/doc_descriptions/nft/nft_currency_symbol.md deleted file mode 100644 index 3dd3c734..00000000 --- a/models/doc_descriptions/nft/nft_currency_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_currency_symbol %} - -The token symbol for this NFT event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_erc1155_value.md b/models/doc_descriptions/nft/nft_erc1155_value.md deleted file mode 100644 index 580ba064..00000000 --- a/models/doc_descriptions/nft/nft_erc1155_value.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_erc1155_value %} - -If the NFT is an ERC-1155 contract, this field may be one or greater, representing the number of tokens. If it is not an ERC-1155 token, this value will be null. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_event_index.md b/models/doc_descriptions/nft/nft_event_index.md deleted file mode 100644 index 4e242db6..00000000 --- a/models/doc_descriptions/nft/nft_event_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_event_index %} - -The event number within a transaction - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_event_type.md b/models/doc_descriptions/nft/nft_event_type.md deleted file mode 100644 index b716b453..00000000 --- a/models/doc_descriptions/nft/nft_event_type.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_event_type %} - -The type of NFT event in this transaction, either `sale`, `bid_won`, `redeem` or `mint` . - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_events_table_doc.md b/models/doc_descriptions/nft/nft_events_table_doc.md deleted file mode 100644 index 70706600..00000000 --- a/models/doc_descriptions/nft/nft_events_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_events_table_doc %} - -This table contains NFT sales on the Ethereum blockchain. More NFT marketplaces will be added over time. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_from_address.md b/models/doc_descriptions/nft/nft_from_address.md deleted file mode 100644 index a1d3c41d..00000000 --- a/models/doc_descriptions/nft/nft_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_from_address %} - -The sending address of the NFT in the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_intra_event_index.md b/models/doc_descriptions/nft/nft_intra_event_index.md deleted file mode 100644 index 4ce24fc7..00000000 --- a/models/doc_descriptions/nft/nft_intra_event_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_intra_event_index %} - -The order of events within a single event index. This is primarily used for ERC1155 NFT batch transfer events. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_metadata.md b/models/doc_descriptions/nft/nft_metadata.md deleted file mode 100644 index 3d016535..00000000 --- a/models/doc_descriptions/nft/nft_metadata.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_metadata %} - -The token metadata for this NFT. This may be blank for many NFTs. We are working to expand this field. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mint_count.md b/models/doc_descriptions/nft/nft_mint_count.md deleted file mode 100644 index a84c6bbf..00000000 --- a/models/doc_descriptions/nft/nft_mint_count.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mint_count %} - -The number of NFTs minted in this event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mint_doc.md b/models/doc_descriptions/nft/nft_mint_doc.md deleted file mode 100644 index 5afdda4a..00000000 --- a/models/doc_descriptions/nft/nft_mint_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mint_doc %} - -This table contains NFT mint events, defined as an NFT transfers from a burn address to an address, on the Ethereum blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mint_price.md b/models/doc_descriptions/nft/nft_mint_price.md deleted file mode 100644 index f9a8c471..00000000 --- a/models/doc_descriptions/nft/nft_mint_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mint_price %} - -The price paid in ETH to mint the NFT(s). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mint_price_usd.md b/models/doc_descriptions/nft/nft_mint_price_usd.md deleted file mode 100644 index 7e8bf177..00000000 --- a/models/doc_descriptions/nft/nft_mint_price_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mint_price_usd %} - -The price paid in US dollars to mint the NFT(s). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mints_symbol.md b/models/doc_descriptions/nft/nft_mints_symbol.md deleted file mode 100644 index 688ae3d9..00000000 --- a/models/doc_descriptions/nft/nft_mints_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mints_symbol %} - -The symbol of the token supplied to mint the NFT, if applicable. This field may not handle all edge cases. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mints_token_address.md b/models/doc_descriptions/nft/nft_mints_token_address.md deleted file mode 100644 index 84d1946f..00000000 --- a/models/doc_descriptions/nft/nft_mints_token_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mints_token_address %} - -The contract address of the token supplied to mint the NFT, if applicable. This field may not handle all edge cases. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mints_token_price.md b/models/doc_descriptions/nft/nft_mints_token_price.md deleted file mode 100644 index 03942a45..00000000 --- a/models/doc_descriptions/nft/nft_mints_token_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mints_token_price %} - -The decimal adjusted amount of tokens supplied within the same transaction to mint the NFT. This field may not handle all edge cases. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mints_token_price_usd.md b/models/doc_descriptions/nft/nft_mints_token_price_usd.md deleted file mode 100644 index 9e500f79..00000000 --- a/models/doc_descriptions/nft/nft_mints_token_price_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mints_token_price_usd %} - -The amount of tokens supplied in US dollars within the same transaction to mint the NFT. This field may not handle all edge cases. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_nft_address.md b/models/doc_descriptions/nft/nft_nft_address.md deleted file mode 100644 index b064027d..00000000 --- a/models/doc_descriptions/nft/nft_nft_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_nft_address %} - -The contract address of the NFT. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_origin_from.md b/models/doc_descriptions/nft/nft_origin_from.md deleted file mode 100644 index 252828b6..00000000 --- a/models/doc_descriptions/nft/nft_origin_from.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_origin_from %} - -The from address of this transaction. In most cases, this is the NFT buyer. However, for some more complex transactions, it may not be the NFT buyer. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_origin_sig.md b/models/doc_descriptions/nft/nft_origin_sig.md deleted file mode 100644 index 02b4ce68..00000000 --- a/models/doc_descriptions/nft/nft_origin_sig.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_origin_sig %} - -The function signature of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_origin_to.md b/models/doc_descriptions/nft/nft_origin_to.md deleted file mode 100644 index 316a2b67..00000000 --- a/models/doc_descriptions/nft/nft_origin_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_origin_to %} - -The to address of this transaction. In most cases, this is the exchange contract. However, for some more complex NFT events, such as aggregate buys with tools such as Gem and Genie, this may not be the exchange address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_platform_address.md b/models/doc_descriptions/nft/nft_platform_address.md deleted file mode 100644 index aa0f0595..00000000 --- a/models/doc_descriptions/nft/nft_platform_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_platform_address %} - -The address of the exchange used for the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_platform_exchange_version.md b/models/doc_descriptions/nft/nft_platform_exchange_version.md deleted file mode 100644 index 18be47c5..00000000 --- a/models/doc_descriptions/nft/nft_platform_exchange_version.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_platform_exchange_version %} - -The version of the exchange contract used for the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_platform_fee.md b/models/doc_descriptions/nft/nft_platform_fee.md deleted file mode 100644 index 5daa5727..00000000 --- a/models/doc_descriptions/nft/nft_platform_fee.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_platform_fee %} - -The decimal adjusted amount of fees paid to the platform for this NFT event in the transaction's currency. There are cases in Magic Eden transactions for example, where there are fees paid to multiple marketplaces. In those cases, the fee in platform_fee column will only reflect the platform fee related to the platform exchange contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_platform_fee_usd.md b/models/doc_descriptions/nft/nft_platform_fee_usd.md deleted file mode 100644 index 22b6d6bb..00000000 --- a/models/doc_descriptions/nft/nft_platform_fee_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_platform_fee_usd %} - -The amount of fees paid to the platform for this NFT event in US dollars. There are cases in Magic Eden transactions for example, where there are fees paid to multiple marketplaces. In those cases, the fee in platform_fee column will only reflect the platform fee related to the platform exchange contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_platform_name.md b/models/doc_descriptions/nft/nft_platform_name.md deleted file mode 100644 index 05c78e18..00000000 --- a/models/doc_descriptions/nft/nft_platform_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_platform_name %} - -The name of the exchange used for the trade. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_price.md b/models/doc_descriptions/nft/nft_price.md deleted file mode 100644 index 8d570aed..00000000 --- a/models/doc_descriptions/nft/nft_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_price %} - -The total price of the NFT, in the currency in which the transaction occurred and decimal adjusted where possible. Please note that the price of the NFT, after subtracting total fees, may not represent the net amount paid to the seller in all cases. You may refer to the platform fee description for more info. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_price_usd.md b/models/doc_descriptions/nft/nft_price_usd.md deleted file mode 100644 index a941620e..00000000 --- a/models/doc_descriptions/nft/nft_price_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_price_usd %} - -The total price of the NFT in US dollars. This will be 0 for tokens without a decimal adjustment or hourly price. Please note that the price of the NFT, after subtracting total fees, may not represent the net amount paid to the seller in all cases. You may refer to the platform fee description for more info. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_project_name.md b/models/doc_descriptions/nft/nft_project_name.md deleted file mode 100644 index 2ddcf233..00000000 --- a/models/doc_descriptions/nft/nft_project_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_project_name %} - -The name of the NFT project. This field, along with metadata, will be filled in over time. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_seller_address.md b/models/doc_descriptions/nft/nft_seller_address.md deleted file mode 100644 index 198294c7..00000000 --- a/models/doc_descriptions/nft/nft_seller_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_seller_address %} - -The address of the seller of the NFT in the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_to_address.md b/models/doc_descriptions/nft/nft_to_address.md deleted file mode 100644 index 547c3838..00000000 --- a/models/doc_descriptions/nft/nft_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_to_address %} - -The receiving address of the NFT in the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_tokenid.md b/models/doc_descriptions/nft/nft_tokenid.md deleted file mode 100644 index 6d2e48b6..00000000 --- a/models/doc_descriptions/nft/nft_tokenid.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_tokenid %} - -The token ID for this NFT contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_total_fees.md b/models/doc_descriptions/nft/nft_total_fees.md deleted file mode 100644 index 7ec60c98..00000000 --- a/models/doc_descriptions/nft/nft_total_fees.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_total_fees %} - -The total amount of fees paid relating to the NFT purchase in the transaction currency. This includes royalty payments to creators and platform fees. Please note, this does not include the gas fee. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_total_fees_usd.md b/models/doc_descriptions/nft/nft_total_fees_usd.md deleted file mode 100644 index e37b7198..00000000 --- a/models/doc_descriptions/nft/nft_total_fees_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_total_fees_usd %} - -The total amount of fees paid relating to the NFT purchase in US dollars. This includes royalty payments to creators and platform fees. Please note, this does not include the gas fee. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_transfer_doc.md b/models/doc_descriptions/nft/nft_transfer_doc.md deleted file mode 100644 index 291ce083..00000000 --- a/models/doc_descriptions/nft/nft_transfer_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_transfer_doc %} - -This table contains NFT transfer events on the Ethereum blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_tx_fee.md b/models/doc_descriptions/nft/nft_tx_fee.md deleted file mode 100644 index c5161cc4..00000000 --- a/models/doc_descriptions/nft/nft_tx_fee.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_tx_fee %} - -The gas fee for this transaction in ETH. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_tx_fee_usd.md b/models/doc_descriptions/nft/nft_tx_fee_usd.md deleted file mode 100644 index 24ea6625..00000000 --- a/models/doc_descriptions/nft/nft_tx_fee_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_tx_fee_usd %} - -The gas fee for this transaction in US dollars. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_tx_hash.md b/models/doc_descriptions/nft/nft_tx_hash.md deleted file mode 100644 index 10e77623..00000000 --- a/models/doc_descriptions/nft/nft_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_tx_hash %} - -The transaction hash for the NFT event. This is not necessarily unique in this table as a transaction may contain multiple NFT events. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/prices/eth_prices_address.md b/models/doc_descriptions/prices/eth_prices_address.md deleted file mode 100644 index 3eda9a47..00000000 --- a/models/doc_descriptions/prices/eth_prices_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_prices_address %} - -The unique Ethereum address for a given token. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/prices/eth_prices_decimals.md b/models/doc_descriptions/prices/eth_prices_decimals.md deleted file mode 100644 index 8b732f3c..00000000 --- a/models/doc_descriptions/prices/eth_prices_decimals.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_prices_decimals %} - -The number of decimals for token contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/prices/eth_prices_hour.md b/models/doc_descriptions/prices/eth_prices_hour.md deleted file mode 100644 index 7f7fd31b..00000000 --- a/models/doc_descriptions/prices/eth_prices_hour.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_prices_hour %} - - Hour at which the token price was recorded. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/prices/eth_prices_imputed.md b/models/doc_descriptions/prices/eth_prices_imputed.md deleted file mode 100644 index c6234ed1..00000000 --- a/models/doc_descriptions/prices/eth_prices_imputed.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_prices_imputed %} - -This column indicates whether or not the price has been pulled forward from the previous hour. Sometimes hourly prices are missed from our data source, and in that case we carry forward the last recorded hourly price until we record a new price. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/prices/eth_prices_price.md b/models/doc_descriptions/prices/eth_prices_price.md deleted file mode 100644 index 92e17a88..00000000 --- a/models/doc_descriptions/prices/eth_prices_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_prices_price %} - -The token price for a given hour. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/prices/eth_prices_symbol.md b/models/doc_descriptions/prices/eth_prices_symbol.md deleted file mode 100644 index 78084441..00000000 --- a/models/doc_descriptions/prices/eth_prices_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_prices_symbol %} - -The token's symbol. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/prices/eth_prices_table_doc.md b/models/doc_descriptions/prices/eth_prices_table_doc.md deleted file mode 100644 index dcc54630..00000000 --- a/models/doc_descriptions/prices/eth_prices_table_doc.md +++ /dev/null @@ -1,6 +0,0 @@ -{% docs eth_prices_table_doc %} - -This table contains hourly prices for tokens on the Ethereum Blockchain. -The sources of this data are [CoinMarketCap](https://coinmarketcap.com/) and [CoinGecko](https://www.coingecko.com/). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/prices/prices.md b/models/doc_descriptions/prices/prices.md deleted file mode 100644 index 60d4e969..00000000 --- a/models/doc_descriptions/prices/prices.md +++ /dev/null @@ -1,143 +0,0 @@ -{% docs prices_dim_asset_metadata_table_doc %} - -A comprehensive dimensional table holding asset metadata and other relevant details pertaining to each id, from multiple providers. This data set includes raw, non-transformed data coming directly from the provider APIs and rows are not intended to be unique. As a result, there may be data quality issues persisting in the APIs that flow through to this dimensional model. If you are interested in using a curated data set instead, please utilize ez_asset_metadata. - -{% enddocs %} - -{% docs prices_ez_asset_metadata_table_doc %} - -A convenience table holding prioritized asset metadata and other relevant details pertaining to each token_address and native asset. This data set is highly curated and contains metadata for one unique asset per blockchain. - -{% enddocs %} - -{% docs prices_fact_prices_ohlc_hourly_table_doc %} - -A comprehensive fact table holding id and provider specific open, high, low, close hourly prices, from multiple providers. This data set includes raw, non-transformed data coming directly from the provider APIs and rows are not intended to be unique. As a result, there may be data quality issues persisting in the APIs that flow through to this fact based model. If you are interested in using a curated data set instead, please utilize ez_prices_hourly. - -{% enddocs %} - -{% docs prices_ez_prices_hourly_table_doc %} - -A convenience table for determining token prices by address and blockchain, and native asset prices by symbol and blockchain. This data set is highly curated and contains metadata for one price per hour per unique asset and blockchain. - -{% enddocs %} - -{% docs prices_provider %} - -The provider or source of the data. - -{% enddocs %} - -{% docs prices_asset_id %} - -The unique identifier representing the asset. - -{% enddocs %} - -{% docs prices_name %} - -The name of asset. - -{% enddocs %} - -{% docs prices_symbol %} - -The symbol of asset. - -{% enddocs %} - -{% docs prices_token_address %} - -The specific address representing the asset on a specific platform. This will be NULL if referring to a native asset. - -{% enddocs %} - -{% docs prices_token_address_evm %} - -The specific address representing the asset on a specific platform. This will be NULL if referring to a native asset. The case (upper / lower) may or may not be specified within the `dim_asset_metadata` table, as this column is raw and not transformed, coming directly from the provider APIs. However, in the `ez_` views, it will be lowercase by default for all EVMs. - -{% enddocs %} - -{% docs prices_blockchain %} - -The Blockchain, Network, or Platform for this asset. - -{% enddocs %} - -{% docs prices_blockchain_id %} - -The unique identifier of the Blockchain, Network, or Platform for this asset. - -{% enddocs %} - -{% docs prices_decimals %} - -The number of decimals for the asset. May be NULL. - -{% enddocs %} - -{% docs prices_is_native %} - -A flag indicating assets native to the respective blockchain. - -{% enddocs %} - -{% docs prices_is_deprecated %} - -A flag indicating if the asset is deprecated or no longer supported by the provider. - -{% enddocs %} - -{% docs prices_id_deprecation %} - -Deprecating soon! Please use the `asset_id` column instead. - -{% enddocs %} - -{% docs prices_decimals_deprecation %} - -Deprecating soon! Please use the decimals column in `ez_asset_metadata` or join in `dim_contracts` instead. - -{% enddocs %} - -{% docs prices_hour %} - -Hour that the price was recorded at. - -{% enddocs %} - -{% docs prices_price %} - -Closing price of the recorded hour in USD. - -{% enddocs %} - -{% docs prices_is_imputed %} - -A flag indicating if the price was imputed, or derived, from the last arriving record. This is generally used for tokens with low-liquidity or inconsistent reporting. - -{% enddocs %} - -{% docs prices_open %} - -Opening price of the recorded hour in USD. - -{% enddocs %} - -{% docs prices_high %} - -Highest price of the recorded hour in USD - -{% enddocs %} - -{% docs prices_low %} - -Lowest price of the recorded hour in USD - -{% enddocs %} - -{% docs prices_close %} - -Closing price of the recorded hour in USD - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/signatures/eth_bytes_signature.md b/models/doc_descriptions/signatures/eth_bytes_signature.md deleted file mode 100644 index bf533041..00000000 --- a/models/doc_descriptions/signatures/eth_bytes_signature.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_bytes_signature %} - -The byte signature for this function. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/signatures/eth_event_sig_table_doc.md b/models/doc_descriptions/signatures/eth_event_sig_table_doc.md deleted file mode 100644 index b6bf7d03..00000000 --- a/models/doc_descriptions/signatures/eth_event_sig_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_event_sig_table_doc %} - -This table contains event signatures used to decode Ethereum event data into a human-readable format. For more details see (https://www.4byte.directory/). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/signatures/eth_function_id.md b/models/doc_descriptions/signatures/eth_function_id.md deleted file mode 100644 index fe927cd2..00000000 --- a/models/doc_descriptions/signatures/eth_function_id.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_function_id %} - -The ID for this function or event signature. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/signatures/eth_function_sig_table_doc.md b/models/doc_descriptions/signatures/eth_function_sig_table_doc.md deleted file mode 100644 index 98dce2b9..00000000 --- a/models/doc_descriptions/signatures/eth_function_sig_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_function_sig_table_doc %} - -This table contains function signatures used to decode Ethereum call data into a human-readable format. For more details see (https://www.4byte.directory/). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/signatures/eth_hex_signature.md b/models/doc_descriptions/signatures/eth_hex_signature.md deleted file mode 100644 index 39679e9b..00000000 --- a/models/doc_descriptions/signatures/eth_hex_signature.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_hex_signature %} - -The hex signature for this event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/signatures/eth_text_signature.md b/models/doc_descriptions/signatures/eth_text_signature.md deleted file mode 100644 index ea836625..00000000 --- a/models/doc_descriptions/signatures/eth_text_signature.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_text_signature %} - -The human-readable format for this function or event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/stats/evm_stats_core.md b/models/doc_descriptions/stats/evm_stats_core.md deleted file mode 100644 index e8a450a9..00000000 --- a/models/doc_descriptions/stats/evm_stats_core.md +++ /dev/null @@ -1,71 +0,0 @@ -{% docs evm_ez_core_metrics_hourly_table_doc %} - -A convenience table that aggregates block and transaction related metrics using various aggregate functions such as SUM, COUNT, MIN and MAX from the fact_transactions table, on an hourly basis. - -{% enddocs %} - -{% docs evm_block_timestamp_hour %} - -The hour of the timestamp of the block. - -{% enddocs %} - -{% docs evm_block_number_min %} - -The minimum block number in the hour. - -{% enddocs %} - -{% docs evm_block_number_max %} - -The maximum block number in the hour. - -{% enddocs %} - -{% docs evm_block_count %} - -The number of blocks in the hour. - -{% enddocs %} - -{% docs evm_transaction_count %} - -The number of transactions in the hour. - -{% enddocs %} - -{% docs evm_transaction_count_success %} - -The number of successful transactions in the hour. - -{% enddocs %} - -{% docs evm_transaction_count_failed %} - -The number of failed transactions in the hour. - -{% enddocs %} - -{% docs evm_unique_from_count %} - -The number of unique origin from addresses in the hour. - -{% enddocs %} - -{% docs evm_unique_to_count %} - -The number of unique origin to addresses in the hour. - -{% enddocs %} - -{% docs evm_total_fees_native %} - -The sum of all fees in the hour, in the native fee currency. Note, Snowflake's native SUM() function may limit decimal precision. To view precise transaction fee values, please use the `tx_fee_precise` column in `core.fact_transactions`. - -{% enddocs %} - -{% docs evm_total_fees_usd %} - -The sum of all fees in the hour, in USD, rounded to 2 decimal places. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/sushi/eth_sushi_sushi_swaps_table_doc.md b/models/doc_descriptions/sushi/eth_sushi_sushi_swaps_table_doc.md deleted file mode 100644 index ec766574..00000000 --- a/models/doc_descriptions/sushi/eth_sushi_sushi_swaps_table_doc.md +++ /dev/null @@ -1,6 +0,0 @@ -{% docs eth_ez_sushi_swaps_table_doc %} - -This table will contain all swap events done on the Sushiswap platform in the ```fact_event_logs table```, joined along with the addresses of both tokens in the swap and the decimal adjusted prices. -Note: A rule has been put in place to null out the amount_USD if that number is too divergent between amount_in_USD and amount_out_usd. This can happen for swaps of less liquid tokens during very high fluctuation of price. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_block_no.md b/models/doc_descriptions/traces/eth_traces_block_no.md deleted file mode 100644 index a844c5dd..00000000 --- a/models/doc_descriptions/traces/eth_traces_block_no.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_block_no %} - -The block number of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_blocktime.md b/models/doc_descriptions/traces/eth_traces_blocktime.md deleted file mode 100644 index 4589a553..00000000 --- a/models/doc_descriptions/traces/eth_traces_blocktime.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_blocktime %} - -The block timestamp of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_call_data.md b/models/doc_descriptions/traces/eth_traces_call_data.md deleted file mode 100644 index 53e7a85a..00000000 --- a/models/doc_descriptions/traces/eth_traces_call_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_call_data %} - -The raw JSON data for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_eth_value.md b/models/doc_descriptions/traces/eth_traces_eth_value.md deleted file mode 100644 index deb4592a..00000000 --- a/models/doc_descriptions/traces/eth_traces_eth_value.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_eth_value %} - -The amount of ETH transferred in this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_from.md b/models/doc_descriptions/traces/eth_traces_from.md deleted file mode 100644 index a6b0e845..00000000 --- a/models/doc_descriptions/traces/eth_traces_from.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_from %} - -The sending address of this trace. This is not necessarily the from address of the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_gas.md b/models/doc_descriptions/traces/eth_traces_gas.md deleted file mode 100644 index 075e711e..00000000 --- a/models/doc_descriptions/traces/eth_traces_gas.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_gas %} - -The gas supplied for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_gas_used.md b/models/doc_descriptions/traces/eth_traces_gas_used.md deleted file mode 100644 index e56e8b66..00000000 --- a/models/doc_descriptions/traces/eth_traces_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_gas_used %} - -The gas used for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_identifier.md b/models/doc_descriptions/traces/eth_traces_identifier.md deleted file mode 100644 index 5a3fd785..00000000 --- a/models/doc_descriptions/traces/eth_traces_identifier.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_identifier %} - -This field represents the position and type of the trace within the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_index.md b/models/doc_descriptions/traces/eth_traces_index.md deleted file mode 100644 index e3a5b19d..00000000 --- a/models/doc_descriptions/traces/eth_traces_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_trace_index %} - -The index of the trace within the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_input.md b/models/doc_descriptions/traces/eth_traces_input.md deleted file mode 100644 index 9981d7a1..00000000 --- a/models/doc_descriptions/traces/eth_traces_input.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_input %} - -The input data for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_output.md b/models/doc_descriptions/traces/eth_traces_output.md deleted file mode 100644 index ebca9906..00000000 --- a/models/doc_descriptions/traces/eth_traces_output.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_output %} - -The output data for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_sub.md b/models/doc_descriptions/traces/eth_traces_sub.md deleted file mode 100644 index 8f6eaeca..00000000 --- a/models/doc_descriptions/traces/eth_traces_sub.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_sub %} - -The amount of nested sub traces for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_table_doc.md b/models/doc_descriptions/traces/eth_traces_table_doc.md deleted file mode 100644 index 09be358c..00000000 --- a/models/doc_descriptions/traces/eth_traces_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_table_doc %} - -This table contains flattened trace data for internal contract calls on the Ethereum blockchain. Hex encoded fields can be decoded to integers by using `TO_NUMBER(, 'XXXXXXXXXXXX')`, with the number of Xs being the max length of the encoded field. You must also remove the `0x` from your field to use the `TO_NUMBER()` function, if applicable. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_to.md b/models/doc_descriptions/traces/eth_traces_to.md deleted file mode 100644 index 1d382dee..00000000 --- a/models/doc_descriptions/traces/eth_traces_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_to %} - -The receiving address of this trace. This is not necessarily the to address of the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_tx_hash.md b/models/doc_descriptions/traces/eth_traces_tx_hash.md deleted file mode 100644 index d1873653..00000000 --- a/models/doc_descriptions/traces/eth_traces_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_tx_hash %} - -The transaction hash for the trace. Please note, this is not necessarily unique in this table as transactions frequently have multiple traces. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/eth_traces_type.md b/models/doc_descriptions/traces/eth_traces_type.md deleted file mode 100644 index 7582dc1a..00000000 --- a/models/doc_descriptions/traces/eth_traces_type.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_traces_type %} - -The type of internal transaction. Common trace types are `CALL`, `DELEGATECALL`, and `STATICCALL`. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_cumulative_gas_used.md b/models/doc_descriptions/transactions/eth_cumulative_gas_used.md deleted file mode 100644 index 43b86879..00000000 --- a/models/doc_descriptions/transactions/eth_cumulative_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_cumulative_gas_used %} - -The total amount of gas used when this transaction was executed in the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_block_hash.md b/models/doc_descriptions/transactions/eth_tx_block_hash.md deleted file mode 100644 index 31bf3337..00000000 --- a/models/doc_descriptions/transactions/eth_tx_block_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_block_hash %} - -Block hash is a unique 66-character identifier that is generate when a block is produced. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_fee.md b/models/doc_descriptions/transactions/eth_tx_fee.md deleted file mode 100644 index e0f4207e..00000000 --- a/models/doc_descriptions/transactions/eth_tx_fee.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_fee %} - -Amount paid to validate the transaction in Ether. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_gas_limit.md b/models/doc_descriptions/transactions/eth_tx_gas_limit.md deleted file mode 100644 index 6adeaa87..00000000 --- a/models/doc_descriptions/transactions/eth_tx_gas_limit.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_gas_limit %} - -Maximum amount of gas allocated for the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_gas_price.md b/models/doc_descriptions/transactions/eth_tx_gas_price.md deleted file mode 100644 index 25d88b5c..00000000 --- a/models/doc_descriptions/transactions/eth_tx_gas_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_gas_price %} - -Cost per unit of gas in Gwei. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_gas_used.md b/models/doc_descriptions/transactions/eth_tx_gas_used.md deleted file mode 100644 index 9ed5d90a..00000000 --- a/models/doc_descriptions/transactions/eth_tx_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_gas_used %} - -Gas used by transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_hash.md b/models/doc_descriptions/transactions/eth_tx_hash.md deleted file mode 100644 index 6e93bab9..00000000 --- a/models/doc_descriptions/transactions/eth_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_input_data.md b/models/doc_descriptions/transactions/eth_tx_input_data.md deleted file mode 100644 index cfd4c731..00000000 --- a/models/doc_descriptions/transactions/eth_tx_input_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_input_data %} - -This column contains additional data for this transaction, and is commonly used as part of a contract interaction or as a message to the recipient. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_json.md b/models/doc_descriptions/transactions/eth_tx_json.md deleted file mode 100644 index f8a5aeb9..00000000 --- a/models/doc_descriptions/transactions/eth_tx_json.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_json %} - -This JSON column contains the transaction details, including event logs. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_nonce.md b/models/doc_descriptions/transactions/eth_tx_nonce.md deleted file mode 100644 index 0f9be3e7..00000000 --- a/models/doc_descriptions/transactions/eth_tx_nonce.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_nonce %} - -The number of transactions sent from a given address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_origin_sig.md b/models/doc_descriptions/transactions/eth_tx_origin_sig.md deleted file mode 100644 index 5b775ea8..00000000 --- a/models/doc_descriptions/transactions/eth_tx_origin_sig.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_origin_sig %} - -The function signature of the contract call. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_position.md b/models/doc_descriptions/transactions/eth_tx_position.md deleted file mode 100644 index b515c7ec..00000000 --- a/models/doc_descriptions/transactions/eth_tx_position.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_position %} - -The position of the transaction within the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_status.md b/models/doc_descriptions/transactions/eth_tx_status.md deleted file mode 100644 index 0c651c4a..00000000 --- a/models/doc_descriptions/transactions/eth_tx_status.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_status %} - -Status of the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_tx_table_doc.md b/models/doc_descriptions/transactions/eth_tx_table_doc.md deleted file mode 100644 index 6ab22114..00000000 --- a/models/doc_descriptions/transactions/eth_tx_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_tx_table_doc %} - -This table contains transaction level data for the Ethereum Blockchain. Each transaction will have a unique transaction hash, along with transactions fees and an ETH value transferred when applicable. Transactions may be native ETH transfers or interactions with contract addresses. For more information, please see [The Ethereum Organization - Transactions](https://ethereum.org/en/developers/docs/transactions/) - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/eth_value.md b/models/doc_descriptions/transactions/eth_value.md deleted file mode 100644 index a424acd4..00000000 --- a/models/doc_descriptions/transactions/eth_value.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_value %} - -The value transacted in Ether. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_eth_amount.md b/models/doc_descriptions/transfers/eth_eth_amount.md deleted file mode 100644 index acbd4817..00000000 --- a/models/doc_descriptions/transfers/eth_eth_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_eth_amount %} - -ETH value transferred. - -{% enddocs %} diff --git a/models/doc_descriptions/transfers/eth_eth_amount_usd.md b/models/doc_descriptions/transfers/eth_eth_amount_usd.md deleted file mode 100644 index 0f1dcd9e..00000000 --- a/models/doc_descriptions/transfers/eth_eth_amount_usd.md +++ /dev/null @@ -1,6 +0,0 @@ - -{% docs eth_eth_amount_usd %} - -ETH value transferred, in USD. - -{% enddocs %} diff --git a/models/doc_descriptions/transfers/eth_ez_eth_transfers_table_doc.md b/models/doc_descriptions/transfers/eth_ez_eth_transfers_table_doc.md deleted file mode 100644 index f6dead08..00000000 --- a/models/doc_descriptions/transfers/eth_ez_eth_transfers_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_ez_eth_transfers_table_doc %} - -This table contains all native ETH transfers, including equivalent USD amounts. The origin addresses correspond to the to and from addresses from the `fact_transactions` table. The `identifier` and `tx_hash` columns relate this table back to `fact_traces`, which contains more details on the transfers. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_ez_transfer_table_doc.md b/models/doc_descriptions/transfers/eth_ez_transfer_table_doc.md deleted file mode 100644 index 2485b6b6..00000000 --- a/models/doc_descriptions/transfers/eth_ez_transfer_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_ez_transfer_table_doc %} - -This table will contain all events in the ```fact_token_transfers table```, along with joined columns such as token price, symbol, and decimals where possible that allow for easier analysis of token transfer events. Please note Native ETH transfers are not included here. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_log_id_transfers.md b/models/doc_descriptions/transfers/eth_log_id_transfers.md deleted file mode 100644 index fe177035..00000000 --- a/models/doc_descriptions/transfers/eth_log_id_transfers.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_log_id_transfers %} - -This is the primary key for this table. This is a concatenation of the transaction hash and the event index at which the transfer event occurred. This field can be used to find more details on the event within the ```fact_event_logs``` table. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_origin_from.md b/models/doc_descriptions/transfers/eth_origin_from.md deleted file mode 100644 index 690c8988..00000000 --- a/models/doc_descriptions/transfers/eth_origin_from.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_origin_from %} - -The from address at the transaction level. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_origin_to.md b/models/doc_descriptions/transfers/eth_origin_to.md deleted file mode 100644 index 678c0b0c..00000000 --- a/models/doc_descriptions/transfers/eth_origin_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_origin_to %} - -The to address at the transaction level. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_transfer_amount.md b/models/doc_descriptions/transfers/eth_transfer_amount.md deleted file mode 100644 index 5bdec85c..00000000 --- a/models/doc_descriptions/transfers/eth_transfer_amount.md +++ /dev/null @@ -1,11 +0,0 @@ -{% docs eth_transfer_amount %} - -The decimal transformed amount for this token. Tokens without a decimal adjustment will be nulled out here. - -{% enddocs %} - -{% docs eth_transfer_amount_precise %} - -The decimal transformed amount for this token returned as a string to preserve precision. Tokens without a decimal adjustment will be nulled out here. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_transfer_amount_usd.md b/models/doc_descriptions/transfers/eth_transfer_amount_usd.md deleted file mode 100644 index 815407a6..00000000 --- a/models/doc_descriptions/transfers/eth_transfer_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_transfer_amount_usd %} - -The amount in US dollars for this transfer at the time of the transfer. Tokens without a decimal adjustment or price will be nulled out here. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_transfer_contract_address.md b/models/doc_descriptions/transfers/eth_transfer_contract_address.md deleted file mode 100644 index 6956ef3f..00000000 --- a/models/doc_descriptions/transfers/eth_transfer_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_transfer_contract_address %} - -Contract address of the token being transferred. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_transfer_from_address.md b/models/doc_descriptions/transfers/eth_transfer_from_address.md deleted file mode 100644 index b98a132b..00000000 --- a/models/doc_descriptions/transfers/eth_transfer_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_transfer_from_address %} - -The sending address of this transfer. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_transfer_has_decimal.md b/models/doc_descriptions/transfers/eth_transfer_has_decimal.md deleted file mode 100644 index 64b6b636..00000000 --- a/models/doc_descriptions/transfers/eth_transfer_has_decimal.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_transfer_has_decimal %} - -Whether or not our contracts model contains the necessary decimal adjustment for this token. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_transfer_has_price.md b/models/doc_descriptions/transfers/eth_transfer_has_price.md deleted file mode 100644 index fbf50a07..00000000 --- a/models/doc_descriptions/transfers/eth_transfer_has_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_transfer_has_price %} - -Whether or not our prices model contains this hourly token price. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_transfer_raw_amount.md b/models/doc_descriptions/transfers/eth_transfer_raw_amount.md deleted file mode 100644 index edaa2b4b..00000000 --- a/models/doc_descriptions/transfers/eth_transfer_raw_amount.md +++ /dev/null @@ -1,12 +0,0 @@ -{% docs eth_transfer_raw_amount %} - -The amount of tokens transferred. This value is not decimal adjusted. - -{% enddocs %} - - -{% docs eth_transfer_raw_amount_precise %} - -The amount of tokens transferred returned as a string to preserve precision. This value is not decimal adjusted. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_transfer_to_address.md b/models/doc_descriptions/transfers/eth_transfer_to_address.md deleted file mode 100644 index 7a6f2ca9..00000000 --- a/models/doc_descriptions/transfers/eth_transfer_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_transfer_to_address %} - -The receiving address of this transfer. This can be a contract address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_transfer_token_price.md b/models/doc_descriptions/transfers/eth_transfer_token_price.md deleted file mode 100644 index ececc287..00000000 --- a/models/doc_descriptions/transfers/eth_transfer_token_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_transfer_token_price %} - -The price, if available, for this token at the transfer time. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/eth_transfer_tx_hash.md b/models/doc_descriptions/transfers/eth_transfer_tx_hash.md deleted file mode 100644 index deccee17..00000000 --- a/models/doc_descriptions/transfers/eth_transfer_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_transfer_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. This will not be unique in this table as a transaction could include multiple transfer events. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_amount0_adjusted.md b/models/doc_descriptions/univ3/all_amount0_adjusted.md deleted file mode 100644 index 1a8f41a6..00000000 --- a/models/doc_descriptions/univ3/all_amount0_adjusted.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_amount0_adjusted %} - -The delta of the token0 balance of the pool, decimal adjusted. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_amount0_usd.md b/models/doc_descriptions/univ3/all_amount0_usd.md deleted file mode 100644 index 72df0062..00000000 --- a/models/doc_descriptions/univ3/all_amount0_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_amount0_usd %} - -The delta of the token0 balance of the pool, converted to USD - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_amount1_adjusted.md b/models/doc_descriptions/univ3/all_amount1_adjusted.md deleted file mode 100644 index 3b01b406..00000000 --- a/models/doc_descriptions/univ3/all_amount1_adjusted.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_amount1_adjusted %} - -The delta of the token1 balance of the pool, decimal adjusted. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_amount1_usd.md b/models/doc_descriptions/univ3/all_amount1_usd.md deleted file mode 100644 index 001ffb7b..00000000 --- a/models/doc_descriptions/univ3/all_amount1_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_amount1_usd %} - -The delta of the token1 balance of the pool, converted to USD - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_liquidity.md b/models/doc_descriptions/univ3/all_liquidity.md deleted file mode 100644 index 940e6674..00000000 --- a/models/doc_descriptions/univ3/all_liquidity.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_liquidity %} - -The liquidity of the pool. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_liquidity_adjusted.md b/models/doc_descriptions/univ3/all_liquidity_adjusted.md deleted file mode 100644 index 9f50e0bd..00000000 --- a/models/doc_descriptions/univ3/all_liquidity_adjusted.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_liquidity_adjusted %} - -The liquidity of the pool, decimal adjusted. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_liquidity_provider.md b/models/doc_descriptions/univ3/all_liquidity_provider.md deleted file mode 100644 index 3d55a00c..00000000 --- a/models/doc_descriptions/univ3/all_liquidity_provider.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_liquidity_provider %} - -The address of the LP - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_nf_position_manager_address.md b/models/doc_descriptions/univ3/all_nf_position_manager_address.md deleted file mode 100644 index e896f5ea..00000000 --- a/models/doc_descriptions/univ3/all_nf_position_manager_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_nf_position_manager_address %} - -The address of the peripheral nf position manager contract, if used. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_nf_token_id.md b/models/doc_descriptions/univ3/all_nf_token_id.md deleted file mode 100644 index 1ba1c51d..00000000 --- a/models/doc_descriptions/univ3/all_nf_token_id.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_nf_token_id %} - -The id of the NFT associated with the liquidity position - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_pool_address.md b/models/doc_descriptions/univ3/all_pool_address.md deleted file mode 100644 index 80ddfaee..00000000 --- a/models/doc_descriptions/univ3/all_pool_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_pool_address %} - -The contract address of the pool - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_pool_name.md b/models/doc_descriptions/univ3/all_pool_name.md deleted file mode 100644 index 76e6b818..00000000 --- a/models/doc_descriptions/univ3/all_pool_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_pool_name %} - -The contract label/name of the pool - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_price_0_1.md b/models/doc_descriptions/univ3/all_price_0_1.md deleted file mode 100644 index 09c7f748..00000000 --- a/models/doc_descriptions/univ3/all_price_0_1.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_price_0_1 %} - -The amount of token0 per token1 that the swap occurred at - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_price_1_0.md b/models/doc_descriptions/univ3/all_price_1_0.md deleted file mode 100644 index 4128a604..00000000 --- a/models/doc_descriptions/univ3/all_price_1_0.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_price_1_0 %} - -The amount of token1 per token0 that the swap occurred at - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_price_lower_0_1.md b/models/doc_descriptions/univ3/all_price_lower_0_1.md deleted file mode 100644 index 8d0c4235..00000000 --- a/models/doc_descriptions/univ3/all_price_lower_0_1.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_price_lower_0_1 %} - -Lower bound of the liquidity position represented as token 0 per token 1 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_price_lower_0_1_usd.md b/models/doc_descriptions/univ3/all_price_lower_0_1_usd.md deleted file mode 100644 index 02f1646a..00000000 --- a/models/doc_descriptions/univ3/all_price_lower_0_1_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_price_lower_0_1_usd %} - -Lower bound of the liquidity position represented as token 0 per token 1, converted to USD - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_price_lower_1_0.md b/models/doc_descriptions/univ3/all_price_lower_1_0.md deleted file mode 100644 index c0af58e0..00000000 --- a/models/doc_descriptions/univ3/all_price_lower_1_0.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_price_lower_1_0 %} - -Lower bound of the liquidity position represented as token 1 per token 0 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_price_lower_1_0_usd.md b/models/doc_descriptions/univ3/all_price_lower_1_0_usd.md deleted file mode 100644 index 2f4ce21b..00000000 --- a/models/doc_descriptions/univ3/all_price_lower_1_0_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_price_lower_1_0_usd %} - -Lower bound of the liquidity position represented as token 1 per token 0, converted to USD - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_price_upper_0_1.md b/models/doc_descriptions/univ3/all_price_upper_0_1.md deleted file mode 100644 index 7aa62c51..00000000 --- a/models/doc_descriptions/univ3/all_price_upper_0_1.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_price_upper_0_1 %} - -Upper bound of the liquidity position represented as token 0 per token 1 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_price_upper_0_1_usd.md b/models/doc_descriptions/univ3/all_price_upper_0_1_usd.md deleted file mode 100644 index de4d61c8..00000000 --- a/models/doc_descriptions/univ3/all_price_upper_0_1_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_price_upper_0_1_usd %} - -Upper bound of the liquidity position represented as token 0 per token 1, converted to USD - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_price_upper_1_0.md b/models/doc_descriptions/univ3/all_price_upper_1_0.md deleted file mode 100644 index d5a0b91d..00000000 --- a/models/doc_descriptions/univ3/all_price_upper_1_0.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_price_upper_1_0 %} - -pper bound of the liquidity position represented as token 1 per token 0 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_price_upper_1_0_usd.md b/models/doc_descriptions/univ3/all_price_upper_1_0_usd.md deleted file mode 100644 index c05e5aec..00000000 --- a/models/doc_descriptions/univ3/all_price_upper_1_0_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_price_upper_1_0_usd %} - -Upper bound of the liquidity position represented as token 1 per token 0, converted to USD - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_tick_lower.md b/models/doc_descriptions/univ3/all_tick_lower.md deleted file mode 100644 index b9b2ba2d..00000000 --- a/models/doc_descriptions/univ3/all_tick_lower.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_tick_lower %} - -Lower tick of the liquidity position - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_tick_upper.md b/models/doc_descriptions/univ3/all_tick_upper.md deleted file mode 100644 index 222e1b33..00000000 --- a/models/doc_descriptions/univ3/all_tick_upper.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_tick_upper %} - -Upper tick of the liquidity position - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_token0_address.md b/models/doc_descriptions/univ3/all_token0_address.md deleted file mode 100644 index 5db432c6..00000000 --- a/models/doc_descriptions/univ3/all_token0_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_token0_address %} - -Contract address of token 0 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_token0_decimals.md b/models/doc_descriptions/univ3/all_token0_decimals.md deleted file mode 100644 index 7fbf9e98..00000000 --- a/models/doc_descriptions/univ3/all_token0_decimals.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_token0_decimals %} - -Decimal adjustment of token0 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_token0_name.md b/models/doc_descriptions/univ3/all_token0_name.md deleted file mode 100644 index 4b73b6e0..00000000 --- a/models/doc_descriptions/univ3/all_token0_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_token0_name %} - -Name of token0 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_token0_price.md b/models/doc_descriptions/univ3/all_token0_price.md deleted file mode 100644 index b1261418..00000000 --- a/models/doc_descriptions/univ3/all_token0_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_token0_price %} - -Price of token0 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_token0_symbol.md b/models/doc_descriptions/univ3/all_token0_symbol.md deleted file mode 100644 index 9b3e087f..00000000 --- a/models/doc_descriptions/univ3/all_token0_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_token0_symbol %} - -Symbol of token0 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_token1_address.md b/models/doc_descriptions/univ3/all_token1_address.md deleted file mode 100644 index f1b00c22..00000000 --- a/models/doc_descriptions/univ3/all_token1_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_token1_address %} - -Address of token1 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_token1_decimals.md b/models/doc_descriptions/univ3/all_token1_decimals.md deleted file mode 100644 index bfc16243..00000000 --- a/models/doc_descriptions/univ3/all_token1_decimals.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_token1_decimals %} - -Decimal adjustment of token1 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_token1_name.md b/models/doc_descriptions/univ3/all_token1_name.md deleted file mode 100644 index 57dd6f33..00000000 --- a/models/doc_descriptions/univ3/all_token1_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_token1_name %} - -Name of token1 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_token1_price.md b/models/doc_descriptions/univ3/all_token1_price.md deleted file mode 100644 index eb3b2573..00000000 --- a/models/doc_descriptions/univ3/all_token1_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_token1_price %} - -Price of token1 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/all_token1_symbol.md b/models/doc_descriptions/univ3/all_token1_symbol.md deleted file mode 100644 index 87d7357a..00000000 --- a/models/doc_descriptions/univ3/all_token1_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs all_token1_symbol %} - -Symbol of token1 - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/lp_actions_action.md b/models/doc_descriptions/univ3/lp_actions_action.md deleted file mode 100644 index a9e87ef8..00000000 --- a/models/doc_descriptions/univ3/lp_actions_action.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lp_actions_action %} - -The type of lp action, either INCREASE_LIQUIDITY (mint) or DECREASE_LIQUIDITY (burn) - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/lp_actions_table_doc.md b/models/doc_descriptions/univ3/lp_actions_table_doc.md deleted file mode 100644 index 717f6a83..00000000 --- a/models/doc_descriptions/univ3/lp_actions_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lp_actions_table_doc %} - -Use this table to track increases and decreases to positions by liquidity providers (LPs) over time. Whenever a Pool Burn or Mint event is triggered on a position a record is appended to this table. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_fee_growth_global0_x128.md b/models/doc_descriptions/univ3/pool_stats_fee_growth_global0_x128.md deleted file mode 100644 index ab4d0186..00000000 --- a/models/doc_descriptions/univ3/pool_stats_fee_growth_global0_x128.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_fee_growth_global0_x128 %} - -The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_fee_growth_global1_x128.md b/models/doc_descriptions/univ3/pool_stats_fee_growth_global1_x128.md deleted file mode 100644 index ea5e051c..00000000 --- a/models/doc_descriptions/univ3/pool_stats_fee_growth_global1_x128.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_fee_growth_global1_x128 %} - -The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_protocol_fees_token0_adjusted.md b/models/doc_descriptions/univ3/pool_stats_protocol_fees_token0_adjusted.md deleted file mode 100644 index 91bb3cc5..00000000 --- a/models/doc_descriptions/univ3/pool_stats_protocol_fees_token0_adjusted.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_protocol_fees_token0_adjusted %} - -The amount of token0 owed to the protocol, decimal adjusted - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_protocol_fees_token1_adjusted.md b/models/doc_descriptions/univ3/pool_stats_protocol_fees_token1_adjusted.md deleted file mode 100644 index 81f69b96..00000000 --- a/models/doc_descriptions/univ3/pool_stats_protocol_fees_token1_adjusted.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_protocol_fees_token1_adjusted %} - -The amount of token1 owed to the protocol, decimal adjusted - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_table_doc.md b/models/doc_descriptions/univ3/pool_stats_table_doc.md deleted file mode 100644 index f6959f82..00000000 --- a/models/doc_descriptions/univ3/pool_stats_table_doc.md +++ /dev/null @@ -1,7 +0,0 @@ -{% docs pool_stats_table_doc %} - -Statistics for each pool, appened each time a transaction triggers a Pool Event (i.e. 'Initialize', 'Mint', 'Collect', 'Burn', 'Swap', 'Flash', 'IncreaseObservationCardinalityNext', 'SetFeeProtocol', 'CollectProtocol', etc.). - -A new record is appended each time this occurs. These stats are read from the Pool contract state leveraging Flipside's fully archival Ethereum cluster. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_tick.md b/models/doc_descriptions/univ3/pool_stats_tick.md deleted file mode 100644 index 236ac34b..00000000 --- a/models/doc_descriptions/univ3/pool_stats_tick.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_tick %} - -The tick of the pool according to the last tick transitions that was run. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_token0_balance.md b/models/doc_descriptions/univ3/pool_stats_token0_balance.md deleted file mode 100644 index 972a45f7..00000000 --- a/models/doc_descriptions/univ3/pool_stats_token0_balance.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_token0_balance %} - -The balance of token0 locked in the pool contract as of this block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_token0_balance_adjusted.md b/models/doc_descriptions/univ3/pool_stats_token0_balance_adjusted.md deleted file mode 100644 index 35306f8b..00000000 --- a/models/doc_descriptions/univ3/pool_stats_token0_balance_adjusted.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_token0_balance_adjusted %} - -The balance of token0 locked in the pool contract as of this block, decimal adjusted. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_token0_balance_usd.md b/models/doc_descriptions/univ3/pool_stats_token0_balance_usd.md deleted file mode 100644 index 2d27f1be..00000000 --- a/models/doc_descriptions/univ3/pool_stats_token0_balance_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_token0_balance_usd %} - -The balance of token0 locked in the pool contract as of this block in USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_token1_balance.md b/models/doc_descriptions/univ3/pool_stats_token1_balance.md deleted file mode 100644 index 00f39612..00000000 --- a/models/doc_descriptions/univ3/pool_stats_token1_balance.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_token1_balance %} - -The balance of token1 locked in the pool contract as of this block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_token1_balance_adjusted.md b/models/doc_descriptions/univ3/pool_stats_token1_balance_adjusted.md deleted file mode 100644 index 1d1e78a6..00000000 --- a/models/doc_descriptions/univ3/pool_stats_token1_balance_adjusted.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_token1_balance_adjusted %} - -The balance of token1 locked in the pool contract as of this block, decimal adjusted. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_token1_balance_usd.md b/models/doc_descriptions/univ3/pool_stats_token1_balance_usd.md deleted file mode 100644 index 737f21a3..00000000 --- a/models/doc_descriptions/univ3/pool_stats_token1_balance_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_token1_balance_usd %} - -The balance of token1 locked in the pool contract as of this block in USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_unlocked.md b/models/doc_descriptions/univ3/pool_stats_unlocked.md deleted file mode 100644 index 0043e534..00000000 --- a/models/doc_descriptions/univ3/pool_stats_unlocked.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_unlocked %} - -Whether the pool is currently locked to reentrancy - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_virtual_liquidity_adjusted.md b/models/doc_descriptions/univ3/pool_stats_virtual_liquidity_adjusted.md deleted file mode 100644 index d843d084..00000000 --- a/models/doc_descriptions/univ3/pool_stats_virtual_liquidity_adjusted.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_virtual_liquidity_adjusted %} - -The virtual liquidity of the pool - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_virtual_reserves_token0_adjusted.md b/models/doc_descriptions/univ3/pool_stats_virtual_reserves_token0_adjusted.md deleted file mode 100644 index 01e43da8..00000000 --- a/models/doc_descriptions/univ3/pool_stats_virtual_reserves_token0_adjusted.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_virtual_reserves_token0_adjusted %} - -The virtual reserves of token0, decimal adjusted, in the pool. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_virtual_reserves_token0_usd.md b/models/doc_descriptions/univ3/pool_stats_virtual_reserves_token0_usd.md deleted file mode 100644 index 4545a02e..00000000 --- a/models/doc_descriptions/univ3/pool_stats_virtual_reserves_token0_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_virtual_reserves_token0_usd %} - -The virtual reserves of token0, converted to USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_virtual_reserves_token1_adjusted.md b/models/doc_descriptions/univ3/pool_stats_virtual_reserves_token1_adjusted.md deleted file mode 100644 index 6df3273a..00000000 --- a/models/doc_descriptions/univ3/pool_stats_virtual_reserves_token1_adjusted.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_virtual_reserves_token1_adjusted %} - -The virtual reserves of token1, decimal adjusted, in the pool. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pool_stats_virtual_reserves_token1_usd.md b/models/doc_descriptions/univ3/pool_stats_virtual_reserves_token1_usd.md deleted file mode 100644 index 8c3e733a..00000000 --- a/models/doc_descriptions/univ3/pool_stats_virtual_reserves_token1_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pool_stats_virtual_reserves_token1_usd %} - -The virtual reserves of token1, converted to USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pools_factory_address.md b/models/doc_descriptions/univ3/pools_factory_address.md deleted file mode 100644 index 615907df..00000000 --- a/models/doc_descriptions/univ3/pools_factory_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pools_factory_address %} - -The address of the UniswapV3 factory that initialized this Pool. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pools_fee.md b/models/doc_descriptions/univ3/pools_fee.md deleted file mode 100644 index 492b1a25..00000000 --- a/models/doc_descriptions/univ3/pools_fee.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pools_fee %} - -The swapping fee of the pool. Liquidity providers initially created pools at three fee levels: 0.05%, 0.30%, and 1%, though more fee levels have been added by UNI governance. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pools_fee_percent.md b/models/doc_descriptions/univ3/pools_fee_percent.md deleted file mode 100644 index 6dfa1472..00000000 --- a/models/doc_descriptions/univ3/pools_fee_percent.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pools_fee_percent %} - -The fee expressed as a decimal percentage - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pools_init_price_1_0.md b/models/doc_descriptions/univ3/pools_init_price_1_0.md deleted file mode 100644 index 32af9b56..00000000 --- a/models/doc_descriptions/univ3/pools_init_price_1_0.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pools_init_price_1_0 %} - -The initial price of the Pool (converted from sqrtPriceX96). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pools_init_price_1_0_usd.md b/models/doc_descriptions/univ3/pools_init_price_1_0_usd.md deleted file mode 100644 index cfe20ee8..00000000 --- a/models/doc_descriptions/univ3/pools_init_price_1_0_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pools_init_price_1_0_usd %} - -The initial price of the Pool (converted from sqrtPriceX96) in USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pools_init_tick.md b/models/doc_descriptions/univ3/pools_init_tick.md deleted file mode 100644 index 3b45c691..00000000 --- a/models/doc_descriptions/univ3/pools_init_tick.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pools_init_tick %} - -The initial tick of the Pool - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pools_table_doc.md b/models/doc_descriptions/univ3/pools_table_doc.md deleted file mode 100644 index 07bb4132..00000000 --- a/models/doc_descriptions/univ3/pools_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pools_table_doc %} - -Pool records are appended to this table whenever a PoolCreated event is emitted by the UniswapV3 Factory Contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/pools_tick_spacing.md b/models/doc_descriptions/univ3/pools_tick_spacing.md deleted file mode 100644 index cb41b507..00000000 --- a/models/doc_descriptions/univ3/pools_tick_spacing.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs pools_tick_spacing %} - -The minimum number of ticks allowed between each tick. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/position_collected_fees_table_doc.md b/models/doc_descriptions/univ3/position_collected_fees_table_doc.md deleted file mode 100644 index 00fb63c8..00000000 --- a/models/doc_descriptions/univ3/position_collected_fees_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs position_collected_fees_table_doc %} - -Fees collected by a Liquidity Provider (LP) on their position. In V3 fees are accrued and collected in each token within the pair. When a pool Collect event is emitted a new record is appended to this table. If a Burn event is emitted in the same transaction as the Collect event the amount of the burn is subtracted from the Collect event token1 and token0 amounts. This allows us to arrive solely at the swap fees collected. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_collected_fees_event_index.md b/models/doc_descriptions/univ3/positions_collected_fees_event_index.md deleted file mode 100644 index b22e10f5..00000000 --- a/models/doc_descriptions/univ3/positions_collected_fees_event_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_collected_fees_event_index %} - -Event index pertains to the grouping of individual events together. Withing one event index there could be multiple messages that take place and this would be the key to tie them together. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_collected_fees_price_lower.md b/models/doc_descriptions/univ3/positions_collected_fees_price_lower.md deleted file mode 100644 index b472df5c..00000000 --- a/models/doc_descriptions/univ3/positions_collected_fees_price_lower.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_collected_fees_price_lower %} - -Lower bound of the liquidity position represented as token 1 per token 0. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_collected_fees_price_lower_usd.md b/models/doc_descriptions/univ3/positions_collected_fees_price_lower_usd.md deleted file mode 100644 index e1880393..00000000 --- a/models/doc_descriptions/univ3/positions_collected_fees_price_lower_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_collected_fees_price_lower_usd %} - -Lower bound of the liquidity position represented as token 1 per token 0, converted to USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_collected_fees_price_upper.md b/models/doc_descriptions/univ3/positions_collected_fees_price_upper.md deleted file mode 100644 index 6d383fd7..00000000 --- a/models/doc_descriptions/univ3/positions_collected_fees_price_upper.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_collected_fees_price_upper %} - -Upper bound of the liquidity position represented as token 1 per token 0. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_collected_fees_price_upper_usd.md b/models/doc_descriptions/univ3/positions_collected_fees_price_upper_usd.md deleted file mode 100644 index eb2cd2d6..00000000 --- a/models/doc_descriptions/univ3/positions_collected_fees_price_upper_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_collected_fees_price_upper_usd %} - -Upper bound of the liquidity position represented as token 1 per token 0, converted to USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_fee_growth_inside0_last_x128.md b/models/doc_descriptions/univ3/positions_fee_growth_inside0_last_x128.md deleted file mode 100644 index 2d841344..00000000 --- a/models/doc_descriptions/univ3/positions_fee_growth_inside0_last_x128.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_fee_growth_inside0_last_x128 %} - -The fee growth of token0 as of the last action on the individual position. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_fee_growth_inside1_last_x128.md b/models/doc_descriptions/univ3/positions_fee_growth_inside1_last_x128.md deleted file mode 100644 index a68aaecd..00000000 --- a/models/doc_descriptions/univ3/positions_fee_growth_inside1_last_x128.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_fee_growth_inside1_last_x128 %} - -The fee growth of token1 as of the last action on the individual position. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_fee_percent.md b/models/doc_descriptions/univ3/positions_fee_percent.md deleted file mode 100644 index 39d0dcde..00000000 --- a/models/doc_descriptions/univ3/positions_fee_percent.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_fee_percent %} - -Percent of fees - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_is_active.md b/models/doc_descriptions/univ3/positions_is_active.md deleted file mode 100644 index ec62a244..00000000 --- a/models/doc_descriptions/univ3/positions_is_active.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_is_active %} - -Is the position currently active? When a position is closed this is set to false. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_table_doc.md b/models/doc_descriptions/univ3/positions_table_doc.md deleted file mode 100644 index 490001c4..00000000 --- a/models/doc_descriptions/univ3/positions_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_table_doc %} - -Positions opened by liquidity providers at a specific tick range (tick_lower, tick_upper). Whenever an event is emitted related to a position a new record is added to this table with the latest state of the position. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_tokens_owed0_adjusted.md b/models/doc_descriptions/univ3/positions_tokens_owed0_adjusted.md deleted file mode 100644 index 42462f4c..00000000 --- a/models/doc_descriptions/univ3/positions_tokens_owed0_adjusted.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_token_owed0_adjusted %} - -The uncollected amount of token0 owed to the position as of the last computation. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_tokens_owed0_usd.md b/models/doc_descriptions/univ3/positions_tokens_owed0_usd.md deleted file mode 100644 index bdb97136..00000000 --- a/models/doc_descriptions/univ3/positions_tokens_owed0_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_tokens_owed0_usd %} - -The uncollected amount of token0 owed to the position as of the last computation, converted to USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_tokens_owed1_adjusted.md b/models/doc_descriptions/univ3/positions_tokens_owed1_adjusted.md deleted file mode 100644 index d072c8a0..00000000 --- a/models/doc_descriptions/univ3/positions_tokens_owed1_adjusted.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_token_owed1_adjusted %} - -The uncollected amount of token1 owed to the position as of the last computation. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/positions_tokens_owed1_usd.md b/models/doc_descriptions/univ3/positions_tokens_owed1_usd.md deleted file mode 100644 index 064c0e9f..00000000 --- a/models/doc_descriptions/univ3/positions_tokens_owed1_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs positions_tokens_owed1_usd %} - -The uncollected amount of token1 owed to the position as of the last computation, converted to USD. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/swaps_log_index.md b/models/doc_descriptions/univ3/swaps_log_index.md deleted file mode 100644 index 7b366d09..00000000 --- a/models/doc_descriptions/univ3/swaps_log_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_log_index %} - -Log index pertains to the grouping of individual events together. Withing one log index there could be multiple events that take place and this would be the key to tie them together. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/swaps_price.md b/models/doc_descriptions/univ3/swaps_price.md deleted file mode 100644 index b2c1c739..00000000 --- a/models/doc_descriptions/univ3/swaps_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_price %} - -Price of swap - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/swaps_recipient.md b/models/doc_descriptions/univ3/swaps_recipient.md deleted file mode 100644 index b3856d23..00000000 --- a/models/doc_descriptions/univ3/swaps_recipient.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_recipient %} - -The address that received the output of the swap - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/swaps_sender.md b/models/doc_descriptions/univ3/swaps_sender.md deleted file mode 100644 index 5c1df3ff..00000000 --- a/models/doc_descriptions/univ3/swaps_sender.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_sender %} - -The address that initiated the swap call, and that received the callback - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/swaps_sqrt_price_x96.md b/models/doc_descriptions/univ3/swaps_sqrt_price_x96.md deleted file mode 100644 index c2971a31..00000000 --- a/models/doc_descriptions/univ3/swaps_sqrt_price_x96.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_sqrt_price_x96 %} - -Original swap price before conversion - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/swaps_table_doc.md b/models/doc_descriptions/univ3/swaps_table_doc.md deleted file mode 100644 index 9898a0e9..00000000 --- a/models/doc_descriptions/univ3/swaps_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_table_doc %} - -All swaps that occur on V3 pools. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/univ3/swaps_tick.md b/models/doc_descriptions/univ3/swaps_tick.md deleted file mode 100644 index 8a5e35cf..00000000 --- a/models/doc_descriptions/univ3/swaps_tick.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs swaps_tick %} - -The log base 1.0001 of the price of the pool after the swap - -{% enddocs %} \ No newline at end of file diff --git a/models/github_actions/github_actions__current_task_status.sql b/models/github_actions/github_actions__current_task_status.sql deleted file mode 100644 index 577a2266..00000000 --- a/models/github_actions/github_actions__current_task_status.sql +++ /dev/null @@ -1,6 +0,0 @@ -{{ config( - materialized = 'view', - tags = ['gha_tasks'] -) }} - -{{ fsc_utils.gha_task_current_status_view() }} \ No newline at end of file diff --git a/models/github_actions/github_actions__current_task_status.yml b/models/github_actions/github_actions__current_task_status.yml deleted file mode 100644 index 7f9db965..00000000 --- a/models/github_actions/github_actions__current_task_status.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 2 -models: - - name: github_actions__current_task_status - columns: - - name: PIPELINE_ACTIVE - tests: - - dbt_expectations.expect_column_values_to_be_in_set: - value_set: - - TRUE - config: - severity: warn - - name: SUCCESSES - tests: - - dbt_expectations.expect_column_values_to_be_in_set: - value_set: - - 2 - config: - severity: warn \ No newline at end of file diff --git a/models/github_actions/github_actions__task_history.sql b/models/github_actions/github_actions__task_history.sql deleted file mode 100644 index 9c35ce78..00000000 --- a/models/github_actions/github_actions__task_history.sql +++ /dev/null @@ -1,5 +0,0 @@ -{{ config( - materialized = 'view' -) }} - -{{ fsc_utils.gha_task_history_view() }} \ No newline at end of file diff --git a/models/github_actions/github_actions__task_performance.sql b/models/github_actions/github_actions__task_performance.sql deleted file mode 100644 index 117ded55..00000000 --- a/models/github_actions/github_actions__task_performance.sql +++ /dev/null @@ -1,5 +0,0 @@ -{{ config( - materialized = 'view' -) }} - -{{ fsc_utils.gha_task_performance_view() }} \ No newline at end of file diff --git a/models/github_actions/github_actions__task_schedule.sql b/models/github_actions/github_actions__task_schedule.sql deleted file mode 100644 index ff95a44b..00000000 --- a/models/github_actions/github_actions__task_schedule.sql +++ /dev/null @@ -1,5 +0,0 @@ -{{ config( - materialized = 'view' -) }} - -{{ fsc_utils.gha_task_schedule_view() }} \ No newline at end of file diff --git a/models/github_actions/github_actions__tasks.sql b/models/github_actions/github_actions__tasks.sql deleted file mode 100644 index feab82a8..00000000 --- a/models/github_actions/github_actions__tasks.sql +++ /dev/null @@ -1,5 +0,0 @@ -{{ config( - materialized = 'view' -) }} - -{{ fsc_utils.gha_tasks_view() }} \ No newline at end of file diff --git a/models/gold/core/core__dim_contract_abis.sql b/models/gold/core/core__dim_contract_abis.sql deleted file mode 100644 index 7f8ebb8b..00000000 --- a/models/gold/core/core__dim_contract_abis.sql +++ /dev/null @@ -1,27 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - contract_address, - DATA AS abi, - abi_source, - bytecode, - COALESCE ( - abis_id, - {{ dbt_utils.generate_surrogate_key( - ['contract_address'] - ) }} - ) AS dim_contract_abis_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__abis') }} diff --git a/models/gold/core/core__dim_contract_abis.yml b/models/gold/core/core__dim_contract_abis.yml deleted file mode 100644 index 9203cf00..00000000 --- a/models/gold/core/core__dim_contract_abis.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: 2 -models: - - name: core__dim_contract_abis - description: > - 'This table contains the contract ABIs that we have sourced from Etherscan, the community, or bytecode matched. This table is the source of ABIs used in the `core__ez_decoded_event_logs` and `core__fact_decoded_event_logs` tables. - We first try to source ABIs from Etherscan. If we cannot find an ABI on Etherscan, we will rely on user submissions. To add a contract to this table, please visit [here](https://science.flipsidecrypto.xyz/abi-requestor/). - If we are unable to locate an ABI for a contract from Etherscan or the community, we will try to find an ABI to use by matching the contract bytecode to a known contract bytecode we do have an ABI for.' - - columns: - - name: CONTRACT_ADDRESS - description: 'The address of the contract.' - - name: ABI - description: 'The JSON ABI for the contract.' - - name: ABI_SOURCE - description: 'The source of the ABI. This can be `etherscan`, `user_submitted`, or `bytecode_matched`.' - - name: BYTECODE - description: 'The deployed bytecode of the contract.' - - name: DIM_CONTRACT_ABIS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__dim_contracts.sql b/models/gold/core/core__dim_contracts.sql deleted file mode 100644 index 44037976..00000000 --- a/models/gold/core/core__dim_contracts.sql +++ /dev/null @@ -1,34 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - c0.created_contract_address AS address, - c1.symbol AS symbol, - c1.name AS NAME, - c1.decimals AS decimals, - c0.block_number AS created_block_number, - c0.block_timestamp AS created_block_timestamp, - c0.tx_hash AS created_tx_hash, - c0.creator_address AS creator_address, - COALESCE ( - c0.created_contracts_id, - {{ dbt_utils.generate_surrogate_key( - ['c0.created_contract_address'] - ) }} - ) AS dim_contracts_id, - GREATEST(COALESCE(c0.inserted_timestamp, '2000-01-01'), COALESCE(c1.inserted_timestamp, '2000-01-01')) AS inserted_timestamp, - GREATEST(COALESCE(c0.modified_timestamp, '2000-01-01'), COALESCE(c1.modified_timestamp, '2000-01-01')) AS modified_timestamp, - c1.contract_metadata AS contract_metadata --deprecate -FROM - {{ ref('silver__created_contracts') }} - c0 - LEFT JOIN {{ ref('silver__contracts') }} - c1 - ON LOWER( - c0.created_contract_address - ) = LOWER( - c1.address - ) diff --git a/models/gold/core/core__dim_contracts.yml b/models/gold/core/core__dim_contracts.yml deleted file mode 100644 index 9c283935..00000000 --- a/models/gold/core/core__dim_contracts.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 2 -models: - - name: core__dim_contracts - description: This table contains all the contracts that are deployed on the Ethereum blockchain along with their on-chain metadata. - - columns: - - name: ADDRESS - description: '{{ doc("eth_contracts_contract_address") }}' - - name: SYMBOL - description: '{{ doc("eth_contracts_symbol") }}' - - name: NAME - description: '{{ doc("eth_contracts_name") }}' - - name: DECIMALS - description: '{{ doc("eth_decimals") }}' - - name: CONTRACT_METADATA - description: '{{ doc("evm_column_deprecation_notice_contract_metadata") }}' - - name: CREATED_BLOCK_NUMBER - description: 'The block number when the contract was created' - - name: CREATED_BLOCK_TIMESTAMP - description: 'The block timestamp when the contract was created' - - name: CREATED_TX_HASH - description: 'The transaction hash when the contract was created' - - name: CREATOR_ADDRESS - description: 'The address of the creator of the contract' - - name: DIM_CONTRACTS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__dim_dates.sql b/models/gold/core/core__dim_dates.sql deleted file mode 100644 index 388fd6fd..00000000 --- a/models/gold/core/core__dim_dates.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config( - materialized = "table", - post_hook = "{{ grant_data_share_statement('DIM_DATES', 'TABLE') }}", - tags = ['non_realtime'] -) }} -{{ dbt_date.get_date_dimension( - '2017-01-01', - '2027-12-31' -) }} \ No newline at end of file diff --git a/models/gold/core/core__dim_labels.sql b/models/gold/core/core__dim_labels.sql deleted file mode 100644 index b904e0a2..00000000 --- a/models/gold/core/core__dim_labels.sql +++ /dev/null @@ -1,19 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - blockchain, - creator, - address, - address_name, - label_type, - label_subtype, - project_name AS label, - labels_combined_id AS dim_labels_id, - inserted_timestamp, - modified_timestamp -FROM - {{ ref('silver__labels') }} diff --git a/models/gold/core/core__dim_labels.yml b/models/gold/core/core__dim_labels.yml deleted file mode 100644 index 9b75511f..00000000 --- a/models/gold/core/core__dim_labels.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 2 -models: - - name: core__dim_labels - description: '{{ doc("table_dim_labels") }}' - columns: - - name: BLOCKCHAIN - description: '{{ doc("eth_label_blockchain") }}' - - name: CREATOR - description: '{{ doc("eth_label_creator") }}' - - name: ADDRESS - description: '{{ doc("eth_label_address") }}' - - name: ADDRESS_NAME - description: '{{ doc("eth_labels_table") }}' - - name: LABEL_TYPE - description: '{{ doc("eth_label_type") }}' - - name: LABEL_SUBTYPE - description: '{{ doc("eth_label_subtype") }}' - - name: LABEL - description: '{{ doc("eth_label") }}' - - name: DIM_LABELS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__ez_balance_deltas.sql b/models/gold/core/core__ez_balance_deltas.sql index ad9c0950..85282561 100644 --- a/models/gold/core/core__ez_balance_deltas.sql +++ b/models/gold/core/core__ez_balance_deltas.sql @@ -2,7 +2,8 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'BALANCES' } } } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'BALANCES' } } }, + tags = ['gold','balances','ez'] ) }} SELECT diff --git a/models/gold/core/core__ez_balance_deltas.yml b/models/gold/core/core__ez_balance_deltas.yml index d0b96427..1264d5d4 100644 --- a/models/gold/core/core__ez_balance_deltas.yml +++ b/models/gold/core/core__ez_balance_deltas.yml @@ -1,7 +1,7 @@ version: 2 models: - name: core__ez_balance_deltas - description: '{{ doc("diffs_table_doc") }}' + description: '{{ doc("evm_diffs_table_doc") }}' columns: - name: BLOCK_NUMBER @@ -41,8 +41,8 @@ models: - name: HAS_PRICE description: 'Whether the token has an hourly price or not, either TRUE or FALSE.' - name: EZ_BALANCE_DELTAS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__ez_current_balances.sql b/models/gold/core/core__ez_current_balances.sql index 2c5b9f85..e8dd4cb8 100644 --- a/models/gold/core/core__ez_current_balances.sql +++ b/models/gold/core/core__ez_current_balances.sql @@ -2,7 +2,8 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'BALANCES' } } } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'BALANCES' } } }, + tags = ['gold','balances','ez'] ) }} WITH prices AS ( diff --git a/models/gold/core/core__ez_current_balances.yml b/models/gold/core/core__ez_current_balances.yml index 3c0deeae..84f56df1 100644 --- a/models/gold/core/core__ez_current_balances.yml +++ b/models/gold/core/core__ez_current_balances.yml @@ -1,7 +1,7 @@ version: 2 models: - name: core__ez_current_balances - description: '{{ doc("current_bal_table_doc") }}' + description: '{{ doc("evm_current_bal_table_doc") }}' columns: - name: LAST_ACTIVITY_BLOCK @@ -33,8 +33,8 @@ models: - name: LAST_RECORDED_PRICE description: 'The timestamp of the last hourly price recorded for this token.' - name: EZ_CURRENT_BALANCES_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__ez_decoded_event_logs.sql b/models/gold/core/core__ez_decoded_event_logs.sql deleted file mode 100644 index d59a788a..00000000 --- a/models/gold/core/core__ez_decoded_event_logs.sql +++ /dev/null @@ -1,66 +0,0 @@ -{{ config ( - materialized = "incremental", - unique_key = "ez_decoded_event_logs_id", - incremental_strategy = 'delete+insert', - cluster_by = "block_timestamp::date", - incremental_predicates = [standard_predicate()], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(ez_decoded_event_logs_id, contract_name, contract_address)", - tags = ['decoded_logs'] -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - contract_address, - topics, - topics[0]::STRING AS topic_0, --new column - topics[1]::STRING AS topic_1, --new column - topics[2]::STRING AS topic_2, --new column - topics[3]::STRING AS topic_3, --new column - DATA, - event_removed, - origin_from_address, - origin_to_address, - origin_function_signature, - CASE - WHEN tx_status = 'SUCCESS' THEN TRUE - ELSE FALSE - END AS tx_succeeded, --new column - event_name, - decoded_data AS full_decoded_log, - decoded_flat AS decoded_log, - C.name AS contract_name, - COALESCE ( - decoded_logs_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS ez_decoded_event_logs_id, -{% if is_incremental() %} - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, -{% else %} - GREATEST(block_timestamp, DATEADD('day', -10, SYSDATE())) AS inserted_timestamp, - GREATEST(block_timestamp, DATEADD('day', -10, SYSDATE())) AS modified_timestamp, -{% endif %} - tx_status --deprecate -FROM - {{ ref('silver__decoded_logs') }} - l - LEFT JOIN {{ ref('silver__contracts') }} C - ON l.contract_address = C.address -WHERE 1=1 - - {% if is_incremental() %} - AND l.modified_timestamp > ( - SELECT - COALESCE( - MAX(modified_timestamp), - '2000-01-01'::TIMESTAMP - ) - FROM - {{ this }} - ) - {% endif %} \ No newline at end of file diff --git a/models/gold/core/core__ez_decoded_event_logs.yml b/models/gold/core/core__ez_decoded_event_logs.yml deleted file mode 100644 index 32ceeb8d..00000000 --- a/models/gold/core/core__ez_decoded_event_logs.yml +++ /dev/null @@ -1,75 +0,0 @@ -version: 2 -models: - - name: core__ez_decoded_event_logs - description: > - 'For information on how to submit a contract for decoding, as well as how ABIs are sourced, please visit [here](https://science.flipsidecrypto.xyz/abi-requestor/). - This model contains decoded event logs for contracts that we have an ABI for. Please note, this table does not include all event logs, only those that we have an ABI for. - The `decoded_log` column is the easiest place to query decoded data. It is a JSON object, where the keys are the names of the event parameters, and the values are the values of the event parameters. - You can select from this column using the following sample format, `decoded_log:from::string` or more generally, `decoded_log:::datatype`. See below for a full sample query. - The `full_decoded_logs` column contains the same information, as well as additional fields such as the datatype of the decoded data. You may need to laterally flatten this column to query the data. - - Sample query for USDC Transfer events: - - ```sql - select - tx_hash, - block_number, - contract_address, - decoded_log:from::string as from_address, - decoded_log:to::string as to_address, - decoded_log:value::integer as value - from ethereum.core.fact_decoded_event_logs - where contract_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') - and block_number between 16400000 and 16405000 - and event_name = 'Transfer' - limit 50```' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' - - name: CONTRACT_NAME - description: 'The name of the contract, if the contract has a name() function.' - - name: EVENT_NAME - description: 'The name of the event, as defined in the contract ABI.' - - name: DECODED_LOG - description: 'The flattened decoded log, where the keys are the names of the event parameters, and the values are the values of the event parameters.' - - name: FULL_DECODED_LOG - description: 'The full decoded log, including the event name, the event parameters, and the data type of the event parameters.' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("eth_tx_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' - - name: TOPICS - description: '{{ doc("eth_topics") }}' - - name: TOPIC_0 - description: '{{ doc("evm_topic_0") }}' - - name: TOPIC_1 - description: '{{ doc("evm_topic_1") }}' - - name: TOPIC_2 - description: '{{ doc("evm_topic_2") }}' - - name: TOPIC_3 - description: '{{ doc("evm_topic_3") }}' - - name: DATA - description: '{{ doc("eth_logs_data") }}' - - name: EVENT_REMOVED - description: '{{ doc("eth_event_removed") }}' - - name: TX_STATUS - description: '{{ doc("evm_column_deprecation_notice") }}' - - name: TX_SUCCEEDED - description: '{{ doc("eth_tx_status") }}' - - name: EZ_DECODED_EVENT_LOGS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__ez_decoded_traces.sql b/models/gold/core/core__ez_decoded_traces.sql index bd1935b1..1497692d 100644 --- a/models/gold/core/core__ez_decoded_traces.sql +++ b/models/gold/core/core__ez_decoded_traces.sql @@ -5,7 +5,7 @@ cluster_by = "block_timestamp::date", incremental_predicates = [standard_predicate()], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(ez_decoded_traces_id, from_address_name, to_address_name, from_address, to_address)", - tags = ['decoded_traces'] + tags = ['gold','decoded_traces'] ) }} SELECT @@ -20,7 +20,7 @@ SELECT c1.name AS to_address_name, input, output, - decoded_data AS full_decoded_trace, --new column + decoded_data AS full_decoded_trace, decoded_data :function_name :: STRING AS function_name, decoded_data :decoded_input_data AS decoded_input_data, decoded_data :decoded_output_data AS decoded_output_data, @@ -34,31 +34,27 @@ SELECT CASE WHEN trace_status = 'SUCCESS' THEN TRUE ELSE FALSE - END AS trace_succeeded, --new column + END AS trace_succeeded, error_reason, CASE WHEN tx_status = 'SUCCESS' THEN TRUE ELSE FALSE - END AS tx_succeeded, --new column + END AS tx_succeeded, decoded_traces_id AS ez_decoded_traces_id, {% if is_incremental() %} SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, + SYSDATE() AS modified_timestamp {% else %} GREATEST(block_timestamp, DATEADD('day', -10, SYSDATE())) AS inserted_timestamp, - GREATEST(block_timestamp, DATEADD('day', -10, SYSDATE())) AS modified_timestamp, + GREATEST(block_timestamp, DATEADD('day', -10, SYSDATE())) AS modified_timestamp {% endif %} - identifier, --deprecate - trace_status, --deprecate - tx_status, --deprecate - decoded_traces_id AS fact_decoded_traces_id --deprecate FROM {{ ref('silver__decoded_traces') }} t - LEFT JOIN {{ ref('silver__contracts') }} + LEFT JOIN {{ ref('core__dim_contracts') }} c0 ON t.from_address = c0.address - LEFT JOIN {{ ref('silver__contracts') }} + LEFT JOIN {{ ref('core__dim_contracts') }} c1 ON t.to_address = c1.address WHERE 1=1 diff --git a/models/gold/core/core__ez_decoded_traces.yml b/models/gold/core/core__ez_decoded_traces.yml index d9f49022..99fde5ee 100644 --- a/models/gold/core/core__ez_decoded_traces.yml +++ b/models/gold/core/core__ez_decoded_traces.yml @@ -7,55 +7,49 @@ models: columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_traces_block_no") }}' + description: '{{ doc("evm_traces_block_no") }}' - name: TX_HASH - description: '{{ doc("eth_traces_tx_hash") }}' + description: '{{ doc("evm_traces_tx_hash") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_traces_blocktime") }}' - - name: TX_STATUS - description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' + description: '{{ doc("evm_traces_blocktime") }}' - name: TX_POSITION description: The position of the transaction within the block. - name: TRACE_INDEX description: The index of the trace within the transaction. - name: FROM_ADDRESS - description: '{{ doc("eth_traces_from") }}' + description: '{{ doc("evm_traces_from") }}' - name: FROM_ADDRESS_NAME description: The name of the address that initiated the trace, if the contract has a name() function. - name: TO_ADDRESS - description: '{{ doc("eth_traces_to") }}' + description: '{{ doc("evm_traces_to") }}' - name: TO_ADDRESS_NAME description: The name of the address that received the trace, if the contract has a name() function. - name: VALUE - description: '{{ doc("eth_traces_eth_value") }}' + description: '{{ doc("evm_eth_value") }}' - name: VALUE_PRECISE_RAW - description: '{{ doc("precise_amount_unadjusted") }}' + description: '{{ doc("evm_precise_amount_unadjusted") }}' - name: VALUE_PRECISE - description: '{{ doc("precise_amount_adjusted") }}' + description: '{{ doc("evm_precise_amount_adjusted") }}' - name: GAS - description: '{{ doc("eth_traces_gas") }}' + description: '{{ doc("evm_traces_gas") }}' - name: GAS_USED - description: '{{ doc("eth_traces_gas_used") }}' + description: '{{ doc("evm_traces_gas_used") }}' - name: TYPE - description: '{{ doc("eth_traces_type") }}' - - name: IDENTIFIER - description: '{{ doc("evm_column_deprecation_notice_identifier") }}' + description: '{{ doc("evm_traces_type") }}' - name: TRACE_ADDRESS description: '{{ doc("evm_trace_address") }}' - name: SUB_TRACES - description: '{{ doc("eth_traces_sub") }}' + description: '{{ doc("evm_sub_traces") }}' - name: ERROR_REASON description: The reason for the trace failure, if any. - - name: TRACE_STATUS - description: '{{ doc("evm_column_deprecation_notice_trace_status") }}' - name: TX_SUCCEEDED description: '{{ doc("evm_tx_succeeded") }}' - name: TRACE_SUCCEEDED description: '{{ doc("evm_trace_succeeded") }}' - name: INPUT - description: '{{ doc("eth_traces_input") }}' + description: '{{ doc("evm_traces_input") }}' - name: OUTPUT - description: '{{ doc("eth_traces_output") }}' + description: '{{ doc("evm_traces_output") }}' - name: FUNCTION_NAME description: The name of the function called in the trace. - name: DECODED_INPUT_DATA @@ -64,12 +58,10 @@ models: description: Decoded output data for the trace. - name: FULL_DECODED_TRACE description: The full json object of the decoded trace, including both input and output data. - - name: FACT_DECODED_TRACES_ID - description: '{{ doc("evm_column_deprecation_notice_fact_decoded_traces_id") }}' - name: EZ_DECODED_TRACES_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__ez_native_transfers.sql b/models/gold/core/core__ez_native_transfers.sql deleted file mode 100644 index 254835b9..00000000 --- a/models/gold/core/core__ez_native_transfers.sql +++ /dev/null @@ -1,27 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - tx_hash, - block_number, - block_timestamp, - tx_position, - trace_index, - origin_from_address, - origin_to_address, - origin_function_signature, - from_address, - to_address, - amount, - amount_precise_raw, - amount_precise, - amount_usd, - native_transfers_id AS ez_native_transfers_id, - inserted_timestamp, - modified_timestamp, - identifier --deprecate -FROM - {{ ref('silver__native_transfers') }} diff --git a/models/gold/core/core__ez_native_transfers.yml b/models/gold/core/core__ez_native_transfers.yml deleted file mode 100644 index 684fd0e6..00000000 --- a/models/gold/core/core__ez_native_transfers.yml +++ /dev/null @@ -1,42 +0,0 @@ -version: 2 -models: - - name: core__ez_native_transfers - description: '{{ doc("evm_ez_native_transfers_table_doc") }}' - - columns: - - name: TX_HASH - description: '{{ doc("eth_transfer_tx_hash") }}' - - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' - - name: TX_POSITION - description: '{{ doc("eth_tx_position") }}' - - name: TRACE_INDEX - description: '{{ doc("eth_trace_index") }}' - - name: IDENTIFIER - description: '{{ doc("evm_column_deprecation_notice_identifier") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' - - name: FROM_ADDRESS - description: '{{ doc("eth_transfer_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("eth_transfer_to_address") }}' - - name: AMOUNT - description: '{{ doc("eth_eth_amount") }}' - - name: AMOUNT_PRECISE_RAW - description: '{{ doc("precise_amount_unadjusted") }}' - - name: AMOUNT_PRECISE - description: '{{ doc("precise_amount_adjusted") }}' - - name: AMOUNT_USD - description: '{{ doc("eth_eth_amount_usd") }}' - - name: EZ_NATIVE_TRANSFERS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__ez_token_transfers.sql b/models/gold/core/core__ez_token_transfers.sql deleted file mode 100644 index 14fb45b0..00000000 --- a/models/gold/core/core__ez_token_transfers.sql +++ /dev/null @@ -1,45 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address, - from_address, - to_address, - raw_amount_precise, - raw_amount, - amount_precise, - amount, - amount_usd, - decimals, - symbol, - COALESCE ( - transfers_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS ez_token_transfers_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp, - token_price, --deprecate - has_decimal, --deprecate - has_price, --deprecate - _log_id, --deprecate - _inserted_timestamp --deprecate -FROM - {{ ref('silver__transfers') }} diff --git a/models/gold/core/core__ez_token_transfers.yml b/models/gold/core/core__ez_token_transfers.yml deleted file mode 100644 index d5d9a03b..00000000 --- a/models/gold/core/core__ez_token_transfers.yml +++ /dev/null @@ -1,56 +0,0 @@ -version: 2 -models: - - name: core__ez_token_transfers - description: '{{ doc("evm_ez_token_transfers_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("eth_transfer_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("eth_transfer_contract_address") }}' - - name: FROM_ADDRESS - description: '{{ doc("eth_transfer_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("eth_transfer_to_address") }}' - - name: RAW_AMOUNT_PRECISE - description: '{{ doc("eth_transfer_raw_amount_precise") }}' - - name: RAW_AMOUNT - description: '{{ doc("eth_transfer_raw_amount") }}' - - name: AMOUNT_PRECISE - description: '{{ doc("eth_transfer_amount_precise") }}' - - name: AMOUNT - description: '{{ doc("eth_transfer_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("eth_transfer_amount_usd") }}' - - name: DECIMALS - description: '{{ doc("eth_decimals") }}' - - name: SYMBOL - description: '{{ doc("eth_contracts_symbol") }}' - - name: TOKEN_PRICE - description: '{{ doc("evm_column_deprecation_notice_token_price") }}' - - name: HAS_PRICE - description: '{{ doc("evm_column_deprecation_notice_has_price") }}' - - name: HAS_DECIMAL - description: '{{ doc("evm_column_deprecation_notice_has_decimal") }}' - - name: _LOG_ID - description: '{{ doc("evm_column_deprecation_notice_log_id") }}' - - name: _INSERTED_TIMESTAMP - description: '{{ doc("evm_column_deprecation_notice_inserted_timestamp") }}' - - name: EZ_TOKEN_TRANSFERS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_blocks.sql b/models/gold/core/core__fact_blocks.sql deleted file mode 100644 index d125d8aa..00000000 --- a/models/gold/core/core__fact_blocks.sql +++ /dev/null @@ -1,94 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - HASH AS block_hash, --new column - block_timestamp, - 'mainnet' AS network, - tx_count, - SIZE, - miner, - extra_data, - parent_hash, - gas_used, - gas_limit, - base_fee_per_gas, --new column - excess_blob_gas, - blob_gas_used, - difficulty, - total_difficulty, - sha3_uncles, - uncles AS uncle_blocks, - nonce, - receipts_root, - state_root, --new column - transactions_root, --new column - logs_bloom, --new column - withdrawals, - withdrawals_root, - COALESCE ( - blocks_id, - {{ dbt_utils.generate_surrogate_key( - ['block_number'] - ) }} - ) AS fact_blocks_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp, - 'ethereum' AS blockchain, --deprecate - HASH, --deprecate - OBJECT_CONSTRUCT( - 'baseFeePerGas', - base_fee_per_gas, - 'difficulty', - difficulty, - 'extraData', - extra_data, - 'gasLimit', - gas_limit, - 'gasUsed', - gas_used, - 'hash', - HASH, - 'logsBloom', - logs_bloom, - 'miner', - miner, - 'nonce', - nonce, - 'number', - NUMBER, - 'parentHash', - parent_hash, - 'receiptsRoot', - receipts_root, - 'sha3Uncles', - sha3_uncles, - 'size', - SIZE, - 'stateRoot', - state_root, - 'timestamp', - block_timestamp, - 'totalDifficulty', - total_difficulty, - 'transactionsRoot', - transactions_root, - 'uncles', - uncles, - 'excessBlobGas', - excess_blob_gas, - 'blobGasUsed', - blob_gas_used - ) AS block_header_json --deprecate -FROM - {{ ref('silver__blocks') }} diff --git a/models/gold/core/core__fact_blocks.yml b/models/gold/core/core__fact_blocks.yml deleted file mode 100644 index c0f73388..00000000 --- a/models/gold/core/core__fact_blocks.yml +++ /dev/null @@ -1,68 +0,0 @@ -version: 2 -models: - - name: core__fact_blocks - description: '{{ doc("evm_blocks_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: NETWORK - description: '{{ doc("evm_network") }}' - - name: BLOCKCHAIN - description: '{{ doc("evm_column_deprecation_notice_blockchain") }}' - - name: TX_COUNT - description: '{{ doc("evm_tx_count") }}' - - name: DIFFICULTY - description: '{{ doc("evm_difficulty") }}' - - name: TOTAL_DIFFICULTY - description: '{{ doc("evm_total_difficulty") }}' - - name: EXTRA_DATA - description: '{{ doc("evm_extra_data") }}' - - name: GAS_LIMIT - description: '{{ doc("evm_gas_limit") }}' - - name: GAS_USED - description: '{{ doc("evm_gas_used") }}' - - name: BLOCK_HASH - description: '{{ doc("evm_blocks_hash") }}' - - name: HASH - description: '{{ doc("evm_column_deprecation_notice_hash") }}' - - name: PARENT_HASH - description: '{{ doc("evm_parent_hash") }}' - - name: MINER - description: '{{ doc("evm_miner") }}' - - name: NONCE - description: '{{ doc("evm_blocks_nonce") }}' - - name: RECEIPTS_ROOT - description: '{{ doc("evm_receipts_root") }}' - - name: SHA3_UNCLES - description: '{{ doc("evm_sha3_uncles") }}' - - name: SIZE - description: '{{ doc("evm_size") }}' - - name: UNCLE_BLOCKS - description: '{{ doc("evm_uncle_blocks") }}' - - name: STATE_ROOT - description: '{{ doc("evm_state_root") }}' - - name: TRANSACTIONS_ROOT - description: '{{ doc("evm_transactions_root") }}' - - name: LOGS_BLOOM - description: '{{ doc("evm_logs_bloom") }}' - - name: BLOCK_HEADER_JSON - description: '{{ doc("evm_column_deprecation_notice_block_header_json") }}' - - name: BASE_FEE_PER_GAS - description: '{{ doc("evm_base_fee_per_gas") }}' - - name: BLOB_GAS_USED - description: The total amount of blob gas consumed by transactions in the block. - - name: EXCESS_BLOB_GAS - description: A running total of blob gas consumed in excess of the target, prior to the block. This is used to set blob gas pricing. - - name: FACT_BLOCKS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' - - name: WITHDRAWALS - description: An array of withdrawals that occurred in this block. - - name: WITHDRAWALS_ROOT - description: '{{ doc("evm_withdrawals_root") }}' diff --git a/models/gold/core/core__fact_contract_reads.sql b/models/gold/core/core__fact_contract_reads.sql index 5b26472b..ec9e15e1 100644 --- a/models/gold/core/core__fact_contract_reads.sql +++ b/models/gold/core/core__fact_contract_reads.sql @@ -1,7 +1,8 @@ {{ config( materialized = 'view', persist_docs ={ "relation": true, - "columns": true } + "columns": true }, + tags = ['gold','reads'] ) }} SELECT diff --git a/models/gold/core/core__fact_contract_reads.yml b/models/gold/core/core__fact_contract_reads.yml index db8a3c02..3bc5210b 100644 --- a/models/gold/core/core__fact_contract_reads.yml +++ b/models/gold/core/core__fact_contract_reads.yml @@ -17,8 +17,8 @@ models: - name: SEGMENTED_OUTPUT description: 'The return of the contract call, segmented into 64 character strings.' - name: FACT_CONTRACT_READS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_decoded_event_logs.sql b/models/gold/core/core__fact_decoded_event_logs.sql deleted file mode 100644 index aab1f0cf..00000000 --- a/models/gold/core/core__fact_decoded_event_logs.sql +++ /dev/null @@ -1,31 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - contract_address, - event_name, - decoded_flat AS decoded_log, - decoded_data AS full_decoded_log, - COALESCE ( - decoded_logs_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS fact_decoded_event_logs_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__decoded_logs') }} diff --git a/models/gold/core/core__fact_decoded_event_logs.yml b/models/gold/core/core__fact_decoded_event_logs.yml deleted file mode 100644 index 914f1ae6..00000000 --- a/models/gold/core/core__fact_decoded_event_logs.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 2 -models: - - name: core__fact_decoded_event_logs - description: '{{ doc("evm_table_deprecation_notice_fact_decoded_event_logs")}}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' - - name: EVENT_NAME - description: 'The name of the event, as defined in the contract ABI.' - - name: DECODED_LOG - description: 'The flattened decoded log, where the keys are the names of the event parameters, and the values are the values of the event parameters.' - - name: FULL_DECODED_LOG - description: 'The full decoded log, including the event name, the event parameters, and the data type of the event parameters.' - - name: FACT_DECODED_EVENT_LOGS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_decoded_traces.sql b/models/gold/core/core__fact_decoded_traces.sql deleted file mode 100644 index 01f11e30..00000000 --- a/models/gold/core/core__fact_decoded_traces.sql +++ /dev/null @@ -1,35 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - tx_hash, - block_timestamp, - tx_status, - tx_position, - trace_index, - from_address, - to_address, - VALUE, - value_precise_raw, - value_precise, - gas, - gas_used, - TYPE, - identifier, - sub_traces, - error_reason, - trace_status, - input, - output, - decoded_data :function_name :: STRING AS function_name, - decoded_data :decoded_input_data AS decoded_input_data, - decoded_data :decoded_output_data AS decoded_output_data, - decoded_traces_id AS fact_decoded_traces_id, - inserted_timestamp, - modified_timestamp -FROM - {{ ref('silver__decoded_traces') }} diff --git a/models/gold/core/core__fact_decoded_traces.yml b/models/gold/core/core__fact_decoded_traces.yml deleted file mode 100644 index cd3e9a30..00000000 --- a/models/gold/core/core__fact_decoded_traces.yml +++ /dev/null @@ -1,58 +0,0 @@ -version: 2 -models: - - name: core__fact_decoded_traces - description: '{{ doc("evm_table_deprecation_notice_fact_decoded_traces")}}' - columns: - - name: BLOCK_NUMBER - description: '{{ doc("eth_traces_block_no") }}' - - name: TX_HASH - description: '{{ doc("eth_traces_tx_hash") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_traces_blocktime") }}' - - name: TX_STATUS - description: '{{ doc("eth_tx_status") }}' - - name: TX_POSITION - description: The position of the transaction within the block. - - name: TRACE_INDEX - description: The index of the trace within the transaction. - - name: FROM_ADDRESS - description: '{{ doc("eth_traces_from") }}' - - name: TO_ADDRESS - description: '{{ doc("eth_traces_to") }}' - - name: VALUE - description: '{{ doc("eth_traces_eth_value") }}' - - name: VALUE_PRECISE_RAW - description: '{{ doc("precise_amount_unadjusted") }}' - - name: VALUE_PRECISE - description: '{{ doc("precise_amount_adjusted") }}' - - name: GAS - description: '{{ doc("eth_traces_gas") }}' - - name: GAS_USED - description: '{{ doc("eth_traces_gas_used") }}' - - name: TYPE - description: '{{ doc("eth_traces_type") }}' - - name: IDENTIFIER - description: '{{ doc("eth_traces_identifier") }}' - - name: SUB_TRACES - description: '{{ doc("eth_traces_sub") }}' - - name: ERROR_REASON - description: The reason for the trace failure, if any. - - name: TRACE_STATUS - description: The status of the trace, either `SUCCESS` or `FAIL` - - name: INPUT - description: '{{ doc("eth_traces_input") }}' - - name: OUTPUT - description: '{{ doc("eth_traces_output") }}' - - name: FUNCTION_NAME - description: The name of the function called in the trace. - - name: DECODED_INPUT_DATA - description: Decoded input data for the trace. - - name: DECODED_OUTPUT_DATA - description: Decoded output data for the trace. - - name: FACT_DECODED_TRACES_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' - \ No newline at end of file diff --git a/models/gold/core/core__fact_eth_balances.sql b/models/gold/core/core__fact_eth_balances.sql index 8e4f8e97..faa087ef 100644 --- a/models/gold/core/core__fact_eth_balances.sql +++ b/models/gold/core/core__fact_eth_balances.sql @@ -8,7 +8,8 @@ 'PURPOSE': 'BALANCES' } } - } + }, + tags = ['gold','balances'] ) }} SELECT diff --git a/models/gold/core/core__fact_eth_balances.yml b/models/gold/core/core__fact_eth_balances.yml index 5834227d..217b641f 100644 --- a/models/gold/core/core__fact_eth_balances.yml +++ b/models/gold/core/core__fact_eth_balances.yml @@ -15,8 +15,8 @@ models: - name: BALANCE description: 'The unadjusted ETH balance.' - name: FACT_ETH_BALANCES_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_event_logs.sql b/models/gold/core/core__fact_event_logs.sql deleted file mode 100644 index 09c81ae7..00000000 --- a/models/gold/core/core__fact_event_logs.sql +++ /dev/null @@ -1,44 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - contract_address, - topics, - topics[0]::STRING AS topic_0, --new column - topics[1]::STRING AS topic_1, --new column - topics[2]::STRING AS topic_2, --new column - topics[3]::STRING AS topic_3, --new column - DATA, - event_removed, - origin_from_address, - origin_to_address, - origin_function_signature, - CASE - WHEN tx_status = 'SUCCESS' THEN TRUE - ELSE FALSE - END AS tx_succeeded, --new column - COALESCE ( - logs_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS fact_event_logs_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp, - tx_status, --deprecate - _log_id --deprecate -FROM - {{ ref('silver__logs') }} diff --git a/models/gold/core/core__fact_event_logs.yml b/models/gold/core/core__fact_event_logs.yml deleted file mode 100644 index 2da973a0..00000000 --- a/models/gold/core/core__fact_event_logs.yml +++ /dev/null @@ -1,48 +0,0 @@ -version: 2 -models: - - name: core__fact_event_logs - description: '{{ doc("evm_logs_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("evm_logs_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("evm_event_index") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("evm_logs_contract_address") }}' - - name: TOPICS - description: '{{ doc("evm_topics") }}' - - name: TOPIC_0 - description: '{{ doc("evm_topic_0") }}' - - name: TOPIC_1 - description: '{{ doc("evm_topic_1") }}' - - name: TOPIC_2 - description: '{{ doc("evm_topic_2") }}' - - name: TOPIC_3 - description: '{{ doc("evm_topic_3") }}' - - name: DATA - description: '{{ doc("evm_logs_data") }}' - - name: EVENT_REMOVED - description: '{{ doc("evm_event_removed") }}' - - name: _LOG_ID - description: '{{ doc("evm_column_deprecation_notice_log_id") }}' - - name: TX_STATUS - description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' - - name: TX_SUCCEEDED - description: '{{ doc("evm_tx_succeeded") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("evm_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("evm_origin_to") }}' - - name: FACT_EVENT_LOGS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/core/core__fact_token_balances.sql b/models/gold/core/core__fact_token_balances.sql index df61ffd8..dbc9ba19 100644 --- a/models/gold/core/core__fact_token_balances.sql +++ b/models/gold/core/core__fact_token_balances.sql @@ -8,7 +8,8 @@ 'PURPOSE': 'BALANCES' } } - } + }, + tags = ['gold','balances'] ) }} SELECT diff --git a/models/gold/core/core__fact_token_balances.yml b/models/gold/core/core__fact_token_balances.yml index 2a9984b3..8c956001 100644 --- a/models/gold/core/core__fact_token_balances.yml +++ b/models/gold/core/core__fact_token_balances.yml @@ -19,8 +19,8 @@ models: - name: BALANCE description: 'The unadjusted token balance.' - name: FACT_TOKEN_BALANCES_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_token_transfers.sql b/models/gold/core/core__fact_token_transfers.sql deleted file mode 100644 index 8908c546..00000000 --- a/models/gold/core/core__fact_token_transfers.sql +++ /dev/null @@ -1,36 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address, - from_address, - to_address, - raw_amount, - raw_amount_precise, - _log_id, - COALESCE ( - transfers_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS fact_token_transfers_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__transfers') }} diff --git a/models/gold/core/core__fact_token_transfers.yml b/models/gold/core/core__fact_token_transfers.yml deleted file mode 100644 index 81c1133d..00000000 --- a/models/gold/core/core__fact_token_transfers.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 2 -models: - - name: core__fact_token_transfers - description: '{{ doc("evm_table_deprecation_notice_fact_token_transfers") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("eth_transfer_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("eth_transfer_contract_address") }}' - - name: FROM_ADDRESS - description: '{{ doc("eth_transfer_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("eth_transfer_to_address") }}' - - name: RAW_AMOUNT - description: '{{ doc("eth_transfer_raw_amount") }}' - - name: RAW_AMOUNT_PRECISE - description: '{{ doc("eth_transfer_raw_amount_precise") }}' - - name: _LOG_ID - description: '{{ doc("internal_column") }}' - - name: FACT_TOKEN_TRANSFERS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_traces.sql b/models/gold/core/core__fact_traces.sql deleted file mode 100644 index 79a45a45..00000000 --- a/models/gold/core/core__fact_traces.sql +++ /dev/null @@ -1,487 +0,0 @@ -{% set full_reload_mode = false %} -{{ config ( - materialized = "incremental", - incremental_strategy = 'delete+insert', - unique_key = "block_number", - incremental_predicates = [fsc_evm.standard_predicate()], - cluster_by = "block_timestamp::date", - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['realtime'], - full_refresh = false -) }} - -WITH silver_traces AS ( - - SELECT - block_number, - tx_position, - trace_address, - parent_trace_address, - trace_address_array, - trace_json, - traces_id, - 'regular' AS source - FROM - {{ ref('silver__traces') }} - WHERE - 1 = 1 - -{% if is_incremental() and not full_reload_mode %} -AND modified_timestamp > ( - SELECT - MAX(modified_timestamp) - FROM - {{ this }} -) {% elif is_incremental() and full_reload_mode %} -AND block_number BETWEEN ( - SELECT - MAX( - block_number - ) - FROM - {{ this }} -) -AND ( - SELECT - MAX( - block_number - ) + 1000000 - FROM - {{ this }} -) -{% else %} - AND block_number <= 3000000 -{% endif %} -), -sub_traces AS ( - SELECT - block_number, - tx_position, - parent_trace_address, - COUNT(*) AS sub_traces - FROM - silver_traces - GROUP BY - block_number, - tx_position, - parent_trace_address -), -trace_index_array AS ( - SELECT - block_number, - tx_position, - trace_address, - ARRAY_AGG(flat_value) AS number_array - FROM - ( - SELECT - block_number, - tx_position, - trace_address, - IFF( - VALUE :: STRING = 'ORIGIN', - -1, - VALUE :: INT - ) AS flat_value - FROM - silver_traces, - LATERAL FLATTEN ( - input => trace_address_array - ) - ) - GROUP BY - block_number, - tx_position, - trace_address -), -trace_index_sub_traces AS ( - SELECT - b.block_number, - b.tx_position, - b.trace_address, - IFNULL( - sub_traces, - 0 - ) AS sub_traces, - number_array, - ROW_NUMBER() over ( - PARTITION BY b.block_number, - b.tx_position - ORDER BY - number_array ASC - ) - 1 AS trace_index, - b.trace_json, - b.traces_id, - b.source - FROM - silver_traces b - LEFT JOIN sub_traces s - ON b.block_number = s.block_number - AND b.tx_position = s.tx_position - AND b.trace_address = s.parent_trace_address - JOIN trace_index_array n - ON b.block_number = n.block_number - AND b.tx_position = n.tx_position - AND b.trace_address = n.trace_address -), -errored_traces AS ( - SELECT - block_number, - tx_position, - trace_address, - trace_json - FROM - trace_index_sub_traces - WHERE - trace_json :error :: STRING IS NOT NULL -), -error_logic AS ( - SELECT - b0.block_number, - b0.tx_position, - b0.trace_address, - b0.trace_json :error :: STRING AS error, - b1.trace_json :error :: STRING AS any_error, - b2.trace_json :error :: STRING AS origin_error - FROM - trace_index_sub_traces b0 - LEFT JOIN errored_traces b1 - ON b0.block_number = b1.block_number - AND b0.tx_position = b1.tx_position - AND b0.trace_address RLIKE CONCAT( - '^', - b1.trace_address, - '(_[0-9]+)*$' - ) - LEFT JOIN errored_traces b2 - ON b0.block_number = b2.block_number - AND b0.tx_position = b2.tx_position - AND b2.trace_address = 'ORIGIN' -), -aggregated_errors AS ( - SELECT - block_number, - tx_position, - trace_address, - error, - IFF(MAX(any_error) IS NULL - AND error IS NULL - AND origin_error IS NULL, TRUE, FALSE) AS trace_succeeded - FROM - error_logic - GROUP BY - block_number, - tx_position, - trace_address, - error, - origin_error), - json_traces AS ( - SELECT - block_number, - tx_position, - trace_address, - sub_traces, - number_array, - trace_index, - trace_json AS DATA, - trace_succeeded, - trace_json :error :: STRING AS error_reason, - trace_json :revertReason :: STRING AS revert_reason, - trace_json :from :: STRING AS from_address, - trace_json :to :: STRING AS to_address, - IFNULL( - trace_json :value :: STRING, - '0x0' - ) AS value_hex, - IFNULL( - utils.udf_hex_to_int( - trace_json :value :: STRING - ), - '0' - ) AS value_precise_raw, - utils.udf_decimal_adjust( - value_precise_raw, - 18 - ) AS value_precise, - value_precise :: FLOAT AS VALUE, - utils.udf_hex_to_int( - trace_json :gas :: STRING - ) :: INT AS gas, - utils.udf_hex_to_int( - trace_json :gasUsed :: STRING - ) :: INT AS gas_used, - trace_json :input :: STRING AS input, - trace_json :output :: STRING AS output, - trace_json :type :: STRING AS TYPE, - concat_ws( - '_', - TYPE, - trace_address - ) AS identifier, - IFF( - trace_succeeded, - 'SUCCESS', - 'FAIL' - ) AS trace_status, - traces_id - FROM - trace_index_sub_traces - JOIN aggregated_errors USING ( - block_number, - tx_position, - trace_address - ) - ), - incremental_traces AS ( - SELECT - f.block_number, - t.tx_hash, - t.block_timestamp, - t.origin_function_signature, - t.from_address AS origin_from_address, - t.to_address AS origin_to_address, - t.tx_status, - f.tx_position, - f.trace_index, - f.from_address AS from_address, - f.to_address AS to_address, - f.value_hex, - f.value_precise_raw, - f.value_precise, - f.value, - f.gas, - f.gas_used, - f.input, - f.output, - f.type, - f.identifier, - f.sub_traces, - f.error_reason, - f.revert_reason, - f.trace_status, - f.data, - f.traces_id, - f.trace_succeeded, - f.trace_address, - IFF( - t.tx_status = 'SUCCESS', - TRUE, - FALSE - ) AS tx_succeeded - FROM - json_traces f - LEFT OUTER JOIN {{ ref('silver__transactions') }} - t - ON f.tx_position = t.position - AND f.block_number = t.block_number - -{% if is_incremental() and not full_reload_mode %} -AND t.modified_timestamp >= ( - SELECT - DATEADD('hour', -24, MAX(modified_timestamp)) - FROM - {{ this }}) - {% endif %} -) - -{% if is_incremental() %}, -overflow_blocks AS ( - SELECT - DISTINCT block_number - FROM - silver_traces - WHERE - source = 'overflow' -), -heal_missing_data AS ( - SELECT - t.block_number, - txs.tx_hash, - txs.block_timestamp, - txs.origin_function_signature, - txs.from_address AS origin_from_address, - txs.to_address AS origin_to_address, - txs.tx_status, - t.tx_position, - t.trace_index, - t.from_address, - t.to_address, - t.value_hex, - t.value_precise_raw, - t.value_precise, - t.value, - t.gas, - t.gas_used, - t.input, - t.output, - t.type, - t.identifier, - t.sub_traces, - t.error_reason, - t.revert_reason, - t.trace_status, - t.data, - t.fact_traces_id AS traces_id, - t.trace_succeeded, - t.trace_address, - IFF( - txs.tx_status = 'SUCCESS', - TRUE, - FALSE - ) AS tx_succeeded - FROM - {{ this }} - t - JOIN {{ ref('silver__transactions') }} - txs - ON t.tx_position = txs.position - AND t.block_number = txs.block_number - WHERE - t.tx_hash IS NULL - OR t.block_timestamp IS NULL - OR t.tx_status IS NULL -) -{% endif %}, -all_traces AS ( - SELECT - block_number, - tx_hash, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - tx_status, - tx_position, - trace_index, - from_address, - to_address, - value_hex, - value_precise_raw, - value_precise, - VALUE, - gas, - gas_used, - input, - output, - TYPE, - identifier, - sub_traces, - error_reason, - revert_reason, - trace_status, - DATA, - trace_succeeded, - trace_address, - tx_succeeded - FROM - incremental_traces - -{% if is_incremental() %} -UNION ALL -SELECT - block_number, - tx_hash, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - tx_status, - tx_position, - trace_index, - from_address, - to_address, - value_hex, - value_precise_raw, - value_precise, - VALUE, - gas, - gas_used, - input, - output, - TYPE, - identifier, - sub_traces, - error_reason, - revert_reason, - trace_status, - DATA, - trace_succeeded, - trace_address, - tx_succeeded -FROM - heal_missing_data -UNION ALL -SELECT - block_number, - tx_hash, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - tx_status, - tx_position, - trace_index, - from_address, - to_address, - value_hex, - value_precise_raw, - value_precise, - VALUE, - gas, - gas_used, - input, - output, - TYPE, - identifier, - sub_traces, - error_reason, - revert_reason, - trace_status, - DATA, - trace_succeeded, - trace_address, - tx_succeeded -FROM - {{ this }} - JOIN overflow_blocks USING (block_number) -{% endif %} -) -SELECT - block_number, - block_timestamp, - tx_hash, - tx_position, - trace_index, - from_address, - to_address, - input, - output, - TYPE, - trace_address, - sub_traces, - VALUE, - value_precise_raw, - value_precise, - value_hex, - gas, - gas_used, - origin_from_address, - origin_to_address, - origin_function_signature, - trace_succeeded, - error_reason, - revert_reason, - tx_succeeded, - identifier, --deprecate - DATA, --deprecate - tx_status, --deprecate - trace_status, --deprecate - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'trace_index'] - ) }} AS fact_traces_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp -FROM - all_traces qualify(ROW_NUMBER() over(PARTITION BY block_number, tx_position, trace_index -ORDER BY - modified_timestamp DESC, block_timestamp DESC nulls last)) = 1 diff --git a/models/gold/core/core__fact_traces.yml b/models/gold/core/core__fact_traces.yml deleted file mode 100644 index 0aaacb5b..00000000 --- a/models/gold/core/core__fact_traces.yml +++ /dev/null @@ -1,64 +0,0 @@ -version: 2 -models: - - name: core__fact_traces - description: '{{ doc("evm_traces_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_traces_block_no") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_traces_blocktime") }}' - - name: TX_HASH - description: '{{ doc("evm_traces_tx_hash") }}' - - name: TX_POSITION - description: '{{ doc("evm_tx_position") }}' - - name: FROM_ADDRESS - description: '{{ doc("evm_traces_from") }}' - - name: TO_ADDRESS - description: '{{ doc("evm_traces_to") }}' - - name: VALUE - description: '{{ doc("evm_traces_value") }}' - - name: VALUE_PRECISE_RAW - description: '{{ doc("evm_precise_amount_unadjusted") }}' - - name: VALUE_PRECISE - description: '{{ doc("evm_precise_amount_adjusted") }}' - - name: VALUE_HEX - description: '{{ doc("evm_value_hex") }}' - - name: GAS - description: '{{ doc("evm_traces_gas") }}' - - name: GAS_USED - description: '{{ doc("evm_traces_gas_used") }}' - - name: INPUT - description: '{{ doc("evm_traces_input") }}' - - name: OUTPUT - description: '{{ doc("evm_traces_output") }}' - - name: TYPE - description: '{{ doc("evm_traces_type") }}' - - name: IDENTIFIER - description: '{{ doc("evm_column_deprecation_notice_identifier") }}' - - name: TRACE_ADDRESS - description: '{{ doc("evm_trace_address") }}' - - name: DATA - description: '{{ doc("evm_column_deprecation_notice_data") }}' - - name: TX_STATUS - description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' - - name: TX_SUCCEEDED - description: '{{ doc("evm_tx_succeeded") }}' - - name: TRACE_SUCCEEDED - description: '{{ doc("evm_trace_succeeded") }}' - - name: SUB_TRACES - description: '{{ doc("evm_sub_traces") }}' - - name: TRACE_STATUS - description: '{{ doc("evm_column_deprecation_notice_trace_status") }}' - - name: ERROR_REASON - description: '{{ doc("evm_trace_error_reason") }}' - - name: REVERT_REASON - description: '{{ doc("evm_revert_reason") }}' - - name: TRACE_INDEX - description: The index of the trace within the transaction. - - name: FACT_TRACES_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/core/core__fact_transactions.sql b/models/gold/core/core__fact_transactions.sql deleted file mode 100644 index de81810e..00000000 --- a/models/gold/core/core__fact_transactions.sql +++ /dev/null @@ -1,60 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - from_address, - to_address, - origin_function_signature, - VALUE, - value_precise_raw, - value_precise, - tx_fee, - tx_fee_precise, - CASE - WHEN tx_status = 'SUCCESS' THEN TRUE - ELSE FALSE - END AS tx_succeeded, --new column - tx_type, - nonce, - POSITION AS tx_position, --new column - input_data, - gas_price, - gas_used, - gas AS gas_limit, - cumulative_gas_used, - effective_gas_price, - max_fee_per_gas, - max_priority_fee_per_gas, - blob_versioned_hashes, - max_fee_per_blob_gas, - blob_gas_used, - blob_gas_price, - r, - s, - v, - COALESCE ( - transactions_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash'] - ) }} - ) AS fact_transactions_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp, - block_hash, --deprecate - POSITION, --deprecate - tx_status AS status, --deprecate - chain_id --deprecate -FROM - {{ ref('silver__transactions') }} diff --git a/models/gold/core/core__fact_transactions.yml b/models/gold/core/core__fact_transactions.yml deleted file mode 100644 index 217a0988..00000000 --- a/models/gold/core/core__fact_transactions.yml +++ /dev/null @@ -1,78 +0,0 @@ -version: 2 -models: - - name: core__fact_transactions - description: '{{ doc("evm_tx_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: BLOCK_HASH - description: '{{ doc("evm_column_deprecation_notice_block_hash") }}' - - name: TX_HASH - description: '{{ doc("evm_tx_hash") }}' - - name: NONCE - description: '{{ doc("evm_tx_nonce") }}' - - name: POSITION - description: '{{ doc("evm_column_deprecation_notice_position") }}' - - name: TX_POSITION - description: '{{ doc("evm_tx_position") }}' - - name: FROM_ADDRESS - description: '{{ doc("evm_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("evm_to_address") }}' - - name: VALUE - description: '{{ doc("evm_value") }}' - - name: VALUE_PRECISE_RAW - description: '{{ doc("evm_precise_amount_unadjusted") }}' - - name: VALUE_PRECISE - description: '{{ doc("evm_precise_amount_adjusted") }}' - - name: TX_FEE - description: '{{ doc("evm_tx_fee") }}' - - name: GAS_PRICE - description: '{{ doc("evm_tx_gas_price") }}' - - name: GAS_LIMIT - description: '{{ doc("evm_tx_gas_limit") }}' - - name: GAS_USED - description: '{{ doc("evm_tx_gas_used") }}' - - name: CUMULATIVE_GAS_USED - description: '{{ doc("evm_cumulative_gas_used") }}' - - name: STATUS - description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' - - name: TX_SUCCEEDED - description: '{{ doc("evm_tx_succeeded") }}' - - name: INPUT_DATA - description: '{{ doc("evm_tx_input_data") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_tx_origin_sig") }}' - - name: EFFECTIVE_GAS_PRICE - description: The effective gas price of the transaction, in wei. - - name: MAX_FEE_PER_GAS - description: The maximum fee per gas of the transaction, in wei. - - name: MAX_PRIORITY_FEE_PER_GAS - description: The maximum priority fee per gas of the transaction, in wei. - - name: CHAIN_ID - description: '{{ doc("evm_column_deprecation_notice_chain_id") }}' - - name: TX_TYPE - description: The type of the transaction, 2 for EIP-1559 transactions and 0 for legacy transactions. - - name: r - description: The r value of the transaction signature. - - name: s - description: The s value of the transaction signature. - - name: v - description: The v value of the transaction signature. - - name: BLOB_VERSIONED_HASHES - description: A list of hashed outputs from kzg_to_versioned_hash. - - name: MAX_FEE_PER_BLOB_GAS - description: The maximum fee a user is willing to pay per blob gas. - - name: BLOB_GAS_USED - description: The total amount of blob gas consumed by transactions in the block. - - name: BLOB_GAS_PRICE - description: The price of blob gas in wei. - - name: FACT_TRANSACTIONS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/tests/traces/test_gold__fact_traces_full.sql b/models/gold/core/tests/traces/test_gold__fact_traces_full.sql deleted file mode 100644 index ced1fba5..00000000 --- a/models/gold/core/tests/traces/test_gold__fact_traces_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = "view", - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('core__fact_traces') }} diff --git a/models/gold/core/tests/traces/test_gold__fact_traces_full.yml b/models/gold/core/tests/traces/test_gold__fact_traces_full.yml deleted file mode 100644 index 6677117b..00000000 --- a/models/gold/core/tests/traces/test_gold__fact_traces_full.yml +++ /dev/null @@ -1,120 +0,0 @@ -version: 2 -models: - - name: test_gold__fact_traces_full - description: "This is a view used to test all of the gold fact traces model." - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - TRACE_INDEX - - fsc_utils.sequence_gaps: - partition_by: - - TX_HASH - column_name: TRACE_INDEX - where: BLOCK_TIMESTAMP < CURRENT_DATE - 1 AND TX_HASH IS NOT NULL - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TX_POSITION - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRACE_INDEX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: FROM_ADDRESS - tests: - - not_null: - where: TYPE <> 'SELFDESTRUCT' - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - where: TO_ADDRESS IS NOT NULL - - name: INPUT - tests: - - not_null - - name: TYPE - tests: - - not_null - - name: TRACE_ADDRESS - tests: - - not_null - - name: SUB_TRACES - tests: - - not_null - - name: VALUE - tests: - - not_null - - name: VALUE_PRECISE_RAW - tests: - - not_null - - name: VALUE_PRECISE - tests: - - not_null - - name: VALUE_HEX - tests: - - not_null - - name: GAS - tests: - - not_null - - name: GAS_USED - tests: - - not_null - - name: ORIGIN_FROM_ADDRESS - tests: - - not_null - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null - - name: TRACE_SUCCEEDED - tests: - - not_null - - name: TX_SUCCEEDED - tests: - - not_null - - name: FACT_TRACES_ID - tests: - - not_null - - name: INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 diff --git a/models/gold/core/tests/traces/test_gold__fact_traces_recent.sql b/models/gold/core/tests/traces/test_gold__fact_traces_recent.sql deleted file mode 100644 index 4bed00ff..00000000 --- a/models/gold/core/tests/traces/test_gold__fact_traces_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = "view", - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('core__fact_traces') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref('_block_lookback') }} - ) diff --git a/models/gold/core/tests/traces/test_gold__fact_traces_recent.yml b/models/gold/core/tests/traces/test_gold__fact_traces_recent.yml deleted file mode 100644 index 4206f508..00000000 --- a/models/gold/core/tests/traces/test_gold__fact_traces_recent.yml +++ /dev/null @@ -1,120 +0,0 @@ -version: 2 -models: - - name: test_gold__fact_traces_recent - description: "This is a view used to test the last three days of fact traces." - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - TRACE_INDEX - - fsc_utils.sequence_gaps: - partition_by: - - TX_HASH - column_name: TRACE_INDEX - where: TX_HASH IS NOT NULL - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TX_POSITION - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRACE_INDEX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: FROM_ADDRESS - tests: - - not_null: - where: TYPE <> 'SELFDESTRUCT' - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - where: TO_ADDRESS IS NOT NULL - - name: INPUT - tests: - - not_null - - name: TYPE - tests: - - not_null - - name: TRACE_ADDRESS - tests: - - not_null - - name: SUB_TRACES - tests: - - not_null - - name: VALUE - tests: - - not_null - - name: VALUE_PRECISE_RAW - tests: - - not_null - - name: VALUE_PRECISE - tests: - - not_null - - name: VALUE_HEX - tests: - - not_null - - name: GAS - tests: - - not_null - - name: GAS_USED - tests: - - not_null - - name: ORIGIN_FROM_ADDRESS - tests: - - not_null - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null - - name: TRACE_SUCCEEDED - tests: - - not_null - - name: TX_SUCCEEDED - tests: - - not_null - - name: FACT_TRACES_ID - tests: - - not_null - - name: INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 diff --git a/models/gold/defi/defi__dim_dex_liquidity_pools.sql b/models/gold/defi/defi__dim_dex_liquidity_pools.sql index 804e56dd..3ff3bb2f 100644 --- a/models/gold/defi/defi__dim_dex_liquidity_pools.sql +++ b/models/gold/defi/defi__dim_dex_liquidity_pools.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'DEX, LIQUIDITY, POOLS, LP, SWAPS', } } - } + }, + tags = ['gold','defi','dex','curated'] ) }} SELECT diff --git a/models/gold/defi/defi__dim_dex_liquidity_pools.yml b/models/gold/defi/defi__dim_dex_liquidity_pools.yml index f21b493d..3bbdc0c0 100644 --- a/models/gold/defi/defi__dim_dex_liquidity_pools.yml +++ b/models/gold/defi/defi__dim_dex_liquidity_pools.yml @@ -1,32 +1,32 @@ version: 2 models: - name: defi__dim_dex_liquidity_pools - description: '{{ doc("eth_dex_lp_table_doc") }}' + description: '{{ doc("evm_dim_dex_lp_table_doc") }}' columns: - name: CREATION_BLOCK - description: '{{ doc("eth_dex_creation_block") }}' + description: '{{ doc("evm_dex_creation_block") }}' - name: CREATION_TIME - description: '{{ doc("eth_dex_creation_time") }}' + description: '{{ doc("evm_dex_creation_time") }}' - name: CREATION_TX - description: '{{ doc("eth_dex_creation_tx") }}' + description: '{{ doc("evm_dex_creation_tx") }}' - name: FACTORY_ADDRESS - description: '{{ doc("eth_dex_factory_address") }}' + description: '{{ doc("evm_dex_factory_address") }}' - name: PLATFORM - description: '{{ doc("eth_dex_platform") }}' + description: '{{ doc("evm_dex_platform") }}' - name: POOL_ADDRESS - description: '{{ doc("eth_dex_pool_address") }}' + description: '{{ doc("evm_dex_pool_address") }}' - name: POOL_NAME - description: '{{ doc("eth_dex_pool_name") }}' + description: '{{ doc("evm_dex_pool_name") }}' - name: TOKENS - description: '{{ doc("eth_dex_lp_tokens") }}' + description: '{{ doc("evm_dex_lp_tokens") }}' - name: SYMBOLS - description: '{{ doc("eth_dex_lp_symbols") }}' + description: '{{ doc("evm_dex_lp_symbols") }}' - name: DECIMALS - description: '{{ doc("eth_dex_lp_decimals") }}' + description: '{{ doc("evm_dex_lp_decimals") }}' - name: DIM_DEX_LIQUIDITY_POOLS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/defi/defi__ez_bridge_activity.sql b/models/gold/defi/defi__ez_bridge_activity.sql index c969ee66..cdf2126b 100644 --- a/models/gold/defi/defi__ez_bridge_activity.sql +++ b/models/gold/defi/defi__ez_bridge_activity.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'ACROSS, ALLBRIDGE, AXELAR, CELER, CBRIDGE, DLN, DEBRIDGE, EYWA, HOP, MESON, MULTICHAIN, NATIVE, STARGATE, SYMBIOSIS, SYNAPSE, WORMHOLE, CCTP, CCIP', - 'PURPOSE': 'BRIDGE' } } } + 'PURPOSE': 'BRIDGE' } } }, + tags = ['gold','defi','bridge','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/defi__ez_bridge_activity.yml b/models/gold/defi/defi__ez_bridge_activity.yml index 344a3d95..cc7a2710 100644 --- a/models/gold/defi/defi__ez_bridge_activity.yml +++ b/models/gold/defi/defi__ez_bridge_activity.yml @@ -1,27 +1,27 @@ version: 2 models: - name: defi__ez_bridge_activity - description: '{{ doc("evm_bridge_table_doc") }}' + description: '{{ doc("evm_ez_bridge_activity_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS description: '{{ doc("evm_bridge_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: PLATFORM description: '{{ doc("evm_bridge_platform") }}' - name: SENDER @@ -47,8 +47,8 @@ models: - name: AMOUNT_USD description: '{{ doc("evm_bridge_amount_usd") }}' - name: EZ_BRIDGE_ACTIVITY_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/defi__ez_dex_swaps.sql b/models/gold/defi/defi__ez_dex_swaps.sql index 9f4b9921..df5fe05c 100644 --- a/models/gold/defi/defi__ez_dex_swaps.sql +++ b/models/gold/defi/defi__ez_dex_swaps.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'SUSHI, UNISWAP, CURVE, SYNTHETIX, BALANCER, DODO, FRAX, HASHFLOW, KYBERSWAP, MAVERICK, PANCAKESWAP, SHIBASWAP, TRADER JOE, VERSE, WOOFI', - 'PURPOSE': 'DEX, SWAPS' } } } + 'PURPOSE': 'DEX, SWAPS' } } }, + tags = ['gold','defi','dex','curated','ez'] ) }} SELECT @@ -65,7 +66,6 @@ SELECT COALESCE( modified_timestamp, '2000-01-01' - ) AS modified_timestamp, - _log_id --deprecate + ) AS modified_timestamp FROM {{ ref('silver_dex__complete_dex_swaps') }} diff --git a/models/gold/defi/defi__ez_dex_swaps.yml b/models/gold/defi/defi__ez_dex_swaps.yml index 49c0a46d..d5c3c832 100644 --- a/models/gold/defi/defi__ez_dex_swaps.yml +++ b/models/gold/defi/defi__ez_dex_swaps.yml @@ -1,60 +1,58 @@ version: 2 models: - name: defi__ez_dex_swaps - description: '{{ doc("eth_ez_dex_swaps_table_doc") }}' + description: '{{ doc("evm_ez_dex_swaps_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: POOL_NAME - description: '{{ doc("eth_dex_pool_name") }}' + description: '{{ doc("evm_dex_pool_name") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: AMOUNT_IN - description: '{{ doc("eth_dex_swaps_amount_in") }}' + description: '{{ doc("evm_dex_swaps_amount_in") }}' - name: AMOUNT_OUT - description: '{{ doc("eth_dex_swaps_amount_out") }}' + description: '{{ doc("evm_dex_swaps_amount_out") }}' - name: AMOUNT_IN_USD - description: '{{ doc("eth_dex_swaps_amount_in_usd") }}' + description: '{{ doc("evm_dex_swaps_amount_in_usd") }}' - name: AMOUNT_OUT_USD - description: '{{ doc("eth_dex_swaps_amount_out_usd") }}' + description: '{{ doc("evm_dex_swaps_amount_out_usd") }}' - name: TOKEN_IN - description: '{{ doc("eth_dex_swaps_token_in") }}' + description: '{{ doc("evm_dex_swaps_token_in") }}' - name: TOKEN_OUT - description: '{{ doc("eth_dex_swaps_token_out") }}' + description: '{{ doc("evm_dex_swaps_token_out") }}' - name: SYMBOL_IN - description: '{{ doc("eth_dex_swaps_symbol_in") }}' + description: '{{ doc("evm_dex_swaps_symbol_in") }}' - name: SYMBOL_OUT - description: '{{ doc("eth_dex_swaps_symbol_out") }}' + description: '{{ doc("evm_dex_swaps_symbol_out") }}' - name: SENDER - description: '{{ doc("eth_dex_swaps_sender") }}' + description: '{{ doc("evm_dex_swaps_sender") }}' - name: TX_TO - description: '{{ doc("eth_dex_swaps_tx_to") }}' + description: '{{ doc("evm_dex_swaps_tx_to") }}' - name: PLATFORM - description: '{{ doc("eth_dex_platform") }}' + description: '{{ doc("evm_dex_platform") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' - - name: _LOG_ID - description: '{{ doc("evm_column_deprecation_notice_log_id") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE description: '{{ doc("evm_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: AMOUNT_IN_UNADJ - description: '{{ doc("eth_dex_swaps_amount_in_unadj") }}' + description: '{{ doc("evm_dex_swaps_amount_in_unadj") }}' - name: AMOUNT_OUT_UNADJ - description: '{{ doc("eth_dex_swaps_amount_out_unadj") }}' + description: '{{ doc("evm_dex_swaps_amount_out_unadj") }}' - name: EZ_DEX_SWAPS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/defi/defi__ez_liquid_staking_deposits.sql b/models/gold/defi/defi__ez_liquid_staking_deposits.sql index 8bd127a6..6650625b 100644 --- a/models/gold/defi/defi__ez_liquid_staking_deposits.sql +++ b/models/gold/defi/defi__ez_liquid_staking_deposits.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'ANKR, BINANCE, COINBASE, CREAM, FRAX, HORD, LIDO, NODEDAO, ROCKETPOOL, SHAREDSTAKE, STADER, STAFI, STAKEHOUND, STAKEWISE, SWELL, UNIETH, ETHERFI, LIQUIDCOLLECTIVE, MANTLE, ORIGIN, STAKESTONE', - 'PURPOSE': 'LIQUID STAKING, LSD' } } } + 'PURPOSE': 'LIQUID STAKING, LSD' } } }, + tags = ['gold','defi','liquid_staking','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/defi__ez_liquid_staking_deposits.yml b/models/gold/defi/defi__ez_liquid_staking_deposits.yml index 1ece5f0a..8d7a1533 100644 --- a/models/gold/defi/defi__ez_liquid_staking_deposits.yml +++ b/models/gold/defi/defi__ez_liquid_staking_deposits.yml @@ -5,21 +5,21 @@ models: columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: CONTRACT_ADDRESS description: The contract that received or processed the deposit/stake/mint. - name: STAKER @@ -43,8 +43,8 @@ models: - name: TOKEN_AMOUNT_USD description: The amount of liquid staking tokens in USD, where available. - name: EZ_LIQUID_STAKING_DEPOSITS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/defi__ez_liquid_staking_withdrawals.sql b/models/gold/defi/defi__ez_liquid_staking_withdrawals.sql index 0cf0eb6b..c48e1c98 100644 --- a/models/gold/defi/defi__ez_liquid_staking_withdrawals.sql +++ b/models/gold/defi/defi__ez_liquid_staking_withdrawals.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LIQUID STAKING, LSD' } } - } + }, + tags = ['gold','defi','liquid_staking','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/defi__ez_liquid_staking_withdrawals.yml b/models/gold/defi/defi__ez_liquid_staking_withdrawals.yml index d2d32974..99ed236f 100644 --- a/models/gold/defi/defi__ez_liquid_staking_withdrawals.yml +++ b/models/gold/defi/defi__ez_liquid_staking_withdrawals.yml @@ -5,21 +5,21 @@ models: columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: CONTRACT_ADDRESS description: The contract that received or processed the withdraw/unstake/redeem/burn. - name: STAKER @@ -43,8 +43,8 @@ models: - name: TOKEN_AMOUNT_USD description: The amount of liquid staking tokens in USD, where available. - name: EZ_LIQUID_STAKING_WITHDRAWALS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/defi/lending/defi__ez_lending_borrows.sql b/models/gold/defi/lending/defi__ez_lending_borrows.sql index 44d993d0..2a269faa 100644 --- a/models/gold/defi/lending/defi__ez_lending_borrows.sql +++ b/models/gold/defi/lending/defi__ez_lending_borrows.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LENDING, BORROWS' } } - } + }, + tags = ['gold','defi','lending','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/lending/defi__ez_lending_borrows.yml b/models/gold/defi/lending/defi__ez_lending_borrows.yml index 288c6856..dea40466 100644 --- a/models/gold/defi/lending/defi__ez_lending_borrows.yml +++ b/models/gold/defi/lending/defi__ez_lending_borrows.yml @@ -1,46 +1,46 @@ version: 2 models: - name: defi__ez_lending_borrows - description: '{{ doc("complete_lending_borrows_table_doc") }}' + description: '{{ doc("evm_complete_lending_borrows_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: PLATFORM - description: '{{ doc("complete_lending_platform") }}' + description: '{{ doc("evm_complete_lending_platform") }}' - name: PROTOCOL_MARKET - description: '{{ doc("complete_lending_protocol_token") }}' + description: '{{ doc("evm_complete_lending_protocol_token") }}' - name: BORROWER - description: '{{ doc("complete_lending_borrower") }}' + description: '{{ doc("evm_complete_lending_borrower") }}' - name: TOKEN_ADDRESS - description: '{{ doc("complete_lending_token_address") }}' + description: '{{ doc("evm_complete_lending_token_address") }}' - name: TOKEN_SYMBOL - description: '{{ doc("complete_lending_token_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: AMOUNT_UNADJ - description: '{{ doc("complete_lending_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_amount_unadj") }}' - name: AMOUNT - description: '{{ doc("complete_lending_amount") }}' + description: '{{ doc("evm_complete_lending_amount") }}' - name: AMOUNT_USD - description: '{{ doc("complete_lending_amount_usd") }}' + description: '{{ doc("evm_complete_lending_amount_usd") }}' - name: EZ_LENDING_BORROWS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_deposits.sql b/models/gold/defi/lending/defi__ez_lending_deposits.sql index 9e59f439..b7e10922 100644 --- a/models/gold/defi/lending/defi__ez_lending_deposits.sql +++ b/models/gold/defi/lending/defi__ez_lending_deposits.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LENDING, DEPOSITS' } } - } + }, + tags = ['gold','defi','lending','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/lending/defi__ez_lending_deposits.yml b/models/gold/defi/lending/defi__ez_lending_deposits.yml index b67fe22b..c0a10a43 100644 --- a/models/gold/defi/lending/defi__ez_lending_deposits.yml +++ b/models/gold/defi/lending/defi__ez_lending_deposits.yml @@ -1,46 +1,46 @@ version: 2 models: - name: defi__ez_lending_deposits - description: '{{ doc("complete_lending_deposits_table_doc") }}' + description: '{{ doc("evm_complete_lending_deposits_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: PLATFORM - description: '{{ doc("complete_lending_platform") }}' + description: '{{ doc("evm_complete_lending_platform") }}' - name: PROTOCOL_MARKET - description: '{{ doc("complete_lending_protocol_token") }}' + description: '{{ doc("evm_complete_lending_protocol_token") }}' - name: DEPOSITOR - description: '{{ doc("complete_lending_depositor") }}' + description: '{{ doc("evm_complete_lending_depositor") }}' - name: TOKEN_ADDRESS - description: '{{ doc("complete_lending_token_address") }}' + description: '{{ doc("evm_complete_lending_token_address") }}' - name: TOKEN_SYMBOL - description: '{{ doc("complete_lending_token_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: AMOUNT_UNADJ - description: '{{ doc("complete_lending_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_amount_unadj") }}' - name: AMOUNT - description: '{{ doc("complete_lending_amount") }}' + description: '{{ doc("evm_complete_lending_amount") }}' - name: AMOUNT_USD - description: '{{ doc("complete_lending_amount_usd") }}' + description: '{{ doc("evm_complete_lending_amount_usd") }}' - name: EZ_LENDING_DEPOSITS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_flashloans.sql b/models/gold/defi/lending/defi__ez_lending_flashloans.sql index 34dced89..1adf8694 100644 --- a/models/gold/defi/lending/defi__ez_lending_flashloans.sql +++ b/models/gold/defi/lending/defi__ez_lending_flashloans.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LENDING, FLASHLOANS' } } - } + }, + tags = ['gold','defi','lending','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/lending/defi__ez_lending_flashloans.yml b/models/gold/defi/lending/defi__ez_lending_flashloans.yml index 2cf5371b..880e85c1 100644 --- a/models/gold/defi/lending/defi__ez_lending_flashloans.yml +++ b/models/gold/defi/lending/defi__ez_lending_flashloans.yml @@ -1,54 +1,54 @@ version: 2 models: - name: defi__ez_lending_flashloans - description: '{{ doc("complete_lending_flashloans_table_doc") }}' + description: '{{ doc("evm_complete_lending_flashloans_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: PLATFORM - description: '{{ doc("complete_lending_platform") }}' + description: '{{ doc("evm_complete_lending_platform") }}' - name: INITIATOR - description: '{{ doc("complete_lending_initiator_address") }}' + description: '{{ doc("evm_complete_lending_initiator_address") }}' - name: TARGET - description: '{{ doc("complete_lending_target_address") }}' + description: '{{ doc("evm_complete_lending_target_address") }}' - name: PROTOCOL_MARKET - description: '{{ doc("complete_lending_protocol_token") }}' + description: '{{ doc("evm_complete_lending_protocol_token") }}' - name: FLASHLOAN_TOKEN - description: '{{ doc("complete_lending_flashloan_token") }}' + description: '{{ doc("evm_complete_lending_flashloan_token") }}' - name: FLASHLOAN_TOKEN_SYMBOL - description: '{{ doc("complete_lending_token_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: FLASHLOAN_AMOUNT_UNADJ - description: '{{ doc("complete_lending_flashloan_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_flashloan_amount_unadj") }}' - name: FLASHLOAN_AMOUNT - description: '{{ doc("complete_lending_flashloan_amount") }}' + description: '{{ doc("evm_complete_lending_flashloan_amount") }}' - name: FLASHLOAN_AMOUNT_USD - description: '{{ doc("complete_lending_flashloan_amount_usd") }}' + description: '{{ doc("evm_complete_lending_flashloan_amount_usd") }}' - name: PREMIUM_AMOUNT_UNADJ - description: '{{ doc("complete_lending_premium_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_premium_amount_unadj") }}' - name: PREMIUM_AMOUNT - description: '{{ doc("complete_lending_premium_amount") }}' + description: '{{ doc("evm_complete_lending_premium_amount") }}' - name: PREMIUM_AMOUNT_USD - description: '{{ doc("complete_lending_premium_amount_usd") }}' + description: '{{ doc("evm_complete_lending_premium_amount_usd") }}' - name: EZ_LENDING_FLASHLOANS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_liquidations.sql b/models/gold/defi/lending/defi__ez_lending_liquidations.sql index 8c843ee1..fe39095e 100644 --- a/models/gold/defi/lending/defi__ez_lending_liquidations.sql +++ b/models/gold/defi/lending/defi__ez_lending_liquidations.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LENDING, LIQUIDATIONS' } } - } + }, + tags = ['gold','defi','lending','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/lending/defi__ez_lending_liquidations.yml b/models/gold/defi/lending/defi__ez_lending_liquidations.yml index c36f11df..003b2f51 100644 --- a/models/gold/defi/lending/defi__ez_lending_liquidations.yml +++ b/models/gold/defi/lending/defi__ez_lending_liquidations.yml @@ -1,52 +1,52 @@ version: 2 models: - name: defi__ez_lending_liquidations - description: '{{ doc("complete_lending_liquidations_table_doc") }}' + description: '{{ doc("evm_complete_lending_liquidations_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: PLATFORM - description: '{{ doc("complete_lending_platform") }}' + description: '{{ doc("evm_complete_lending_platform") }}' - name: LIQUIDATOR - description: '{{ doc("complete_lending_liquidator") }}' + description: '{{ doc("evm_complete_lending_liquidator") }}' - name: BORROWER - description: '{{ doc("complete_lending_borrower") }}' + description: '{{ doc("evm_complete_lending_borrower") }}' - name: PROTOCOL_MARKET - description: '{{ doc("complete_lending_protocol_token") }}' + description: '{{ doc("evm_complete_lending_protocol_token") }}' - name: COLLATERAL_TOKEN - description: '{{ doc("complete_lending_collateral_asset") }}' + description: '{{ doc("evm_complete_lending_collateral_asset") }}' - name: COLLATERAL_TOKEN_SYMBOL - description: '{{ doc("complete_lending_token_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: AMOUNT_UNADJ - description: '{{ doc("complete_lending_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_amount_unadj") }}' - name: AMOUNT - description: '{{ doc("complete_lending_amount") }}' + description: '{{ doc("evm_complete_lending_amount") }}' - name: AMOUNT_USD - description: '{{ doc("complete_lending_amount_usd") }}' + description: '{{ doc("evm_complete_lending_amount_usd") }}' - name: DEBT_TOKEN - description: '{{ doc("complete_lending_debt_asset") }}' + description: '{{ doc("evm_complete_lending_debt_asset") }}' - name: DEBT_TOKEN_SYMBOL - description: '{{ doc("complete_lending_token_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: EZ_LENDING_LIQUIDATIONS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_repayments.sql b/models/gold/defi/lending/defi__ez_lending_repayments.sql index c3b89587..ab5f7cef 100644 --- a/models/gold/defi/lending/defi__ez_lending_repayments.sql +++ b/models/gold/defi/lending/defi__ez_lending_repayments.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LENDING, REPAYMENTS' } } - } + }, + tags = ['gold','defi','lending','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/lending/defi__ez_lending_repayments.yml b/models/gold/defi/lending/defi__ez_lending_repayments.yml index 8b02b34e..01c40dbf 100644 --- a/models/gold/defi/lending/defi__ez_lending_repayments.yml +++ b/models/gold/defi/lending/defi__ez_lending_repayments.yml @@ -1,48 +1,48 @@ version: 2 models: - name: defi__ez_lending_repayments - description: '{{ doc("complete_lending_repayments_table_doc") }}' + description: '{{ doc("evm_complete_lending_repayments_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: PLATFORM - description: '{{ doc("complete_lending_platform") }}' + description: '{{ doc("evm_complete_lending_platform") }}' - name: PAYER - description: '{{ doc("complete_lending_payer") }}' + description: '{{ doc("evm_complete_lending_payer") }}' - name: BORROWER - description: '{{ doc("complete_lending_borrower") }}' + description: '{{ doc("evm_complete_lending_borrower") }}' - name: PROTOCOL_MARKET - description: '{{ doc("complete_lending_protocol_token") }}' + description: '{{ doc("evm_complete_lending_protocol_token") }}' - name: TOKEN_ADDRESS - description: '{{ doc("complete_lending_token_address") }}' + description: '{{ doc("evm_complete_lending_token_address") }}' - name: TOKEN_SYMBOL - description: '{{ doc("complete_lending_token_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: AMOUNT_UNADJ - description: '{{ doc("complete_lending_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_amount_unadj") }}' - name: AMOUNT - description: '{{ doc("complete_lending_amount") }}' + description: '{{ doc("evm_complete_lending_amount") }}' - name: AMOUNT_USD - description: '{{ doc("complete_lending_amount_usd") }}' + description: '{{ doc("evm_complete_lending_amount_usd") }}' - name: EZ_LENDING_REPAYMENTS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_withdraws.sql b/models/gold/defi/lending/defi__ez_lending_withdraws.sql index cb28e733..27161014 100644 --- a/models/gold/defi/lending/defi__ez_lending_withdraws.sql +++ b/models/gold/defi/lending/defi__ez_lending_withdraws.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LENDING, WITHDRAWS' } } - } + }, + tags = ['gold','defi','lending','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/lending/defi__ez_lending_withdraws.yml b/models/gold/defi/lending/defi__ez_lending_withdraws.yml index 0d00c1fa..1c088169 100644 --- a/models/gold/defi/lending/defi__ez_lending_withdraws.yml +++ b/models/gold/defi/lending/defi__ez_lending_withdraws.yml @@ -1,46 +1,46 @@ version: 2 models: - name: defi__ez_lending_withdraws - description: '{{ doc("complete_lending_withdraws_table_doc") }}' + description: '{{ doc("evm_complete_lending_withdraws_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: PLATFORM - description: '{{ doc("complete_lending_platform") }}' + description: '{{ doc("evm_complete_lending_platform") }}' - name: DEPOSITOR - description: '{{ doc("borrower") }}' + description: '{{ doc("evm_borrower") }}' - name: PROTOCOL_MARKET - description: '{{ doc("complete_lending_protocol_token") }}' + description: '{{ doc("evm_complete_lending_protocol_token") }}' - name: TOKEN_ADDRESS - description: '{{ doc("complete_lending_token_address") }}' + description: '{{ doc("evm_complete_lending_token_address") }}' - name: TOKEN_SYMBOL - description: '{{ doc("complete_lending_token_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: AMOUNT_UNADJ - description: '{{ doc("complete_lending_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_amount_unadj") }}' - name: AMOUNT - description: '{{ doc("complete_lending_amount") }}' + description: '{{ doc("evm_complete_lending_amount") }}' - name: AMOUNT_USD - description: '{{ doc("complete_lending_amount_usd") }}' + description: '{{ doc("evm_complete_lending_amount_usd") }}' - name: EZ_LENDING_WITHDRAWS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/l2/l2__ez_data_availability.sql b/models/gold/l2/l2__ez_data_availability.sql index 92354c82..8c2278ec 100644 --- a/models/gold/l2/l2__ez_data_availability.sql +++ b/models/gold/l2/l2__ez_data_availability.sql @@ -4,7 +4,7 @@ unique_key = ['block_number'], cluster_by = ['block_timestamp::DATE'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, chain, chain_category)", - tags = ['curated','reorg'] + tags = ['gold','l2','curated','ez'] ) }} WITH base AS ( diff --git a/models/gold/l2/l2__ez_data_availability.yml b/models/gold/l2/l2__ez_data_availability.yml index 3c0d1bb1..f2b7f8fe 100644 --- a/models/gold/l2/l2__ez_data_availability.yml +++ b/models/gold/l2/l2__ez_data_availability.yml @@ -9,26 +9,26 @@ models: columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' tests: - not_null - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' tests: - not_null - dbt_expectations.expect_row_values_to_have_recent_data: datepart: day interval: 1 - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' tests: - not_null - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' tests: - not_null - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' tests: - not_null - name: CHAIN diff --git a/models/gold/l2/l2__ez_state_validation.sql b/models/gold/l2/l2__ez_state_validation.sql index 2b403257..e6f699fd 100644 --- a/models/gold/l2/l2__ez_state_validation.sql +++ b/models/gold/l2/l2__ez_state_validation.sql @@ -4,7 +4,7 @@ unique_key = ['block_number','chain', 'validation_type'], cluster_by = ['block_timestamp::DATE'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, chain, chain_category, validation_address, validation_type)", - tags = ['curated','reorg'] + tags = ['gold','l2','curated','ez'] ) }} WITH base AS ( diff --git a/models/gold/l2/l2__ez_state_validation.yml b/models/gold/l2/l2__ez_state_validation.yml index c756e311..af684020 100644 --- a/models/gold/l2/l2__ez_state_validation.yml +++ b/models/gold/l2/l2__ez_state_validation.yml @@ -10,34 +10,34 @@ models: columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' tests: - not_null - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' tests: - not_null - dbt_expectations.expect_row_values_to_have_recent_data: datepart: day interval: 1 - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' tests: - not_null - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' tests: - not_null - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' tests: - not_null - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' tests: - not_null - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' tests: - not_null - name: CHAIN diff --git a/models/gold/nft/lending/nft__ez_lending_liquidations.sql b/models/gold/nft/lending/nft__ez_lending_liquidations.sql index 8f871e2a..05a23091 100644 --- a/models/gold/nft/lending/nft__ez_lending_liquidations.sql +++ b/models/gold/nft/lending/nft__ez_lending_liquidations.sql @@ -2,7 +2,8 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } }, + tags = ['gold','nft','curated','ez'] ) }} SELECT @@ -13,13 +14,13 @@ SELECT platform_name, platform_address, platform_exchange_version, - loanid AS loan_id, --new column + loanid AS loan_id, unique_loan_id, lender_address, borrower_address, - project_name AS name, --new column - nft_address AS contract_address, --new column - tokenid AS token_id, --new column + project_name AS name, + nft_address AS contract_address, + tokenid AS token_id, loan_token_address, loan_token_symbol, principal_unadj, @@ -48,10 +49,6 @@ SELECT COALESCE( modified_timestamp, '2000-01-01' - ) AS modified_timestamp, - loanId, --deprecate - project_name, --deprecate - nft_address, --deprecate - tokenId --deprecate + ) AS modified_timestamp FROM {{ ref('silver_nft__complete_liquidations') }} \ No newline at end of file diff --git a/models/gold/nft/lending/nft__ez_lending_liquidations.yml b/models/gold/nft/lending/nft__ez_lending_liquidations.yml index a965c408..329a06c9 100644 --- a/models/gold/nft/lending/nft__ez_lending_liquidations.yml +++ b/models/gold/nft/lending/nft__ez_lending_liquidations.yml @@ -5,21 +5,19 @@ models: columns: - name: BLOCK_NUMBER - description: '{{ doc("nft_block_no") }}' + description: '{{ doc("evm_nft_block_no") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("nft_blocktime") }}' + description: '{{ doc("evm_nft_blocktime") }}' - name: TX_HASH - description: '{{ doc("nft_tx_hash") }}' + description: '{{ doc("evm_nft_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("nft_event_index") }}' + description: '{{ doc("evm_nft_event_index") }}' - name: PLATFORM_ADDRESS description: The contract address of the platform's lending contract - name: PLATFORM_NAME description: The name of the platform - name: PLATFORM_EXCHANGE_VERSION description: The version of the platform's lending contract - - name: LOANID - description: '{{ doc("evm_column_deprecation_notice_loanid") }}' - name: LOAN_ID description: The ID associated with the loan, often times tied to the borrower's address and collateral. For the case of Blur's blend, this ID can be used as a unique identifier when tracking active loans. However, note that refinances can happen while still maintaining the same loanId. For platforms like NFTFI, loanids of previously paid loans are reused hence they can't be reliably used as a unique identifier without appropriate timestamp filters. Instead, use the unique_loan_id column. - name: UNIQUE_LOAN_ID @@ -28,10 +26,6 @@ models: description: The address that gives out a loan to the borrower. In the case of NFTFI, when a loan is issued, a promissory note (an ERC721) is issued to the lender. The lender can transfer this note to any address which makes any receiving address the new "lender" - name: BORROWER_ADDRESS description: The address that receives the loan and has an NFT locked as collateral - - name: NFT_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_address") }}' - - name: TOKENID - description: '{{ doc("evm_column_deprecation_notice_tokenid") }}' - name: CONTRACT_ADDRESS description: The address of the NFT used as collateral - name: TOKEN_ID @@ -59,22 +53,20 @@ models: - name: LOAN_TENURE description: The tenure of the loan denominated in seconds. For perpetual term loan, the value will be null - name: TX_FEE - description: '{{ doc("nft_tx_fee") }}' + description: '{{ doc("evm_nft_tx_fee") }}' - name: TX_FEE_USD - description: '{{ doc("nft_tx_fee_usd") }}' + description: '{{ doc("evm_nft_tx_fee_usd") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("nft_origin_from") }}' + description: '{{ doc("evm_nft_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("nft_origin_to") }}' + description: '{{ doc("evm_nft_origin_to") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' - - name: PROJECT_NAME - description: '{{ doc("evm_column_deprecation_notice_project_name") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: NAME - description: '{{ doc("nft_project_name") }}' + description: '{{ doc("evm_nft_project_name") }}' - name: EZ_NFT_LENDING_LIQUIDATIONS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/nft/lending/nft__ez_lending_loans.sql b/models/gold/nft/lending/nft__ez_lending_loans.sql index 9643bdcc..d232f6a6 100644 --- a/models/gold/nft/lending/nft__ez_lending_loans.sql +++ b/models/gold/nft/lending/nft__ez_lending_loans.sql @@ -2,7 +2,8 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } }, + tags = ['gold','nft','curated','ez'] ) }} SELECT @@ -14,13 +15,13 @@ SELECT platform_name, platform_address, platform_exchange_version, - loanid AS loan_id, --new column + loanid AS loan_id, unique_loan_id, lender_address, borrower_address, - project_name AS name, --new column - nft_address AS contract_address, --new column - tokenid AS token_id, --new column + project_name AS name, + nft_address AS contract_address, + tokenid AS token_id, loan_token_address, loan_token_symbol, principal_unadj, @@ -56,10 +57,6 @@ SELECT COALESCE( modified_timestamp, '2000-01-01' - ) AS modified_timestamp, - loanId, --deprecate - project_name, --deprecate - nft_address, --deprecate - tokenId --deprecate + ) AS modified_timestamp FROM {{ ref('silver_nft__complete_loans') }} diff --git a/models/gold/nft/lending/nft__ez_lending_loans.yml b/models/gold/nft/lending/nft__ez_lending_loans.yml index 8027f9d7..1e2fbd68 100644 --- a/models/gold/nft/lending/nft__ez_lending_loans.yml +++ b/models/gold/nft/lending/nft__ez_lending_loans.yml @@ -5,13 +5,13 @@ models: columns: - name: BLOCK_NUMBER - description: '{{ doc("nft_block_no") }}' + description: '{{ doc("evm_nft_block_no") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("nft_blocktime") }}' + description: '{{ doc("evm_nft_blocktime") }}' - name: TX_HASH - description: '{{ doc("nft_tx_hash") }}' + description: '{{ doc("evm_nft_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("nft_event_index") }}' + description: '{{ doc("evm_nft_event_index") }}' - name: EVENT_TYPE description: There are 2 types of loan creation events. It can either be a new loan or a refinance of an existing loan. Note that for NFTfi, renegotiation events are categorised as refinance events in this table. As for the refinancing feature on NFTfi, old loans are repaid and new loan ids are reissued so these would be new loan entries in this table. - name: PLATFORM_ADDRESS @@ -20,8 +20,6 @@ models: description: The name of the platform - name: PLATFORM_EXCHANGE_VERSION description: The version of the platform's lending contract - - name: LOANID - description: '{{ doc("evm_column_deprecation_notice_loanid") }}' - name: LOAN_ID description: The ID associated with the loan, often times tied to the borrower's address and collateral. For the case of Blur's blend, this ID can be used as a unique identifier when tracking active loans. However, note that refinances can happen while still maintaining the same loanId. For platforms like NFTFI, loanids of previously paid loans are reused hence they can't be reliably used as a unique identifier without appropriate timestamp filters. Instead, use the unique_loan_id column. - name: UNIQUE_LOAN_ID @@ -30,10 +28,6 @@ models: description: The address that gives out a loan to the borrower. In the case of NFTFI, when a loan is issued, a promissory note (an ERC721) is issued to the lender. The lender can transfer this note to any address which makes any receiving address the new "lender" - name: BORROWER_ADDRESS description: The address that receives the loan and has an NFT locked as collateral - - name: NFT_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_address") }}' - - name: TOKENID - description: '{{ doc("evm_column_deprecation_notice_tokenid") }}' - name: CONTRACT_ADDRESS description: The address of the NFT used as collateral - name: TOKEN_ID @@ -73,22 +67,20 @@ models: - name: LOAN_TENURE description: The tenure of the loan denominated in seconds. For perpetual term loan, the value will be null - name: TX_FEE - description: '{{ doc("nft_tx_fee") }}' + description: '{{ doc("evm_nft_tx_fee") }}' - name: TX_FEE_USD - description: '{{ doc("nft_tx_fee_usd") }}' + description: '{{ doc("evm_nft_tx_fee_usd") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("nft_origin_from") }}' + description: '{{ doc("evm_nft_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("nft_origin_to") }}' + description: '{{ doc("evm_nft_origin_to") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' - - name: PROJECT_NAME - description: '{{ doc("evm_column_deprecation_notice_project_name") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: NAME - description: '{{ doc("nft_project_name") }}' + description: '{{ doc("evm_nft_project_name") }}' - name: EZ_NFT_LENDING_LOANS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/nft/lending/nft__ez_lending_repayments.sql b/models/gold/nft/lending/nft__ez_lending_repayments.sql index 67e5124e..78657873 100644 --- a/models/gold/nft/lending/nft__ez_lending_repayments.sql +++ b/models/gold/nft/lending/nft__ez_lending_repayments.sql @@ -2,7 +2,8 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } }, + tags = ['gold','nft','curated','ez'] ) }} SELECT @@ -14,13 +15,13 @@ SELECT platform_name, platform_address, platform_exchange_version, - loanid AS loan_id, --new column + loanid AS loan_id, unique_loan_id, lender_address, borrower_address, - project_name AS name, --new column - nft_address AS contract_address, --new column - tokenid AS token_id, --new column + project_name AS name, + nft_address AS contract_address, + tokenid AS token_id, loan_token_address, loan_token_symbol, principal_unadj, @@ -56,11 +57,6 @@ SELECT COALESCE( modified_timestamp, '2000-01-01' - ) AS modified_timestamp, - loanId, --deprecate - project_name, --deprecate - nft_address, --deprecate - tokenId --deprecate - + ) AS modified_timestamp FROM {{ ref('silver_nft__complete_repayments') }} \ No newline at end of file diff --git a/models/gold/nft/lending/nft__ez_lending_repayments.yml b/models/gold/nft/lending/nft__ez_lending_repayments.yml index 19b75b83..df2352b4 100644 --- a/models/gold/nft/lending/nft__ez_lending_repayments.yml +++ b/models/gold/nft/lending/nft__ez_lending_repayments.yml @@ -5,13 +5,13 @@ models: columns: - name: BLOCK_NUMBER - description: '{{ doc("nft_block_no") }}' + description: '{{ doc("evm_nft_block_no") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("nft_blocktime") }}' + description: '{{ doc("evm_nft_blocktime") }}' - name: TX_HASH - description: '{{ doc("nft_tx_hash") }}' + description: '{{ doc("evm_nft_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("nft_event_index") }}' + description: '{{ doc("evm_nft_event_index") }}' - name: EVENT_TYPE description: There are 2 types of loan repayment events. It can either be repay or refinance. 'repay' events are full repayment events by the borrower to get their collateral back while 'refinance' events represent the same borrower engaging a new lender and repay their past loan. The collateral is still locked in this scenario. - name: PLATFORM_ADDRESS @@ -20,8 +20,6 @@ models: description: The name of the platform - name: PLATFORM_EXCHANGE_VERSION description: The version of the platform's lending contract - - name: LOANID - description: '{{ doc("evm_column_deprecation_notice_loanid") }}' - name: LOAN_ID description: The ID associated with the loan, often times tied to the borrower's address and collateral. For the case of Blur's blend, this ID can be used as a unique identifier when tracking active loans. However, note that refinances can happen while still maintaining the same loanId. For platforms like NFTFI, loanids of previously paid loans are reused hence they can't be reliably used as a unique identifier without appropriate timestamp filters. Instead, use the unique_loan_id column. - name: UNIQUE_LOAN_ID @@ -30,10 +28,6 @@ models: description: The address that gives out a loan to the borrower. In the case of NFTFI, when a loan is issued, a promissory note (an ERC721) is issued to the lender. The lender can transfer this note to any address which makes any receiving address the new "lender" - name: BORROWER_ADDRESS description: The address that receives the loan and has an NFT locked as collateral - - name: NFT_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_address") }}' - - name: TOKENID - description: '{{ doc("evm_column_deprecation_notice_tokenid") }}' - name: CONTRACT_ADDRESS description: The address of the NFT used as collateral - name: TOKEN_ID @@ -75,22 +69,20 @@ models: - name: LOAN_TENURE description: The tenure of the loan denominated in seconds. For perpetual term loan, the value will be null - name: TX_FEE - description: '{{ doc("nft_tx_fee") }}' + description: '{{ doc("evm_nft_tx_fee") }}' - name: TX_FEE_USD - description: '{{ doc("nft_tx_fee_usd") }}' + description: '{{ doc("evm_nft_tx_fee_usd") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("nft_origin_from") }}' + description: '{{ doc("evm_nft_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("nft_origin_to") }}' + description: '{{ doc("evm_nft_origin_to") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' - - name: PROJECT_NAME - description: '{{ doc("evm_column_deprecation_notice_project_name") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: NAME - description: '{{ doc("nft_project_name") }}' + description: '{{ doc("evm_nft_project_name") }}' - name: EZ_NFT_LENDING_REPAYMENTS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/nft/mev/nft__ez_mev_arbitrage.sql b/models/gold/nft/mev/nft__ez_mev_arbitrage.sql index e423c858..3e038f81 100644 --- a/models/gold/nft/mev/nft__ez_mev_arbitrage.sql +++ b/models/gold/nft/mev/nft__ez_mev_arbitrage.sql @@ -2,7 +2,8 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } }, + tags = ['gold','nft','curated','ez'] ) }} SELECT diff --git a/models/gold/nft/mev/nft__ez_mev_arbitrage.yml b/models/gold/nft/mev/nft__ez_mev_arbitrage.yml index 2949fa25..61ab8b1e 100644 --- a/models/gold/nft/mev/nft__ez_mev_arbitrage.yml +++ b/models/gold/nft/mev/nft__ez_mev_arbitrage.yml @@ -5,13 +5,13 @@ models: columns: - name: BLOCK_NUMBER - description: '{{ doc("nft_block_no") }}' + description: '{{ doc("evm_nft_block_no") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("nft_blocktime") }}' + description: '{{ doc("evm_nft_blocktime") }}' - name: TX_HASH - description: '{{ doc("nft_tx_hash") }}' + description: '{{ doc("evm_nft_tx_hash") }}' - name: EVENT_TYPE - description: '{{ doc("nft_event_type") }}' + description: '{{ doc("evm_nft_event_type") }}' - name: MEV_SEARCHER description: 'The address of the MEV finder, taken from the origin address that initiated the transaction' - name: MEV_CONTRACT @@ -23,7 +23,7 @@ models: - name: MINER_TIP_USD description: 'The total amount in USD sent to the block miner/builder as a tip to include the transaction in the block' - name: TX_FEE_USD - description: '{{ doc("nft_tx_fee_usd") }}' + description: '{{ doc("evm_nft_tx_fee_usd") }}' - name: PROFIT_USD description: 'The remainder in USD after subtracting cost, miner tip and transaction fee from revenue' - name: FUNDING_SOURCE @@ -31,8 +31,8 @@ models: - name: ARBITRAGE_DIRECTION description: 'The direction in which the arbitrage is performed. There are two possibilities of origin and destination: pool and marketplace. Pool represents marketplaces like nftx and sudoswap where users swap from a pool whereas marketplace represents regular marketplaces that are not pool-based' - name: EZ_MEV_ARBITRAGE_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/nft/mev/nft__fact_mev_arbitrage_events.sql b/models/gold/nft/mev/nft__fact_mev_arbitrage_events.sql index 4de0d991..9885a660 100644 --- a/models/gold/nft/mev/nft__fact_mev_arbitrage_events.sql +++ b/models/gold/nft/mev/nft__fact_mev_arbitrage_events.sql @@ -2,7 +2,8 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } }, + tags = ['gold','nft','curated'] ) }} SELECT @@ -15,17 +16,17 @@ SELECT platform_exchange_version, buyer_address, seller_address, - nft_address AS contract_address, --new column - tokenid AS token_id, --new column + nft_address AS contract_address, + tokenid AS token_id, COALESCE( erc1155_value, '1' - ) :: STRING AS quantity, --new column + ) :: STRING AS quantity, CASE WHEN erc1155_value IS NULL THEN 'erc721' ELSE 'erc1155' - END AS token_standard, --new column - project_name AS name, --new column + END AS token_standard, + project_name AS name, nft_arbitrage_events_id AS ez_mev_arbitrage_events_id, COALESCE( inserted_timestamp, @@ -34,10 +35,6 @@ SELECT COALESCE( modified_timestamp, '2000-01-01' - ) AS modified_timestamp, - nft_address, --deprecate - tokenid, --deprecate - erc1155_value, --deprecate - project_name --deprecate + ) AS modified_timestamp FROM {{ ref('silver_nft__arbitrage_events') }} diff --git a/models/gold/nft/mev/nft__fact_mev_arbitrage_events.yml b/models/gold/nft/mev/nft__fact_mev_arbitrage_events.yml index d0503900..42e94fe1 100644 --- a/models/gold/nft/mev/nft__fact_mev_arbitrage_events.yml +++ b/models/gold/nft/mev/nft__fact_mev_arbitrage_events.yml @@ -5,44 +5,34 @@ models: columns: - name: BLOCK_NUMBER - description: '{{ doc("nft_block_no") }}' + description: '{{ doc("evm_nft_block_no") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("nft_blocktime") }}' + description: '{{ doc("evm_nft_blocktime") }}' - name: TX_HASH - description: '{{ doc("nft_tx_hash") }}' + description: '{{ doc("evm_nft_tx_hash") }}' - name: TRADE_SIDE description: 'The side of the trade that this event represents. This can be either buy or sell. Buy would represent the events where nfts are bought while sell would present the events where the bought nfts are sold. Note that the number of events for buy and sell may not be the same for a given transaction.' - name: EVENT_INDEX - description: '{{ doc("nft_event_index") }}' + description: '{{ doc("evm_nft_event_index") }}' - name: PLATFORM_NAME - description: '{{ doc("nft_platform_name") }}' + description: '{{ doc("evm_nft_platform_name") }}' - name: PLATFORM_EXCHANGE_VERSION - description: '{{ doc("nft_platform_exchange_version") }}' + description: '{{ doc("evm_nft_platform_exchange_version") }}' - name: BUYER_ADDRESS - description: '{{ doc("nft_buyer_address") }}' + description: '{{ doc("evm_nft_buyer_address") }}' - name: SELLER_ADDRESS - description: '{{ doc("nft_seller_address") }}' - - name: NFT_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_address") }}' - - name: TOKENID - description: '{{ doc("evm_column_deprecation_notice_tokenid") }}' + description: '{{ doc("evm_nft_seller_address") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("nft_nft_address") }}' + description: '{{ doc("evm_nft_nft_address") }}' - name: TOKEN_ID - description: '{{ doc("nft_tokenid") }}' - - name: ERC1155_VALUE - description: '{{ doc("evm_column_deprecation_notice_erc1155_value") }}' - - name: QUANTITY - description: '{{ doc("nft_erc1155_value") }}' + description: '{{ doc("evm_nft_tokenid") }}' - name: TOKEN_STANDARD - description: '{{ doc("evm_nft_token_standard") }}' - - name: PROJECT_NAME - description: '{{ doc("evm_column_deprecation_notice_project_name") }}' + description: '{{ doc("evm_token_standard") }}' - name: NAME - description: '{{ doc("nft_project_name") }}' + description: '{{ doc("evm_nft_project_name") }}' - name: EZ_MEV_ARBITRAGE_EVENTS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/nft/nft__dim_nft_collection_metadata.sql b/models/gold/nft/nft__dim_nft_collection_metadata.sql index 5e7248a5..5bcff468 100644 --- a/models/gold/nft/nft__dim_nft_collection_metadata.sql +++ b/models/gold/nft/nft__dim_nft_collection_metadata.sql @@ -2,19 +2,20 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } }, + tags = ['gold','nft','curated'] ) }} SELECT blockchain, - nft_address AS contract_address, --new column + nft_address AS contract_address, collection_name, - tokenid AS token_id, --new column + tokenid AS token_id, traits, - tokenid_name AS token_id_name, --new column - tokenid_description AS token_id_description, --new column - tokenid_image_url AS token_id_image_url, --new column - nft_address_tokenid AS nft_address_token_id, --new column + tokenid_name AS token_id_name, + tokenid_description AS token_id_description, + tokenid_image_url AS token_id_image_url, + nft_address_tokenid AS nft_address_token_id, COALESCE ( nft_collection_metadata_id, {{ dbt_utils.generate_surrogate_key( @@ -28,12 +29,6 @@ SELECT COALESCE( modified_timestamp, '2000-01-01' - ) AS modified_timestamp, - nft_address, --deprecate - tokenid, --deprecate - tokenid_name, --deprecate - tokenid_description, --deprecate - tokenid_image_url, --deprecate - nft_address_tokenid --deprecate + ) AS modified_timestamp FROM {{ ref('silver__nft_collection_metadata') }} diff --git a/models/gold/nft/nft__dim_nft_collection_metadata.yml b/models/gold/nft/nft__dim_nft_collection_metadata.yml index cdcaff41..eea349ca 100644 --- a/models/gold/nft/nft__dim_nft_collection_metadata.yml +++ b/models/gold/nft/nft__dim_nft_collection_metadata.yml @@ -6,37 +6,25 @@ models: columns: - name: BLOCKCHAIN description: 'Blockchain where the NFT metadata is retrieved from.' - - name: NFT_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_address") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("nft_nft_address") }}' + description: '{{ doc("evm_nft_nft_address") }}' - name: COLLECTION_NAME description: 'The name for this NFT collection.' - - name: TOKENID - description: '{{ doc("evm_column_deprecation_notice_tokenid") }}' - name: TOKEN_ID - description: '{{ doc("nft_tokenid") }}' - - name: TOKENID_NAME - description: '{{ doc("evm_column_deprecation_notice_tokenid_name") }}' + description: '{{ doc("evm_nft_tokenid") }}' - name: TOKEN_ID_NAME description: 'The name for this specific tokenId. This may be the same for all tokenIds within the same collection.' - name: TRAITS description: 'The traits for this tokenId in a key-value pair format.' - - name: TOKENID_DESCRIPTION - description: '{{ doc("evm_column_deprecation_notice_tokenid_description") }}' - name: TOKEN_ID_DESCRIPTION description: 'The description for this specific tokenId. This may be the same for all tokenIds within the same collection.' - - name: TOKENID_IMAGE_URL - description: '{{ doc("evm_column_deprecation_notice_tokenid_image_url") }}' - name: TOKEN_ID_IMAGE_URL description: 'The url of the image for this tokenId.' - - name: NFT_ADDRESS_TOKENID - description: '{{ doc("evm_column_deprecation_notice_nft_address_tokenid") }}' - name: NFT_ADDRESS_TOKEN_ID description: 'The concatenation of nft address and tokenId.' - name: DIM_NFT_COLLECTION_METADATA_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/nft/nft__ez_nft_mints.sql b/models/gold/nft/nft__ez_nft_mints.sql deleted file mode 100644 index d3873eab..00000000 --- a/models/gold/nft/nft__ez_nft_mints.sql +++ /dev/null @@ -1,60 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } } -) }} - -SELECT - block_timestamp, - block_number, - tx_hash, - event_type, - nft_address AS contract_address,--new column - project_name AS NAME,--new column - nft_from_address AS from_address,--new column - nft_to_address AS to_address,--new column - tokenId AS token_id,--new column - COALESCE( - erc1155_value, - '1' - ) :: STRING AS quantity,--new column - CASE - WHEN erc1155_value IS NULL THEN 'erc721' - ELSE 'erc1155' - END AS token_standard,--new column - mint_price_eth AS mint_price_native,--new column - mint_price_usd, - nft_count, - amount, - amount_usd, - mint_price_tokens, - mint_price_tokens_usd, - mint_token_symbol, - mint_token_address, - tx_fee, - COALESCE ( - nft_mints_id, - {{ dbt_utils.generate_surrogate_key( - ['_log_id','nft_address'] - ) }} - ) AS ez_nft_mints_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp, - nft_address,--deprecate - project_name,--deprecate - nft_from_address,--deprecate - nft_to_address,--deprecate - tokenId,--deprecate - erc1155_value,--deprecate - mint_price_eth,--deprecate - _log_id,--deprecate - _inserted_timestamp --deprecate -FROM - {{ ref('silver__nft_mints') }} diff --git a/models/gold/nft/nft__ez_nft_mints.yml b/models/gold/nft/nft__ez_nft_mints.yml deleted file mode 100644 index 6c5fc293..00000000 --- a/models/gold/nft/nft__ez_nft_mints.yml +++ /dev/null @@ -1,74 +0,0 @@ -version: 2 -models: - - name: nft__ez_nft_mints - description: We will be deprecating this table by March 10. Please use the ez_nft_transfers table together with the is_mint column to filter for nft mints. - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("nft_block_no") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("nft_blocktime") }}' - - name: TX_HASH - description: '{{ doc("nft_tx_hash") }}' - - name: EVENT_TYPE - description: '{{ doc("nft_event_type") }}' - - name: NFT_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_address") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("nft_nft_address") }}' - - name: PROJECT_NAME - description: '{{ doc("evm_column_deprecation_notice_project_name") }}' - - name: NAME - description: '{{ doc("nft_project_name") }}' - - name: ERC1155_VALUE - description: '{{ doc("evm_column_deprecation_notice_erc1155_value") }}' - - name: QUANTITY - description: '{{ doc("nft_erc1155_value") }}' - - name: NFT_FROM_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_from_address") }}' - - name: NFT_TO_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_to_address") }}' - - name: FROM_ADDRESS - description: '{{ doc("nft_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("nft_to_address") }}' - - name: TOKENID - description: '{{ doc("evm_column_deprecation_notice_tokenid") }}' - - name: TOKEN_ID - description: '{{ doc("nft_tokenid") }}' - - name: MINT_PRICE_ETH - description: '{{ doc("evm_column_deprecation_notice_mint_price_eth") }}' - - name: MINT_PRICE_NATIVE - description: '{{ doc("nft_mint_price") }}' - - name: MINT_PRICE_USD - description: '{{ doc("nft_mint_price_usd") }}' - - name: NFT_COUNT - description: '{{ doc("nft_mint_count") }}' - - name: AMOUNT - description: '{{ doc("nft_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("nft_amount_usd") }}' - - name: TX_FEE - description: '{{ doc("nft_tx_fee") }}' - - name: TX_FEE_USD - description: '{{ doc("nft_tx_fee_usd") }}' - - name: MINT_PRICE_TOKENS - description: '{{ doc("nft_mints_token_price") }}' - - name: MINT_PRICE_TOKENS_USD - description: '{{ doc("nft_mints_token_price_usd") }}' - - name: MINT_TOKEN_SYMBOL - description: '{{ doc("nft_mints_symbol") }}' - - name: MINT_TOKEN_ADDRESS - description: '{{ doc("nft_mints_token_address") }}' - - name: TOKEN_STANDARD - description: '{{ doc("evm_nft_token_standard") }}' - - name: EZ_NFT_MINTS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' - - name: _INSERTED_TIMESTAMP - description: '{{ doc("evm_column_deprecation_notice_inserted_timestamp") }}' - - name: _LOG_ID - description: '{{ doc("evm_column_deprecation_notice_log_id") }}' diff --git a/models/gold/nft/nft__ez_nft_sales.sql b/models/gold/nft/nft__ez_nft_sales.sql index 65cc026e..7667373e 100644 --- a/models/gold/nft/nft__ez_nft_sales.sql +++ b/models/gold/nft/nft__ez_nft_sales.sql @@ -2,8 +2,8 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } - } } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } }, + tags = ['gold','nft','curated','ez'] ) }} SELECT @@ -18,17 +18,11 @@ SELECT aggregator_name, seller_address, buyer_address, - nft_address AS contract_address, --new column - project_name AS NAME, --new column - tokenid AS token_id, --new column - COALESCE( - erc1155_value, - '1' - ) :: STRING AS quantity, --new column - CASE - WHEN erc1155_value IS NULL THEN 'erc721' - ELSE 'erc1155' - END AS token_standard, --new column + nft_address as contract_address, + project_name as name, + tokenId as token_id, + coalesce(erc1155_value, '1')::STRING AS quantity, + case when erc1155_value is null then 'erc721' else 'erc1155' end as token_standard, currency_symbol, currency_address, price, @@ -39,7 +33,7 @@ SELECT total_fees_usd, platform_fee_usd, creator_fee_usd, - tx_fee, + tx_fee, tx_fee_usd, origin_from_address, origin_to_address, @@ -57,10 +51,7 @@ SELECT COALESCE( modified_timestamp, '2000-01-01' - ) AS modified_timestamp, - tokenId, --deprecate - erc1155_value, --deprecate - project_name, --deprecate - nft_address --deprecate + ) AS modified_timestamp + FROM {{ ref('silver_nft__complete_nft_sales') }} diff --git a/models/gold/nft/nft__ez_nft_sales.yml b/models/gold/nft/nft__ez_nft_sales.yml index 318384cb..a6825e1e 100644 --- a/models/gold/nft/nft__ez_nft_sales.yml +++ b/models/gold/nft/nft__ez_nft_sales.yml @@ -5,78 +5,66 @@ models: columns: - name: BLOCK_NUMBER - description: '{{ doc("nft_block_no") }}' + description: '{{ doc("evm_nft_block_no") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("nft_blocktime") }}' + description: '{{ doc("evm_nft_blocktime") }}' - name: TX_HASH - description: '{{ doc("nft_tx_hash") }}' + description: '{{ doc("evm_nft_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("nft_event_index") }}' + description: '{{ doc("evm_nft_event_index") }}' - name: EVENT_TYPE - description: '{{ doc("nft_event_type") }}' + description: '{{ doc("evm_nft_event_type") }}' - name: PLATFORM_ADDRESS - description: '{{ doc("nft_platform_address") }}' + description: '{{ doc("evm_nft_platform_address") }}' - name: PLATFORM_NAME - description: '{{ doc("nft_platform_name") }}' + description: '{{ doc("evm_nft_platform_name") }}' - name: PLATFORM_EXCHANGE_VERSION - description: '{{ doc("nft_platform_exchange_version") }}' + description: '{{ doc("evm_nft_platform_exchange_version") }}' - name: AGGREGATOR_NAME - description: '{{ doc("nft_aggregator_name") }}' + description: '{{ doc("evm_nft_aggregator_name") }}' - name: SELLER_ADDRESS - description: '{{ doc("nft_seller_address") }}' + description: '{{ doc("evm_nft_seller_address") }}' - name: BUYER_ADDRESS - description: '{{ doc("nft_buyer_address") }}' - - name: NFT_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_address") }}' + description: '{{ doc("evm_nft_buyer_address") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("nft_nft_address") }}' - - name: PROJECT_NAME - description: '{{ doc("evm_column_deprecation_notice_project_name") }}' + description: '{{ doc("evm_nft_address") }}' - name: NAME description: '{{ doc("evm_nft_project_name") }}' - - name: TOKENID - description: '{{ doc("evm_column_deprecation_notice_tokenid") }}' - name: TOKEN_ID - description: '{{ doc("nft_tokenid") }}' - - name: ERC1155_VALUE - description: '{{ doc("evm_column_deprecation_notice_erc1155_value") }}' + description: '{{ doc("evm_nft_tokenid") }}' - name: QUANTITY description: '{{ doc("evm_nft_quantity") }}' - name: TOKEN_STANDARD - description: '{{ doc("evm_nft_token_standard") }}' + description: '{{ doc("evm_token_standard") }}' - name: CURRENCY_SYMBOL - description: '{{ doc("nft_currency_symbol") }}' + description: '{{ doc("evm_nft_currency_symbol") }}' - name: CURRENCY_ADDRESS - description: '{{ doc("nft_currency_address") }}' + description: '{{ doc("evm_nft_currency_address") }}' - name: PRICE - description: '{{ doc("nft_price") }}' + description: '{{ doc("evm_nft_price") }}' - name: PRICE_USD - description: '{{ doc("nft_price_usd") }}' + description: '{{ doc("evm_nft_price_usd") }}' - name: TOTAL_FEES - description: '{{ doc("nft_total_fees") }}' + description: '{{ doc("evm_nft_total_fees") }}' - name: PLATFORM_FEE - description: '{{ doc("nft_platform_fee") }}' + description: '{{ doc("evm_nft_platform_fee") }}' - name: CREATOR_FEE - description: '{{ doc("nft_creator_fee") }}' + description: '{{ doc("evm_nft_creator_fee") }}' - name: TOTAL_FEES_USD - description: '{{ doc("nft_total_fees_usd") }}' + description: '{{ doc("evm_nft_total_fees_usd") }}' - name: PLATFORM_FEE_USD - description: '{{ doc("nft_platform_fee_usd") }}' + description: '{{ doc("evm_nft_platform_fee_usd") }}' - name: CREATOR_FEE_USD - description: '{{ doc("nft_creator_fee_usd") }}' + description: '{{ doc("evm_nft_creator_fee_usd") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("nft_origin_from") }}' + description: '{{ doc("evm_nft_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("nft_origin_to") }}' + description: '{{ doc("evm_nft_origin_to") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' - - name: TX_FEE - description: '{{ doc("evm_nft_tx_fee") }}' - - name: TX_FEE_USD - description: '{{ doc("evm_nft_tx_fee_usd") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: EZ_NFT_SALES_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/nft/nft__ez_nft_transfers.sql b/models/gold/nft/nft__ez_nft_transfers.sql deleted file mode 100644 index 98cd0552..00000000 --- a/models/gold/nft/nft__ez_nft_transfers.sql +++ /dev/null @@ -1,57 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } - } } -) }} - -SELECT - block_timestamp, - block_number, - tx_hash, - event_index, - intra_event_index, - token_transfer_type, - IFF( - from_address = '0x0000000000000000000000000000000000000000', - TRUE, - FALSE - ) AS is_mint, --new column - from_address, --new column - to_address, --new column - contract_address, --new column - tokenId AS token_id, --new column - COALESCE( - erc1155_value, - '1' - ) :: STRING AS quantity, --new column - CASE - WHEN token_transfer_type = 'erc721_Transfer' THEN 'erc721' - WHEN token_transfer_type = 'erc1155_TransferSingle' THEN 'erc1155' - WHEN token_transfer_type = 'erc1155_TransferBatch' THEN 'erc1155' - END AS token_standard, --new column - project_name AS NAME, --new column - COALESCE ( - nft_transfers_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash','event_index','intra_event_index'] - ) }} - ) AS ez_nft_transfers_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp, - event_type, -- deprecate - from_address AS nft_from_address, -- deprecate - to_address AS nft_to_address, -- deprecate - contract_address AS nft_address, --deprecate - tokenId, -- deprecate - erc1155_value, --deprecate - project_name --deprecate -FROM - {{ ref('silver__nft_transfers') }} diff --git a/models/gold/nft/nft__ez_nft_transfers.yml b/models/gold/nft/nft__ez_nft_transfers.yml deleted file mode 100644 index a0e14147..00000000 --- a/models/gold/nft/nft__ez_nft_transfers.yml +++ /dev/null @@ -1,54 +0,0 @@ -version: 2 -models: - - name: nft__ez_nft_transfers - description: '{{ doc("evm_ez_nft_transfer_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("nft_block_no") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("nft_blocktime") }}' - - name: TX_HASH - description: '{{ doc("nft_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("nft_event_index") }}' - - name: INTRA_EVENT_INDEX - description: '{{ doc("nft_intra_event_index") }}' - - name: TOKEN_TRANSFER_TYPE - description: '{{ doc("evm_nft_token_transfer_type") }}' - - name: IS_MINT - description: '{{ doc("evm_nft_is_mint") }}' - - name: EVENT_TYPE - description: '{{ doc("evm_column_deprecation_notice_event_type") }}' - - name: NFT_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_address") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("nft_nft_address") }}' - - name: NAME - description: '{{ doc("evm_nft_project_name") }}' - - name: PROJECT_NAME - description: '{{ doc("evm_column_deprecation_notice_project_name") }}' - - name: NFT_FROM_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_from_address") }}' - - name: FROM_ADDRESS - description: '{{ doc("evm_nft_from_address") }}' - - name: NFT_TO_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_to_address") }}' - - name: TO_ADDRESS - description: '{{ doc("evm_nft_to_address") }}' - - name: TOKENID - description: '{{ doc("evm_column_deprecation_notice_tokenid") }}' - - name: TOKEN_ID - description: '{{ doc("nft_tokenid") }}' - - name: ERC1155_VALUE - description: '{{ doc("evm_column_deprecation_notice_erc1155_value") }}' - - name: QUANTITY - description: '{{ doc("evm_nft_quantity") }}' - - name: TOKEN_STANDARD - description: '{{ doc("evm_nft_token_standard") }}' - - name: EZ_NFT_TRANSFERS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/price/price__dim_asset_metadata.sql b/models/gold/price/price__dim_asset_metadata.sql deleted file mode 100644 index 71bf27f0..00000000 --- a/models/gold/price/price__dim_asset_metadata.sql +++ /dev/null @@ -1,19 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - token_address, - asset_id, - symbol, - name, - platform AS blockchain, - platform_id AS blockchain_id, - provider, - inserted_timestamp, - modified_timestamp, - complete_provider_asset_metadata_id AS dim_asset_metadata_id -FROM - {{ ref('silver__complete_provider_asset_metadata') }} \ No newline at end of file diff --git a/models/gold/price/price__dim_asset_metadata.yml b/models/gold/price/price__dim_asset_metadata.yml deleted file mode 100644 index db7ec288..00000000 --- a/models/gold/price/price__dim_asset_metadata.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: 2 -models: - - name: price__dim_asset_metadata - description: '{{ doc("prices_dim_asset_metadata_table_doc") }}' - - columns: - - name: PROVIDER - description: '{{ doc("prices_provider")}}' - - name: ASSET_ID - description: '{{ doc("prices_asset_id") }}' - - name: NAME - description: '{{ doc("prices_name") }}' - - name: SYMBOL - description: '{{ doc("prices_symbol") }}' - - name: TOKEN_ADDRESS - description: '{{ doc("prices_token_address_evm") }}' - - name: BLOCKCHAIN - description: '{{ doc("prices_blockchain") }}' - - name: BLOCKCHAIN_ID - description: '{{ doc("prices_blockchain_id") }}' - - name: DIM_ASSET_METADATA_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/price/price__ez_asset_metadata.sql b/models/gold/price/price__ez_asset_metadata.sql deleted file mode 100644 index f8c8f8bd..00000000 --- a/models/gold/price/price__ez_asset_metadata.sql +++ /dev/null @@ -1,35 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - token_address, - asset_id, - symbol, - NAME, - decimals, - blockchain, - FALSE AS is_native, - is_deprecated, - inserted_timestamp, - modified_timestamp, - complete_token_asset_metadata_id AS ez_asset_metadata_id -FROM - {{ ref('silver__complete_token_asset_metadata') }} -UNION ALL -SELECT - NULL AS token_address, - asset_id, - symbol, - NAME, - decimals, - blockchain, - TRUE AS is_native, - is_deprecated, - inserted_timestamp, - modified_timestamp, - complete_native_asset_metadata_id AS ez_asset_metadata_id -FROM - {{ ref('silver__complete_native_asset_metadata') }} diff --git a/models/gold/price/price__ez_asset_metadata.yml b/models/gold/price/price__ez_asset_metadata.yml deleted file mode 100644 index 57088a9b..00000000 --- a/models/gold/price/price__ez_asset_metadata.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: 2 -models: - - name: price__ez_asset_metadata - description: '{{ doc("prices_ez_asset_metadata_table_doc") }}' - - columns: - - name: ASSET_ID - description: '{{ doc("prices_asset_id") }}' - - name: NAME - description: '{{ doc("prices_name") }}' - - name: SYMBOL - description: '{{ doc("prices_symbol") }}' - - name: TOKEN_ADDRESS - description: '{{ doc("prices_token_address_evm") }}' - - name: BLOCKCHAIN - description: '{{ doc("prices_blockchain") }}' - - name: DECIMALS - description: '{{ doc("prices_decimals") }}' - - name: IS_NATIVE - description: '{{ doc("prices_is_native") }}' - - name: IS_DEPRECATED - description: '{{ doc("prices_is_deprecated") }}' - - name: EZ_ASSET_METADATA_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' - \ No newline at end of file diff --git a/models/gold/price/price__ez_prices_hourly.sql b/models/gold/price/price__ez_prices_hourly.sql deleted file mode 100644 index dfda724e..00000000 --- a/models/gold/price/price__ez_prices_hourly.sql +++ /dev/null @@ -1,39 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - HOUR, - token_address, - symbol, - NAME, - decimals, - price, - blockchain, - FALSE AS is_native, - is_imputed, - is_deprecated, - inserted_timestamp, - modified_timestamp, - complete_token_prices_id AS ez_prices_hourly_id -FROM - {{ ref('silver__complete_token_prices') }} -UNION ALL -SELECT - HOUR, - NULL AS token_address, - symbol, - NAME, - decimals, - price, - blockchain, - TRUE AS is_native, - is_imputed, - is_deprecated, - inserted_timestamp, - modified_timestamp, - complete_native_prices_id AS ez_prices_hourly_id -FROM - {{ ref('silver__complete_native_prices') }} diff --git a/models/gold/price/price__ez_prices_hourly.yml b/models/gold/price/price__ez_prices_hourly.yml deleted file mode 100644 index 96cf4e5e..00000000 --- a/models/gold/price/price__ez_prices_hourly.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 2 -models: - - name: price__ez_prices_hourly - description: '{{ doc("prices_ez_prices_hourly_table_doc") }}' - - columns: - - name: HOUR - description: '{{ doc("prices_hour")}}' - - name: TOKEN_ADDRESS - description: '{{ doc("prices_token_address_evm") }}' - - name: SYMBOL - description: '{{ doc("prices_symbol") }}' - - name: BLOCKCHAIN - description: '{{ doc("prices_blockchain") }}' - - name: DECIMALS - description: '{{ doc("prices_decimals") }}' - - name: PRICE - description: '{{ doc("prices_price") }}' - - name: IS_NATIVE - description: '{{ doc("prices_is_native") }}' - - name: IS_IMPUTED - description: '{{ doc("prices_is_imputed") }}' - - name: IS_DEPRECATED - description: '{{ doc("prices_is_deprecated") }}' - - name: EZ_PRICES_HOURLY_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/price/price__fact_prices_ohlc_hourly.sql b/models/gold/price/price__fact_prices_ohlc_hourly.sql deleted file mode 100644 index 2be7d759..00000000 --- a/models/gold/price/price__fact_prices_ohlc_hourly.sql +++ /dev/null @@ -1,19 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - asset_id, - recorded_hour AS HOUR, - OPEN, - high, - low, - CLOSE, - provider, - inserted_timestamp, - modified_timestamp, - complete_provider_prices_id AS fact_prices_ohlc_hourly_id -FROM - {{ ref('silver__complete_provider_prices') }} diff --git a/models/gold/price/price__fact_prices_ohlc_hourly.yml b/models/gold/price/price__fact_prices_ohlc_hourly.yml deleted file mode 100644 index 29ff0457..00000000 --- a/models/gold/price/price__fact_prices_ohlc_hourly.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: 2 -models: - - name: price__fact_prices_ohlc_hourly - description: '{{ doc("prices_fact_prices_ohlc_hourly_table_doc") }}' - - columns: - - name: HOUR - description: '{{ doc("prices_hour")}}' - - name: ASSET_ID - description: '{{ doc("prices_asset_id") }}' - - name: OPEN - description: '{{ doc("prices_open") }}' - - name: HIGH - description: '{{ doc("prices_high") }}' - - name: LOW - description: '{{ doc("prices_low") }}' - - name: CLOSE - description: '{{ doc("prices_close") }}' - - name: FACT_PRICES_OHLC_HOURLY_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/chainlink/chainlink__dim_oracle_feeds.sql b/models/gold/protocols/chainlink/chainlink__dim_oracle_feeds.sql deleted file mode 100644 index a6de446c..00000000 --- a/models/gold/protocols/chainlink/chainlink__dim_oracle_feeds.sql +++ /dev/null @@ -1,36 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'CHAINLINK', - 'PURPOSE': 'ORACLE' - } - } - } -) }} - -SELECT - feed_address, - feed_name, - feed_category, - feed_added_date, - created_block_number, - COALESCE ( - chainlink_feed_details_id, - {{ dbt_utils.generate_surrogate_key( - ['feed_address'] - ) }} - ) AS dim_oracle_feeds_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__chainlink_feed_details') }} diff --git a/models/gold/protocols/chainlink/chainlink__dim_oracle_feeds.yml b/models/gold/protocols/chainlink/chainlink__dim_oracle_feeds.yml deleted file mode 100644 index 0b4d6268..00000000 --- a/models/gold/protocols/chainlink/chainlink__dim_oracle_feeds.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: 2 -models: - - name: chainlink__dim_oracle_feeds - description: Deprecating soon! This table will be removed on December 9th, 2024 and is no longer updated. - - columns: - - name: FEED_ADDRESS - description: "The address of the feed contract." - - name: FEED_NAME - description: "The name of the feed contract." - - name: FEED_CATEGORY - description: "The category of the feed contract." - - name: FEED_ADDED_DATE - description: "The date the feed was added to the Chainlink network." - - name: CREATED_BLOCK_NUMBER - description: "The block number at which the feed was created." - - name: DIM_ORACLE_FEEDS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' diff --git a/models/gold/protocols/chainlink/chainlink__ez_oracle_feeds.sql b/models/gold/protocols/chainlink/chainlink__ez_oracle_feeds.sql deleted file mode 100644 index 50588e04..00000000 --- a/models/gold/protocols/chainlink/chainlink__ez_oracle_feeds.sql +++ /dev/null @@ -1,53 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'CHAINLINK', - 'PURPOSE': 'ORACLE' - } - } - } -) }} - -SELECT - contract_address AS feed_address, - A.block_number, - block_timestamp, - feed_name, - read_result AS latest_answer_unadj, - latest_answer_unadj / pow( - 10, - decimals - ) AS latest_answer_adj, - feed_category, - feed_added AS feed_added_date, - created_block_number, - COALESCE ( - chainlink_feeds_id, - {{ dbt_utils.generate_surrogate_key( - ['a.block_number', 'contract_address'] - ) }} - ) AS ez_oracle_feeds_id, - greatest( - a.inserted_timestamp, - b.inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - greatest( - a.modified_timestamp, - b.modified_timestamp, - '2000-01-01' - ) AS modified_timestamp - -FROM - {{ ref('silver__chainlink_feeds') }} A - JOIN {{ ref('silver__chainlink_feeds_seed') }} - ON contract_address = feed_address - JOIN {{ ref('silver__contracts') }} - ON contract_address = address - JOIN {{ ref('core__fact_blocks') }} - b - ON A.block_number = b.block_number diff --git a/models/gold/protocols/chainlink/chainlink__ez_oracle_feeds.yml b/models/gold/protocols/chainlink/chainlink__ez_oracle_feeds.yml deleted file mode 100644 index 1c36e155..00000000 --- a/models/gold/protocols/chainlink/chainlink__ez_oracle_feeds.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 2 -models: - - name: chainlink__ez_oracle_feeds - description: Deprecating soon! This table will be removed on December 9th, 2024 and is no longer updated. - - columns: - - name: FEED_ADDRESS - description: "The address of the feed contract." - - name: BLOCK_NUMBER - description: "The block number at which the feed was read." - - name: BLOCK_TIMESTAMP - description: "The timestamp of the block at which the feed was read." - - name: FEED_NAME - description: "The name of the feed contract." - - name: LATEST_ANSWER_UNADJ - description: "The latest answer from the feed, unadjusted." - - name: LATEST_ANSWER_ADJ - description: "The latest answer from the feed, adjusted." - - name: FEED_CATEGORY - description: "The category of the feed contract." - - name: FEED_ADDED_DATE - description: "The date the feed was added to the Chainlink network." - - name: CREATED_BLOCK_NUMBER - description: "The block number at which the feed was created." - - name: EZ_ORACLE_FEEDS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' diff --git a/models/gold/protocols/chainlink/chainlink__fact_oracle_feeds.sql b/models/gold/protocols/chainlink/chainlink__fact_oracle_feeds.sql deleted file mode 100644 index 29ab66b1..00000000 --- a/models/gold/protocols/chainlink/chainlink__fact_oracle_feeds.sql +++ /dev/null @@ -1,34 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'CHAINLINK', - 'PURPOSE': 'ORACLE' - } - } - } -) }} - -SELECT - contract_address AS feed_address, - block_number, - read_result AS latest_answer, - COALESCE ( - chainlink_feeds_id, - {{ dbt_utils.generate_surrogate_key( - ['block_number', 'contract_address'] - ) }} - ) AS fact_oracle_feeds_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__chainlink_feeds') }} diff --git a/models/gold/protocols/chainlink/chainlink__fact_oracle_feeds.yml b/models/gold/protocols/chainlink/chainlink__fact_oracle_feeds.yml deleted file mode 100644 index ef95a0de..00000000 --- a/models/gold/protocols/chainlink/chainlink__fact_oracle_feeds.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: 2 -models: - - name: chainlink__fact_oracle_feeds - description: Deprecating soon! This table will be removed on December 9th, 2024 and is no longer updated. - columns: - - name: FEED_ADDRESS - description: "The address of the feed contract." - - name: BLOCK_NUMBER - description: "The block number at which the feed was read." - - name: LATEST_ANSWER - description: "The latest answer from the feed. Note, this is not decimal adjusted." - - name: FACT_ORACLE_FEEDS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' diff --git a/models/gold/protocols/ens/ens__ez_ens_domains.sql b/models/gold/protocols/ens/ens__ez_ens_domains.sql index 9b37c749..ff24876f 100644 --- a/models/gold/protocols/ens/ens__ez_ens_domains.sql +++ b/models/gold/protocols/ens/ens__ez_ens_domains.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'ENS', - 'PURPOSE': 'NFT, DOMAINS' } } } + 'PURPOSE': 'NFT, DOMAINS' } } }, + tags = ['gold','ens','curated','ez'] ) }} SELECT diff --git a/models/gold/protocols/ens/ens__ez_ens_domains.yml b/models/gold/protocols/ens/ens__ez_ens_domains.yml index a5d104f4..b78a6b5f 100644 --- a/models/gold/protocols/ens/ens__ez_ens_domains.yml +++ b/models/gold/protocols/ens/ens__ez_ens_domains.yml @@ -46,8 +46,8 @@ models: - name: LAST_UPDATED description: The timestamp of the last update made to the domain's record or last updated record in this table. - name: EZ_ENS_DOMAINS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/ens/ens__fact_dao_votes.sql b/models/gold/protocols/ens/ens__fact_dao_votes.sql index 958fb09e..e649f493 100644 --- a/models/gold/protocols/ens/ens__fact_dao_votes.sql +++ b/models/gold/protocols/ens/ens__fact_dao_votes.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'ENS', - 'PURPOSE': 'NFT, DOMAINS' } } } + 'PURPOSE': 'NFT, DOMAINS' } } }, + tags = ['gold','ens','curated'] ) }} SELECT diff --git a/models/gold/protocols/ens/ens__fact_dao_votes.yml b/models/gold/protocols/ens/ens__fact_dao_votes.yml index 8d787748..a323e190 100644 --- a/models/gold/protocols/ens/ens__fact_dao_votes.yml +++ b/models/gold/protocols/ens/ens__fact_dao_votes.yml @@ -4,23 +4,23 @@ models: description: A fact based table containing ENS DAO voting records, derived from decoded event logs. columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: PROPOSALID description: A unique identifier for the specific proposal that was voted upon. - name: REASON @@ -36,8 +36,8 @@ models: - name: VOTING_POWER_PCT description: The percentage of total voting power represented by the voter's votes. - name: FACT_DAO_VOTES_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/ens/ens__fact_registrations.sql b/models/gold/protocols/ens/ens__fact_registrations.sql index 6257cdc9..8bdfe121 100644 --- a/models/gold/protocols/ens/ens__fact_registrations.sql +++ b/models/gold/protocols/ens/ens__fact_registrations.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'ENS', - 'PURPOSE': 'NFT, DOMAINS' } } } + 'PURPOSE': 'NFT, DOMAINS' } } }, + tags = ['gold','ens','curated'] ) }} SELECT diff --git a/models/gold/protocols/ens/ens__fact_registrations.yml b/models/gold/protocols/ens/ens__fact_registrations.yml index 8a10a967..0d7f296f 100644 --- a/models/gold/protocols/ens/ens__fact_registrations.yml +++ b/models/gold/protocols/ens/ens__fact_registrations.yml @@ -4,23 +4,23 @@ models: description: A fact based table containing ENS domain registration records, derived from decoded event logs. columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: MANAGER description: The address responsible for managing the domain. - name: OWNER @@ -42,8 +42,8 @@ models: - name: EXPIRES_TIMESTAMP description: The timestamp indicating the expiration of the ENS domain registration. - name: FACT_REGISTRATIONS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/ens/ens__fact_renewals.sql b/models/gold/protocols/ens/ens__fact_renewals.sql index f529c011..f8a01722 100644 --- a/models/gold/protocols/ens/ens__fact_renewals.sql +++ b/models/gold/protocols/ens/ens__fact_renewals.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'ENS', - 'PURPOSE': 'NFT, DOMAINS' } } } + 'PURPOSE': 'NFT, DOMAINS' } } }, + tags = ['gold','ens','curated'] ) }} SELECT diff --git a/models/gold/protocols/ens/ens__fact_renewals.yml b/models/gold/protocols/ens/ens__fact_renewals.yml index 3181ec2f..6e283359 100644 --- a/models/gold/protocols/ens/ens__fact_renewals.yml +++ b/models/gold/protocols/ens/ens__fact_renewals.yml @@ -4,23 +4,23 @@ models: description: A fact based table containing ENS domain renewal records, derived from decoded event logs. columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: MANAGER description: The address responsible for managing the domain. - name: NAME @@ -32,8 +32,8 @@ models: - name: EXPIRES_TIMESTAMP description: The timestamp indicating the expiration of the ENS domain registration. - name: FACT_RENEWALS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/ens/ens__fact_transfers.sql b/models/gold/protocols/ens/ens__fact_transfers.sql index 73f63c83..4d53284e 100644 --- a/models/gold/protocols/ens/ens__fact_transfers.sql +++ b/models/gold/protocols/ens/ens__fact_transfers.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'ENS', - 'PURPOSE': 'NFT, DOMAINS' } } } + 'PURPOSE': 'NFT, DOMAINS' } } }, + tags = ['gold','ens','curated'] ) }} SELECT diff --git a/models/gold/protocols/ens/ens__fact_transfers.yml b/models/gold/protocols/ens/ens__fact_transfers.yml index 8b22c4ac..9e567dc5 100644 --- a/models/gold/protocols/ens/ens__fact_transfers.yml +++ b/models/gold/protocols/ens/ens__fact_transfers.yml @@ -4,23 +4,23 @@ models: description: A fact based table containing ENS domain transfer events, derived from decoded event logs. columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: EVENT_NAME - description: '{{ doc("eth_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: OPERATOR description: The address that initiated the transfer. - name: FROM_ADDRESS @@ -30,8 +30,8 @@ models: - name: TOKEN_ID description: The ID of the token associated with the domain. - name: FACT_TRANSFERS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_cat_bite.sql b/models/gold/protocols/maker/fact/maker__fact_cat_bite.sql index c1be5f01..af56b129 100644 --- a/models/gold/protocols/maker/fact/maker__fact_cat_bite.sql +++ b/models/gold/protocols/maker/fact/maker__fact_cat_bite.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_cat_bite.yml b/models/gold/protocols/maker/fact/maker__fact_cat_bite.yml index 1b4a82d6..bb40a097 100644 --- a/models/gold/protocols/maker/fact/maker__fact_cat_bite.yml +++ b/models/gold/protocols/maker/fact/maker__fact_cat_bite.yml @@ -1,38 +1,38 @@ version: 2 models: - name: maker__fact_cat_bite - description: '{{ doc("maker_fact_cat_bite") }}' + description: '{{ doc("evm_maker_fact_cat_bite") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: ILK - description: '{{ doc("maker_ilk") }}' + description: '{{ doc("evm_maker_ilk") }}' - name: URN_ADDRESS - description: '{{ doc("maker_urn_address") }}' + description: '{{ doc("evm_maker_urn_address") }}' - name: ART - description: '{{ doc("maker_art") }}' + description: '{{ doc("evm_maker_art") }}' - name: INK - description: '{{ doc("maker_ink") }}' + description: '{{ doc("evm_maker_ink") }}' - name: TAB - description: '{{ doc("maker_tab") }}' + description: '{{ doc("evm_maker_tab") }}' - name: ID - description: '{{ doc("maker_id") }}' + description: '{{ doc("evm_maker_id") }}' - name: FACT_CAT_BITE_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_cdp_flux.sql b/models/gold/protocols/maker/fact/maker__fact_cdp_flux.sql index 7f24b68e..792d9fc7 100644 --- a/models/gold/protocols/maker/fact/maker__fact_cdp_flux.sql +++ b/models/gold/protocols/maker/fact/maker__fact_cdp_flux.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_cdp_flux.yml b/models/gold/protocols/maker/fact/maker__fact_cdp_flux.yml index 81513998..b8a59e97 100644 --- a/models/gold/protocols/maker/fact/maker__fact_cdp_flux.yml +++ b/models/gold/protocols/maker/fact/maker__fact_cdp_flux.yml @@ -1,30 +1,30 @@ version: 2 models: - name: maker__fact_cdp_flux - description: '{{ doc("maker_fact_cdp_flux") }}' + description: '{{ doc("evm_maker_fact_cdp_flux") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: USR - name: CDP - description: '{{ doc("maker_cdp") }}' + description: '{{ doc("evm_maker_cdp") }}' - name: DST - name: WAD - name: FACT_CDP_FLUX_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_cdp_frob.sql b/models/gold/protocols/maker/fact/maker__fact_cdp_frob.sql index afd6359f..7b207a1b 100644 --- a/models/gold/protocols/maker/fact/maker__fact_cdp_frob.sql +++ b/models/gold/protocols/maker/fact/maker__fact_cdp_frob.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_cdp_frob.yml b/models/gold/protocols/maker/fact/maker__fact_cdp_frob.yml index 3a418a76..9a6f69ae 100644 --- a/models/gold/protocols/maker/fact/maker__fact_cdp_frob.yml +++ b/models/gold/protocols/maker/fact/maker__fact_cdp_frob.yml @@ -1,32 +1,32 @@ version: 2 models: - name: maker__fact_cdp_frob - description: '{{ doc("maker_fact_cdp_frob") }}' + description: '{{ doc("evm_maker_fact_cdp_frob") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: USR - name: CDP - description: '{{ doc("maker_cdp") }}' + description: '{{ doc("evm_maker_cdp") }}' - name: DINK - description: '{{ doc("maker_vat_frob_dink") }}' + description: '{{ doc("evm_maker_vat_frob_dink") }}' - name: DART - description: '{{ doc("maker_vat_frob_dart") }}' + description: '{{ doc("evm_maker_vat_frob_dart") }}' - name: FACT_CDP_FROB_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_cdp_move.sql b/models/gold/protocols/maker/fact/maker__fact_cdp_move.sql index 5843636c..0467c769 100644 --- a/models/gold/protocols/maker/fact/maker__fact_cdp_move.sql +++ b/models/gold/protocols/maker/fact/maker__fact_cdp_move.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_cdp_move.yml b/models/gold/protocols/maker/fact/maker__fact_cdp_move.yml index 5900076d..c42110d0 100644 --- a/models/gold/protocols/maker/fact/maker__fact_cdp_move.yml +++ b/models/gold/protocols/maker/fact/maker__fact_cdp_move.yml @@ -1,31 +1,31 @@ version: 2 models: - name: maker__fact_cdp_move - description: '{{ doc("maker_fact_cdp_move") }}' + description: '{{ doc("evm_maker_fact_cdp_move") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: USR - name: CDP - description: '{{ doc("maker_cdp") }}' + description: '{{ doc("evm_maker_cdp") }}' - name: DST - name: RAD - description: '{{ doc("maker_rad") }}' + description: '{{ doc("evm_maker_rad") }}' - name: FACT_CDP_MOVE_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_cdp_newcdp.sql b/models/gold/protocols/maker/fact/maker__fact_cdp_newcdp.sql index 8bacb168..652c1fb5 100644 --- a/models/gold/protocols/maker/fact/maker__fact_cdp_newcdp.sql +++ b/models/gold/protocols/maker/fact/maker__fact_cdp_newcdp.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_cdp_newcdp.yml b/models/gold/protocols/maker/fact/maker__fact_cdp_newcdp.yml index 42652c58..2f8262da 100644 --- a/models/gold/protocols/maker/fact/maker__fact_cdp_newcdp.yml +++ b/models/gold/protocols/maker/fact/maker__fact_cdp_newcdp.yml @@ -1,27 +1,27 @@ version: 2 models: - name: maker__fact_cdp_newcdp - description: '{{ doc("maker_fact_cdp_newcdp") }}' + description: '{{ doc("evm_maker_fact_cdp_newcdp") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: USR - name: OWN - name: FACT_CDP_NEWCDP_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_dai_join_exit.sql b/models/gold/protocols/maker/fact/maker__fact_dai_join_exit.sql index 6bd09f21..9158c9ba 100644 --- a/models/gold/protocols/maker/fact/maker__fact_dai_join_exit.sql +++ b/models/gold/protocols/maker/fact/maker__fact_dai_join_exit.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_dai_join_exit.yml b/models/gold/protocols/maker/fact/maker__fact_dai_join_exit.yml index ec2f3e73..52f2e8a9 100644 --- a/models/gold/protocols/maker/fact/maker__fact_dai_join_exit.yml +++ b/models/gold/protocols/maker/fact/maker__fact_dai_join_exit.yml @@ -1,28 +1,28 @@ version: 2 models: - name: maker__fact_dai_join_exit - description: '{{ doc("maker_fact_dai_join_exit") }}' + description: '{{ doc("evm_maker_fact_dai_join_exit") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: USR1 - name: USR2 - name: WAD - name: FACT_DAI_JOIN_EXIT_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_dai_join_join.sql b/models/gold/protocols/maker/fact/maker__fact_dai_join_join.sql index f788471c..a7aa1650 100644 --- a/models/gold/protocols/maker/fact/maker__fact_dai_join_join.sql +++ b/models/gold/protocols/maker/fact/maker__fact_dai_join_join.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_dai_join_join.yml b/models/gold/protocols/maker/fact/maker__fact_dai_join_join.yml index a6182065..d5f87e57 100644 --- a/models/gold/protocols/maker/fact/maker__fact_dai_join_join.yml +++ b/models/gold/protocols/maker/fact/maker__fact_dai_join_join.yml @@ -1,28 +1,28 @@ version: 2 models: - name: maker__fact_dai_join_join - description: '{{ doc("maker_fact_dai_join_join") }}' + description: '{{ doc("evm_maker_fact_dai_join_join") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: USR1 - name: USR2 - name: WAD - name: FACT_DAI_JOIN_JOIN_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_dog_bark.sql b/models/gold/protocols/maker/fact/maker__fact_dog_bark.sql index e66345c0..b943b880 100644 --- a/models/gold/protocols/maker/fact/maker__fact_dog_bark.sql +++ b/models/gold/protocols/maker/fact/maker__fact_dog_bark.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_dog_bark.yml b/models/gold/protocols/maker/fact/maker__fact_dog_bark.yml index bd06b90f..257fc8ce 100644 --- a/models/gold/protocols/maker/fact/maker__fact_dog_bark.yml +++ b/models/gold/protocols/maker/fact/maker__fact_dog_bark.yml @@ -1,37 +1,37 @@ version: 2 models: - name: maker__fact_dog_bark - description: '{{ doc("maker_fact_dog_bark") }}' + description: '{{ doc("evm_maker_fact_dog_bark") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: ILK - description: '{{ doc("maker_ilk") }}' + description: '{{ doc("evm_maker_ilk") }}' - name: URN_ADDRESS - description: '{{ doc("maker_urn_address") }}' + description: '{{ doc("evm_maker_urn_address") }}' - name: ART - description: '{{ doc("maker_art") }}' + description: '{{ doc("evm_maker_art") }}' - name: INK - description: '{{ doc("maker_ink") }}' + description: '{{ doc("evm_maker_ink") }}' - name: DUE - description: '{{ doc("maker_tab") }}' + description: '{{ doc("evm_maker_tab") }}' - name: CLIP - name: ID - name: FACT_DOG_BARK_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_dss_flashloan.sql b/models/gold/protocols/maker/fact/maker__fact_dss_flashloan.sql index 508681ba..74aa5926 100644 --- a/models/gold/protocols/maker/fact/maker__fact_dss_flashloan.sql +++ b/models/gold/protocols/maker/fact/maker__fact_dss_flashloan.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_dss_flashloan.yml b/models/gold/protocols/maker/fact/maker__fact_dss_flashloan.yml index cbe77262..466a84a3 100644 --- a/models/gold/protocols/maker/fact/maker__fact_dss_flashloan.yml +++ b/models/gold/protocols/maker/fact/maker__fact_dss_flashloan.yml @@ -3,26 +3,26 @@ models: - name: maker__fact_dss_flashloan columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: RECEIVER - name: TOKEN - name: AMOUNT - name: FEE - name: FACT_DSS_FLASHLOAN_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_pot_exit.sql b/models/gold/protocols/maker/fact/maker__fact_pot_exit.sql index 82b6204e..df01dd66 100644 --- a/models/gold/protocols/maker/fact/maker__fact_pot_exit.sql +++ b/models/gold/protocols/maker/fact/maker__fact_pot_exit.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_pot_exit.yml b/models/gold/protocols/maker/fact/maker__fact_pot_exit.yml index c8853496..72a5a3b4 100644 --- a/models/gold/protocols/maker/fact/maker__fact_pot_exit.yml +++ b/models/gold/protocols/maker/fact/maker__fact_pot_exit.yml @@ -1,27 +1,27 @@ version: 2 models: - name: maker__fact_pot_exit - description: '{{ doc("maker_fact_pot_exit") }}' + description: '{{ doc("evm_maker_fact_pot_exit") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: WAD - name: USR - name: FACT_POT_EXIT_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_pot_join.sql b/models/gold/protocols/maker/fact/maker__fact_pot_join.sql index 7648fd70..660bfef8 100644 --- a/models/gold/protocols/maker/fact/maker__fact_pot_join.sql +++ b/models/gold/protocols/maker/fact/maker__fact_pot_join.sql @@ -1,7 +1,8 @@ {{ config( materialized = 'view', persist_docs ={ "relation": true, - "columns": true } + "columns": true }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_pot_join.yml b/models/gold/protocols/maker/fact/maker__fact_pot_join.yml index fc0eba59..617eb033 100644 --- a/models/gold/protocols/maker/fact/maker__fact_pot_join.yml +++ b/models/gold/protocols/maker/fact/maker__fact_pot_join.yml @@ -1,27 +1,27 @@ version: 2 models: - name: maker__fact_pot_join - description: '{{ doc("maker_fact_pot_join") }}' + description: '{{ doc("evm_maker_fact_pot_join") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: WAD - name: USR - name: FACT_POT_JOIN_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_urns.sql b/models/gold/protocols/maker/fact/maker__fact_urns.sql index 58332c42..e334ff10 100644 --- a/models/gold/protocols/maker/fact/maker__fact_urns.sql +++ b/models/gold/protocols/maker/fact/maker__fact_urns.sql @@ -1,7 +1,8 @@ {{ config( materialized = 'view', persist_docs ={ "relation": true, - "columns": true } + "columns": true }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_urns.yml b/models/gold/protocols/maker/fact/maker__fact_urns.yml index 777ae64b..61e4b710 100644 --- a/models/gold/protocols/maker/fact/maker__fact_urns.yml +++ b/models/gold/protocols/maker/fact/maker__fact_urns.yml @@ -1,18 +1,18 @@ version: 2 models: - name: maker__fact_urns - description: '{{ doc("maker_fact_urns") }}' + description: '{{ doc("evm_maker_fact_urns") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: VAULT_NUMBER - name: URN_ADDRESS - description: '{{ doc("maker_urn_address") }}' + description: '{{ doc("evm_maker_urn_address") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: FACT_URNS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_file.sql b/models/gold/protocols/maker/fact/maker__fact_vat_file.sql index 3261bdcd..644025b5 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_file.sql +++ b/models/gold/protocols/maker/fact/maker__fact_vat_file.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_file.yml b/models/gold/protocols/maker/fact/maker__fact_vat_file.yml index f86b9435..744990e7 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_file.yml +++ b/models/gold/protocols/maker/fact/maker__fact_vat_file.yml @@ -1,29 +1,29 @@ version: 2 models: - name: maker__fact_vat_file - description: '{{ doc("maker_fact_vat_file") }}' + description: '{{ doc("evm_maker_fact_vat_file") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: ILK - description: '{{ doc("maker_ilk") }}' + description: '{{ doc("evm_maker_ilk") }}' - name: WHAT - name: DATA - name: FACT_CAT_BITE_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_flux.sql b/models/gold/protocols/maker/fact/maker__fact_vat_flux.sql index 11d89ae6..bceb15fc 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_flux.sql +++ b/models/gold/protocols/maker/fact/maker__fact_vat_flux.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_flux.yml b/models/gold/protocols/maker/fact/maker__fact_vat_flux.yml index 6a352b6b..e2f72b46 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_flux.yml +++ b/models/gold/protocols/maker/fact/maker__fact_vat_flux.yml @@ -1,31 +1,31 @@ version: 2 models: - name: maker__fact_vat_flux - description: '{{ doc("maker_fact_vat_flux") }}' + description: '{{ doc("evm_maker_fact_vat_flux") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: ILK - description: '{{ doc("maker_ilk") }}' + description: '{{ doc("evm_maker_ilk") }}' - name: RECEIVER - name: SENDER - name: WAD - name: FACT_VAT_FLUX_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_fold.sql b/models/gold/protocols/maker/fact/maker__fact_vat_fold.sql index 1d550f34..afd149cf 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_fold.sql +++ b/models/gold/protocols/maker/fact/maker__fact_vat_fold.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_fold.yml b/models/gold/protocols/maker/fact/maker__fact_vat_fold.yml index fadfe136..0ff47029 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_fold.yml +++ b/models/gold/protocols/maker/fact/maker__fact_vat_fold.yml @@ -3,28 +3,28 @@ models: - name: maker__fact_vat_fold columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: ILK - description: '{{ doc("maker_ilk") }}' + description: '{{ doc("evm_maker_ilk") }}' - name: U - name: RATE - description: '{{ doc("maker_rate") }}' + description: '{{ doc("evm_maker_rate") }}' - name: FACT_VAT_FOLD_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_fork.sql b/models/gold/protocols/maker/fact/maker__fact_vat_fork.sql index e76c0688..6dcca48a 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_fork.sql +++ b/models/gold/protocols/maker/fact/maker__fact_vat_fork.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_fork.yml b/models/gold/protocols/maker/fact/maker__fact_vat_fork.yml index 58415fc3..f622b95b 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_fork.yml +++ b/models/gold/protocols/maker/fact/maker__fact_vat_fork.yml @@ -1,34 +1,34 @@ version: 2 models: - name: maker__fact_vat_fork - description: '{{ doc("maker_fact_vat_fork") }}' + description: '{{ doc("evm_maker_fact_vat_fork") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: ILK - description: '{{ doc("maker_ilk") }}' + description: '{{ doc("evm_maker_ilk") }}' - name: SRC - name: DST - name: DINK - description: '{{ doc("maker_vat_fork_dink") }}' + description: '{{ doc("evm_maker_vat_fork_dink") }}' - name: DART - description: '{{ doc("maker_vat_fork_dart") }}' + description: '{{ doc("evm_maker_vat_fork_dart") }}' - name: FACT_VAT_FORK_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_frob.sql b/models/gold/protocols/maker/fact/maker__fact_vat_frob.sql index 09dcd581..e16a08c2 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_frob.sql +++ b/models/gold/protocols/maker/fact/maker__fact_vat_frob.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_frob.yml b/models/gold/protocols/maker/fact/maker__fact_vat_frob.yml index 4c0ea7e1..bfe37c6f 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_frob.yml +++ b/models/gold/protocols/maker/fact/maker__fact_vat_frob.yml @@ -1,34 +1,34 @@ version: 2 models: - name: maker__fact_vat_frob - description: '{{ doc("maker_fact_vat_frob") }}' + description: '{{ doc("evm_maker_fact_vat_frob") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: ILK - description: '{{ doc("maker_ilk") }}' + description: '{{ doc("evm_maker_ilk") }}' - name: U_ADDRESS - name: V_ADDRESS - name: W_ADDRESS - name: DINK - description: '{{ doc("maker_vat_frob_dink") }}' + description: '{{ doc("evm_maker_vat_frob_dink") }}' - name: DART - description: '{{ doc("maker_vat_frob_dart") }}' + description: '{{ doc("evm_maker_vat_frob_dart") }}' - name: FACT_VAT_FROB_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_move.sql b/models/gold/protocols/maker/fact/maker__fact_vat_move.sql index 6904b169..0afac6bf 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_move.sql +++ b/models/gold/protocols/maker/fact/maker__fact_vat_move.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_move.yml b/models/gold/protocols/maker/fact/maker__fact_vat_move.yml index 57ee0dd7..c7995bcf 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_move.yml +++ b/models/gold/protocols/maker/fact/maker__fact_vat_move.yml @@ -1,30 +1,30 @@ version: 2 models: - name: maker__fact_vat_move - description: '{{ doc("maker_fact_vat_move") }}' + description: '{{ doc("evm_maker_fact_vat_move") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: SRC_ADDRESS - name: DST_ADDRESS - name: RAD - description: '{{ doc("maker_rad") }}' + description: '{{ doc("evm_maker_rad") }}' - name: FACT_VAT_MOVE_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_slip.sql b/models/gold/protocols/maker/fact/maker__fact_vat_slip.sql index 65010d2d..6f6f104c 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_slip.sql +++ b/models/gold/protocols/maker/fact/maker__fact_vat_slip.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_slip.yml b/models/gold/protocols/maker/fact/maker__fact_vat_slip.yml index 61340bbf..edbfa41f 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_slip.yml +++ b/models/gold/protocols/maker/fact/maker__fact_vat_slip.yml @@ -1,29 +1,29 @@ version: 2 models: - name: maker__fact_vat_slip - description: '{{ doc("maker_fact_vat_slip") }}' + description: '{{ doc("evm_maker_fact_vat_slip") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: ILK - description: '{{ doc("maker_ilk") }}' + description: '{{ doc("evm_maker_ilk") }}' - name: USR - name: WAD - name: FACT_VAT_SLIP_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_suck.sql b/models/gold/protocols/maker/fact/maker__fact_vat_suck.sql index f25b03d5..6de91b18 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_suck.sql +++ b/models/gold/protocols/maker/fact/maker__fact_vat_suck.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'MAKER, MKR', - 'PURPOSE': 'GOVERNANCE, DEFI' } } } + 'PURPOSE': 'GOVERNANCE, DEFI' } } }, + tags = ['gold','maker','curated'] ) }} SELECT diff --git a/models/gold/protocols/maker/fact/maker__fact_vat_suck.yml b/models/gold/protocols/maker/fact/maker__fact_vat_suck.yml index 8ce81cc2..af3afceb 100644 --- a/models/gold/protocols/maker/fact/maker__fact_vat_suck.yml +++ b/models/gold/protocols/maker/fact/maker__fact_vat_suck.yml @@ -1,28 +1,28 @@ version: 2 models: - name: maker__fact_vat_suck - description: '{{ doc("maker_fact_vat_suck") }}' + description: '{{ doc("evm_maker_fact_vat_suck") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("eth_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("eth_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("eth_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("eth_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: U_ADDRESS - name: V_ADDRESS - name: RAD - name: FACT_VAT_SUCK_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/protocols/uniswapv3/uniswapv3__ez_lp_actions.sql b/models/gold/protocols/uniswapv3/uniswapv3__ez_lp_actions.sql index 61347bb8..2c57c4a9 100644 --- a/models/gold/protocols/uniswapv3/uniswapv3__ez_lp_actions.sql +++ b/models/gold/protocols/uniswapv3/uniswapv3__ez_lp_actions.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'DEFI, DEX' } } - } + }, + tags = ['gold','uniswap','curated'] ) }} SELECT diff --git a/models/gold/protocols/uniswapv3/uniswapv3__ez_lp_actions.yml b/models/gold/protocols/uniswapv3/uniswapv3__ez_lp_actions.yml index 63c9d310..5de24a6f 100644 --- a/models/gold/protocols/uniswapv3/uniswapv3__ez_lp_actions.yml +++ b/models/gold/protocols/uniswapv3/uniswapv3__ez_lp_actions.yml @@ -1,80 +1,80 @@ version: 2 models: - name: uniswapv3__ez_lp_actions - description: '{{ doc("lp_actions_table_doc") }}' + description: '{{ doc("evm_lp_actions_table_doc") }}' columns: - name: BLOCKCHAIN - description: '{{ doc("eth_blockchain") }}' + description: '{{ doc("evm_blockchain") }}' - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_transfer_tx_hash") }}' + description: '{{ doc("evm_transfer_tx_hash") }}' - name: ACTION - description: '{{ doc("lp_actions_action") }}' + description: '{{ doc("evm_lp_actions_action") }}' - name: AMOUNT0_ADJUSTED - description: '{{ doc("swaps_amount0_adjusted") }}' + description: '{{ doc("evm_swaps_amount0_adjusted") }}' - name: AMOUNT1_ADJUSTED - description: '{{ doc("swaps_amount1_adjusted") }}' + description: '{{ doc("evm_swaps_amount1_adjusted") }}' - name: AMOUNT0_USD - description: '{{ doc("swaps_amount0_usd") }}' + description: '{{ doc("evm_swaps_amount0_usd") }}' - name: AMOUNT1_USD - description: '{{ doc("swaps_amount1_usd") }}' + description: '{{ doc("evm_swaps_amount1_usd") }}' - name: TOKEN0_ADDRESS - description: '{{ doc("all_token0_address") }}' + description: '{{ doc("evm_all_token0_address") }}' - name: TOKEN1_ADDRESS - description: '{{ doc("all_token0_address") }}' + description: '{{ doc("evm_all_token0_address") }}' - name: TOKEN0_SYMBOL - description: '{{ doc("all_token0_symbol") }}' + description: '{{ doc("evm_all_token0_symbol") }}' - name: TOKEN1_SYMBOL - description: '{{ doc("all_token1_symbol") }}' + description: '{{ doc("evm_all_token1_symbol") }}' - name: TOKEN0_PRICE - description: '{{ doc("all_token0_price") }}' + description: '{{ doc("evm_all_token0_price") }}' - name: TOKEN1_PRICE - description: '{{ doc("all_token1_price") }}' + description: '{{ doc("evm_all_token1_price") }}' - name: LIQUIDITY - description: '{{ doc("all_liquidity") }}' + description: '{{ doc("evm_all_liquidity") }}' - name: LIQUIDITY_ADJUSTED - description: '{{ doc("all_liquidity_adjusted") }}' + description: '{{ doc("evm_all_liquidity_adjusted") }}' - name: LIQUIDITY_PROVIDER - description: '{{ doc("positions_liquidity_provider") }}' + description: '{{ doc("evm_positions_liquidity_provider") }}' - name: NF_POSITION_MANAGER_ADDRESS - description: '{{ doc("positions_nf_position_manager_address") }}' + description: '{{ doc("evm_positions_nf_position_manager_address") }}' - name: NF_TOKEN_ID - description: '{{ doc("positions_nf_token_id") }}' + description: '{{ doc("evm_positions_nf_token_id") }}' - name: POOL_ADDRESS - description: '{{ doc("all_pool_address") }}' + description: '{{ doc("evm_all_pool_address") }}' - name: POOL_NAME - description: '{{ doc("all_pool_name") }}' + description: '{{ doc("evm_all_pool_name") }}' - name: TICK_LOWER - description: '{{ doc("positions_tick_lower") }}' + description: '{{ doc("evm_positions_tick_lower") }}' - name: TICK_UPPER - description: '{{ doc("positions_tick_upper") }}' + description: '{{ doc("evm_positions_tick_upper") }}' - name: PRICE_LOWER_1_0 - description: '{{ doc("positions_price_lower_1_0") }}' + description: '{{ doc("evm_positions_price_lower_1_0") }}' - name: PRICE_UPPER_1_0 - description: '{{ doc("positions_price_upper_1_0") }}' + description: '{{ doc("evm_positions_price_upper_1_0") }}' - name: PRICE_LOWER_0_1 - description: '{{ doc("positions_price_lower_0_1") }}' + description: '{{ doc("evm_positions_price_lower_0_1") }}' - name: PRICE_UPPER_0_1 - description: '{{ doc("positions_price_upper_0_1") }}' + description: '{{ doc("evm_positions_price_upper_0_1") }}' - name: PRICE_LOWER_1_0_USD - description: '{{ doc("positions_price_lower_1_0_usd") }}' + description: '{{ doc("evm_positions_price_lower_1_0_usd") }}' - name: PRICE_UPPER_1_0_USD - description: '{{ doc("positions_price_upper_1_0_usd") }}' + description: '{{ doc("evm_positions_price_upper_1_0_usd") }}' - name: PRICE_LOWER_0_1_USD - description: '{{ doc("positions_price_lower_0_1_usd") }}' + description: '{{ doc("evm_positions_price_lower_0_1_usd") }}' - name: PRICE_UPPER_0_1_USD - description: '{{ doc("positions_price_upper_0_1_usd") }}' + description: '{{ doc("evm_positions_price_upper_0_1_usd") }}' - name: EZ_LP_ACTIONS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' - name: _INSERTED_TIMESTAMP - description: '{{ doc("internal_column") }}' + description: '{{ doc("evm_internal_column") }}' - name: _LOG_ID - description: '{{ doc("internal_column") }}' \ No newline at end of file + description: '{{ doc("evm_internal_column") }}' \ No newline at end of file diff --git a/models/gold/protocols/uniswapv3/uniswapv3__ez_pool_stats.sql b/models/gold/protocols/uniswapv3/uniswapv3__ez_pool_stats.sql index 09196776..84305baf 100644 --- a/models/gold/protocols/uniswapv3/uniswapv3__ez_pool_stats.sql +++ b/models/gold/protocols/uniswapv3/uniswapv3__ez_pool_stats.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'UNISWAPV3', - 'PURPOSE': 'DEFI, DEX' } } } + 'PURPOSE': 'DEFI, DEX' } } }, + tags = ['gold','uniswap','curated'] ) }} SELECT diff --git a/models/gold/protocols/uniswapv3/uniswapv3__ez_pool_stats.yml b/models/gold/protocols/uniswapv3/uniswapv3__ez_pool_stats.yml index 1620ec44..563c0a74 100644 --- a/models/gold/protocols/uniswapv3/uniswapv3__ez_pool_stats.yml +++ b/models/gold/protocols/uniswapv3/uniswapv3__ez_pool_stats.yml @@ -1,68 +1,68 @@ version: 2 models: - name: uniswapv3__ez_pool_stats - description: '{{ doc("pool_stats_table_doc") }}' + description: '{{ doc("evm_pool_stats_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: BLOCKCHAIN - description: '{{ doc("eth_blockchain") }}' + description: '{{ doc("evm_blockchain") }}' - name: FEE_GROWTH_global0_X128 - description: '{{ doc("pool_stats_fee_growth_global0_x128") }}' + description: '{{ doc("evm_pool_stats_fee_growth_global0_x128") }}' - name: FEE_GROWTH_global1_X128 - description: '{{ doc("pool_stats_fee_growth_global1_x128") }}' + description: '{{ doc("evm_pool_stats_fee_growth_global1_x128") }}' - name: POOL_ADDRESS - description: '{{ doc("all_pool_address") }}' + description: '{{ doc("evm_all_pool_address") }}' - name: POOL_NAME - description: '{{ doc("all_pool_name") }}' + description: '{{ doc("evm_all_pool_name") }}' - name: PRICE_0_1 - description: '{{ doc("swaps_price_0_1") }}' + description: '{{ doc("evm_swaps_price_0_1") }}' - name: PRICE_1_0 - description: '{{ doc("swaps_price_1_0") }}' + description: '{{ doc("evm_swaps_price_1_0") }}' - name: PROTOCOL_FEES_TOKEN0_ADJUSTED - description: '{{ doc("pool_stats_protocol_fees_token0_adjusted") }}' + description: '{{ doc("evm_pool_stats_protocol_fees_token0_adjusted") }}' - name: PROTOCOL_FEES_TOKEN1_ADJUSTED - description: '{{ doc("pool_stats_protocol_fees_token1_adjusted") }}' + description: '{{ doc("evm_pool_stats_protocol_fees_token1_adjusted") }}' - name: TOKEN0_ADDRESS - description: '{{ doc("all_token0_address") }}' + description: '{{ doc("evm_all_token0_address") }}' - name: TOKEN1_ADDRESS - description: '{{ doc("all_token1_address") }}' + description: '{{ doc("evm_all_token1_address") }}' - name: TOKEN0_SYMBOL - description: '{{ doc("all_token0_symbol") }}' + description: '{{ doc("evm_all_token0_symbol") }}' - name: TOKEN1_SYMBOL - description: '{{ doc("all_token1_symbol") }}' + description: '{{ doc("evm_all_token1_symbol") }}' - name: TICK - description: '{{ doc("pool_stats_tick") }}' + description: '{{ doc("evm_pool_stats_tick") }}' - name: UNLOCKED - description: '{{ doc("pool_stats_unlocked") }}' + description: '{{ doc("evm_pool_stats_unlocked") }}' - name: VIRTUAL_LIQUIDITY_ADJUSTED - description: '{{ doc("pool_stats_virtual_liquidity_adjusted") }}' + description: '{{ doc("evm_pool_stats_virtual_liquidity_adjusted") }}' - name: VIRTUAL_RESERVES_TOKEN0_ADJUSTED - description: '{{ doc("pool_stats_virtual_reserves_token0_adjusted") }}' + description: '{{ doc("evm_pool_stats_virtual_reserves_token0_adjusted") }}' - name: VIRTUAL_RESERVES_TOKEN1_ADJUSTED - description: '{{ doc("pool_stats_virtual_reserves_token1_adjusted") }}' + description: '{{ doc("evm_pool_stats_virtual_reserves_token1_adjusted") }}' - name: VIRTUAL_RESERVES_TOKEN0_USD - description: '{{ doc("pool_stats_virtual_reserves_token0_usd") }}' + description: '{{ doc("evm_pool_stats_virtual_reserves_token0_usd") }}' - name: VIRTUAL_RESERVES_TOKEN1_USD - description: '{{ doc("pool_stats_virtual_reserves_token1_usd") }}' + description: '{{ doc("evm_pool_stats_virtual_reserves_token1_usd") }}' - name: TOKEN0_BALANCE_ADJUSTED - description: '{{ doc("pool_stats_token0_balance_adjusted") }}' + description: '{{ doc("evm_pool_stats_token0_balance_adjusted") }}' - name: TOKEN1_BALANCE_ADJUSTED - description: '{{ doc("pool_stats_token1_balance_adjusted") }}' + description: '{{ doc("evm_pool_stats_token1_balance_adjusted") }}' - name: TOKEN0_BALANCE_USD - description: '{{ doc("pool_stats_token0_balance_usd") }}' + description: '{{ doc("evm_pool_stats_token0_balance_usd") }}' - name: TOKEN1_BALANCE_USD - description: '{{ doc("pool_stats_token1_balance_usd") }}' + description: '{{ doc("evm_pool_stats_token1_balance_usd") }}' - name: TOKEN0_BALANCE - description: '{{ doc("pool_stats_token0_balance") }}' + description: '{{ doc("evm_pool_stats_token0_balance") }}' - name: TOKEN1_BALANCE - description: '{{ doc("pool_stats_token1_balance") }}' + description: '{{ doc("evm_pool_stats_token1_balance") }}' - name: EZ_POOL_STATS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/uniswapv3/uniswapv3__ez_pools.sql b/models/gold/protocols/uniswapv3/uniswapv3__ez_pools.sql index 3d5b49e8..d29d508e 100644 --- a/models/gold/protocols/uniswapv3/uniswapv3__ez_pools.sql +++ b/models/gold/protocols/uniswapv3/uniswapv3__ez_pools.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'DEFI, DEX' } } - } + }, + tags = ['gold','uniswap','curated'] ) }} SELECT diff --git a/models/gold/protocols/uniswapv3/uniswapv3__ez_pools.yml b/models/gold/protocols/uniswapv3/uniswapv3__ez_pools.yml index 1caaa4df..30f67234 100644 --- a/models/gold/protocols/uniswapv3/uniswapv3__ez_pools.yml +++ b/models/gold/protocols/uniswapv3/uniswapv3__ez_pools.yml @@ -1,53 +1,53 @@ version: 2 models: - name: uniswapv3__ez_pools - description: '{{ doc("pools_table_doc") }}' + description: '{{ doc("evm_pools_table_doc") }}' columns: - name: BLOCKCHAIN - description: '{{ doc("eth_blockchain") }}' + description: '{{ doc("evm_blockchain") }}' - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_transfer_tx_hash") }}' + description: '{{ doc("evm_transfer_tx_hash") }}' - name: FACTORY_ADDRESS - description: '{{ doc("pools_factory_address") }}' + description: '{{ doc("evm_pools_factory_address") }}' - name: FEE_PERCENT - description: '{{ doc("pools_fee_percent") }}' + description: '{{ doc("evm_pools_fee_percent") }}' - name: FEE - description: '{{ doc("pools_fee") }}' + description: '{{ doc("evm_pools_fee") }}' - name: INIT_PRICE_1_0 - description: '{{ doc("pools_init_price_1_0") }}' + description: '{{ doc("evm_pools_init_price_1_0") }}' - name: INIT_PRICE_1_0_USD - description: '{{ doc("pools_init_price_1_0_usd") }}' + description: '{{ doc("evm_pools_init_price_1_0_usd") }}' - name: INIT_TICK - description: '{{ doc("pools_init_tick") }}' + description: '{{ doc("evm_pools_init_tick") }}' - name: POOL_ADDRESS - description: '{{ doc("all_pool_address") }}' + description: '{{ doc("evm_all_pool_address") }}' - name: POOL_NAME - description: '{{ doc("all_pool_name") }}' + description: '{{ doc("evm_all_pool_name") }}' - name: TICK_SPACING - description: '{{ doc("pools_tick_spacing") }}' + description: '{{ doc("evm_pools_tick_spacing") }}' - name: TOKEN0_ADDRESS - description: '{{ doc("all_pool_address") }}' + description: '{{ doc("evm_all_pool_address") }}' - name: TOKEN1_ADDRESS - description: '{{ doc("all_pool_address") }}' + description: '{{ doc("evm_all_pool_address") }}' - name: TOKEN0_SYMBOL - description: '{{ doc("all_token0_symbol") }}' + description: '{{ doc("evm_all_token0_symbol") }}' - name: TOKEN1_SYMBOL - description: '{{ doc("all_token1_symbol") }}' + description: '{{ doc("evm_all_token1_symbol") }}' - name: TOKEN0_NAME - description: '{{ doc("all_token0_name") }}' + description: '{{ doc("evm_all_token0_name") }}' - name: TOKEN1_NAME - description: '{{ doc("all_token1_name") }}' + description: '{{ doc("evm_all_token1_name") }}' - name: TOKEN0_DECIMALS - description: '{{ doc("all_token0_decimals") }}' + description: '{{ doc("evm_all_token0_decimals") }}' - name: TOKEN1_DECIMALS - description: '{{ doc("all_token1_decimals") }}' + description: '{{ doc("evm_all_token1_decimals") }}' - name: EZ_POOLS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/uniswapv3/uniswapv3__ez_position_collected_fees.sql b/models/gold/protocols/uniswapv3/uniswapv3__ez_position_collected_fees.sql index cbed7368..bbab4817 100644 --- a/models/gold/protocols/uniswapv3/uniswapv3__ez_position_collected_fees.sql +++ b/models/gold/protocols/uniswapv3/uniswapv3__ez_position_collected_fees.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'DEFI, DEX' } } - } + }, + tags = ['gold','uniswap','curated'] ) }} SELECT diff --git a/models/gold/protocols/uniswapv3/uniswapv3__ez_position_collected_fees.yml b/models/gold/protocols/uniswapv3/uniswapv3__ez_position_collected_fees.yml index 209e1dfb..ea850c4c 100644 --- a/models/gold/protocols/uniswapv3/uniswapv3__ez_position_collected_fees.yml +++ b/models/gold/protocols/uniswapv3/uniswapv3__ez_position_collected_fees.yml @@ -1,71 +1,71 @@ version: 2 models: - name: uniswapv3__ez_position_collected_fees - description: '{{ doc("position_collected_fees_table_doc") }}' + description: '{{ doc("evm_position_collected_fees_table_doc") }}' columns: - name: BLOCKCHAIN - description: '{{ doc("eth_blockchain") }}' + description: '{{ doc("evm_blockchain") }}' - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_transfer_tx_hash") }}' + description: '{{ doc("evm_transfer_tx_hash") }}' - name: POOL_ADDRESS - description: '{{ doc("all_pool_address") }}' + description: '{{ doc("evm_all_pool_address") }}' - name: LIQUIDITY_PROVIDER - description: '{{ doc("positions_liquidity_provider") }}' + description: '{{ doc("evm_positions_liquidity_provider") }}' - name: NF_POSITION_MANAGER_ADDRESS - description: '{{ doc("positions_nf_position_manager_address") }}' + description: '{{ doc("evm_positions_nf_position_manager_address") }}' - name: NF_TOKEN_ID - description: '{{ doc("positions_nf_token_id") }}' + description: '{{ doc("evm_positions_nf_token_id") }}' - name: TOKEN0_SYMBOL - description: '{{ doc("all_token0_symbol") }}' + description: '{{ doc("evm_all_token0_symbol") }}' - name: TOKEN1_SYMBOL - description: '{{ doc("all_token1_symbol") }}' + description: '{{ doc("evm_all_token1_symbol") }}' - name: AMOUNT0_ADJUSTED - description: '{{ doc("swaps_amount0_adjusted") }}' + description: '{{ doc("evm_swaps_amount0_adjusted") }}' - name: AMOUNT1_ADJUSTED - description: '{{ doc("swaps_amount1_adjusted") }}' + description: '{{ doc("evm_swaps_amount1_adjusted") }}' - name: AMOUNT0_USD - description: '{{ doc("swaps_amount0_usd") }}' + description: '{{ doc("evm_swaps_amount0_usd") }}' - name: AMOUNT1_USD - description: '{{ doc("swaps_amount1_usd") }}' + description: '{{ doc("evm_swaps_amount1_usd") }}' - name: TICK_LOWER - description: '{{ doc("positions_tick_lower") }}' + description: '{{ doc("evm_positions_tick_lower") }}' - name: TICK_UPPER - description: '{{ doc("positions_tick_upper") }}' + description: '{{ doc("evm_positions_tick_upper") }}' - name: PRICE_LOWER - description: '{{ doc("positions_collected_fees_price_lower") }}' + description: '{{ doc("evm_positions_collected_fees_price_lower") }}' - name: PRICE_UPPER - description: '{{ doc("positions_collected_fees_price_upper") }}' + description: '{{ doc("evm_positions_collected_fees_price_upper") }}' - name: PRICE_LOWER_USD - description: '{{ doc("positions_collected_fees_price_lower_usd") }}' + description: '{{ doc("evm_positions_collected_fees_price_lower_usd") }}' - name: PRICE_UPPER_USD - description: '{{ doc("positions_collected_fees_price_upper_usd") }}' + description: '{{ doc("evm_positions_collected_fees_price_upper_usd") }}' - name: EZ_POSITION_COLLECTED_FEES_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/protocols/uniswapv3/uniswapv3__ez_positions.sql b/models/gold/protocols/uniswapv3/uniswapv3__ez_positions.sql index 46592259..5b9e20ca 100644 --- a/models/gold/protocols/uniswapv3/uniswapv3__ez_positions.sql +++ b/models/gold/protocols/uniswapv3/uniswapv3__ez_positions.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'DEFI, DEX' } } - } + }, + tags = ['gold','uniswap','curated'] ) }} SELECT diff --git a/models/gold/protocols/uniswapv3/uniswapv3__ez_positions.yml b/models/gold/protocols/uniswapv3/uniswapv3__ez_positions.yml index c6214c9d..17e21e25 100644 --- a/models/gold/protocols/uniswapv3/uniswapv3__ez_positions.yml +++ b/models/gold/protocols/uniswapv3/uniswapv3__ez_positions.yml @@ -1,76 +1,76 @@ version: 2 models: - name: uniswapv3__ez_positions - description: '{{ doc("positions_table_doc") }}' + description: '{{ doc("evm_positions_table_doc") }}' columns: - name: BLOCKCHAIN - description: '{{ doc("eth_blockchain") }}' + description: '{{ doc("evm_blockchain") }}' - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_transfer_tx_hash") }}' + description: '{{ doc("evm_transfer_tx_hash") }}' - name: FEE_PERCENT - description: '{{ doc("positions_fee_percent") }}' + description: '{{ doc("evm_positions_fee_percent") }}' - name: FEE_GROWTH_INSIDE0_LAST_x128 - description: '{{ doc("positions_fee_growth_inside0_last_x128") }}' + description: '{{ doc("evm_positions_fee_growth_inside0_last_x128") }}' - name: FEE_GROWTH_INSIDE1_LAST_x128 - description: '{{ doc("positions_fee_growth_inside1_last_x128") }}' + description: '{{ doc("evm_positions_fee_growth_inside1_last_x128") }}' - name: IS_ACTIVE - description: '{{ doc("positions_is_active") }}' + description: '{{ doc("evm_positions_is_active") }}' - name: LIQUIDITY_ADJUSTED - description: '{{ doc("all_liquidity_adjusted") }}' + description: '{{ doc("evm_all_liquidity_adjusted") }}' - name: LIQUIDITY_PROVIDER - description: '{{ doc("positions_liquidity_provider") }}' + description: '{{ doc("evm_positions_liquidity_provider") }}' - name: NF_POSITION_MANAGER_ADDRESS - description: '{{ doc("positions_nf_position_manager_address") }}' + description: '{{ doc("evm_positions_nf_position_manager_address") }}' - name: NF_TOKEN_ID - description: '{{ doc("positions_nf_token_id") }}' + description: '{{ doc("evm_positions_nf_token_id") }}' - name: POOL_ADDRESS - description: '{{ doc("all_pool_address") }}' + description: '{{ doc("evm_all_pool_address") }}' - name: POOL_NAME - description: '{{ doc("all_pool_name") }}' + description: '{{ doc("evm_all_pool_name") }}' - name: TICK_LOWER - description: '{{ doc("positions_tick_lower") }}' + description: '{{ doc("evm_positions_tick_lower") }}' - name: TICK_UPPER - description: '{{ doc("positions_tick_upper") }}' + description: '{{ doc("evm_positions_tick_upper") }}' - name: PRICE_UPPER_1_0 - description: '{{ doc("positions_price_upper_1_0") }}' + description: '{{ doc("evm_positions_price_upper_1_0") }}' - name: PRICE_LOWER_1_0 - description: '{{ doc("positions_price_lower_1_0") }}' + description: '{{ doc("evm_positions_price_lower_1_0") }}' - name: PRICE_UPPER_0_1 - description: '{{ doc("positions_price_upper_0_1") }}' + description: '{{ doc("evm_positions_price_upper_0_1") }}' - name: PRICE_LOWER_0_1 - description: '{{ doc("positions_price_lower_0_1") }}' + description: '{{ doc("evm_positions_price_lower_0_1") }}' - name: PRICE_UPPER_1_0_USD - description: '{{ doc("positions_price_upper_1_0_usd") }}' + description: '{{ doc("evm_positions_price_upper_1_0_usd") }}' - name: PRICE_LOWER_1_0_USD - description: '{{ doc("positions_price_lower_1_0_usd") }}' + description: '{{ doc("evm_positions_price_lower_1_0_usd") }}' - name: PRICE_UPPER_0_1_USD - description: '{{ doc("positions_price_upper_0_1_usd") }}' + description: '{{ doc("evm_positions_price_upper_0_1_usd") }}' - name: PRICE_LOWER_0_1_USD - description: '{{ doc("positions_price_lower_0_1_usd") }}' + description: '{{ doc("evm_positions_price_lower_0_1_usd") }}' - name: TOKENS_OWED0_ADJUSTED - description: '{{ doc("positions_token_owed0_adjusted") }}' + description: '{{ doc("evm_positions_token_owed0_adjusted") }}' - name: TOKENS_OWED1_ADJUSTED - description: '{{ doc("positions_token_owed1_adjusted") }}' + description: '{{ doc("evm_positions_token_owed1_adjusted") }}' - name: TOKENS_OWED0_USD - description: '{{ doc("positions_tokens_owed0_usd") }}' + description: '{{ doc("evm_positions_tokens_owed0_usd") }}' - name: TOKENS_OWED1_USD - description: '{{ doc("positions_tokens_owed1_usd") }}' + description: '{{ doc("evm_positions_tokens_owed1_usd") }}' - name: TOKEN0_ADDRESS - description: '{{ doc("all_token0_address") }}' + description: '{{ doc("evm_all_token0_address") }}' - name: TOKEN1_ADDRESS - description: '{{ doc("all_token1_address") }}' + description: '{{ doc("evm_all_token1_address") }}' - name: TOKEN0_SYMBOL - description: '{{ doc("all_token0_symbol") }}' + description: '{{ doc("evm_all_token0_symbol") }}' - name: TOKEN1_SYMBOL - description: '{{ doc("all_token1_symbol") }}' + description: '{{ doc("evm_all_token1_symbol") }}' - name: EZ_POSITION_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/uniswapv3/uniswapv3__ez_swaps.sql b/models/gold/protocols/uniswapv3/uniswapv3__ez_swaps.sql index 45832460..913799c9 100644 --- a/models/gold/protocols/uniswapv3/uniswapv3__ez_swaps.sql +++ b/models/gold/protocols/uniswapv3/uniswapv3__ez_swaps.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'DEFI, DEX, SWAPS' } } - } + }, + tags = ['gold','uniswap','curated'] ) }} SELECT diff --git a/models/gold/protocols/uniswapv3/uniswapv3__ez_swaps.yml b/models/gold/protocols/uniswapv3/uniswapv3__ez_swaps.yml index 99dc1c65..57602d61 100644 --- a/models/gold/protocols/uniswapv3/uniswapv3__ez_swaps.yml +++ b/models/gold/protocols/uniswapv3/uniswapv3__ez_swaps.yml @@ -1,59 +1,59 @@ version: 2 models: - name: uniswapv3__ez_swaps - description: '{{ doc("swaps_table_doc") }}' + description: '{{ doc("evm_swaps_table_doc") }}' columns: - name: BLOCKCHAIN - description: '{{ doc("eth_blockchain") }}' + description: '{{ doc("evm_blockchain") }}' - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("eth_transfer_tx_hash") }}' + description: '{{ doc("evm_transfer_tx_hash") }}' - name: POOL_ADDRESS - description: '{{ doc("all_pool_address") }}' + description: '{{ doc("evm_all_pool_address") }}' - name: POOL_NAME - description: '{{ doc("all_pool_name") }}' + description: '{{ doc("evm_all_pool_name") }}' - name: PRICE_1_0 - description: '{{ doc("swaps_price_1_0") }}' + description: '{{ doc("evm_swaps_price_1_0") }}' - name: PRICE_0_1 - description: '{{ doc("swaps_price_0_1") }}' + description: '{{ doc("evm_swaps_price_0_1") }}' - name: RECIPIENT - description: '{{ doc("swaps_recipient") }}' + description: '{{ doc("evm_swaps_recipient") }}' - name: SENDER - description: '{{ doc("swaps_sender") }}' + description: '{{ doc("evm_swaps_sender") }}' - name: TICK - description: '{{ doc("swaps_tick") }}' + description: '{{ doc("evm_swaps_tick") }}' - name: LIQUIDITY - description: '{{ doc("all_liquidity") }}' + description: '{{ doc("evm_all_liquidity") }}' - name: LIQUIDITY_ADJUSTED - description: '{{ doc("all_liquidity_adjusted") }}' + description: '{{ doc("evm_all_liquidity_adjusted") }}' - name: EVENT_INDEX - description: '{{ doc("swaps_log_index") }}' + description: '{{ doc("evm_swaps_log_index") }}' - name: AMOUNT0_ADJUSTED - description: '{{ doc("swaps_amount0_adjusted") }}' + description: '{{ doc("evm_swaps_amount0_adjusted") }}' - name: AMOUNT1_ADJUSTED - description: '{{ doc("swaps_amount1_adjusted") }}' + description: '{{ doc("evm_swaps_amount1_adjusted") }}' - name: TOKEN0_ADDRESS - description: '{{ doc("all_token0_address") }}' + description: '{{ doc("evm_all_token0_address") }}' - name: TOKEN1_ADDRESS - description: '{{ doc("all_token1_address") }}' + description: '{{ doc("evm_all_token1_address") }}' - name: TOKEN0_SYMBOL - description: '{{ doc("all_token0_symbol") }}' + description: '{{ doc("evm_all_token0_symbol") }}' - name: TOKEN1_SYMBOL - description: '{{ doc("all_token1_symbol") }}' + description: '{{ doc("evm_all_token1_symbol") }}' - name: TOKEN0_PRICE - description: '{{ doc("all_token0_price") }}' + description: '{{ doc("evm_all_token0_price") }}' - name: TOKEN1_PRICE - description: '{{ doc("all_token1_price") }}' + description: '{{ doc("evm_all_token1_price") }}' - name: AMOUNT0_USD - description: '{{ doc("swaps_amount0_usd") }}' + description: '{{ doc("evm_swaps_amount0_usd") }}' - name: AMOUNT1_USD - description: '{{ doc("swaps_amount1_usd") }}' + description: '{{ doc("evm_swaps_amount1_usd") }}' - name: EZ_SWAPS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/stats/stats__ez_core_metrics_hourly.sql b/models/gold/stats/stats__ez_core_metrics_hourly.sql deleted file mode 100644 index bfe61b70..00000000 --- a/models/gold/stats/stats__ez_core_metrics_hourly.sql +++ /dev/null @@ -1,38 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'STATS, METRICS, CORE, HOURLY', - } } } -) }} - -SELECT - block_timestamp_hour, - block_number_min, - block_number_max, - block_count, - transaction_count, - transaction_count_success, - transaction_count_failed, - unique_from_count, - unique_to_count, - total_fees AS total_fees_native, - ROUND( - total_fees * LAST_VALUE( - p.price ignore nulls - ) over ( - ORDER BY - block_timestamp_hour rows unbounded preceding - ), - 2 - ) AS total_fees_usd, - core_metrics_hourly_id AS ez_core_metrics_hourly_id, - s.inserted_timestamp AS inserted_timestamp, - s.modified_timestamp AS modified_timestamp -FROM - {{ ref('silver_stats__core_metrics_hourly') }} - s - LEFT JOIN {{ ref('price__ez_prices_hourly') }} - p - ON s.block_timestamp_hour = p.hour - AND p.token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' --WETH diff --git a/models/gold/stats/stats__ez_core_metrics_hourly.yml b/models/gold/stats/stats__ez_core_metrics_hourly.yml deleted file mode 100644 index 8a61528c..00000000 --- a/models/gold/stats/stats__ez_core_metrics_hourly.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: 2 -models: - - name: stats__ez_core_metrics_hourly - description: '{{ doc("evm_ez_core_metrics_hourly_table_doc") }}' - - columns: - - name: BLOCK_TIMESTAMP_HOUR - description: '{{ doc("evm_block_timestamp_hour") }}' - - name: BLOCK_NUMBER_MIN - description: '{{ doc("evm_block_number_min") }}' - - name: BLOCK_NUMBER_MAX - description: '{{ doc("evm_block_number_max") }}' - - name: BLOCK_COUNT - description: '{{ doc("evm_block_count") }}' - - name: TRANSACTION_COUNT - description: '{{ doc("evm_transaction_count") }}' - - name: TRANSACTION_COUNT_SUCCESS - description: '{{ doc("evm_transaction_count_success") }}' - - name: TRANSACTION_COUNT_FAILED - description: '{{ doc("evm_transaction_count_failed") }}' - - name: UNIQUE_FROM_COUNT - description: '{{ doc("evm_unique_from_count") }}' - - name: UNIQUE_TO_COUNT - description: '{{ doc("evm_unique_to_count") }}' - - name: TOTAL_FEES_NATIVE - description: '{{ doc("evm_total_fees_native") }}' - - name: TOTAL_FEES_USD - description: '{{ doc("evm_total_fees_usd") }}' - - name: EZ_CORE_METRICS_HOURLY_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/silver/_observability/silver_observability__blocks_completeness.sql b/models/silver/_observability/silver_observability__blocks_completeness.sql deleted file mode 100644 index c5c625e9..00000000 --- a/models/silver/_observability/silver_observability__blocks_completeness.sql +++ /dev/null @@ -1,161 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -blocks AS ( - SELECT - l.block_number, - block_timestamp, - LAG( - l.block_number, - 1 - ) over ( - ORDER BY - l.block_number ASC - ) AS prev_BLOCK_NUMBER - FROM - {{ ref("silver__blocks") }} - l - INNER JOIN block_range b - ON l.block_number = b.block_number - AND l.block_number >= ( - SELECT - MIN(block_number) - FROM - block_range - ) -), -block_gen AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - MIN(block_number) - FROM - blocks - ) - AND ( - SELECT - MAX(block_number) - FROM - blocks - ) -) -SELECT - 'blocks' AS test_name, - MIN( - b.block_number - ) AS min_block, - MAX( - b.block_number - ) AS max_block, - MIN( - b.block_timestamp - ) AS min_block_timestamp, - MAX( - b.block_timestamp - ) AS max_block_timestamp, - COUNT(1) AS blocks_tested, - COUNT( - CASE - WHEN C.block_number IS NOT NULL THEN A.block_number - END - ) AS blocks_impacted_count, - ARRAY_AGG( - CASE - WHEN C.block_number IS NOT NULL THEN A.block_number - END - ) within GROUP ( - ORDER BY - A.block_number - ) AS blocks_impacted_array, - CURRENT_TIMESTAMP AS test_timestamp -FROM - block_gen A - LEFT JOIN blocks b - ON A.block_number = b.block_number - LEFT JOIN blocks C - ON A.block_number > C.prev_block_number - AND A.block_number < C.block_number - AND C.block_number - C.prev_block_number <> 1 -WHERE - COALESCE( - b.block_number, - C.block_number - ) IS NOT NULL diff --git a/models/silver/_observability/silver_observability__excluded_trace_blocks.sql b/models/silver/_observability/silver_observability__excluded_trace_blocks.sql deleted file mode 100644 index 8d2bab51..00000000 --- a/models/silver/_observability/silver_observability__excluded_trace_blocks.sql +++ /dev/null @@ -1,102 +0,0 @@ -{{ config( - materialized = 'view', - tags = ['observability'] -) }} - -SELECT - column1 AS block_number -FROM - ( - VALUES - (3804951), - (3804282), - (3805213), - (3805274), - (3805144), - (3804909), - (3804375), - (3805171), - (3805210), - (3804357), - (3804917), - (3805111), - (3805195), - (3804880), - (3805005), - (3804985), - (3805056), - (3805047), - (3805177), - (3805129), - (3804887), - (3804982), - (3804898), - (3804931), - (3804939), - (3805099), - (3805119), - (3805027), - (3804885), - (3805174), - (3804945), - (3805147), - (3804005), - (3805207), - (3804216), - (3805224), - (3805042), - (3805126), - (3805141), - (3805091), - (3804347), - (3805247), - (3805132), - (3805262), - (3804934), - (3804958), - (3804962), - (3804299), - (3804906), - (3804953), - (3805228), - (3805016), - (3805222), - (3805064), - (3805072), - (3804222), - (3805115), - (3805279), - (3804874), - (3804913), - (3804992), - (3805084), - (3805258), - (3805157), - (3804893), - (3805061), - (3805019), - (3804973), - (3804920), - (3805230), - (3804901), - (3805266), - (3805038), - (3804969), - (3805190), - (3805200), - (3805153), - (3805067), - (3804865), - (3804988), - (3804975), - (3804926), - (3805010), - (3804315), - (3804309), - (3805272), - (3805249), - (3804227), - (3805202), - (3805033), - (3805022) - ) AS block_number(column1) diff --git a/models/silver/_observability/silver_observability__logs_completeness.sql b/models/silver/_observability/silver_observability__logs_completeness.sql deleted file mode 100644 index bf88e6f1..00000000 --- a/models/silver/_observability/silver_observability__logs_completeness.sql +++ /dev/null @@ -1,119 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -broken_blocks AS ( - SELECT - DISTINCT block_number - FROM - {{ ref("silver__receipts") }} - r - LEFT JOIN {{ ref("silver__logs") }} - l USING ( - block_number, - tx_hash - ) - JOIN block_range USING (block_number) - WHERE - l.tx_hash IS NULL - AND ARRAY_SIZE( - r.logs - ) > 0 -), -impacted_blocks AS ( - SELECT - COUNT(1) AS blocks_impacted_count, - ARRAY_AGG(block_number) within GROUP ( - ORDER BY - block_number - ) AS blocks_impacted_array - FROM - broken_blocks -) -SELECT - 'event_logs' AS test_name, - min_block, - max_block, - min_block_timestamp, - max_block_timestamp, - blocks_tested, - blocks_impacted_count, - blocks_impacted_array, - CURRENT_TIMESTAMP() AS test_timestamp -FROM - summary_stats - JOIN impacted_blocks - ON 1 = 1 diff --git a/models/silver/_observability/silver_observability__receipts_completeness.sql b/models/silver/_observability/silver_observability__receipts_completeness.sql deleted file mode 100644 index c4911664..00000000 --- a/models/silver/_observability/silver_observability__receipts_completeness.sql +++ /dev/null @@ -1,117 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -broken_blocks AS ( - SELECT - DISTINCT block_number - FROM - {{ ref("silver__transactions") }} - t - LEFT JOIN {{ ref("silver__receipts") }} - r USING ( - block_number, - tx_hash, - block_hash - ) - JOIN block_range USING (block_number) - WHERE - r.tx_hash IS NULL -), -impacted_blocks AS ( - SELECT - COUNT(1) AS blocks_impacted_count, - ARRAY_AGG(block_number) within GROUP ( - ORDER BY - block_number - ) AS blocks_impacted_array - FROM - broken_blocks -) -SELECT - 'receipts' AS test_name, - min_block, - max_block, - min_block_timestamp, - max_block_timestamp, - blocks_tested, - blocks_impacted_count, - blocks_impacted_array, - CURRENT_TIMESTAMP() AS test_timestamp -FROM - summary_stats - JOIN impacted_blocks - ON 1 = 1 diff --git a/models/silver/_observability/silver_observability__traces_completeness.sql b/models/silver/_observability/silver_observability__traces_completeness.sql deleted file mode 100644 index eb873bd4..00000000 --- a/models/silver/_observability/silver_observability__traces_completeness.sql +++ /dev/null @@ -1,123 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -broken_blocks AS ( - SELECT - DISTINCT block_number - FROM - {{ ref("silver__transactions") }} - tx - LEFT JOIN {{ ref("core__fact_traces") }} - tr USING ( - block_number, - tx_hash - ) - JOIN block_range USING (block_number) - WHERE - tr.tx_hash IS NULL -), -impacted_blocks AS ( - SELECT - COUNT(1) AS blocks_impacted_count, - ARRAY_AGG(block_number) within GROUP ( - ORDER BY - block_number - ) AS blocks_impacted_array - FROM - broken_blocks - WHERE - block_number NOT IN ( - SELECT - block_number - FROM - {{ ref("silver_observability__excluded_trace_blocks") }} - ) -) -SELECT - 'traces' AS test_name, - min_block, - max_block, - min_block_timestamp, - max_block_timestamp, - blocks_tested, - blocks_impacted_count, - blocks_impacted_array, - CURRENT_TIMESTAMP() AS test_timestamp -FROM - summary_stats - JOIN impacted_blocks - ON 1 = 1 diff --git a/models/silver/_observability/silver_observability__transactions_completeness.sql b/models/silver/_observability/silver_observability__transactions_completeness.sql deleted file mode 100644 index d755db3c..00000000 --- a/models/silver/_observability/silver_observability__transactions_completeness.sql +++ /dev/null @@ -1,117 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -broken_blocks AS ( - SELECT - DISTINCT block_number - FROM - {{ ref("silver__confirmed_blocks") }} - b - LEFT JOIN {{ ref("silver__transactions") }} - t USING ( - block_number, - tx_hash, - block_hash - ) - JOIN block_range USING (block_number) - WHERE - t.tx_hash IS NULL -), -impacted_blocks AS ( - SELECT - COUNT(1) AS blocks_impacted_count, - ARRAY_AGG(block_number) within GROUP ( - ORDER BY - block_number - ) AS blocks_impacted_array - FROM - broken_blocks -) -SELECT - 'transactions' AS test_name, - min_block, - max_block, - min_block_timestamp, - max_block_timestamp, - blocks_tested, - blocks_impacted_count, - blocks_impacted_array, - CURRENT_TIMESTAMP() AS test_timestamp -FROM - summary_stats - JOIN impacted_blocks - ON 1 = 1 diff --git a/models/silver/abis/event_logs/silver__complete_event_abis.sql b/models/silver/abis/event_logs/silver__complete_event_abis.sql deleted file mode 100644 index 1bff0ea3..00000000 --- a/models/silver/abis/event_logs/silver__complete_event_abis.sql +++ /dev/null @@ -1,265 +0,0 @@ -{{ config ( - materialized = 'incremental', - unique_key = ['parent_contract_address','event_signature','start_block'], - merge_exclude_columns = ["inserted_timestamp"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['abis'] -) }} - -WITH new_abis AS ( - - SELECT - DISTINCT contract_address - FROM - {{ ref('silver__flat_event_abis') }} - -{% if is_incremental() %} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '18 hours' - FROM - {{ this }} - ) -UNION - -- catches any late arriving proxies -SELECT - DISTINCT proxy_address AS contract_address -FROM - {{ ref('silver__proxies') }} -WHERE - start_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '18 hours' - FROM - {{ this }} - ) -{% endif %} -), -proxies AS ( - SELECT - p0.created_block, - p0.proxy_created_block, - p0.contract_address, - p0.proxy_address, - p0.start_block, - p0._id, - p0._inserted_timestamp - FROM - {{ ref('silver__proxies') }} - p0 - JOIN new_abis na0 - ON p0.contract_address = na0.contract_address - UNION - SELECT - p1.created_block, - p1.proxy_created_block, - p1.contract_address, - p1.proxy_address, - p1.start_block, - p1._id, - p1._inserted_timestamp - FROM - {{ ref('silver__proxies') }} - p1 - JOIN new_abis na1 - ON p1.proxy_address = na1.contract_address -), -all_relevant_contracts AS ( - SELECT - DISTINCT contract_address - FROM - proxies - UNION - SELECT - DISTINCT proxy_address AS contract_address - FROM - proxies - UNION - SELECT - contract_address - FROM - new_abis -), -flat_abis AS ( - SELECT - contract_address, - event_name, - abi, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp - FROM - {{ ref('silver__flat_event_abis') }} - JOIN all_relevant_contracts USING (contract_address) -), -base AS ( - SELECT - ea.contract_address, - event_name, - abi, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - ea._inserted_timestamp, - pb._inserted_timestamp AS proxy_inserted_timestamp, - pb.start_block, - pb.proxy_created_block, - pb.contract_address AS base_contract_address, - 1 AS priority - FROM - flat_abis ea - JOIN proxies pb - ON ea.contract_address = pb.proxy_address - UNION ALL - SELECT - eab.contract_address, - event_name, - abi, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - eab._inserted_timestamp, - pbb._inserted_timestamp AS proxy_inserted_timestamp, - pbb.created_block AS start_block, - pbb.proxy_created_block, - pbb.contract_address AS base_contract_address, - 2 AS priority - FROM - flat_abis eab - JOIN ( - SELECT - DISTINCT contract_address, - created_block, - proxy_created_block, - _inserted_timestamp - FROM - proxies - ) pbb - ON eab.contract_address = pbb.contract_address - UNION ALL - SELECT - contract_address, - event_name, - abi, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp, - NULL AS proxy_inserted_timestamp, - 0 AS start_block, - NULL AS proxy_created_block, - contract_address AS base_contract_address, - 3 AS priority - FROM - flat_abis eac - WHERE - contract_address NOT IN ( - SELECT - DISTINCT contract_address - FROM - proxies - ) -), -new_records AS ( - SELECT - base_contract_address AS parent_contract_address, - contract_address, - event_name, - abi, - start_block, - proxy_created_block, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp, - proxy_inserted_timestamp - FROM - base qualify ROW_NUMBER() over ( - PARTITION BY parent_contract_address, - NAME, - event_type, - event_signature, - start_block - ORDER BY - priority ASC, - _inserted_timestamp DESC, - proxy_created_block DESC nulls last, - proxy_inserted_timestamp DESC nulls last - ) = 1 -), -FINAL AS ( - SELECT - parent_contract_address, - contract_address AS implementation_contract, - event_name, - abi, - start_block, - proxy_created_block, - simple_event_name, - event_signature, - IFNULL(LEAD(start_block) over (PARTITION BY parent_contract_address, event_signature - ORDER BY - start_block) -1, 1e18) AS end_block, - _inserted_timestamp, - proxy_inserted_timestamp, - SYSDATE() AS _updated_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['parent_contract_address','event_signature','start_block'] - ) }} AS complete_event_abis_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id - FROM - new_records qualify ROW_NUMBER() over ( - PARTITION BY parent_contract_address, - event_name, - event_signature, - start_block - ORDER BY - _inserted_timestamp DESC - ) = 1 -) -SELECT - parent_contract_address, - implementation_contract, - event_name, - abi, - start_block, - proxy_created_block, - simple_event_name, - event_signature, - end_block, - _inserted_timestamp, - proxy_inserted_timestamp, - _updated_timestamp, - complete_event_abis_id, - inserted_timestamp, - modified_timestamp, - _invocation_id -FROM - FINAL f - -{% if is_incremental() %} -LEFT JOIN {{ this }} -t USING ( - parent_contract_address, - event_name, - event_signature, - start_block, - end_block -) -WHERE - t.event_signature IS NULL -{% endif %} diff --git a/models/silver/abis/event_logs/silver__complete_event_abis.yml b/models/silver/abis/event_logs/silver__complete_event_abis.yml deleted file mode 100644 index 9004009f..00000000 --- a/models/silver/abis/event_logs/silver__complete_event_abis.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: 2 -models: - - name: silver__complete_event_abis - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - PARENT_CONTRACT_ADDRESS - - EVENT_SIGNATURE - - START_BLOCK \ No newline at end of file diff --git a/models/silver/abis/event_logs/silver__flat_event_abis.sql b/models/silver/abis/event_logs/silver__flat_event_abis.sql deleted file mode 100644 index da102b90..00000000 --- a/models/silver/abis/event_logs/silver__flat_event_abis.sql +++ /dev/null @@ -1,112 +0,0 @@ -{{ config ( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'contract_address', - cluster_by = '_inserted_timestamp::date', - tags = ['abis'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY (contract_address)" -) }} - -WITH abi_base AS ( - - SELECT - contract_address, - DATA, - _inserted_timestamp - FROM - {{ ref('silver__abis') }} - -{% if is_incremental() %} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '24 hours' - FROM - {{ this }} - ) -{% endif %} -), -flat_abi AS ( - SELECT - contract_address, - _inserted_timestamp, - DATA, - VALUE :inputs AS inputs, - VALUE :payable :: BOOLEAN AS payable, - VALUE :stateMutability :: STRING AS stateMutability, - VALUE :type :: STRING AS TYPE, - VALUE :anonymous :: BOOLEAN AS anonymous, - VALUE :name :: STRING AS NAME - FROM - abi_base, - LATERAL FLATTEN ( - input => DATA - ) - WHERE - TYPE = 'event' qualify ROW_NUMBER() over ( - PARTITION BY contract_address, - NAME, - inputs - ORDER BY - LENGTH(inputs) - ) = 1 -), -event_types AS ( - SELECT - contract_address, - _inserted_timestamp, - inputs, - anonymous, - NAME, - ARRAY_AGG( - VALUE :type :: STRING - ) AS event_type - FROM - flat_abi, - LATERAL FLATTEN ( - input => inputs - ) - GROUP BY - contract_address, - _inserted_timestamp, - inputs, - anonymous, - NAME -), -apply_udfs AS ( - SELECT - contract_address, - NAME AS event_name, - PARSE_JSON( - OBJECT_CONSTRUCT( - 'anonymous', - anonymous, - 'inputs', - inputs, - 'name', - NAME, - 'type', - 'event' - ) :: STRING - ) AS abi, - utils.udf_evm_text_signature(abi) AS simple_event_name, - utils.udf_keccak256(simple_event_name) AS event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp - FROM - event_types -) -SELECT - contract_address, - event_name, - abi, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp -FROM - apply_udfs diff --git a/models/silver/abis/silver__abis.sql b/models/silver/abis/silver__abis.sql deleted file mode 100644 index af5d9205..00000000 --- a/models/silver/abis/silver__abis.sql +++ /dev/null @@ -1,181 +0,0 @@ -{{ config ( - materialized = "incremental", - unique_key = "contract_address", - merge_exclude_columns = ["inserted_timestamp"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(contract_address,abi_hash,bytecode), SUBSTRING(contract_address,abi_hash,bytecode)", - tags = ['abis'] -) }} - -WITH override_abis AS ( - - SELECT - contract_address, - PARSE_JSON(DATA) AS abi, - TO_TIMESTAMP_LTZ(SYSDATE()) AS _inserted_timestamp, - 'flipside' AS abi_source, - 'flipside' AS discord_username, - SHA2(abi) AS abi_hash, - 1 AS priority - FROM - {{ ref('silver__override_abis') }} - WHERE - contract_address IS NOT NULL -), -verified_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - 2 AS priority - FROM - {{ ref('silver__verified_abis') }} - WHERE - abi_source = 'etherscan' - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - FROM - {{ this }} - WHERE - abi_source = 'etherscan' -) -{% endif %} -), -user_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - 2 AS priority - FROM - {{ ref('silver__verified_abis') }} - WHERE - abi_source = 'user' - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - FROM - {{ this }} - WHERE - abi_source = 'user' -) -{% endif %} -), -bytecode_abis AS ( - SELECT - contract_address, - abi, - abi_hash, - 'bytecode_matched' AS abi_source, - NULL AS discord_username, - _inserted_timestamp, - 3 AS priority - FROM - {{ ref('silver__bytecode_abis') }} - WHERE - 1 = 1 - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - FROM - {{ this }} - WHERE - abi_source = 'bytecode_matched' -) -{% endif %} -), -all_abis AS ( - SELECT - contract_address, - abi AS DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - priority - FROM - override_abis - UNION - SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - priority - FROM - verified_abis - UNION - SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - priority - FROM - user_abis - UNION - SELECT - contract_address, - abi AS DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - priority - FROM - bytecode_abis -), -priority_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - priority - FROM - all_abis qualify(ROW_NUMBER() over(PARTITION BY contract_address - ORDER BY - priority ASC)) = 1 -) -SELECT - p.contract_address, - p.data, - p._inserted_timestamp, - p.abi_source, - p.discord_username, - p.abi_hash, - created_contract_input AS bytecode, - {{ dbt_utils.generate_surrogate_key( - ['p.contract_address'] - ) }} AS abis_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - priority_abis p - LEFT JOIN {{ ref('silver__created_contracts') }} - ON p.contract_address = created_contract_address diff --git a/models/silver/abis/silver__abis.yml b/models/silver/abis/silver__abis.yml deleted file mode 100644 index 2af6440c..00000000 --- a/models/silver/abis/silver__abis.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -models: - - name: silver__abis - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - CONTRACT_ADDRESS \ No newline at end of file diff --git a/models/silver/abis/silver__bytecode_abis.sql b/models/silver/abis/silver__bytecode_abis.sql deleted file mode 100644 index 3c6ac461..00000000 --- a/models/silver/abis/silver__bytecode_abis.sql +++ /dev/null @@ -1,77 +0,0 @@ -{{ config ( - materialized = "incremental", - unique_key = "contract_address", - tags = ['abis'] -) }} - -WITH contracts_with_abis AS ( - -- Identifying contracts with verified ABIs - - SELECT - created_contract_address AS contract_address - FROM - {{ ref('silver__created_contracts') }} - JOIN {{ ref('silver__verified_abis') }} A - ON A.contract_address = created_contract_address -), -contracts_without_abis AS ( - -- Contracts that are missing ABIs - SELECT - created_contract_address AS contract_address, - created_contract_input AS bytecode - FROM - {{ ref('silver__created_contracts') }} - WHERE - created_contract_address NOT IN ( - SELECT - contract_address - FROM - contracts_with_abis - ) - -{% if is_incremental() %} -AND created_contract_address NOT IN ( - SELECT - contract_address - FROM - {{ this }} -) -{% endif %} -), -unique_bytecode_abis AS ( - -- Bytecodes from created_contracts with a unique ABI - SELECT - cc.created_contract_input AS bytecode, - va.data AS abi, - va.abi_hash - FROM - {{ ref('silver__created_contracts') }} - cc - JOIN {{ ref('silver__verified_abis') }} - va - ON cc.created_contract_address = va.contract_address - GROUP BY - cc.created_contract_input, - va.data, - va.abi_hash - HAVING - COUNT( - DISTINCT va.data - ) = 1 -- Ensuring there's only one ABI per bytecode -) -- Final matching -SELECT - contract_address, - abi, - abi_hash, - -{% if is_incremental() %} -SYSDATE() -{% else %} - TO_TIMESTAMP_NTZ('2000-01-01 00:00:00') -{% endif %} - -AS _inserted_timestamp -FROM - contracts_without_abis - JOIN unique_bytecode_abis USING (bytecode) - diff --git a/models/silver/abis/silver__bytecode_abis.yml b/models/silver/abis/silver__bytecode_abis.yml deleted file mode 100644 index 704e39d1..00000000 --- a/models/silver/abis/silver__bytecode_abis.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: 2 -models: - - name: silver__bytecode_abis - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - CONTRACT_ADDRESS - - ABI_HASH \ No newline at end of file diff --git a/models/silver/abis/silver__override_abis.sql b/models/silver/abis/silver__override_abis.sql deleted file mode 100644 index 88b8439d..00000000 --- a/models/silver/abis/silver__override_abis.sql +++ /dev/null @@ -1,8 +0,0 @@ -{{ config( - materialized = 'view', - tags = ['abis'] -) }} - -SELECT - NULL AS contract_address, - NULL AS DATA diff --git a/models/silver/abis/silver__proxies.sql b/models/silver/abis/silver__proxies.sql deleted file mode 100644 index b6187cc2..00000000 --- a/models/silver/abis/silver__proxies.sql +++ /dev/null @@ -1,110 +0,0 @@ -{{ config ( - materialized = 'incremental', - unique_key = ['contract_address','proxy_address'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['abis'] -) }} - -WITH base AS ( - - SELECT - from_address, - to_address, - MIN(block_number) AS start_block, - MIN(block_timestamp) AS start_timestamp, - MAX(modified_timestamp) AS _inserted_timestamp - FROM - {{ ref('core__fact_traces') }} - WHERE - TYPE = 'DELEGATECALL' - AND trace_succeeded - AND tx_succeeded - AND from_address != to_address -- exclude self-calls - -{% if is_incremental() %} -AND modified_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '24 hours' - FROM - {{ this }} -) -{% endif %} -GROUP BY - from_address, - to_address -), -create_id AS ( - SELECT - from_address AS contract_address, - to_address AS proxy_address, - start_block, - start_timestamp, - CONCAT( - from_address, - '-', - to_address - ) AS _id, - _inserted_timestamp - FROM - base -), -heal AS ( - SELECT - contract_address, - proxy_address, - start_block, - start_timestamp, - _id, - _inserted_timestamp - FROM - create_id - -{% if is_incremental() %} -UNION ALL -SELECT - contract_address, - proxy_address, - start_block, - start_timestamp, - _id, - _inserted_timestamp -FROM - {{ this }} - JOIN create_id USING ( - contract_address, - proxy_address - ) -{% endif %} -), -FINAL AS ( - SELECT - contract_address, - proxy_address, - start_block, - start_timestamp, - _id, - _inserted_timestamp - FROM - heal qualify ROW_NUMBER() over ( - PARTITION BY contract_address, - proxy_address - ORDER BY - start_block ASC - ) = 1 -) -SELECT - f.contract_address, - f.proxy_address, - f.start_block, - f.start_timestamp, - f._id, - f._inserted_timestamp, - C.block_number AS created_block, - p.block_number AS proxy_created_block -FROM - FINAL f - JOIN {{ ref('silver__created_contracts') }} C - ON f.contract_address = C.created_contract_address - JOIN {{ ref('silver__created_contracts') }} - p - ON f.proxy_address = p.created_contract_address diff --git a/models/silver/abis/silver__proxies.yml b/models/silver/abis/silver__proxies.yml deleted file mode 100644 index da5fa8f0..00000000 --- a/models/silver/abis/silver__proxies.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -models: - - name: silver__proxies - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _ID \ No newline at end of file diff --git a/models/silver/abis/silver__user_verified_abis.sql b/models/silver/abis/silver__user_verified_abis.sql deleted file mode 100644 index 7f71f83a..00000000 --- a/models/silver/abis/silver__user_verified_abis.sql +++ /dev/null @@ -1,547 +0,0 @@ -{{ config ( - materialized = "incremental", - unique_key = "id", - tags = ['abis'] -) }} - -WITH base AS ( - - SELECT - contract_address, - abi, - PARSE_JSON(abi) AS DATA, - SHA2(PARSE_JSON(abi)) AS abi_hash, - discord_username, - _inserted_timestamp - FROM - {{ source( - "crosschain_public", - "user_abis" - ) }} - WHERE - blockchain = 'ethereum' - AND NOT duplicate_abi - -{% if is_incremental() %} -AND contract_address NOT IN ( - SELECT - contract_address - FROM - {{ this }} -) -AND _inserted_timestamp > ( - SELECT - COALESCE( - MAX( - _inserted_timestamp - ), - '1970-01-01' - ) - FROM - {{ this }} -) -AND _inserted_timestamp > DATEADD('day', -2, SYSDATE()) -{% endif %}), -flat_event_abi AS ( - SELECT - contract_address, - _inserted_timestamp, - DATA, - VALUE :inputs AS inputs, - VALUE :payable :: BOOLEAN AS payable, - VALUE :stateMutability :: STRING AS stateMutability, - VALUE :type :: STRING AS TYPE, - VALUE :anonymous :: BOOLEAN AS anonymous, - VALUE :name :: STRING AS NAME - FROM - base, - LATERAL FLATTEN ( - input => DATA - ) - WHERE - TYPE = 'event' qualify ROW_NUMBER() over ( - PARTITION BY contract_address, - NAME, - inputs - ORDER BY - LENGTH(inputs) - ) = 1 -), -event_types AS ( - SELECT - contract_address, - _inserted_timestamp, - inputs, - anonymous, - NAME, - ARRAY_AGG( - VALUE :type :: STRING - ) AS event_type - FROM - flat_event_abi, - LATERAL FLATTEN ( - input => inputs - ) - GROUP BY - contract_address, - _inserted_timestamp, - inputs, - anonymous, - NAME -), -apply_event_udfs AS ( - SELECT - contract_address, - NAME AS event_name, - PARSE_JSON( - OBJECT_CONSTRUCT( - 'anonymous', - anonymous, - 'inputs', - inputs, - 'name', - NAME, - 'type', - 'event' - ) :: STRING - ) AS abi, - utils.udf_evm_text_signature(abi) AS simple_event_name, - utils.udf_keccak256(simple_event_name) AS event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp - FROM - event_types -), -final_flat_event_abis AS ( - SELECT - contract_address, - event_name, - abi, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp - FROM - apply_event_udfs -), -flat_function_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - VALUE :inputs AS inputs, - VALUE :outputs AS outputs, - VALUE :payable :: BOOLEAN AS payable, - VALUE :stateMutability :: STRING AS stateMutability, - VALUE :type :: STRING AS TYPE, - VALUE :name :: STRING AS NAME - FROM - base, - LATERAL FLATTEN ( - input => DATA - ) - WHERE - TYPE = 'function' -), -udf_function_abis AS ( - SELECT - *, - PARSE_JSON( - object_construct_keep_null( - 'inputs', - IFNULL( - inputs, - [] - ), - 'outputs', - IFNULL( - outputs, - [] - ), - 'name', - NAME, - 'type', - 'function' - ) :: STRING - ) AS abi, - utils.udf_evm_text_signature(abi) AS simple_function_name, - utils.udf_keccak256(simple_function_name) AS function_signature - FROM - flat_function_abis qualify ROW_NUMBER() over ( - PARTITION BY contract_address, - function_signature - ORDER BY - _inserted_timestamp DESC - ) = 1 -), -flat_inputs AS ( - SELECT - contract_address, - inputs, - NAME, - simple_function_name, - function_signature, - ARRAY_AGG( - VALUE :type :: STRING - ) AS inputs_type - FROM - udf_function_abis, - LATERAL FLATTEN ( - input => inputs - ) - GROUP BY - ALL -), -fill_missing_input_names AS ( - SELECT - contract_address, - NAME, - inputs_type, - simple_function_name, - function_signature, - VALUE :internalType :: STRING AS internalType, - VALUE :type :: STRING AS TYPE, - CASE - WHEN VALUE :name :: STRING = '' THEN CONCAT('input_', ROW_NUMBER() over (PARTITION BY contract_address, function_signature - ORDER BY - INDEX ASC) :: STRING) - ELSE VALUE :name :: STRING - END AS name_fixed, - inputs, - INDEX, - VALUE :components AS components - FROM - flat_inputs, - LATERAL FLATTEN ( - input => inputs - ) -), -final_flat_inputs AS ( - SELECT - contract_address, - NAME, - inputs_type, - simple_function_name, - function_signature, - ARRAY_AGG( - OBJECT_CONSTRUCT( - 'internalType', - internalType, - 'name', - name_fixed, - 'type', - TYPE, - 'components', - components - ) - ) within GROUP ( - ORDER BY - INDEX - ) AS inputs - FROM - fill_missing_input_names - GROUP BY - ALL -), -flat_outputs AS ( - SELECT - contract_address, - outputs, - simple_function_name, - function_signature, - NAME, - ARRAY_AGG( - VALUE :type :: STRING - ) AS outputs_type - FROM - udf_function_abis, - LATERAL FLATTEN ( - input => outputs - ) - GROUP BY - ALL -), -fill_missing_output_names AS ( - SELECT - contract_address, - NAME, - outputs_type, - simple_function_name, - function_signature, - VALUE :internalType :: STRING AS internalType, - VALUE :type :: STRING AS TYPE, - CASE - WHEN VALUE :name :: STRING = '' THEN CONCAT('output_', ROW_NUMBER() over (PARTITION BY contract_address, function_signature - ORDER BY - INDEX ASC) :: STRING) - ELSE VALUE :name :: STRING - END AS name_fixed, - outputs, - INDEX, - VALUE :components AS components - FROM - flat_outputs, - LATERAL FLATTEN ( - input => outputs - ) -), -final_flat_outputs AS ( - SELECT - contract_address, - NAME, - outputs_type, - simple_function_name, - function_signature, - ARRAY_AGG( - OBJECT_CONSTRUCT( - 'internalType', - internalType, - 'name', - name_fixed, - 'type', - TYPE, - 'components', - components - ) - ) within GROUP ( - ORDER BY - INDEX - ) AS outputs - FROM - fill_missing_output_names - GROUP BY - ALL -), -all_contracts AS ( - SELECT - A.contract_address, - A.name AS function_name, - i.inputs, - o.outputs, - i.inputs_type, - o.outputs_type, - A._inserted_timestamp, - A.function_signature, - A.simple_function_name - FROM - udf_function_abis A - LEFT JOIN final_flat_inputs i - ON A.contract_address = i.contract_address - AND A.function_signature = i.function_signature - LEFT JOIN final_flat_outputs o - ON A.contract_address = o.contract_address - AND A.function_signature = o.function_signature -), -apply_function_udfs AS ( - SELECT - contract_address, - function_name, - PARSE_JSON( - object_construct_keep_null( - 'inputs', - IFNULL( - inputs, - [] - ), - 'outputs', - IFNULL( - outputs, - [] - ), - 'name', - function_name, - 'type', - 'function' - ) :: STRING - ) AS abi, - simple_function_name, - function_signature, - inputs, - outputs, - inputs_type, - outputs_type, - _inserted_timestamp - FROM - all_contracts -), -final_function_abis AS ( - SELECT - contract_address, - function_name, - abi, - simple_function_name, - function_signature, - inputs, - outputs, - inputs_type, - outputs_type, - _inserted_timestamp - FROM - apply_function_udfs -), -new_abis AS ( - SELECT - DISTINCT contract_address - FROM - base -), -contracts AS ( - SELECT - contract_address - FROM - {{ ref('silver__proxies') }} - JOIN new_abis USING (contract_address) -), -proxies AS ( - SELECT - p.proxy_address, - p.contract_address - FROM - {{ ref('silver__proxies') }} - p - JOIN new_abis n - ON p.proxy_address = n.contract_address -), -final_groupings AS ( - SELECT - b.contract_address AS address, - C.contract_address, - proxy_address, - CASE - WHEN C.contract_address IS NOT NULL - AND proxy_address IS NOT NULL THEN 'contract' - WHEN C.contract_address IS NOT NULL THEN 'contract' - WHEN proxy_address IS NOT NULL THEN 'proxy' - WHEN C.contract_address IS NULL - AND proxy_address IS NULL THEN 'contract' - END AS TYPE, - p.contract_address AS proxy_parent, - CASE - WHEN TYPE = 'contract' THEN address - ELSE proxy_parent - END AS final_address - FROM - base b - LEFT JOIN ( - SELECT - DISTINCT contract_address - FROM - contracts - ) C - ON b.contract_address = C.contract_address - LEFT JOIN ( - SELECT - DISTINCT proxy_address, - contract_address - FROM - proxies - ) p - ON b.contract_address = proxy_address -), -identified_addresses AS ( - SELECT - DISTINCT address AS base_address, - final_address AS contract_address - FROM - final_groupings -), -function_mapping AS ( - SELECT - ia.base_address, - ia.contract_address, - LEFT( - function_signature, - 10 - ) AS function_sig - FROM - identified_addresses ia - JOIN final_function_abis ffa - ON ia.base_address = ffa.contract_address -), -valid_traces AS ( - SELECT - DISTINCT base_address - FROM - ( - SELECT - base_address - FROM - {{ ref('core__fact_traces') }} - JOIN function_mapping - ON function_sig = LEFT( - input, - 10 - ) - AND IFF( - TYPE = 'DELEGATECALL', - from_address, - to_address - ) = contract_address - WHERE - block_timestamp > DATEADD('month', -12, SYSDATE()) - LIMIT - 50000) - ), event_mapping AS ( - SELECT - ia.base_address, - ia.contract_address, - event_signature - FROM - identified_addresses ia - JOIN final_flat_event_abis fea - ON ia.base_address = fea.contract_address - ), - valid_logs AS ( - SELECT - DISTINCT base_address - FROM - ( - SELECT - base_address - FROM - {{ ref('core__fact_event_logs') }} - l - JOIN event_mapping ia - ON ia.contract_address = l.contract_address - AND event_signature = topics [0] :: STRING - WHERE - block_timestamp > DATEADD('month', -12, SYSDATE()) - LIMIT - 50000) - ), all_valid_addresses AS ( - SELECT - base_address - FROM - valid_traces - UNION - SELECT - base_address - FROM - valid_logs - ) - SELECT - contract_address, - abi, - discord_username, - _inserted_timestamp, - abi_hash, - CONCAT( - contract_address, - '-', - abi_hash - ) AS id - FROM - base - WHERE - contract_address IN ( - SELECT - base_address - FROM - all_valid_addresses - ) qualify(ROW_NUMBER() over(PARTITION BY contract_address - ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/abis/silver__user_verified_abis.yml b/models/silver/abis/silver__user_verified_abis.yml deleted file mode 100644 index 912a5c86..00000000 --- a/models/silver/abis/silver__user_verified_abis.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -models: - - name: silver__user_verified_abis - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - ID \ No newline at end of file diff --git a/models/silver/abis/silver__verified_abis.sql b/models/silver/abis/silver__verified_abis.sql deleted file mode 100644 index 3d2d8b6c..00000000 --- a/models/silver/abis/silver__verified_abis.sql +++ /dev/null @@ -1,110 +0,0 @@ --- depends_on: {{ ref('bronze__streamline_contract_abis') }} -{{ config ( - materialized = "incremental", - unique_key = "contract_address", - merge_update_columns = ["contract_address"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(contract_address)", - tags = ['abis'] -) }} - -WITH etherscan_abis AS ( - - SELECT - block_number, - COALESCE( - VALUE :"CONTRACT_ADDRESS" :: STRING, - VALUE :"contract_address" :: STRING - ) AS contract_address, - TRY_PARSE_JSON(DATA) AS DATA, - VALUE, - 'etherscan' AS abi_source, - _inserted_timestamp - FROM - -{% if is_incremental() %} -{{ ref('bronze__streamline_contract_abis') }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) - AND TRY_PARSE_JSON(DATA) :: STRING <> '[]' - AND TRY_PARSE_JSON(DATA) IS NOT NULL -{% else %} - {{ ref('bronze__streamline_fr_contract_abis') }} -WHERE - TRY_PARSE_JSON(DATA) :: STRING <> '[]' - AND TRY_PARSE_JSON(DATA) IS NOT NULL -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY contract_address, block_number -ORDER BY - _inserted_timestamp DESC)) = 1 -), -user_abis AS ( - SELECT - contract_address, - abi, - discord_username, - _inserted_timestamp, - 'user' AS abi_source, - abi_hash - FROM - {{ ref('silver__user_verified_abis') }} - -{% if is_incremental() %} -WHERE - _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - FROM - {{ this }} - WHERE - abi_source = 'user' - ) - AND contract_address NOT IN ( - SELECT - contract_address - FROM - {{ this }} - ) -{% endif %} -), -all_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - NULL AS discord_username, - SHA2(DATA) AS abi_hash - FROM - etherscan_abis - UNION - SELECT - contract_address, - PARSE_JSON(abi) AS DATA, - _inserted_timestamp, - 'user' AS abi_source, - discord_username, - abi_hash - FROM - user_abis -) -SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash -FROM - all_abis -WHERE - DATA :: STRING <> 'Unknown Exception' qualify(ROW_NUMBER() over(PARTITION BY contract_address -ORDER BY - _INSERTED_TIMESTAMP DESC)) = 1 diff --git a/models/silver/abis/silver__verified_abis.yml b/models/silver/abis/silver__verified_abis.yml deleted file mode 100644 index b576e2ae..00000000 --- a/models/silver/abis/silver__verified_abis.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 2 -models: - - name: silver__verified_abis - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - CONTRACT_ADDRESS - columns: - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ \ No newline at end of file diff --git a/models/silver/abis/traces/silver__complete_function_abis.sql b/models/silver/abis/traces/silver__complete_function_abis.sql deleted file mode 100644 index 92bf3874..00000000 --- a/models/silver/abis/traces/silver__complete_function_abis.sql +++ /dev/null @@ -1,270 +0,0 @@ -{{ config ( - materialized = 'incremental', - unique_key = ['parent_contract_address','function_signature','start_block'], - merge_exclude_columns = ["inserted_timestamp"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['stale'] -) }} - -WITH new_abis AS ( - - SELECT - DISTINCT contract_address - FROM - {{ ref('silver__flat_function_abis') }} - -{% if is_incremental() %} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '18 hours' - FROM - {{ this }} - ) -UNION - -- catches any late arriving proxies -SELECT - DISTINCT proxy_address AS contract_address -FROM - {{ ref('silver__proxies') }} -WHERE - start_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '18 hours' - FROM - {{ this }} - ) -{% endif %} -), -proxies AS ( - SELECT - p0.created_block, - p0.proxy_created_block, - p0.contract_address, - p0.proxy_address, - p0.start_block, - p0._id, - p0._inserted_timestamp - FROM - {{ ref('silver__proxies') }} - p0 - JOIN new_abis na0 - ON p0.contract_address = na0.contract_address - UNION - SELECT - p1.created_block, - p1.proxy_created_block, - p1.contract_address, - p1.proxy_address, - p1.start_block, - p1._id, - p1._inserted_timestamp - FROM - {{ ref('silver__proxies') }} - p1 - JOIN new_abis na1 - ON p1.proxy_address = na1.contract_address -), -all_relevant_contracts AS ( - SELECT - DISTINCT contract_address - FROM - proxies - UNION - SELECT - DISTINCT proxy_address AS contract_address - FROM - proxies - UNION - SELECT - contract_address - FROM - new_abis -), -flat_abis AS ( - SELECT - contract_address, - function_name, - abi, - simple_function_name, - function_signature, - inputs, - outputs, - inputs_type, - outputs_type, - _inserted_timestamp - FROM - {{ ref('silver__flat_function_abis') }} - JOIN all_relevant_contracts USING (contract_address) -), -base AS ( - SELECT - ea.contract_address, - function_name, - abi, - simple_function_name, - function_signature, - inputs, - outputs, - inputs_type, - outputs_type, - ea._inserted_timestamp, - pb._inserted_timestamp AS proxy_inserted_timestamp, - pb.start_block, - pb.proxy_created_block, - pb.contract_address AS base_contract_address, - 1 AS priority - FROM - flat_abis ea - JOIN proxies pb - ON ea.contract_address = pb.proxy_address - UNION ALL - SELECT - eab.contract_address, - function_name, - abi, - simple_function_name, - function_signature, - inputs, - outputs, - inputs_type, - outputs_type, - eab._inserted_timestamp, - pbb._inserted_timestamp AS proxy_inserted_timestamp, - pbb.created_block AS start_block, - pbb.proxy_created_block, - pbb.contract_address AS base_contract_address, - 2 AS priority - FROM - flat_abis eab - JOIN ( - SELECT - DISTINCT contract_address, - created_block, - proxy_created_block, - _inserted_timestamp - FROM - proxies - ) pbb - ON eab.contract_address = pbb.contract_address - UNION ALL - SELECT - contract_address, - function_name, - abi, - simple_function_name, - function_signature, - inputs, - outputs, - inputs_type, - outputs_type, - _inserted_timestamp, - NULL AS proxy_inserted_timestamp, - 0 AS start_block, - NULL AS proxy_created_block, - contract_address AS base_contract_address, - 3 AS priority - FROM - flat_abis eac - WHERE - contract_address NOT IN ( - SELECT - DISTINCT contract_address - FROM - proxies - ) -), -new_records AS ( - SELECT - base_contract_address AS parent_contract_address, - contract_address AS implementation_contract, - function_name, - abi, - start_block, - proxy_created_block, - simple_function_name, - function_signature, - inputs, - outputs, - inputs_type, - outputs_type, - _inserted_timestamp, - proxy_inserted_timestamp - FROM - base qualify ROW_NUMBER() over ( - PARTITION BY parent_contract_address, - function_name, - inputs_type, - simple_function_name, - start_block - ORDER BY - priority ASC, - _inserted_timestamp DESC, - proxy_created_block DESC nulls last, - proxy_inserted_timestamp DESC nulls last - ) = 1 -), -FINAL AS ( - SELECT - parent_contract_address, - implementation_contract, - function_name, - abi, - start_block, - proxy_created_block, - simple_function_name, - function_signature, - IFNULL(LEAD(start_block) over (PARTITION BY parent_contract_address, function_signature - ORDER BY - start_block) -1, 1e18) AS end_block, - _inserted_timestamp, - proxy_inserted_timestamp, - SYSDATE() AS _updated_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['parent_contract_address','function_signature','start_block'] - ) }} AS complete_event_abis_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id - FROM - new_records qualify ROW_NUMBER() over ( - PARTITION BY parent_contract_address, - function_name, - function_signature, - start_block - ORDER BY - _inserted_timestamp DESC - ) = 1 -) -SELECT - parent_contract_address, - implementation_contract, - function_name, - abi, - start_block, - proxy_created_block, - simple_function_name, - function_signature, - end_block, - _inserted_timestamp, - proxy_inserted_timestamp, - _updated_timestamp, - complete_event_abis_id, - inserted_timestamp, - modified_timestamp, - _invocation_id -FROM - FINAL - -{% if is_incremental() %} -LEFT JOIN {{ this }} -t USING ( - parent_contract_address, - function_name, - function_signature, - start_block, - end_block -) -WHERE - t.function_signature IS NULL -{% endif %} diff --git a/models/silver/abis/traces/silver__flat_function_abis.sql b/models/silver/abis/traces/silver__flat_function_abis.sql index 6f21e8cf..8b48f93b 100644 --- a/models/silver/abis/traces/silver__flat_function_abis.sql +++ b/models/silver/abis/traces/silver__flat_function_abis.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'contract_address', cluster_by = '_inserted_timestamp::date', - tags = ['abis'], + tags = ['silver','abis'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY (contract_address)" ) }} diff --git a/models/silver/balances/silver__eth_balance_address_blocks.sql b/models/silver/balances/silver__eth_balance_address_blocks.sql index 610b196a..a5322dbe 100644 --- a/models/silver/balances/silver__eth_balance_address_blocks.sql +++ b/models/silver/balances/silver__eth_balance_address_blocks.sql @@ -4,7 +4,7 @@ cluster_by = ['block_timestamp::date','address'], enabled = false, post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(address)", - tags = ['curated'] + tags = ['silver','curated'] ) }} SELECT diff --git a/models/silver/balances/silver__eth_balance_diffs.sql b/models/silver/balances/silver__eth_balance_diffs.sql index bab3efff..4e16bbf2 100644 --- a/models/silver/balances/silver__eth_balance_diffs.sql +++ b/models/silver/balances/silver__eth_balance_diffs.sql @@ -4,7 +4,7 @@ cluster_by = ['block_timestamp::date'], merge_exclude_columns = ["inserted_timestamp"], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['curated'] + tags = ['silver','curated'] ) }} WITH base_table AS ( diff --git a/models/silver/balances/silver__eth_balance_diffs_v2.sql b/models/silver/balances/silver__eth_balance_diffs_v2.sql index 7e07e3aa..994d509b 100644 --- a/models/silver/balances/silver__eth_balance_diffs_v2.sql +++ b/models/silver/balances/silver__eth_balance_diffs_v2.sql @@ -6,7 +6,7 @@ enabled = false, merge_exclude_columns = ["inserted_timestamp"], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['curated'] + tags = ['silver','curated'] ) }} WITH base_table AS ( diff --git a/models/silver/balances/silver__eth_balances.sql b/models/silver/balances/silver__eth_balances.sql index cc0d1178..d8a74f89 100644 --- a/models/silver/balances/silver__eth_balances.sql +++ b/models/silver/balances/silver__eth_balances.sql @@ -6,7 +6,7 @@ incremental_predicates = ["dynamic_range", "block_number"], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", merge_exclude_columns = ["inserted_timestamp"], - tags = ['non_realtime'] + tags = ['silver','balances'] ) }} SELECT diff --git a/models/silver/balances/silver__token_balance_address_blocks.sql b/models/silver/balances/silver__token_balance_address_blocks.sql index 25c35a31..3eaf36cd 100644 --- a/models/silver/balances/silver__token_balance_address_blocks.sql +++ b/models/silver/balances/silver__token_balance_address_blocks.sql @@ -4,7 +4,7 @@ cluster_by = ['block_timestamp::date','contract_address'], enabled = false, post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(address,contract_address)", - tags = ['curated'] + tags = ['silver','curated'] ) }} diff --git a/models/silver/balances/silver__token_balance_diffs.sql b/models/silver/balances/silver__token_balance_diffs.sql index 4bad4c9a..0da9e4d5 100644 --- a/models/silver/balances/silver__token_balance_diffs.sql +++ b/models/silver/balances/silver__token_balance_diffs.sql @@ -4,7 +4,7 @@ cluster_by = ['block_timestamp::date'], merge_exclude_columns = ["inserted_timestamp"], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['curated'] + tags = ['silver','curated'] ) }} WITH base_table AS ( diff --git a/models/silver/balances/silver__token_balance_diffs_v2.sql b/models/silver/balances/silver__token_balance_diffs_v2.sql index 7b373bdc..08fddd80 100644 --- a/models/silver/balances/silver__token_balance_diffs_v2.sql +++ b/models/silver/balances/silver__token_balance_diffs_v2.sql @@ -6,7 +6,7 @@ merge_exclude_columns = ["inserted_timestamp"], enabled = false, post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['curated'] + tags = ['silver','curated'] ) }} WITH base_table AS ( diff --git a/models/silver/balances/silver__token_balances.sql b/models/silver/balances/silver__token_balances.sql index 11e131b4..28f6335f 100644 --- a/models/silver/balances/silver__token_balances.sql +++ b/models/silver/balances/silver__token_balances.sql @@ -6,7 +6,7 @@ incremental_predicates = ["dynamic_range", "block_number"], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", merge_exclude_columns = ["inserted_timestamp"], - tags = ['non_realtime'] + tags = ['silver','balances'] ) }} SELECT diff --git a/models/silver/balances/tests/eth_balances/test_silver__eth_balance_diffs_full.sql b/models/silver/balances/tests/eth_balances/test_silver__eth_balance_diffs_full.sql index 93a9306d..aae5e463 100644 --- a/models/silver/balances/tests/eth_balances/test_silver__eth_balance_diffs_full.sql +++ b/models/silver/balances/tests/eth_balances/test_silver__eth_balance_diffs_full.sql @@ -1,6 +1,6 @@ {{ config ( materialized = 'view', - tags = ['full_test'] + tags = ['test_silver','balances','full_test'] ) }} SELECT diff --git a/models/silver/balances/tests/eth_balances/test_silver__eth_balance_diffs_recent.sql b/models/silver/balances/tests/eth_balances/test_silver__eth_balance_diffs_recent.sql index e240936f..e026b15a 100644 --- a/models/silver/balances/tests/eth_balances/test_silver__eth_balance_diffs_recent.sql +++ b/models/silver/balances/tests/eth_balances/test_silver__eth_balance_diffs_recent.sql @@ -1,6 +1,6 @@ {{ config ( materialized = 'view', - tags = ['recent_test'] + tags = ['test_silver','balances','recent_test'] ) }} WITH last_3_days AS ( diff --git a/models/silver/balances/tests/eth_balances/test_silver__eth_balances_full.sql b/models/silver/balances/tests/eth_balances/test_silver__eth_balances_full.sql index 001c2609..5dbe0c03 100644 --- a/models/silver/balances/tests/eth_balances/test_silver__eth_balances_full.sql +++ b/models/silver/balances/tests/eth_balances/test_silver__eth_balances_full.sql @@ -1,6 +1,6 @@ {{ config ( materialized = 'view', - tags = ['full_test'] + tags = ['test_silver','balances','full_test'] ) }} SELECT diff --git a/models/silver/balances/tests/eth_balances/test_silver__eth_balances_recent.sql b/models/silver/balances/tests/eth_balances/test_silver__eth_balances_recent.sql index bcbe3bf4..a5ac0cb0 100644 --- a/models/silver/balances/tests/eth_balances/test_silver__eth_balances_recent.sql +++ b/models/silver/balances/tests/eth_balances/test_silver__eth_balances_recent.sql @@ -1,6 +1,6 @@ {{ config ( materialized = 'view', - tags = ['recent_test'] + tags = ['test_silver','balances','recent_test'] ) }} WITH last_3_days AS ( diff --git a/models/silver/balances/tests/token_balances/test_silver__token_balance_diffs_full.sql b/models/silver/balances/tests/token_balances/test_silver__token_balance_diffs_full.sql index 42a188ad..c011d47c 100644 --- a/models/silver/balances/tests/token_balances/test_silver__token_balance_diffs_full.sql +++ b/models/silver/balances/tests/token_balances/test_silver__token_balance_diffs_full.sql @@ -1,6 +1,6 @@ {{ config ( materialized = 'view', - tags = ['full_test'] + tags = ['test_silver','balances','full_test'] ) }} SELECT diff --git a/models/silver/balances/tests/token_balances/test_silver__token_balance_diffs_recent.sql b/models/silver/balances/tests/token_balances/test_silver__token_balance_diffs_recent.sql index 791f5107..81df5c25 100644 --- a/models/silver/balances/tests/token_balances/test_silver__token_balance_diffs_recent.sql +++ b/models/silver/balances/tests/token_balances/test_silver__token_balance_diffs_recent.sql @@ -1,6 +1,6 @@ {{ config ( materialized = 'view', - tags = ['recent_test'] + tags = ['test_silver','balances','recent_test'] ) }} WITH last_3_days AS ( diff --git a/models/silver/balances/tests/token_balances/test_silver__token_balances_full.sql b/models/silver/balances/tests/token_balances/test_silver__token_balances_full.sql index 7785d844..01948f9b 100644 --- a/models/silver/balances/tests/token_balances/test_silver__token_balances_full.sql +++ b/models/silver/balances/tests/token_balances/test_silver__token_balances_full.sql @@ -1,6 +1,6 @@ {{ config ( materialized = 'view', - tags = ['full_test'] + tags = ['test_silver','balances','full_test'] ) }} SELECT diff --git a/models/silver/balances/tests/token_balances/test_silver__token_balances_recent.sql b/models/silver/balances/tests/token_balances/test_silver__token_balances_recent.sql index c62d128a..99fce74e 100644 --- a/models/silver/balances/tests/token_balances/test_silver__token_balances_recent.sql +++ b/models/silver/balances/tests/token_balances/test_silver__token_balances_recent.sql @@ -1,6 +1,6 @@ {{ config ( materialized = 'view', - tags = ['recent_test'] + tags = ['test_silver','balances','recent_test'] ) }} WITH last_3_days AS ( diff --git a/models/silver/core/silver__blocks.sql b/models/silver/core/silver__blocks.sql deleted file mode 100644 index ad4ef0b8..00000000 --- a/models/silver/core/silver__blocks.sql +++ /dev/null @@ -1,86 +0,0 @@ --- depends_on: {{ ref('bronze__blocks') }} -{{ config( - materialized = 'incremental', - unique_key = "block_number", - cluster_by = "block_timestamp::date", - merge_exclude_columns = ["inserted_timestamp"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(hash,parent_hash,receipts_root,sha3_uncles,state_root,transactions_root,withdrawals_root)", - full_refresh = false, - tags = ['realtime'] -) }} - -SELECT - block_number, - utils.udf_hex_to_int( - DATA :baseFeePerGas :: STRING - ) :: INT AS base_fee_per_gas, - utils.udf_hex_to_int( - DATA :difficulty :: STRING - ) :: INT AS difficulty, - DATA :extraData :: STRING AS extra_data, - utils.udf_hex_to_int( - DATA :gasLimit :: STRING - ) :: INT AS gas_limit, - utils.udf_hex_to_int( - DATA :gasUsed :: STRING - ) :: INT AS gas_used, - DATA :hash :: STRING AS HASH, - DATA :logsBloom :: STRING AS logs_bloom, - DATA :miner :: STRING AS miner, - utils.udf_hex_to_int( - DATA :nonce :: STRING - ) :: INT AS nonce, - utils.udf_hex_to_int( - DATA :number :: STRING - ) :: INT AS NUMBER, - DATA :parentHash :: STRING AS parent_hash, - DATA :receiptsRoot :: STRING AS receipts_root, - DATA :sha3Uncles :: STRING AS sha3_uncles, - utils.udf_hex_to_int( - DATA :size :: STRING - ) :: INT AS SIZE, - DATA :stateRoot :: STRING AS state_root, - utils.udf_hex_to_int( - DATA :timestamp :: STRING - ) :: TIMESTAMP AS block_timestamp, - utils.udf_hex_to_int( - DATA :totalDifficulty :: STRING - ) :: INT AS total_difficulty, - ARRAY_SIZE( - DATA :transactions - ) AS tx_count, - DATA :transactionsRoot :: STRING AS transactions_root, - DATA :uncles AS uncles, - DATA :withdrawals AS withdrawals, - DATA :withdrawalsRoot :: STRING AS withdrawals_root, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['block_number'] - ) }} AS blocks_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id, - utils.udf_hex_to_int( - DATA: blobGasUsed :: STRING - ) :: INT AS blob_gas_used, - utils.udf_hex_to_int( - DATA: excessBlobGas :: STRING - ) :: INT AS excess_blob_gas -FROM - -{% if is_incremental() %} -{{ ref('bronze__blocks') }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) -{% else %} - {{ ref('bronze__blocks_fr') }} -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY block_number -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/core/silver__confirmed_blocks.sql b/models/silver/core/silver__confirmed_blocks.sql deleted file mode 100644 index 6d18edda..00000000 --- a/models/silver/core/silver__confirmed_blocks.sql +++ /dev/null @@ -1,50 +0,0 @@ --- depends_on: {{ ref('bronze__confirm_blocks') }} -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = "round(block_number,-3)", - tags = ['realtime'] -) }} - -WITH base AS ( - - SELECT - block_number, - DATA :result :hash :: STRING AS block_hash, - DATA :result :transactions AS txs, - _inserted_timestamp - FROM - -{% if is_incremental() %} -{{ ref('bronze__confirm_blocks') }} -WHERE - _inserted_timestamp >= ( - SELECT - IFNULL( - MAX( - _inserted_timestamp - ), - '1970-01-01' :: TIMESTAMP - ) _inserted_timestamp - FROM - {{ this }} - ) -{% else %} - {{ ref('bronze__confirm_blocks_fr') }} -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY block_number -ORDER BY - _inserted_timestamp DESC)) = 1 -) -SELECT - block_number, - block_hash, - VALUE :: STRING AS tx_hash, - _inserted_timestamp -FROM - base, - LATERAL FLATTEN ( - input => txs - ) diff --git a/models/silver/core/silver__contracts.sql b/models/silver/core/silver__contracts.sql deleted file mode 100644 index cdda496a..00000000 --- a/models/silver/core/silver__contracts.sql +++ /dev/null @@ -1,106 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'address', - merge_exclude_columns = ["inserted_timestamp"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(address, symbol, name), SUBSTRING(address, symbol, name)", - tags = ['non_realtime'] -) }} - -WITH legacy AS ( - - SELECT - LOWER(address) :: STRING AS address, - meta :symbol :: STRING AS symbol, - meta :name :: STRING AS NAME, - meta :decimals :: INTEGER AS decimals, - meta AS contract_metadata, - '2000-01-01' :: TIMESTAMP AS _inserted_timestamp - FROM - {{ source( - 'ethereum_bronze', - 'legacy_contracts' - ) }} - WHERE - meta IS NOT NULL - -{% if is_incremental() %} -AND 1 = 2 -{% endif %} -), -streamline_reads AS ( - SELECT - LOWER( - A.contract_address - ) :: STRING AS address, - A.token_symbol :: STRING AS symbol, - A.token_name :: STRING AS NAME, - TRY_TO_NUMBER( - A.token_decimals - ) :: INTEGER AS decimals, - contract_metadata, - A._inserted_timestamp - FROM - {{ ref('silver__token_meta_reads') }} A - LEFT JOIN legacy - ON LOWER(contract_address) = LOWER(address) -{% if is_incremental() %} -WHERE -A._inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) :: DATE - 2 - FROM - {{ this }} -) -{% endif %} -), -all_records AS ( - SELECT - address, - symbol, - NAME, - decimals, - contract_metadata, - _inserted_timestamp - FROM - legacy - UNION ALL - SELECT - address, - symbol, - NAME, - decimals, - contract_metadata, - _inserted_timestamp - FROM - streamline_reads -) -SELECT - - address, - symbol, - NAME, - decimals, - contract_metadata, - _inserted_timestamp, - CASE - WHEN decimals IS NOT NULL AND symbol IS NOT NULL AND NAME IS NOT NULL THEN 7 - WHEN symbol IS NOT NULL AND decimals IS NOT NULL THEN 6 - WHEN NAME IS NOT NULL AND decimals IS NOT NULL THEN 5 - WHEN NAME IS NOT NULL AND symbol IS NOT NULL THEN 4 - WHEN decimals IS NOT NULL THEN 3 - WHEN symbol IS NOT NULL THEN 2 - WHEN name IS NOT NULL THEN 1 - ELSE 0 - END AS ranker, - {{ dbt_utils.generate_surrogate_key( - ['address'] - ) }} AS contracts_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - all_records qualify(ROW_NUMBER() over(PARTITION BY address -ORDER BY - ranker DESC)) = 1 diff --git a/models/silver/core/silver__contracts.yml b/models/silver/core/silver__contracts.yml deleted file mode 100644 index f52d02d9..00000000 --- a/models/silver/core/silver__contracts.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: 2 -models: - - name: silver__contracts - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - address - columns: - - name: address - tests: - - not_null \ No newline at end of file diff --git a/models/silver/core/silver__created_contracts.sql b/models/silver/core/silver__created_contracts.sql deleted file mode 100644 index 7a1ff898..00000000 --- a/models/silver/core/silver__created_contracts.sql +++ /dev/null @@ -1,45 +0,0 @@ -{{ config ( - materialized = "incremental", - unique_key = "created_contract_address", - merge_exclude_columns = ["inserted_timestamp"], - cluster_by = ['block_timestamp::date'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, created_contract_address, creator_address), SUBSTRING(created_contract_address, creator_address)", - tags = ['non_realtime'] -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - to_address AS created_contract_address, - from_address AS creator_address, - input AS created_contract_input, - modified_timestamp AS _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['to_address'] - ) }} AS created_contracts_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {{ ref('core__fact_traces') }} -WHERE - TYPE ILIKE 'create%' - AND to_address IS NOT NULL - AND input IS NOT NULL - AND input != '0x' - AND tx_succeeded - AND trace_succeeded - -{% if is_incremental() %} -AND modified_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '24 hours' - FROM - {{ this }} -) -{% endif %} - -qualify(ROW_NUMBER() over(PARTITION BY created_contract_address -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/core/silver__created_contracts.yml b/models/silver/core/silver__created_contracts.yml deleted file mode 100644 index 729e7695..00000000 --- a/models/silver/core/silver__created_contracts.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 2 -models: - - name: silver__created_contracts - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - created_contract_address - columns: - - name: BLOCK_TIMESTAMP - tests: - - not_null: - where: BLOCK_TIMESTAMP < CURRENT_DATE - 1 - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - \ No newline at end of file diff --git a/models/silver/core/silver__decoded_logs.sql b/models/silver/core/silver__decoded_logs.sql deleted file mode 100644 index 20338b18..00000000 --- a/models/silver/core/silver__decoded_logs.sql +++ /dev/null @@ -1,239 +0,0 @@ --- depends_on: {{ ref('bronze__decoded_logs') }} -{{ config ( - materialized = "incremental", - unique_key = ['block_number', 'event_index'], - cluster_by = "block_timestamp::date", - incremental_predicates = ["dynamic_range", "block_number"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - full_refresh = false, - merge_exclude_columns = ["inserted_timestamp"], - tags = ['decoded_logs','reorg'] -) }} - -WITH base_data AS ( - - SELECT - block_number :: INTEGER AS block_number, - SPLIT( - id, - '-' - ) [0] :: STRING AS tx_hash, - SPLIT( - id, - '-' - ) [1] :: INTEGER AS event_index, - DATA :name :: STRING AS event_name, - LOWER( - DATA :address :: STRING - ) :: STRING AS contract_address, - DATA AS decoded_data, - id :: STRING AS _log_id, - TO_TIMESTAMP_NTZ(_inserted_timestamp) AS _inserted_timestamp - FROM - -{% if is_incremental() %} -{{ ref('bronze__decoded_logs') }} -WHERE - TO_TIMESTAMP_NTZ(_inserted_timestamp) >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '2 hours' - FROM - {{ this }} - ) - AND DATA NOT ILIKE '%Event topic is not present in given ABI%' -{% else %} - {{ ref('bronze__decoded_logs_fr') }} -WHERE - _partition_by_block_number <= 4000000 - AND DATA NOT ILIKE '%Event topic is not present in given ABI%' -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY block_number, event_index -ORDER BY - _inserted_timestamp DESC, _partition_by_created_date DESC)) = 1 -), -transformed_logs AS ( - SELECT - block_number, - tx_hash, - event_index, - contract_address, - event_name, - decoded_data, - _inserted_timestamp, - _log_id, - utils.udf_transform_logs(decoded_data) AS transformed - FROM - base_data -), -FINAL AS ( - SELECT - b.tx_hash, - b.block_number, - b.event_index, - b.event_name, - b.contract_address, - b.decoded_data, - transformed, - b._log_id, - b._inserted_timestamp, - OBJECT_AGG( - DISTINCT CASE - WHEN v.value :name = '' THEN CONCAT( - 'anonymous_', - v.index - ) - ELSE v.value :name - END, - v.value :value - ) AS decoded_flat - FROM - transformed_logs b, - LATERAL FLATTEN( - input => transformed :data - ) v - GROUP BY - b.tx_hash, - b.block_number, - b.event_index, - b.event_name, - b.contract_address, - b.decoded_data, - transformed, - b._log_id, - b._inserted_timestamp -), -new_records AS ( - SELECT - b.tx_hash, - b.block_number, - b.event_index, - b.event_name, - b.contract_address, - b.decoded_data, - b.transformed, - b._log_id, - b._inserted_timestamp, - b.decoded_flat, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - topics, - DATA, - event_removed :: STRING AS event_removed, - tx_status, - CASE - WHEN block_timestamp IS NULL THEN TRUE - ELSE FALSE - END AS is_pending - FROM - FINAL b - LEFT JOIN {{ ref('silver__logs') }} USING ( - block_number, - _log_id - ) -) - -{% if is_incremental() %}, -missing_data AS ( - SELECT - t.tx_hash, - t.block_number, - t.event_index, - t.event_name, - t.contract_address, - t.decoded_data, - t.transformed, - t._log_id, - GREATEST( - TO_TIMESTAMP_NTZ( - t._inserted_timestamp - ), - TO_TIMESTAMP_NTZ( - l._inserted_timestamp - ) - ) AS _inserted_timestamp, - t.decoded_flat, - l.block_timestamp, - l.origin_function_signature, - l.origin_from_address, - l.origin_to_address, - l.topics, - l.data, - l.event_removed :: STRING AS event_removed, - l.tx_status, - FALSE AS is_pending - FROM - {{ this }} - t - INNER JOIN {{ ref('silver__logs') }} - l USING ( - block_number, - _log_id - ) - WHERE - t.is_pending - AND l.block_timestamp IS NOT NULL -) -{% endif %} -SELECT - tx_hash, - block_number, - event_index, - event_name, - contract_address, - decoded_data, - transformed, - _log_id, - _inserted_timestamp, - decoded_flat, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - topics, - DATA, - event_removed, - tx_status, - is_pending, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} AS decoded_logs_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - new_records - -{% if is_incremental() %} -UNION -SELECT - tx_hash, - block_number, - event_index, - event_name, - contract_address, - decoded_data, - transformed, - _log_id, - _inserted_timestamp, - decoded_flat, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - topics, - DATA, - event_removed, - tx_status, - is_pending, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} AS decoded_logs_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - missing_data -{% endif %} diff --git a/models/silver/core/silver__decoded_traces.sql b/models/silver/core/silver__decoded_traces.sql index 23a77595..d819d390 100644 --- a/models/silver/core/silver__decoded_traces.sql +++ b/models/silver/core/silver__decoded_traces.sql @@ -7,7 +7,7 @@ post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", merge_exclude_columns = ["inserted_timestamp"], full_refresh = false, - tags = ['decoded_traces','reorg'] + tags = ['silver','decoded_traces'] ) }} WITH base AS ( @@ -41,7 +41,10 @@ new_records AS ( b.block_number, tx_hash, block_timestamp, - tx_status, + CASE + WHEN tx_succeeded = TRUE THEN 'SUCCESS' + ELSE 'FAIL' + END AS tx_status, tx_position, trace_index, from_address, @@ -52,10 +55,12 @@ new_records AS ( gas, gas_used, TYPE, - identifier, sub_traces, error_reason, - trace_status, + CASE + WHEN trace_succeeded = TRUE THEN 'SUCCESS' + ELSE 'FAIL' + END AS trace_status, concat_ws( '-', t.block_number, @@ -97,7 +102,10 @@ missing_data AS ( t.block_number, tr.tx_hash, tr.block_timestamp, - tr.tx_status, + CASE + WHEN tr.tx_succeeded = TRUE THEN 'SUCCESS' + ELSE 'FAIL' + END AS tx_status, tr.trace_index, tr.tx_position, tr.from_address, @@ -108,10 +116,12 @@ missing_data AS ( tr.gas, tr.gas_used, tr.type, - tr.identifier, tr.sub_traces, tr.error_reason, - tr.trace_status, + CASE + WHEN tr.trace_succeeded = TRUE THEN 'SUCCESS' + ELSE 'FAIL' + END AS trace_status, t._call_id, t.decoded_data, tr.input, @@ -154,7 +164,6 @@ SELECT gas, gas_used, TYPE, - identifier, sub_traces, error_reason, trace_status, @@ -190,7 +199,6 @@ SELECT gas, gas_used, TYPE, - identifier, sub_traces, error_reason, trace_status, diff --git a/models/silver/core/silver__eth_transfers.sql b/models/silver/core/silver__eth_transfers.sql deleted file mode 100644 index 77e51bd6..00000000 --- a/models/silver/core/silver__eth_transfers.sql +++ /dev/null @@ -1,31 +0,0 @@ -{{ config( - materialized = 'view' -) }} - -SELECT - tx_hash, - block_number, - block_timestamp, - from_address, - to_address, - value AS eth_value, - identifier, - concat_ws( - '-', - block_number, - tx_position, - CONCAT( - type, - '_', - trace_address - ) - ) AS _call_id, - modified_timestamp AS _inserted_timestamp, - input -FROM - {{ ref('core__fact_traces') }} -WHERE - TYPE = 'CALL' - AND eth_value > 0 - AND tx_succeeded - AND trace_succeeded diff --git a/models/silver/core/silver__logs.sql b/models/silver/core/silver__logs.sql deleted file mode 100644 index 5f795a44..00000000 --- a/models/silver/core/silver__logs.sql +++ /dev/null @@ -1,195 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = "block_timestamp::date, _inserted_timestamp::date", - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - full_refresh = false, - tags = ['realtime'] -) }} - -WITH base AS ( - - SELECT - block_number, - tx_hash, - from_address AS origin_from_address, - to_address AS origin_to_address, - tx_status, - {# position AS tx_position, --new column #} - logs, - _inserted_timestamp - FROM - {{ ref('silver__receipts') }} - WHERE - ARRAY_SIZE(logs) > 0 - -{% if is_incremental() %} -AND _INSERTED_TIMESTAMP >= ( - SELECT - MAX(_INSERTED_TIMESTAMP) _INSERTED_TIMESTAMP - FROM - {{ this }} -) -{% endif %} -), -flat_logs AS ( - SELECT - block_number, - tx_hash, - origin_from_address, - origin_to_address, - tx_status, - {# tx_position, #} - VALUE :address :: STRING AS contract_address, - VALUE :blockHash :: STRING AS block_hash, - VALUE :data :: STRING AS DATA, - utils.udf_hex_to_int( - VALUE :logIndex :: STRING - ) :: INT AS event_index, - VALUE :removed :: BOOLEAN AS event_removed, - VALUE :topics AS topics, - _inserted_timestamp - FROM - base, - LATERAL FLATTEN( - input => logs - ) -), -new_records AS ( - SELECT - l.block_number, - txs.block_timestamp, - l.tx_hash, - l.origin_from_address, - l.origin_to_address, - txs.origin_function_signature, - l.tx_status, - {# l.tx_position, #} - l.contract_address, - l.block_hash, - l.data, - l.event_index, - l.event_removed, - l.topics, - l._inserted_timestamp, - CASE - WHEN txs.block_timestamp IS NULL - OR txs.origin_function_signature IS NULL THEN TRUE - ELSE FALSE - END AS is_pending, - CONCAT( - l.tx_hash :: STRING, - '-', - l.event_index :: STRING - ) AS _log_id - FROM - flat_logs l - LEFT OUTER JOIN {{ ref('silver__transactions') }} - txs - ON l.block_number = txs.block_number - AND l.tx_hash = txs.tx_hash - -{% if is_incremental() %} -AND txs._INSERTED_TIMESTAMP >= ( - SELECT - MAX(_inserted_timestamp) :: DATE - 1 - FROM - {{ this }} -) -{% endif %} -) - -{% if is_incremental() %}, -missing_data AS ( - SELECT - t.block_number, - txs.block_timestamp, - t.tx_hash, - t.origin_from_address, - t.origin_to_address, - txs.origin_function_signature, - t.tx_status, - {# t.tx_position, #} - t.contract_address, - t.block_hash, - t.data, - t.event_index, - t.event_removed, - t.topics, - GREATEST( - t._inserted_timestamp, - txs._inserted_timestamp - ) AS _inserted_timestamp, - _log_id, - FALSE AS is_pending - FROM - {{ this }} - t - LEFT JOIN {{ ref('silver__transactions') }} - txs USING ( - block_number, - tx_hash - ) - WHERE - t.is_pending -) -{% endif %}, -FINAL AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - origin_from_address, - origin_to_address, - origin_function_signature, - tx_status, - {# tx_position, #} - contract_address, - block_hash, - DATA, - event_index, - event_removed, - topics, - _inserted_timestamp, - _log_id, - is_pending - FROM - new_records - -{% if is_incremental() %} -UNION -SELECT - block_number, - block_timestamp, - tx_hash, - origin_from_address, - origin_to_address, - origin_function_signature, - tx_status, - {# tx_position, #} - contract_address, - block_hash, - DATA, - event_index, - event_removed, - topics, - _inserted_timestamp, - _log_id, - is_pending -FROM - missing_data -{% endif %} -) -SELECT - *, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} AS logs_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - FINAL qualify(ROW_NUMBER() over (PARTITION BY block_number, event_index -ORDER BY - _inserted_timestamp DESC, is_pending ASC)) = 1 diff --git a/models/silver/core/silver__native_transfers.sql b/models/silver/core/silver__native_transfers.sql deleted file mode 100644 index 4b8faa2f..00000000 --- a/models/silver/core/silver__native_transfers.sql +++ /dev/null @@ -1,118 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'block_number', - cluster_by = ['block_timestamp::DATE'], - tags = ['core','non_realtime','reorg'] -) }} - -WITH eth_base AS ( - - SELECT - tx_hash, - block_number, - block_timestamp, - identifier, --deprecate - from_address, - to_address, - value, - concat_ws( - '-', - block_number, - tx_position, - CONCAT( - type, - '_', - trace_address - ) - ) AS _call_id, - modified_timestamp AS _inserted_timestamp, - value_precise_raw, - value_precise, - tx_position, - trace_index - FROM - {{ ref('core__fact_traces') }} - WHERE - value > 0 - AND tx_succeeded - AND trace_succeeded - AND TYPE NOT IN ( - 'DELEGATECALL', - 'STATICCALL' - ) - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '72 hours' - FROM - {{ this }} -) -{% endif %} -), -tx_table AS ( - SELECT - block_number, - tx_hash, - from_address AS origin_from_address, - to_address AS origin_to_address, - origin_function_signature - FROM - {{ ref('core__fact_transactions') }} - WHERE - tx_hash IN ( - SELECT - DISTINCT tx_hash - FROM - eth_base - ) - -{% if is_incremental() %} -AND modified_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '72 hours' - FROM - {{ this }} -) -{% endif %} -) -SELECT - tx_hash, - block_number, - block_timestamp, - identifier, --deprecate - origin_from_address, - origin_to_address, - origin_function_signature, - from_address, - to_address, - value AS amount, - value_precise_raw AS amount_precise_raw, - value_precise AS amount_precise, - ROUND( - value * price, - 2 - ) AS amount_usd, - _call_id, - _inserted_timestamp, - tx_position, - trace_index, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'trace_index'] - ) }} AS native_transfers_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - eth_base A - LEFT JOIN {{ ref('price__ez_prices_hourly') }} - ON DATE_TRUNC( - 'hour', - block_timestamp - ) = HOUR - AND token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' - JOIN tx_table USING ( - tx_hash, - block_number - ) diff --git a/models/silver/core/silver__receipts.sql b/models/silver/core/silver__receipts.sql deleted file mode 100644 index 0b4ff35c..00000000 --- a/models/silver/core/silver__receipts.sql +++ /dev/null @@ -1,102 +0,0 @@ --- depends_on: {{ ref('bronze__receipts') }} -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(block_hash, tx_hash, from_address, to_address)", - full_refresh = false, - tags = ['realtime'] -) }} - -WITH base AS ( - - SELECT - block_number, - DATA, - _inserted_timestamp - FROM - -{% if is_incremental() %} -{{ ref('bronze__receipts') }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) - AND IS_OBJECT( - DATA - ) -{% else %} - {{ ref('bronze__receipts_fr') }} -WHERE - IS_OBJECT( - DATA - ) -{% endif %} -), -FINAL AS ( - SELECT - block_number, - DATA :blockHash :: STRING AS block_hash, - utils.udf_hex_to_int( - DATA :blockNumber :: STRING - ) :: INT AS blockNumber, - utils.udf_hex_to_int( - DATA :cumulativeGasUsed :: STRING - ) :: INT AS cumulative_gas_used, - utils.udf_hex_to_int( - DATA :effectiveGasPrice :: STRING - ) :: INT / pow( - 10, - 9 - ) AS effective_gas_price, - DATA :from :: STRING AS from_address, - utils.udf_hex_to_int( - DATA :gasUsed :: STRING - ) :: INT AS gas_used, - DATA :logs AS logs, - DATA :logsBloom :: STRING AS logs_bloom, - utils.udf_hex_to_int( - DATA :status :: STRING - ) :: INT AS status, - CASE - WHEN status = 1 THEN TRUE - ELSE FALSE - END AS tx_success, - CASE - WHEN status = 1 THEN 'SUCCESS' - ELSE 'FAIL' - END AS tx_status, - DATA :to :: STRING AS to_address1, - CASE - WHEN to_address1 = '' THEN NULL - ELSE to_address1 - END AS to_address, - DATA :transactionHash :: STRING AS tx_hash, - utils.udf_hex_to_int( - DATA :transactionIndex :: STRING - ) :: INT AS POSITION, - utils.udf_hex_to_int( - DATA :type :: STRING - ) :: INT AS TYPE, - _inserted_timestamp, - utils.udf_hex_to_int( - DATA :blobGasPrice :: STRING - ) :: INT AS blob_gas_price, - utils.udf_hex_to_int( - DATA :blobGasUsed :: STRING - ) :: INT AS blob_gas_used - FROM - base -) -SELECT - * -FROM - FINAL -WHERE - tx_hash IS NOT NULL qualify(ROW_NUMBER() over (PARTITION BY block_number, POSITION -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/core/silver__relevant_contracts.sql b/models/silver/core/silver__relevant_contracts.sql deleted file mode 100644 index 14ba6cfd..00000000 --- a/models/silver/core/silver__relevant_contracts.sql +++ /dev/null @@ -1,134 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = "contract_address", - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(contract_address)", - tags = ['non_realtime'] -) }} - -WITH emitted_events AS ( - - SELECT - contract_address, - COUNT(*) AS event_count, - MAX(modified_timestamp) AS max_inserted_timestamp_logs, - MAX(block_number) AS latest_event_block - FROM - {{ ref('core__fact_event_logs') }} - -{% if is_incremental() %} -WHERE - modified_timestamp > ( - SELECT - MAX(max_inserted_timestamp_logs) - FROM - {{ this }} - ) -{% endif %} -GROUP BY - contract_address -), -function_calls AS ( - SELECT - to_address AS contract_address, - COUNT(*) AS function_call_count, - MAX(modified_timestamp) AS max_inserted_timestamp_traces, - MAX(block_number) AS latest_call_block - FROM - {{ ref('core__fact_traces') }} - WHERE - tx_succeeded - AND trace_succeeded - AND to_address IS NOT NULL - AND input IS NOT NULL - AND input <> '0x' - -{% if is_incremental() %} -AND modified_timestamp > ( - SELECT - MAX(max_inserted_timestamp_traces) - FROM - {{ this }} -) -{% endif %} -GROUP BY - 1 -), -active_contracts AS ( - SELECT - contract_address - FROM - emitted_events - UNION - SELECT - contract_address - FROM - function_calls -), -previous_totals AS ( - -{% if is_incremental() %} -SELECT - contract_address, total_event_count, total_call_count, max_inserted_timestamp_logs, latest_event_block, max_inserted_timestamp_traces, latest_call_block -FROM - {{ this }} -{% else %} -SELECT - NULL AS contract_address, 0 AS total_event_count, 0 AS total_call_count, '1970-01-01 00:00:00' AS max_inserted_timestamp_logs, 0 AS latest_event_block, '1970-01-01 00:00:00' AS max_inserted_timestamp_traces, 0 AS latest_call_block -{% endif %}) -SELECT - C.contract_address, - COALESCE( - p.total_event_count, - 0 - ) + COALESCE( - e.event_count, - 0 - ) AS total_event_count, - COALESCE( - p.total_call_count, - 0 - ) + COALESCE( - f.function_call_count, - 0 - ) AS total_call_count, - COALESCE( - p.total_event_count, - 0 - ) + COALESCE( - e.event_count, - 0 - ) + COALESCE( - p.total_call_count, - 0 - ) + COALESCE( - f.function_call_count, - 0 - ) AS total_interaction_count, - COALESCE( - e.max_inserted_timestamp_logs, - p.max_inserted_timestamp_logs, - '1970-01-01 00:00:00' - ) AS max_inserted_timestamp_logs, - COALESCE( - f.max_inserted_timestamp_traces, - p.max_inserted_timestamp_traces, - '1970-01-01 00:00:00' - ) AS max_inserted_timestamp_traces, - COALESCE( - e.latest_event_block, - p.latest_event_block, - 0 - ) AS latest_event_block, - COALESCE( - f.latest_call_block, - p.latest_call_block, - 0 - ) AS latest_call_block -FROM - active_contracts C - LEFT JOIN emitted_events e - ON C.contract_address = e.contract_address - LEFT JOIN function_calls f - ON C.contract_address = f.contract_address - LEFT JOIN previous_totals p - ON C.contract_address = p.contract_address diff --git a/models/silver/core/silver__token_meta_reads.sql b/models/silver/core/silver__token_meta_reads.sql index 4a8222fa..505b3441 100644 --- a/models/silver/core/silver__token_meta_reads.sql +++ b/models/silver/core/silver__token_meta_reads.sql @@ -1,7 +1,7 @@ {{ config( materialized = 'incremental', unique_key = 'contract_address', - tags = ['non_realtime'] + tags = ['silver','reads'] ) }} WITH @@ -31,7 +31,7 @@ reads_base_metadata AS ( read_result AS read_output, _inserted_timestamp FROM - {{ ref('bronze_api__contract_reads') }} + {{ ref('bronze_api__token_reads') }} WHERE read_result IS NOT NULL AND read_result <> '0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000' diff --git a/models/silver/core/silver__traces.sql b/models/silver/core/silver__traces.sql deleted file mode 100644 index 142e9a0c..00000000 --- a/models/silver/core/silver__traces.sql +++ /dev/null @@ -1,162 +0,0 @@ --- depends_on: {{ ref('bronze__traces') }} -{{ config ( - materialized = "incremental", - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = ['modified_timestamp::DATE','partition_key'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - full_refresh = false, - tags = ['realtime'] -) }} -{# {{ fsc_evm.silver_traces_v1( -full_reload_start_block = 3000000, -full_reload_blocks = 1000000, -use_partition_key = TRUE -) }} -#} -WITH bronze_traces AS ( - - SELECT - block_number, - partition_key, - VALUE :array_index :: INT AS tx_position, - DATA :result AS full_traces, - _inserted_timestamp - FROM - -{% if is_incremental() and not full_reload_mode %} -{{ ref( - 'bronze__traces' -) }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) - AND DATA :result IS NOT NULL {% elif is_incremental() and full_reload_mode %} - {{ ref( - 'bronze__traces_fr' - ) }} -WHERE - partition_key BETWEEN ( - SELECT - MAX(partition_key) - 100000 - FROM - {{ this }} - ) - AND ( - SELECT - MAX(partition_key) + 1000000 - FROM - {{ this }} - ) -{% else %} - {{ ref( - 'bronze__traces_fr' - ) }} -WHERE - partition_key <= 3000000 -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY block_number, tx_position -ORDER BY - _inserted_timestamp DESC)) = 1 -), -flatten_traces AS ( - SELECT - block_number, - tx_position, - partition_key, - IFF( - path IN ( - 'result', - 'result.value', - 'result.type', - 'result.to', - 'result.input', - 'result.gasUsed', - 'result.gas', - 'result.from', - 'result.output', - 'result.error', - 'result.revertReason', - 'result.time', - 'gasUsed', - 'gas', - 'type', - 'to', - 'from', - 'value', - 'input', - 'error', - 'output', - 'time', - 'revertReason' - ), - 'ORIGIN', - REGEXP_REPLACE(REGEXP_REPLACE(path, '[^0-9]+', '_'), '^_|_$', '') - ) AS trace_address, - _inserted_timestamp, - OBJECT_AGG( - key, - VALUE - ) AS trace_json, - CASE - WHEN trace_address = 'ORIGIN' THEN NULL - WHEN POSITION( - '_' IN trace_address - ) = 0 THEN 'ORIGIN' - ELSE REGEXP_REPLACE( - trace_address, - '_[0-9]+$', - '', - 1, - 1 - ) - END AS parent_trace_address, - SPLIT( - trace_address, - '_' - ) AS trace_address_array - FROM - bronze_traces txs, - TABLE( - FLATTEN( - input => PARSE_JSON( - txs.full_traces - ), - recursive => TRUE - ) - ) f - WHERE - f.index IS NULL - AND f.key != 'calls' - AND f.path != 'result' - GROUP BY - block_number, - tx_position, - partition_key, - trace_address, - _inserted_timestamp -) -SELECT - block_number, - tx_position, - trace_address, - parent_trace_address, - trace_address_array, - trace_json, - partition_key, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['block_number', 'tx_position', 'trace_address'] - ) }} AS traces_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - flatten_traces qualify(ROW_NUMBER() over(PARTITION BY traces_id -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/core/silver__transactions.sql b/models/silver/core/silver__transactions.sql deleted file mode 100644 index b7a7b9a5..00000000 --- a/models/silver/core/silver__transactions.sql +++ /dev/null @@ -1,346 +0,0 @@ --- depends_on: {{ ref('bronze__transactions') }} -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = "block_timestamp::date, _inserted_timestamp::date", - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['realtime'] -) }} - -WITH base AS ( - - SELECT - block_number, - DATA, - _inserted_timestamp - FROM - -{% if is_incremental() %} -{{ ref('bronze__transactions') }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) - AND IS_OBJECT(DATA) -{% else %} - {{ ref('bronze__transactions_fr') }} -WHERE - IS_OBJECT(DATA) -{% endif %} -), -base_tx AS ( - SELECT - A.block_number AS block_number, - A.data :blockHash :: STRING AS block_hash, - utils.udf_hex_to_int( - A.data :blockNumber :: STRING - ) :: INT AS blockNumber, - utils.udf_hex_to_int( - A.data :chainId :: STRING - ) :: INT AS chain_id, - A.data :from :: STRING AS from_address, - utils.udf_hex_to_int( - A.data :gas :: STRING - ) :: INT AS gas, - utils.udf_hex_to_int( - A.data :gasPrice :: STRING - ) :: INT / pow( - 10, - 9 - ) AS gas_price, - A.data :hash :: STRING AS tx_hash, - A.data :input :: STRING AS input_data, - SUBSTR( - input_data, - 1, - 10 - ) AS origin_function_signature, - utils.udf_hex_to_int( - A.data :maxFeePerGas :: STRING - ) :: INT / pow( - 10, - 9 - ) AS max_fee_per_gas, - utils.udf_hex_to_int( - A.data :maxPriorityFeePerGas :: STRING - ) :: INT / pow( - 10, - 9 - ) AS max_priority_fee_per_gas, - utils.udf_hex_to_int( - A.data :nonce :: STRING - ) :: INT AS nonce, - A.data :r :: STRING AS r, - A.data :s :: STRING AS s, - A.data :to :: STRING AS to_address1, - CASE - WHEN to_address1 = '' THEN NULL - ELSE to_address1 - END AS to_address, - utils.udf_hex_to_int( - A.data :transactionIndex :: STRING - ) :: INT AS POSITION, - A.data :type :: STRING AS TYPE, - A.data :v :: STRING AS v, - utils.udf_hex_to_int( - A.data :value :: STRING - ) AS value_precise_raw, - utils.udf_decimal_adjust( - value_precise_raw, - 18 - ) AS value_precise, - value_precise :: FLOAT AS VALUE, - A.data :accessList AS access_list, - A._INSERTED_TIMESTAMP, - A.data, - A.data: blobVersionedHashes :: ARRAY AS blob_versioned_hashes, - utils.udf_hex_to_int( - A.data: maxFeePerBlobGas :: STRING - ) :: INT AS max_fee_per_blob_gas - FROM - base A -), -new_records AS ( - SELECT - t.block_number, - t.block_hash, - t.chain_id, - t.from_address, - t.gas, - t.gas_price, - t.tx_hash, - t.input_data, - t.origin_function_signature, - t.max_fee_per_gas, - t.max_priority_fee_per_gas, - t.nonce, - t.r, - t.s, - t.to_address1, - t.to_address, - t.position, - t.type, - t.v, - t.value_precise_raw, - t.value_precise, - t.value, - block_timestamp, - CASE - WHEN block_timestamp IS NULL - OR tx_status IS NULL THEN TRUE - ELSE FALSE - END AS is_pending, - r.gas_used, - tx_success, - tx_status, - cumulative_gas_used, - effective_gas_price, - utils.udf_decimal_adjust( - utils.udf_hex_to_int( - t.data :gasPrice :: STRING - ) :: bigint * r.gas_used, - 18 - ) AS tx_fee_precise, - COALESCE( - tx_fee_precise :: FLOAT, - 0 - ) AS tx_fee, - r.type AS tx_type, - t.access_list, - t._inserted_timestamp, - t.data, - t.blob_versioned_hashes, - t.max_fee_per_blob_gas, - r.blob_gas_used, - r.blob_gas_price - FROM - base_tx t - LEFT OUTER JOIN {{ ref('silver__blocks') }} - b - ON t.block_number = b.block_number - LEFT OUTER JOIN {{ ref('silver__receipts') }} - r - ON t.block_number = r.block_number - AND t.tx_hash = r.tx_hash - -{% if is_incremental() %} -AND r._INSERTED_TIMESTAMP >= ( - SELECT - MAX(_inserted_timestamp) :: DATE - 1 - FROM - {{ this }} -) -{% endif %} -) - -{% if is_incremental() %}, -missing_data AS ( - SELECT - t.block_number, - t.block_hash, - t.chain_id, - t.from_address, - t.gas, - t.gas_price, - t.tx_hash, - t.input_data, - t.origin_function_signature, - t.max_fee_per_gas, - t.max_priority_fee_per_gas, - t.nonce, - t.r, - t.s, - t.to_address, - t.position, - t.type, - t.v, - t.value_precise_raw, - t.value_precise, - t.value, - b.block_timestamp, - FALSE AS is_pending, - r.gas_used, - r.tx_success, - r.tx_status, - r.cumulative_gas_used, - r.effective_gas_price, - utils.udf_decimal_adjust( - utils.udf_hex_to_int( - t.data :gasPrice :: STRING - ) :: bigint * r.gas_used, - 18 - ) AS tx_fee_precise_heal, - COALESCE( - tx_fee_precise_heal :: FLOAT, - 0 - ) AS tx_fee, - r.type AS tx_type, - t.access_list, - GREATEST( - t._inserted_timestamp, - b._inserted_timestamp, - r._inserted_timestamp - ) AS _inserted_timestamp, - t.data, - t.blob_versioned_hashes, - t.max_fee_per_blob_gas, - r.blob_gas_used, - r.blob_gas_price - FROM - {{ this }} - t - LEFT JOIN {{ ref('silver__blocks') }} - b - ON t.block_number = b.block_number - LEFT JOIN {{ ref('silver__receipts') }} - r - ON t.tx_hash = r.tx_hash - AND t.block_number = r.block_number - WHERE - t.is_pending -) -{% endif %}, -FINAL AS ( - SELECT - block_number, - block_hash, - chain_id, - from_address, - gas, - gas_price, - tx_hash, - input_data, - origin_function_signature, - max_fee_per_gas, - max_priority_fee_per_gas, - nonce, - r, - s, - to_address, - POSITION, - TYPE, - v, - VALUE, - value_precise_raw, - value_precise, - block_timestamp, - is_pending, - gas_used, - tx_success, - tx_status, - cumulative_gas_used, - effective_gas_price, - tx_fee, - tx_fee_precise, - tx_type, - access_list, - _inserted_timestamp, - DATA, - blob_versioned_hashes, - max_fee_per_blob_gas, - blob_gas_used, - blob_gas_price - FROM - new_records - -{% if is_incremental() %} -UNION -SELECT - block_number, - block_hash, - chain_id, - from_address, - gas, - gas_price, - tx_hash, - input_data, - origin_function_signature, - max_fee_per_gas, - max_priority_fee_per_gas, - nonce, - r, - s, - to_address, - POSITION, - TYPE, - v, - VALUE, - value_precise_raw, - value_precise, - block_timestamp, - is_pending, - gas_used, - tx_success, - tx_status, - cumulative_gas_used, - effective_gas_price, - tx_fee, - tx_fee_precise_heal AS tx_fee_precise, - tx_type, - access_list, - _inserted_timestamp, - DATA, - blob_versioned_hashes, - max_fee_per_blob_gas, - blob_gas_used, - blob_gas_price -FROM - missing_data -{% endif %} -) -SELECT - *, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash'] - ) }} AS transactions_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - FINAL qualify(ROW_NUMBER() over (PARTITION BY block_number, POSITION -ORDER BY - _inserted_timestamp DESC, is_pending ASC)) = 1 diff --git a/models/silver/core/silver__transfers.sql b/models/silver/core/silver__transfers.sql deleted file mode 100644 index 5d890390..00000000 --- a/models/silver/core/silver__transfers.sql +++ /dev/null @@ -1,293 +0,0 @@ --- depends_on: {{ ref('silver__complete_token_prices') }} -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = ['block_timestamp::DATE', '_inserted_timestamp::DATE'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_function_signature, origin_from_address, origin_to_address, contract_address, from_address, to_address, symbol), SUBSTRING(origin_function_signature, contract_address, from_address, to_address, symbol)", - tags = ['realtime','reorg','heal'] -) }} - -WITH logs AS ( - - SELECT - CONCAT( - tx_hash :: STRING, - '-', - event_index :: STRING - ) AS _log_id, - block_number, - tx_hash, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address :: STRING AS contract_address, - CONCAT('0x', SUBSTR(topics [1], 27, 40)) :: STRING AS from_address, - CONCAT('0x', SUBSTR(topics [2], 27, 40)) :: STRING AS to_address, - utils.udf_hex_to_int(SUBSTR(DATA, 3, 64)) AS raw_amount_precise, - raw_amount_precise :: FLOAT AS raw_amount, - event_index, - modified_timestamp AS _inserted_timestamp - FROM - {{ ref('core__fact_event_logs') }} - WHERE - topics [0] :: STRING = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' - AND tx_succeeded - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '{{ var("LOOKBACK", "4 hours") }}' - FROM - {{ this }} -) -{% endif %} -), -token_transfers AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - t.contract_address, - from_address, - to_address, - raw_amount_precise, - raw_amount, - IFF( - C.decimals IS NOT NULL, - utils.udf_decimal_adjust( - raw_amount_precise, - C.decimals - ), - NULL - ) AS amount_precise, - amount_precise :: FLOAT AS amount, - IFF( - C.decimals IS NOT NULL - AND price IS NOT NULL, - amount * price, - NULL - ) AS amount_usd, - C.decimals AS decimals, - C.symbol AS symbol, - price AS token_price, - CASE - WHEN C.decimals IS NULL THEN 'false' - ELSE 'true' - END AS has_decimal, - CASE - WHEN price IS NULL THEN 'false' - ELSE 'true' - END AS has_price, - t._log_id, - t._inserted_timestamp - FROM - logs t - LEFT JOIN {{ ref('price__ez_prices_hourly') }} - p - ON t.contract_address = p.token_address - AND DATE_TRUNC( - 'hour', - t.block_timestamp - ) = HOUR - LEFT JOIN {{ ref('silver__contracts') }} C - ON t.contract_address = C.address - WHERE - raw_amount IS NOT NULL - AND to_address IS NOT NULL - AND from_address IS NOT NULL -) - -{% if is_incremental() and var( - 'HEAL_MODEL' -) %}, -heal_model AS ( - SELECT - t0.block_number, - t0.block_timestamp, - t0.tx_hash, - t0.event_index, - t0.origin_function_signature, - t0.origin_from_address, - t0.origin_to_address, - t0.contract_address, - t0.from_address, - t0.to_address, - t0.raw_amount_precise, - t0.raw_amount, - IFF( - C.decimals IS NOT NULL, - utils.udf_decimal_adjust( - t0.raw_amount_precise, - C.decimals - ), - NULL - ) AS amount_precise_heal, - amount_precise_heal :: FLOAT AS amount_heal, - IFF( - C.decimals IS NOT NULL - AND price IS NOT NULL, - amount_heal * p.price, - NULL - ) AS amount_usd, - C.decimals AS decimals, - C.symbol AS symbol, - p.price AS token_price, - CASE - WHEN C.decimals IS NULL THEN 'false' - ELSE 'true' - END AS has_decimal, - CASE - WHEN p.price IS NULL THEN 'false' - ELSE 'true' - END AS has_price, - t0._log_id, - t0._inserted_timestamp - FROM - {{ this }} - t0 - LEFT JOIN {{ ref('price__ez_prices_hourly') }} - p - ON t0.contract_address = p.token_address - AND DATE_TRUNC( - 'hour', - t0.block_timestamp - ) = HOUR - LEFT JOIN {{ ref('silver__contracts') }} C - ON C.address = t0.contract_address - WHERE - t0.block_number IN ( - SELECT - DISTINCT t1.block_number AS block_number - FROM - {{ this }} - t1 - WHERE - t1.decimals IS NULL - AND _inserted_timestamp < ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '{{ var("LOOKBACK", "4 hours") }}' - FROM - {{ this }} - ) - AND EXISTS ( - SELECT - 1 - FROM - {{ ref('silver__contracts') }} C - WHERE - C._inserted_timestamp > DATEADD('DAY', -14, SYSDATE()) - AND C.decimals IS NOT NULL - AND C.address = t1.contract_address) - ) - OR t0.block_number IN ( - SELECT - DISTINCT t2.block_number - FROM - {{ this }} - t2 - WHERE - t2.token_price IS NULL - AND _inserted_timestamp < ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '{{ var("LOOKBACK", "4 hours") }}' - FROM - {{ this }} - ) - AND EXISTS ( - SELECT - 1 - FROM - {{ ref('silver__complete_token_prices') }} - p - WHERE - p._inserted_timestamp > DATEADD('DAY', -14, SYSDATE()) - AND p.price IS NOT NULL - AND p.token_address = t2.contract_address - AND p.hour = DATE_TRUNC( - 'hour', - t2.block_timestamp - ) - ) - ) - ) - {% endif %} - SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address, - from_address, - to_address, - raw_amount_precise, - raw_amount, - amount_precise, - amount, - amount_usd, - decimals, - symbol, - token_price, - has_decimal, - has_price, - _log_id, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} AS transfers_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id - FROM - token_transfers - -{% if is_incremental() and var( - 'HEAL_MODEL' -) %} -UNION ALL -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address, - from_address, - to_address, - raw_amount_precise, - raw_amount, - amount_precise_heal AS amount_precise, - amount_heal AS amount, - amount_usd, - decimals, - symbol, - token_price, - has_decimal, - has_price, - _log_id, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} AS transfers_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - heal_model -{% endif %} diff --git a/models/silver/core/tests/blocks/test_silver__blocks_full.sql b/models/silver/core/tests/blocks/test_silver__blocks_full.sql deleted file mode 100644 index 25dc03b2..00000000 --- a/models/silver/core/tests/blocks/test_silver__blocks_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__blocks') }} diff --git a/models/silver/core/tests/blocks/test_silver__blocks_full.yml b/models/silver/core/tests/blocks/test_silver__blocks_full.yml deleted file mode 100644 index f90d39ce..00000000 --- a/models/silver/core/tests/blocks/test_silver__blocks_full.yml +++ /dev/null @@ -1,95 +0,0 @@ -version: 2 -models: - - name: test_silver__blocks_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - BLOCK_NUMBER - - fsc_utils.sequence_gaps: - column_name: BLOCK_NUMBER - where: BLOCK_TIMESTAMP < CURRENT_DATE - 1 - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: DIFFICULTY - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TOTAL_DIFFICULTY - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EXTRA_DATA - tests: - - not_null - - name: GAS_LIMIT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: GAS_USED - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: PARENT_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: MINER - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: NONCE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: RECEIPTS_ROOT - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: SHA3_UNCLES - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: SIZE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - diff --git a/models/silver/core/tests/blocks/test_silver__blocks_recent.sql b/models/silver/core/tests/blocks/test_silver__blocks_recent.sql deleted file mode 100644 index d55ba9c9..00000000 --- a/models/silver/core/tests/blocks/test_silver__blocks_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__blocks') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/blocks/test_silver__blocks_recent.yml b/models/silver/core/tests/blocks/test_silver__blocks_recent.yml deleted file mode 100644 index ceb767ff..00000000 --- a/models/silver/core/tests/blocks/test_silver__blocks_recent.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: 2 -models: - - name: test_silver__blocks_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - BLOCK_NUMBER - - fsc_utils.sequence_gaps: - column_name: BLOCK_NUMBER - config: - severity: error - error_if: ">10" - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 3 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - \ No newline at end of file diff --git a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.sql b/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.sql deleted file mode 100644 index 6d93a212..00000000 --- a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__confirmed_blocks') }} diff --git a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.yml b/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.yml deleted file mode 100644 index 81a9db00..00000000 --- a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: 2 -models: - - name: test_silver__confirmed_blocks_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: BLOCK_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ \ No newline at end of file diff --git a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.sql b/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.sql deleted file mode 100644 index a88692b0..00000000 --- a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__confirmed_blocks') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.yml b/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.yml deleted file mode 100644 index 460ddf12..00000000 --- a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: 2 -models: - - name: test_silver__confirmed_blocks_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: BLOCK_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 3 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ \ No newline at end of file diff --git a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.sql b/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.sql deleted file mode 100644 index 1dcc890e..00000000 --- a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__decoded_logs') }} diff --git a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.yml b/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.yml deleted file mode 100644 index 4f41ab74..00000000 --- a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.yml +++ /dev/null @@ -1,47 +0,0 @@ -version: 2 -models: - - name: test_silver__decoded_logs_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - - dbt_utils.recency: - datepart: day - field: _INSERTED_TIMESTAMP - interval: 1 - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: EVENT_INDEX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - name: EVENT_NAME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - \ No newline at end of file diff --git a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.sql b/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.sql deleted file mode 100644 index 944a2a6b..00000000 --- a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.sql +++ /dev/null @@ -1,11 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__decoded_logs') }} -WHERE - _inserted_timestamp >= DATEADD(DAY, -3, CURRENT_DATE()) diff --git a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.yml b/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.yml deleted file mode 100644 index b1a14a1a..00000000 --- a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.yml +++ /dev/null @@ -1,51 +0,0 @@ -version: 2 -models: - - name: test_silver__decoded_logs_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - - dbt_utils.recency: - datepart: day - field: _INSERTED_TIMESTAMP - interval: 1 - - fsc_utils.recent_decoded_logs_match: - config: - severity: error - error_if: ">0" - - missing_decoded_logs - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: EVENT_INDEX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - name: EVENT_NAME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR \ No newline at end of file diff --git a/models/silver/core/tests/decoded_traces/test_silver__decoded_traces_full.sql b/models/silver/core/tests/decoded_traces/test_silver__decoded_traces_full.sql index 3969e11e..7b90584d 100644 --- a/models/silver/core/tests/decoded_traces/test_silver__decoded_traces_full.sql +++ b/models/silver/core/tests/decoded_traces/test_silver__decoded_traces_full.sql @@ -1,6 +1,6 @@ {{ config ( materialized = 'view', - tags = ['full_test'] + tags = ['test_silver','decoded_traces','full_test'] ) }} SELECT diff --git a/models/silver/core/tests/decoded_traces/test_silver__decoded_traces_recent.sql b/models/silver/core/tests/decoded_traces/test_silver__decoded_traces_recent.sql index 13b91808..4dbdb71f 100644 --- a/models/silver/core/tests/decoded_traces/test_silver__decoded_traces_recent.sql +++ b/models/silver/core/tests/decoded_traces/test_silver__decoded_traces_recent.sql @@ -1,6 +1,6 @@ {{ config ( materialized = 'view', - tags = ['recent_test'] + tags = ['test_silver','decoded_traces','recent_test'] ) }} SELECT diff --git a/models/silver/core/tests/event_logs/test_silver__logs_full.sql b/models/silver/core/tests/event_logs/test_silver__logs_full.sql deleted file mode 100644 index e1172988..00000000 --- a/models/silver/core/tests/event_logs/test_silver__logs_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__logs') }} diff --git a/models/silver/core/tests/event_logs/test_silver__logs_full.yml b/models/silver/core/tests/event_logs/test_silver__logs_full.yml deleted file mode 100644 index 4b5140c7..00000000 --- a/models/silver/core/tests/event_logs/test_silver__logs_full.yml +++ /dev/null @@ -1,77 +0,0 @@ -version: 2 -models: - - name: test_silver__logs_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - - TX_HASH - column_name: EVENT_INDEX - where: BLOCK_TIMESTAMP < CURRENT_DATE - 1 - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: BLOCK_TIMESTAMP - tests: - - not_null: - where: NOT IS_PENDING - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - fsc_utils.tx_block_count: - config: - severity: error - error_if: "!=0" - - name: EVENT_INDEX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TOPICS - tests: - - not_null - - name: DATA - tests: - - not_null - - name: EVENT_REMOVED - tests: - - not_null - - name: _LOG_ID - tests: - - not_null - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null: - where: NOT IS_PENDING - - name: ORIGIN_FROM_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: ORIGIN_TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ \ No newline at end of file diff --git a/models/silver/core/tests/event_logs/test_silver__logs_recent.sql b/models/silver/core/tests/event_logs/test_silver__logs_recent.sql deleted file mode 100644 index 879aa9b5..00000000 --- a/models/silver/core/tests/event_logs/test_silver__logs_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__logs') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/event_logs/test_silver__logs_recent.yml b/models/silver/core/tests/event_logs/test_silver__logs_recent.yml deleted file mode 100644 index 4a2b8a63..00000000 --- a/models/silver/core/tests/event_logs/test_silver__logs_recent.yml +++ /dev/null @@ -1,33 +0,0 @@ -version: 2 -models: - - name: test_silver__logs_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - - TX_HASH - column_name: EVENT_INDEX - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: BLOCK_TIMESTAMP - tests: - - not_null: - where: NOT IS_PENDING - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 3 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null diff --git a/models/silver/core/tests/receipts/test_silver__receipts_full.sql b/models/silver/core/tests/receipts/test_silver__receipts_full.sql deleted file mode 100644 index 56f39ae1..00000000 --- a/models/silver/core/tests/receipts/test_silver__receipts_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__receipts') }} diff --git a/models/silver/core/tests/receipts/test_silver__receipts_full.yml b/models/silver/core/tests/receipts/test_silver__receipts_full.yml deleted file mode 100644 index 9a186859..00000000 --- a/models/silver/core/tests/receipts/test_silver__receipts_full.yml +++ /dev/null @@ -1,82 +0,0 @@ -version: 2 -models: - - name: test_silver__receipts_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - column_name: POSITION - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: POSITION - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: FROM_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - where: TO_ADDRESS IS NOT NULL - - name: BLOCK_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: CUMULATIVE_GAS_USED - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EFFECTIVE_GAS_PRICE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: GAS_USED - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TX_STATUS - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_set: - value_set: ['SUCCESS', 'FAIL'] - - name: TYPE - tests: - - not_null - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - diff --git a/models/silver/core/tests/receipts/test_silver__receipts_recent.sql b/models/silver/core/tests/receipts/test_silver__receipts_recent.sql deleted file mode 100644 index 97bd45a5..00000000 --- a/models/silver/core/tests/receipts/test_silver__receipts_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__receipts') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/receipts/test_silver__receipts_recent.yml b/models/silver/core/tests/receipts/test_silver__receipts_recent.yml deleted file mode 100644 index 1e8cfa1c..00000000 --- a/models/silver/core/tests/receipts/test_silver__receipts_recent.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 2 -models: - - name: test_silver__receipts_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - column_name: POSITION - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 3 - - diff --git a/models/silver/core/tests/traces/test_silver__traces_full.sql b/models/silver/core/tests/traces/test_silver__traces_full.sql deleted file mode 100644 index be52e71d..00000000 --- a/models/silver/core/tests/traces/test_silver__traces_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__traces') }} diff --git a/models/silver/core/tests/traces/test_silver__traces_full.yml b/models/silver/core/tests/traces/test_silver__traces_full.yml deleted file mode 100644 index f21a7e1d..00000000 --- a/models/silver/core/tests/traces/test_silver__traces_full.yml +++ /dev/null @@ -1,52 +0,0 @@ -version: 2 -models: - - name: test_silver__traces_full - description: "This is a view used to test all of the silver traces model." - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TRACES_ID - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - name: TX_POSITION - tests: - - not_null - - name: TRACE_ADDRESS - tests: - - not_null - - name: TRACE_JSON - tests: - - not_null - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ diff --git a/models/silver/core/tests/traces/test_silver__traces_recent.sql b/models/silver/core/tests/traces/test_silver__traces_recent.sql deleted file mode 100644 index 493b8f2c..00000000 --- a/models/silver/core/tests/traces/test_silver__traces_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__traces') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/traces/test_silver__traces_recent.yml b/models/silver/core/tests/traces/test_silver__traces_recent.yml deleted file mode 100644 index 10e6629d..00000000 --- a/models/silver/core/tests/traces/test_silver__traces_recent.yml +++ /dev/null @@ -1,52 +0,0 @@ -version: 2 -models: - - name: test_silver__traces_recent - description: "This is a view used to test the last three days of traces." - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TRACES_ID - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - name: TX_POSITION - tests: - - not_null - - name: TRACE_ADDRESS - tests: - - not_null - - name: TRACE_JSON - tests: - - not_null - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ diff --git a/models/silver/core/tests/transactions/test_silver__transactions_full.sql b/models/silver/core/tests/transactions/test_silver__transactions_full.sql deleted file mode 100644 index df58d177..00000000 --- a/models/silver/core/tests/transactions/test_silver__transactions_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__transactions') }} diff --git a/models/silver/core/tests/transactions/test_silver__transactions_full.yml b/models/silver/core/tests/transactions/test_silver__transactions_full.yml deleted file mode 100644 index fc88627e..00000000 --- a/models/silver/core/tests/transactions/test_silver__transactions_full.yml +++ /dev/null @@ -1,119 +0,0 @@ -version: 2 -models: - - name: test_silver__transactions_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - column_name: POSITION - where: BLOCK_TIMESTAMP < CURRENT_DATE - 1 - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: NONCE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: POSITION - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: FROM_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - where: TO_ADDRESS IS NOT NULL - - name: VALUE - tests: - - not_null - - name: BLOCK_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: GAS_PRICE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: GAS - tests: - - not_null - - name: INPUT_DATA - tests: - - not_null - - name: TX_STATUS - tests: - - not_null: - where: NOT IS_PENDING - - dbt_expectations.expect_column_values_to_be_in_set: - value_set: ['SUCCESS', 'FAIL'] - where: NOT IS_PENDING - - name: GAS_USED - tests: - - not_null: - where: NOT IS_PENDING - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: CUMULATIVE_GAS_USED - tests: - - not_null: - where: NOT IS_PENDING - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TX_FEE - tests: - - not_null: - where: NOT IS_PENDING - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EFFECTIVE_GAS_PRICE - tests: - - not_null: - where: NOT IS_PENDING - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null - - diff --git a/models/silver/core/tests/transactions/test_silver__transactions_recent.sql b/models/silver/core/tests/transactions/test_silver__transactions_recent.sql deleted file mode 100644 index 73431ac9..00000000 --- a/models/silver/core/tests/transactions/test_silver__transactions_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__transactions') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/transactions/test_silver__transactions_recent.yml b/models/silver/core/tests/transactions/test_silver__transactions_recent.yml deleted file mode 100644 index 3539ac2d..00000000 --- a/models/silver/core/tests/transactions/test_silver__transactions_recent.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: 2 -models: - - name: test_silver__transactions_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - column_name: POSITION - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 3 - \ No newline at end of file diff --git a/models/silver/core/tests/transfers/test_silver__eth_transfers_full.sql b/models/silver/core/tests/transfers/test_silver__eth_transfers_full.sql deleted file mode 100644 index 6e4902eb..00000000 --- a/models/silver/core/tests/transfers/test_silver__eth_transfers_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__eth_transfers') }} diff --git a/models/silver/core/tests/transfers/test_silver__eth_transfers_full.yml b/models/silver/core/tests/transfers/test_silver__eth_transfers_full.yml deleted file mode 100644 index 91910614..00000000 --- a/models/silver/core/tests/transfers/test_silver__eth_transfers_full.yml +++ /dev/null @@ -1,43 +0,0 @@ -version: 2 -models: - - name: test_silver__eth_transfers_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _CALL_ID - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: FROM_ADDRESS - tests: - - not_null - - name: TO_ADDRESS - tests: - - not_null - - name: ETH_VALUE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT diff --git a/models/silver/core/tests/transfers/test_silver__eth_transfers_recent.sql b/models/silver/core/tests/transfers/test_silver__eth_transfers_recent.sql deleted file mode 100644 index c74fe599..00000000 --- a/models/silver/core/tests/transfers/test_silver__eth_transfers_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__eth_transfers') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/transfers/test_silver__eth_transfers_recent.yml b/models/silver/core/tests/transfers/test_silver__eth_transfers_recent.yml deleted file mode 100644 index 1f3ca0a2..00000000 --- a/models/silver/core/tests/transfers/test_silver__eth_transfers_recent.yml +++ /dev/null @@ -1,43 +0,0 @@ -version: 2 -models: - - name: test_silver__eth_transfers_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _CALL_ID - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: FROM_ADDRESS - tests: - - not_null - - name: TO_ADDRESS - tests: - - not_null - - name: ETH_VALUE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT \ No newline at end of file diff --git a/models/silver/core/tests/transfers/test_silver__transfers_full.sql b/models/silver/core/tests/transfers/test_silver__transfers_full.sql deleted file mode 100644 index 487722dc..00000000 --- a/models/silver/core/tests/transfers/test_silver__transfers_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__transfers') }} diff --git a/models/silver/core/tests/transfers/test_silver__transfers_full.yml b/models/silver/core/tests/transfers/test_silver__transfers_full.yml deleted file mode 100644 index fe05c444..00000000 --- a/models/silver/core/tests/transfers/test_silver__transfers_full.yml +++ /dev/null @@ -1,70 +0,0 @@ -version: 2 -models: - - name: test_silver__transfers_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: FROM_ADDRESS - tests: - - not_null: - where: BLOCK_TIMESTAMP > '2021-08-01' - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: RAW_AMOUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: _LOG_ID - tests: - - not_null - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null - - name: ORIGIN_FROM_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: ORIGIN_TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - diff --git a/models/silver/core/tests/transfers/test_silver__transfers_recent.sql b/models/silver/core/tests/transfers/test_silver__transfers_recent.sql deleted file mode 100644 index e384cdaa..00000000 --- a/models/silver/core/tests/transfers/test_silver__transfers_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__transfers') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/transfers/test_silver__transfers_recent.yml b/models/silver/core/tests/transfers/test_silver__transfers_recent.yml deleted file mode 100644 index 373bd568..00000000 --- a/models/silver/core/tests/transfers/test_silver__transfers_recent.yml +++ /dev/null @@ -1,68 +0,0 @@ -version: 2 -models: - - name: test_silver__transfers_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: FROM_ADDRESS - tests: - - not_null: - where: BLOCK_TIMESTAMP > '2021-08-01' - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: RAW_AMOUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: _LOG_ID - tests: - - not_null - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null - - name: ORIGIN_FROM_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: ORIGIN_TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ \ No newline at end of file diff --git a/models/silver/defi/bridge/across/silver_bridge__across_fundsdeposited.sql b/models/silver/defi/bridge/across/silver_bridge__across_fundsdeposited.sql index 75d27a6f..b06df8e8 100644 --- a/models/silver/defi/bridge/across/silver_bridge__across_fundsdeposited.sql +++ b/models/silver/defi/bridge/across/silver_bridge__across_fundsdeposited.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/across/silver_bridge__across_v3fundsdeposited.sql b/models/silver/defi/bridge/across/silver_bridge__across_v3fundsdeposited.sql index 22fdb7d2..8ce659c7 100644 --- a/models/silver/defi/bridge/across/silver_bridge__across_v3fundsdeposited.sql +++ b/models/silver/defi/bridge/across/silver_bridge__across_v3fundsdeposited.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_sent.sql b/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_sent.sql index 37a045c5..2f6f5fce 100644 --- a/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_sent.sql +++ b/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_sent.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_tokens_sent.sql b/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_tokens_sent.sql index 6699439b..97e375ef 100644 --- a/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_tokens_sent.sql +++ b/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_tokens_sent.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/axelar/silver_bridge__axelar_contractcallwithtoken.sql b/models/silver/defi/bridge/axelar/silver_bridge__axelar_contractcallwithtoken.sql index 73240af6..28e98152 100644 --- a/models/silver/defi/bridge/axelar/silver_bridge__axelar_contractcallwithtoken.sql +++ b/models/silver/defi/bridge/axelar/silver_bridge__axelar_contractcallwithtoken.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/axie/silver_bridge__axie_infinity_depositrequested.sql b/models/silver/defi/bridge/axie/silver_bridge__axie_infinity_depositrequested.sql index 243a5eba..a4392a87 100644 --- a/models/silver/defi/bridge/axie/silver_bridge__axie_infinity_depositrequested.sql +++ b/models/silver/defi/bridge/axie/silver_bridge__axie_infinity_depositrequested.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/ccip/silver_bridge__ccip_send_requested.sql b/models/silver/defi/bridge/ccip/silver_bridge__ccip_send_requested.sql index f3065e45..71f7be50 100644 --- a/models/silver/defi/bridge/ccip/silver_bridge__ccip_send_requested.sql +++ b/models/silver/defi/bridge/ccip/silver_bridge__ccip_send_requested.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH on_ramp_set AS ( diff --git a/models/silver/defi/bridge/cctp/silver_bridge__cctp_depositforburn.sql b/models/silver/defi/bridge/cctp/silver_bridge__cctp_depositforburn.sql index 267193c2..25225c9c 100644 --- a/models/silver/defi/bridge/cctp/silver_bridge__cctp_depositforburn.sql +++ b/models/silver/defi/bridge/cctp/silver_bridge__cctp_depositforburn.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/cctp/silver_bridge__cctp_v2_depositforburn.sql b/models/silver/defi/bridge/cctp/silver_bridge__cctp_v2_depositforburn.sql index 81fe8faa..5ce41786 100644 --- a/models/silver/defi/bridge/cctp/silver_bridge__cctp_v2_depositforburn.sql +++ b/models/silver/defi/bridge/cctp/silver_bridge__cctp_v2_depositforburn.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/celer/silver_bridge__celer_cbridge_send.sql b/models/silver/defi/bridge/celer/silver_bridge__celer_cbridge_send.sql index d3fe069a..9a2e7131 100644 --- a/models/silver/defi/bridge/celer/silver_bridge__celer_cbridge_send.sql +++ b/models/silver/defi/bridge/celer/silver_bridge__celer_cbridge_send.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/dln/silver_bridge__dln_debridge_createdorder.sql b/models/silver/defi/bridge/dln/silver_bridge__dln_debridge_createdorder.sql index 1b0aca7e..0bdf38cb 100644 --- a/models/silver/defi/bridge/dln/silver_bridge__dln_debridge_createdorder.sql +++ b/models/silver/defi/bridge/dln/silver_bridge__dln_debridge_createdorder.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/eywa/silver_bridge__eywa_requestsent.sql b/models/silver/defi/bridge/eywa/silver_bridge__eywa_requestsent.sql index 28cd5971..d1065408 100644 --- a/models/silver/defi/bridge/eywa/silver_bridge__eywa_requestsent.sql +++ b/models/silver/defi/bridge/eywa/silver_bridge__eywa_requestsent.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/hop/silver_bridge__hop_l1canonicaltoken.sql b/models/silver/defi/bridge/hop/silver_bridge__hop_l1canonicaltoken.sql index 22fabdae..002fd625 100644 --- a/models/silver/defi/bridge/hop/silver_bridge__hop_l1canonicaltoken.sql +++ b/models/silver/defi/bridge/hop/silver_bridge__hop_l1canonicaltoken.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "block_number", - tags = ['curated'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_contracts AS ( diff --git a/models/silver/defi/bridge/hop/silver_bridge__hop_transfersenttol2.sql b/models/silver/defi/bridge/hop/silver_bridge__hop_transfersenttol2.sql index eaa1ca3d..7017c9b4 100644 --- a/models/silver/defi/bridge/hop/silver_bridge__hop_transfersenttol2.sql +++ b/models/silver/defi/bridge/hop/silver_bridge__hop_transfersenttol2.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/meson/silver_bridge__meson_transfers.sql b/models/silver/defi/bridge/meson/silver_bridge__meson_transfers.sql index e330e21e..c4cfb133 100644 --- a/models/silver/defi/bridge/meson/silver_bridge__meson_transfers.sql +++ b/models/silver/defi/bridge/meson/silver_bridge__meson_transfers.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH token_transfers AS ( diff --git a/models/silver/defi/bridge/multichain/silver_bridge__multichain_v7_loganyswapout.sql b/models/silver/defi/bridge/multichain/silver_bridge__multichain_v7_loganyswapout.sql index 2cd3ce8d..55614748 100644 --- a/models/silver/defi/bridge/multichain/silver_bridge__multichain_v7_loganyswapout.sql +++ b/models/silver/defi/bridge/multichain/silver_bridge__multichain_v7_loganyswapout.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/native_bridges/silver_bridge__native_bridges_transfers_out.sql b/models/silver/defi/bridge/native_bridges/silver_bridge__native_bridges_transfers_out.sql index 3e303e3b..92091deb 100644 --- a/models/silver/defi/bridge/native_bridges/silver_bridge__native_bridges_transfers_out.sql +++ b/models/silver/defi/bridge/native_bridges/silver_bridge__native_bridges_transfers_out.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH bridges AS ( diff --git a/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql b/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql index a7675a97..093f6b5b 100644 --- a/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql +++ b/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform','version'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, bridge_address, sender, receiver, destination_chain_receiver, destination_chain_id, destination_chain, token_address, token_symbol), SUBSTRING(origin_function_signature, bridge_address, sender, receiver, destination_chain_receiver, destination_chain, token_address, token_symbol)", - tags = ['curated','reorg','heal'] + tags = ['silver_bridge','defi','bridge','curated','heal'] ) }} WITH across AS ( @@ -971,7 +971,7 @@ complete_bridge_activity AS ( b._inserted_timestamp FROM all_bridges b - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON b.token_address = C.address LEFT JOIN {{ ref('price__ez_prices_hourly') }} p @@ -1034,7 +1034,7 @@ heal_model AS ( FROM {{ this }} t0 - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON t0.token_address = C.address LEFT JOIN {{ ref('price__ez_prices_hourly') }} p @@ -1076,7 +1076,7 @@ heal_model AS ( SELECT 1 FROM - {{ ref('silver__contracts') }} C + {{ ref('core__dim_contracts') }} C WHERE C._inserted_timestamp > DATEADD('DAY', -14, SYSDATE()) AND C.decimals IS NOT NULL diff --git a/models/silver/defi/bridge/stargate/silver_bridge__stargate_createpool.sql b/models/silver/defi/bridge/stargate/silver_bridge__stargate_createpool.sql index 833316a7..7e4b89ff 100644 --- a/models/silver/defi/bridge/stargate/silver_bridge__stargate_createpool.sql +++ b/models/silver/defi/bridge/stargate/silver_bridge__stargate_createpool.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "block_number", - tags = ['curated'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_contracts AS ( diff --git a/models/silver/defi/bridge/stargate/silver_bridge__stargate_swap.sql b/models/silver/defi/bridge/stargate/silver_bridge__stargate_swap.sql index 90bf2cc9..32d153ea 100644 --- a/models/silver/defi/bridge/stargate/silver_bridge__stargate_swap.sql +++ b/models/silver/defi/bridge/stargate/silver_bridge__stargate_swap.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/bridge/symbiosis/silver_bridge__symbiosis_synthesizerequest.sql b/models/silver/defi/bridge/symbiosis/silver_bridge__symbiosis_synthesizerequest.sql index 6a38f88f..f6774cd0 100644 --- a/models/silver/defi/bridge/symbiosis/silver_bridge__symbiosis_synthesizerequest.sql +++ b/models/silver/defi/bridge/symbiosis/silver_bridge__symbiosis_synthesizerequest.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/synapse/silver_bridge__synapse_token_bridge.sql b/models/silver/defi/bridge/synapse/silver_bridge__synapse_token_bridge.sql index fed07896..2beea633 100644 --- a/models/silver/defi/bridge/synapse/silver_bridge__synapse_token_bridge.sql +++ b/models/silver/defi/bridge/synapse/silver_bridge__synapse_token_bridge.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/synapse/silver_bridge__synapse_tokenbridgeandswap.sql b/models/silver/defi/bridge/synapse/silver_bridge__synapse_tokenbridgeandswap.sql index ca1a78e9..e384c9d6 100644 --- a/models/silver/defi/bridge/synapse/silver_bridge__synapse_tokenbridgeandswap.sql +++ b/models/silver/defi/bridge/synapse/silver_bridge__synapse_tokenbridgeandswap.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/wormhole/silver_bridge__wormhole_transfers.sql b/models/silver/defi/bridge/wormhole/silver_bridge__wormhole_transfers.sql index f474103c..90a096b9 100644 --- a/models/silver/defi/bridge/wormhole/silver_bridge__wormhole_transfers.sql +++ b/models/silver/defi/bridge/wormhole/silver_bridge__wormhole_transfers.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH token_transfers AS ( diff --git a/models/silver/defi/dex/balancer/silver_dex__balancer_pools.sql b/models/silver/defi/dex/balancer/silver_dex__balancer_pools.sql index f8c60bd9..ac9b4183 100644 --- a/models/silver/defi/dex/balancer/silver_dex__balancer_pools.sql +++ b/models/silver/defi/dex/balancer/silver_dex__balancer_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "pool_address", full_refresh = false, - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools_registered AS ( diff --git a/models/silver/defi/dex/balancer/silver_dex__balancer_swaps.sql b/models/silver/defi/dex/balancer/silver_dex__balancer_swaps.sql index 2a23fc68..2d7102f4 100644 --- a/models/silver/defi/dex/balancer/silver_dex__balancer_swaps.sql +++ b/models/silver/defi/dex/balancer/silver_dex__balancer_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_name AS ( diff --git a/models/silver/defi/dex/curve/silver_dex__curve_pools.sql b/models/silver/defi/dex/curve/silver_dex__curve_pools.sql index 233aaa4b..5c3e97a4 100644 --- a/models/silver/defi/dex/curve/silver_dex__curve_pools.sql +++ b/models/silver/defi/dex/curve/silver_dex__curve_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "pool_address", full_refresh = false, - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH contract_deployments AS ( @@ -431,7 +431,7 @@ FINAL AS ( A._inserted_timestamp FROM all_pools A - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON A.token_address = C.address LEFT JOIN contract_deployments d ON A.pool_address = d.contract_address qualify(ROW_NUMBER() over(PARTITION BY pool_address, token_address diff --git a/models/silver/defi/dex/curve/silver_dex__curve_swaps.sql b/models/silver/defi/dex/curve/silver_dex__curve_swaps.sql index 28e570e1..80ec1ce5 100644 --- a/models/silver/defi/dex/curve/silver_dex__curve_swaps.sql +++ b/models/silver/defi/dex/curve/silver_dex__curve_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_meta AS ( diff --git a/models/silver/defi/dex/dodo/silver_dex__dodo_v1_pools.sql b/models/silver/defi/dex/dodo/silver_dex__dodo_v1_pools.sql index 0cea7235..8126cbea 100644 --- a/models/silver/defi/dex/dodo/silver_dex__dodo_v1_pools.sql +++ b/models/silver/defi/dex/dodo/silver_dex__dodo_v1_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_events AS ( diff --git a/models/silver/defi/dex/dodo/silver_dex__dodo_v1_swaps.sql b/models/silver/defi/dex/dodo/silver_dex__dodo_v1_swaps.sql index 4b6eba46..e9b2d66a 100644 --- a/models/silver/defi/dex/dodo/silver_dex__dodo_v1_swaps.sql +++ b/models/silver/defi/dex/dodo/silver_dex__dodo_v1_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/dodo/silver_dex__dodo_v2_pools.sql b/models/silver/defi/dex/dodo/silver_dex__dodo_v2_pools.sql index ca01b224..09fe8ff8 100644 --- a/models/silver/defi/dex/dodo/silver_dex__dodo_v2_pools.sql +++ b/models/silver/defi/dex/dodo/silver_dex__dodo_v2_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/dodo/silver_dex__dodo_v2_swaps.sql b/models/silver/defi/dex/dodo/silver_dex__dodo_v2_swaps.sql index 74f05500..5259542e 100644 --- a/models/silver/defi/dex/dodo/silver_dex__dodo_v2_swaps.sql +++ b/models/silver/defi/dex/dodo/silver_dex__dodo_v2_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/frax/silver_dex__fraxswap_pools.sql b/models/silver/defi/dex/frax/silver_dex__fraxswap_pools.sql index 31213947..f2718147 100644 --- a/models/silver/defi/dex/frax/silver_dex__fraxswap_pools.sql +++ b/models/silver/defi/dex/frax/silver_dex__fraxswap_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/frax/silver_dex__fraxswap_swaps.sql b/models/silver/defi/dex/frax/silver_dex__fraxswap_swaps.sql index 19987236..07350fc1 100644 --- a/models/silver/defi/dex/frax/silver_dex__fraxswap_swaps.sql +++ b/models/silver/defi/dex/frax/silver_dex__fraxswap_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/hashflow/silver_dex__hashflow_pools.sql b/models/silver/defi/dex/hashflow/silver_dex__hashflow_pools.sql index d39e1608..4033e756 100644 --- a/models/silver/defi/dex/hashflow/silver_dex__hashflow_pools.sql +++ b/models/silver/defi/dex/hashflow/silver_dex__hashflow_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH contract_deployments AS ( diff --git a/models/silver/defi/dex/hashflow/silver_dex__hashflow_swaps.sql b/models/silver/defi/dex/hashflow/silver_dex__hashflow_swaps.sql index 89f0c8ee..696517b8 100644 --- a/models/silver/defi/dex/hashflow/silver_dex__hashflow_swaps.sql +++ b/models/silver/defi/dex/hashflow/silver_dex__hashflow_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_pools.sql b/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_pools.sql index 5e14c036..ef5d82aa 100644 --- a/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_pools.sql +++ b/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH contract_deployments AS ( diff --git a/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_swaps.sql b/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_swaps.sql index e7e24b57..bb0e093e 100644 --- a/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_swaps.sql +++ b/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_pools.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_pools.sql index af7013d7..0a7badca 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_pools.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_swaps.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_swaps.sql index 665ee09a..1c9cb6c4 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_swaps.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_pools.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_pools.sql index 35b8c408..9dc6e400 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_pools.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_swaps.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_swaps.sql index 99ae3f94..0dbdb35a 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_swaps.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_pools.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_pools.sql index 61479590..e0715710 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_pools.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_swaps.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_swaps.sql index c1bdcd8c..6b7eb5b7 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_swaps.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/maverick/silver_dex__maverick_pools.sql b/models/silver/defi/dex/maverick/silver_dex__maverick_pools.sql index 9a5ed4ad..039b77c3 100644 --- a/models/silver/defi/dex/maverick/silver_dex__maverick_pools.sql +++ b/models/silver/defi/dex/maverick/silver_dex__maverick_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/maverick/silver_dex__maverick_swaps.sql b/models/silver/defi/dex/maverick/silver_dex__maverick_swaps.sql index 813f78b4..0ffaeae4 100644 --- a/models/silver/defi/dex/maverick/silver_dex__maverick_swaps.sql +++ b/models/silver/defi/dex/maverick/silver_dex__maverick_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v2_amm_pools.sql b/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v2_amm_pools.sql index 75230714..ca2475b9 100644 --- a/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v2_amm_pools.sql +++ b/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v2_amm_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v2_amm_swaps.sql b/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v2_amm_swaps.sql index 09ee48a0..3266fd43 100644 --- a/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v2_amm_swaps.sql +++ b/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v2_amm_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v2_mm_swaps.sql b/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v2_mm_swaps.sql index c7f06e19..aaea7f8b 100644 --- a/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v2_mm_swaps.sql +++ b/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v2_mm_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH swaps_base AS ( diff --git a/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v3_pools.sql b/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v3_pools.sql index e4d299f3..8c9d494e 100644 --- a/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v3_pools.sql +++ b/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v3_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'pool_address', cluster_by = ['block_timestamp::DATE'], - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH created_pools AS ( diff --git a/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v3_swaps.sql b/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v3_swaps.sql index 7780958f..dc88c8c1 100644 --- a/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v3_swaps.sql +++ b/models/silver/defi/dex/pancake/silver_dex__pancakeswap_v3_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/shibaswap/silver_dex__shibaswap_pools.sql b/models/silver/defi/dex/shibaswap/silver_dex__shibaswap_pools.sql index 2b4c579f..23155361 100644 --- a/models/silver/defi/dex/shibaswap/silver_dex__shibaswap_pools.sql +++ b/models/silver/defi/dex/shibaswap/silver_dex__shibaswap_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/shibaswap/silver_dex__shibaswap_swaps.sql b/models/silver/defi/dex/shibaswap/silver_dex__shibaswap_swaps.sql index dcee4bb3..dbe6c47f 100644 --- a/models/silver/defi/dex/shibaswap/silver_dex__shibaswap_swaps.sql +++ b/models/silver/defi/dex/shibaswap/silver_dex__shibaswap_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/silver_dex__complete_dex_liquidity_pools.sql b/models/silver/defi/dex/silver_dex__complete_dex_liquidity_pools.sql index 8930a22a..d7cf1e07 100644 --- a/models/silver/defi/dex/silver_dex__complete_dex_liquidity_pools.sql +++ b/models/silver/defi/dex/silver_dex__complete_dex_liquidity_pools.sql @@ -4,7 +4,7 @@ unique_key = ['block_number','platform','version'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, contract_address, pool_address, pool_name, tokens, symbols), SUBSTRING(pool_address, pool_name, tokens, symbols)", - tags = ['curated','reorg','heal'] + tags = ['silver_dex','defi','dex','curated','heal'] ) }} WITH contracts AS ( @@ -13,17 +13,17 @@ WITH contracts AS ( address, symbol, decimals, - _inserted_timestamp + modified_timestamp AS _inserted_timestamp FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} UNION ALL SELECT '0x0000000000000000000000000000000000000000' AS address, 'ETH' AS symbol, decimals, - _inserted_timestamp + modified_timestamp AS _inserted_timestamp FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} WHERE address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' -- weth_address ), diff --git a/models/silver/defi/dex/silver_dex__complete_dex_swaps.sql b/models/silver/defi/dex/silver_dex__complete_dex_swaps.sql index 715f1448..dab519c6 100644 --- a/models/silver/defi/dex/silver_dex__complete_dex_swaps.sql +++ b/models/silver/defi/dex/silver_dex__complete_dex_swaps.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform','version'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_function_signature, origin_from_address, origin_to_address, contract_address, pool_name, event_name, sender, tx_to, token_in, token_out, symbol_in, symbol_out), SUBSTRING(origin_function_signature, pool_name, event_name, sender, tx_to, token_in, token_out, symbol_in, symbol_out)", - tags = ['curated','reorg','heal'] + tags = ['silver_dex','defi','dex','curated','heal'] ) }} WITH contracts AS ( @@ -14,17 +14,17 @@ WITH contracts AS ( address, symbol, decimals, - _inserted_timestamp + modified_timestamp AS _inserted_timestamp FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} UNION ALL SELECT '0x0000000000000000000000000000000000000000' AS address, 'ETH' AS symbol, decimals, - _inserted_timestamp + modified_timestamp AS _inserted_timestamp FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} WHERE address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' ), diff --git a/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.sql b/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.sql index 698f1cd4..6f113946 100644 --- a/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.sql +++ b/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH swaps_base AS ( diff --git a/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.yml b/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.yml index 4761ec55..56154c50 100644 --- a/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.yml +++ b/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.yml @@ -8,7 +8,7 @@ models: - _log_id columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -16,7 +16,7 @@ models: - NUMBER - FLOAT - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -24,7 +24,7 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: TX_HASH - description: '{{ doc("eth_tx_hash") }}' + description: '{{ doc("evm_tx_hash") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: @@ -62,7 +62,7 @@ models: - STRING - VARCHAR - name: CONTRACT_ADDRESS - description: '{{ doc("eth_contracts_name") }}' + description: '{{ doc("evm_contracts_name") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: diff --git a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_1_swaps.sql b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_1_swaps.sql index 7534ea2d..8a2bd44e 100644 --- a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_1_swaps.sql +++ b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_1_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_pools.sql b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_pools.sql index 11b72e1c..a4d9beec 100644 --- a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_pools.sql +++ b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "lb_pair", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/uni_sushi_v2/silver_dex__pools.sql b/models/silver/defi/dex/uni_sushi_v2/silver_dex__pools.sql index 360b06b2..8b30907f 100644 --- a/models/silver/defi/dex/uni_sushi_v2/silver_dex__pools.sql +++ b/models/silver/defi/dex/uni_sushi_v2/silver_dex__pools.sql @@ -4,7 +4,7 @@ "columns": true }, incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH univ2_sushi_pairs AS ( diff --git a/models/silver/defi/dex/uni_sushi_v2/silver_dex__v2_swaps.sql b/models/silver/defi/dex/uni_sushi_v2/silver_dex__v2_swaps.sql index d290c578..3b5c239f 100644 --- a/models/silver/defi/dex/uni_sushi_v2/silver_dex__v2_swaps.sql +++ b/models/silver/defi/dex/uni_sushi_v2/silver_dex__v2_swaps.sql @@ -5,7 +5,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['_inserted_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH v2_pairs AS ( diff --git a/models/silver/defi/dex/uniswap/silver_dex__uni_v4_pools.sql b/models/silver/defi/dex/uniswap/silver_dex__uni_v4_pools.sql index 883c9966..57b475d2 100644 --- a/models/silver/defi/dex/uniswap/silver_dex__uni_v4_pools.sql +++ b/models/silver/defi/dex/uniswap/silver_dex__uni_v4_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "pool_id", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','pools'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH initialize AS ( diff --git a/models/silver/defi/dex/uniswap/silver_dex__uni_v4_swaps.sql b/models/silver/defi/dex/uniswap/silver_dex__uni_v4_swaps.sql index 36dd5757..64c813a2 100644 --- a/models/silver/defi/dex/uniswap/silver_dex__uni_v4_swaps.sql +++ b/models/silver/defi/dex/uniswap/silver_dex__uni_v4_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_data AS ( diff --git a/models/silver/defi/dex/verse/silver_dex__verse_pools.sql b/models/silver/defi/dex/verse/silver_dex__verse_pools.sql index e2485ab9..82efd713 100644 --- a/models/silver/defi/dex/verse/silver_dex__verse_pools.sql +++ b/models/silver/defi/dex/verse/silver_dex__verse_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/verse/silver_dex__verse_swaps.sql b/models/silver/defi/dex/verse/silver_dex__verse_swaps.sql index d1256422..7f467dbf 100644 --- a/models/silver/defi/dex/verse/silver_dex__verse_swaps.sql +++ b/models/silver/defi/dex/verse/silver_dex__verse_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/woofi/silver_dex__woofi_swaps.sql b/models/silver/defi/dex/woofi/silver_dex__woofi_swaps.sql index 51417f6d..d440dbc9 100644 --- a/models/silver/defi/dex/woofi/silver_dex__woofi_swaps.sql +++ b/models/silver/defi/dex/woofi/silver_dex__woofi_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH router_swaps_base AS ( diff --git a/models/silver/defi/lending/aave/silver__aave_borrows.sql b/models/silver/defi/lending/aave/silver__aave_borrows.sql index a148eab0..f1f2f2ff 100644 --- a/models/silver/defi/lending/aave/silver__aave_borrows.sql +++ b/models/silver/defi/lending/aave/silver__aave_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH --borrows from Aave LendingPool contracts diff --git a/models/silver/defi/lending/aave/silver__aave_deposits.sql b/models/silver/defi/lending/aave/silver__aave_deposits.sql index 3587666e..5cdcf9dd 100644 --- a/models/silver/defi/lending/aave/silver__aave_deposits.sql +++ b/models/silver/defi/lending/aave/silver__aave_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH deposits AS( diff --git a/models/silver/defi/lending/aave/silver__aave_flashloans.sql b/models/silver/defi/lending/aave/silver__aave_flashloans.sql index b74b1917..b337a9ff 100644 --- a/models/silver/defi/lending/aave/silver__aave_flashloans.sql +++ b/models/silver/defi/lending/aave/silver__aave_flashloans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH flashloan AS ( diff --git a/models/silver/defi/lending/aave/silver__aave_liquidations.sql b/models/silver/defi/lending/aave/silver__aave_liquidations.sql index 938e151e..94e74f49 100644 --- a/models/silver/defi/lending/aave/silver__aave_liquidations.sql +++ b/models/silver/defi/lending/aave/silver__aave_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH liquidation AS( diff --git a/models/silver/defi/lending/aave/silver__aave_repayments.sql b/models/silver/defi/lending/aave/silver__aave_repayments.sql index 7c99f9b8..3cc878ba 100644 --- a/models/silver/defi/lending/aave/silver__aave_repayments.sql +++ b/models/silver/defi/lending/aave/silver__aave_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH repay AS( diff --git a/models/silver/defi/lending/aave/silver__aave_token_backfill.sql b/models/silver/defi/lending/aave/silver__aave_token_backfill.sql index 7cdaac2f..4cd17d1c 100644 --- a/models/silver/defi/lending/aave/silver__aave_token_backfill.sql +++ b/models/silver/defi/lending/aave/silver__aave_token_backfill.sql @@ -1,7 +1,7 @@ {{ config( materialized = 'incremental', unique_key = "atoken_address", - tags = ['curated'] + tags = ['silver','defi','lending','curated'] ) }} @@ -12,7 +12,7 @@ with contracts as ( symbol, decimals FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} ), aave_token_pull AS ( diff --git a/models/silver/defi/lending/aave/silver__aave_tokens.sql b/models/silver/defi/lending/aave/silver__aave_tokens.sql index 75b54e68..a0172689 100644 --- a/models/silver/defi/lending/aave/silver__aave_tokens.sql +++ b/models/silver/defi/lending/aave/silver__aave_tokens.sql @@ -1,6 +1,6 @@ {{ config( materialized = 'view', - tags = ['curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH base AS ( @@ -34,16 +34,16 @@ SELECT atoken_created_block, atoken_stable_debt_address, atoken_variable_debt_address, - c1.contract_metadata AS atoken_metadata, - c2.contract_metadata AS underlying_metadata + NULL AS atoken_metadata, + NULL AS underlying_metadata FROM base - LEFT JOIN {{ ref('silver__contracts') }} + LEFT JOIN {{ ref('core__dim_contracts') }} c1 ON LOWER( c1.address ) = atoken_address - LEFT JOIN {{ ref('silver__contracts') }} + LEFT JOIN {{ ref('core__dim_contracts') }} c2 ON LOWER( c2.address diff --git a/models/silver/defi/lending/aave/silver__aave_withdraws.sql b/models/silver/defi/lending/aave/silver__aave_withdraws.sql index db54ba79..09ae87b2 100644 --- a/models/silver/defi/lending/aave/silver__aave_withdraws.sql +++ b/models/silver/defi/lending/aave/silver__aave_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH withdraw AS( diff --git a/models/silver/defi/lending/complete_lending/silver__complete_lending_borrows.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_borrows.sql index a6886b01..13d6d713 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_borrows.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_borrows.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, token_address, token_symbol, borrower, protocol_market), SUBSTRING(origin_function_signature, event_name, token_address, token_symbol, borrower, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/complete_lending/silver__complete_lending_deposits.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_deposits.sql index 3642ffc4..daed4f0b 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_deposits.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_deposits.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, token_address, token_symbol, depositor, protocol_market), SUBSTRING(origin_function_signature, event_name, token_address, token_symbol, depositor, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/complete_lending/silver__complete_lending_flashloans.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_flashloans.sql index 09ec2c28..3ed66464 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_flashloans.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_flashloans.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, flashloan_token, flashloan_token_symbol, protocol_market), SUBSTRING(origin_function_signature, event_name, flashloan_token, flashloan_token_symbol, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/complete_lending/silver__complete_lending_liquidations.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_liquidations.sql index 0f6741c6..e3bff4db 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_liquidations.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_liquidations.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, liquidator, borrower, collateral_token, collateral_token_symbol, debt_token, debt_token_symbol, protocol_market), SUBSTRING(origin_function_signature, event_name, liquidator, borrower, collateral_token, collateral_token_symbol, debt_token, debt_token_symbol, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/complete_lending/silver__complete_lending_repayments.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_repayments.sql index 44915b35..c76206f3 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_repayments.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_repayments.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, token_address, token_symbol, payer, borrower, protocol_market), SUBSTRING(origin_function_signature, event_name, token_address, token_symbol, payer, borrower, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/complete_lending/silver__complete_lending_withdraws.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_withdraws.sql index c6683b8c..15ed9a8a 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_withdraws.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_withdraws.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, token_address, token_symbol, depositor, protocol_market), SUBSTRING(origin_function_signature, event_name, token_address, token_symbol, depositor, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/compound/silver__comp_asset_details.sql b/models/silver/defi/lending/compound/silver__comp_asset_details.sql index 8c1862d0..7458a481 100644 --- a/models/silver/defi/lending/compound/silver__comp_asset_details.sql +++ b/models/silver/defi/lending/compound/silver__comp_asset_details.sql @@ -18,7 +18,7 @@ WITH base AS ( END AS underlying_asset_address, contract_metadata FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} WHERE address IN ( --cAAVE @@ -113,7 +113,7 @@ comp_union as ( 'Compound V2' AS compound_version FROM base b - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON b.underlying_asset_address = C.address UNION ALL SELECT diff --git a/models/silver/defi/lending/compound/silver__comp_borrows.sql b/models/silver/defi/lending/compound/silver__comp_borrows.sql index 9a326c01..cfc6c9d2 100644 --- a/models/silver/defi/lending/compound/silver__comp_borrows.sql +++ b/models/silver/defi/lending/compound/silver__comp_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all ctoken addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/compound/silver__comp_borrows.yml b/models/silver/defi/lending/compound/silver__comp_borrows.yml index 06f8762b..8dfbf703 100644 --- a/models/silver/defi/lending/compound/silver__comp_borrows.yml +++ b/models/silver/defi/lending/compound/silver__comp_borrows.yml @@ -1,7 +1,6 @@ version: 2 models: - name: silver__comp_borrows - description: '{{ doc("borrows_table_doc") }}' tests: - dbt_utils.unique_combination_of_columns: diff --git a/models/silver/defi/lending/compound/silver__comp_deposits.sql b/models/silver/defi/lending/compound/silver__comp_deposits.sql index de2b4025..2734fe8c 100644 --- a/models/silver/defi/lending/compound/silver__comp_deposits.sql +++ b/models/silver/defi/lending/compound/silver__comp_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all ctoken addresses and corresponding name WITH asset_details AS ( @@ -172,7 +172,7 @@ comp_combine AS ( b._inserted_timestamp FROM compv3_deposits b - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON b.asset = C.address LEFT JOIN asset_details a ON b.ctoken = a.ctoken_address diff --git a/models/silver/defi/lending/compound/silver__comp_liquidations.sql b/models/silver/defi/lending/compound/silver__comp_liquidations.sql index 1ad71c46..0cfe53d4 100644 --- a/models/silver/defi/lending/compound/silver__comp_liquidations.sql +++ b/models/silver/defi/lending/compound/silver__comp_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all ctoken addresses and corresponding name -- add the collateral liquidated here @@ -111,7 +111,7 @@ compv3_liquidations AS ( {{ ref('core__fact_event_logs') }} l LEFT JOIN - {{ ref('silver__contracts') }} C + {{ ref('core__dim_contracts') }} C ON CONCAT('0x', SUBSTR(topics [3] :: STRING, 27, 40)) = C.address WHERE @@ -241,7 +241,7 @@ liquidation_union as ( compv3_liquidations l LEFT JOIN {{ ref('silver__comp_asset_details') }} A ON l.ctoken = A.ctoken_address - LEFT JOIN {{ ref('silver__contracts') }} c + LEFT JOIN {{ ref('core__dim_contracts') }} c ON l.asset = c.address ) SELECT diff --git a/models/silver/defi/lending/compound/silver__comp_redemptions.sql b/models/silver/defi/lending/compound/silver__comp_redemptions.sql index 5fba63dd..7379eb5f 100644 --- a/models/silver/defi/lending/compound/silver__comp_redemptions.sql +++ b/models/silver/defi/lending/compound/silver__comp_redemptions.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all ctoken addresses and corresponding name WITH asset_details AS ( @@ -166,7 +166,7 @@ comp_combine AS ( b._inserted_timestamp FROM compv3_redemptions b - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON b.asset = C.address LEFT JOIN {{ ref('silver__comp_asset_details') }} a ON b.ctoken = a.ctoken_address diff --git a/models/silver/defi/lending/compound/silver__comp_repayments.sql b/models/silver/defi/lending/compound/silver__comp_repayments.sql index 6d4564c6..aa1c3b99 100644 --- a/models/silver/defi/lending/compound/silver__comp_repayments.sql +++ b/models/silver/defi/lending/compound/silver__comp_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all ctoken addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/cream/silver__cream_asset_details.sql b/models/silver/defi/lending/cream/silver__cream_asset_details.sql index cb326505..54e18f35 100644 --- a/models/silver/defi/lending/cream/silver__cream_asset_details.sql +++ b/models/silver/defi/lending/cream/silver__cream_asset_details.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH contracts AS ( @@ -11,7 +11,7 @@ WITH contracts AS ( SELECT * FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} ), log_pull AS ( SELECT diff --git a/models/silver/defi/lending/cream/silver__cream_borrows.sql b/models/silver/defi/lending/cream/silver__cream_borrows.sql index 730a2df9..139406d7 100644 --- a/models/silver/defi/lending/cream/silver__cream_borrows.sql +++ b/models/silver/defi/lending/cream/silver__cream_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/cream/silver__cream_deposits.sql b/models/silver/defi/lending/cream/silver__cream_deposits.sql index a7ec386e..c375f2fa 100644 --- a/models/silver/defi/lending/cream/silver__cream_deposits.sql +++ b/models/silver/defi/lending/cream/silver__cream_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/cream/silver__cream_liquidations.sql b/models/silver/defi/lending/cream/silver__cream_liquidations.sql index 93f7e7b4..960431e8 100644 --- a/models/silver/defi/lending/cream/silver__cream_liquidations.sql +++ b/models/silver/defi/lending/cream/silver__cream_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH asset_details AS ( diff --git a/models/silver/defi/lending/cream/silver__cream_repayments.sql b/models/silver/defi/lending/cream/silver__cream_repayments.sql index c156e402..db2b3396 100644 --- a/models/silver/defi/lending/cream/silver__cream_repayments.sql +++ b/models/silver/defi/lending/cream/silver__cream_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/cream/silver__cream_withdraws.sql b/models/silver/defi/lending/cream/silver__cream_withdraws.sql index d32bf6f6..551262bd 100644 --- a/models/silver/defi/lending/cream/silver__cream_withdraws.sql +++ b/models/silver/defi/lending/cream/silver__cream_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/flux/silver__flux_asset_details.sql b/models/silver/defi/lending/flux/silver__flux_asset_details.sql index 21770fae..88deee38 100644 --- a/models/silver/defi/lending/flux/silver__flux_asset_details.sql +++ b/models/silver/defi/lending/flux/silver__flux_asset_details.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH log_pull AS ( @@ -60,7 +60,7 @@ contracts AS ( SELECT * FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} ), contract_pull AS ( SELECT diff --git a/models/silver/defi/lending/flux/silver__flux_borrows.sql b/models/silver/defi/lending/flux/silver__flux_borrows.sql index 9d3407c5..ebee0b9d 100644 --- a/models/silver/defi/lending/flux/silver__flux_borrows.sql +++ b/models/silver/defi/lending/flux/silver__flux_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/flux/silver__flux_deposits.sql b/models/silver/defi/lending/flux/silver__flux_deposits.sql index b84d6194..b290ff1d 100644 --- a/models/silver/defi/lending/flux/silver__flux_deposits.sql +++ b/models/silver/defi/lending/flux/silver__flux_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/flux/silver__flux_liquidations.sql b/models/silver/defi/lending/flux/silver__flux_liquidations.sql index 7e1f006a..93ef97ed 100644 --- a/models/silver/defi/lending/flux/silver__flux_liquidations.sql +++ b/models/silver/defi/lending/flux/silver__flux_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH asset_details AS ( diff --git a/models/silver/defi/lending/flux/silver__flux_repayments.sql b/models/silver/defi/lending/flux/silver__flux_repayments.sql index b0aa95dc..aa6f8849 100644 --- a/models/silver/defi/lending/flux/silver__flux_repayments.sql +++ b/models/silver/defi/lending/flux/silver__flux_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/flux/silver__flux_withdraws.sql b/models/silver/defi/lending/flux/silver__flux_withdraws.sql index a018d9d9..3473e323 100644 --- a/models/silver/defi/lending/flux/silver__flux_withdraws.sql +++ b/models/silver/defi/lending/flux/silver__flux_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/fraxlend/silver__fraxlend_asset_details.sql b/models/silver/defi/lending/fraxlend/silver__fraxlend_asset_details.sql index 8c66d75b..2846aefa 100644 --- a/models/silver/defi/lending/fraxlend/silver__fraxlend_asset_details.sql +++ b/models/silver/defi/lending/fraxlend/silver__fraxlend_asset_details.sql @@ -1,7 +1,7 @@ {{ config( materialized = 'incremental', unique_key = '_log_id', - tags = ['curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH logs AS ( @@ -49,7 +49,7 @@ logs_transform AS ( l.modified_timestamp AS _inserted_timestamp FROM logs l - LEFT JOIN {{ ref('silver__contracts') }} + LEFT JOIN {{ ref('core__dim_contracts') }} ON address = pool_address ) SELECT @@ -66,7 +66,7 @@ SELECT FROM logs_transform l LEFT JOIN - {{ ref('silver__contracts') }} c + {{ ref('core__dim_contracts') }} c ON c.address = underlying_asset WHERE diff --git a/models/silver/defi/lending/fraxlend/silver__fraxlend_borrows.sql b/models/silver/defi/lending/fraxlend/silver__fraxlend_borrows.sql index 302bf77f..efe1ac31 100644 --- a/models/silver/defi/lending/fraxlend/silver__fraxlend_borrows.sql +++ b/models/silver/defi/lending/fraxlend/silver__fraxlend_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH log_join AS ( diff --git a/models/silver/defi/lending/fraxlend/silver__fraxlend_deposits.sql b/models/silver/defi/lending/fraxlend/silver__fraxlend_deposits.sql index 60b4ed05..63a99482 100644 --- a/models/silver/defi/lending/fraxlend/silver__fraxlend_deposits.sql +++ b/models/silver/defi/lending/fraxlend/silver__fraxlend_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH log_join AS ( diff --git a/models/silver/defi/lending/fraxlend/silver__fraxlend_liquidations.sql b/models/silver/defi/lending/fraxlend/silver__fraxlend_liquidations.sql index 2b4b217a..6b2cce8a 100644 --- a/models/silver/defi/lending/fraxlend/silver__fraxlend_liquidations.sql +++ b/models/silver/defi/lending/fraxlend/silver__fraxlend_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH log_join AS ( diff --git a/models/silver/defi/lending/fraxlend/silver__fraxlend_repayments.sql b/models/silver/defi/lending/fraxlend/silver__fraxlend_repayments.sql index a20be373..dad624c6 100644 --- a/models/silver/defi/lending/fraxlend/silver__fraxlend_repayments.sql +++ b/models/silver/defi/lending/fraxlend/silver__fraxlend_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH log_join AS ( diff --git a/models/silver/defi/lending/fraxlend/silver__fraxlend_withdraws.sql b/models/silver/defi/lending/fraxlend/silver__fraxlend_withdraws.sql index 744dd3ee..645d0933 100644 --- a/models/silver/defi/lending/fraxlend/silver__fraxlend_withdraws.sql +++ b/models/silver/defi/lending/fraxlend/silver__fraxlend_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH log_join AS ( diff --git a/models/silver/defi/lending/morpho/silver__morpho_borrows.sql b/models/silver/defi/lending/morpho/silver__morpho_borrows.sql index 2ed22469..fba14684 100644 --- a/models/silver/defi/lending/morpho/silver__morpho_borrows.sql +++ b/models/silver/defi/lending/morpho/silver__morpho_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH traces AS ( @@ -119,5 +119,5 @@ SELECT t._inserted_timestamp FROM tx_join t - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON address = t.loan_token diff --git a/models/silver/defi/lending/morpho/silver__morpho_deposits.sql b/models/silver/defi/lending/morpho/silver__morpho_deposits.sql index 522f7c0f..b1371c2f 100644 --- a/models/silver/defi/lending/morpho/silver__morpho_deposits.sql +++ b/models/silver/defi/lending/morpho/silver__morpho_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH traces AS ( @@ -119,5 +119,5 @@ SELECT t._inserted_timestamp FROM tx_join t - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON address = t.loan_token diff --git a/models/silver/defi/lending/morpho/silver__morpho_flashloans.sql b/models/silver/defi/lending/morpho/silver__morpho_flashloans.sql index 482c3f20..9e38efd4 100644 --- a/models/silver/defi/lending/morpho/silver__morpho_flashloans.sql +++ b/models/silver/defi/lending/morpho/silver__morpho_flashloans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} with flashloan AS( @@ -71,5 +71,5 @@ SELECT f._inserted_timestamp FROM flashloan f - LEFT JOIN {{ ref('silver__contracts') }} c + LEFT JOIN {{ ref('core__dim_contracts') }} c ON f.token = c.address \ No newline at end of file diff --git a/models/silver/defi/lending/morpho/silver__morpho_liquidations.sql b/models/silver/defi/lending/morpho/silver__morpho_liquidations.sql index 74bc72c6..56df69e3 100644 --- a/models/silver/defi/lending/morpho/silver__morpho_liquidations.sql +++ b/models/silver/defi/lending/morpho/silver__morpho_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH traces AS ( @@ -129,9 +129,9 @@ FROM INNER JOIN logs l ON l.tx_hash = t.tx_hash AND l.seized_assets = t.amount - LEFT JOIN {{ ref('silver__contracts') }} + LEFT JOIN {{ ref('core__dim_contracts') }} c0 ON c0.address = t.loan_token - LEFT JOIN {{ ref('silver__contracts') }} + LEFT JOIN {{ ref('core__dim_contracts') }} c1 ON c1.address = t.collateral_token \ No newline at end of file diff --git a/models/silver/defi/lending/morpho/silver__morpho_repayments.sql b/models/silver/defi/lending/morpho/silver__morpho_repayments.sql index dedf5201..ac6656fb 100644 --- a/models/silver/defi/lending/morpho/silver__morpho_repayments.sql +++ b/models/silver/defi/lending/morpho/silver__morpho_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH traces AS ( @@ -119,5 +119,5 @@ SELECT t._inserted_timestamp FROM tx_join t - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON address = t.loan_token diff --git a/models/silver/defi/lending/morpho/silver__morpho_withdraws.sql b/models/silver/defi/lending/morpho/silver__morpho_withdraws.sql index 4ca7ad6b..8136f9b8 100644 --- a/models/silver/defi/lending/morpho/silver__morpho_withdraws.sql +++ b/models/silver/defi/lending/morpho/silver__morpho_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH traces AS ( @@ -119,5 +119,5 @@ SELECT t._inserted_timestamp FROM tx_join t - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON address = t.loan_token diff --git a/models/silver/defi/lending/radiant/silver__radiant_borrows.sql b/models/silver/defi/lending/radiant/silver__radiant_borrows.sql index 4bf9e74f..12b8ca89 100644 --- a/models/silver/defi/lending/radiant/silver__radiant_borrows.sql +++ b/models/silver/defi/lending/radiant/silver__radiant_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH --borrows from Aave LendingPool contracts atoken_meta AS ( diff --git a/models/silver/defi/lending/radiant/silver__radiant_deposits.sql b/models/silver/defi/lending/radiant/silver__radiant_deposits.sql index f781d1c2..ba9efd60 100644 --- a/models/silver/defi/lending/radiant/silver__radiant_deposits.sql +++ b/models/silver/defi/lending/radiant/silver__radiant_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/radiant/silver__radiant_flashloans.sql b/models/silver/defi/lending/radiant/silver__radiant_flashloans.sql index e416cc71..5a3a3378 100644 --- a/models/silver/defi/lending/radiant/silver__radiant_flashloans.sql +++ b/models/silver/defi/lending/radiant/silver__radiant_flashloans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/radiant/silver__radiant_liquidations.sql b/models/silver/defi/lending/radiant/silver__radiant_liquidations.sql index 97afe5be..f9b5ba40 100644 --- a/models/silver/defi/lending/radiant/silver__radiant_liquidations.sql +++ b/models/silver/defi/lending/radiant/silver__radiant_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/radiant/silver__radiant_repayments.sql b/models/silver/defi/lending/radiant/silver__radiant_repayments.sql index 87b345dd..9bea91b3 100644 --- a/models/silver/defi/lending/radiant/silver__radiant_repayments.sql +++ b/models/silver/defi/lending/radiant/silver__radiant_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/radiant/silver__radiant_tokens.sql b/models/silver/defi/lending/radiant/silver__radiant_tokens.sql index 6f4a032f..24923689 100644 --- a/models/silver/defi/lending/radiant/silver__radiant_tokens.sql +++ b/models/silver/defi/lending/radiant/silver__radiant_tokens.sql @@ -1,6 +1,6 @@ {{ config( materialized = 'incremental', - tags = ['curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH DECODE AS ( @@ -134,7 +134,7 @@ FROM a_token_step_2 A INNER JOIN debt_tokens b ON A.a_token_address = b.atoken_address - INNER JOIN {{ ref('silver__contracts') }} C + INNER JOIN {{ ref('core__dim_contracts') }} C ON address = A.underlying_asset qualify(ROW_NUMBER() over(PARTITION BY atoken_address ORDER BY a.atoken_created_block DESC)) = 1 diff --git a/models/silver/defi/lending/radiant/silver__radiant_withdraws.sql b/models/silver/defi/lending/radiant/silver__radiant_withdraws.sql index 3f319fef..f9e25208 100644 --- a/models/silver/defi/lending/radiant/silver__radiant_withdraws.sql +++ b/models/silver/defi/lending/radiant/silver__radiant_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/silo/silver__silo_borrows.sql b/models/silver/defi/lending/silo/silver__silo_borrows.sql index 17d44cda..4cc98a92 100644 --- a/models/silver/defi/lending/silo/silver__silo_borrows.sql +++ b/models/silver/defi/lending/silo/silver__silo_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH borrows AS( @@ -79,7 +79,7 @@ SELECT d._inserted_timestamp FROM borrows d - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON d.asset_address = C.address qualify(ROW_NUMBER() over(PARTITION BY _log_id ORDER BY d._inserted_timestamp DESC)) = 1 diff --git a/models/silver/defi/lending/silo/silver__silo_deposits.sql b/models/silver/defi/lending/silo/silver__silo_deposits.sql index 05a01b6d..67b5f74c 100644 --- a/models/silver/defi/lending/silo/silver__silo_deposits.sql +++ b/models/silver/defi/lending/silo/silver__silo_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH deposits AS( @@ -75,7 +75,7 @@ SELECT d._inserted_timestamp FROM deposits d - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON d.asset_address = C.address qualify(ROW_NUMBER() over(PARTITION BY _log_id ORDER BY d._inserted_timestamp DESC)) = 1 diff --git a/models/silver/defi/lending/silo/silver__silo_liquidations.sql b/models/silver/defi/lending/silo/silver__silo_liquidations.sql index a3801e38..ae8b4059 100644 --- a/models/silver/defi/lending/silo/silver__silo_liquidations.sql +++ b/models/silver/defi/lending/silo/silver__silo_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH liquidations AS( @@ -64,7 +64,7 @@ contracts AS ( SELECT * FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} WHERE address IN ( SELECT diff --git a/models/silver/defi/lending/silo/silver__silo_pools.sql b/models/silver/defi/lending/silo/silver__silo_pools.sql index 15c737b1..74c35cfe 100644 --- a/models/silver/defi/lending/silo/silver__silo_pools.sql +++ b/models/silver/defi/lending/silo/silver__silo_pools.sql @@ -1,6 +1,6 @@ {{ config( materialized = 'incremental', - tags = ['curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH logs_pull AS ( @@ -34,7 +34,7 @@ contracts AS ( SELECT * FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} WHERE ADDRESS IN ( SELECT diff --git a/models/silver/defi/lending/silo/silver__silo_repayments.sql b/models/silver/defi/lending/silo/silver__silo_repayments.sql index ffc3773f..5cda9793 100644 --- a/models/silver/defi/lending/silo/silver__silo_repayments.sql +++ b/models/silver/defi/lending/silo/silver__silo_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH deposits AS( @@ -75,7 +75,7 @@ SELECT d._inserted_timestamp FROM deposits d - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON d.asset_address = C.address qualify(ROW_NUMBER() over(PARTITION BY _log_id ORDER BY d._inserted_timestamp DESC)) = 1 diff --git a/models/silver/defi/lending/silo/silver__silo_withdraws.sql b/models/silver/defi/lending/silo/silver__silo_withdraws.sql index ff651f13..a5ae080f 100644 --- a/models/silver/defi/lending/silo/silver__silo_withdraws.sql +++ b/models/silver/defi/lending/silo/silver__silo_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH deposits AS( @@ -79,7 +79,7 @@ SELECT d._inserted_timestamp FROM deposits d - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON d.asset_address = C.address qualify(ROW_NUMBER() over(PARTITION BY _log_id ORDER BY d._inserted_timestamp DESC)) = 1 diff --git a/models/silver/defi/lending/spark/silver__spark_borrows.sql b/models/silver/defi/lending/spark/silver__spark_borrows.sql index 2eccc332..7e7ed5c1 100644 --- a/models/silver/defi/lending/spark/silver__spark_borrows.sql +++ b/models/silver/defi/lending/spark/silver__spark_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH --borrows from Aave LendingPool contracts atoken_meta AS ( diff --git a/models/silver/defi/lending/spark/silver__spark_deposits.sql b/models/silver/defi/lending/spark/silver__spark_deposits.sql index e04641b8..3233a12d 100644 --- a/models/silver/defi/lending/spark/silver__spark_deposits.sql +++ b/models/silver/defi/lending/spark/silver__spark_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/spark/silver__spark_flashloans.sql b/models/silver/defi/lending/spark/silver__spark_flashloans.sql index 0e30434b..fca98efe 100644 --- a/models/silver/defi/lending/spark/silver__spark_flashloans.sql +++ b/models/silver/defi/lending/spark/silver__spark_flashloans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/spark/silver__spark_liquidations.sql b/models/silver/defi/lending/spark/silver__spark_liquidations.sql index daea8144..7f9c93df 100644 --- a/models/silver/defi/lending/spark/silver__spark_liquidations.sql +++ b/models/silver/defi/lending/spark/silver__spark_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/spark/silver__spark_repayments.sql b/models/silver/defi/lending/spark/silver__spark_repayments.sql index a001ec1b..7c4482f7 100644 --- a/models/silver/defi/lending/spark/silver__spark_repayments.sql +++ b/models/silver/defi/lending/spark/silver__spark_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/spark/silver__spark_tokens.sql b/models/silver/defi/lending/spark/silver__spark_tokens.sql index 7ff46be8..76857cb6 100644 --- a/models/silver/defi/lending/spark/silver__spark_tokens.sql +++ b/models/silver/defi/lending/spark/silver__spark_tokens.sql @@ -1,6 +1,6 @@ {{ config( materialized = 'incremental', - tags = ['curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH DECODE AS ( @@ -134,7 +134,7 @@ FROM a_token_step_2 A INNER JOIN debt_tokens b ON A.a_token_address = b.atoken_address - INNER JOIN {{ ref('silver__contracts') }} C + INNER JOIN {{ ref('core__dim_contracts') }} C ON address = A.underlying_asset qualify(ROW_NUMBER() over(PARTITION BY atoken_address ORDER BY a.atoken_created_block DESC)) = 1 diff --git a/models/silver/defi/lending/spark/silver__spark_withdraws.sql b/models/silver/defi/lending/spark/silver__spark_withdraws.sql index 72df2a81..062dd0cb 100644 --- a/models/silver/defi/lending/spark/silver__spark_withdraws.sql +++ b/models/silver/defi/lending/spark/silver__spark_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/strike/silver__strike_asset_details.sql b/models/silver/defi/lending/strike/silver__strike_asset_details.sql index f246106a..937d0bbb 100644 --- a/models/silver/defi/lending/strike/silver__strike_asset_details.sql +++ b/models/silver/defi/lending/strike/silver__strike_asset_details.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH log_pull AS ( @@ -60,7 +60,7 @@ contracts AS ( SELECT * FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} ), contract_pull AS ( SELECT diff --git a/models/silver/defi/lending/strike/silver__strike_borrows.sql b/models/silver/defi/lending/strike/silver__strike_borrows.sql index c2c44b86..88198ff4 100644 --- a/models/silver/defi/lending/strike/silver__strike_borrows.sql +++ b/models/silver/defi/lending/strike/silver__strike_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/strike/silver__strike_deposits.sql b/models/silver/defi/lending/strike/silver__strike_deposits.sql index bb08672a..14902352 100644 --- a/models/silver/defi/lending/strike/silver__strike_deposits.sql +++ b/models/silver/defi/lending/strike/silver__strike_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/strike/silver__strike_liquidations.sql b/models/silver/defi/lending/strike/silver__strike_liquidations.sql index cc0da0d5..d4677f49 100644 --- a/models/silver/defi/lending/strike/silver__strike_liquidations.sql +++ b/models/silver/defi/lending/strike/silver__strike_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH asset_details AS ( diff --git a/models/silver/defi/lending/strike/silver__strike_repayments.sql b/models/silver/defi/lending/strike/silver__strike_repayments.sql index 6893b327..bd099cc8 100644 --- a/models/silver/defi/lending/strike/silver__strike_repayments.sql +++ b/models/silver/defi/lending/strike/silver__strike_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/strike/silver__strike_withdraws.sql b/models/silver/defi/lending/strike/silver__strike_withdraws.sql index 58a93394..cd1875e5 100644 --- a/models/silver/defi/lending/strike/silver__strike_withdraws.sql +++ b/models/silver/defi/lending/strike/silver__strike_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/sturdy/silver__sturdy_borrows.sql b/models/silver/defi/lending/sturdy/silver__sturdy_borrows.sql index 9fc4e9a3..dd30bbe0 100644 --- a/models/silver/defi/lending/sturdy/silver__sturdy_borrows.sql +++ b/models/silver/defi/lending/sturdy/silver__sturdy_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH --borrows from Aave LendingPool contracts atoken_meta AS ( diff --git a/models/silver/defi/lending/sturdy/silver__sturdy_deposits.sql b/models/silver/defi/lending/sturdy/silver__sturdy_deposits.sql index cacf15a6..4c69d217 100644 --- a/models/silver/defi/lending/sturdy/silver__sturdy_deposits.sql +++ b/models/silver/defi/lending/sturdy/silver__sturdy_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/sturdy/silver__sturdy_liquidations.sql b/models/silver/defi/lending/sturdy/silver__sturdy_liquidations.sql index 4c61d8de..5e5121ef 100644 --- a/models/silver/defi/lending/sturdy/silver__sturdy_liquidations.sql +++ b/models/silver/defi/lending/sturdy/silver__sturdy_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/sturdy/silver__sturdy_repayments.sql b/models/silver/defi/lending/sturdy/silver__sturdy_repayments.sql index 203e4812..314ae701 100644 --- a/models/silver/defi/lending/sturdy/silver__sturdy_repayments.sql +++ b/models/silver/defi/lending/sturdy/silver__sturdy_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/sturdy/silver__sturdy_tokens.sql b/models/silver/defi/lending/sturdy/silver__sturdy_tokens.sql index eb0862b0..41d6330a 100644 --- a/models/silver/defi/lending/sturdy/silver__sturdy_tokens.sql +++ b/models/silver/defi/lending/sturdy/silver__sturdy_tokens.sql @@ -1,6 +1,6 @@ {{ config( materialized = 'incremental', - tags = ['curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH DECODE AS ( @@ -133,7 +133,7 @@ FROM a_token_step_2 A INNER JOIN debt_tokens b ON A.a_token_address = b.atoken_address - INNER JOIN {{ ref('silver__contracts') }} C + INNER JOIN {{ ref('core__dim_contracts') }} C ON address = A.underlying_asset qualify(ROW_NUMBER() over(PARTITION BY atoken_address ORDER BY a.atoken_created_block DESC)) = 1 diff --git a/models/silver/defi/lending/sturdy/silver__sturdy_withdraws.sql b/models/silver/defi/lending/sturdy/silver__sturdy_withdraws.sql index 27c00fb7..043c4f39 100644 --- a/models/silver/defi/lending/sturdy/silver__sturdy_withdraws.sql +++ b/models/silver/defi/lending/sturdy/silver__sturdy_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/uwu/silver__uwu_borrows.sql b/models/silver/defi/lending/uwu/silver__uwu_borrows.sql index 3ace88c3..b2d050a2 100644 --- a/models/silver/defi/lending/uwu/silver__uwu_borrows.sql +++ b/models/silver/defi/lending/uwu/silver__uwu_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH --borrows from Aave LendingPool contracts atoken_meta AS ( diff --git a/models/silver/defi/lending/uwu/silver__uwu_deposits.sql b/models/silver/defi/lending/uwu/silver__uwu_deposits.sql index d76e1c42..4c84b849 100644 --- a/models/silver/defi/lending/uwu/silver__uwu_deposits.sql +++ b/models/silver/defi/lending/uwu/silver__uwu_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/uwu/silver__uwu_flashloans.sql b/models/silver/defi/lending/uwu/silver__uwu_flashloans.sql index 34851f25..2d5f9f6f 100644 --- a/models/silver/defi/lending/uwu/silver__uwu_flashloans.sql +++ b/models/silver/defi/lending/uwu/silver__uwu_flashloans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/uwu/silver__uwu_liquidations.sql b/models/silver/defi/lending/uwu/silver__uwu_liquidations.sql index 892fcd7e..32110ff1 100644 --- a/models/silver/defi/lending/uwu/silver__uwu_liquidations.sql +++ b/models/silver/defi/lending/uwu/silver__uwu_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/uwu/silver__uwu_repayments.sql b/models/silver/defi/lending/uwu/silver__uwu_repayments.sql index 906a1963..8f92b1ef 100644 --- a/models/silver/defi/lending/uwu/silver__uwu_repayments.sql +++ b/models/silver/defi/lending/uwu/silver__uwu_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/uwu/silver__uwu_tokens.sql b/models/silver/defi/lending/uwu/silver__uwu_tokens.sql index 46513d38..a680f7f3 100644 --- a/models/silver/defi/lending/uwu/silver__uwu_tokens.sql +++ b/models/silver/defi/lending/uwu/silver__uwu_tokens.sql @@ -1,6 +1,6 @@ {{ config( materialized = 'incremental', - tags = ['curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH DECODE AS ( @@ -133,7 +133,7 @@ FROM a_token_step_2 A INNER JOIN debt_tokens b ON A.a_token_address = b.atoken_address - INNER JOIN {{ ref('silver__contracts') }} C + INNER JOIN {{ ref('core__dim_contracts') }} C ON address = A.underlying_asset qualify(ROW_NUMBER() over(PARTITION BY atoken_address ORDER BY a.atoken_created_block DESC)) = 1 diff --git a/models/silver/defi/lending/uwu/silver__uwu_withdraws.sql b/models/silver/defi/lending/uwu/silver__uwu_withdraws.sql index 3c691917..1bc4e857 100644 --- a/models/silver/defi/lending/uwu/silver__uwu_withdraws.sql +++ b/models/silver/defi/lending/uwu/silver__uwu_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/liquid_staking/ankr/silver_lsd__ankr_deposits.sql b/models/silver/defi/liquid_staking/ankr/silver_lsd__ankr_deposits.sql index e4030d90..eb6fc3aa 100644 --- a/models/silver/defi/liquid_staking/ankr/silver_lsd__ankr_deposits.sql +++ b/models/silver/defi/liquid_staking/ankr/silver_lsd__ankr_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposits AS ( diff --git a/models/silver/defi/liquid_staking/ankr/silver_lsd__ankr_withdrawals.sql b/models/silver/defi/liquid_staking/ankr/silver_lsd__ankr_withdrawals.sql index 64e8b37c..ce90f603 100644 --- a/models/silver/defi/liquid_staking/ankr/silver_lsd__ankr_withdrawals.sql +++ b/models/silver/defi/liquid_staking/ankr/silver_lsd__ankr_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH withdrawals AS ( diff --git a/models/silver/defi/liquid_staking/binance/silver_lsd__binance_deposits.sql b/models/silver/defi/liquid_staking/binance/silver_lsd__binance_deposits.sql index 2375b32d..aa692d3c 100644 --- a/models/silver/defi/liquid_staking/binance/silver_lsd__binance_deposits.sql +++ b/models/silver/defi/liquid_staking/binance/silver_lsd__binance_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposit_logs AS ( diff --git a/models/silver/defi/liquid_staking/coinbase/silver_lsd__coinbase_deposits.sql b/models/silver/defi/liquid_staking/coinbase/silver_lsd__coinbase_deposits.sql index 9f6b503f..90ad9547 100644 --- a/models/silver/defi/liquid_staking/coinbase/silver_lsd__coinbase_deposits.sql +++ b/models/silver/defi/liquid_staking/coinbase/silver_lsd__coinbase_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH mints AS ( diff --git a/models/silver/defi/liquid_staking/coinbase/silver_lsd__coinbase_withdrawals.sql b/models/silver/defi/liquid_staking/coinbase/silver_lsd__coinbase_withdrawals.sql index dcb0606c..71196497 100644 --- a/models/silver/defi/liquid_staking/coinbase/silver_lsd__coinbase_withdrawals.sql +++ b/models/silver/defi/liquid_staking/coinbase/silver_lsd__coinbase_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH burns AS ( diff --git a/models/silver/defi/liquid_staking/cream/silver_lsd__cream_deposits.sql b/models/silver/defi/liquid_staking/cream/silver_lsd__cream_deposits.sql index e9852025..f73ad0c3 100644 --- a/models/silver/defi/liquid_staking/cream/silver_lsd__cream_deposits.sql +++ b/models/silver/defi/liquid_staking/cream/silver_lsd__cream_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposits AS ( diff --git a/models/silver/defi/liquid_staking/cream/silver_lsd__cream_withdrawals.sql b/models/silver/defi/liquid_staking/cream/silver_lsd__cream_withdrawals.sql index aad0f6f9..ca1e0608 100644 --- a/models/silver/defi/liquid_staking/cream/silver_lsd__cream_withdrawals.sql +++ b/models/silver/defi/liquid_staking/cream/silver_lsd__cream_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH withdrawals AS ( diff --git a/models/silver/defi/liquid_staking/etherfi/silver_lsd__etherfi_deposits.sql b/models/silver/defi/liquid_staking/etherfi/silver_lsd__etherfi_deposits.sql index 94168997..55484e3a 100644 --- a/models/silver/defi/liquid_staking/etherfi/silver_lsd__etherfi_deposits.sql +++ b/models/silver/defi/liquid_staking/etherfi/silver_lsd__etherfi_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposit_logs AS ( diff --git a/models/silver/defi/liquid_staking/etherfi/silver_lsd__etherfi_withdrawals.sql b/models/silver/defi/liquid_staking/etherfi/silver_lsd__etherfi_withdrawals.sql index 0940a485..9633083a 100644 --- a/models/silver/defi/liquid_staking/etherfi/silver_lsd__etherfi_withdrawals.sql +++ b/models/silver/defi/liquid_staking/etherfi/silver_lsd__etherfi_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH withdrawals AS ( diff --git a/models/silver/defi/liquid_staking/frax/silver_lsd__fraxether_deposits.sql b/models/silver/defi/liquid_staking/frax/silver_lsd__fraxether_deposits.sql index c873113e..c59a00c2 100644 --- a/models/silver/defi/liquid_staking/frax/silver_lsd__fraxether_deposits.sql +++ b/models/silver/defi/liquid_staking/frax/silver_lsd__fraxether_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposits AS ( diff --git a/models/silver/defi/liquid_staking/frax/silver_lsd__fraxether_withdrawals.sql b/models/silver/defi/liquid_staking/frax/silver_lsd__fraxether_withdrawals.sql index 0b6fc878..5a9600c6 100644 --- a/models/silver/defi/liquid_staking/frax/silver_lsd__fraxether_withdrawals.sql +++ b/models/silver/defi/liquid_staking/frax/silver_lsd__fraxether_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH withdrawals AS ( diff --git a/models/silver/defi/liquid_staking/guarded/silver_lsd__guarded_deposits.sql b/models/silver/defi/liquid_staking/guarded/silver_lsd__guarded_deposits.sql index ffa6e617..2a8f6ad2 100644 --- a/models/silver/defi/liquid_staking/guarded/silver_lsd__guarded_deposits.sql +++ b/models/silver/defi/liquid_staking/guarded/silver_lsd__guarded_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposit_logs AS ( diff --git a/models/silver/defi/liquid_staking/hord/silver_lsd__hord_deposits.sql b/models/silver/defi/liquid_staking/hord/silver_lsd__hord_deposits.sql index 1854fb08..235c7347 100644 --- a/models/silver/defi/liquid_staking/hord/silver_lsd__hord_deposits.sql +++ b/models/silver/defi/liquid_staking/hord/silver_lsd__hord_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposits AS ( diff --git a/models/silver/defi/liquid_staking/lido/silver_lsd__lido_deposits.sql b/models/silver/defi/liquid_staking/lido/silver_lsd__lido_deposits.sql index 6d824382..ff444227 100644 --- a/models/silver/defi/liquid_staking/lido/silver_lsd__lido_deposits.sql +++ b/models/silver/defi/liquid_staking/lido/silver_lsd__lido_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposits AS ( diff --git a/models/silver/defi/liquid_staking/lido/silver_lsd__lido_withdrawal_requests.sql b/models/silver/defi/liquid_staking/lido/silver_lsd__lido_withdrawal_requests.sql index b01eac9a..a7ee6046 100644 --- a/models/silver/defi/liquid_staking/lido/silver_lsd__lido_withdrawal_requests.sql +++ b/models/silver/defi/liquid_staking/lido/silver_lsd__lido_withdrawal_requests.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH requests AS ( diff --git a/models/silver/defi/liquid_staking/lido/silver_lsd__lido_withdrawals_claimed.sql b/models/silver/defi/liquid_staking/lido/silver_lsd__lido_withdrawals_claimed.sql index 304a4d68..14259df8 100644 --- a/models/silver/defi/liquid_staking/lido/silver_lsd__lido_withdrawals_claimed.sql +++ b/models/silver/defi/liquid_staking/lido/silver_lsd__lido_withdrawals_claimed.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH claims AS ( diff --git a/models/silver/defi/liquid_staking/liquidcollective/silver_lsd__liquidcollective_deposits.sql b/models/silver/defi/liquid_staking/liquidcollective/silver_lsd__liquidcollective_deposits.sql index 805579ff..f36831ea 100644 --- a/models/silver/defi/liquid_staking/liquidcollective/silver_lsd__liquidcollective_deposits.sql +++ b/models/silver/defi/liquid_staking/liquidcollective/silver_lsd__liquidcollective_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposit_logs AS ( diff --git a/models/silver/defi/liquid_staking/liquidcollective/silver_lsd__liquidcollective_withdrawals.sql b/models/silver/defi/liquid_staking/liquidcollective/silver_lsd__liquidcollective_withdrawals.sql index 8c4c8013..a672dc29 100644 --- a/models/silver/defi/liquid_staking/liquidcollective/silver_lsd__liquidcollective_withdrawals.sql +++ b/models/silver/defi/liquid_staking/liquidcollective/silver_lsd__liquidcollective_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH withdrawals AS ( diff --git a/models/silver/defi/liquid_staking/mantle/silver_lsd__mantle_deposits.sql b/models/silver/defi/liquid_staking/mantle/silver_lsd__mantle_deposits.sql index 3022626e..1e9292e3 100644 --- a/models/silver/defi/liquid_staking/mantle/silver_lsd__mantle_deposits.sql +++ b/models/silver/defi/liquid_staking/mantle/silver_lsd__mantle_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH stake AS ( diff --git a/models/silver/defi/liquid_staking/mantle/silver_lsd__mantle_withdrawals.sql b/models/silver/defi/liquid_staking/mantle/silver_lsd__mantle_withdrawals.sql index d1fca818..e73274fc 100644 --- a/models/silver/defi/liquid_staking/mantle/silver_lsd__mantle_withdrawals.sql +++ b/models/silver/defi/liquid_staking/mantle/silver_lsd__mantle_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH unstake AS ( diff --git a/models/silver/defi/liquid_staking/nodedao/silver_lsd__nodedao_deposits.sql b/models/silver/defi/liquid_staking/nodedao/silver_lsd__nodedao_deposits.sql index bf777d7c..df8cfafb 100644 --- a/models/silver/defi/liquid_staking/nodedao/silver_lsd__nodedao_deposits.sql +++ b/models/silver/defi/liquid_staking/nodedao/silver_lsd__nodedao_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposits AS ( diff --git a/models/silver/defi/liquid_staking/nodedao/silver_lsd__nodedao_withdrawals.sql b/models/silver/defi/liquid_staking/nodedao/silver_lsd__nodedao_withdrawals.sql index c37e9a6a..0116e68f 100644 --- a/models/silver/defi/liquid_staking/nodedao/silver_lsd__nodedao_withdrawals.sql +++ b/models/silver/defi/liquid_staking/nodedao/silver_lsd__nodedao_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH withdrawals AS ( diff --git a/models/silver/defi/liquid_staking/origin/silver_lsd__origin_deposits.sql b/models/silver/defi/liquid_staking/origin/silver_lsd__origin_deposits.sql index 82e831f6..fb56d66c 100644 --- a/models/silver/defi/liquid_staking/origin/silver_lsd__origin_deposits.sql +++ b/models/silver/defi/liquid_staking/origin/silver_lsd__origin_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposit_logs AS ( diff --git a/models/silver/defi/liquid_staking/origin/silver_lsd__origin_withdrawals.sql b/models/silver/defi/liquid_staking/origin/silver_lsd__origin_withdrawals.sql index 4c138e8e..681123f4 100644 --- a/models/silver/defi/liquid_staking/origin/silver_lsd__origin_withdrawals.sql +++ b/models/silver/defi/liquid_staking/origin/silver_lsd__origin_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH withdrawals AS ( diff --git a/models/silver/defi/liquid_staking/rocketpool/silver_lsd__rocketpool_deposits.sql b/models/silver/defi/liquid_staking/rocketpool/silver_lsd__rocketpool_deposits.sql index bc199143..b28451f6 100644 --- a/models/silver/defi/liquid_staking/rocketpool/silver_lsd__rocketpool_deposits.sql +++ b/models/silver/defi/liquid_staking/rocketpool/silver_lsd__rocketpool_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposits AS ( diff --git a/models/silver/defi/liquid_staking/rocketpool/silver_lsd__rocketpool_withdrawals.sql b/models/silver/defi/liquid_staking/rocketpool/silver_lsd__rocketpool_withdrawals.sql index b832508a..39bd61fe 100644 --- a/models/silver/defi/liquid_staking/rocketpool/silver_lsd__rocketpool_withdrawals.sql +++ b/models/silver/defi/liquid_staking/rocketpool/silver_lsd__rocketpool_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH burns AS ( diff --git a/models/silver/defi/liquid_staking/sharedstake/silver_lsd__sharedstake_v2_deposits.sql b/models/silver/defi/liquid_staking/sharedstake/silver_lsd__sharedstake_v2_deposits.sql index 12a24a09..73b3bb3f 100644 --- a/models/silver/defi/liquid_staking/sharedstake/silver_lsd__sharedstake_v2_deposits.sql +++ b/models/silver/defi/liquid_staking/sharedstake/silver_lsd__sharedstake_v2_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposit_logs AS ( diff --git a/models/silver/defi/liquid_staking/sharedstake/silver_lsd__sharedstake_v2_withdrawals.sql b/models/silver/defi/liquid_staking/sharedstake/silver_lsd__sharedstake_v2_withdrawals.sql index 9b2ab6c2..e0fca75c 100644 --- a/models/silver/defi/liquid_staking/sharedstake/silver_lsd__sharedstake_v2_withdrawals.sql +++ b/models/silver/defi/liquid_staking/sharedstake/silver_lsd__sharedstake_v2_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH withdrawals AS ( diff --git a/models/silver/defi/liquid_staking/sharedstake/silver_lsd__sharedstake_withdrawals.sql b/models/silver/defi/liquid_staking/sharedstake/silver_lsd__sharedstake_withdrawals.sql index 39e0d5fb..fccae2f1 100644 --- a/models/silver/defi/liquid_staking/sharedstake/silver_lsd__sharedstake_withdrawals.sql +++ b/models/silver/defi/liquid_staking/sharedstake/silver_lsd__sharedstake_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH withdrawals AS ( diff --git a/models/silver/defi/liquid_staking/silver_lsd__complete_lsd_deposits.sql b/models/silver/defi/liquid_staking/silver_lsd__complete_lsd_deposits.sql index f2a8a4d9..29313116 100644 --- a/models/silver/defi/liquid_staking/silver_lsd__complete_lsd_deposits.sql +++ b/models/silver/defi/liquid_staking/silver_lsd__complete_lsd_deposits.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform','version'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_function_signature, origin_from_address, origin_to_address, contract_address, event_name, sender, recipient, token_address, token_symbol), SUBSTRING(origin_function_signature, event_name, token_address, token_symbol)", - tags = ['curated','reorg','heal'] + tags = ['silver','defi','liquid_staking','curated','heal'] ) }} WITH ankr AS ( diff --git a/models/silver/defi/liquid_staking/silver_lsd__complete_lsd_withdrawals.sql b/models/silver/defi/liquid_staking/silver_lsd__complete_lsd_withdrawals.sql index 02262f62..aa9a0e6d 100644 --- a/models/silver/defi/liquid_staking/silver_lsd__complete_lsd_withdrawals.sql +++ b/models/silver/defi/liquid_staking/silver_lsd__complete_lsd_withdrawals.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform','version'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_function_signature, origin_from_address, origin_to_address, contract_address, event_name, sender, recipient, token_address, token_symbol), SUBSTRING(origin_function_signature, event_name, token_address, token_symbol)", - tags = ['curated','reorg','heal'] + tags = ['silver','defi','liquid_staking','curated','heal'] ) }} WITH ankr AS ( diff --git a/models/silver/defi/liquid_staking/stader/silver_lsd__stader_deposits.sql b/models/silver/defi/liquid_staking/stader/silver_lsd__stader_deposits.sql index 01f6f553..8f19240e 100644 --- a/models/silver/defi/liquid_staking/stader/silver_lsd__stader_deposits.sql +++ b/models/silver/defi/liquid_staking/stader/silver_lsd__stader_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposits AS ( diff --git a/models/silver/defi/liquid_staking/stader/silver_lsd__stader_withdrawals.sql b/models/silver/defi/liquid_staking/stader/silver_lsd__stader_withdrawals.sql index 3be657d2..5f90b52e 100644 --- a/models/silver/defi/liquid_staking/stader/silver_lsd__stader_withdrawals.sql +++ b/models/silver/defi/liquid_staking/stader/silver_lsd__stader_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH requests AS ( diff --git a/models/silver/defi/liquid_staking/stafi/silver_lsd__stafi_deposits.sql b/models/silver/defi/liquid_staking/stafi/silver_lsd__stafi_deposits.sql index 9ca1701d..7b431ae2 100644 --- a/models/silver/defi/liquid_staking/stafi/silver_lsd__stafi_deposits.sql +++ b/models/silver/defi/liquid_staking/stafi/silver_lsd__stafi_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposits AS ( diff --git a/models/silver/defi/liquid_staking/stafi/silver_lsd__stafi_withdrawals.sql b/models/silver/defi/liquid_staking/stafi/silver_lsd__stafi_withdrawals.sql index e4c6efd8..381682cb 100644 --- a/models/silver/defi/liquid_staking/stafi/silver_lsd__stafi_withdrawals.sql +++ b/models/silver/defi/liquid_staking/stafi/silver_lsd__stafi_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH withdrawals AS ( diff --git a/models/silver/defi/liquid_staking/stakehound/silver_lsd__stakehound_deposits.sql b/models/silver/defi/liquid_staking/stakehound/silver_lsd__stakehound_deposits.sql index 4c6afc22..ad773256 100644 --- a/models/silver/defi/liquid_staking/stakehound/silver_lsd__stakehound_deposits.sql +++ b/models/silver/defi/liquid_staking/stakehound/silver_lsd__stakehound_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH mints AS ( diff --git a/models/silver/defi/liquid_staking/stakestone/silver_lsd__stakestone_deposits.sql b/models/silver/defi/liquid_staking/stakestone/silver_lsd__stakestone_deposits.sql index 559414cb..a2d017e6 100644 --- a/models/silver/defi/liquid_staking/stakestone/silver_lsd__stakestone_deposits.sql +++ b/models/silver/defi/liquid_staking/stakestone/silver_lsd__stakestone_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposit_logs AS ( diff --git a/models/silver/defi/liquid_staking/stakestone/silver_lsd__stakestone_withdrawals.sql b/models/silver/defi/liquid_staking/stakestone/silver_lsd__stakestone_withdrawals.sql index a019097c..031c34ed 100644 --- a/models/silver/defi/liquid_staking/stakestone/silver_lsd__stakestone_withdrawals.sql +++ b/models/silver/defi/liquid_staking/stakestone/silver_lsd__stakestone_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH withdrawals AS ( diff --git a/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_deposits.sql b/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_deposits.sql index 02365273..58a3ee69 100644 --- a/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_deposits.sql +++ b/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH transfers AS ( diff --git a/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_v3_deposits.sql b/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_v3_deposits.sql index 41a61938..ac0d9559 100644 --- a/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_v3_deposits.sql +++ b/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_v3_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH vaults AS ( diff --git a/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_v3_vaults.sql b/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_v3_vaults.sql index a8f41893..0d8787d9 100644 --- a/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_v3_vaults.sql +++ b/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_v3_vaults.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "vault_address", - tags = ['curated'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH factories AS ( diff --git a/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_v3_withdrawals.sql b/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_v3_withdrawals.sql index 2a627cd2..edc454b9 100644 --- a/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_v3_withdrawals.sql +++ b/models/silver/defi/liquid_staking/stakewise/silver_lsd__stakewise_v3_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH vaults AS ( diff --git a/models/silver/defi/liquid_staking/swell/silver_lsd__swell_deposits.sql b/models/silver/defi/liquid_staking/swell/silver_lsd__swell_deposits.sql index d489012e..2a8c65a1 100644 --- a/models/silver/defi/liquid_staking/swell/silver_lsd__swell_deposits.sql +++ b/models/silver/defi/liquid_staking/swell/silver_lsd__swell_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposits_t1 AS ( diff --git a/models/silver/defi/liquid_staking/unieth/silver_lsd__unieth_deposits.sql b/models/silver/defi/liquid_staking/unieth/silver_lsd__unieth_deposits.sql index df6befa2..d21f4e18 100644 --- a/models/silver/defi/liquid_staking/unieth/silver_lsd__unieth_deposits.sql +++ b/models/silver/defi/liquid_staking/unieth/silver_lsd__unieth_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH deposit_logs AS ( diff --git a/models/silver/defi/liquid_staking/unieth/silver_lsd__unieth_withdrawals.sql b/models/silver/defi/liquid_staking/unieth/silver_lsd__unieth_withdrawals.sql index 7e20db2d..2952aa84 100644 --- a/models/silver/defi/liquid_staking/unieth/silver_lsd__unieth_withdrawals.sql +++ b/models/silver/defi/liquid_staking/unieth/silver_lsd__unieth_withdrawals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','defi','liquid_staking','curated'] ) }} WITH withdrawals AS ( diff --git a/models/silver/l2/data_availability/silver_l2__blobs_submission.sql b/models/silver/l2/data_availability/silver_l2__blobs_submission.sql index 14e0697a..1dd4de10 100644 --- a/models/silver/l2/data_availability/silver_l2__blobs_submission.sql +++ b/models/silver/l2/data_availability/silver_l2__blobs_submission.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated'] + tags = ['silver','l2','curated'] ) }} WITH da_addresses AS ( diff --git a/models/silver/l2/data_availability/silver_l2__calldata_submission.sql b/models/silver/l2/data_availability/silver_l2__calldata_submission.sql index 5aaf79cb..1c2d56ea 100644 --- a/models/silver/l2/data_availability/silver_l2__calldata_submission.sql +++ b/models/silver/l2/data_availability/silver_l2__calldata_submission.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated'] + tags = ['silver','l2','curated'] ) }} WITH da_addresses AS ( diff --git a/models/silver/l2/data_availability/silver_l2__da_address.sql b/models/silver/l2/data_availability/silver_l2__da_address.sql index 3ae591e1..53345ed8 100644 --- a/models/silver/l2/data_availability/silver_l2__da_address.sql +++ b/models/silver/l2/data_availability/silver_l2__da_address.sql @@ -1,7 +1,7 @@ {{ config( materialized = 'table', unique_key = ['chain', 'da_address'], - tags = ['curated'] + tags = ['silver','l2','curated'] ) }} WITH da_addresses AS ( diff --git a/models/silver/l2/state_validation/op_stack/silver_l2__opstack_dispute_games.sql b/models/silver/l2/state_validation/op_stack/silver_l2__opstack_dispute_games.sql index c55c7d3a..cddfb7a3 100644 --- a/models/silver/l2/state_validation/op_stack/silver_l2__opstack_dispute_games.sql +++ b/models/silver/l2/state_validation/op_stack/silver_l2__opstack_dispute_games.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated'] + tags = ['silver','curated'] ) }} WITH validation_addresses AS ( diff --git a/models/silver/l2/state_validation/op_stack/silver_l2__opstack_output_oracle.sql b/models/silver/l2/state_validation/op_stack/silver_l2__opstack_output_oracle.sql index 0deec3b8..e72d63eb 100644 --- a/models/silver/l2/state_validation/op_stack/silver_l2__opstack_output_oracle.sql +++ b/models/silver/l2/state_validation/op_stack/silver_l2__opstack_output_oracle.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated'] + tags = ['silver','curated'] ) }} WITH validation_addresses AS ( diff --git a/models/silver/l2/state_validation/silver_l2__validation_address.sql b/models/silver/l2/state_validation/silver_l2__validation_address.sql index 538d9896..b63b5167 100644 --- a/models/silver/l2/state_validation/silver_l2__validation_address.sql +++ b/models/silver/l2/state_validation/silver_l2__validation_address.sql @@ -1,7 +1,7 @@ {{ config( materialized = 'table', unique_key = ['chain', 'validation_address'], - tags = ['curated'] + tags = ['silver','curated'] ) }} WITH validation_addresses AS ( diff --git a/models/silver/labels/silver__labels.sql b/models/silver/labels/silver__labels.sql deleted file mode 100644 index ed350136..00000000 --- a/models/silver/labels/silver__labels.sql +++ /dev/null @@ -1,40 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = ['address', 'blockchain'], - incremental_strategy = 'merge', - merge_exclude_columns = ["inserted_timestamp"], - cluster_by = 'modified_timestamp::DATE', - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(address, label_type, label_subtype, address_name, project_name), SUBSTRING(address, label_type, label_subtype, address_name, project_name); DELETE FROM {{ this }} WHERE _is_deleted = TRUE;", - tags = ['non_realtime'] -) }} - -SELECT - system_created_at, - insert_date, - blockchain, - address, - creator, - label_type, - label_subtype, - address_name, - project_name, - _is_deleted, - labels_combined_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {{ ref('bronze__labels') }} -WHERE - 1 = 1 - -{% if is_incremental() %} -AND modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} -) -{% endif %} diff --git a/models/silver/labels/silver__labels.yml b/models/silver/labels/silver__labels.yml deleted file mode 100644 index 8c7511fb..00000000 --- a/models/silver/labels/silver__labels.yml +++ /dev/null @@ -1,47 +0,0 @@ -version: 2 -models: - - name: silver__labels - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - BLOCKCHAIN - - CREATOR - - ADDRESS - columns: - - name: BLOCKCHAIN - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_set: - value_set: ['ethereum'] - - name: CREATOR - tests: - - not_null - - name: ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: ADDRESS_NAME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - name: LABEL_TYPE - tests: - - not_null - - name: LABEL_SUBTYPE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - name: PROJECT_NAME - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - diff --git a/models/silver/nft/lending/arcade_v1/silver_nft__arcade_v1_liquidations.sql b/models/silver/nft/lending/arcade_v1/silver_nft__arcade_v1_liquidations.sql index a0e204ba..c2edaeb2 100644 --- a/models/silver/nft/lending/arcade_v1/silver_nft__arcade_v1_liquidations.sql +++ b/models/silver/nft/lending/arcade_v1/silver_nft__arcade_v1_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated', 'reorg'] + tags = ['silver','nft','curated'] ) }} WITH base AS ( diff --git a/models/silver/nft/lending/arcade_v2/silver_nft__arcade_v2_liquidations.sql b/models/silver/nft/lending/arcade_v2/silver_nft__arcade_v2_liquidations.sql index 1016b617..529267f4 100644 --- a/models/silver/nft/lending/arcade_v2/silver_nft__arcade_v2_liquidations.sql +++ b/models/silver/nft/lending/arcade_v2/silver_nft__arcade_v2_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH base AS ( diff --git a/models/silver/nft/lending/arcade_v3/silver_nft__arcade_v3_liquidations.sql b/models/silver/nft/lending/arcade_v3/silver_nft__arcade_v3_liquidations.sql index a7a8177b..6ef973ec 100644 --- a/models/silver/nft/lending/arcade_v3/silver_nft__arcade_v3_liquidations.sql +++ b/models/silver/nft/lending/arcade_v3/silver_nft__arcade_v3_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH base AS ( diff --git a/models/silver/nft/lending/arcade_v3/silver_nft__arcade_v3_loans.sql b/models/silver/nft/lending/arcade_v3/silver_nft__arcade_v3_loans.sql index 4dd75677..80fce0be 100644 --- a/models/silver/nft/lending/arcade_v3/silver_nft__arcade_v3_loans.sql +++ b/models/silver/nft/lending/arcade_v3/silver_nft__arcade_v3_loans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_traces AS ( @@ -34,8 +34,7 @@ WITH raw_traces AS ( gas_used, trace_succeeded, error_reason, - tx_succeeded, - fact_decoded_traces_id, + tx_succeeded, inserted_timestamp, modified_timestamp AS _inserted_timestamp FROM diff --git a/models/silver/nft/lending/arcade_v3/silver_nft__arcade_v3_repayments.sql b/models/silver/nft/lending/arcade_v3/silver_nft__arcade_v3_repayments.sql index 99e3f7ba..a308a62b 100644 --- a/models/silver/nft/lending/arcade_v3/silver_nft__arcade_v3_repayments.sql +++ b/models/silver/nft/lending/arcade_v3/silver_nft__arcade_v3_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH base AS ( diff --git a/models/silver/nft/lending/blur/silver_nft__blend_liquidations.sql b/models/silver/nft/lending/blur/silver_nft__blend_liquidations.sql index 3bed2362..b8dba20e 100644 --- a/models/silver/nft/lending/blur/silver_nft__blend_liquidations.sql +++ b/models/silver/nft/lending/blur/silver_nft__blend_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_traces AS ( diff --git a/models/silver/nft/lending/blur/silver_nft__blend_loans.sql b/models/silver/nft/lending/blur/silver_nft__blend_loans.sql index 6ef2b6f1..60789b95 100644 --- a/models/silver/nft/lending/blur/silver_nft__blend_loans.sql +++ b/models/silver/nft/lending/blur/silver_nft__blend_loans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_logs AS ( diff --git a/models/silver/nft/lending/blur/silver_nft__blend_new_loans.sql b/models/silver/nft/lending/blur/silver_nft__blend_new_loans.sql index f26c5560..7c6ecd9e 100644 --- a/models/silver/nft/lending/blur/silver_nft__blend_new_loans.sql +++ b/models/silver/nft/lending/blur/silver_nft__blend_new_loans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_logs AS ( diff --git a/models/silver/nft/lending/blur/silver_nft__blend_repayments.sql b/models/silver/nft/lending/blur/silver_nft__blend_repayments.sql index 5214ab8e..ec22fd29 100644 --- a/models/silver/nft/lending/blur/silver_nft__blend_repayments.sql +++ b/models/silver/nft/lending/blur/silver_nft__blend_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH calculation_helpers AS ( diff --git a/models/silver/nft/lending/complete_lending/silver_nft__complete_liquidations.sql b/models/silver/nft/lending/complete_lending/silver_nft__complete_liquidations.sql index 46d3667e..1ef7e818 100644 --- a/models/silver/nft/lending/complete_lending/silver_nft__complete_liquidations.sql +++ b/models/silver/nft/lending/complete_lending/silver_nft__complete_liquidations.sql @@ -4,7 +4,7 @@ unique_key = ['block_number', 'platform_exchange_version'], cluster_by = ['block_timestamp::DATE','platform_name'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_function_signature, origin_from_address, origin_to_address, event_name, platform_address, platform_exchange_version, contract_address, lender_address, borrower_address, nft_address, project_name, loan_token_address, loan_token_symbol, loan_term_type), SUBSTRING(origin_function_signature, event_name, platform_address, platform_exchange_version, lender_address, borrower_address, nft_address, project_name, loan_token_address, loan_token_symbol, loan_term_type)", - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH base_models AS ( @@ -402,7 +402,7 @@ FINAL AS ( b.block_timestamp ) = e.hour INNER JOIN tx_data USING (tx_hash) - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON b.nft_address = C.address {% if is_incremental() and 'heal_tx' in var('HEAL_MODELS') %} diff --git a/models/silver/nft/lending/complete_lending/silver_nft__complete_loans.sql b/models/silver/nft/lending/complete_lending/silver_nft__complete_loans.sql index a4764c5c..d2efeb03 100644 --- a/models/silver/nft/lending/complete_lending/silver_nft__complete_loans.sql +++ b/models/silver/nft/lending/complete_lending/silver_nft__complete_loans.sql @@ -4,7 +4,7 @@ unique_key = ['block_number', 'platform_exchange_version'], cluster_by = ['block_timestamp::DATE', 'platform_name'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_function_signature, origin_from_address, origin_to_address, event_name, event_type, platform_address, platform_exchange_version, lender_address, borrower_address, nft_address, project_name, loan_token_address, loan_token_symbol, loan_term_type), SUBSTRING(origin_function_signature, event_name, event_type, platform_address, platform_exchange_version, lender_address, borrower_address, nft_address, project_name, loan_token_address, loan_token_symbol, loan_term_type)", - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH base_models AS ( @@ -448,7 +448,7 @@ FINAL AS ( 'hour', b.block_timestamp ) = e.hour - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON b.nft_address = C.address {% if is_incremental() and 'heal_tx' in var('HEAL_MODELS') %} diff --git a/models/silver/nft/lending/complete_lending/silver_nft__complete_repayments.sql b/models/silver/nft/lending/complete_lending/silver_nft__complete_repayments.sql index e29ddf5c..706721c4 100644 --- a/models/silver/nft/lending/complete_lending/silver_nft__complete_repayments.sql +++ b/models/silver/nft/lending/complete_lending/silver_nft__complete_repayments.sql @@ -4,7 +4,7 @@ unique_key = ['block_number', 'platform_exchange_version'], cluster_by = ['block_timestamp::DATE','platform_name'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_function_signature, origin_from_address, origin_to_address, event_name, event_type, platform_address, platform_exchange_version, contract_address, lender_address, borrower_address, nft_address, project_name, loan_token_address, loan_token_symbol, loan_term_type), SUBSTRING(origin_function_signature, event_name, event_type, platform_address, platform_exchange_version, lender_address, borrower_address, nft_address, project_name, loan_token_address, loan_token_symbol, loan_term_type)", - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH base_models AS ( @@ -455,7 +455,7 @@ FINAL AS ( b.block_timestamp ) = e.hour INNER JOIN tx_data USING (tx_hash) - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON b.nft_address = C.address {% if is_incremental() and 'heal_tx' in var('HEAL_MODELS') %} diff --git a/models/silver/nft/lending/nftfi_v1/silver_nft__nftfi_v1_liquidations.sql b/models/silver/nft/lending/nftfi_v1/silver_nft__nftfi_v1_liquidations.sql index 2b415a64..bf8881eb 100644 --- a/models/silver/nft/lending/nftfi_v1/silver_nft__nftfi_v1_liquidations.sql +++ b/models/silver/nft/lending/nftfi_v1/silver_nft__nftfi_v1_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated', 'reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_logs AS ( diff --git a/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_liquidations.sql b/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_liquidations.sql index f1639baf..f4caa6c0 100644 --- a/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_liquidations.sql +++ b/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_logs AS ( diff --git a/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_loans.sql b/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_loans.sql index bcf905ff..dc3c1513 100644 --- a/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_loans.sql +++ b/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_loans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_logs AS ( diff --git a/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_new_loans.sql b/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_new_loans.sql index 753464af..6cc24a21 100644 --- a/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_new_loans.sql +++ b/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_new_loans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "_log_id", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_logs AS ( diff --git a/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_obligation_receipts.sql b/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_obligation_receipts.sql index b0caf940..49b0c9ce 100644 --- a/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_obligation_receipts.sql +++ b/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_obligation_receipts.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} SELECT diff --git a/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_repayments.sql b/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_repayments.sql index 2ea20b55..67df96c0 100644 --- a/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_repayments.sql +++ b/models/silver/nft/lending/nftfi_v2/silver_nft__nftfi_v2_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_logs AS ( diff --git a/models/silver/nft/mev/arbitrage/silver_nft__arbitrage_events.sql b/models/silver/nft/mev/arbitrage/silver_nft__arbitrage_events.sql index 6ca0a0ae..2151d2a5 100644 --- a/models/silver/nft/mev/arbitrage/silver_nft__arbitrage_events.sql +++ b/models/silver/nft/mev/arbitrage/silver_nft__arbitrage_events.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = ['block_number'], cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH base AS ( diff --git a/models/silver/nft/mev/arbitrage/silver_nft__arbitrage_raw.sql b/models/silver/nft/mev/arbitrage/silver_nft__arbitrage_raw.sql index b762b192..d39e0444 100644 --- a/models/silver/nft/mev/arbitrage/silver_nft__arbitrage_raw.sql +++ b/models/silver/nft/mev/arbitrage/silver_nft__arbitrage_raw.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = ['block_number'], cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_sales AS ( diff --git a/models/silver/nft/mev/arbitrage/silver_nft__arbitrage_trades.sql b/models/silver/nft/mev/arbitrage/silver_nft__arbitrage_trades.sql index 71594883..c88e7b0a 100644 --- a/models/silver/nft/mev/arbitrage/silver_nft__arbitrage_trades.sql +++ b/models/silver/nft/mev/arbitrage/silver_nft__arbitrage_trades.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = ['block_number'], cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH base AS ( diff --git a/models/silver/nft/sales/artblocks/silver_nft__artblocks_base_sales.sql b/models/silver/nft/sales/artblocks/silver_nft__artblocks_base_sales.sql index e161756f..bf4f1c71 100644 --- a/models/silver/nft/sales/artblocks/silver_nft__artblocks_base_sales.sql +++ b/models/silver/nft/sales/artblocks/silver_nft__artblocks_base_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} /* Old artblocks contracts diff --git a/models/silver/nft/sales/artblocks/silver_nft__artblocks_sales.sql b/models/silver/nft/sales/artblocks/silver_nft__artblocks_sales.sql index b53e4446..5a263fdb 100644 --- a/models/silver/nft/sales/artblocks/silver_nft__artblocks_sales.sql +++ b/models/silver/nft/sales/artblocks/silver_nft__artblocks_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH seller_base AS ( diff --git a/models/silver/nft/sales/silver_nft__blur_blend_sales.sql b/models/silver/nft/sales/silver_nft__blur_blend_sales.sql index 6fa33419..665fd464 100644 --- a/models/silver/nft/sales/silver_nft__blur_blend_sales.sql +++ b/models/silver/nft/sales/silver_nft__blur_blend_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_traces AS ( diff --git a/models/silver/nft/sales/silver_nft__blur_decoded_sales.sql b/models/silver/nft/sales/silver_nft__blur_decoded_sales.sql index 456b2952..d92969ba 100644 --- a/models/silver/nft/sales/silver_nft__blur_decoded_sales.sql +++ b/models/silver/nft/sales/silver_nft__blur_decoded_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH base AS ( diff --git a/models/silver/nft/sales/silver_nft__blur_v2.sql b/models/silver/nft/sales/silver_nft__blur_v2.sql index b2092124..22a74b77 100644 --- a/models/silver/nft/sales/silver_nft__blur_v2.sql +++ b/models/silver/nft/sales/silver_nft__blur_v2.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = ['block_number', 'event_index'], cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH blur_v2_tx AS ( diff --git a/models/silver/nft/sales/silver_nft__complete_nft_sales.sql b/models/silver/nft/sales/silver_nft__complete_nft_sales.sql index 8bbd15d2..e86ed783 100644 --- a/models/silver/nft/sales/silver_nft__complete_nft_sales.sql +++ b/models/silver/nft/sales/silver_nft__complete_nft_sales.sql @@ -4,7 +4,7 @@ unique_key = ['block_number','platform_exchange_version'], cluster_by = ['block_timestamp::DATE','platform_name'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_function_signature, origin_from_address, origin_to_address, event_type, platform_address, platform_exchange_version, seller_address, buyer_address, nft_address, project_name, currency_address, currency_symbol), SUBSTRING(origin_function_signature, event_type, platform_address, platform_exchange_version, seller_address, buyer_address, nft_address, project_name, currency_address, currency_symbol)", - tags = ['curated','reorg', 'heal'] + tags = ['silver','nft','curated','heal'] ) }} WITH nft_base_models AS ( @@ -879,7 +879,7 @@ contracts_decimal AS ( symbol AS symbol_contracts, decimals AS decimals_contracts FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} WHERE address IN ( SELECT @@ -1125,7 +1125,7 @@ heal_model AS ( FROM {{ this }} t - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON t.nft_address = C.address LEFT JOIN {{ ref('silver_nft__aggregator_list') }} A ON RIGHT( @@ -1159,7 +1159,7 @@ heal_model AS ( SELECT 1 FROM - {{ ref('silver__contracts') }} C + {{ ref('core__dim_contracts') }} C WHERE C._inserted_timestamp > DATEADD('DAY', -14, SYSDATE()) AND C.name IS NOT NULL @@ -1293,7 +1293,7 @@ heal_model AS ( '{{ invocation_id }}' AS _invocation_id FROM final_base b - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON b.nft_address = C.address LEFT JOIN {{ ref('silver_nft__aggregator_list') }} A ON RIGHT( diff --git a/models/silver/nft/sales/silver_nft__cryptopunk_bids.sql b/models/silver/nft/sales/silver_nft__cryptopunk_bids.sql index 007a3bca..2009329b 100644 --- a/models/silver/nft/sales/silver_nft__cryptopunk_bids.sql +++ b/models/silver/nft/sales/silver_nft__cryptopunk_bids.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH base AS ( diff --git a/models/silver/nft/sales/silver_nft__cryptopunk_sales.sql b/models/silver/nft/sales/silver_nft__cryptopunk_sales.sql index 78f97ce8..bb487da2 100644 --- a/models/silver/nft/sales/silver_nft__cryptopunk_sales.sql +++ b/models/silver/nft/sales/silver_nft__cryptopunk_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_traces AS ( diff --git a/models/silver/nft/sales/silver_nft__element_sales.sql b/models/silver/nft/sales/silver_nft__element_sales.sql index 64d1220c..04f99ebf 100644 --- a/models/silver/nft/sales/silver_nft__element_sales.sql +++ b/models/silver/nft/sales/silver_nft__element_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH settings AS ( diff --git a/models/silver/nft/sales/silver_nft__looksrare_v2.sql b/models/silver/nft/sales/silver_nft__looksrare_v2.sql index 07700442..b08bfc0b 100644 --- a/models/silver/nft/sales/silver_nft__looksrare_v2.sql +++ b/models/silver/nft/sales/silver_nft__looksrare_v2.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_decoded_logs AS ( diff --git a/models/silver/nft/sales/silver_nft__magiceden_sales.sql b/models/silver/nft/sales/silver_nft__magiceden_sales.sql index 1cf961c1..c067f244 100644 --- a/models/silver/nft/sales/silver_nft__magiceden_sales.sql +++ b/models/silver/nft/sales/silver_nft__magiceden_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH decoded_trace AS ( diff --git a/models/silver/nft/sales/silver_nft__nftx_decoded_sales.sql b/models/silver/nft/sales/silver_nft__nftx_decoded_sales.sql index f1db0211..7f998b82 100644 --- a/models/silver/nft/sales/silver_nft__nftx_decoded_sales.sql +++ b/models/silver/nft/sales/silver_nft__nftx_decoded_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} /* this model includes : diff --git a/models/silver/nft/sales/silver_nft__nftx_vaults.sql b/models/silver/nft/sales/silver_nft__nftx_vaults.sql index 87234f54..3dbee579 100644 --- a/models/silver/nft/sales/silver_nft__nftx_vaults.sql +++ b/models/silver/nft/sales/silver_nft__nftx_vaults.sql @@ -1,7 +1,7 @@ {{ config( materialized = 'incremental', unique_key = "vault_id", - tags = ['curated'] + tags = ['silver','nft','curated'] ) }} WITH vaults AS ( diff --git a/models/silver/nft/sales/silver_nft__rarible_v2_sales.sql b/models/silver/nft/sales/silver_nft__rarible_v2_sales.sql index 1b94aeaf..b7f50401 100644 --- a/models/silver/nft/sales/silver_nft__rarible_v2_sales.sql +++ b/models/silver/nft/sales/silver_nft__rarible_v2_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw AS ( @@ -34,8 +34,7 @@ WITH raw AS ( gas_used, trace_succeeded, error_reason, - tx_succeeded, - fact_decoded_traces_id, + tx_succeeded, inserted_timestamp, modified_timestamp AS _inserted_timestamp FROM diff --git a/models/silver/nft/sales/silver_nft__seaport_1_1_sales.sql b/models/silver/nft/sales/silver_nft__seaport_1_1_sales.sql index c3aeb8e5..9619bfa3 100644 --- a/models/silver/nft/sales/silver_nft__seaport_1_1_sales.sql +++ b/models/silver/nft/sales/silver_nft__seaport_1_1_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH seaport_fees_wallet AS ( diff --git a/models/silver/nft/sales/silver_nft__seaport_1_4_sales.sql b/models/silver/nft/sales/silver_nft__seaport_1_4_sales.sql index 26591f3f..157838f0 100644 --- a/models/silver/nft/sales/silver_nft__seaport_1_4_sales.sql +++ b/models/silver/nft/sales/silver_nft__seaport_1_4_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH seaport_fees_wallet AS ( diff --git a/models/silver/nft/sales/silver_nft__seaport_1_5_sales.sql b/models/silver/nft/sales/silver_nft__seaport_1_5_sales.sql index 38f36acf..b93d3a9d 100644 --- a/models/silver/nft/sales/silver_nft__seaport_1_5_sales.sql +++ b/models/silver/nft/sales/silver_nft__seaport_1_5_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH seaport_fees_wallet AS ( diff --git a/models/silver/nft/sales/silver_nft__seaport_1_6_sales.sql b/models/silver/nft/sales/silver_nft__seaport_1_6_sales.sql index d30db14e..4486f49e 100644 --- a/models/silver/nft/sales/silver_nft__seaport_1_6_sales.sql +++ b/models/silver/nft/sales/silver_nft__seaport_1_6_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH seaport_fees_wallet AS ( diff --git a/models/silver/nft/sales/silver_nft__x2y2_decoded_sales.sql b/models/silver/nft/sales/silver_nft__x2y2_decoded_sales.sql index c5a7d1d2..a6e9a9e8 100644 --- a/models/silver/nft/sales/silver_nft__x2y2_decoded_sales.sql +++ b/models/silver/nft/sales/silver_nft__x2y2_decoded_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH x2y2_fee_address AS ( diff --git a/models/silver/nft/sales/sudoswap/silver_nft__sudoswap_v1_sales.sql b/models/silver/nft/sales/sudoswap/silver_nft__sudoswap_v1_sales.sql index 02445718..407e21eb 100644 --- a/models/silver/nft/sales/sudoswap/silver_nft__sudoswap_v1_sales.sql +++ b/models/silver/nft/sales/sudoswap/silver_nft__sudoswap_v1_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH pools AS ( diff --git a/models/silver/nft/sales/sudoswap/silver_nft__sudoswap_v2_pools.sql b/models/silver/nft/sales/sudoswap/silver_nft__sudoswap_v2_pools.sql index 3d69595f..34297805 100644 --- a/models/silver/nft/sales/sudoswap/silver_nft__sudoswap_v2_pools.sql +++ b/models/silver/nft/sales/sudoswap/silver_nft__sudoswap_v2_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','pools','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_traces AS ( @@ -34,8 +34,7 @@ WITH raw_traces AS ( gas_used, trace_succeeded, error_reason, - tx_succeeded, - fact_decoded_traces_id, + tx_succeeded, inserted_timestamp, modified_timestamp AS _inserted_timestamp FROM diff --git a/models/silver/nft/sales/sudoswap/silver_nft__sudoswap_v2_sales.sql b/models/silver/nft/sales/sudoswap/silver_nft__sudoswap_v2_sales.sql index 32b79b0b..b38bf769 100644 --- a/models/silver/nft/sales/sudoswap/silver_nft__sudoswap_v2_sales.sql +++ b/models/silver/nft/sales/sudoswap/silver_nft__sudoswap_v2_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH pools AS ( diff --git a/models/silver/nft/silver__nft_collection_metadata.sql b/models/silver/nft/silver__nft_collection_metadata.sql index 42899b52..a9d3c263 100644 --- a/models/silver/nft/silver__nft_collection_metadata.sql +++ b/models/silver/nft/silver__nft_collection_metadata.sql @@ -3,7 +3,7 @@ unique_key = 'nft_address_tokenid', merge_exclude_columns = ["inserted_timestamp"], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(nft_address, collection_page, collection_name, tokenid_description, tokenid_name),SUBSTRING(nft_address, collection_page, collection_name, tokenid_description, tokenid_name)", - tags = ['nft_reads'] + tags = ['silver','nft_reads'] ) }} WITH base AS ( diff --git a/models/silver/nft/silver__nft_mints.sql b/models/silver/nft/silver__nft_mints.sql index 85adcbd6..0a6446ab 100644 --- a/models/silver/nft/silver__nft_mints.sql +++ b/models/silver/nft/silver__nft_mints.sql @@ -4,7 +4,7 @@ unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, event_type, nft_address, project_name, nft_from_address, nft_to_address, mint_token_symbol, mint_token_address), SUBSTRING(event_type, nft_address, project_name, nft_from_address, nft_to_address, mint_token_symbol, mint_token_address)", - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH nft_mints AS ( @@ -75,7 +75,11 @@ tokens_per_tx AS ( tokens_moved AS ( SELECT tx_hash, - _log_id, + CONCAT( + tx_hash :: STRING, + '-', + event_index :: STRING + ) AS _log_id, from_address, to_address, contract_address, @@ -130,7 +134,7 @@ metadata AS ( NAME, decimals FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} WHERE decimals IS NOT NULL ), diff --git a/models/silver/nft/silver__nft_transfers.sql b/models/silver/nft/silver__nft_transfers.sql index c87d8e84..ba00e691 100644 --- a/models/silver/nft/silver__nft_transfers.sql +++ b/models/silver/nft/silver__nft_transfers.sql @@ -4,7 +4,7 @@ unique_key = "block_number", cluster_by = ['block_timestamp::DATE', '_inserted_timestamp::DATE', 'contract_address'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, contract_address, project_name, from_address, to_address, event_type, token_transfer_type), SUBSTRING(project_name, from_address, to_address, event_type, token_transfer_type)", - tags = ['curated','reorg', 'heal'] + tags = ['silver','nft','curated','heal'] ) }} WITH base AS ( @@ -519,7 +519,7 @@ transfer_base AS ( A._inserted_timestamp FROM all_transfers A - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON A.contract_address = C.address WHERE to_address IS NOT NULL @@ -548,7 +548,7 @@ heal_model AS ( FROM {{ this }} t - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON t.contract_address = C.address WHERE t.block_number IN ( @@ -571,7 +571,7 @@ heal_model AS ( SELECT 1 FROM - {{ ref('silver__contracts') }} C + {{ ref('core__dim_contracts') }} C WHERE C._inserted_timestamp > DATEADD('DAY', -14, SYSDATE()) AND C.name IS NOT NULL diff --git a/models/silver/prices/silver__complete_native_asset_metadata.sql b/models/silver/prices/silver__complete_native_asset_metadata.sql deleted file mode 100644 index a81b6a6e..00000000 --- a/models/silver/prices/silver__complete_native_asset_metadata.sql +++ /dev/null @@ -1,38 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'complete_native_asset_metadata_id', - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_id, symbol, name),SUBSTRING(asset_id, symbol, name)", - tags = ['non_realtime'] -) }} - -SELECT - asset_id, - symbol, - NAME, - decimals, - blockchain, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_native_asset_metadata_id, - _invocation_id -FROM - {{ ref( - 'bronze__complete_native_asset_metadata' - ) }} - -{% if is_incremental() %} -WHERE - modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} - ) -{% endif %} diff --git a/models/silver/prices/silver__complete_native_asset_metadata.yml b/models/silver/prices/silver__complete_native_asset_metadata.yml deleted file mode 100644 index 1c1fdf1c..00000000 --- a/models/silver/prices/silver__complete_native_asset_metadata.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: 2 -models: - - name: silver__complete_native_asset_metadata - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - SYMBOL - - columns: - - name: PROVIDER - tests: - - not_null - - name: SYMBOL - tests: - - not_null - - name: BLOCKCHAIN - tests: - - not_null - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - name: COMPLETE_NATIVE_ASSET_METADATA_ID - tests: - - unique \ No newline at end of file diff --git a/models/silver/prices/silver__complete_native_prices.sql b/models/silver/prices/silver__complete_native_prices.sql deleted file mode 100644 index ec99925c..00000000 --- a/models/silver/prices/silver__complete_native_prices.sql +++ /dev/null @@ -1,42 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'complete_native_prices_id', - cluster_by = ['hour::DATE'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_id, symbol, name),SUBSTRING(asset_id, symbol, name)", - tags = ['non_realtime'] -) }} - -SELECT - HOUR, - asset_id, - symbol, - NAME, - decimals, - price, - blockchain, - is_imputed, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_native_prices_id, - _invocation_id -FROM - {{ ref( - 'bronze__complete_native_prices' - ) }} - -{% if is_incremental() %} -WHERE - modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} - ) -{% endif %} diff --git a/models/silver/prices/silver__complete_native_prices.yml b/models/silver/prices/silver__complete_native_prices.yml deleted file mode 100644 index bb724335..00000000 --- a/models/silver/prices/silver__complete_native_prices.yml +++ /dev/null @@ -1,37 +0,0 @@ -version: 2 -models: - - name: silver__complete_native_prices - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - HOUR - - SYMBOL - - columns: - - name: HOUR - tests: - - not_null - - name: SYMBOL - tests: - - not_null - - name: BLOCKCHAIN - tests: - - not_null - - name: PROVIDER - tests: - - not_null - - name: PRICE - tests: - - not_null - - name: IS_IMPUTED - tests: - - not_null - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - name: COMPLETE_NATIVE_PRICES_ID - tests: - - unique \ No newline at end of file diff --git a/models/silver/prices/silver__complete_provider_asset_metadata.sql b/models/silver/prices/silver__complete_provider_asset_metadata.sql deleted file mode 100644 index b981c9ca..00000000 --- a/models/silver/prices/silver__complete_provider_asset_metadata.sql +++ /dev/null @@ -1,38 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'complete_provider_asset_metadata_id', - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_id, token_address, symbol, name),SUBSTRING(asset_id, token_address, symbol, name)", - tags = ['non_realtime'] -) }} - -SELECT - asset_id, - token_address, - NAME, - symbol, - platform, - platform_id, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_provider_asset_metadata_id, - _invocation_id -FROM - {{ ref( - 'bronze__complete_provider_asset_metadata' - ) }} - -{% if is_incremental() %} -WHERE - modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} - ) -{% endif %} \ No newline at end of file diff --git a/models/silver/prices/silver__complete_provider_asset_metadata.yml b/models/silver/prices/silver__complete_provider_asset_metadata.yml deleted file mode 100644 index 8fa56fd8..00000000 --- a/models/silver/prices/silver__complete_provider_asset_metadata.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: 2 -models: - - name: silver__complete_provider_asset_metadata - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - ASSET_ID - - TOKEN_ADDRESS - - NAME - - SYMBOL - - PLATFORM - - PLATFORM_ID - - PROVIDER - columns: - - name: PROVIDER - tests: - - not_null - - name: ASSET_ID - tests: - - not_null - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - name: COMPLETE_PROVIDER_ASSET_METADATA_ID - tests: - - unique \ No newline at end of file diff --git a/models/silver/prices/silver__complete_provider_prices.sql b/models/silver/prices/silver__complete_provider_prices.sql deleted file mode 100644 index a8be434f..00000000 --- a/models/silver/prices/silver__complete_provider_prices.sql +++ /dev/null @@ -1,47 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'complete_provider_prices_id', - cluster_by = ['recorded_hour::DATE','provider'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_id),SUBSTRING(asset_id)", - tags = ['non_realtime'] -) }} - -SELECT - p.asset_id, - recorded_hour, - OPEN, - high, - low, - CLOSE, - p.provider, - p.source, - p._inserted_timestamp, - p.inserted_timestamp, - p.modified_timestamp, - p.complete_provider_prices_id, - p._invocation_id -FROM - {{ ref( - 'bronze__complete_provider_prices' - ) }} - p - INNER JOIN {{ ref('bronze__complete_provider_asset_metadata') }} - m - ON p.asset_id = m.asset_id - -{% if is_incremental() %} -WHERE - p.modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} - ) -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY p.asset_id, recorded_hour, p.provider -ORDER BY - p.modified_timestamp DESC)) = 1 diff --git a/models/silver/prices/silver__complete_provider_prices.yml b/models/silver/prices/silver__complete_provider_prices.yml deleted file mode 100644 index 8db23c7e..00000000 --- a/models/silver/prices/silver__complete_provider_prices.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 2 -models: - - name: silver__complete_provider_prices - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - ASSET_ID - - RECORDED_HOUR - - PROVIDER - columns: - - name: PROVIDER - tests: - - not_null - - name: ASSET_ID - tests: - - not_null - - name: RECORDED_HOUR - tests: - - not_null - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - name: COMPLETE_PROVIDER_PRICES_ID - tests: - - unique \ No newline at end of file diff --git a/models/silver/prices/silver__complete_token_asset_metadata.sql b/models/silver/prices/silver__complete_token_asset_metadata.sql deleted file mode 100644 index f5339b80..00000000 --- a/models/silver/prices/silver__complete_token_asset_metadata.sql +++ /dev/null @@ -1,43 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'complete_token_asset_metadata_id', - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_id, token_address, symbol, name),SUBSTRING(asset_id, token_address, symbol, name)", - tags = ['non_realtime'] -) }} - -SELECT - LOWER( - A.token_address - ) AS token_address, - asset_id, - symbol, - NAME, - decimals, - blockchain, - blockchain_name, - blockchain_id, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_token_asset_metadata_id, - _invocation_id -FROM - {{ ref( - 'bronze__complete_token_asset_metadata' - ) }} A - -{% if is_incremental() %} -WHERE - modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} - ) -{% endif %} diff --git a/models/silver/prices/silver__complete_token_asset_metadata.yml b/models/silver/prices/silver__complete_token_asset_metadata.yml deleted file mode 100644 index 3eea590e..00000000 --- a/models/silver/prices/silver__complete_token_asset_metadata.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 2 -models: - - name: silver__complete_token_asset_metadata - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TOKEN_ADDRESS - - BLOCKCHAIN - - columns: - - name: PROVIDER - tests: - - not_null - - name: TOKEN_ADDRESS - tests: - - not_null - - name: BLOCKCHAIN - tests: - - not_null - - name: BLOCKCHAIN_ID - tests: - - not_null - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - name: COMPLETE_TOKEN_ASSET_METADATA_ID - tests: - - unique \ No newline at end of file diff --git a/models/silver/prices/silver__complete_token_prices.sql b/models/silver/prices/silver__complete_token_prices.sql deleted file mode 100644 index f8e64424..00000000 --- a/models/silver/prices/silver__complete_token_prices.sql +++ /dev/null @@ -1,48 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'complete_token_prices_id', - cluster_by = ['hour::DATE'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_id, token_address, symbol, name),SUBSTRING(asset_id, token_address, symbol, name)", - tags = ['non_realtime'] -) }} - -SELECT - HOUR, - LOWER( - p.token_address - ) AS token_address, - asset_id, - symbol, - NAME, - decimals, - price, - blockchain, - blockchain_name, - blockchain_id, - is_imputed, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_token_prices_id, - _invocation_id -FROM - {{ ref( - 'bronze__complete_token_prices' - ) }} - p - -{% if is_incremental() %} -WHERE - modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} - ) -{% endif %} diff --git a/models/silver/prices/silver__complete_token_prices.yml b/models/silver/prices/silver__complete_token_prices.yml deleted file mode 100644 index d2ac57f5..00000000 --- a/models/silver/prices/silver__complete_token_prices.yml +++ /dev/null @@ -1,41 +0,0 @@ -version: 2 -models: - - name: silver__complete_token_prices - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - HOUR - - TOKEN_ADDRESS - - BLOCKCHAIN - - columns: - - name: HOUR - tests: - - not_null - - name: TOKEN_ADDRESS - tests: - - not_null - - name: BLOCKCHAIN - tests: - - not_null - - name: BLOCKCHAIN_ID - tests: - - not_null - - name: PROVIDER - tests: - - not_null - - name: PRICE - tests: - - not_null - - name: IS_IMPUTED - tests: - - not_null - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - name: COMPLETE_TOKEN_PRICES_ID - tests: - - unique \ No newline at end of file diff --git a/models/silver/protocols/chainlink/silver__chainlink_feed_details.sql b/models/silver/protocols/chainlink/silver__chainlink_feed_details.sql deleted file mode 100644 index 40003473..00000000 --- a/models/silver/protocols/chainlink/silver__chainlink_feed_details.sql +++ /dev/null @@ -1,18 +0,0 @@ -{{ config( - materialized = 'table' -) }} - -SELECT - feed_address, - feed_name, - feed_category, - feed_added AS feed_added_date, - created_block_number, - {{ dbt_utils.generate_surrogate_key( - ['feed_address'] - ) }} AS chainlink_feed_details_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {{ ref('silver__chainlink_feeds_seed') }} diff --git a/models/silver/protocols/chainlink/silver__chainlink_feeds.sql b/models/silver/protocols/chainlink/silver__chainlink_feeds.sql deleted file mode 100644 index 6b51856c..00000000 --- a/models/silver/protocols/chainlink/silver__chainlink_feeds.sql +++ /dev/null @@ -1,51 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'id', - merge_exclude_columns = ["inserted_timestamp"], - tags = ['stale'] -) }} - -WITH base AS ( - - SELECT - contract_address, - block_number, - TRY_TO_NUMBER( - utils.udf_hex_to_int( - read_output :: STRING - ) - ) AS read_result, - _inserted_timestamp - FROM - {{ ref('silver__reads') }} - WHERE - function_signature = '0x50d25bcd' - AND call_name = 'chainlink_price_feed' - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - FROM - {{ this }} -) -{% endif %} -) -SELECT - contract_address, - block_number, - read_result, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['block_number', 'contract_address'] - ) }} AS id, - id AS chainlink_feeds_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - base qualify(ROW_NUMBER() over(PARTITION BY contract_address, block_number -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/protocols/ens/silver_ens__ens_dao_votes.sql b/models/silver/protocols/ens/silver_ens__ens_dao_votes.sql index 0270262b..8b3f131a 100644 --- a/models/silver/protocols/ens/silver_ens__ens_dao_votes.sql +++ b/models/silver/protocols/ens/silver_ens__ens_dao_votes.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','ens'] ) }} WITH base_events AS ( diff --git a/models/silver/protocols/ens/silver_ens__ens_domain_current_records.sql b/models/silver/protocols/ens/silver_ens__ens_domain_current_records.sql index e37b012f..db74c7bf 100644 --- a/models/silver/protocols/ens/silver_ens__ens_domain_current_records.sql +++ b/models/silver/protocols/ens/silver_ens__ens_domain_current_records.sql @@ -2,7 +2,7 @@ materialized = 'incremental', unique_key = '_id', incremental_strategy = 'delete+insert', - tags = ['curated'] + tags = ['silver','curated','ens'] ) }} WITH name_registered AS ( diff --git a/models/silver/protocols/ens/silver_ens__ens_domain_owners.sql b/models/silver/protocols/ens/silver_ens__ens_domain_owners.sql index 64b5c6bb..ca5a20b3 100644 --- a/models/silver/protocols/ens/silver_ens__ens_domain_owners.sql +++ b/models/silver/protocols/ens/silver_ens__ens_domain_owners.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','ens'] ) }} WITH base_events AS ( diff --git a/models/silver/protocols/ens/silver_ens__ens_domain_registrations.sql b/models/silver/protocols/ens/silver_ens__ens_domain_registrations.sql index 91069636..065b1430 100644 --- a/models/silver/protocols/ens/silver_ens__ens_domain_registrations.sql +++ b/models/silver/protocols/ens/silver_ens__ens_domain_registrations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','ens'] ) }} WITH base_events AS ( diff --git a/models/silver/protocols/ens/silver_ens__ens_domain_renewals.sql b/models/silver/protocols/ens/silver_ens__ens_domain_renewals.sql index 7682898f..d7cc6a1b 100644 --- a/models/silver/protocols/ens/silver_ens__ens_domain_renewals.sql +++ b/models/silver/protocols/ens/silver_ens__ens_domain_renewals.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','ens'] ) }} WITH base_events AS ( diff --git a/models/silver/protocols/ens/silver_ens__ens_domain_resolvers.sql b/models/silver/protocols/ens/silver_ens__ens_domain_resolvers.sql index 9541aa21..dafa9805 100644 --- a/models/silver/protocols/ens/silver_ens__ens_domain_resolvers.sql +++ b/models/silver/protocols/ens/silver_ens__ens_domain_resolvers.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','ens'] ) }} WITH base_events AS ( diff --git a/models/silver/protocols/ens/silver_ens__ens_domain_set.sql b/models/silver/protocols/ens/silver_ens__ens_domain_set.sql index cf358e67..9fb404b7 100644 --- a/models/silver/protocols/ens/silver_ens__ens_domain_set.sql +++ b/models/silver/protocols/ens/silver_ens__ens_domain_set.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','ens'] ) }} WITH base AS ( diff --git a/models/silver/protocols/ens/silver_ens__ens_domain_textchanged.sql b/models/silver/protocols/ens/silver_ens__ens_domain_textchanged.sql index 40f8e6e8..ce013227 100644 --- a/models/silver/protocols/ens/silver_ens__ens_domain_textchanged.sql +++ b/models/silver/protocols/ens/silver_ens__ens_domain_textchanged.sql @@ -2,7 +2,7 @@ materialized = 'incremental', unique_key = 'node', merge_exclude_columns = ["inserted_timestamp"], - tags = ['curated'] + tags = ['silver','curated','ens'] ) }} WITH base_events AS ( diff --git a/models/silver/protocols/ens/silver_ens__ens_domain_transfers.sql b/models/silver/protocols/ens/silver_ens__ens_domain_transfers.sql index 036c4ea1..a8274103 100644 --- a/models/silver/protocols/ens/silver_ens__ens_domain_transfers.sql +++ b/models/silver/protocols/ens/silver_ens__ens_domain_transfers.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','ens'] ) }} WITH base_events AS ( diff --git a/models/silver/protocols/ens/silver_ens__ens_domain_wrapped.sql b/models/silver/protocols/ens/silver_ens__ens_domain_wrapped.sql index 1d642304..ae160be7 100644 --- a/models/silver/protocols/ens/silver_ens__ens_domain_wrapped.sql +++ b/models/silver/protocols/ens/silver_ens__ens_domain_wrapped.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','ens'] ) }} WITH base_events AS ( diff --git a/models/silver/protocols/maker/base/cat/silver_maker__cat_bite.sql b/models/silver/protocols/maker/base/cat/silver_maker__cat_bite.sql index 0efc6aa2..3220893c 100644 --- a/models/silver/protocols/maker/base/cat/silver_maker__cat_bite.sql +++ b/models/silver/protocols/maker/base/cat/silver_maker__cat_bite.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/cdp/silver_maker__cdp_flux.sql b/models/silver/protocols/maker/base/cdp/silver_maker__cdp_flux.sql index d7130631..c28d23f3 100644 --- a/models/silver/protocols/maker/base/cdp/silver_maker__cdp_flux.sql +++ b/models/silver/protocols/maker/base/cdp/silver_maker__cdp_flux.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/cdp/silver_maker__cdp_frob.sql b/models/silver/protocols/maker/base/cdp/silver_maker__cdp_frob.sql index 49dd5d5a..a85ae4f0 100644 --- a/models/silver/protocols/maker/base/cdp/silver_maker__cdp_frob.sql +++ b/models/silver/protocols/maker/base/cdp/silver_maker__cdp_frob.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/cdp/silver_maker__cdp_move.sql b/models/silver/protocols/maker/base/cdp/silver_maker__cdp_move.sql index 06d9ae16..ad1a66a1 100644 --- a/models/silver/protocols/maker/base/cdp/silver_maker__cdp_move.sql +++ b/models/silver/protocols/maker/base/cdp/silver_maker__cdp_move.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/cdp/silver_maker__cdp_newcdp.sql b/models/silver/protocols/maker/base/cdp/silver_maker__cdp_newcdp.sql index 55aa8d5f..cab36e1a 100644 --- a/models/silver/protocols/maker/base/cdp/silver_maker__cdp_newcdp.sql +++ b/models/silver/protocols/maker/base/cdp/silver_maker__cdp_newcdp.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/dai_join/silver_maker__dai_join_exit.sql b/models/silver/protocols/maker/base/dai_join/silver_maker__dai_join_exit.sql index e53ecac0..c40da116 100644 --- a/models/silver/protocols/maker/base/dai_join/silver_maker__dai_join_exit.sql +++ b/models/silver/protocols/maker/base/dai_join/silver_maker__dai_join_exit.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/dai_join/silver_maker__dai_join_join.sql b/models/silver/protocols/maker/base/dai_join/silver_maker__dai_join_join.sql index 4ce409d3..202a3cd0 100644 --- a/models/silver/protocols/maker/base/dai_join/silver_maker__dai_join_join.sql +++ b/models/silver/protocols/maker/base/dai_join/silver_maker__dai_join_join.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/decimals/silver_maker__decimals.sql b/models/silver/protocols/maker/base/decimals/silver_maker__decimals.sql index d9a78136..15978494 100644 --- a/models/silver/protocols/maker/base/decimals/silver_maker__decimals.sql +++ b/models/silver/protocols/maker/base/decimals/silver_maker__decimals.sql @@ -1,6 +1,6 @@ {{ config( materialized = 'view', - tags = ['curated'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/dog/silver_maker__dog_bark.sql b/models/silver/protocols/maker/base/dog/silver_maker__dog_bark.sql index ecf3e18e..ee4f1ca9 100644 --- a/models/silver/protocols/maker/base/dog/silver_maker__dog_bark.sql +++ b/models/silver/protocols/maker/base/dog/silver_maker__dog_bark.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/dss_flash/silver_maker__dss_flashloan.sql b/models/silver/protocols/maker/base/dss_flash/silver_maker__dss_flashloan.sql index e342a65d..6f75aa49 100644 --- a/models/silver/protocols/maker/base/dss_flash/silver_maker__dss_flashloan.sql +++ b/models/silver/protocols/maker/base/dss_flash/silver_maker__dss_flashloan.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/mcd_pot/silver_maker__pot_exit.sql b/models/silver/protocols/maker/base/mcd_pot/silver_maker__pot_exit.sql index 700f7060..d5bf3c2c 100644 --- a/models/silver/protocols/maker/base/mcd_pot/silver_maker__pot_exit.sql +++ b/models/silver/protocols/maker/base/mcd_pot/silver_maker__pot_exit.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/mcd_pot/silver_maker__pot_join.sql b/models/silver/protocols/maker/base/mcd_pot/silver_maker__pot_join.sql index 237cdc3b..2c2c1e3d 100644 --- a/models/silver/protocols/maker/base/mcd_pot/silver_maker__pot_join.sql +++ b/models/silver/protocols/maker/base/mcd_pot/silver_maker__pot_join.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/vat/silver_maker__vat_file.sql b/models/silver/protocols/maker/base/vat/silver_maker__vat_file.sql index e08c9f34..132a0152 100644 --- a/models/silver/protocols/maker/base/vat/silver_maker__vat_file.sql +++ b/models/silver/protocols/maker/base/vat/silver_maker__vat_file.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/vat/silver_maker__vat_flux.sql b/models/silver/protocols/maker/base/vat/silver_maker__vat_flux.sql index d91cf4c2..35251315 100644 --- a/models/silver/protocols/maker/base/vat/silver_maker__vat_flux.sql +++ b/models/silver/protocols/maker/base/vat/silver_maker__vat_flux.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/vat/silver_maker__vat_fold.sql b/models/silver/protocols/maker/base/vat/silver_maker__vat_fold.sql index 516e824d..3ca2030b 100644 --- a/models/silver/protocols/maker/base/vat/silver_maker__vat_fold.sql +++ b/models/silver/protocols/maker/base/vat/silver_maker__vat_fold.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/vat/silver_maker__vat_fork.sql b/models/silver/protocols/maker/base/vat/silver_maker__vat_fork.sql index 11ba5498..024489fd 100644 --- a/models/silver/protocols/maker/base/vat/silver_maker__vat_fork.sql +++ b/models/silver/protocols/maker/base/vat/silver_maker__vat_fork.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/vat/silver_maker__vat_frob.sql b/models/silver/protocols/maker/base/vat/silver_maker__vat_frob.sql index 7699afc5..62d7d520 100644 --- a/models/silver/protocols/maker/base/vat/silver_maker__vat_frob.sql +++ b/models/silver/protocols/maker/base/vat/silver_maker__vat_frob.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/vat/silver_maker__vat_move.sql b/models/silver/protocols/maker/base/vat/silver_maker__vat_move.sql index 55880e2c..6c5dd191 100644 --- a/models/silver/protocols/maker/base/vat/silver_maker__vat_move.sql +++ b/models/silver/protocols/maker/base/vat/silver_maker__vat_move.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/vat/silver_maker__vat_slip.sql b/models/silver/protocols/maker/base/vat/silver_maker__vat_slip.sql index 9b4eb334..c0efce76 100644 --- a/models/silver/protocols/maker/base/vat/silver_maker__vat_slip.sql +++ b/models/silver/protocols/maker/base/vat/silver_maker__vat_slip.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/base/vat/silver_maker__vat_suck.sql b/models/silver/protocols/maker/base/vat/silver_maker__vat_suck.sql index 21511595..75c20826 100644 --- a/models/silver/protocols/maker/base/vat/silver_maker__vat_suck.sql +++ b/models/silver/protocols/maker/base/vat/silver_maker__vat_suck.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/ez_models/silver_maker__delegations.sql b/models/silver/protocols/maker/ez_models/silver_maker__delegations.sql index 4edfc678..b5b42b39 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__delegations.sql +++ b/models/silver/protocols/maker/ez_models/silver_maker__delegations.sql @@ -4,7 +4,7 @@ enabled = false, unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH txs_base AS ( diff --git a/models/silver/protocols/maker/ez_models/silver_maker__delegations.yml b/models/silver/protocols/maker/ez_models/silver_maker__delegations.yml index 048ac6bf..1154675d 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__delegations.yml +++ b/models/silver/protocols/maker/ez_models/silver_maker__delegations.yml @@ -8,7 +8,7 @@ models: - _LOG_ID columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -16,7 +16,7 @@ models: - NUMBER - FLOAT - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' tests: - not_null - dbt_expectations.expect_row_values_to_have_recent_data: @@ -27,13 +27,13 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: TX_HASH - description: '{{ doc("eth_tx_hash") }}' + description: '{{ doc("evm_tx_hash") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: regex: 0[xX][0-9a-fA-F]+ - name: TX_STATUS - description: '{{ doc("eth_tx_status") }}' + description: '{{ doc("evm_tx_status") }}' tests: - not_null - name: ORIGIN_FROM_ADDRESS @@ -47,7 +47,7 @@ models: - dbt_expectations.expect_column_values_to_match_regex: regex: 0[xX][0-9a-fA-F]+ - name: CONTRACT_ADDRESS - description: '{{ doc("eth_contracts_name") }}' + description: '{{ doc("evm_contracts_name") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: @@ -85,4 +85,4 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: _LOG_ID - description: '{{ doc("eth_log_id_events") }}' \ No newline at end of file + description: '{{ doc("evm_log_id_events") }}' \ No newline at end of file diff --git a/models/silver/protocols/maker/ez_models/silver_maker__deposits.sql b/models/silver/protocols/maker/ez_models/silver_maker__deposits.sql index 5a855e2c..e15562ba 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__deposits.sql +++ b/models/silver/protocols/maker/ez_models/silver_maker__deposits.sql @@ -4,7 +4,7 @@ enabled = false, unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/ez_models/silver_maker__deposits.yml b/models/silver/protocols/maker/ez_models/silver_maker__deposits.yml index 5ff61399..eeac5fb3 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__deposits.yml +++ b/models/silver/protocols/maker/ez_models/silver_maker__deposits.yml @@ -8,7 +8,7 @@ models: - _LOG_ID columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -16,7 +16,7 @@ models: - NUMBER - FLOAT - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' tests: - not_null - dbt_expectations.expect_row_values_to_have_recent_data: @@ -27,13 +27,13 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: TX_HASH - description: '{{ doc("eth_tx_hash") }}' + description: '{{ doc("evm_tx_hash") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: regex: 0[xX][0-9a-fA-F]+ - name: TX_STATUS - description: '{{ doc("eth_tx_status") }}' + description: '{{ doc("evm_tx_status") }}' tests: - not_null - name: EVENT_INDEX @@ -87,4 +87,4 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: _LOG_ID - description: '{{ doc("eth_log_id_events") }}' \ No newline at end of file + description: '{{ doc("evm_log_id_events") }}' \ No newline at end of file diff --git a/models/silver/protocols/maker/ez_models/silver_maker__flash_loans.sql b/models/silver/protocols/maker/ez_models/silver_maker__flash_loans.sql index 23b9e4b2..1e234907 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__flash_loans.sql +++ b/models/silver/protocols/maker/ez_models/silver_maker__flash_loans.sql @@ -4,7 +4,7 @@ enabled = false, unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( @@ -65,5 +65,5 @@ SELECT '{{ invocation_id }}' AS _invocation_id FROM base b - LEFT JOIN {{ ref('silver__contracts') }} C + LEFT JOIN {{ ref('core__dim_contracts') }} C ON C.address = token_loaned diff --git a/models/silver/protocols/maker/ez_models/silver_maker__flash_loans.yml b/models/silver/protocols/maker/ez_models/silver_maker__flash_loans.yml index 1f3055e3..94497f80 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__flash_loans.yml +++ b/models/silver/protocols/maker/ez_models/silver_maker__flash_loans.yml @@ -8,7 +8,7 @@ models: - _LOG_ID columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -16,7 +16,7 @@ models: - NUMBER - FLOAT - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -24,13 +24,13 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: TX_HASH - description: '{{ doc("eth_tx_hash") }}' + description: '{{ doc("evm_tx_hash") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: regex: 0[xX][0-9a-fA-F]+ - name: TX_STATUS - description: '{{ doc("eth_tx_status") }}' + description: '{{ doc("evm_tx_status") }}' tests: - not_null - name: BORROWER @@ -77,4 +77,4 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: _LOG_ID - description: '{{ doc("eth_log_id_events") }}' \ No newline at end of file + description: '{{ doc("evm_log_id_events") }}' \ No newline at end of file diff --git a/models/silver/protocols/maker/ez_models/silver_maker__governance_votes.sql b/models/silver/protocols/maker/ez_models/silver_maker__governance_votes.sql index aba84512..5c14a91b 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__governance_votes.sql +++ b/models/silver/protocols/maker/ez_models/silver_maker__governance_votes.sql @@ -4,7 +4,7 @@ enabled = false, unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} SELECT diff --git a/models/silver/protocols/maker/ez_models/silver_maker__governance_votes.yml b/models/silver/protocols/maker/ez_models/silver_maker__governance_votes.yml index 16e4ab44..f74e9c45 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__governance_votes.yml +++ b/models/silver/protocols/maker/ez_models/silver_maker__governance_votes.yml @@ -8,7 +8,7 @@ models: - _LOG_ID columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -16,7 +16,7 @@ models: - NUMBER - FLOAT - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -24,13 +24,13 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: TX_HASH - description: '{{ doc("eth_tx_hash") }}' + description: '{{ doc("evm_tx_hash") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: regex: 0[xX][0-9a-fA-F]+ - name: TX_STATUS - description: '{{ doc("eth_tx_status") }}' + description: '{{ doc("evm_tx_status") }}' tests: - not_null - name: EVENT_INDEX @@ -66,4 +66,4 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: _LOG_ID - description: '{{ doc("eth_log_id_events") }}' \ No newline at end of file + description: '{{ doc("evm_log_id_events") }}' \ No newline at end of file diff --git a/models/silver/protocols/maker/ez_models/silver_maker__liquidations.sql b/models/silver/protocols/maker/ez_models/silver_maker__liquidations.sql index eec479e9..8e12c96c 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__liquidations.sql +++ b/models/silver/protocols/maker/ez_models/silver_maker__liquidations.sql @@ -4,7 +4,7 @@ enabled = false, unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH cat_bite AS ( diff --git a/models/silver/protocols/maker/ez_models/silver_maker__liquidations.yml b/models/silver/protocols/maker/ez_models/silver_maker__liquidations.yml index 628d59d4..b42b616b 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__liquidations.yml +++ b/models/silver/protocols/maker/ez_models/silver_maker__liquidations.yml @@ -8,7 +8,7 @@ models: - _LOG_ID columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -16,7 +16,7 @@ models: - NUMBER - FLOAT - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -24,13 +24,13 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: TX_HASH - description: '{{ doc("eth_tx_hash") }}' + description: '{{ doc("evm_tx_hash") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: regex: 0[xX][0-9a-fA-F]+ - name: TX_STATUS - description: '{{ doc("eth_tx_status") }}' + description: '{{ doc("evm_tx_status") }}' tests: - not_null - name: COLLATERAL @@ -91,4 +91,4 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: _LOG_ID - description: '{{ doc("eth_log_id_events") }}' \ No newline at end of file + description: '{{ doc("evm_log_id_events") }}' \ No newline at end of file diff --git a/models/silver/protocols/maker/ez_models/silver_maker__repayments.sql b/models/silver/protocols/maker/ez_models/silver_maker__repayments.sql index b81c811a..3542b2fc 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__repayments.sql +++ b/models/silver/protocols/maker/ez_models/silver_maker__repayments.sql @@ -4,7 +4,7 @@ enabled = false, unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH repayment_txs AS ( diff --git a/models/silver/protocols/maker/ez_models/silver_maker__repayments.yml b/models/silver/protocols/maker/ez_models/silver_maker__repayments.yml index cb92b2d4..74e8dd96 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__repayments.yml +++ b/models/silver/protocols/maker/ez_models/silver_maker__repayments.yml @@ -8,7 +8,7 @@ models: - _LOG_ID columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -16,7 +16,7 @@ models: - NUMBER - FLOAT - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' tests: - not_null - dbt_expectations.expect_row_values_to_have_recent_data: @@ -27,13 +27,13 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: TX_HASH - description: '{{ doc("eth_tx_hash") }}' + description: '{{ doc("evm_tx_hash") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: regex: 0[xX][0-9a-fA-F]+ - name: TX_STATUS - description: '{{ doc("eth_tx_status") }}' + description: '{{ doc("evm_tx_status") }}' tests: - not_null - name: EVENT_INDEX @@ -84,4 +84,4 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: _LOG_ID - description: '{{ doc("eth_log_id_events") }}' \ No newline at end of file + description: '{{ doc("evm_log_id_events") }}' \ No newline at end of file diff --git a/models/silver/protocols/maker/ez_models/silver_maker__urns.sql b/models/silver/protocols/maker/ez_models/silver_maker__urns.sql index 6eb5faca..fd0eb31d 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__urns.sql +++ b/models/silver/protocols/maker/ez_models/silver_maker__urns.sql @@ -3,7 +3,7 @@ unique_key = 'vault_no', full_refresh = false, merge_exclude_columns = ["inserted_timestamp"], - tags = ['curated'] + tags = ['silver','curated','maker'] ) }} WITH vaults AS ( diff --git a/models/silver/protocols/maker/ez_models/silver_maker__vault_creation.sql b/models/silver/protocols/maker/ez_models/silver_maker__vault_creation.sql index 5cedd494..45e69d26 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__vault_creation.sql +++ b/models/silver/protocols/maker/ez_models/silver_maker__vault_creation.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH logs_base AS ( diff --git a/models/silver/protocols/maker/ez_models/silver_maker__withdrawals.sql b/models/silver/protocols/maker/ez_models/silver_maker__withdrawals.sql index cf87d74e..fb742d49 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__withdrawals.sql +++ b/models/silver/protocols/maker/ez_models/silver_maker__withdrawals.sql @@ -4,7 +4,7 @@ enabled = false, unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','maker'] ) }} WITH base AS ( diff --git a/models/silver/protocols/maker/ez_models/silver_maker__withdrawals.yml b/models/silver/protocols/maker/ez_models/silver_maker__withdrawals.yml index a7ab39d4..f45db4af 100644 --- a/models/silver/protocols/maker/ez_models/silver_maker__withdrawals.yml +++ b/models/silver/protocols/maker/ez_models/silver_maker__withdrawals.yml @@ -8,7 +8,7 @@ models: - _LOG_ID columns: - name: BLOCK_NUMBER - description: '{{ doc("eth_block_number") }}' + description: '{{ doc("evm_block_number") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -16,7 +16,7 @@ models: - NUMBER - FLOAT - name: BLOCK_TIMESTAMP - description: '{{ doc("eth_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' tests: - not_null - dbt_expectations.expect_row_values_to_have_recent_data: @@ -27,13 +27,13 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: TX_HASH - description: '{{ doc("eth_tx_hash") }}' + description: '{{ doc("evm_tx_hash") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: regex: 0[xX][0-9a-fA-F]+ - name: TX_STATUS - description: '{{ doc("eth_tx_status") }}' + description: '{{ doc("evm_tx_status") }}' tests: - not_null - name: EVENT_INDEX @@ -87,4 +87,4 @@ models: - TIMESTAMP_LTZ - TIMESTAMP_NTZ - name: _LOG_ID - description: '{{ doc("eth_log_id_events") }}' \ No newline at end of file + description: '{{ doc("evm_log_id_events") }}' \ No newline at end of file diff --git a/models/silver/protocols/olas/metadata/silver_olas__getservice_reads.sql b/models/silver/protocols/olas/metadata/silver_olas__getservice_reads.sql index 092443df..d3852747 100644 --- a/models/silver/protocols/olas/metadata/silver_olas__getservice_reads.sql +++ b/models/silver/protocols/olas/metadata/silver_olas__getservice_reads.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'getservice_reads_id', full_refresh = false, - tags = ['curated'] + tags = ['silver_olas','curated','olas'] ) }} WITH service_contracts AS ( diff --git a/models/silver/protocols/olas/metadata/silver_olas__getsubcomponents_reads.sql b/models/silver/protocols/olas/metadata/silver_olas__getsubcomponents_reads.sql index 8001d34c..dde397c5 100644 --- a/models/silver/protocols/olas/metadata/silver_olas__getsubcomponents_reads.sql +++ b/models/silver/protocols/olas/metadata/silver_olas__getsubcomponents_reads.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'getsubcomponents_reads_id', full_refresh = false, - tags = ['curated'] + tags = ['silver_olas','curated','olas'] ) }} WITH unit_contracts AS ( diff --git a/models/silver/protocols/olas/metadata/silver_olas__registry_metadata.sql b/models/silver/protocols/olas/metadata/silver_olas__registry_metadata.sql index 843fce62..29219d39 100644 --- a/models/silver/protocols/olas/metadata/silver_olas__registry_metadata.sql +++ b/models/silver/protocols/olas/metadata/silver_olas__registry_metadata.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'registry_metadata_id', full_refresh = false, - tags = ['curated'] + tags = ['silver_olas','curated','olas'] ) }} WITH new_records AS ( diff --git a/models/silver/protocols/olas/metadata/silver_olas__registry_metadata_complete.sql b/models/silver/protocols/olas/metadata/silver_olas__registry_metadata_complete.sql index a8495dbc..ca184216 100644 --- a/models/silver/protocols/olas/metadata/silver_olas__registry_metadata_complete.sql +++ b/models/silver/protocols/olas/metadata/silver_olas__registry_metadata_complete.sql @@ -1,5 +1,6 @@ {{ config( - materialized = 'view' + materialized = 'view', + tags = ['silver_olas','curated','olas'] ) }} SELECT diff --git a/models/silver/protocols/olas/metadata/silver_olas__registry_reads.sql b/models/silver/protocols/olas/metadata/silver_olas__registry_reads.sql index 18a60a8d..a2c185a5 100644 --- a/models/silver/protocols/olas/metadata/silver_olas__registry_reads.sql +++ b/models/silver/protocols/olas/metadata/silver_olas__registry_reads.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'registry_reads_id', full_refresh = false, - tags = ['curated'] + tags = ['silver_olas','curated','olas'] ) }} WITH unit_contracts AS ( diff --git a/models/silver/protocols/olas/silver_olas__create_bond.sql b/models/silver/protocols/olas/silver_olas__create_bond.sql index 7579036a..5d4209ad 100644 --- a/models/silver/protocols/olas/silver_olas__create_bond.sql +++ b/models/silver/protocols/olas/silver_olas__create_bond.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_olas','curated','olas'] ) }} WITH base_evt AS ( diff --git a/models/silver/protocols/olas/silver_olas__create_service_multisigs.sql b/models/silver/protocols/olas/silver_olas__create_service_multisigs.sql index 70faa8c9..836cd198 100644 --- a/models/silver/protocols/olas/silver_olas__create_service_multisigs.sql +++ b/models/silver/protocols/olas/silver_olas__create_service_multisigs.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_olas','curated','olas'] ) }} SELECT diff --git a/models/silver/protocols/olas/silver_olas__olas_locking.sql b/models/silver/protocols/olas/silver_olas__olas_locking.sql index 5b1c5bd8..9f4af490 100644 --- a/models/silver/protocols/olas/silver_olas__olas_locking.sql +++ b/models/silver/protocols/olas/silver_olas__olas_locking.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_olas','curated','olas'] ) }} WITH event_logs AS ( diff --git a/models/silver/protocols/olas/silver_olas__pol_transfers.sql b/models/silver/protocols/olas/silver_olas__pol_transfers.sql index 20ed173f..51a6a2aa 100644 --- a/models/silver/protocols/olas/silver_olas__pol_transfers.sql +++ b/models/silver/protocols/olas/silver_olas__pol_transfers.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_olas','curated','olas'] ) }} SELECT diff --git a/models/silver/protocols/olas/silver_olas__redeem_bond.sql b/models/silver/protocols/olas/silver_olas__redeem_bond.sql index 35904eb2..403686ee 100644 --- a/models/silver/protocols/olas/silver_olas__redeem_bond.sql +++ b/models/silver/protocols/olas/silver_olas__redeem_bond.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_olas','curated','olas'] ) }} WITH redeem AS ( diff --git a/models/silver/protocols/olas/silver_olas__service_donations.sql b/models/silver/protocols/olas/silver_olas__service_donations.sql index 3fa8155e..746955c9 100644 --- a/models/silver/protocols/olas/silver_olas__service_donations.sql +++ b/models/silver/protocols/olas/silver_olas__service_donations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_olas','curated','olas'] ) }} WITH base_evt AS ( diff --git a/models/silver/protocols/olas/silver_olas__service_event_logs.sql b/models/silver/protocols/olas/silver_olas__service_event_logs.sql index 19954200..9a3b65a5 100644 --- a/models/silver/protocols/olas/silver_olas__service_event_logs.sql +++ b/models/silver/protocols/olas/silver_olas__service_event_logs.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_olas','curated','olas'] ) }} WITH service_multisigs AS ( diff --git a/models/silver/protocols/olas/silver_olas__service_registrations.sql b/models/silver/protocols/olas/silver_olas__service_registrations.sql index 216add82..d8936da1 100644 --- a/models/silver/protocols/olas/silver_olas__service_registrations.sql +++ b/models/silver/protocols/olas/silver_olas__service_registrations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg','heal'] + tags = ['silver_olas','curated','olas','heal'] ) }} WITH registry_evt AS ( diff --git a/models/silver/protocols/olas/silver_olas__unit_registrations.sql b/models/silver/protocols/olas/silver_olas__unit_registrations.sql index d24af002..b0b59eb7 100644 --- a/models/silver/protocols/olas/silver_olas__unit_registrations.sql +++ b/models/silver/protocols/olas/silver_olas__unit_registrations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_olas','curated','olas'] ) }} WITH registry_evt AS ( diff --git a/models/silver/protocols/uniswapv3/silver__univ3_lp_actions.sql b/models/silver/protocols/uniswapv3/silver__univ3_lp_actions.sql index e2e14529..8072a5b1 100644 --- a/models/silver/protocols/uniswapv3/silver__univ3_lp_actions.sql +++ b/models/silver/protocols/uniswapv3/silver__univ3_lp_actions.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','uniswap'] ) }} WITH lp_actions_base AS ( diff --git a/models/silver/protocols/uniswapv3/silver__univ3_pool_stats.sql b/models/silver/protocols/uniswapv3/silver__univ3_pool_stats.sql index 2ed1e501..94535c65 100644 --- a/models/silver/protocols/uniswapv3/silver__univ3_pool_stats.sql +++ b/models/silver/protocols/uniswapv3/silver__univ3_pool_stats.sql @@ -3,7 +3,7 @@ cluster_by = ['block_timestamp::date', 'pool_address'], merge_exclude_columns = ["inserted_timestamp"], unique_key = 'id', - tags = ['curated'] + tags = ['silver','curated','uniswap'] ) }} WITH block_date AS ( diff --git a/models/silver/protocols/uniswapv3/silver__univ3_pools.sql b/models/silver/protocols/uniswapv3/silver__univ3_pools.sql index dfe7c8f8..1a077719 100644 --- a/models/silver/protocols/uniswapv3/silver__univ3_pools.sql +++ b/models/silver/protocols/uniswapv3/silver__univ3_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "created_block", cluster_by = ['_inserted_timestamp::DATE'], - tags = ['curated','pools'] + tags = ['silver','curated','uniswap','pools'] ) }} WITH created_pools AS ( @@ -97,7 +97,7 @@ contracts AS ( NAME, decimals FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} WHERE decimals IS NOT NULL ), diff --git a/models/silver/protocols/uniswapv3/silver__univ3_position_collected_fees.sql b/models/silver/protocols/uniswapv3/silver__univ3_position_collected_fees.sql index 81b497df..3a4585f0 100644 --- a/models/silver/protocols/uniswapv3/silver__univ3_position_collected_fees.sql +++ b/models/silver/protocols/uniswapv3/silver__univ3_position_collected_fees.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','uniswap'] ) }} WITH all_collected AS ( diff --git a/models/silver/protocols/uniswapv3/silver__univ3_positions.sql b/models/silver/protocols/uniswapv3/silver__univ3_positions.sql index dbbd03ec..84f5e715 100644 --- a/models/silver/protocols/uniswapv3/silver__univ3_positions.sql +++ b/models/silver/protocols/uniswapv3/silver__univ3_positions.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::date'], - tags = ['curated','reorg'] + tags = ['silver','curated','uniswap'] ) }} WITH lp_events AS ( diff --git a/models/silver/protocols/uniswapv3/silver__univ3_swaps.sql b/models/silver/protocols/uniswapv3/silver__univ3_swaps.sql index ed9e3b4c..b88f2fb8 100644 --- a/models/silver/protocols/uniswapv3/silver__univ3_swaps.sql +++ b/models/silver/protocols/uniswapv3/silver__univ3_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','curated','uniswap'] ) }} WITH base_swaps AS ( diff --git a/models/silver/api_udf/silver__reads.sql b/models/silver/reads/silver__reads.sql similarity index 98% rename from models/silver/api_udf/silver__reads.sql rename to models/silver/reads/silver__reads.sql index 16947683..be87f116 100644 --- a/models/silver/api_udf/silver__reads.sql +++ b/models/silver/reads/silver__reads.sql @@ -6,7 +6,7 @@ incremental_predicates = ["dynamic_range", "block_number"], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", merge_exclude_columns = ["inserted_timestamp"], - tags = ['non_realtime'] + tags = ['silver','reads'] ) }} SELECT diff --git a/models/silver/api_udf/tests/test_silver__reads_full.sql b/models/silver/reads/tests/test_silver__reads_full.sql similarity index 66% rename from models/silver/api_udf/tests/test_silver__reads_full.sql rename to models/silver/reads/tests/test_silver__reads_full.sql index 7784eb92..8662caf3 100644 --- a/models/silver/api_udf/tests/test_silver__reads_full.sql +++ b/models/silver/reads/tests/test_silver__reads_full.sql @@ -1,6 +1,6 @@ {{ config ( materialized = 'view', - tags = ['full_test'] + tags = ['test_silver','reads','full_test'] ) }} SELECT diff --git a/models/silver/api_udf/tests/test_silver__reads_full.yml b/models/silver/reads/tests/test_silver__reads_full.yml similarity index 100% rename from models/silver/api_udf/tests/test_silver__reads_full.yml rename to models/silver/reads/tests/test_silver__reads_full.yml diff --git a/models/silver/api_udf/tests/test_silver__reads_recent.sql b/models/silver/reads/tests/test_silver__reads_recent.sql similarity index 89% rename from models/silver/api_udf/tests/test_silver__reads_recent.sql rename to models/silver/reads/tests/test_silver__reads_recent.sql index 7c9a3ad0..887ef666 100644 --- a/models/silver/api_udf/tests/test_silver__reads_recent.sql +++ b/models/silver/reads/tests/test_silver__reads_recent.sql @@ -1,6 +1,6 @@ {{ config ( materialized = 'view', - tags = ['recent_test'] + tags = ['test_silver','reads','recent_test'] ) }} WITH last_3_days AS ( diff --git a/models/silver/api_udf/tests/test_silver__reads_recent.yml b/models/silver/reads/tests/test_silver__reads_recent.yml similarity index 100% rename from models/silver/api_udf/tests/test_silver__reads_recent.yml rename to models/silver/reads/tests/test_silver__reads_recent.yml diff --git a/models/silver/stats/silver_stats__core_metrics_hourly.sql b/models/silver/stats/silver_stats__core_metrics_hourly.sql deleted file mode 100644 index b08810d3..00000000 --- a/models/silver/stats/silver_stats__core_metrics_hourly.sql +++ /dev/null @@ -1,80 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_timestamp_hour", - cluster_by = ['block_timestamp_hour::DATE'], - tags = ['curated'] -) }} -/* run incremental timestamp value first then use it as a static value */ -{% if execute %} - -{% if is_incremental() %} -{% set query %} - -SELECT - MIN(DATE_TRUNC('hour', block_timestamp)) block_timestamp_hour -FROM - {{ ref('core__fact_transactions') }} -WHERE - modified_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - FROM - {{ this }} - ) {% endset %} - {% set min_block_timestamp_hour = run_query(query).columns [0].values() [0] %} -{% endif %} -{% endif %} -SELECT - DATE_TRUNC( - 'hour', - block_timestamp - ) AS block_timestamp_hour, - MIN(block_number) AS block_number_min, - MAX(block_number) AS block_number_max, - COUNT( - DISTINCT block_number - ) AS block_count, - COUNT( - DISTINCT tx_hash - ) AS transaction_count, - COUNT( - DISTINCT CASE - WHEN tx_succeeded THEN tx_hash - END - ) AS transaction_count_success, - COUNT( - DISTINCT CASE - WHEN NOT tx_succeeded THEN tx_hash - END - ) AS transaction_count_failed, - COUNT( - DISTINCT from_address - ) AS unique_from_count, - COUNT( - DISTINCT to_address - ) AS unique_to_count, - SUM(tx_fee_precise) AS total_fees, - MAX(modified_timestamp) AS _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['block_timestamp_hour'] - ) }} AS core_metrics_hourly_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {{ ref('core__fact_transactions') }} -WHERE - block_timestamp_hour < DATE_TRUNC( - 'hour', - CURRENT_TIMESTAMP - ) - -{% if is_incremental() %} -AND DATE_TRUNC( - 'hour', - block_timestamp -) >= '{{ min_block_timestamp_hour }}' -{% endif %} -GROUP BY - 1 diff --git a/models/silver/stats/silver_stats__core_metrics_hourly.yml b/models/silver/stats/silver_stats__core_metrics_hourly.yml deleted file mode 100644 index df231f39..00000000 --- a/models/silver/stats/silver_stats__core_metrics_hourly.yml +++ /dev/null @@ -1,84 +0,0 @@ -version: 2 -models: - - name: silver_stats__core_metrics_hourly - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - BLOCK_TIMESTAMP_HOUR - columns: - - name: BLOCK_TIMESTAMP_HOUR - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: BLOCK_NUMBER_MIN - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_NUMBER_MAX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_COUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRANSACTION_COUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRANSACTION_COUNT_SUCCESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRANSACTION_COUNT_FAILED - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: UNIQUE_FROM_COUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: UNIQUE_TO_COUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TOTAL_FEES - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - DECIMAL - - FLOAT - - NUMBER - - name: _INSERTED_TIMESTAMP - tests: - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 diff --git a/models/silver/utilities/silver__number_sequence.sql b/models/silver/utilities/silver__number_sequence.sql deleted file mode 100644 index 03592c39..00000000 --- a/models/silver/utilities/silver__number_sequence.sql +++ /dev/null @@ -1,8 +0,0 @@ -{{ config( - materialized = 'table', - cluster_by = 'round(_id,-3)', - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION" -) }} -{{ fsc_evm.number_sequence( - max_num = 50000000 -) }} diff --git a/models/sources.yml b/models/sources.yml index b43734f1..c5ff556b 100644 --- a/models/sources.yml +++ b/models/sources.yml @@ -1,23 +1,67 @@ version: 2 sources: - - name: crosschain - database: "{{ 'crosschain' if target.database == 'ETHEREUM' else 'crosschain_dev' }}" - schema: core + - name: bronze_streamline + database: streamline + schema: | + {{ target.database.upper() | replace('_DEV', '') ~ '_DEV' if var("STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES", False) else target.database.upper() | replace('_DEV', '') }} tables: - - name: dim_date_hours - - name: dim_labels - - name: eth_dev_db - database: ethereum_dev + - name: receipts + - name: blocks + - name: transactions + - name: debug_traceblockbynumber + - name: traces + - name: decoded_logs + - name: confirm_blocks + - name: blocks_v2 + - name: transactions_v2 + - name: receipts_v2 + - name: traces_v2 + - name: confirm_blocks_v2 + - name: decoded_logs_v2 + - name: contract_abis + - name: contract_abis_v2 + - name: beacon_blocks + - name: beacon_blocks_v2 + - name: beacon_committees + - name: beacon_sync_committees + - name: beacon_validators + - name: beacon_validators_v2 + - name: beacon_validator_balances + - name: beacon_blobs_v2 + - name: nft_metadata_api + - name: reads + - name: reads_v2 + - name: token_balances + - name: token_balances_v2 + - name: eth_balances + - name: eth_balances_v2 + - name: decoded_traces + - name: decoded_traces_v2 + - name: crosschain_silver + database: >- + {{ 'CROSSCHAIN_DEV' if '_DEV' in target.database.upper() else 'CROSSCHAIN' }} schema: silver tables: - - name: aave_atokens_upload - - name: curve_pools_backfill - - name: ethereum_bronze + - name: near_address_encoded + - name: labels_combined + - name: complete_provider_asset_metadata + - name: complete_native_asset_metadata + - name: complete_native_prices + - name: complete_provider_prices + - name: complete_token_asset_metadata + - name: complete_token_prices + - name: ethereum_silver database: ethereum - schema: bronze + schema: silver tables: - - name: legacy_contracts + - name: base_state_hashes + - name: crosschain_public + database: crosschain + schema: bronze_public + tables: + - name: user_abis + - name: user_metadata - name: ethereum_silver database: ethereum schema: silver @@ -30,86 +74,38 @@ sources: - name: nft_collection_metadata - name: eth_balance_diffs - name: token_balance_diffs - - name: ethereum_share - database: "{{target.database}}" - schema: silver + - name: complete_streamline + database: "{{ target.database }}" + schema: streamline tables: - - name: token_prices_hourly - - name: dex_liquidity_pools - - name: labels - - name: bronze_streamline - database: streamline - schema: | - {{ "ETHEREUM_DEV" if var("STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES", False) else "ETHEREUM" }} + - name: complete_contract_abis + - name: github_actions + database: "{{ target.database }}" + schema: github_actions tables: - - name: beacon_blocks - - name: beacon_blocks_v2 - - name: blocks - - name: blocks_v2 - - name: beacon_committees - - name: beacon_sync_committees - - name: beacon_validators - - name: beacon_validators_v2 - - name: beacon_validator_balances - - name: contract_abis - - name: contract_abis_v2 - - name: decode_logs - - name: eth_balances - - name: eth_balances_v2 - - name: nft_metadata_api - - name: reads - - name: reads_v2 - - name: sushi_rewards_schedule - - name: token_balances - - name: token_balances_v2 - - name: transactions - - name: transactions_v2 - - name: decoded_logs - - name: decoded_logs_v2 - - name: receipts - - name: receipts_v2 - - name: traces - - name: traces_v2 - - name: confirm_blocks - - name: confirm_blocks_v2 - - name: decoded_traces - - name: decoded_traces_v2 - - name: beacon_blobs_v2 - - name: crosschain_silver - database: "{{ 'crosschain' if target.database == 'ETHEREUM' else 'crosschain_dev' }}" - schema: silver - tables: - - name: near_address_encoded - - name: labels_combined - - name: complete_token_asset_metadata - - name: complete_token_prices - - name: complete_provider_asset_metadata - - name: complete_provider_prices - - name: complete_native_asset_metadata - - name: complete_native_prices - - name: eth_bronze_public - database: ethereum - schema: bronze_public - tables: - - name: user_abis - - name: crosschain_public - database: crosschain - schema: bronze_public - tables: - - name: user_abis - - name: user_metadata - - name: streamline_test - database: streamline - schema: ethereum - tables: - - name: decoded_logs_test + - name: workflows - name: external_gold_defillama database: external schema: defillama tables: - name: dim_chains - - name: github_actions - database: ethereum - schema: github_actions + - name: abis_silver + database: "{{ target.database }}" + schema: silver tables: - - name: workflows \ No newline at end of file + - name: verified_abis + - name: complete_event_abis + - name: fsc_evm_admin + database: >- + {{ 'FSC_EVM_DEV' if '_DEV' in target.database.upper() else 'FSC_EVM' }} + schema: admin + tables: + - name: _master_keys + - name: rpc_node_logs + - name: logs_temp + database: "{{ target.database }}" + schema: silver + tables: + - name: logs + - name: decoded_logs + - name: confirmed_blocks diff --git a/models/streamline/bronze/abis/bronze__contract_abis.sql b/models/streamline/bronze/abis/bronze__contract_abis.sql new file mode 100644 index 00000000..e0633968 --- /dev/null +++ b/models/streamline/bronze/abis/bronze__contract_abis.sql @@ -0,0 +1,21 @@ +{{ config ( + materialized = 'view' +) }} + +WITH base AS ( + {{ v0_streamline_external_table_query( + model = "contract_abis_v2", + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 4), '_', 1) AS INTEGER)" + ) }} +) +SELECT + partition_key, + block_number, + VALUE :"CONTRACT_ADDRESS" :: STRING AS contract_address, + VALUE, + DATA, + metadata, + file_name, + _inserted_timestamp +FROM + base diff --git a/models/streamline/bronze/abis/bronze__streamline_fr_contract_abis.sql b/models/streamline/bronze/abis/bronze__contract_abis_fr.sql similarity index 78% rename from models/streamline/bronze/abis/bronze__streamline_fr_contract_abis.sql rename to models/streamline/bronze/abis/bronze__contract_abis_fr.sql index f59c2e53..fe458eff 100644 --- a/models/streamline/bronze/abis/bronze__streamline_fr_contract_abis.sql +++ b/models/streamline/bronze/abis/bronze__contract_abis_fr.sql @@ -12,7 +12,7 @@ SELECT file_name, _inserted_timestamp FROM - {{ ref('bronze__streamline_fr_contract_abis_v2') }} + {{ ref('bronze__contract_abis_fr_v2') }} UNION ALL SELECT _partition_by_block_id AS partition_key, @@ -24,4 +24,4 @@ SELECT file_name, _inserted_timestamp FROM - {{ ref('bronze__streamline_fr_contract_abis_v1') }} + {{ ref('bronze__contract_abis_fr_v1') }} diff --git a/models/streamline/bronze/abis/bronze__streamline_fr_contract_abis_v1.sql b/models/streamline/bronze/abis/bronze__contract_abis_fr_v1.sql similarity index 100% rename from models/streamline/bronze/abis/bronze__streamline_fr_contract_abis_v1.sql rename to models/streamline/bronze/abis/bronze__contract_abis_fr_v1.sql diff --git a/models/streamline/bronze/abis/bronze__streamline_fr_contract_abis_v2.sql b/models/streamline/bronze/abis/bronze__contract_abis_fr_v2.sql similarity index 100% rename from models/streamline/bronze/abis/bronze__streamline_fr_contract_abis_v2.sql rename to models/streamline/bronze/abis/bronze__contract_abis_fr_v2.sql diff --git a/models/streamline/bronze/abis/bronze__streamline_contract_abis.sql b/models/streamline/bronze/abis/bronze__streamline_contract_abis.sql deleted file mode 100644 index 2574871b..00000000 --- a/models/streamline/bronze/abis/bronze__streamline_contract_abis.sql +++ /dev/null @@ -1,7 +0,0 @@ -{{ config ( - materialized = 'view' -) }} -{{ v0_streamline_external_table_query( - model = "contract_abis_v2", - partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 4), '_', 1) AS INTEGER)" -) }} diff --git a/models/streamline/bronze/core/bronze__blocks.sql b/models/streamline/bronze/core/bronze__blocks.sql index a75a70db..b5611e02 100644 --- a/models/streamline/bronze/core/bronze__blocks.sql +++ b/models/streamline/bronze/core/bronze__blocks.sql @@ -1,39 +1,14 @@ -{# Set variables #} -{% set source_name = 'BLOCKS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = '' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query( + source_name = 'blocks', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__blocks_fr.sql b/models/streamline/bronze/core/bronze__blocks_fr.sql index 9733a667..09f381d4 100644 --- a/models/streamline/bronze/core/bronze__blocks_fr.sql +++ b/models/streamline/bronze/core/bronze__blocks_fr.sql @@ -1,6 +1,9 @@ +{# Log configuration details #} +{{ fsc_evm.log_model_details() }} + {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} SELECT @@ -16,7 +19,6 @@ SELECT _inserted_timestamp FROM {{ ref('bronze__blocks_fr_v2') }} -{% if var('GLOBAL_USES_STREAMLINE_V1', false) %} UNION ALL SELECT _partition_by_block_id AS partition_key, @@ -27,5 +29,4 @@ SELECT file_name, _inserted_timestamp FROM - {{ ref('bronze__blocks_fr_v1') }} -{% endif %} \ No newline at end of file + {{ ref('bronze__blocks_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__blocks_fr_v1.sql b/models/streamline/bronze/core/bronze__blocks_fr_v1.sql index b45639a6..6b0b0bc5 100644 --- a/models/streamline/bronze/core/bronze__blocks_fr_v1.sql +++ b/models/streamline/bronze/core/bronze__blocks_fr_v1.sql @@ -1,40 +1,16 @@ -{# Set variables #} -{% set source_name = 'BLOCKS' %} -{% set source_version = '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" %} -{% set partition_join_key = '_partition_by_block_id' %} -{% set balances = default_vars['balances'] %} -{% set block_number = false %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core_streamline_v1'] + tags = ['bronze','core','streamline_v1','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'blocks', + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", + partition_join_key = "_partition_by_block_id", + block_number = false ) }} diff --git a/models/streamline/bronze/core/bronze__blocks_fr_v2.sql b/models/streamline/bronze/core/bronze__blocks_fr_v2.sql index 91576bd6..32dcd1d4 100644 --- a/models/streamline/bronze/core/bronze__blocks_fr_v2.sql +++ b/models/streamline/bronze/core/bronze__blocks_fr_v2.sql @@ -1,40 +1,14 @@ -{# Set variables #} -{% set source_name = 'BLOCKS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'blocks', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__confirm_blocks.sql b/models/streamline/bronze/core/bronze__confirm_blocks.sql index 031fdb2c..2927de05 100644 --- a/models/streamline/bronze/core/bronze__confirm_blocks.sql +++ b/models/streamline/bronze/core/bronze__confirm_blocks.sql @@ -1,39 +1,14 @@ -{# Set variables #} -{% set source_name = 'CONFIRM_BLOCKS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = '' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','confirm_blocks','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query( + source_name = 'confirm_blocks', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__confirm_blocks_fr.sql b/models/streamline/bronze/core/bronze__confirm_blocks_fr.sql index ebf8ac69..5b4a5e83 100644 --- a/models/streamline/bronze/core/bronze__confirm_blocks_fr.sql +++ b/models/streamline/bronze/core/bronze__confirm_blocks_fr.sql @@ -1,6 +1,9 @@ +{# Log configuration details #} +{{ fsc_evm.log_model_details() }} + {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','confirm_blocks','phase_1'] ) }} SELECT @@ -13,7 +16,6 @@ SELECT _inserted_timestamp FROM {{ ref('bronze__confirm_blocks_fr_v2') }} -{% if var('GLOBAL_USES_STREAMLINE_V1', false) %} UNION ALL SELECT _partition_by_block_id AS partition_key, @@ -24,5 +26,4 @@ SELECT file_name, _inserted_timestamp FROM - {{ ref('bronze__confirm_blocks_fr_v1') }} -{% endif %} \ No newline at end of file + {{ ref('bronze__confirm_blocks_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__confirm_blocks_fr_v1.sql b/models/streamline/bronze/core/bronze__confirm_blocks_fr_v1.sql index a4402e53..b65db0d9 100644 --- a/models/streamline/bronze/core/bronze__confirm_blocks_fr_v1.sql +++ b/models/streamline/bronze/core/bronze__confirm_blocks_fr_v1.sql @@ -1,40 +1,17 @@ -{# Set variables #} -{% set source_name = 'CONFIRM_BLOCKS' %} -{% set source_version = '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" %} -{% set partition_join_key = '_partition_by_block_id' %} -{% set balances = default_vars['balances'] %} -{% set block_number = false %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core_streamline_v1'] + tags = ['bronze','core','streamline_v1','confirm_blocks','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'confirm_blocks', + source_version = '', + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", + partition_join_key = "_partition_by_block_id", + block_number = false ) }} diff --git a/models/streamline/bronze/core/bronze__confirm_blocks_fr_v2.sql b/models/streamline/bronze/core/bronze__confirm_blocks_fr_v2.sql index d03c45b9..f14b4582 100644 --- a/models/streamline/bronze/core/bronze__confirm_blocks_fr_v2.sql +++ b/models/streamline/bronze/core/bronze__confirm_blocks_fr_v2.sql @@ -1,40 +1,14 @@ -{# Set variables #} -{% set source_name = 'CONFIRM_BLOCKS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','confirm_blocks','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'confirm_blocks', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__receipts.sql b/models/streamline/bronze/core/bronze__receipts.sql index 21d84b90..4e167d2a 100644 --- a/models/streamline/bronze/core/bronze__receipts.sql +++ b/models/streamline/bronze/core/bronze__receipts.sql @@ -1,39 +1,14 @@ -{# Set variables #} -{% set source_name = 'RECEIPTS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = '' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_receipts'] + tags = ['bronze','core','receipts','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query( + source_name = 'receipts', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__receipts_by_hash.sql b/models/streamline/bronze/core/bronze__receipts_by_hash.sql new file mode 100644 index 00000000..e69de29b diff --git a/models/streamline/bronze/core/bronze__receipts_by_hash_fr.sql b/models/streamline/bronze/core/bronze__receipts_by_hash_fr.sql new file mode 100644 index 00000000..e69de29b diff --git a/models/streamline/bronze/core/bronze__receipts_fr.sql b/models/streamline/bronze/core/bronze__receipts_fr.sql index 3b861c06..9b46789c 100644 --- a/models/streamline/bronze/core/bronze__receipts_fr.sql +++ b/models/streamline/bronze/core/bronze__receipts_fr.sql @@ -1,6 +1,9 @@ +{# Log configuration details #} +{{ fsc_evm.log_model_details() }} + {{ config ( materialized = 'view', - tags = ['bronze_receipts'] + tags = ['bronze','core','receipts','phase_1'] ) }} SELECT @@ -14,25 +17,18 @@ SELECT _inserted_timestamp FROM {{ ref('bronze__receipts_fr_v2') }} - - {% if var('GLOBAL_USES_STREAMLINE_V1',false) %} - UNION ALL - SELECT - _partition_by_block_id AS partition_key, - block_number, - COALESCE( - VALUE :"array_index" :: INT, - TRY_TO_NUMBER( - utils.udf_hex_to_int( - VALUE :"data" :"transactionIndex" :: STRING - ) - ) - ) AS array_index, - VALUE, - DATA, - metadata, - file_name, - _inserted_timestamp - FROM - {{ ref('bronze__receipts_fr_v1') }} - {% endif %} +UNION ALL +SELECT + _partition_by_block_id AS partition_key, + block_number, + COALESCE( + VALUE :array_index :: INT, + TRY_TO_NUMBER(utils.udf_hex_to_int(VALUE :data :"transactionIndex" :: STRING)) + ) AS array_index, + VALUE, + DATA, + metadata, + file_name, + _inserted_timestamp +FROM + {{ ref('bronze__receipts_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__receipts_fr_v1.sql b/models/streamline/bronze/core/bronze__receipts_fr_v1.sql index 6c4956e2..edba56df 100644 --- a/models/streamline/bronze/core/bronze__receipts_fr_v1.sql +++ b/models/streamline/bronze/core/bronze__receipts_fr_v1.sql @@ -1,40 +1,17 @@ -{# Set variables #} -{% set source_name = 'RECEIPTS' %} -{% set source_version = '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" %} -{% set partition_join_key = '_partition_by_block_id' %} -{% set balances = default_vars['balances'] %} -{% set block_number = false %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core_streamline_v1','bronze_receipts'] -) }} + tags = ['bronze','core','streamline_v1','receipts','phase_1'] +) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} \ No newline at end of file +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'receipts', + source_version = '', + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", + partition_join_key = "_partition_by_block_id", + block_number = false +) }} diff --git a/models/streamline/bronze/core/bronze__receipts_fr_v2.sql b/models/streamline/bronze/core/bronze__receipts_fr_v2.sql index 90e0a071..cf74f3cc 100644 --- a/models/streamline/bronze/core/bronze__receipts_fr_v2.sql +++ b/models/streamline/bronze/core/bronze__receipts_fr_v2.sql @@ -1,40 +1,14 @@ -{# Set variables #} -{% set source_name = 'RECEIPTS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_receipts'] + tags = ['bronze','core','receipts','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'receipts', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__traces.sql b/models/streamline/bronze/core/bronze__traces.sql index f8661762..98031337 100644 --- a/models/streamline/bronze/core/bronze__traces.sql +++ b/models/streamline/bronze/core/bronze__traces.sql @@ -1,39 +1,14 @@ -{# Set variables #} -{% set source_name = 'TRACES' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = '' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query( + source_name = 'traces', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__traces_fr.sql b/models/streamline/bronze/core/bronze__traces_fr.sql index b150c368..74b915f0 100644 --- a/models/streamline/bronze/core/bronze__traces_fr.sql +++ b/models/streamline/bronze/core/bronze__traces_fr.sql @@ -1,6 +1,9 @@ +{# Log configuration details #} +{{ fsc_evm.log_model_details() }} + {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} SELECT @@ -14,7 +17,6 @@ SELECT _inserted_timestamp FROM {{ ref('bronze__traces_fr_v2') }} -{% if var('GLOBAL_USES_STREAMLINE_V1', false) %} UNION ALL SELECT _partition_by_block_id AS partition_key, @@ -26,5 +28,4 @@ SELECT file_name, _inserted_timestamp FROM - {{ ref('bronze__traces_fr_v1') }} -{% endif %} \ No newline at end of file + {{ ref('bronze__traces_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__traces_fr_v1.sql b/models/streamline/bronze/core/bronze__traces_fr_v1.sql index 3905c1b8..c557d2e7 100644 --- a/models/streamline/bronze/core/bronze__traces_fr_v1.sql +++ b/models/streamline/bronze/core/bronze__traces_fr_v1.sql @@ -1,40 +1,16 @@ -{# Set variables #} -{% set source_name = 'DEBUG_TRACEBLOCKBYNUMBER' if var('GLOBAL_USES_SINGLE_FLIGHT_METHOD',false) else 'TRACES' %} -{% set source_version = '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" %} -{% set partition_join_key = '_partition_by_block_id' %} -{% set balances = default_vars['balances'] %} -{% set block_number = false %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core_streamline_v1'] + tags = ['bronze','core','streamline_v1','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'traces', + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", + partition_join_key = "_partition_by_block_id", + block_number = false ) }} diff --git a/models/streamline/bronze/core/bronze__traces_fr_v2.sql b/models/streamline/bronze/core/bronze__traces_fr_v2.sql index 04158254..facbd5d2 100644 --- a/models/streamline/bronze/core/bronze__traces_fr_v2.sql +++ b/models/streamline/bronze/core/bronze__traces_fr_v2.sql @@ -1,40 +1,14 @@ -{# Set variables #} -{% set source_name = 'TRACES' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'traces', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__transactions.sql b/models/streamline/bronze/core/bronze__transactions.sql index 69cf41d9..df93172f 100644 --- a/models/streamline/bronze/core/bronze__transactions.sql +++ b/models/streamline/bronze/core/bronze__transactions.sql @@ -1,39 +1,14 @@ -{# Set variables #} -{% set source_name = 'TRANSACTIONS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = '' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query( + source_name = 'transactions', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__transactions_fr.sql b/models/streamline/bronze/core/bronze__transactions_fr.sql index 6bca77b6..ccb3e1bb 100644 --- a/models/streamline/bronze/core/bronze__transactions_fr.sql +++ b/models/streamline/bronze/core/bronze__transactions_fr.sql @@ -1,6 +1,9 @@ +{# Log configuration details #} +{{ fsc_evm.log_model_details() }} + {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} SELECT @@ -13,7 +16,6 @@ SELECT _inserted_timestamp FROM {{ ref('bronze__transactions_fr_v2') }} -{% if var('GLOBAL_USES_STREAMLINE_V1', false) %} UNION ALL SELECT _partition_by_block_id AS partition_key, @@ -24,5 +26,4 @@ SELECT file_name, _inserted_timestamp FROM - {{ ref('bronze__transactions_fr_v1') }} -{% endif %} \ No newline at end of file + {{ ref('bronze__transactions_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__transactions_fr_v1.sql b/models/streamline/bronze/core/bronze__transactions_fr_v1.sql index 41179ac7..54e50ad3 100644 --- a/models/streamline/bronze/core/bronze__transactions_fr_v1.sql +++ b/models/streamline/bronze/core/bronze__transactions_fr_v1.sql @@ -1,40 +1,16 @@ -{# Set variables #} -{% set source_name = 'TRANSACTIONS' %} -{% set source_version = '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" %} -{% set partition_join_key = '_partition_by_block_id' %} -{% set balances = default_vars['balances'] %} -{% set block_number = false %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core_streamline_v1'] + tags = ['bronze','core','streamline_v1','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'transactions', + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", + partition_join_key = "_partition_by_block_id", + block_number = false ) }} diff --git a/models/streamline/bronze/core/bronze__transactions_fr_v2.sql b/models/streamline/bronze/core/bronze__transactions_fr_v2.sql index 7907074d..25da349d 100644 --- a/models/streamline/bronze/core/bronze__transactions_fr_v2.sql +++ b/models/streamline/bronze/core/bronze__transactions_fr_v2.sql @@ -1,40 +1,14 @@ -{# Set variables #} -{% set source_name = 'TRANSACTIONS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'transactions', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs.sql b/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs.sql index 8a339c61..1d5264a4 100644 --- a/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs.sql +++ b/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs.sql @@ -1,23 +1,14 @@ -{# Set variables #} -{% set source_name = 'DECODED_LOGS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = '' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - {# Log configuration details #} -{{ log_model_details( - vars = default_vars -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_decoded_logs'] + tags = ['bronze','decoded_logs','phase_2'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_decoder( - source_name = source_name.lower(), - source_version = source_version.lower() +{{ fsc_evm.streamline_external_table_query_decoder( + source_name = 'decoded_logs', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs_fr.sql b/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs_fr.sql index bbe59557..03e1cfb5 100644 --- a/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs_fr.sql +++ b/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs_fr.sql @@ -1,20 +1,18 @@ {# Log configuration details #} -{{ log_model_details() }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_decoded_logs'] + tags = ['bronze','decoded_logs','phase_2'] ) }} SELECT * FROM {{ ref('bronze__decoded_logs_fr_v2') }} -{% if var('GLOBAL_USES_STREAMLINE_V1', false) %} UNION ALL SELECT * FROM - {{ ref('bronze__decoded_logs_fr_v1') }} -{% endif %} + {{ ref('bronze__decoded_logs_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs_fr_v1.sql b/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs_fr_v1.sql index 8c122fa9..20e47dd2 100644 --- a/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs_fr_v1.sql +++ b/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs_fr_v1.sql @@ -1,23 +1,13 @@ -{# Set variables #} -{% set source_name = 'DECODED_LOGS' %} -{% set source_version = '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - {# Log configuration details #} -{{ log_model_details( - vars = default_vars -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_decoded_logs_streamline_v1'] + tags = ['bronze','decoded_logs','streamline_v1','phase_2'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_decoder_fr( - source_name = source_name.lower(), - source_version = source_version.lower() +{{ fsc_evm.streamline_external_table_query_decoder_fr( + source_name = 'decoded_logs' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs_fr_v2.sql b/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs_fr_v2.sql index 2bd430a1..c849a83a 100644 --- a/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs_fr_v2.sql +++ b/models/streamline/bronze/decoder/decoded_logs/bronze__decoded_logs_fr_v2.sql @@ -1,23 +1,14 @@ -{# Set variables #} -{% set source_name = 'DECODED_LOGS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - {# Log configuration details #} -{{ log_model_details( - vars = default_vars -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_decoded_logs'] + tags = ['bronze','decoded_logs','phase_2'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_decoder_fr( - source_name = source_name.lower(), - source_version = source_version.lower() +{{ fsc_evm.streamline_external_table_query_decoder_fr( + source_name = 'decoded_logs', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/silver/_24_hour_lookback.sql b/models/streamline/silver/_24_hour_lookback.sql deleted file mode 100644 index e9d060f8..00000000 --- a/models/streamline/silver/_24_hour_lookback.sql +++ /dev/null @@ -1,26 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH max_time AS ( - - SELECT - MAX(block_timestamp) AS max_timestamp - FROM - {{ ref("silver__blocks") }} -) -SELECT - MIN(block_number) AS block_number -FROM - {{ ref("silver__blocks") }} - JOIN max_time - ON block_timestamp BETWEEN DATEADD( - 'hour', - -25, - max_timestamp - ) - AND DATEADD( - 'hour', - -24, - max_timestamp - ) diff --git a/models/streamline/silver/_block_lookback.sql b/models/streamline/silver/_block_lookback.sql deleted file mode 100644 index f37bcf61..00000000 --- a/models/streamline/silver/_block_lookback.sql +++ /dev/null @@ -1,11 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -SELECT - MIN(block_number) AS block_number -FROM - {{ ref("silver__blocks") }} -WHERE - block_timestamp >= DATEADD('hour', -72, TRUNCATE(SYSDATE(), 'HOUR')) - AND block_timestamp < DATEADD('hour', -71, TRUNCATE(SYSDATE(), 'HOUR')) diff --git a/models/streamline/silver/_block_ranges.sql b/models/streamline/silver/_block_ranges.sql deleted file mode 100644 index 0f5f0b68..00000000 --- a/models/streamline/silver/_block_ranges.sql +++ /dev/null @@ -1,55 +0,0 @@ -{{ config ( - materialized = "ephemeral", - unique_key = "block_number", -) }} - -SELECT - block_number, - CASE - WHEN RIGHT( - block_number, - 1 - ) = 0 THEN block_number - END AS block_number_10, - CASE - WHEN RIGHT( - block_number, - 2 - ) IN ( - 00, - 25, - 50, - 75 - ) THEN block_number - END AS block_number_25, - CASE - WHEN RIGHT( - block_number, - 2 - ) IN ( - 00, - 50 - ) THEN block_number - END AS block_number_50, - CASE - WHEN RIGHT( - block_number, - 2 - ) IN (00) THEN block_number - END AS block_number_100, - CASE - WHEN RIGHT( - block_number, - 3 - ) IN (000) THEN block_number - END AS block_number_1000, - CASE - WHEN RIGHT( - block_number, - 4 - ) IN (0000) THEN block_number - END AS block_number_10000, - block_timestamp, - TO_TIMESTAMP_NTZ(_inserted_timestamp) AS _inserted_timestamp -FROM - {{ ref("silver__blocks") }} diff --git a/models/streamline/silver/_max_block_by_date.sql b/models/streamline/silver/_max_block_by_date.sql deleted file mode 100644 index a56cf82d..00000000 --- a/models/streamline/silver/_max_block_by_date.sql +++ /dev/null @@ -1,27 +0,0 @@ -{{ config ( - materialized = "ephemeral", - unique_key = "block_number", -) }} - -WITH base AS ( - - SELECT - block_timestamp :: DATE AS block_date, - MAX(block_number) block_number - FROM - {{ ref("silver__blocks") }} - GROUP BY - block_timestamp :: DATE -) -SELECT - block_date, - block_number -FROM - base -WHERE - block_date <> ( - SELECT - MAX(block_date) - FROM - base - ) \ No newline at end of file diff --git a/models/streamline/silver/_max_block_by_hour.sql b/models/streamline/silver/_max_block_by_hour.sql deleted file mode 100644 index 80e3d972..00000000 --- a/models/streamline/silver/_max_block_by_hour.sql +++ /dev/null @@ -1,37 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH base AS ( - - SELECT - DATE_TRUNC( - 'hour', - block_timestamp - ) AS block_hour, - MAX(block_number) block_number - FROM - {{ ref("silver__blocks") }} - WHERE - block_timestamp > DATEADD( - 'day', - -5, - CURRENT_DATE - ) - GROUP BY - 1 -) -SELECT - block_hour, - block_number -FROM - base -WHERE - block_hour <> ( - SELECT - MAX( - block_hour - ) - FROM - base - ) diff --git a/models/streamline/silver/abis/complete/streamline__complete_contract_abis.sql b/models/streamline/silver/abis/complete/streamline__complete_contract_abis.sql deleted file mode 100644 index 44b52f9d..00000000 --- a/models/streamline/silver/abis/complete/streamline__complete_contract_abis.sql +++ /dev/null @@ -1,38 +0,0 @@ --- depends on: {{ ref('bronze__streamline_contract_abis') }} -{{ config ( - materialized = "incremental", - unique_key = "complete_contract_abis_id", - cluster_by = "ROUND(block_number, -3)", - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(complete_contract_abis_id)", - incremental_predicates = ["dynamic_range", "block_number"], - tags = ['streamline_abis_complete'] -) }} - -SELECT - block_number, - COALESCE( - VALUE :"CONTRACT_ADDRESS" :: STRING, - VALUE :"contract_address" :: STRING - ) AS contract_address, - {{ dbt_utils.generate_surrogate_key( - ['block_number', 'contract_address'] - ) }} AS complete_contract_abis_id, - _inserted_timestamp -FROM - -{% if is_incremental() %} -{{ ref('bronze__streamline_contract_abis') }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) -{% else %} - {{ ref('bronze__streamline_fr_contract_abis') }} -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY complete_contract_abis_id -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/streamline/silver/abis/history/streamline__contract_abis_history.sql b/models/streamline/silver/abis/history/streamline__contract_abis_history.sql deleted file mode 100644 index 9acfd082..00000000 --- a/models/streamline/silver/abis/history/streamline__contract_abis_history.sql +++ /dev/null @@ -1,76 +0,0 @@ -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params ={ "external_table" :"contract_abis_v2", - "sql_limit" :"100000", - "producer_batch_size" :"18000", - "worker_batch_size" :"18000", - "sql_source" :"{{this.identifier}}", - "exploded_key": tojson(["result"]) } - ), - tags = ['streamline_abis_realtime'] -) }} - -WITH last_3_days AS ( - - SELECT - block_number - FROM - {{ ref("_max_block_by_date") }} - qualify ROW_NUMBER() over ( - ORDER BY - block_number DESC - ) = 3 -), -to_do AS ( - SELECT - created_contract_address AS contract_address, - block_number - FROM - {{ ref("silver__created_contracts") }} - WHERE - block_number < ( - SELECT - block_number - FROM - last_3_days - ) - AND block_number IS NOT NULL - EXCEPT - SELECT - contract_address, - block_number - FROM - {{ ref("streamline__complete_contract_abis") }} - WHERE - block_number < ( - SELECT - block_number - FROM - last_3_days - ) - AND block_number IS NOT NULL -) -SELECT - block_number, - contract_address, - ROUND( - block_number, - -3 - ) AS partition_key, - {{ target.database }}.live.udf_api( - 'GET', - 'https://api.etherscan.io/api?module=contract&action=getabi&address=' || contract_address || '&apikey={key}', - OBJECT_CONSTRUCT( - 'accept', - 'application/json' - ), - NULL, - 'vault/prod/ethereum/block_explorers/etherscan' - ) AS request -FROM - to_do -ORDER BY - block_number DESC \ No newline at end of file diff --git a/models/streamline/silver/abis/realtime/streamline__contract_abis_realtime.sql b/models/streamline/silver/abis/realtime/streamline__contract_abis_realtime.sql deleted file mode 100644 index 3b591a37..00000000 --- a/models/streamline/silver/abis/realtime/streamline__contract_abis_realtime.sql +++ /dev/null @@ -1,100 +0,0 @@ -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params ={ "external_table" :"contract_abis_v2", - "sql_limit" :"100000", - "producer_batch_size" :"18000", - "worker_batch_size" :"18000", - "sql_source" :"{{this.identifier}}", - "exploded_key": tojson(["result"]) } - ), - tags = ['streamline_abis_realtime'] -) }} - -WITH last_3_days AS ( - - SELECT - block_number - FROM - {{ ref("_max_block_by_date") }} - qualify ROW_NUMBER() over ( - ORDER BY - block_number DESC - ) = 3 -), -to_do AS ( - SELECT - created_contract_address AS contract_address, - block_number - FROM - {{ ref("silver__created_contracts") }} - WHERE - block_number >= ( - SELECT - block_number - FROM - last_3_days - ) - AND block_number IS NOT NULL - EXCEPT - SELECT - contract_address, - block_number - FROM - {{ ref("streamline__complete_contract_abis") }} - WHERE - block_number >= ( - SELECT - block_number - FROM - last_3_days - ) - AND block_number IS NOT NULL -), -ready_abis AS ( - SELECT - * - FROM - ( - SELECT - contract_address, - block_number - FROM - to_do - UNION ALL - SELECT - contract_address, - block_number - FROM - {{ ref("_retry_abis") }} - WHERE - block_number IS NOT NULL - ) - WHERE - contract_address IS NOT NULL qualify(ROW_NUMBER() over(PARTITION BY contract_address - ORDER BY - block_number DESC)) = 1 -) -SELECT - block_number, - contract_address, - ROUND( - block_number, - -3 - ) AS partition_key, - {{ target.database }}.live.udf_api( - 'GET', - 'https://api.etherscan.io/api?module=contract&action=getabi&address=' || contract_address || '&apikey={key}', - OBJECT_CONSTRUCT( - 'accept', - 'application/json' - ), - NULL, - 'vault/prod/ethereum/block_explorers/etherscan' - ) AS request -FROM - ready_abis -ORDER BY - block_number DESC diff --git a/models/streamline/silver/abis/retry/_retry_abis.sql b/models/streamline/silver/abis/retry/_retry_abis.sql deleted file mode 100644 index 4203c105..00000000 --- a/models/streamline/silver/abis/retry/_retry_abis.sql +++ /dev/null @@ -1,73 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH retry AS ( - - SELECT - contract_address, - GREATEST( - latest_call_block, - latest_event_block - ) AS block_number, - total_interaction_count - FROM - {{ ref("silver__relevant_contracts") }} - r - LEFT JOIN {{ ref("silver__verified_abis") }} - v USING (contract_address) - WHERE - r.total_interaction_count >= 1000 -- high interaction count - AND GREATEST( - max_inserted_timestamp_logs, - max_inserted_timestamp_traces - ) >= CURRENT_DATE - INTERVAL '30 days' -- recent activity - AND v.contract_address IS NULL -- no verified abi - AND r.contract_address NOT IN ( - SELECT - contract_address - FROM - {{ ref("streamline__complete_contract_abis") }} - WHERE - _inserted_timestamp >= CURRENT_DATE - INTERVAL '30 days' -- this won't let us retry the same contract within 30 days - ) - ORDER BY - total_interaction_count DESC - LIMIT - 50 -), FINAL AS ( - SELECT - proxy_address AS contract_address, - start_block AS block_number - FROM - {{ ref("silver__proxies") }} - p - JOIN retry r USING (contract_address) - LEFT JOIN {{ ref("silver__verified_abis") }} - v - ON v.contract_address = p.proxy_address - WHERE - v.contract_address IS NULL - AND p.contract_address NOT IN ( - SELECT - contract_address - FROM - {{ ref("streamline__complete_contract_abis") }} - WHERE - _inserted_timestamp >= CURRENT_DATE - INTERVAL '30 days' -- this won't let us retry the same contract within 30 days - ) - UNION ALL - SELECT - contract_address, - block_number - FROM - retry -) -SELECT - * -FROM - FINAL qualify ROW_NUMBER() over ( - PARTITION BY contract_address - ORDER BY - block_number DESC - ) = 1 diff --git a/models/streamline/silver/beacon/_premerge_max_daily_slots.sql b/models/streamline/silver/beacon/_premerge_max_daily_slots.sql index 74e5cf2d..06d2bc16 100644 --- a/models/streamline/silver/beacon/_premerge_max_daily_slots.sql +++ b/models/streamline/silver/beacon/_premerge_max_daily_slots.sql @@ -8,7 +8,7 @@ WITH slots AS ( FLOOR((_id - 3599) / 7200) + 1 AS day_number, MAX(_id) AS max_slot FROM - {{ ref("silver__number_sequence") }} + {{ ref("admin__number_sequence") }} WHERE _id BETWEEN 3598 AND 4700012 diff --git a/models/streamline/silver/beacon/retry/_missing_withdrawals.sql b/models/streamline/silver/beacon/retry/_missing_withdrawals.sql index 47790601..7b739e74 100644 --- a/models/streamline/silver/beacon/retry/_missing_withdrawals.sql +++ b/models/streamline/silver/beacon/retry/_missing_withdrawals.sql @@ -41,7 +41,7 @@ FINAL AS ( start_slot_number + _id AS missing_slot_number FROM gaps - JOIN {{ ref('silver__number_sequence') }} + JOIN {{ ref('admin__number_sequence') }} ON _id BETWEEN 1 AND ( end_slot_number - start_slot_number - 1 diff --git a/models/streamline/silver/beacon/streamline__beacon_blocks.sql b/models/streamline/silver/beacon/streamline__beacon_blocks.sql index 698b895f..29fabbfe 100644 --- a/models/streamline/silver/beacon/streamline__beacon_blocks.sql +++ b/models/streamline/silver/beacon/streamline__beacon_blocks.sql @@ -7,7 +7,7 @@ SELECT _id AS slot_number FROM {{ ref( - 'silver__number_sequence' + 'admin__number_sequence' ) }} WHERE _id <= ( diff --git a/models/streamline/silver/core/complete/streamline__blocks_complete.sql b/models/streamline/silver/core/complete/streamline__blocks_complete.sql deleted file mode 100644 index 4c8977d8..00000000 --- a/models/streamline/silver/core/complete/streamline__blocks_complete.sql +++ /dev/null @@ -1,50 +0,0 @@ -{# Set variables #} -{%- set source_name = 'BLOCKS' -%} -{%- set model_type = 'COMPLETE' -%} - -{%- set full_refresh_type = var((source_name ~ '_complete_full_refresh').upper(), false) -%} - -{% set post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(block_number)" %} - -{# Log configuration details #} -{{ log_complete_details( - post_hook = post_hook, - full_refresh_type = full_refresh_type -) }} - -{# Set up dbt configuration #} --- depends_on: {{ ref('bronze__' ~ source_name.lower()) }} - -{{ config ( - materialized = "incremental", - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = post_hook, - full_refresh = full_refresh_type, - tags = ['streamline_core_complete'] -) }} - -{# Main query starts here #} -SELECT - block_number, - file_name, - {{ dbt_utils.generate_surrogate_key(['block_number']) }} AS complete_{{ source_name.lower() }}_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - _inserted_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {% if is_incremental() %} - {{ ref('bronze__' ~ source_name.lower()) }} - WHERE - _inserted_timestamp >= ( - SELECT - COALESCE(MAX(_inserted_timestamp), '1970-01-01'::TIMESTAMP) AS _inserted_timestamp - FROM - {{ this }} - ) - {% else %} - {{ ref('bronze__' ~ source_name.lower() ~ '_fr') }} - {% endif %} - -QUALIFY (ROW_NUMBER() OVER (PARTITION BY block_number ORDER BY _inserted_timestamp DESC)) = 1 diff --git a/models/streamline/silver/core/complete/streamline__confirm_blocks_complete.sql b/models/streamline/silver/core/complete/streamline__confirm_blocks_complete.sql deleted file mode 100644 index fe73ef27..00000000 --- a/models/streamline/silver/core/complete/streamline__confirm_blocks_complete.sql +++ /dev/null @@ -1,50 +0,0 @@ -{# Set variables #} -{%- set source_name = 'CONFIRM_BLOCKS' -%} -{%- set model_type = 'COMPLETE' -%} - -{%- set full_refresh_type = var((source_name ~ '_complete_full_refresh').upper(), false) -%} - -{% set post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(block_number)" %} - -{# Log configuration details #} -{{ log_complete_details( - post_hook = post_hook, - full_refresh_type = full_refresh_type -) }} - -{# Set up dbt configuration #} --- depends_on: {{ ref('bronze__' ~ source_name.lower()) }} - -{{ config ( - materialized = "incremental", - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = post_hook, - full_refresh = full_refresh_type, - tags = ['streamline_core_complete_confirm_blocks'] -) }} - -{# Main query starts here #} -SELECT - block_number, - file_name, - {{ dbt_utils.generate_surrogate_key(['block_number']) }} AS complete_{{ source_name.lower() }}_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - _inserted_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {% if is_incremental() %} - {{ ref('bronze__' ~ source_name.lower()) }} - WHERE - _inserted_timestamp >= ( - SELECT - COALESCE(MAX(_inserted_timestamp), '1970-01-01'::TIMESTAMP) AS _inserted_timestamp - FROM - {{ this }} - ) - {% else %} - {{ ref('bronze__' ~ source_name.lower() ~ '_fr') }} - {% endif %} - -QUALIFY (ROW_NUMBER() OVER (PARTITION BY block_number ORDER BY _inserted_timestamp DESC)) = 1 diff --git a/models/streamline/silver/core/complete/streamline__receipts_complete.sql b/models/streamline/silver/core/complete/streamline__receipts_complete.sql deleted file mode 100644 index b77138da..00000000 --- a/models/streamline/silver/core/complete/streamline__receipts_complete.sql +++ /dev/null @@ -1,50 +0,0 @@ -{# Set variables #} -{%- set source_name = 'RECEIPTS' -%} -{%- set model_type = 'COMPLETE' -%} - -{%- set full_refresh_type = var((source_name ~ '_complete_full_refresh').upper(), false) -%} - -{% set post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(block_number)" %} - -{# Log configuration details #} -{{ log_complete_details( - post_hook = post_hook, - full_refresh_type = full_refresh_type -) }} - -{# Set up dbt configuration #} --- depends_on: {{ ref('bronze__' ~ source_name.lower()) }} - -{{ config ( - materialized = "incremental", - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = post_hook, - full_refresh = full_refresh_type, - tags = ['streamline_core_complete_receipts'] -) }} - -{# Main query starts here #} -SELECT - block_number, - file_name, - {{ dbt_utils.generate_surrogate_key(['block_number']) }} AS complete_{{ source_name.lower() }}_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - _inserted_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {% if is_incremental() %} - {{ ref('bronze__' ~ source_name.lower()) }} - WHERE - _inserted_timestamp >= ( - SELECT - COALESCE(MAX(_inserted_timestamp), '1970-01-01'::TIMESTAMP) AS _inserted_timestamp - FROM - {{ this }} - ) - {% else %} - {{ ref('bronze__' ~ source_name.lower() ~ '_fr') }} - {% endif %} - -QUALIFY (ROW_NUMBER() OVER (PARTITION BY block_number ORDER BY _inserted_timestamp DESC)) = 1 diff --git a/models/streamline/silver/core/complete/streamline__traces_complete.sql b/models/streamline/silver/core/complete/streamline__traces_complete.sql deleted file mode 100644 index e7158769..00000000 --- a/models/streamline/silver/core/complete/streamline__traces_complete.sql +++ /dev/null @@ -1,50 +0,0 @@ -{# Set variables #} -{%- set source_name = 'TRACES' -%} -{%- set model_type = 'COMPLETE' -%} - -{%- set full_refresh_type = var((source_name ~ '_complete_full_refresh').upper(), false) -%} - -{% set post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(block_number)" %} - -{# Log configuration details #} -{{ log_complete_details( - post_hook = post_hook, - full_refresh_type = full_refresh_type -) }} - -{# Set up dbt configuration #} --- depends_on: {{ ref('bronze__' ~ source_name.lower()) }} - -{{ config ( - materialized = "incremental", - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = post_hook, - full_refresh = full_refresh_type, - tags = ['streamline_core_complete'] -) }} - -{# Main query starts here #} -SELECT - block_number, - file_name, - {{ dbt_utils.generate_surrogate_key(['block_number']) }} AS complete_{{ source_name.lower() }}_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - _inserted_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {% if is_incremental() %} - {{ ref('bronze__' ~ source_name.lower()) }} - WHERE - _inserted_timestamp >= ( - SELECT - COALESCE(MAX(_inserted_timestamp), '1970-01-01'::TIMESTAMP) AS _inserted_timestamp - FROM - {{ this }} - ) - {% else %} - {{ ref('bronze__' ~ source_name.lower() ~ '_fr') }} - {% endif %} - -QUALIFY (ROW_NUMBER() OVER (PARTITION BY block_number ORDER BY _inserted_timestamp DESC)) = 1 \ No newline at end of file diff --git a/models/streamline/silver/core/complete/streamline__transactions_complete.sql b/models/streamline/silver/core/complete/streamline__transactions_complete.sql deleted file mode 100644 index 06ec7f76..00000000 --- a/models/streamline/silver/core/complete/streamline__transactions_complete.sql +++ /dev/null @@ -1,50 +0,0 @@ -{# Set variables #} -{%- set source_name = 'TRANSACTIONS' -%} -{%- set model_type = 'COMPLETE' -%} - -{%- set full_refresh_type = var((source_name ~ '_complete_full_refresh').upper(), false) -%} - -{% set post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(block_number)"%} - -{# Log configuration details #} -{{ log_complete_details( - post_hook = post_hook, - full_refresh_type = full_refresh_type -) }} - -{# Set up dbt configuration #} --- depends_on: {{ ref('bronze__' ~ source_name.lower()) }} - -{{ config ( - materialized = "incremental", - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = post_hook, - full_refresh = full_refresh_type, - tags = ['streamline_core_complete'] -) }} - -{# Main query starts here #} -SELECT - block_number, - file_name, - {{ dbt_utils.generate_surrogate_key(['block_number']) }} AS complete_{{ source_name.lower() }}_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - _inserted_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {% if is_incremental() %} - {{ ref('bronze__' ~ source_name.lower()) }} - WHERE - _inserted_timestamp >= ( - SELECT - COALESCE(MAX(_inserted_timestamp), '1970-01-01'::TIMESTAMP) AS _inserted_timestamp - FROM - {{ this }} - ) - {% else %} - {{ ref('bronze__' ~ source_name.lower() ~ '_fr') }} - {% endif %} - -QUALIFY (ROW_NUMBER() OVER (PARTITION BY block_number ORDER BY _inserted_timestamp DESC)) = 1 \ No newline at end of file diff --git a/models/streamline/silver/core/history/streamline__blocks_transactions_history.sql b/models/streamline/silver/core/history/streamline__blocks_transactions_history.sql deleted file mode 100644 index baed1d72..00000000 --- a/models/streamline/silver/core/history/streamline__blocks_transactions_history.sql +++ /dev/null @@ -1,112 +0,0 @@ -{# Set variables #} -{%- set model_name = 'BLOCKS_TRANSACTIONS' -%} -{%- set model_type = 'HISTORY' -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} - -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_history'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} - - EXCEPT - - SELECT block_number - FROM {{ ref("streamline__blocks_complete") }} b - INNER JOIN {{ ref("streamline__transactions_complete") }} t USING(block_number) - WHERE 1=1 - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} -), -ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/history/streamline__confirm_blocks_history.sql b/models/streamline/silver/core/history/streamline__confirm_blocks_history.sql deleted file mode 100644 index d715b311..00000000 --- a/models/streamline/silver/core/history/streamline__confirm_blocks_history.sql +++ /dev/null @@ -1,133 +0,0 @@ -{# Set variables #} -{%- set model_name = 'CONFIRM_BLOCKS' -%} -{%- set model_type = 'HISTORY' -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_history_confirm_blocks'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Delay blocks #} -look_back AS ( - SELECT - block_number - FROM - {{ ref("_max_block_by_hour") }} - qualify ROW_NUMBER() over ( - ORDER BY - block_number DESC - ) = 6 - ), - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - AND block_number <= (SELECT block_number FROM look_back) - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} - - EXCEPT - - {# Exclude blocks that have already been processed #} - SELECT block_number - FROM {{ ref('streamline__' ~ model_name.lower() ~ '_complete') }} - WHERE 1=1 - AND block_number IS NOT NULL - AND block_number <= (SELECT block_number FROM look_back) - AND _inserted_timestamp >= DATEADD( - 'day', - -4, - SYSDATE() - ) - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} -) - -{# Prepare the final list of blocks to process #} -,ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/history/streamline__receipts_history.sql b/models/streamline/silver/core/history/streamline__receipts_history.sql deleted file mode 100644 index 4cd5823e..00000000 --- a/models/streamline/silver/core/history/streamline__receipts_history.sql +++ /dev/null @@ -1,113 +0,0 @@ -{# Set variables #} -{%- set model_name = 'RECEIPTS' -%} -{%- set model_type = 'HISTORY' -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_history_receipts'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} - - EXCEPT - - {# Exclude blocks that have already been processed #} - SELECT block_number - FROM {{ ref('streamline__' ~ model_name.lower() ~ '_complete') }} - WHERE 1=1 - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} -) - -{# Prepare the final list of blocks to process #} -,ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/history/streamline__traces_history.sql b/models/streamline/silver/core/history/streamline__traces_history.sql deleted file mode 100644 index 0cf5cc27..00000000 --- a/models/streamline/silver/core/history/streamline__traces_history.sql +++ /dev/null @@ -1,113 +0,0 @@ -{# Set variables #} -{%- set model_name = 'TRACES' -%} -{%- set model_type = 'HISTORY' -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_history'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} - - EXCEPT - - {# Exclude blocks that have already been processed #} - SELECT block_number - FROM {{ ref('streamline__' ~ model_name.lower() ~ '_complete') }} - WHERE 1=1 - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} -) - -{# Prepare the final list of blocks to process #} -,ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/realtime/streamline__blocks_transactions_realtime.sql b/models/streamline/silver/core/realtime/streamline__blocks_transactions_realtime.sql deleted file mode 100644 index 0bd0a93f..00000000 --- a/models/streamline/silver/core/realtime/streamline__blocks_transactions_realtime.sql +++ /dev/null @@ -1,126 +0,0 @@ -{# Set variables #} -{%- set model_name = 'BLOCKS_TRANSACTIONS' -%} -{%- set model_type = 'REALTIME' -%} -{%- set min_block = var('GLOBAL_START_UP_BLOCK', none) -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method, - min_block=min_block -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_realtime'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} - - {% if min_block is not none %} - AND block_number >= {{ min_block }} - {% endif %} - - EXCEPT - - SELECT block_number - FROM {{ ref("streamline__blocks_complete") }} b - INNER JOIN {{ ref("streamline__transactions_complete") }} t USING(block_number) - WHERE 1=1 - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} -), -ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if not new_build %} - UNION - SELECT block_number - FROM {{ ref("_unconfirmed_blocks") }} - UNION - SELECT block_number - FROM {{ ref("_missing_txs") }} - {% endif %} - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/realtime/streamline__confirm_blocks_realtime.sql b/models/streamline/silver/core/realtime/streamline__confirm_blocks_realtime.sql deleted file mode 100644 index 6135a3fc..00000000 --- a/models/streamline/silver/core/realtime/streamline__confirm_blocks_realtime.sql +++ /dev/null @@ -1,138 +0,0 @@ -{# Set variables #} -{%- set model_name = 'CONFIRM_BLOCKS' -%} -{%- set model_type = 'REALTIME' -%} -{%- set min_block = var('GLOBAL_START_UP_BLOCK', none) -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method, - min_block=min_block -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_realtime_confirm_blocks'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Delay blocks #} -look_back AS ( - SELECT - block_number - FROM - {{ ref("_max_block_by_hour") }} - qualify ROW_NUMBER() over ( - ORDER BY - block_number DESC - ) = 6 - ), - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - AND block_number <= (SELECT block_number FROM look_back) - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} - {% if min_block is not none %} - AND block_number >= {{ min_block }} - {% endif %} - - EXCEPT - - {# Exclude blocks that have already been processed #} - SELECT block_number - FROM {{ ref('streamline__' ~ model_name.lower() ~ '_complete') }} - WHERE 1=1 - AND block_number IS NOT NULL - AND block_number <= (SELECT block_number FROM look_back) - AND _inserted_timestamp >= DATEADD( - 'day', - -4, - SYSDATE() - ) - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} -) - -{# Prepare the final list of blocks to process #} -,ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/realtime/streamline__receipts_realtime.sql b/models/streamline/silver/core/realtime/streamline__receipts_realtime.sql deleted file mode 100644 index 6ec5c850..00000000 --- a/models/streamline/silver/core/realtime/streamline__receipts_realtime.sql +++ /dev/null @@ -1,130 +0,0 @@ -{# Set variables #} -{%- set model_name = 'RECEIPTS' -%} -{%- set model_type = 'REALTIME' -%} -{%- set min_block = var('GLOBAL_START_UP_BLOCK', none) -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method, - min_block=min_block -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_realtime_receipts'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} - {% if min_block is not none %} - AND block_number >= {{ min_block }} - {% endif %} - - EXCEPT - - {# Exclude blocks that have already been processed #} - SELECT block_number - FROM {{ ref('streamline__' ~ model_name.lower() ~ '_complete') }} - WHERE 1=1 - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} -) - -{# Prepare the final list of blocks to process #} -,ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if not new_build %} - UNION - SELECT block_number - FROM {{ ref("_unconfirmed_blocks") }} - UNION - SELECT block_number - FROM {{ ref("_missing_txs") }} - UNION - SELECT block_number - FROM {{ ref("_missing_receipts") }} - {% endif %} - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/realtime/streamline__traces_realtime.sql b/models/streamline/silver/core/realtime/streamline__traces_realtime.sql deleted file mode 100644 index 34f7f984..00000000 --- a/models/streamline/silver/core/realtime/streamline__traces_realtime.sql +++ /dev/null @@ -1,127 +0,0 @@ -{# Set variables #} -{%- set model_name = 'TRACES' -%} -{%- set model_type = 'REALTIME' -%} -{%- set min_block = var('GLOBAL_START_UP_BLOCK', none) -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method, - min_block=min_block -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_realtime'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} - {% if min_block is not none %} - AND block_number >= {{ min_block }} - {% endif %} - - EXCEPT - - {# Exclude blocks that have already been processed #} - SELECT block_number - FROM {{ ref('streamline__' ~ model_name.lower() ~ '_complete') }} - WHERE 1=1 - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} -) - -{# Prepare the final list of blocks to process #} -,ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if not new_build %} - UNION - SELECT block_number - FROM {{ ref("_unconfirmed_blocks") }} - UNION - SELECT block_number - FROM {{ ref("_missing_traces") }} - {% endif %} - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/retry/_missing_receipts.sql b/models/streamline/silver/core/retry/_missing_receipts.sql deleted file mode 100644 index fb055b60..00000000 --- a/models/streamline/silver/core/retry/_missing_receipts.sql +++ /dev/null @@ -1,34 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH lookback AS ( - - SELECT - block_number - FROM - {{ ref("_block_lookback") }} -) -SELECT - DISTINCT t.block_number AS block_number -FROM - {{ ref("silver__transactions") }} - t - LEFT JOIN {{ ref("silver__receipts") }} - r USING ( - block_number, - block_hash, - tx_hash - ) -WHERE - r.tx_hash IS NULL - AND t.block_number >= ( - SELECT - block_number - FROM - lookback - ) - AND t.block_timestamp >= DATEADD('hour', -84, SYSDATE()) - AND ( - r._inserted_timestamp >= DATEADD('hour', -84, SYSDATE()) - OR r._inserted_timestamp IS NULL) diff --git a/models/streamline/silver/core/retry/_missing_traces.sql b/models/streamline/silver/core/retry/_missing_traces.sql deleted file mode 100644 index 346f556c..00000000 --- a/models/streamline/silver/core/retry/_missing_traces.sql +++ /dev/null @@ -1,17 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -SELECT - DISTINCT tx.block_number -FROM - {{ ref("test_silver__transactions_recent") }} - tx - LEFT JOIN {{ ref("test_gold__fact_traces_recent") }} - tr USING ( - block_number, - tx_hash - ) -WHERE - tr.tx_hash IS NULL - AND tx.block_timestamp > DATEADD('day', -5, SYSDATE()) diff --git a/models/streamline/silver/core/retry/_missing_txs.sql b/models/streamline/silver/core/retry/_missing_txs.sql deleted file mode 100644 index 7718e970..00000000 --- a/models/streamline/silver/core/retry/_missing_txs.sql +++ /dev/null @@ -1,40 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH lookback AS ( - - SELECT - block_number - FROM - {{ ref("_block_lookback") }} -), -transactions AS ( - SELECT - block_number, - POSITION, - LAG( - POSITION, - 1 - ) over ( - PARTITION BY block_number - ORDER BY - POSITION ASC - ) AS prev_POSITION - FROM - {{ ref("silver__transactions") }} - WHERE - block_timestamp >= DATEADD('hour', -84, SYSDATE()) - AND block_number >= ( - SELECT - block_number - FROM - lookback - ) -) -SELECT - DISTINCT block_number AS block_number -FROM - transactions -WHERE - POSITION - prev_POSITION <> 1 diff --git a/models/streamline/silver/core/retry/_unconfirmed_blocks.sql b/models/streamline/silver/core/retry/_unconfirmed_blocks.sql deleted file mode 100644 index 8e2507cd..00000000 --- a/models/streamline/silver/core/retry/_unconfirmed_blocks.sql +++ /dev/null @@ -1,34 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH lookback AS ( - - SELECT - block_number - FROM - {{ ref("_block_lookback") }} -) -SELECT - DISTINCT cb.block_number AS block_number -FROM - {{ ref("silver__confirmed_blocks") }} - cb - LEFT JOIN {{ ref("silver__transactions") }} - txs USING ( - block_number, - block_hash, - tx_hash - ) -WHERE - txs.tx_hash IS NULL - AND cb.block_number >= ( - SELECT - block_number - FROM - lookback - ) - AND cb._inserted_timestamp >= DATEADD('hour', -84, SYSDATE()) - AND ( - txs._inserted_timestamp >= DATEADD('hour', -84, SYSDATE()) - OR txs._inserted_timestamp IS NULL) diff --git a/models/streamline/silver/core/streamline__blocks.sql b/models/streamline/silver/core/streamline__blocks.sql deleted file mode 100644 index 9e56c764..00000000 --- a/models/streamline/silver/core/streamline__blocks.sql +++ /dev/null @@ -1,36 +0,0 @@ -{%- if flags.WHICH == 'compile' and execute -%} - - {% set config_log = '\n' %} - {% set config_log = config_log ~ '\n=== DBT Model Config ===\n'%} - {% set config_log = config_log ~ '\n{{ config (\n' %} - {% set config_log = config_log ~ ' materialized = "' ~ config.get('materialized') ~ '",\n' %} - {% set config_log = config_log ~ ' tags = ' ~ config.get('tags') | tojson ~ '\n' %} - {% set config_log = config_log ~ ') }}\n' %} - {{ log(config_log, info=True) }} - {{ log("", info=True) }} -{%- endif -%} - -{{ config ( - materialized = "view", - tags = ['streamline_core_complete'] -) }} - -SELECT - _id, - ( - ({{ var('GLOBAL_BLOCKS_PER_HOUR',0) }} / 60) * {{ var('GLOBAL_CHAINHEAD_DELAY',3) }} - ) :: INT AS block_number_delay, --minute-based block delay - (_id - block_number_delay) :: INT AS block_number, - utils.udf_int_to_hex(block_number) AS block_number_hex -FROM - {{ ref('silver__number_sequence') }} -WHERE - _id <= ( - SELECT - COALESCE( - block_number, - 0 - ) - FROM - {{ ref("streamline__get_chainhead") }} - ) \ No newline at end of file diff --git a/models/streamline/silver/core/streamline__get_chainhead.sql b/models/streamline/silver/core/streamline__get_chainhead.sql deleted file mode 100644 index 9e98ae7b..00000000 --- a/models/streamline/silver/core/streamline__get_chainhead.sql +++ /dev/null @@ -1,54 +0,0 @@ -{%- set model_quantum_state = var('CHAINHEAD_QUANTUM_STATE', 'livequery') -%} - -{%- set node_url = var('GLOBAL_NODE_URL', '{Service}/{Authentication}') -%} - -{%- if flags.WHICH == 'compile' and execute -%} - - {{ log("=== Current Variable Settings ===", info=True) }} - {{ log("CHAINHEAD_QUANTUM_STATE: " ~ model_quantum_state, info=True) }} - {{ log("", info=True) }} - - {{ log("=== API Details ===", info=True) }} - {{ log("NODE_URL: " ~ node_url, info=True) }} - {{ log("NODE_SECRET_PATH: " ~ var('GLOBAL_NODE_SECRET_PATH'), info=True) }} - {{ log("", info=True) }} - - {% set config_log = '\n' %} - {% set config_log = config_log ~ '\n=== DBT Model Config ===\n'%} - {% set config_log = config_log ~ '\n{{ config (\n' %} - {% set config_log = config_log ~ ' materialized = "' ~ config.get('materialized') ~ '",\n' %} - {% set config_log = config_log ~ ' tags = ' ~ config.get('tags') | tojson ~ '\n' %} - {% set config_log = config_log ~ ') }}\n' %} - {{ log(config_log, info=True) }} - {{ log("", info=True) }} - -{%- endif -%} - -{{ config ( - materialized = 'table', - tags = ['streamline_core_complete','chainhead'] -) }} - -SELECT - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', - 0, - 'jsonrpc', - '2.0', - 'method', - 'eth_blockNumber', - 'params', - [] - ), - '{{ var('GLOBAL_NODE_SECRET_PATH') }}' - ) AS resp, - utils.udf_hex_to_int( - resp :data :result :: STRING - ) AS block_number \ No newline at end of file diff --git a/models/streamline/silver/core/streamline__get_chainhead.yml b/models/streamline/silver/core/streamline__get_chainhead.yml deleted file mode 100644 index e318e4db..00000000 --- a/models/streamline/silver/core/streamline__get_chainhead.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: 2 -models: - - name: streamline__get_chainhead - description: "This model is used to get the chainhead from the blockchain." - - columns: - - name: BLOCK_NUMBER - tests: - - not_null \ No newline at end of file diff --git a/models/streamline/silver/decoder/decoded_logs/complete/streamline__decoded_logs_complete.sql b/models/streamline/silver/decoder/decoded_logs/complete/streamline__decoded_logs_complete.sql deleted file mode 100644 index 3e805898..00000000 --- a/models/streamline/silver/decoder/decoded_logs/complete/streamline__decoded_logs_complete.sql +++ /dev/null @@ -1,50 +0,0 @@ -{# Set variables #} -{%- set source_name = 'DECODED_LOGS' -%} -{%- set model_type = 'COMPLETE' -%} - -{%- set full_refresh_type = var((source_name ~ '_complete_full_refresh').upper(), false) -%} - -{% set post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(_log_id)" %} - -{# Log configuration details #} -{{ log_model_details() }} - -{# Set up dbt configuration #} --- depends_on: {{ ref('bronze__' ~ source_name.lower()) }} - -{{ config ( - materialized = "incremental", - unique_key = "_log_id", - cluster_by = "ROUND(block_number, -3)", - incremental_predicates = ["dynamic_range", "block_number"], - merge_update_columns = ["_log_id"], - post_hook = post_hook, - full_refresh = full_refresh_type, - tags = ['streamline_decoded_logs_complete'] -) }} - -{# Main query starts here #} -SELECT - block_number, - file_name, - id AS _log_id, - {{ dbt_utils.generate_surrogate_key(['id']) }} AS complete_{{ source_name.lower() }}_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - _inserted_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {% if is_incremental() %} - {{ ref('bronze__' ~ source_name.lower()) }} - WHERE - _inserted_timestamp >= ( - SELECT - COALESCE(MAX(_inserted_timestamp), '1970-01-01'::TIMESTAMP) AS _inserted_timestamp - FROM - {{ this }} - ) - {% else %} - {{ ref('bronze__' ~ source_name.lower() ~ '_fr') }} - {% endif %} - -QUALIFY (ROW_NUMBER() OVER (PARTITION BY id ORDER BY _inserted_timestamp DESC)) = 1 diff --git a/models/streamline/silver/decoder/decoded_logs/realtime/streamline__decoded_logs_realtime.sql b/models/streamline/silver/decoder/decoded_logs/realtime/streamline__decoded_logs_realtime.sql deleted file mode 100644 index a0ff21b9..00000000 --- a/models/streamline/silver/decoder/decoded_logs/realtime/streamline__decoded_logs_realtime.sql +++ /dev/null @@ -1,110 +0,0 @@ -{%- set testing_limit = var('DECODED_LOGS_REALTIME_TESTING_LIMIT', none) -%} - -{%- set streamline_params = { - "external_table": var("DECODED_LOGS_REALTIME_EXTERNAL_TABLE", "decoded_logs"), - "sql_limit": var("DECODED_LOGS_REALTIME_SQL_LIMIT", 10000000), - "producer_batch_size": var("DECODED_LOGS_REALTIME_PRODUCER_BATCH_SIZE", 400000), - "worker_batch_size": var("DECODED_LOGS_REALTIME_WORKER_BATCH_SIZE", 200000), - "sql_source": "decoded_logs_realtime" -} -%} - -{# Log configuration details #} -{{ log_model_details( - params = streamline_params -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = [fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_decode_logs_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = { - "external_table": streamline_params['external_table'], - "sql_limit": streamline_params['sql_limit'], - "producer_batch_size": streamline_params['producer_batch_size'], - "worker_batch_size": streamline_params['worker_batch_size'], - "sql_source": streamline_params['sql_source'] - } - ), - fsc_utils.if_data_call_wait()], - tags = ['streamline_decoded_logs_realtime'] -) }} - -WITH target_blocks AS ( - SELECT - block_number - FROM - {{ ref('core__fact_blocks') }} - WHERE - block_number >= ( - SELECT - block_number - FROM - {{ ref('_24_hour_lookback') }} - ) -), -existing_logs_to_exclude AS ( - SELECT - _log_id - FROM - {{ ref('streamline__decoded_logs_complete') }} - l - INNER JOIN target_blocks b USING (block_number) - WHERE - l.inserted_timestamp :: DATE >= DATEADD('day', -2, SYSDATE()) -), -candidate_logs AS ( - SELECT - l.block_number, - l.tx_hash, - l.event_index, - l.contract_address, - l.topics, - l.data, - CONCAT( - l.tx_hash :: STRING, - '-', - l.event_index :: STRING - ) AS _log_id - FROM - target_blocks b - INNER JOIN {{ ref('core__fact_event_logs') }} - l USING (block_number) - WHERE - l.tx_succeeded - AND l.inserted_timestamp :: DATE >= DATEADD('day', -2, SYSDATE()) -) -SELECT - l.block_number, - l._log_id, - A.abi, - OBJECT_CONSTRUCT( - 'topics', - l.topics, - 'data', - l.data, - 'address', - l.contract_address - ) AS DATA -FROM - candidate_logs l - INNER JOIN {{ ref('silver__complete_event_abis') }} A - ON A.parent_contract_address = l.contract_address - AND A.event_signature = l.topics [0] :: STRING - AND l.block_number BETWEEN A.start_block - AND A.end_block -WHERE - NOT EXISTS ( - SELECT - 1 - FROM - existing_logs_to_exclude e - WHERE - e._log_id = l._log_id - ) - -{% if testing_limit is not none %} - LIMIT - {{ testing_limit }} -{% endif %} \ No newline at end of file diff --git a/models/streamline/silver/reads/curated/streamline__price_api_token_reads.sql b/models/streamline/silver/reads/curated/streamline__price_api_token_reads.sql index d84342e3..21480a48 100644 --- a/models/streamline/silver/reads/curated/streamline__price_api_token_reads.sql +++ b/models/streamline/silver/reads/curated/streamline__price_api_token_reads.sql @@ -23,7 +23,7 @@ missing_contracts AS ( SELECT address AS token_address FROM - {{ ref('silver__contracts') }} + {{ ref('core__dim_contracts') }} WHERE symbol IS NOT NULL AND decimals IS NOT NULL diff --git a/models/streamline/silver/reads/curated/streamline__uni_v3_pool_reads.sql b/models/streamline/silver/reads/curated/streamline__uni_v3_pool_reads.sql index b5c78ebb..e015c2a1 100644 --- a/models/streamline/silver/reads/curated/streamline__uni_v3_pool_reads.sql +++ b/models/streamline/silver/reads/curated/streamline__uni_v3_pool_reads.sql @@ -24,7 +24,7 @@ block_range AS ( -- edit this range to use a different block range from the ephemeral table SELECT block_number_1000 AS block_input, - _inserted_timestamp + modified_timestamp AS _inserted_timestamp FROM {{ ref('_block_ranges') }} diff --git a/package-lock.yml b/package-lock.yml deleted file mode 100644 index d5a9564f..00000000 --- a/package-lock.yml +++ /dev/null @@ -1,18 +0,0 @@ -packages: -- package: calogica/dbt_expectations - version: 0.8.2 -- package: dbt-labs/dbt_external_tables - version: 0.8.2 -- package: dbt-labs/dbt_utils - version: 1.0.0 -- git: https://github.com/FlipsideCrypto/fsc-utils.git - revision: c3ab97e8e06d31e8c6f63819714e0a2d45c45e82 -- git: https://github.com/FlipsideCrypto/fsc-evm.git - revision: 2a41facb272eba867486813d29dad177b913e59f -- package: get-select/dbt_snowflake_query_tags - version: 2.5.0 -- package: calogica/dbt_date - version: 0.7.2 -- git: https://github.com/FlipsideCrypto/livequery-models.git - revision: b024188be4e9c6bc00ed77797ebdc92d351d620e -sha1_hash: 3683c230b43d3e3d45bf55b57becf0ea43cad172 diff --git a/packages.yml b/packages.yml index 44d638c8..c1735f8f 100644 --- a/packages.yml +++ b/packages.yml @@ -1,13 +1,3 @@ packages: - - package: calogica/dbt_expectations - version: 0.8.2 - - package: dbt-labs/dbt_external_tables - version: 0.8.2 - - package: dbt-labs/dbt_utils - version: 1.0.0 - - git: https://github.com/FlipsideCrypto/fsc-utils.git - revision: "v1.31.0" - git: https://github.com/FlipsideCrypto/fsc-evm.git - revision: "v1.6.0" - - package: get-select/dbt_snowflake_query_tags - version: [">=2.0.0", "<3.0.0"] + revision: v4.0.0-beta.78 \ No newline at end of file diff --git a/python/slack_alert.py b/python/slack_alert.py deleted file mode 100644 index 11ad94ad..00000000 --- a/python/slack_alert.py +++ /dev/null @@ -1,74 +0,0 @@ -import requests -import os -import sys - -def create_message(): - """Creates a simple failure notification message with repo, workflow name, and URL""" - - # Get GitHub environment variables - repository = os.environ.get('GITHUB_REPOSITORY', 'Unknown repository') - repo_name = repository.split('/')[-1] if '/' in repository else repository - workflow_name = os.environ.get('GITHUB_WORKFLOW', 'Unknown workflow') - run_id = os.environ.get('GITHUB_RUN_ID', '') - server_url = os.environ.get('GITHUB_SERVER_URL', 'https://github.com') - - # Build the workflow URL - workflow_url = f"{server_url}/{repository}/actions/runs/{run_id}" - - message_body = { - "text": f"Failure in {repo_name}", - "attachments": [ - { - "color": "#f44336", # Red color for failures - "fields": [ - { - "title": "Repository", - "value": repository, - "short": True - }, - { - "title": "Workflow", - "value": workflow_name, - "short": True - } - ], - "actions": [ - { - "type": "button", - "text": "View Workflow Run", - "style": "primary", - "url": workflow_url - } - ], - "footer": "GitHub Actions" - } - ] - } - - return message_body - -def send_alert(webhook_url): - """Sends a failure notification to Slack""" - - message = create_message() - - try: - response = requests.post(webhook_url, json=message) - - if response.status_code == 200: - print("Successfully sent Slack notification") - else: - print(f"Failed to send Slack notification: {response.status_code} {response.text}") - sys.exit(1) - except Exception as e: - print(f"Error sending Slack notification: {str(e)}") - sys.exit(1) - -if __name__ == '__main__': - webhook_url = os.environ.get("SLACK_WEBHOOK_URL") - - if not webhook_url: - print("ERROR: SLACK_WEBHOOK_URL environment variable is required") - sys.exit(1) - - send_alert(webhook_url) \ No newline at end of file diff --git a/tests/ethereum/test_gold__missing_traces.sql b/tests/ethereum/test_gold__missing_traces.sql deleted file mode 100644 index 514d31cf..00000000 --- a/tests/ethereum/test_gold__missing_traces.sql +++ /dev/null @@ -1,2 +0,0 @@ --- depends_on: {{ ref('test_silver__transactions_full') }} -{{ missing_txs(ref("test_gold__fact_traces_full")) }} diff --git a/tests/ethereum/test_gold__recent_missing_traces.sql b/tests/ethereum/test_gold__recent_missing_traces.sql deleted file mode 100644 index 9a571cae..00000000 --- a/tests/ethereum/test_gold__recent_missing_traces.sql +++ /dev/null @@ -1,2 +0,0 @@ --- depends_on: {{ ref('test_silver__transactions_recent') }} -{{ recent_missing_txs(ref("test_gold__fact_traces_recent")) }} diff --git a/tests/ethereum/test_silver__confirmed_blocks.sql b/tests/ethereum/test_silver__confirmed_blocks.sql deleted file mode 100644 index 8cbac8b4..00000000 --- a/tests/ethereum/test_silver__confirmed_blocks.sql +++ /dev/null @@ -1 +0,0 @@ -{{ missing_confirmed_txs(ref("test_silver__confirmed_blocks_full"), ref("test_silver__transactions_full")) }} diff --git a/tests/ethereum/test_silver__missing_receipts.sql b/tests/ethereum/test_silver__missing_receipts.sql deleted file mode 100644 index 8481599b..00000000 --- a/tests/ethereum/test_silver__missing_receipts.sql +++ /dev/null @@ -1,2 +0,0 @@ --- depends_on: {{ ref('test_silver__transactions_full') }} -{{ missing_txs(ref("test_silver__receipts_full")) }} diff --git a/tests/ethereum/test_silver__missing_txs.sql b/tests/ethereum/test_silver__missing_txs.sql deleted file mode 100644 index 6c01a35f..00000000 --- a/tests/ethereum/test_silver__missing_txs.sql +++ /dev/null @@ -1,2 +0,0 @@ --- depends_on: {{ ref('test_silver__blocks_full') }} -{{ fsc_utils.tx_gaps(ref("test_silver__transactions_full")) }} diff --git a/tests/ethereum/test_silver__recent_confirmed_blocks.sql b/tests/ethereum/test_silver__recent_confirmed_blocks.sql deleted file mode 100644 index 79cdd660..00000000 --- a/tests/ethereum/test_silver__recent_confirmed_blocks.sql +++ /dev/null @@ -1 +0,0 @@ -{{ missing_confirmed_txs(ref("test_silver__confirmed_blocks_recent"), ref("test_silver__transactions_recent")) }} diff --git a/tests/ethereum/test_silver__recent_missing_receipts.sql b/tests/ethereum/test_silver__recent_missing_receipts.sql deleted file mode 100644 index f657fd34..00000000 --- a/tests/ethereum/test_silver__recent_missing_receipts.sql +++ /dev/null @@ -1,2 +0,0 @@ --- depends_on: {{ ref('test_silver__transactions_recent') }} -{{ recent_missing_txs(ref("test_silver__receipts_recent")) }} diff --git a/tests/ethereum/test_silver__recent_missing_txs.sql b/tests/ethereum/test_silver__recent_missing_txs.sql deleted file mode 100644 index 985c2500..00000000 --- a/tests/ethereum/test_silver__recent_missing_txs.sql +++ /dev/null @@ -1,2 +0,0 @@ --- depends_on: {{ ref('test_silver__blocks_recent') }} -{{ fsc_utils.recent_tx_gaps(ref("test_silver__transactions_recent")) }}