diff --git a/.github/workflows/commit_manifest.yml b/.github/workflows/commit_manifest.yml index 153383d9e67..137ae8485ce 100644 --- a/.github/workflows/commit_manifest.yml +++ b/.github/workflows/commit_manifest.yml @@ -15,7 +15,7 @@ jobs: runs-on: [ self-hosted, linux, spellbook-trino-ci ] strategy: matrix: - project: [ 'tokens', 'spellbook', 'daily_spellbook', 'nft', 'dex', 'solana'] + project: [ 'tokens', 'spellbook', 'daily_spellbook', 'nft', 'dex', 'solana', 'hourly_spellbook'] max-parallel: 1 steps: @@ -56,4 +56,4 @@ jobs: run: "aws s3 cp $S3_LOCATION/manifest.json $S3_LOCATION/manifest_$GIT_SHA.json" - name: upload manifest - run: "aws s3 cp $PROJECT_DIR/manifest.json $S3_LOCATION/manifest.json" \ No newline at end of file + run: "aws s3 cp $PROJECT_DIR/manifest.json $S3_LOCATION/manifest.json" diff --git a/.github/workflows/hourly_spellbook.yml b/.github/workflows/hourly_spellbook.yml new file mode 100644 index 00000000000..7ea3ecdd80d --- /dev/null +++ b/.github/workflows/hourly_spellbook.yml @@ -0,0 +1,20 @@ +name: DBT Hourly Spellbook run + +on: + workflow_dispatch: + pull_request: + paths: + - hourly_spellbook/** + - .github/workflows/hourly_spellbook.yml + - .github/workflows/dbt_run.yml + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + dbt-run: + uses: ./.github/workflows/dbt_run.yml + with: + project: 'hourly_spellbook' + diff --git a/.github/workflows/prices_check.yml b/.github/workflows/prices_check.yml index 6cb5d1880c0..3d7d4e0e68f 100644 --- a/.github/workflows/prices_check.yml +++ b/.github/workflows/prices_check.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: pull_request: paths: - - 'models/prices/*/*.sql' + - 'tokens/models/prices/*/*.sql' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -30,7 +30,7 @@ jobs: - name: Get prices diff shell: bash run: | - git diff ${{ github.event.pull_request.base.sha}}..${{ github.event.pull_request.head.sha }} models/prices/**/*.sql | grep '^\+ ' > scripts/new_lines.txt + git diff ${{ github.event.pull_request.base.sha}}..${{ github.event.pull_request.head.sha }} tokens/models/prices/**/*.sql | grep '^\+ ' > scripts/new_lines.txt - name: Run validations id: validations diff --git a/.github/workflows/spellbook.yml b/.github/workflows/spellbook.yml index a8b1f62db1f..e626deb4e2c 100644 --- a/.github/workflows/spellbook.yml +++ b/.github/workflows/spellbook.yml @@ -9,6 +9,7 @@ on: - '.gitignore' - 'tokens/**' - 'daily_spellbook/**' + - 'hourly_spellbook/**' - 'nft/**' - 'solana/**' diff --git a/dbt_project.yml b/dbt_project.yml index 3a50f1a66e2..36cb5b63db3 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -65,25 +65,6 @@ models: dex: +schema: dex - cex: - +schema: cex - arbitrum: - +schema: cex_arbitrum - avalanche_c: - +schema: cex_avalanche_c - bnb: - +schema: cex_bnb - ethereum: - +schema: cex_ethereum - optimism: - +schema: cex_optimism - polygon: - +schema: cex_polygon - fantom: - +schema: cex_fantom - bitcoin: - +schema: cex_bitcoin - balances: +schema: balances ethereum: @@ -131,29 +112,6 @@ models: ethereum: +schema: sudoswap_ethereum - safe: - +schema: safe - ethereum: - +schema: safe_ethereum - optimism: - +schema: safe_optimism - gnosis: - +schema: safe_gnosis - polygon: - +schema: safe_polygon - bnb: - +schema: safe_bnb - avalanche_c: - +schema: safe_avalanche_c - fantom: - +schema: safe_fantom - arbitrum: - +schema: safe_arbitrum - goerli: - +schema: safe_goerli - base: - +schema: safe_base - aragon: +schema: aragon ethereum: @@ -221,12 +179,7 @@ models: ethereum: +schema: fiat_dao_ethereum - cow_protocol: - +schema: cow_protocol - ethereum: - +schema: cow_protocol_ethereum - gnosis: - +schema: cow_protocol_gnosis + ironbank: +schema: ironbank @@ -335,17 +288,6 @@ models: ethereum: +schema: dydx_ethereum - lido: - +schema: lido - accounting: - +schema: lido_accounting - ethereum: - +schema: lido_accounting_ethereum - liquidity: - +schema: lido_liquidity - ethereum: - +schema: lido_liquidity_ethereum - layerzero: +schema: layerzero ethereum: diff --git a/hourly_spellbook/README.md b/hourly_spellbook/README.md new file mode 100644 index 00000000000..ae104440a3c --- /dev/null +++ b/hourly_spellbook/README.md @@ -0,0 +1,3 @@ +## Hourly Spellbook + +This is a DBT sub project for the all hourly models in spellbook diff --git a/hourly_spellbook/dbt_project.yml b/hourly_spellbook/dbt_project.yml new file mode 100644 index 00000000000..a2dcc760508 --- /dev/null +++ b/hourly_spellbook/dbt_project.yml @@ -0,0 +1,100 @@ +#Welcome to the NFT Spellbook! + +name: "hourly_spellbook" +version: "1.0.0" +config-version: 2 + +quoting: + database: false + schema: false + identifier: false + +# This setting configures which "profile" dbt uses for this project. +# profile: "spellbook-poc-tokens" +profile: "spellbook-local" + +vars: + DBT_ENV_CUSTOM_ENV_S3_BUCKET: "{{ env_var('DBT_ENV_CUSTOM_ENV_S3_BUCKET', 'local') }}" + DBT_ENV_INCREMENTAL_TIME: "{{ env_var('DBT_ENV_INCREMENTAL_TIME', '1') }}" + DBT_ENV_INCREMENTAL_TIME_UNIT: "{{ env_var('DBT_ENV_INCREMENTAL_TIME_UNIT', 'day') }}" + ETH_ERC20_ADDRESS: '0x0000000000000000000000000000000000000000' + +# These configurations specify where dbt should look for different types of files. +# You don't need to change these! +model-paths: ["models", "../sources"] +# ../tests/* should be added to a separate shared folder +test-paths: ["tests"] +seed-paths: ["seeds"] +macro-paths: ["../macros", "macros"] + +target-path: "target" # directory which will store compiled SQL files +clean-targets: # directories to be removed by `dbt clean` + - "target" + - "dbt_packages" + +# Configuring tests +# Full documentation: https://docs.getdbt.com/reference/test-configs +tests: + hourly_spellbook: + +store_failures: true # store failures for all tests + +# Configuring seeds +# Full documentation: https://docs.getdbt.com/reference/seed-configs +# For configuring individual seeds (e.g. overriding column types) we recommend a yml file nested in the same folder as the seed +# example: seeds/cryptopunks/schema.yml +seeds: + hourly_spellbook: + +schema: test_data + +# defining search order of macro invokation +dispatch: + - macro_namespace: dbt_utils + search_order: ['trino_utils', 'dbt_utils'] + +# Configuring models +# Full documentation: https://docs.getdbt.com/docs/configuring-models +models: + hourly_spellbook: + +post-hook: + - sql: "{{ set_trino_session_property(is_materialized(model), 'writer_scaling_min_data_processed', model.config.get('writer_min_size', '500MB')) }}" + transaction: true + - sql: "{{ set_trino_session_property(is_materialized(model), 'task_scale_writers_enabled', false) }}" + transaction: true + - sql: "{{ optimize_spell(this, model.config.materialized) }}" + transaction: true + - sql: "{{ mark_as_spell(this, model.config.materialized) }}" + transaction: true + +materialized: view + +schema: no_schema # this should be overriden in model specific configs + +view_security: invoker + + _project: + safe: + +schema: safe + ethereum: + +schema: safe_ethereum + optimism: + +schema: safe_optimism + gnosis: + +schema: safe_gnosis + polygon: + +schema: safe_polygon + bnb: + +schema: safe_bnb + avalanche_c: + +schema: safe_avalanche_c + fantom: + +schema: safe_fantom + arbitrum: + +schema: safe_arbitrum + goerli: + +schema: safe_goerli + base: + +schema: safe_base + cow_protocol: + +schema: cow_protocol + ethereum: + +schema: cow_protocol_ethereum + gnosis: + +schema: cow_protocol_gnosis + diff --git a/models/_project/balancer/balances/_schema.yml b/hourly_spellbook/models/_project/balancer/balances/_schema.yml similarity index 100% rename from models/_project/balancer/balances/_schema.yml rename to hourly_spellbook/models/_project/balancer/balances/_schema.yml diff --git a/models/_project/balancer/balances/arbitrum/_schema.yml b/hourly_spellbook/models/_project/balancer/balances/arbitrum/_schema.yml similarity index 100% rename from models/_project/balancer/balances/arbitrum/_schema.yml rename to hourly_spellbook/models/_project/balancer/balances/arbitrum/_schema.yml diff --git a/models/_project/balancer/balances/arbitrum/balancer_v2_arbitrum_token_balance_changes.sql b/hourly_spellbook/models/_project/balancer/balances/arbitrum/balancer_v2_arbitrum_token_balance_changes.sql similarity index 100% rename from models/_project/balancer/balances/arbitrum/balancer_v2_arbitrum_token_balance_changes.sql rename to hourly_spellbook/models/_project/balancer/balances/arbitrum/balancer_v2_arbitrum_token_balance_changes.sql diff --git a/models/_project/balancer/balances/arbitrum/balancer_v2_arbitrum_token_balance_changes_daily.sql b/hourly_spellbook/models/_project/balancer/balances/arbitrum/balancer_v2_arbitrum_token_balance_changes_daily.sql similarity index 100% rename from models/_project/balancer/balances/arbitrum/balancer_v2_arbitrum_token_balance_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/balances/arbitrum/balancer_v2_arbitrum_token_balance_changes_daily.sql diff --git a/models/_project/balancer/balances/avalanche_c/_schema.yml b/hourly_spellbook/models/_project/balancer/balances/avalanche_c/_schema.yml similarity index 100% rename from models/_project/balancer/balances/avalanche_c/_schema.yml rename to hourly_spellbook/models/_project/balancer/balances/avalanche_c/_schema.yml diff --git a/models/_project/balancer/balances/avalanche_c/balancer_v2_avalanche_c_token_balance_changes.sql b/hourly_spellbook/models/_project/balancer/balances/avalanche_c/balancer_v2_avalanche_c_token_balance_changes.sql similarity index 100% rename from models/_project/balancer/balances/avalanche_c/balancer_v2_avalanche_c_token_balance_changes.sql rename to hourly_spellbook/models/_project/balancer/balances/avalanche_c/balancer_v2_avalanche_c_token_balance_changes.sql diff --git a/models/_project/balancer/balances/avalanche_c/balancer_v2_avalanche_c_token_balance_changes_daily.sql b/hourly_spellbook/models/_project/balancer/balances/avalanche_c/balancer_v2_avalanche_c_token_balance_changes_daily.sql similarity index 100% rename from models/_project/balancer/balances/avalanche_c/balancer_v2_avalanche_c_token_balance_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/balances/avalanche_c/balancer_v2_avalanche_c_token_balance_changes_daily.sql diff --git a/models/_project/balancer/balances/balancer_token_balance_changes.sql b/hourly_spellbook/models/_project/balancer/balances/balancer_token_balance_changes.sql similarity index 100% rename from models/_project/balancer/balances/balancer_token_balance_changes.sql rename to hourly_spellbook/models/_project/balancer/balances/balancer_token_balance_changes.sql diff --git a/models/_project/balancer/balances/balancer_token_balance_changes_daily.sql b/hourly_spellbook/models/_project/balancer/balances/balancer_token_balance_changes_daily.sql similarity index 100% rename from models/_project/balancer/balances/balancer_token_balance_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/balances/balancer_token_balance_changes_daily.sql diff --git a/models/_project/balancer/balances/base/_schema.yml b/hourly_spellbook/models/_project/balancer/balances/base/_schema.yml similarity index 100% rename from models/_project/balancer/balances/base/_schema.yml rename to hourly_spellbook/models/_project/balancer/balances/base/_schema.yml diff --git a/models/_project/balancer/balances/base/balancer_v2_base_token_balance_changes.sql b/hourly_spellbook/models/_project/balancer/balances/base/balancer_v2_base_token_balance_changes.sql similarity index 100% rename from models/_project/balancer/balances/base/balancer_v2_base_token_balance_changes.sql rename to hourly_spellbook/models/_project/balancer/balances/base/balancer_v2_base_token_balance_changes.sql diff --git a/models/_project/balancer/balances/base/balancer_v2_base_token_balance_changes_daily.sql b/hourly_spellbook/models/_project/balancer/balances/base/balancer_v2_base_token_balance_changes_daily.sql similarity index 100% rename from models/_project/balancer/balances/base/balancer_v2_base_token_balance_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/balances/base/balancer_v2_base_token_balance_changes_daily.sql diff --git a/models/_project/balancer/balances/ethereum/_schema.yml b/hourly_spellbook/models/_project/balancer/balances/ethereum/_schema.yml similarity index 100% rename from models/_project/balancer/balances/ethereum/_schema.yml rename to hourly_spellbook/models/_project/balancer/balances/ethereum/_schema.yml diff --git a/models/_project/balancer/balances/ethereum/balancer_ethereum_balances.sql b/hourly_spellbook/models/_project/balancer/balances/ethereum/balancer_ethereum_balances.sql similarity index 100% rename from models/_project/balancer/balances/ethereum/balancer_ethereum_balances.sql rename to hourly_spellbook/models/_project/balancer/balances/ethereum/balancer_ethereum_balances.sql diff --git a/models/_project/balancer/balances/ethereum/balancer_v2_ethereum_token_balance_changes.sql b/hourly_spellbook/models/_project/balancer/balances/ethereum/balancer_v2_ethereum_token_balance_changes.sql similarity index 100% rename from models/_project/balancer/balances/ethereum/balancer_v2_ethereum_token_balance_changes.sql rename to hourly_spellbook/models/_project/balancer/balances/ethereum/balancer_v2_ethereum_token_balance_changes.sql diff --git a/models/_project/balancer/balances/ethereum/balancer_v2_ethereum_token_balance_changes_daily.sql b/hourly_spellbook/models/_project/balancer/balances/ethereum/balancer_v2_ethereum_token_balance_changes_daily.sql similarity index 100% rename from models/_project/balancer/balances/ethereum/balancer_v2_ethereum_token_balance_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/balances/ethereum/balancer_v2_ethereum_token_balance_changes_daily.sql diff --git a/models/_project/balancer/balances/gnosis/_schema.yml b/hourly_spellbook/models/_project/balancer/balances/gnosis/_schema.yml similarity index 100% rename from models/_project/balancer/balances/gnosis/_schema.yml rename to hourly_spellbook/models/_project/balancer/balances/gnosis/_schema.yml diff --git a/models/_project/balancer/balances/gnosis/balancer_v2_gnosis_token_balance_changes.sql b/hourly_spellbook/models/_project/balancer/balances/gnosis/balancer_v2_gnosis_token_balance_changes.sql similarity index 100% rename from models/_project/balancer/balances/gnosis/balancer_v2_gnosis_token_balance_changes.sql rename to hourly_spellbook/models/_project/balancer/balances/gnosis/balancer_v2_gnosis_token_balance_changes.sql diff --git a/models/_project/balancer/balances/gnosis/balancer_v2_gnosis_token_balance_changes_daily.sql b/hourly_spellbook/models/_project/balancer/balances/gnosis/balancer_v2_gnosis_token_balance_changes_daily.sql similarity index 100% rename from models/_project/balancer/balances/gnosis/balancer_v2_gnosis_token_balance_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/balances/gnosis/balancer_v2_gnosis_token_balance_changes_daily.sql diff --git a/models/_project/balancer/balances/optimism/_schema.yml b/hourly_spellbook/models/_project/balancer/balances/optimism/_schema.yml similarity index 100% rename from models/_project/balancer/balances/optimism/_schema.yml rename to hourly_spellbook/models/_project/balancer/balances/optimism/_schema.yml diff --git a/models/_project/balancer/balances/optimism/balancer_v2_optimism_token_balance_changes.sql b/hourly_spellbook/models/_project/balancer/balances/optimism/balancer_v2_optimism_token_balance_changes.sql similarity index 100% rename from models/_project/balancer/balances/optimism/balancer_v2_optimism_token_balance_changes.sql rename to hourly_spellbook/models/_project/balancer/balances/optimism/balancer_v2_optimism_token_balance_changes.sql diff --git a/models/_project/balancer/balances/optimism/balancer_v2_optimism_token_balance_changes_daily.sql b/hourly_spellbook/models/_project/balancer/balances/optimism/balancer_v2_optimism_token_balance_changes_daily.sql similarity index 100% rename from models/_project/balancer/balances/optimism/balancer_v2_optimism_token_balance_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/balances/optimism/balancer_v2_optimism_token_balance_changes_daily.sql diff --git a/models/_project/balancer/balances/polygon/_schema.yml b/hourly_spellbook/models/_project/balancer/balances/polygon/_schema.yml similarity index 100% rename from models/_project/balancer/balances/polygon/_schema.yml rename to hourly_spellbook/models/_project/balancer/balances/polygon/_schema.yml diff --git a/models/_project/balancer/balances/polygon/balancer_v2_polygon_token_balance_changes.sql b/hourly_spellbook/models/_project/balancer/balances/polygon/balancer_v2_polygon_token_balance_changes.sql similarity index 100% rename from models/_project/balancer/balances/polygon/balancer_v2_polygon_token_balance_changes.sql rename to hourly_spellbook/models/_project/balancer/balances/polygon/balancer_v2_polygon_token_balance_changes.sql diff --git a/models/_project/balancer/balances/polygon/balancer_v2_polygon_token_balance_changes_daily.sql b/hourly_spellbook/models/_project/balancer/balances/polygon/balancer_v2_polygon_token_balance_changes_daily.sql similarity index 100% rename from models/_project/balancer/balances/polygon/balancer_v2_polygon_token_balance_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/balances/polygon/balancer_v2_polygon_token_balance_changes_daily.sql diff --git a/models/_project/balancer/balances/zkevm/_schema.yml b/hourly_spellbook/models/_project/balancer/balances/zkevm/_schema.yml similarity index 100% rename from models/_project/balancer/balances/zkevm/_schema.yml rename to hourly_spellbook/models/_project/balancer/balances/zkevm/_schema.yml diff --git a/models/_project/balancer/balances/zkevm/balancer_v2_zkevm_token_balance_changes.sql b/hourly_spellbook/models/_project/balancer/balances/zkevm/balancer_v2_zkevm_token_balance_changes.sql similarity index 100% rename from models/_project/balancer/balances/zkevm/balancer_v2_zkevm_token_balance_changes.sql rename to hourly_spellbook/models/_project/balancer/balances/zkevm/balancer_v2_zkevm_token_balance_changes.sql diff --git a/models/_project/balancer/balances/zkevm/balancer_v2_zkevm_token_balance_changes_daily.sql b/hourly_spellbook/models/_project/balancer/balances/zkevm/balancer_v2_zkevm_token_balance_changes_daily.sql similarity index 100% rename from models/_project/balancer/balances/zkevm/balancer_v2_zkevm_token_balance_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/balances/zkevm/balancer_v2_zkevm_token_balance_changes_daily.sql diff --git a/models/_project/balancer/bpt/_schema.yml b/hourly_spellbook/models/_project/balancer/bpt/_schema.yml similarity index 100% rename from models/_project/balancer/bpt/_schema.yml rename to hourly_spellbook/models/_project/balancer/bpt/_schema.yml diff --git a/models/_project/balancer/bpt/arbitrum/_schema.yml b/hourly_spellbook/models/_project/balancer/bpt/arbitrum/_schema.yml similarity index 100% rename from models/_project/balancer/bpt/arbitrum/_schema.yml rename to hourly_spellbook/models/_project/balancer/bpt/arbitrum/_schema.yml diff --git a/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_prices.sql b/hourly_spellbook/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_prices.sql similarity index 100% rename from models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_prices.sql rename to hourly_spellbook/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_prices.sql diff --git a/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_supply.sql b/hourly_spellbook/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_supply.sql similarity index 100% rename from models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_supply.sql rename to hourly_spellbook/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_supply.sql diff --git a/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_supply_changes.sql b/hourly_spellbook/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_supply_changes.sql similarity index 100% rename from models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_supply_changes.sql rename to hourly_spellbook/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_supply_changes.sql diff --git a/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_supply_changes_daily.sql b/hourly_spellbook/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_supply_changes_daily.sql similarity index 100% rename from models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_supply_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_bpt_supply_changes_daily.sql diff --git a/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_transfers_bpt.sql b/hourly_spellbook/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_transfers_bpt.sql similarity index 100% rename from models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_transfers_bpt.sql rename to hourly_spellbook/models/_project/balancer/bpt/arbitrum/balancer_v2_arbitrum_transfers_bpt.sql diff --git a/models/_project/balancer/bpt/avalanche_c/_schema.yml b/hourly_spellbook/models/_project/balancer/bpt/avalanche_c/_schema.yml similarity index 100% rename from models/_project/balancer/bpt/avalanche_c/_schema.yml rename to hourly_spellbook/models/_project/balancer/bpt/avalanche_c/_schema.yml diff --git a/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_prices.sql b/hourly_spellbook/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_prices.sql similarity index 100% rename from models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_prices.sql rename to hourly_spellbook/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_prices.sql diff --git a/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_supply.sql b/hourly_spellbook/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_supply.sql similarity index 100% rename from models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_supply.sql rename to hourly_spellbook/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_supply.sql diff --git a/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_supply_changes.sql b/hourly_spellbook/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_supply_changes.sql similarity index 100% rename from models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_supply_changes.sql rename to hourly_spellbook/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_supply_changes.sql diff --git a/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_supply_changes_daily.sql b/hourly_spellbook/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_supply_changes_daily.sql similarity index 100% rename from models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_supply_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_bpt_supply_changes_daily.sql diff --git a/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_transfers_bpt.sql b/hourly_spellbook/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_transfers_bpt.sql similarity index 100% rename from models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_transfers_bpt.sql rename to hourly_spellbook/models/_project/balancer/bpt/avalanche_c/balancer_v2_avalanche_c_transfers_bpt.sql diff --git a/models/_project/balancer/bpt/balancer_bpt_prices.sql b/hourly_spellbook/models/_project/balancer/bpt/balancer_bpt_prices.sql similarity index 100% rename from models/_project/balancer/bpt/balancer_bpt_prices.sql rename to hourly_spellbook/models/_project/balancer/bpt/balancer_bpt_prices.sql diff --git a/models/_project/balancer/bpt/balancer_bpt_supply.sql b/hourly_spellbook/models/_project/balancer/bpt/balancer_bpt_supply.sql similarity index 100% rename from models/_project/balancer/bpt/balancer_bpt_supply.sql rename to hourly_spellbook/models/_project/balancer/bpt/balancer_bpt_supply.sql diff --git a/models/_project/balancer/bpt/balancer_bpt_supply_changes.sql b/hourly_spellbook/models/_project/balancer/bpt/balancer_bpt_supply_changes.sql similarity index 100% rename from models/_project/balancer/bpt/balancer_bpt_supply_changes.sql rename to hourly_spellbook/models/_project/balancer/bpt/balancer_bpt_supply_changes.sql diff --git a/models/_project/balancer/bpt/balancer_bpt_supply_changes_daily.sql b/hourly_spellbook/models/_project/balancer/bpt/balancer_bpt_supply_changes_daily.sql similarity index 100% rename from models/_project/balancer/bpt/balancer_bpt_supply_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/bpt/balancer_bpt_supply_changes_daily.sql diff --git a/models/_project/balancer/bpt/balancer_transfers_bpt.sql b/hourly_spellbook/models/_project/balancer/bpt/balancer_transfers_bpt.sql similarity index 100% rename from models/_project/balancer/bpt/balancer_transfers_bpt.sql rename to hourly_spellbook/models/_project/balancer/bpt/balancer_transfers_bpt.sql diff --git a/models/_project/balancer/bpt/base/_schema.yml b/hourly_spellbook/models/_project/balancer/bpt/base/_schema.yml similarity index 100% rename from models/_project/balancer/bpt/base/_schema.yml rename to hourly_spellbook/models/_project/balancer/bpt/base/_schema.yml diff --git a/models/_project/balancer/bpt/base/balancer_v2_base_bpt_prices.sql b/hourly_spellbook/models/_project/balancer/bpt/base/balancer_v2_base_bpt_prices.sql similarity index 100% rename from models/_project/balancer/bpt/base/balancer_v2_base_bpt_prices.sql rename to hourly_spellbook/models/_project/balancer/bpt/base/balancer_v2_base_bpt_prices.sql diff --git a/models/_project/balancer/bpt/base/balancer_v2_base_bpt_supply.sql b/hourly_spellbook/models/_project/balancer/bpt/base/balancer_v2_base_bpt_supply.sql similarity index 100% rename from models/_project/balancer/bpt/base/balancer_v2_base_bpt_supply.sql rename to hourly_spellbook/models/_project/balancer/bpt/base/balancer_v2_base_bpt_supply.sql diff --git a/models/_project/balancer/bpt/base/balancer_v2_base_bpt_supply_changes.sql b/hourly_spellbook/models/_project/balancer/bpt/base/balancer_v2_base_bpt_supply_changes.sql similarity index 100% rename from models/_project/balancer/bpt/base/balancer_v2_base_bpt_supply_changes.sql rename to hourly_spellbook/models/_project/balancer/bpt/base/balancer_v2_base_bpt_supply_changes.sql diff --git a/models/_project/balancer/bpt/base/balancer_v2_base_bpt_supply_changes_daily.sql b/hourly_spellbook/models/_project/balancer/bpt/base/balancer_v2_base_bpt_supply_changes_daily.sql similarity index 100% rename from models/_project/balancer/bpt/base/balancer_v2_base_bpt_supply_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/bpt/base/balancer_v2_base_bpt_supply_changes_daily.sql diff --git a/models/_project/balancer/bpt/base/balancer_v2_base_transfers_bpt.sql b/hourly_spellbook/models/_project/balancer/bpt/base/balancer_v2_base_transfers_bpt.sql similarity index 100% rename from models/_project/balancer/bpt/base/balancer_v2_base_transfers_bpt.sql rename to hourly_spellbook/models/_project/balancer/bpt/base/balancer_v2_base_transfers_bpt.sql diff --git a/models/_project/balancer/bpt/ethereum/_schema.yml b/hourly_spellbook/models/_project/balancer/bpt/ethereum/_schema.yml similarity index 100% rename from models/_project/balancer/bpt/ethereum/_schema.yml rename to hourly_spellbook/models/_project/balancer/bpt/ethereum/_schema.yml diff --git a/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_prices.sql b/hourly_spellbook/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_prices.sql similarity index 100% rename from models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_prices.sql rename to hourly_spellbook/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_prices.sql diff --git a/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_supply.sql b/hourly_spellbook/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_supply.sql similarity index 100% rename from models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_supply.sql rename to hourly_spellbook/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_supply.sql diff --git a/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_supply_changes.sql b/hourly_spellbook/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_supply_changes.sql similarity index 100% rename from models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_supply_changes.sql rename to hourly_spellbook/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_supply_changes.sql diff --git a/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_supply_changes_daily.sql b/hourly_spellbook/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_supply_changes_daily.sql similarity index 100% rename from models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_supply_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_bpt_supply_changes_daily.sql diff --git a/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_transfers_bpt.sql b/hourly_spellbook/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_transfers_bpt.sql similarity index 100% rename from models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_transfers_bpt.sql rename to hourly_spellbook/models/_project/balancer/bpt/ethereum/balancer_v2_ethereum_transfers_bpt.sql diff --git a/models/_project/balancer/bpt/gnosis/_schema.yml b/hourly_spellbook/models/_project/balancer/bpt/gnosis/_schema.yml similarity index 100% rename from models/_project/balancer/bpt/gnosis/_schema.yml rename to hourly_spellbook/models/_project/balancer/bpt/gnosis/_schema.yml diff --git a/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_prices.sql b/hourly_spellbook/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_prices.sql similarity index 100% rename from models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_prices.sql rename to hourly_spellbook/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_prices.sql diff --git a/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_supply.sql b/hourly_spellbook/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_supply.sql similarity index 100% rename from models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_supply.sql rename to hourly_spellbook/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_supply.sql diff --git a/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_supply_changes.sql b/hourly_spellbook/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_supply_changes.sql similarity index 100% rename from models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_supply_changes.sql rename to hourly_spellbook/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_supply_changes.sql diff --git a/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_supply_changes_daily.sql b/hourly_spellbook/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_supply_changes_daily.sql similarity index 100% rename from models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_supply_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_bpt_supply_changes_daily.sql diff --git a/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_transfers_bpt.sql b/hourly_spellbook/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_transfers_bpt.sql similarity index 100% rename from models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_transfers_bpt.sql rename to hourly_spellbook/models/_project/balancer/bpt/gnosis/balancer_v2_gnosis_transfers_bpt.sql diff --git a/models/_project/balancer/bpt/optimism/_schema.yml b/hourly_spellbook/models/_project/balancer/bpt/optimism/_schema.yml similarity index 100% rename from models/_project/balancer/bpt/optimism/_schema.yml rename to hourly_spellbook/models/_project/balancer/bpt/optimism/_schema.yml diff --git a/models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_prices.sql b/hourly_spellbook/models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_prices.sql similarity index 100% rename from models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_prices.sql rename to hourly_spellbook/models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_prices.sql diff --git a/models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_supply.sql b/hourly_spellbook/models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_supply.sql similarity index 100% rename from models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_supply.sql rename to hourly_spellbook/models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_supply.sql diff --git a/models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_supply_changes.sql b/hourly_spellbook/models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_supply_changes.sql similarity index 100% rename from models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_supply_changes.sql rename to hourly_spellbook/models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_supply_changes.sql diff --git a/models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_supply_changes_daily.sql b/hourly_spellbook/models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_supply_changes_daily.sql similarity index 100% rename from models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_supply_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/bpt/optimism/balancer_v2_optimism_bpt_supply_changes_daily.sql diff --git a/models/_project/balancer/bpt/optimism/balancer_v2_optimism_transfers_bpt.sql b/hourly_spellbook/models/_project/balancer/bpt/optimism/balancer_v2_optimism_transfers_bpt.sql similarity index 100% rename from models/_project/balancer/bpt/optimism/balancer_v2_optimism_transfers_bpt.sql rename to hourly_spellbook/models/_project/balancer/bpt/optimism/balancer_v2_optimism_transfers_bpt.sql diff --git a/models/_project/balancer/bpt/polygon/_schema.yml b/hourly_spellbook/models/_project/balancer/bpt/polygon/_schema.yml similarity index 100% rename from models/_project/balancer/bpt/polygon/_schema.yml rename to hourly_spellbook/models/_project/balancer/bpt/polygon/_schema.yml diff --git a/models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_prices.sql b/hourly_spellbook/models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_prices.sql similarity index 100% rename from models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_prices.sql rename to hourly_spellbook/models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_prices.sql diff --git a/models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_supply.sql b/hourly_spellbook/models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_supply.sql similarity index 100% rename from models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_supply.sql rename to hourly_spellbook/models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_supply.sql diff --git a/models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_supply_changes.sql b/hourly_spellbook/models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_supply_changes.sql similarity index 100% rename from models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_supply_changes.sql rename to hourly_spellbook/models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_supply_changes.sql diff --git a/models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_supply_changes_daily.sql b/hourly_spellbook/models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_supply_changes_daily.sql similarity index 100% rename from models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_supply_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/bpt/polygon/balancer_v2_polygon_bpt_supply_changes_daily.sql diff --git a/models/_project/balancer/bpt/polygon/balancer_v2_polygon_transfers_bpt.sql b/hourly_spellbook/models/_project/balancer/bpt/polygon/balancer_v2_polygon_transfers_bpt.sql similarity index 100% rename from models/_project/balancer/bpt/polygon/balancer_v2_polygon_transfers_bpt.sql rename to hourly_spellbook/models/_project/balancer/bpt/polygon/balancer_v2_polygon_transfers_bpt.sql diff --git a/models/_project/balancer/bpt/zkevm/_schema.yml b/hourly_spellbook/models/_project/balancer/bpt/zkevm/_schema.yml similarity index 100% rename from models/_project/balancer/bpt/zkevm/_schema.yml rename to hourly_spellbook/models/_project/balancer/bpt/zkevm/_schema.yml diff --git a/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_prices.sql b/hourly_spellbook/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_prices.sql similarity index 100% rename from models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_prices.sql rename to hourly_spellbook/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_prices.sql diff --git a/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_supply.sql b/hourly_spellbook/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_supply.sql similarity index 100% rename from models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_supply.sql rename to hourly_spellbook/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_supply.sql diff --git a/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_supply_changes.sql b/hourly_spellbook/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_supply_changes.sql similarity index 100% rename from models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_supply_changes.sql rename to hourly_spellbook/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_supply_changes.sql diff --git a/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_supply_changes_daily.sql b/hourly_spellbook/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_supply_changes_daily.sql similarity index 100% rename from models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_supply_changes_daily.sql rename to hourly_spellbook/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_bpt_supply_changes_daily.sql diff --git a/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_transfers_bpt.sql b/hourly_spellbook/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_transfers_bpt.sql similarity index 100% rename from models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_transfers_bpt.sql rename to hourly_spellbook/models/_project/balancer/bpt/zkevm/balancer_v2_zkevm_transfers_bpt.sql diff --git a/models/_project/balancer/flashloans/_schema.yml b/hourly_spellbook/models/_project/balancer/flashloans/_schema.yml similarity index 100% rename from models/_project/balancer/flashloans/_schema.yml rename to hourly_spellbook/models/_project/balancer/flashloans/_schema.yml diff --git a/models/_project/balancer/flashloans/arbitrum/_schema.yml b/hourly_spellbook/models/_project/balancer/flashloans/arbitrum/_schema.yml similarity index 100% rename from models/_project/balancer/flashloans/arbitrum/_schema.yml rename to hourly_spellbook/models/_project/balancer/flashloans/arbitrum/_schema.yml diff --git a/models/_project/balancer/flashloans/arbitrum/balancer_v2_arbitrum_flashloans.sql b/hourly_spellbook/models/_project/balancer/flashloans/arbitrum/balancer_v2_arbitrum_flashloans.sql similarity index 100% rename from models/_project/balancer/flashloans/arbitrum/balancer_v2_arbitrum_flashloans.sql rename to hourly_spellbook/models/_project/balancer/flashloans/arbitrum/balancer_v2_arbitrum_flashloans.sql diff --git a/models/_project/balancer/flashloans/avalanche_c/_schema.yml b/hourly_spellbook/models/_project/balancer/flashloans/avalanche_c/_schema.yml similarity index 100% rename from models/_project/balancer/flashloans/avalanche_c/_schema.yml rename to hourly_spellbook/models/_project/balancer/flashloans/avalanche_c/_schema.yml diff --git a/models/_project/balancer/flashloans/avalanche_c/balancer_v2_avalanche_c_flashloans.sql b/hourly_spellbook/models/_project/balancer/flashloans/avalanche_c/balancer_v2_avalanche_c_flashloans.sql similarity index 100% rename from models/_project/balancer/flashloans/avalanche_c/balancer_v2_avalanche_c_flashloans.sql rename to hourly_spellbook/models/_project/balancer/flashloans/avalanche_c/balancer_v2_avalanche_c_flashloans.sql diff --git a/models/_project/balancer/flashloans/balancer_flashloans.sql b/hourly_spellbook/models/_project/balancer/flashloans/balancer_flashloans.sql similarity index 100% rename from models/_project/balancer/flashloans/balancer_flashloans.sql rename to hourly_spellbook/models/_project/balancer/flashloans/balancer_flashloans.sql diff --git a/models/_project/balancer/flashloans/base/_schema.yml b/hourly_spellbook/models/_project/balancer/flashloans/base/_schema.yml similarity index 100% rename from models/_project/balancer/flashloans/base/_schema.yml rename to hourly_spellbook/models/_project/balancer/flashloans/base/_schema.yml diff --git a/models/_project/balancer/flashloans/base/balancer_v2_base_flashloans.sql b/hourly_spellbook/models/_project/balancer/flashloans/base/balancer_v2_base_flashloans.sql similarity index 100% rename from models/_project/balancer/flashloans/base/balancer_v2_base_flashloans.sql rename to hourly_spellbook/models/_project/balancer/flashloans/base/balancer_v2_base_flashloans.sql diff --git a/models/_project/balancer/flashloans/ethereum/_schema.yml b/hourly_spellbook/models/_project/balancer/flashloans/ethereum/_schema.yml similarity index 100% rename from models/_project/balancer/flashloans/ethereum/_schema.yml rename to hourly_spellbook/models/_project/balancer/flashloans/ethereum/_schema.yml diff --git a/models/_project/balancer/flashloans/ethereum/balancer_v2_ethereum_flashloans.sql b/hourly_spellbook/models/_project/balancer/flashloans/ethereum/balancer_v2_ethereum_flashloans.sql similarity index 100% rename from models/_project/balancer/flashloans/ethereum/balancer_v2_ethereum_flashloans.sql rename to hourly_spellbook/models/_project/balancer/flashloans/ethereum/balancer_v2_ethereum_flashloans.sql diff --git a/models/_project/balancer/flashloans/gnosis/_schema.yml b/hourly_spellbook/models/_project/balancer/flashloans/gnosis/_schema.yml similarity index 100% rename from models/_project/balancer/flashloans/gnosis/_schema.yml rename to hourly_spellbook/models/_project/balancer/flashloans/gnosis/_schema.yml diff --git a/models/_project/balancer/flashloans/gnosis/balancer_v2_gnosis_flashloans.sql b/hourly_spellbook/models/_project/balancer/flashloans/gnosis/balancer_v2_gnosis_flashloans.sql similarity index 100% rename from models/_project/balancer/flashloans/gnosis/balancer_v2_gnosis_flashloans.sql rename to hourly_spellbook/models/_project/balancer/flashloans/gnosis/balancer_v2_gnosis_flashloans.sql diff --git a/models/_project/balancer/flashloans/optimism/_schema.yml b/hourly_spellbook/models/_project/balancer/flashloans/optimism/_schema.yml similarity index 100% rename from models/_project/balancer/flashloans/optimism/_schema.yml rename to hourly_spellbook/models/_project/balancer/flashloans/optimism/_schema.yml diff --git a/models/_project/balancer/flashloans/optimism/balancer_v2_optimism_flashloans.sql b/hourly_spellbook/models/_project/balancer/flashloans/optimism/balancer_v2_optimism_flashloans.sql similarity index 100% rename from models/_project/balancer/flashloans/optimism/balancer_v2_optimism_flashloans.sql rename to hourly_spellbook/models/_project/balancer/flashloans/optimism/balancer_v2_optimism_flashloans.sql diff --git a/models/_project/balancer/flashloans/polygon/_schema.yml b/hourly_spellbook/models/_project/balancer/flashloans/polygon/_schema.yml similarity index 100% rename from models/_project/balancer/flashloans/polygon/_schema.yml rename to hourly_spellbook/models/_project/balancer/flashloans/polygon/_schema.yml diff --git a/models/_project/balancer/flashloans/polygon/balancer_v2_polygon_flashloans.sql b/hourly_spellbook/models/_project/balancer/flashloans/polygon/balancer_v2_polygon_flashloans.sql similarity index 100% rename from models/_project/balancer/flashloans/polygon/balancer_v2_polygon_flashloans.sql rename to hourly_spellbook/models/_project/balancer/flashloans/polygon/balancer_v2_polygon_flashloans.sql diff --git a/models/_project/balancer/flashloans/zkevm/_schema.yml b/hourly_spellbook/models/_project/balancer/flashloans/zkevm/_schema.yml similarity index 100% rename from models/_project/balancer/flashloans/zkevm/_schema.yml rename to hourly_spellbook/models/_project/balancer/flashloans/zkevm/_schema.yml diff --git a/models/_project/balancer/flashloans/zkevm/balancer_v2_zkevm_flashloans.sql b/hourly_spellbook/models/_project/balancer/flashloans/zkevm/balancer_v2_zkevm_flashloans.sql similarity index 100% rename from models/_project/balancer/flashloans/zkevm/balancer_v2_zkevm_flashloans.sql rename to hourly_spellbook/models/_project/balancer/flashloans/zkevm/balancer_v2_zkevm_flashloans.sql diff --git a/models/_project/balancer/liquidity/_schema.yml b/hourly_spellbook/models/_project/balancer/liquidity/_schema.yml similarity index 100% rename from models/_project/balancer/liquidity/_schema.yml rename to hourly_spellbook/models/_project/balancer/liquidity/_schema.yml diff --git a/models/_project/balancer/liquidity/arbitrum/_schema.yml b/hourly_spellbook/models/_project/balancer/liquidity/arbitrum/_schema.yml similarity index 100% rename from models/_project/balancer/liquidity/arbitrum/_schema.yml rename to hourly_spellbook/models/_project/balancer/liquidity/arbitrum/_schema.yml diff --git a/models/_project/balancer/liquidity/arbitrum/balancer_v2_arbitrum_liquidity.sql b/hourly_spellbook/models/_project/balancer/liquidity/arbitrum/balancer_v2_arbitrum_liquidity.sql similarity index 100% rename from models/_project/balancer/liquidity/arbitrum/balancer_v2_arbitrum_liquidity.sql rename to hourly_spellbook/models/_project/balancer/liquidity/arbitrum/balancer_v2_arbitrum_liquidity.sql diff --git a/models/_project/balancer/liquidity/avalanche_c/_schema.yml b/hourly_spellbook/models/_project/balancer/liquidity/avalanche_c/_schema.yml similarity index 100% rename from models/_project/balancer/liquidity/avalanche_c/_schema.yml rename to hourly_spellbook/models/_project/balancer/liquidity/avalanche_c/_schema.yml diff --git a/models/_project/balancer/liquidity/avalanche_c/balancer_v2_avalanche_c_liquidity.sql b/hourly_spellbook/models/_project/balancer/liquidity/avalanche_c/balancer_v2_avalanche_c_liquidity.sql similarity index 100% rename from models/_project/balancer/liquidity/avalanche_c/balancer_v2_avalanche_c_liquidity.sql rename to hourly_spellbook/models/_project/balancer/liquidity/avalanche_c/balancer_v2_avalanche_c_liquidity.sql diff --git a/models/_project/balancer/liquidity/balancer_liquidity.sql b/hourly_spellbook/models/_project/balancer/liquidity/balancer_liquidity.sql similarity index 100% rename from models/_project/balancer/liquidity/balancer_liquidity.sql rename to hourly_spellbook/models/_project/balancer/liquidity/balancer_liquidity.sql diff --git a/models/_project/balancer/liquidity/base/_schema.yml b/hourly_spellbook/models/_project/balancer/liquidity/base/_schema.yml similarity index 100% rename from models/_project/balancer/liquidity/base/_schema.yml rename to hourly_spellbook/models/_project/balancer/liquidity/base/_schema.yml diff --git a/models/_project/balancer/liquidity/base/balancer_v2_base_liquidity.sql b/hourly_spellbook/models/_project/balancer/liquidity/base/balancer_v2_base_liquidity.sql similarity index 100% rename from models/_project/balancer/liquidity/base/balancer_v2_base_liquidity.sql rename to hourly_spellbook/models/_project/balancer/liquidity/base/balancer_v2_base_liquidity.sql diff --git a/models/_project/balancer/liquidity/ethereum/_schema.yml b/hourly_spellbook/models/_project/balancer/liquidity/ethereum/_schema.yml similarity index 100% rename from models/_project/balancer/liquidity/ethereum/_schema.yml rename to hourly_spellbook/models/_project/balancer/liquidity/ethereum/_schema.yml diff --git a/models/_project/balancer/liquidity/ethereum/balancer_v1_ethereum_liquidity.sql b/hourly_spellbook/models/_project/balancer/liquidity/ethereum/balancer_v1_ethereum_liquidity.sql similarity index 100% rename from models/_project/balancer/liquidity/ethereum/balancer_v1_ethereum_liquidity.sql rename to hourly_spellbook/models/_project/balancer/liquidity/ethereum/balancer_v1_ethereum_liquidity.sql diff --git a/models/_project/balancer/liquidity/ethereum/balancer_v2_ethereum_liquidity.sql b/hourly_spellbook/models/_project/balancer/liquidity/ethereum/balancer_v2_ethereum_liquidity.sql similarity index 100% rename from models/_project/balancer/liquidity/ethereum/balancer_v2_ethereum_liquidity.sql rename to hourly_spellbook/models/_project/balancer/liquidity/ethereum/balancer_v2_ethereum_liquidity.sql diff --git a/models/_project/balancer/liquidity/gnosis/_schema.yml b/hourly_spellbook/models/_project/balancer/liquidity/gnosis/_schema.yml similarity index 100% rename from models/_project/balancer/liquidity/gnosis/_schema.yml rename to hourly_spellbook/models/_project/balancer/liquidity/gnosis/_schema.yml diff --git a/models/_project/balancer/liquidity/gnosis/balancer_v2_gnosis_liquidity.sql b/hourly_spellbook/models/_project/balancer/liquidity/gnosis/balancer_v2_gnosis_liquidity.sql similarity index 100% rename from models/_project/balancer/liquidity/gnosis/balancer_v2_gnosis_liquidity.sql rename to hourly_spellbook/models/_project/balancer/liquidity/gnosis/balancer_v2_gnosis_liquidity.sql diff --git a/models/_project/balancer/liquidity/optimism/_schema.yml b/hourly_spellbook/models/_project/balancer/liquidity/optimism/_schema.yml similarity index 100% rename from models/_project/balancer/liquidity/optimism/_schema.yml rename to hourly_spellbook/models/_project/balancer/liquidity/optimism/_schema.yml diff --git a/models/_project/balancer/liquidity/optimism/balancer_v2_optimism_liquidity.sql b/hourly_spellbook/models/_project/balancer/liquidity/optimism/balancer_v2_optimism_liquidity.sql similarity index 100% rename from models/_project/balancer/liquidity/optimism/balancer_v2_optimism_liquidity.sql rename to hourly_spellbook/models/_project/balancer/liquidity/optimism/balancer_v2_optimism_liquidity.sql diff --git a/models/_project/balancer/liquidity/polygon/_schema.yml b/hourly_spellbook/models/_project/balancer/liquidity/polygon/_schema.yml similarity index 100% rename from models/_project/balancer/liquidity/polygon/_schema.yml rename to hourly_spellbook/models/_project/balancer/liquidity/polygon/_schema.yml diff --git a/models/_project/balancer/liquidity/polygon/balancer_v2_polygon_liquidity.sql b/hourly_spellbook/models/_project/balancer/liquidity/polygon/balancer_v2_polygon_liquidity.sql similarity index 100% rename from models/_project/balancer/liquidity/polygon/balancer_v2_polygon_liquidity.sql rename to hourly_spellbook/models/_project/balancer/liquidity/polygon/balancer_v2_polygon_liquidity.sql diff --git a/models/_project/balancer/liquidity/zkevm/_schema.yml b/hourly_spellbook/models/_project/balancer/liquidity/zkevm/_schema.yml similarity index 100% rename from models/_project/balancer/liquidity/zkevm/_schema.yml rename to hourly_spellbook/models/_project/balancer/liquidity/zkevm/_schema.yml diff --git a/models/_project/balancer/liquidity/zkevm/balancer_v2_zkevm_liquidity.sql b/hourly_spellbook/models/_project/balancer/liquidity/zkevm/balancer_v2_zkevm_liquidity.sql similarity index 100% rename from models/_project/balancer/liquidity/zkevm/balancer_v2_zkevm_liquidity.sql rename to hourly_spellbook/models/_project/balancer/liquidity/zkevm/balancer_v2_zkevm_liquidity.sql diff --git a/models/_project/balancer/pools/_schema.yml b/hourly_spellbook/models/_project/balancer/pools/_schema.yml similarity index 100% rename from models/_project/balancer/pools/_schema.yml rename to hourly_spellbook/models/_project/balancer/pools/_schema.yml diff --git a/models/_project/balancer/pools/arbitrum/_schema.yml b/hourly_spellbook/models/_project/balancer/pools/arbitrum/_schema.yml similarity index 100% rename from models/_project/balancer/pools/arbitrum/_schema.yml rename to hourly_spellbook/models/_project/balancer/pools/arbitrum/_schema.yml diff --git a/models/_project/balancer/pools/arbitrum/balancer_arbitrum_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/arbitrum/balancer_arbitrum_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/arbitrum/balancer_arbitrum_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/arbitrum/balancer_arbitrum_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/arbitrum/balancer_v2_arbitrum_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/arbitrum/balancer_v2_arbitrum_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/arbitrum/balancer_v2_arbitrum_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/arbitrum/balancer_v2_arbitrum_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/avalanche_c/_schema.yml b/hourly_spellbook/models/_project/balancer/pools/avalanche_c/_schema.yml similarity index 100% rename from models/_project/balancer/pools/avalanche_c/_schema.yml rename to hourly_spellbook/models/_project/balancer/pools/avalanche_c/_schema.yml diff --git a/models/_project/balancer/pools/avalanche_c/balancer_avalanche_c_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/avalanche_c/balancer_avalanche_c_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/avalanche_c/balancer_avalanche_c_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/avalanche_c/balancer_avalanche_c_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/avalanche_c/balancer_v2_avalanche_c_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/avalanche_c/balancer_v2_avalanche_c_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/avalanche_c/balancer_v2_avalanche_c_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/avalanche_c/balancer_v2_avalanche_c_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/balancer_gauge_mappings.sql b/hourly_spellbook/models/_project/balancer/pools/balancer_gauge_mappings.sql similarity index 100% rename from models/_project/balancer/pools/balancer_gauge_mappings.sql rename to hourly_spellbook/models/_project/balancer/pools/balancer_gauge_mappings.sql diff --git a/models/_project/balancer/pools/balancer_pools_metrics_daily.sql b/hourly_spellbook/models/_project/balancer/pools/balancer_pools_metrics_daily.sql similarity index 100% rename from models/_project/balancer/pools/balancer_pools_metrics_daily.sql rename to hourly_spellbook/models/_project/balancer/pools/balancer_pools_metrics_daily.sql diff --git a/models/_project/balancer/pools/balancer_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/balancer_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/balancer_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/balancer_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/base/_schema.yml b/hourly_spellbook/models/_project/balancer/pools/base/_schema.yml similarity index 100% rename from models/_project/balancer/pools/base/_schema.yml rename to hourly_spellbook/models/_project/balancer/pools/base/_schema.yml diff --git a/models/_project/balancer/pools/base/balancer_base_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/base/balancer_base_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/base/balancer_base_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/base/balancer_base_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/base/balancer_v2_base_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/base/balancer_v2_base_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/base/balancer_v2_base_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/base/balancer_v2_base_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/ethereum/_schema.yml b/hourly_spellbook/models/_project/balancer/pools/ethereum/_schema.yml similarity index 100% rename from models/_project/balancer/pools/ethereum/_schema.yml rename to hourly_spellbook/models/_project/balancer/pools/ethereum/_schema.yml diff --git a/models/_project/balancer/pools/ethereum/balancer_ethereum_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/ethereum/balancer_ethereum_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/ethereum/balancer_ethereum_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/ethereum/balancer_ethereum_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/ethereum/balancer_v1_ethereum_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/ethereum/balancer_v1_ethereum_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/ethereum/balancer_v1_ethereum_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/ethereum/balancer_v1_ethereum_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/ethereum/balancer_v2_ethereum_lbps.sql b/hourly_spellbook/models/_project/balancer/pools/ethereum/balancer_v2_ethereum_lbps.sql similarity index 100% rename from models/_project/balancer/pools/ethereum/balancer_v2_ethereum_lbps.sql rename to hourly_spellbook/models/_project/balancer/pools/ethereum/balancer_v2_ethereum_lbps.sql diff --git a/models/_project/balancer/pools/ethereum/balancer_v2_ethereum_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/ethereum/balancer_v2_ethereum_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/ethereum/balancer_v2_ethereum_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/ethereum/balancer_v2_ethereum_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/gnosis/_schema.yml b/hourly_spellbook/models/_project/balancer/pools/gnosis/_schema.yml similarity index 100% rename from models/_project/balancer/pools/gnosis/_schema.yml rename to hourly_spellbook/models/_project/balancer/pools/gnosis/_schema.yml diff --git a/models/_project/balancer/pools/gnosis/balancer_gnosis_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/gnosis/balancer_gnosis_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/gnosis/balancer_gnosis_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/gnosis/balancer_gnosis_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/gnosis/balancer_v2_gnosis_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/gnosis/balancer_v2_gnosis_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/gnosis/balancer_v2_gnosis_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/gnosis/balancer_v2_gnosis_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/optimism/_schema.yml b/hourly_spellbook/models/_project/balancer/pools/optimism/_schema.yml similarity index 100% rename from models/_project/balancer/pools/optimism/_schema.yml rename to hourly_spellbook/models/_project/balancer/pools/optimism/_schema.yml diff --git a/models/_project/balancer/pools/optimism/balancer_optimism_gauge_mappings.sql b/hourly_spellbook/models/_project/balancer/pools/optimism/balancer_optimism_gauge_mappings.sql similarity index 100% rename from models/_project/balancer/pools/optimism/balancer_optimism_gauge_mappings.sql rename to hourly_spellbook/models/_project/balancer/pools/optimism/balancer_optimism_gauge_mappings.sql diff --git a/models/_project/balancer/pools/optimism/balancer_optimism_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/optimism/balancer_optimism_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/optimism/balancer_optimism_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/optimism/balancer_optimism_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/optimism/balancer_v2_optimism_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/optimism/balancer_v2_optimism_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/optimism/balancer_v2_optimism_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/optimism/balancer_v2_optimism_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/polygon/_schema.yml b/hourly_spellbook/models/_project/balancer/pools/polygon/_schema.yml similarity index 100% rename from models/_project/balancer/pools/polygon/_schema.yml rename to hourly_spellbook/models/_project/balancer/pools/polygon/_schema.yml diff --git a/models/_project/balancer/pools/polygon/balancer_polygon_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/polygon/balancer_polygon_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/polygon/balancer_polygon_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/polygon/balancer_polygon_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/polygon/balancer_v2_polygon_lbps.sql b/hourly_spellbook/models/_project/balancer/pools/polygon/balancer_v2_polygon_lbps.sql similarity index 100% rename from models/_project/balancer/pools/polygon/balancer_v2_polygon_lbps.sql rename to hourly_spellbook/models/_project/balancer/pools/polygon/balancer_v2_polygon_lbps.sql diff --git a/models/_project/balancer/pools/polygon/balancer_v2_polygon_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/polygon/balancer_v2_polygon_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/polygon/balancer_v2_polygon_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/polygon/balancer_v2_polygon_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/zkevm/_schema.yml b/hourly_spellbook/models/_project/balancer/pools/zkevm/_schema.yml similarity index 100% rename from models/_project/balancer/pools/zkevm/_schema.yml rename to hourly_spellbook/models/_project/balancer/pools/zkevm/_schema.yml diff --git a/models/_project/balancer/pools/zkevm/balancer_v2_zkevm_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/zkevm/balancer_v2_zkevm_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/zkevm/balancer_v2_zkevm_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/zkevm/balancer_v2_zkevm_pools_tokens_weights.sql diff --git a/models/_project/balancer/pools/zkevm/balancer_zkevm_pools_tokens_weights.sql b/hourly_spellbook/models/_project/balancer/pools/zkevm/balancer_zkevm_pools_tokens_weights.sql similarity index 100% rename from models/_project/balancer/pools/zkevm/balancer_zkevm_pools_tokens_weights.sql rename to hourly_spellbook/models/_project/balancer/pools/zkevm/balancer_zkevm_pools_tokens_weights.sql diff --git a/models/_project/balancer/protocol_fee/_schema.yml b/hourly_spellbook/models/_project/balancer/protocol_fee/_schema.yml similarity index 100% rename from models/_project/balancer/protocol_fee/_schema.yml rename to hourly_spellbook/models/_project/balancer/protocol_fee/_schema.yml diff --git a/models/_project/balancer/protocol_fee/arbitrum/_schema.yml b/hourly_spellbook/models/_project/balancer/protocol_fee/arbitrum/_schema.yml similarity index 100% rename from models/_project/balancer/protocol_fee/arbitrum/_schema.yml rename to hourly_spellbook/models/_project/balancer/protocol_fee/arbitrum/_schema.yml diff --git a/models/_project/balancer/protocol_fee/arbitrum/balancer_v2_arbitrum_protocol_fee.sql b/hourly_spellbook/models/_project/balancer/protocol_fee/arbitrum/balancer_v2_arbitrum_protocol_fee.sql similarity index 100% rename from models/_project/balancer/protocol_fee/arbitrum/balancer_v2_arbitrum_protocol_fee.sql rename to hourly_spellbook/models/_project/balancer/protocol_fee/arbitrum/balancer_v2_arbitrum_protocol_fee.sql diff --git a/models/_project/balancer/protocol_fee/avalanche_c/_schema.yml b/hourly_spellbook/models/_project/balancer/protocol_fee/avalanche_c/_schema.yml similarity index 100% rename from models/_project/balancer/protocol_fee/avalanche_c/_schema.yml rename to hourly_spellbook/models/_project/balancer/protocol_fee/avalanche_c/_schema.yml diff --git a/models/_project/balancer/protocol_fee/avalanche_c/balancer_v2_avalanche_c_protocol_fee.sql b/hourly_spellbook/models/_project/balancer/protocol_fee/avalanche_c/balancer_v2_avalanche_c_protocol_fee.sql similarity index 100% rename from models/_project/balancer/protocol_fee/avalanche_c/balancer_v2_avalanche_c_protocol_fee.sql rename to hourly_spellbook/models/_project/balancer/protocol_fee/avalanche_c/balancer_v2_avalanche_c_protocol_fee.sql diff --git a/models/_project/balancer/protocol_fee/balancer_protocol_fee.sql b/hourly_spellbook/models/_project/balancer/protocol_fee/balancer_protocol_fee.sql similarity index 100% rename from models/_project/balancer/protocol_fee/balancer_protocol_fee.sql rename to hourly_spellbook/models/_project/balancer/protocol_fee/balancer_protocol_fee.sql diff --git a/models/_project/balancer/protocol_fee/base/_schema.yml b/hourly_spellbook/models/_project/balancer/protocol_fee/base/_schema.yml similarity index 100% rename from models/_project/balancer/protocol_fee/base/_schema.yml rename to hourly_spellbook/models/_project/balancer/protocol_fee/base/_schema.yml diff --git a/models/_project/balancer/protocol_fee/base/balancer_v2_base_protocol_fee.sql b/hourly_spellbook/models/_project/balancer/protocol_fee/base/balancer_v2_base_protocol_fee.sql similarity index 100% rename from models/_project/balancer/protocol_fee/base/balancer_v2_base_protocol_fee.sql rename to hourly_spellbook/models/_project/balancer/protocol_fee/base/balancer_v2_base_protocol_fee.sql diff --git a/models/_project/balancer/protocol_fee/ethereum/_schema.yml b/hourly_spellbook/models/_project/balancer/protocol_fee/ethereum/_schema.yml similarity index 100% rename from models/_project/balancer/protocol_fee/ethereum/_schema.yml rename to hourly_spellbook/models/_project/balancer/protocol_fee/ethereum/_schema.yml diff --git a/models/_project/balancer/protocol_fee/ethereum/balancer_v2_ethereum_protocol_fee.sql b/hourly_spellbook/models/_project/balancer/protocol_fee/ethereum/balancer_v2_ethereum_protocol_fee.sql similarity index 100% rename from models/_project/balancer/protocol_fee/ethereum/balancer_v2_ethereum_protocol_fee.sql rename to hourly_spellbook/models/_project/balancer/protocol_fee/ethereum/balancer_v2_ethereum_protocol_fee.sql diff --git a/models/_project/balancer/protocol_fee/gnosis/_schema.yml b/hourly_spellbook/models/_project/balancer/protocol_fee/gnosis/_schema.yml similarity index 100% rename from models/_project/balancer/protocol_fee/gnosis/_schema.yml rename to hourly_spellbook/models/_project/balancer/protocol_fee/gnosis/_schema.yml diff --git a/models/_project/balancer/protocol_fee/gnosis/balancer_v2_gnosis_protocol_fee.sql b/hourly_spellbook/models/_project/balancer/protocol_fee/gnosis/balancer_v2_gnosis_protocol_fee.sql similarity index 100% rename from models/_project/balancer/protocol_fee/gnosis/balancer_v2_gnosis_protocol_fee.sql rename to hourly_spellbook/models/_project/balancer/protocol_fee/gnosis/balancer_v2_gnosis_protocol_fee.sql diff --git a/models/_project/balancer/protocol_fee/optimism/_schema.yml b/hourly_spellbook/models/_project/balancer/protocol_fee/optimism/_schema.yml similarity index 100% rename from models/_project/balancer/protocol_fee/optimism/_schema.yml rename to hourly_spellbook/models/_project/balancer/protocol_fee/optimism/_schema.yml diff --git a/models/_project/balancer/protocol_fee/optimism/balancer_v2_optimism_protocol_fee.sql b/hourly_spellbook/models/_project/balancer/protocol_fee/optimism/balancer_v2_optimism_protocol_fee.sql similarity index 100% rename from models/_project/balancer/protocol_fee/optimism/balancer_v2_optimism_protocol_fee.sql rename to hourly_spellbook/models/_project/balancer/protocol_fee/optimism/balancer_v2_optimism_protocol_fee.sql diff --git a/models/_project/balancer/protocol_fee/polygon/_schema.yml b/hourly_spellbook/models/_project/balancer/protocol_fee/polygon/_schema.yml similarity index 100% rename from models/_project/balancer/protocol_fee/polygon/_schema.yml rename to hourly_spellbook/models/_project/balancer/protocol_fee/polygon/_schema.yml diff --git a/models/_project/balancer/protocol_fee/polygon/balancer_v2_polygon_protocol_fee.sql b/hourly_spellbook/models/_project/balancer/protocol_fee/polygon/balancer_v2_polygon_protocol_fee.sql similarity index 100% rename from models/_project/balancer/protocol_fee/polygon/balancer_v2_polygon_protocol_fee.sql rename to hourly_spellbook/models/_project/balancer/protocol_fee/polygon/balancer_v2_polygon_protocol_fee.sql diff --git a/models/_project/balancer/protocol_fee/zkevm/_schema.yml b/hourly_spellbook/models/_project/balancer/protocol_fee/zkevm/_schema.yml similarity index 100% rename from models/_project/balancer/protocol_fee/zkevm/_schema.yml rename to hourly_spellbook/models/_project/balancer/protocol_fee/zkevm/_schema.yml diff --git a/models/_project/balancer/protocol_fee/zkevm/balancer_v2_zkevm_protocol_fee.sql b/hourly_spellbook/models/_project/balancer/protocol_fee/zkevm/balancer_v2_zkevm_protocol_fee.sql similarity index 100% rename from models/_project/balancer/protocol_fee/zkevm/balancer_v2_zkevm_protocol_fee.sql rename to hourly_spellbook/models/_project/balancer/protocol_fee/zkevm/balancer_v2_zkevm_protocol_fee.sql diff --git a/models/_project/balancer/support/_schema.yml b/hourly_spellbook/models/_project/balancer/support/_schema.yml similarity index 100% rename from models/_project/balancer/support/_schema.yml rename to hourly_spellbook/models/_project/balancer/support/_schema.yml diff --git a/models/_project/balancer/support/balancer_single_recipient_gauges.sql b/hourly_spellbook/models/_project/balancer/support/balancer_single_recipient_gauges.sql similarity index 100% rename from models/_project/balancer/support/balancer_single_recipient_gauges.sql rename to hourly_spellbook/models/_project/balancer/support/balancer_single_recipient_gauges.sql diff --git a/models/_project/balancer/support/balancer_token_whitelist.sql b/hourly_spellbook/models/_project/balancer/support/balancer_token_whitelist.sql similarity index 100% rename from models/_project/balancer/support/balancer_token_whitelist.sql rename to hourly_spellbook/models/_project/balancer/support/balancer_token_whitelist.sql diff --git a/models/_project/balancer/vebal/ethereum/_schema.yml b/hourly_spellbook/models/_project/balancer/vebal/ethereum/_schema.yml similarity index 100% rename from models/_project/balancer/vebal/ethereum/_schema.yml rename to hourly_spellbook/models/_project/balancer/vebal/ethereum/_schema.yml diff --git a/models/_project/balancer/vebal/ethereum/balancer_ethereum_vebal_balances_day.sql b/hourly_spellbook/models/_project/balancer/vebal/ethereum/balancer_ethereum_vebal_balances_day.sql similarity index 100% rename from models/_project/balancer/vebal/ethereum/balancer_ethereum_vebal_balances_day.sql rename to hourly_spellbook/models/_project/balancer/vebal/ethereum/balancer_ethereum_vebal_balances_day.sql diff --git a/models/_project/balancer/vebal/ethereum/balancer_ethereum_vebal_slopes.sql b/hourly_spellbook/models/_project/balancer/vebal/ethereum/balancer_ethereum_vebal_slopes.sql similarity index 100% rename from models/_project/balancer/vebal/ethereum/balancer_ethereum_vebal_slopes.sql rename to hourly_spellbook/models/_project/balancer/vebal/ethereum/balancer_ethereum_vebal_slopes.sql diff --git a/models/_project/balancer/vebal/ethereum/balancer_ethereum_vebal_votes.sql b/hourly_spellbook/models/_project/balancer/vebal/ethereum/balancer_ethereum_vebal_votes.sql similarity index 100% rename from models/_project/balancer/vebal/ethereum/balancer_ethereum_vebal_votes.sql rename to hourly_spellbook/models/_project/balancer/vebal/ethereum/balancer_ethereum_vebal_votes.sql diff --git a/models/cow_protocol/arbitrum/cow_protocol_arbitrum_batches.sql b/hourly_spellbook/models/_project/cow_protocol/arbitrum/cow_protocol_arbitrum_batches.sql similarity index 100% rename from models/cow_protocol/arbitrum/cow_protocol_arbitrum_batches.sql rename to hourly_spellbook/models/_project/cow_protocol/arbitrum/cow_protocol_arbitrum_batches.sql diff --git a/models/cow_protocol/arbitrum/cow_protocol_arbitrum_schema.yml b/hourly_spellbook/models/_project/cow_protocol/arbitrum/cow_protocol_arbitrum_schema.yml similarity index 100% rename from models/cow_protocol/arbitrum/cow_protocol_arbitrum_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/arbitrum/cow_protocol_arbitrum_schema.yml diff --git a/models/cow_protocol/arbitrum/cow_protocol_arbitrum_solvers.sql b/hourly_spellbook/models/_project/cow_protocol/arbitrum/cow_protocol_arbitrum_solvers.sql similarity index 100% rename from models/cow_protocol/arbitrum/cow_protocol_arbitrum_solvers.sql rename to hourly_spellbook/models/_project/cow_protocol/arbitrum/cow_protocol_arbitrum_solvers.sql diff --git a/models/cow_protocol/cow_protocol_batches.sql b/hourly_spellbook/models/_project/cow_protocol/cow_protocol_batches.sql similarity index 100% rename from models/cow_protocol/cow_protocol_batches.sql rename to hourly_spellbook/models/_project/cow_protocol/cow_protocol_batches.sql diff --git a/models/cow_protocol/cow_protocol_schema.yml b/hourly_spellbook/models/_project/cow_protocol/cow_protocol_schema.yml similarity index 100% rename from models/cow_protocol/cow_protocol_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/cow_protocol_schema.yml diff --git a/models/cow_protocol/ethereum/cow_protocol_ethereum_app_data.sql b/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_app_data.sql similarity index 100% rename from models/cow_protocol/ethereum/cow_protocol_ethereum_app_data.sql rename to hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_app_data.sql diff --git a/models/cow_protocol/ethereum/cow_protocol_ethereum_batches.sql b/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_batches.sql similarity index 100% rename from models/cow_protocol/ethereum/cow_protocol_ethereum_batches.sql rename to hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_batches.sql diff --git a/models/cow_protocol/ethereum/cow_protocol_ethereum_eth_flow_orders.sql b/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_eth_flow_orders.sql similarity index 100% rename from models/cow_protocol/ethereum/cow_protocol_ethereum_eth_flow_orders.sql rename to hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_eth_flow_orders.sql diff --git a/models/cow_protocol/ethereum/cow_protocol_ethereum_order_rewards.sql b/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_order_rewards.sql similarity index 100% rename from models/cow_protocol/ethereum/cow_protocol_ethereum_order_rewards.sql rename to hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_order_rewards.sql diff --git a/models/cow_protocol/ethereum/cow_protocol_ethereum_referrals.sql b/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_referrals.sql similarity index 100% rename from models/cow_protocol/ethereum/cow_protocol_ethereum_referrals.sql rename to hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_referrals.sql diff --git a/models/cow_protocol/ethereum/cow_protocol_ethereum_schema.yml b/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_schema.yml similarity index 100% rename from models/cow_protocol/ethereum/cow_protocol_ethereum_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_schema.yml diff --git a/models/cow_protocol/ethereum/cow_protocol_ethereum_solvers.sql b/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_solvers.sql similarity index 100% rename from models/cow_protocol/ethereum/cow_protocol_ethereum_solvers.sql rename to hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_solvers.sql diff --git a/models/cow_protocol/ethereum/cow_protocol_ethereum_trade_slippage.sql b/hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_trade_slippage.sql similarity index 100% rename from models/cow_protocol/ethereum/cow_protocol_ethereum_trade_slippage.sql rename to hourly_spellbook/models/_project/cow_protocol/ethereum/cow_protocol_ethereum_trade_slippage.sql diff --git a/models/cow_protocol/gnosis/cow_protocol_gnosis_batches.sql b/hourly_spellbook/models/_project/cow_protocol/gnosis/cow_protocol_gnosis_batches.sql similarity index 100% rename from models/cow_protocol/gnosis/cow_protocol_gnosis_batches.sql rename to hourly_spellbook/models/_project/cow_protocol/gnosis/cow_protocol_gnosis_batches.sql diff --git a/models/cow_protocol/gnosis/cow_protocol_gnosis_schema.yml b/hourly_spellbook/models/_project/cow_protocol/gnosis/cow_protocol_gnosis_schema.yml similarity index 100% rename from models/cow_protocol/gnosis/cow_protocol_gnosis_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/gnosis/cow_protocol_gnosis_schema.yml diff --git a/models/cow_protocol/gnosis/cow_protocol_gnosis_solvers.sql b/hourly_spellbook/models/_project/cow_protocol/gnosis/cow_protocol_gnosis_solvers.sql similarity index 100% rename from models/cow_protocol/gnosis/cow_protocol_gnosis_solvers.sql rename to hourly_spellbook/models/_project/cow_protocol/gnosis/cow_protocol_gnosis_solvers.sql diff --git a/models/cow_protocol/tx_hash_labels/bluechip_investment/cow_protocol_tx_hash_labels_bluechip_investment.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/bluechip_investment/cow_protocol_tx_hash_labels_bluechip_investment.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/bluechip_investment/cow_protocol_tx_hash_labels_bluechip_investment.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/bluechip_investment/cow_protocol_tx_hash_labels_bluechip_investment.sql diff --git a/models/cow_protocol/tx_hash_labels/bluechip_investment/cow_protocol_tx_hash_labels_bluechip_investment_schema.yml b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/bluechip_investment/cow_protocol_tx_hash_labels_bluechip_investment_schema.yml similarity index 100% rename from models/cow_protocol/tx_hash_labels/bluechip_investment/cow_protocol_tx_hash_labels_bluechip_investment_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/bluechip_investment/cow_protocol_tx_hash_labels_bluechip_investment_schema.yml diff --git a/models/cow_protocol/tx_hash_labels/bluechip_investment/ethereum/cow_protocol_tx_hash_labels_bluechip_investment_ethereum.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/bluechip_investment/ethereum/cow_protocol_tx_hash_labels_bluechip_investment_ethereum.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/bluechip_investment/ethereum/cow_protocol_tx_hash_labels_bluechip_investment_ethereum.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/bluechip_investment/ethereum/cow_protocol_tx_hash_labels_bluechip_investment_ethereum.sql diff --git a/models/cow_protocol/tx_hash_labels/cow_protocol_tx_hash_labels_all.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/cow_protocol_tx_hash_labels_all.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/cow_protocol_tx_hash_labels_all.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/cow_protocol_tx_hash_labels_all.sql diff --git a/models/cow_protocol/tx_hash_labels/cow_protocol_tx_hash_labels_all_schema.yml b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/cow_protocol_tx_hash_labels_all_schema.yml similarity index 100% rename from models/cow_protocol/tx_hash_labels/cow_protocol_tx_hash_labels_all_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/cow_protocol_tx_hash_labels_all_schema.yml diff --git a/models/cow_protocol/tx_hash_labels/early_investment/cow_protocol_tx_hash_labels_early_investment.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/early_investment/cow_protocol_tx_hash_labels_early_investment.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/early_investment/cow_protocol_tx_hash_labels_early_investment.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/early_investment/cow_protocol_tx_hash_labels_early_investment.sql diff --git a/models/cow_protocol/tx_hash_labels/early_investment/cow_protocol_tx_hash_labels_early_investment_schema.yml b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/early_investment/cow_protocol_tx_hash_labels_early_investment_schema.yml similarity index 100% rename from models/cow_protocol/tx_hash_labels/early_investment/cow_protocol_tx_hash_labels_early_investment_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/early_investment/cow_protocol_tx_hash_labels_early_investment_schema.yml diff --git a/models/cow_protocol/tx_hash_labels/early_investment/ethereum/cow_protocol_tx_hash_labels_early_investment_ethereum.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/early_investment/ethereum/cow_protocol_tx_hash_labels_early_investment_ethereum.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/early_investment/ethereum/cow_protocol_tx_hash_labels_early_investment_ethereum.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/early_investment/ethereum/cow_protocol_tx_hash_labels_early_investment_ethereum.sql diff --git a/models/cow_protocol/tx_hash_labels/harvest_yield/cow_protocol_tx_hash_labels_harvest_yield.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/harvest_yield/cow_protocol_tx_hash_labels_harvest_yield.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/harvest_yield/cow_protocol_tx_hash_labels_harvest_yield.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/harvest_yield/cow_protocol_tx_hash_labels_harvest_yield.sql diff --git a/models/cow_protocol/tx_hash_labels/harvest_yield/cow_protocol_tx_hash_labels_harvest_yield_schema.yml b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/harvest_yield/cow_protocol_tx_hash_labels_harvest_yield_schema.yml similarity index 100% rename from models/cow_protocol/tx_hash_labels/harvest_yield/cow_protocol_tx_hash_labels_harvest_yield_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/harvest_yield/cow_protocol_tx_hash_labels_harvest_yield_schema.yml diff --git a/models/cow_protocol/tx_hash_labels/harvest_yield/ethereum/cow_protocol_tx_hash_labels_harvest_yield_ethereum.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/harvest_yield/ethereum/cow_protocol_tx_hash_labels_harvest_yield_ethereum.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/harvest_yield/ethereum/cow_protocol_tx_hash_labels_harvest_yield_ethereum.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/harvest_yield/ethereum/cow_protocol_tx_hash_labels_harvest_yield_ethereum.sql diff --git a/models/cow_protocol/tx_hash_labels/offramp/cow_protocol_tx_hash_labels_offramp.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/offramp/cow_protocol_tx_hash_labels_offramp.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/offramp/cow_protocol_tx_hash_labels_offramp.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/offramp/cow_protocol_tx_hash_labels_offramp.sql diff --git a/models/cow_protocol/tx_hash_labels/offramp/cow_protocol_tx_hash_labels_offramp_schema.yml b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/offramp/cow_protocol_tx_hash_labels_offramp_schema.yml similarity index 100% rename from models/cow_protocol/tx_hash_labels/offramp/cow_protocol_tx_hash_labels_offramp_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/offramp/cow_protocol_tx_hash_labels_offramp_schema.yml diff --git a/models/cow_protocol/tx_hash_labels/offramp/ethereum/cow_protocol_tx_hash_labels_offramp_ethereum.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/offramp/ethereum/cow_protocol_tx_hash_labels_offramp_ethereum.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/offramp/ethereum/cow_protocol_tx_hash_labels_offramp_ethereum.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/offramp/ethereum/cow_protocol_tx_hash_labels_offramp_ethereum.sql diff --git a/models/cow_protocol/tx_hash_labels/onramp/cow_protocol_tx_hash_labels_onramp.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/onramp/cow_protocol_tx_hash_labels_onramp.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/onramp/cow_protocol_tx_hash_labels_onramp.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/onramp/cow_protocol_tx_hash_labels_onramp.sql diff --git a/models/cow_protocol/tx_hash_labels/onramp/cow_protocol_tx_hash_labels_onramp_schema.yml b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/onramp/cow_protocol_tx_hash_labels_onramp_schema.yml similarity index 100% rename from models/cow_protocol/tx_hash_labels/onramp/cow_protocol_tx_hash_labels_onramp_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/onramp/cow_protocol_tx_hash_labels_onramp_schema.yml diff --git a/models/cow_protocol/tx_hash_labels/onramp/ethereum/cow_protocol_tx_hash_labels_onramp_ethereum.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/onramp/ethereum/cow_protocol_tx_hash_labels_onramp_ethereum.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/onramp/ethereum/cow_protocol_tx_hash_labels_onramp_ethereum.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/onramp/ethereum/cow_protocol_tx_hash_labels_onramp_ethereum.sql diff --git a/models/cow_protocol/tx_hash_labels/stable_to_stable/cow_protocol_tx_hash_labels_stable_to_stable.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/stable_to_stable/cow_protocol_tx_hash_labels_stable_to_stable.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/stable_to_stable/cow_protocol_tx_hash_labels_stable_to_stable.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/stable_to_stable/cow_protocol_tx_hash_labels_stable_to_stable.sql diff --git a/models/cow_protocol/tx_hash_labels/stable_to_stable/cow_protocol_tx_hash_labels_stable_to_stable_schema.yml b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/stable_to_stable/cow_protocol_tx_hash_labels_stable_to_stable_schema.yml similarity index 100% rename from models/cow_protocol/tx_hash_labels/stable_to_stable/cow_protocol_tx_hash_labels_stable_to_stable_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/stable_to_stable/cow_protocol_tx_hash_labels_stable_to_stable_schema.yml diff --git a/models/cow_protocol/tx_hash_labels/stable_to_stable/ethereum/cow_protocol_tx_hash_labels_stable_to_stable_ethereum.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/stable_to_stable/ethereum/cow_protocol_tx_hash_labels_stable_to_stable_ethereum.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/stable_to_stable/ethereum/cow_protocol_tx_hash_labels_stable_to_stable_ethereum.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/stable_to_stable/ethereum/cow_protocol_tx_hash_labels_stable_to_stable_ethereum.sql diff --git a/models/cow_protocol/tx_hash_labels/staking_token_investment/cow_protocol_tx_hash_labels_staking_token_investment.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/staking_token_investment/cow_protocol_tx_hash_labels_staking_token_investment.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/staking_token_investment/cow_protocol_tx_hash_labels_staking_token_investment.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/staking_token_investment/cow_protocol_tx_hash_labels_staking_token_investment.sql diff --git a/models/cow_protocol/tx_hash_labels/staking_token_investment/cow_protocol_tx_hash_labels_staking_token_investment_schema.yml b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/staking_token_investment/cow_protocol_tx_hash_labels_staking_token_investment_schema.yml similarity index 100% rename from models/cow_protocol/tx_hash_labels/staking_token_investment/cow_protocol_tx_hash_labels_staking_token_investment_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/staking_token_investment/cow_protocol_tx_hash_labels_staking_token_investment_schema.yml diff --git a/models/cow_protocol/tx_hash_labels/staking_token_investment/ethereum/cow_protocol_tx_hash_labels_staking_token_investment_ethereum.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/staking_token_investment/ethereum/cow_protocol_tx_hash_labels_staking_token_investment_ethereum.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/staking_token_investment/ethereum/cow_protocol_tx_hash_labels_staking_token_investment_ethereum.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/staking_token_investment/ethereum/cow_protocol_tx_hash_labels_staking_token_investment_ethereum.sql diff --git a/models/cow_protocol/tx_hash_labels/treasury_management/cow_protocol_tx_hash_labels_treasury_management.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/treasury_management/cow_protocol_tx_hash_labels_treasury_management.sql similarity index 100% rename from models/cow_protocol/tx_hash_labels/treasury_management/cow_protocol_tx_hash_labels_treasury_management.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/treasury_management/cow_protocol_tx_hash_labels_treasury_management.sql diff --git a/models/cow_protocol/tx_hash_labels/treasury_management/cow_protocol_tx_hash_labels_treasury_management_schema.yml b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/treasury_management/cow_protocol_tx_hash_labels_treasury_management_schema.yml similarity index 100% rename from models/cow_protocol/tx_hash_labels/treasury_management/cow_protocol_tx_hash_labels_treasury_management_schema.yml rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/treasury_management/cow_protocol_tx_hash_labels_treasury_management_schema.yml diff --git a/models/cow_protocol/tx_hash_labels/treasury_management/ethereum/cow_protocol_tx_hash_labels_treasury_management_ethereum.sql b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/treasury_management/ethereum/cow_protocol_tx_hash_labels_treasury_management_ethereum.sql similarity index 96% rename from models/cow_protocol/tx_hash_labels/treasury_management/ethereum/cow_protocol_tx_hash_labels_treasury_management_ethereum.sql rename to hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/treasury_management/ethereum/cow_protocol_tx_hash_labels_treasury_management_ethereum.sql index 999d9883439..68f3d5d3f40 100644 --- a/models/cow_protocol/tx_hash_labels/treasury_management/ethereum/cow_protocol_tx_hash_labels_treasury_management_ethereum.sql +++ b/hourly_spellbook/models/_project/cow_protocol/tx_hash_labels/treasury_management/ethereum/cow_protocol_tx_hash_labels_treasury_management_ethereum.sql @@ -1,7 +1,7 @@ {{ config( alias = 'tx_hash_labels_treasury_management_ethereum', - + ) }} @@ -10,7 +10,7 @@ with -- DAO list taken from dao multisig list from Dune -- https://github.com/duneanalytics/spellbook/blob/main/models/labels/dao/identifier/multisigs/labels_dao_multisig_ethereum.sql SELECT distinct address - FROM {{ ref('labels_addresses') }} + FROM {{ source('labels','addresses') }} WHERE category = 'dao' and blockchain = 'ethereum' and label_type = 'identifier' ), diff --git a/models/ens/ens_ethereum_schema.yml b/hourly_spellbook/models/_project/ens/ens_ethereum_schema.yml similarity index 69% rename from models/ens/ens_ethereum_schema.yml rename to hourly_spellbook/models/_project/ens/ens_ethereum_schema.yml index ea5c9cf47ad..c0f60904105 100644 --- a/models/ens/ens_ethereum_schema.yml +++ b/hourly_spellbook/models/_project/ens/ens_ethereum_schema.yml @@ -209,104 +209,6 @@ models: - name: evt_index description: "event index of node record update" - - name: ens_ethereum_votes - meta: - blockchain: ethereum - sector: dao - contributors: soispoke - config: - tags: ['ethereum', 'votes', 'dao', 'cross-chain'] - description: > - DAO votes on all chains across all contracts and versions - columns: - - name: blockchain - - name: project - description: "Project name of the DAO" - - name: version - description: "Version of the contract built and deployed by the DAO project" - - name: block_time - description: "UTC event block time of each DAO vote" - - name: tx_hash - description: "Unique transaction hash value tied to each vote on the DAO" - - &dao_name - name: dao_name - description: "DAO name" - - &dao_address - name: dao_address - description: "DAO wallet address" - - &proposal_id - name: proposal_id - - &votes - name: votes - description: "Votes weighted by the amount of governance tokens" - - &votes_share - name: votes_share - description: "Votes share in percent for a given proposal" - - &token_symbol - name: token_symbol - - &token_address - name: token_address - - &votes_value_usd - name: votes_value_usd - description: "USD amount of governance tokens used at the time of the vote" - - &voter_address - name: voter_address - - &support - name: support - description: "0 = Against, 1 = For, 2 = Abstain votes" - tests: - - accepted_values: - values: ['for', 'against', 'abstain'] - - &reason - name: reason - description: "Optional onchain comments to explain votes" - - - name: ens_ethereum_proposals - meta: - blockchain: ethereum - sector: dao - contributors: soispoke - config: - tags: ['ethereum', 'proposals', 'dao', 'cross-chain'] - description: > - DAO proposals on all chains across all contracts and versions - columns: - - name: blockchain - - name: project - description: "Project name of the DAO" - - name: version - description: "Version of the contract built and deployed by the DAO project" - - name: created_at - description: "UTC event block time at which the proposal was created" - - name: tx_hash - description: "Unique transaction hash value tied to each DAO proposal" - - *dao_name - - *dao_address - - name: proposal_id - tests: - - unique - - &votes_for - name: votes_for - - &votes_against - name: votes_against - - &votes_total - name: votes_total - description: "Total number of governance tokens used to vote on a given DAO proposal" - - &number_of_voters - name: number_of_voters - - &participation - name: participation - description: "Participation in percent: Number of governance tokens used to vote / Total token supply" - - &status - name: status - description: "Proposal status: Queued, Active, Executed, Canceled or Defeated" - tests: - - accepted_values: - values: ['Queued', 'Active', 'Executed', 'Canceled','Defeated'] - - &description - name: description - description: "Description of the proposal" - - name: ens_set_name_latest meta: blockchain: ethereum diff --git a/models/ens/ens_node_names.sql b/hourly_spellbook/models/_project/ens/ens_node_names.sql similarity index 100% rename from models/ens/ens_node_names.sql rename to hourly_spellbook/models/_project/ens/ens_node_names.sql diff --git a/models/ens/ens_resolver_latest.sql b/hourly_spellbook/models/_project/ens/ens_resolver_latest.sql similarity index 100% rename from models/ens/ens_resolver_latest.sql rename to hourly_spellbook/models/_project/ens/ens_resolver_latest.sql diff --git a/models/ens/ens_resolver_records.sql b/hourly_spellbook/models/_project/ens/ens_resolver_records.sql similarity index 100% rename from models/ens/ens_resolver_records.sql rename to hourly_spellbook/models/_project/ens/ens_resolver_records.sql diff --git a/models/ens/ens_reverse_latest.sql b/hourly_spellbook/models/_project/ens/ens_reverse_latest.sql similarity index 100% rename from models/ens/ens_reverse_latest.sql rename to hourly_spellbook/models/_project/ens/ens_reverse_latest.sql diff --git a/models/ens/ens_set_name_latest.sql b/hourly_spellbook/models/_project/ens/ens_set_name_latest.sql similarity index 100% rename from models/ens/ens_set_name_latest.sql rename to hourly_spellbook/models/_project/ens/ens_set_name_latest.sql diff --git a/models/ens/ens_view_expirations.sql b/hourly_spellbook/models/_project/ens/ens_view_expirations.sql similarity index 100% rename from models/ens/ens_view_expirations.sql rename to hourly_spellbook/models/_project/ens/ens_view_expirations.sql diff --git a/models/ens/ens_view_registrations.sql b/hourly_spellbook/models/_project/ens/ens_view_registrations.sql similarity index 100% rename from models/ens/ens_view_registrations.sql rename to hourly_spellbook/models/_project/ens/ens_view_registrations.sql diff --git a/models/ens/ens_view_registries.sql b/hourly_spellbook/models/_project/ens/ens_view_registries.sql similarity index 100% rename from models/ens/ens_view_registries.sql rename to hourly_spellbook/models/_project/ens/ens_view_registries.sql diff --git a/models/ens/ens_view_renewals.sql b/hourly_spellbook/models/_project/ens/ens_view_renewals.sql similarity index 100% rename from models/ens/ens_view_renewals.sql rename to hourly_spellbook/models/_project/ens/ens_view_renewals.sql diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_buffer_inflow.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_buffer_inflow.sql similarity index 95% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_buffer_inflow.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_buffer_inflow.sql index ec28e4ef05d..f44c1168e09 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_buffer_inflow.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_buffer_inflow.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'buffer_inflow', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -21,7 +22,7 @@ union all SELECT evt_block_time, amount, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, evt_tx_hash, date_trunc('day', evt_block_time) as day FROM {{source('lido_ethereum','steth_evt_ELRewardsReceived')}} -union all +union all SELECT evt_block_time, amount , 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, evt_tx_hash, date_trunc('day', evt_block_time) as day -FROM {{source('lido_ethereum','steth_evt_WithdrawalsReceived')}} \ No newline at end of file +FROM {{source('lido_ethereum','steth_evt_WithdrawalsReceived')}} diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_buffer_outflow.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_buffer_outflow.sql similarity index 91% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_buffer_outflow.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_buffer_outflow.sql index 846bd2dde04..a869f683e50 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_buffer_outflow.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_buffer_outflow.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'buffer_outflow', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -13,4 +14,4 @@ --ref{{'lido_accounting_ethereum_buffer_outflow'}} SELECT evt_block_time as period, amountOfETHLocked as amount, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 AS token, evt_tx_hash, date_trunc('day', evt_block_time) as day -FROM {{source('lido_ethereum','WithdrawalQueueERC721_evt_WithdrawalsFinalized')}} \ No newline at end of file +FROM {{source('lido_ethereum','WithdrawalQueueERC721_evt_WithdrawalsFinalized')}} diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_dai_referral_payment.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_dai_referral_payment.sql similarity index 89% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_dai_referral_payment.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_dai_referral_payment.sql index 7a8e83f5054..92db59d983c 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_dai_referral_payment.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_dai_referral_payment.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'dai_referral_payment', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -14,7 +15,7 @@ --ref{{'lido_accounting_dai_referral_payment'}} with tokens AS ( -select * from (values +select * from (values (0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32), --LDO (0x6B175474E89094C44Da98b954EedeAC495271d0F), --DAI (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --USDC @@ -30,11 +31,11 @@ select * from (values (0x3e40d73eb977dc6a537af587d48316fee66e9c8c, 'Ethereum', 'Aragon'), (0x48F300bD3C52c7dA6aAbDE4B683dEB27d38B9ABb, 'Ethereum', 'FinanceOpsMsig'), (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Ethereum', 'LiquidityRewardsMsig'), -(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager -(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 -(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 -(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 -(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager +(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager +(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 +(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 +(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 +(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager (0xE5576eB1dD4aA524D67Cf9a32C8742540252b6F4, 'Ethereum', 'LiquidityRewardMngr'), --Sushi Reward Manager (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Polygon', 'LiquidityRewardsMsig'), (0x9cd7477521B7d7E7F9e2F091D2eA0084e8AaA290, 'Ethereum', 'PolygonTeamRewardsMsig'), @@ -47,7 +48,7 @@ select * from (values (0xde06d17db9295fa8c4082d4f73ff81592a3ac437, 'Ethereum', 'RCCMsig'), (0x834560f580764bc2e0b16925f8bf229bb00cb759, 'Ethereum', 'TRPMsig') ) as list(address, chain, name) - + ), intermediate_addresses AS ( @@ -69,10 +70,10 @@ dai_referral_payments_addr AS ( NOT EXISTS (SELECT _recipient FROM {{source('lido_ethereum','AllowedRecipientsRegistry_evt_RecipientRemoved')}}) OR ( EXISTS (SELECT _recipient FROM {{source('lido_ethereum','AllowedRecipientsRegistry_evt_RecipientRemoved')}}) - AND + AND _recipient NOT IN (SELECT _recipient FROM {{source('lido_ethereum','AllowedRecipientsRegistry_evt_RecipientRemoved')}}) ) - ) + ) UNION ALL SELECT 0xaf8aE6955d07776aB690e565Ba6Fbc79B8dE3a5d --rhino ), @@ -81,7 +82,7 @@ dai_referral_payments_addr AS ( dai_referral_payment_txns AS ( SELECT evt_block_time, - evt_tx_hash, + evt_tx_hash, contract_address, value FROM {{source('erc20_ethereum','evt_transfer')}} @@ -89,14 +90,14 @@ dai_referral_payment_txns AS ( AND to IN ( SELECT address FROM dai_referral_payments_addr ) - AND evt_block_time >= CAST('2023-01-01 00:00' AS TIMESTAMP) + AND evt_block_time >= CAST('2023-01-01 00:00' AS TIMESTAMP) AND contract_address = 0x6B175474E89094C44Da98b954EedeAC495271d0F - ORDER BY evt_block_time -) + ORDER BY evt_block_time +) SELECT evt_block_time as period, - evt_tx_hash, + evt_tx_hash, contract_address AS token, value AS amount_token - FROM dai_referral_payment_txns \ No newline at end of file + FROM dai_referral_payment_txns diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_deposits.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_deposits.sql similarity index 76% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_deposits.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_deposits.sql index 2a79119f120..65efbc5753e 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_deposits.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_deposits.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'deposits', - + materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,21 +13,20 @@ ) }} -{% set project_start_date = '2020-12-18' %} +{% set project_start_date = '2020-12-18' %} - SELECT block_time as period, - sum(cast(value as DOUBLE)) as amount_staked, + SELECT block_time as period, + sum(cast(value as DOUBLE)) as amount_staked, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 AS token, tx_hash - FROM {{source('ethereum','traces')}} + FROM {{source('ethereum','traces')}} {% if is_incremental() %} WHERE date_trunc('hour', block_time) >= date_trunc('hour', now() - interval '1' day) {% else %} - WHERE date_trunc('hour', block_time) >= cast('{{ project_start_date }}' as timestamp) - {% endif %} + WHERE date_trunc('hour', block_time) >= cast('{{ project_start_date }}' as timestamp) + {% endif %} AND to = 0x00000000219ab540356cbb839cbe05303d7705fa AND call_type = 'call' - AND success = True + AND success = True AND "from" in (0xae7ab96520de3a18e5e111b5eaab095312d7fe84, 0xB9D7934878B5FB9610B3fE8A5e441e8fad7E293f, 0xFdDf38947aFB03C621C71b06C9C70bce73f12999) group by 1,3,4 - \ No newline at end of file diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_fundraising.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_fundraising.sql similarity index 88% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_fundraising.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_fundraising.sql index 224fcc9c3d3..f3369bb0df2 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_fundraising.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_fundraising.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'fundraising', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -11,7 +12,7 @@ }} with tokens AS ( -select * from (values +select * from (values (0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32), --LDO (0x6B175474E89094C44Da98b954EedeAC495271d0F), --DAI (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --USDC @@ -27,11 +28,11 @@ select * from (values (0x3e40d73eb977dc6a537af587d48316fee66e9c8c, 'Ethereum', 'Aragon'), (0x48F300bD3C52c7dA6aAbDE4B683dEB27d38B9ABb, 'Ethereum', 'FinanceOpsMsig'), (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Ethereum', 'LiquidityRewardsMsig'), -(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager -(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 -(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 -(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 -(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager +(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager +(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 +(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 +(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 +(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager (0xE5576eB1dD4aA524D67Cf9a32C8742540252b6F4, 'Ethereum', 'LiquidityRewardMngr'), --Sushi Reward Manager (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Polygon', 'LiquidityRewardsMsig'), (0x9cd7477521B7d7E7F9e2F091D2eA0084e8AaA290, 'Ethereum', 'PolygonTeamRewardsMsig'), @@ -44,7 +45,7 @@ select * from (values (0xde06d17db9295fa8c4082d4f73ff81592a3ac437, 'Ethereum', 'RCCMsig'), (0x834560f580764bc2e0b16925f8bf229bb00cb759, 'Ethereum', 'TRPMsig') ) as list(address, chain, name) - + ), diversifications_addresses AS ( @@ -69,34 +70,34 @@ select * from (values fundraising_txs AS ( select - evt_block_time, - value, - evt_tx_hash, + evt_block_time, + value, + evt_tx_hash, contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE contract_address IN (SELECT address FROM tokens) AND to IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('Aragon','FinanceOpsMsig') AND chain = 'Ethereum' ) - AND "from" IN (SELECT address FROM diversifications_addresses) + AND "from" IN (SELECT address FROM diversifications_addresses) AND contract_address != 0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32 ) SELECT - evt_block_time AS period, + evt_block_time AS period, contract_address AS token, value AS amount_token, evt_tx_hash FROM fundraising_txs - - + + UNION ALL --ETH inflow - SELECT + SELECT block_time AS period, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 AS token, tr.value, @@ -104,9 +105,9 @@ fundraising_txs AS ( FROM {{source('ethereum','traces')}} tr WHERE tr.success = True AND tr.to IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('Aragon','FinanceOpsMsig') AND chain = 'Ethereum' ) AND tr."from" IN ( SELECT address FROM diversifications_addresses ) diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_ldo_referral_payment.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_ldo_referral_payment.sql similarity index 92% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_ldo_referral_payment.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_ldo_referral_payment.sql index c601b96ee20..fb53e3eef02 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_ldo_referral_payment.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_ldo_referral_payment.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'ldo_referral_payment', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -13,7 +14,7 @@ --ref{{'lido_accounting_ldo_referral_payment'}} with tokens AS ( -select * from (values +select * from (values (0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32), --LDO (0x6B175474E89094C44Da98b954EedeAC495271d0F), --DAI (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --USDC @@ -30,11 +31,11 @@ select * from (values (0x3e40d73eb977dc6a537af587d48316fee66e9c8c, 'Ethereum', 'Aragon'), (0x48F300bD3C52c7dA6aAbDE4B683dEB27d38B9ABb, 'Ethereum', 'FinanceOpsMsig'), (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Ethereum', 'LiquidityRewardsMsig'), -(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager -(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 -(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 -(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 -(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager +(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager +(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 +(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 +(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 +(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager (0xE5576eB1dD4aA524D67Cf9a32C8742540252b6F4, 'Ethereum', 'LiquidityRewardMngr'), --Sushi Reward Manager (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Polygon', 'LiquidityRewardsMsig'), (0x9cd7477521B7d7E7F9e2F091D2eA0084e8AaA290, 'Ethereum', 'PolygonTeamRewardsMsig'), @@ -47,7 +48,7 @@ select * from (values (0xde06d17db9295fa8c4082d4f73ff81592a3ac437, 'Ethereum', 'RCCMsig'), (0x834560f580764bc2e0b16925f8bf229bb00cb759, 'Ethereum', 'TRPMsig') ) as list(address, chain, name) - + ), diversifications_addresses AS ( @@ -98,7 +99,7 @@ ldo_referral_payment_txns AS ( --only LDO referral program, need to add DAI refe AND _to IN ( SELECT address FROM ldo_referral_payments_addr ) - ORDER BY evt_block_time + ORDER BY evt_block_time ) @@ -106,6 +107,6 @@ ldo_referral_payment_txns AS ( --only LDO referral program, need to add DAI refe evt_tx_hash, contract_address AS token, amnt AS amount_token - FROM ldo_referral_payment_txns + FROM ldo_referral_payment_txns WHERE amnt != 0 diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_lego_expenses.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_lego_expenses.sql similarity index 84% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_lego_expenses.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_lego_expenses.sql index 9f95e307270..3295d946673 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_lego_expenses.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_lego_expenses.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'lego_expenses', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -14,7 +15,7 @@ with tokens AS ( -select * from (values +select * from (values (0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32), --LDO (0x6B175474E89094C44Da98b954EedeAC495271d0F), --DAI (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --USDC @@ -31,11 +32,11 @@ select * from (values (0x3e40d73eb977dc6a537af587d48316fee66e9c8c, 'Ethereum', 'Aragon'), (0x48F300bD3C52c7dA6aAbDE4B683dEB27d38B9ABb, 'Ethereum', 'FinanceOpsMsig'), (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Ethereum', 'LiquidityRewardsMsig'), -(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager -(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 -(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 -(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 -(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager +(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager +(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 +(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 +(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 +(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager (0xE5576eB1dD4aA524D67Cf9a32C8742540252b6F4, 'Ethereum', 'LiquidityRewardMngr'), --Sushi Reward Manager (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Polygon', 'LiquidityRewardsMsig'), (0x9cd7477521B7d7E7F9e2F091D2eA0084e8AaA290, 'Ethereum', 'PolygonTeamRewardsMsig'), @@ -48,7 +49,7 @@ select * from (values (0xde06d17db9295fa8c4082d4f73ff81592a3ac437, 'Ethereum', 'RCCMsig'), (0x834560f580764bc2e0b16925f8bf229bb00cb759, 'Ethereum', 'TRPMsig') ) as list(address, chain, name) - + ), diversifications_addresses AS ( @@ -75,49 +76,49 @@ select * from (values lego_expenses_txns AS ( select evt_block_time, - CAST(value AS DOUBLE) AS value, - evt_tx_hash, - contract_address + CAST(value AS DOUBLE) AS value, + evt_tx_hash, + contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE contract_address IN (SELECT address FROM tokens) AND "from" IN ( SELECT - address - FROM multisigs_list + address + FROM multisigs_list WHERE name = 'LegoMsig' AND chain = 'Ethereum' ) AND to NOT IN (SELECT address FROM multisigs_list UNION ALL SELECT address FROM intermediate_addresses UNION ALL - SELECT address FROM diversifications_addresses - ) - + SELECT address FROM diversifications_addresses + ) + UNION ALL - - SELECT - evt_block_time, - -CAST(value AS DOUBLE) AS value, - evt_tx_hash, + + SELECT + evt_block_time, + -CAST(value AS DOUBLE) AS value, + evt_tx_hash, contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE contract_address IN (SELECT address FROM tokens) AND to IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name = 'LegoMsig' AND chain = 'Ethereum') AND "from" NOT IN (SELECT address FROM multisigs_list UNION ALL SELECT address FROM intermediate_addresses UNION ALL - SELECT address FROM diversifications_addresses - ) + SELECT address FROM diversifications_addresses + ) ) - SELECT - evt_block_time AS period, + SELECT + evt_block_time AS period, contract_address AS token, value AS amount_token, evt_tx_hash diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_liquidity_incentives.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_liquidity_incentives.sql similarity index 76% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_liquidity_incentives.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_liquidity_incentives.sql index b0f3053fa3e..d17991e4a21 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_liquidity_incentives.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_liquidity_incentives.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'liquidity_incentives', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -13,9 +14,9 @@ --ref{{'lido_accounting_ethereum_liquidity_incentives'}} with tokens AS ( -select * from (values +select * from (values (0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32), --LDO - (0xfdb794692724153d1488ccdbe0c56c252596735f), --Opti LDO + (0xfdb794692724153d1488ccdbe0c56c252596735f), --Opti LDO (0x13ad51ed4f1b7e9dc168d8a00cb3f4ddd85efa60), --Arbi LDO (0x6B175474E89094C44Da98b954EedeAC495271d0F), --DAI (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --USDC @@ -24,7 +25,7 @@ select * from (values (0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0), --MATIC (0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84), --stETH (0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0), --wstETH - (0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb),-- Opti wstETH + (0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb),-- Opti wstETH (0x5979D7b546E38E414F7E9822514be443A4800529) --Arbi wstETH ) as tokens(address)), @@ -35,11 +36,11 @@ select * from (values (0x3e40d73eb977dc6a537af587d48316fee66e9c8c, 'Ethereum', 'Aragon'), (0x48F300bD3C52c7dA6aAbDE4B683dEB27d38B9ABb, 'Ethereum', 'FinanceOpsMsig'), (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Ethereum', 'LiquidityRewardsMsig'), -(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager -(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 -(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 -(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 -(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager +(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager +(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 +(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 +(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 +(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager (0xE5576eB1dD4aA524D67Cf9a32C8742540252b6F4, 'Ethereum', 'LiquidityRewardMngr'), --Sushi Reward Manager (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Polygon', 'LiquidityRewardsMsig'), (0x9cd7477521B7d7E7F9e2F091D2eA0084e8AaA290, 'Ethereum', 'PolygonTeamRewardsMsig'), @@ -52,7 +53,7 @@ select * from (values (0xde06d17db9295fa8c4082d4f73ff81592a3ac437, 'Ethereum', 'RCCMsig'), (0x834560f580764bc2e0b16925f8bf229bb00cb759, 'Ethereum', 'TRPMsig') ) as list(address, chain, name) - + ), diversifications_addresses AS ( @@ -77,18 +78,18 @@ select * from (values ethereum_liquidity_incentives_txns AS ( -- Ethereum Liq Incentives - SELECT - evt_block_time, - CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", + SELECT + evt_block_time, + CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE "from" IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name in ('LiquidityRewardsMsig', 'LiquidityRewardMngr') AND chain = 'Ethereum' ) AND to NOT IN ( @@ -96,23 +97,23 @@ ethereum_liquidity_incentives_txns AS ( UNION ALL SELECT address FROM intermediate_addresses UNION ALL - SELECT address FROM diversifications_addresses + SELECT address FROM diversifications_addresses ) - + UNION ALL - + SELECT - evt_block_time, - -CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", - contract_address + evt_block_time, + -CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", + contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE to IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('LiquidityRewardsMsig', 'LiquidityRewardMngr') AND chain = 'Ethereum' ) AND "from" NOT IN ( @@ -120,75 +121,75 @@ ethereum_liquidity_incentives_txns AS ( UNION ALL SELECT address FROM intermediate_addresses UNION ALL - SELECT address FROM diversifications_addresses + SELECT address FROM diversifications_addresses ) - - UNION ALL - + + UNION ALL + -- Optimism Incentives - SELECT - evt_block_time, - CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", + SELECT + evt_block_time, + CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", contract_address FROM {{source('erc20_optimism','evt_transfer')}} WHERE "from" IN ( - SELECT - address + SELECT + address FROM multisigs_list WHERE name IN ('LiquidityRewardsMsig') AND chain = 'Optimism' ) AND to != 0x0000000000000000000000000000000000000000 UNION ALL - SELECT + SELECT evt_block_time, - -CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", - contract_address + -CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", + contract_address FROM {{source('erc20_optimism','evt_transfer')}} WHERE to IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('LiquidityRewardsMsig') AND chain = 'Optimism' ) AND "from" != 0x0000000000000000000000000000000000000000 - + UNION ALL - + -- Arbitrum Incentives - SELECT - evt_block_time, - CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", + SELECT + evt_block_time, + CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", contract_address FROM {{source('erc20_arbitrum','evt_transfer')}} WHERE "from" IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('LiquidityRewardsMsig') AND chain = 'Arbitrum' ) AND to != 0x0000000000000000000000000000000000000000 UNION ALL - SELECT - evt_block_time, - -CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", - contract_address + SELECT + evt_block_time, + -CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", + contract_address FROM {{source('erc20_arbitrum','evt_transfer')}} WHERE to IN ( - SELECT + SELECT address - FROM multisigs_list + FROM multisigs_list WHERE name IN ('LiquidityRewardsMsig') AND chain = 'Arbitrum' ) and "from" != 0x0000000000000000000000000000000000000000 @@ -196,20 +197,20 @@ ethereum_liquidity_incentives_txns AS ( ) - SELECT - evt_block_time AS period, + SELECT + evt_block_time AS period, evt_tx_hash, value AS amount_token, - CASE + CASE WHEN contract_address = 0x0914d4ccc4154ca864637b0b653bc5fd5e1d3ecf THEN 0x5a98fcbea516cf06857215779fd812ca3bef1b32 --anyLDO - WHEN contract_address = 0xfdb794692724153d1488ccdbe0c56c252596735f THEN 0x5a98fcbea516cf06857215779fd812ca3bef1b32 --Opti LDO - WHEN contract_address = 0x13ad51ed4f1b7e9dc168d8a00cb3f4ddd85efa60 THEN 0x5a98fcbea516cf06857215779fd812ca3bef1b32 --Arbi LDO - WHEN contract_address = 0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb THEN 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0-- Opti wstETH - WHEN contract_address = 0x5979D7b546E38E414F7E9822514be443A4800529 THEN 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0-- Arbi wstETH + WHEN contract_address = 0xfdb794692724153d1488ccdbe0c56c252596735f THEN 0x5a98fcbea516cf06857215779fd812ca3bef1b32 --Opti LDO + WHEN contract_address = 0x13ad51ed4f1b7e9dc168d8a00cb3f4ddd85efa60 THEN 0x5a98fcbea516cf06857215779fd812ca3bef1b32 --Arbi LDO + WHEN contract_address = 0x1F32b1c2345538c0c6f582fCB022739c4A194Ebb THEN 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0-- Opti wstETH + WHEN contract_address = 0x5979D7b546E38E414F7E9822514be443A4800529 THEN 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0-- Arbi wstETH ELSE contract_address - END AS token + END AS token FROM ethereum_liquidity_incentives_txns WHERE contract_address IN (SELECT address FROM tokens) and value != 0 - + diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_lox_incentives.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_lox_incentives.sql similarity index 69% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_lox_incentives.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_lox_incentives.sql index 240ef8a3418..b300b7222b0 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_lox_incentives.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_lox_incentives.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'lox_incentives', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -10,10 +11,10 @@ ) }} --https://dune.com/queries/2012051 ---ref{{'lido_accounting_lox_incentives'}} +--ref{{'lido_accounting_lox_incentives'}} with tokens AS ( -select * from (values +select * from (values (0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32), --LDO (0x0914d4ccc4154ca864637b0b653bc5fd5e1d3ecf),--anyLDO (0xc3c7d422809852031b44ab29eec9f1eff2a58756), --Poly LDO @@ -24,8 +25,8 @@ select * from (values (0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0), --MATIC (0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84), --stETH (0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0), --wstETH - (0x03b54A6e9a984069379fae1a4fC4dBAE93B3bCCD)-- Poly wstETH - + (0x03b54A6e9a984069379fae1a4fC4dBAE93B3bCCD)-- Poly wstETH + ) as tokens(address)), @@ -35,11 +36,11 @@ select * from (values (0x3e40d73eb977dc6a537af587d48316fee66e9c8c, 'Ethereum', 'Aragon'), (0x48F300bD3C52c7dA6aAbDE4B683dEB27d38B9ABb, 'Ethereum', 'FinanceOpsMsig'), (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Ethereum', 'LiquidityRewardsMsig'), -(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager -(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 -(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 -(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 -(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager +(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager +(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 +(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 +(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 +(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager (0xE5576eB1dD4aA524D67Cf9a32C8742540252b6F4, 'Ethereum', 'LiquidityRewardMngr'), --Sushi Reward Manager (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Polygon', 'LiquidityRewardsMsig'), (0x9cd7477521B7d7E7F9e2F091D2eA0084e8AaA290, 'Ethereum', 'PolygonTeamRewardsMsig'), @@ -52,7 +53,7 @@ select * from (values (0xde06d17db9295fa8c4082d4f73ff81592a3ac437, 'Ethereum', 'RCCMsig'), (0x834560f580764bc2e0b16925f8bf229bb00cb759, 'Ethereum', 'TRPMsig') ) as list(address, chain, name) - + ), diversifications_addresses AS ( @@ -78,178 +79,178 @@ select * from (values lox_incentives_txns AS ( -- Polygon Incentives - select - evt_block_time, - CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", + select + evt_block_time, + CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", contract_address FROM {{source('erc20_polygon','evt_transfer')}} WHERE "from" IN ( SELECT - address - FROM multisigs_list + address + FROM multisigs_list WHERE name IN ('LiquidityRewardsMsig') AND chain = 'Polygon' ) AND to != 0x0000000000000000000000000000000000000000 - + UNION ALL - - SELECT - evt_block_time, - -CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", - contract_address + + SELECT + evt_block_time, + -CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", + contract_address FROM {{source('erc20_polygon','evt_transfer')}} WHERE to IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('LiquidityRewardsMsig') AND chain = 'Polygon' ) AND "from" != 0x0000000000000000000000000000000000000000 - + UNION ALL - - SELECT - evt_block_time, - CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", + + SELECT + evt_block_time, + CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE to IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('PolygonTeamRewardsMsig' ) AND chain = 'Ethereum' ) AND "from" IN (SELECT address FROM multisigs_list WHERE name = 'Aragon' and chain = 'Ethereum' ) - + UNION ALL - + SELECT evt_block_time, - -CAST(value AS DOUBLE), - evt_tx_hash, - to, - "from", + -CAST(value AS DOUBLE), + evt_tx_hash, + to, + "from", contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE "from" IN ( - SELECT + SELECT address - FROM multisigs_list + FROM multisigs_list WHERE name IN ('PolygonTeamRewardsMsig' ) and chain = 'Ethereum' ) AND to IN (SELECT address FROM multisigs_list WHERE name = 'Aragon' and chain = 'Ethereum' ) - + UNION ALL - + -- Solana, Terra Liq Incentives - SELECT - evt_block_time, - CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", + SELECT + evt_block_time, + CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE "from" IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('LiquidityRewardsMsig', 'Aragon', 'ReferralRewardsMsig') AND chain = 'Ethereum' ) AND to IN ( - SELECT - address - FROM intermediate_addresses - WHERE name IN ('Jumpgate(Solana)','Wormhole bridge') + SELECT + address + FROM intermediate_addresses + WHERE name IN ('Jumpgate(Solana)','Wormhole bridge') ) UNION ALL SELECT - evt_block_time, - -CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", - contract_address + evt_block_time, + -CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", + contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE to IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('LiquidityRewardsMsig', 'Aragon', 'ReferralRewardsMsig') and chain = 'Ethereum' ) AND "from" IN ( - SELECT - address - FROM intermediate_addresses - WHERE name IN ('Jumpgate(Solana)','Wormhole bridge') + SELECT + address + FROM intermediate_addresses + WHERE name IN ('Jumpgate(Solana)','Wormhole bridge') ) UNION ALL -- Polkadot, Kusama Incentives - SELECT - evt_block_time, - CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", + SELECT + evt_block_time, + CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE "from" IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('LiquidityRewardsMsig') AND chain = 'Ethereum' ) AND to IN ( - SELECT - address - FROM intermediate_addresses - WHERE name IN ('AnySwap bridge (Polkadot, Kusama)') + SELECT + address + FROM intermediate_addresses + WHERE name IN ('AnySwap bridge (Polkadot, Kusama)') ) UNION ALL - SELECT - evt_block_time, - -CAST(value AS DOUBLE) AS value, - evt_tx_hash, - to, - "from", - contract_address + SELECT + evt_block_time, + -CAST(value AS DOUBLE) AS value, + evt_tx_hash, + to, + "from", + contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE to IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('LiquidityRewardsMsig') and chain = 'Ethereum' ) AND "from" IN ( - SELECT - address - FROM intermediate_addresses - WHERE name IN ('AnySwap bridge (Polkadot, Kusama)') + SELECT + address + FROM intermediate_addresses + WHERE name IN ('AnySwap bridge (Polkadot, Kusama)') ) -) +) - SELECT - evt_block_time AS period, + SELECT + evt_block_time AS period, evt_tx_hash, value AS amount_token, CASE WHEN contract_address = 0x0914d4ccc4154ca864637b0b653bc5fd5e1d3ecf THEN 0x5a98fcbea516cf06857215779fd812ca3bef1b32 --anyLDO - WHEN contract_address = 0xc3c7d422809852031b44ab29eec9f1eff2a58756 THEN 0x5a98fcbea516cf06857215779fd812ca3bef1b32 --Poly LDO + WHEN contract_address = 0xc3c7d422809852031b44ab29eec9f1eff2a58756 THEN 0x5a98fcbea516cf06857215779fd812ca3bef1b32 --Poly LDO WHEN contract_address = 0x03b54A6e9a984069379fae1a4fC4dBAE93B3bCCD THEN 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 --Poly wstETH ELSE contract_address - END AS token - + END AS token + FROM lox_incentives_txns WHERE contract_address IN (SELECT address FROM tokens) and value != 0 diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_operating_expenses.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_operating_expenses.sql similarity index 84% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_operating_expenses.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_operating_expenses.sql index dce8e5c40f8..75b9374855f 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_operating_expenses.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_operating_expenses.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'operating_expenses', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -13,7 +14,7 @@ --ref{{'lido_accounting_operating_expenses'}} with tokens AS ( -select * from (values +select * from (values (0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32), --LDO (0x6B175474E89094C44Da98b954EedeAC495271d0F), --DAI (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --USDC @@ -30,11 +31,11 @@ select * from (values (0x3e40d73eb977dc6a537af587d48316fee66e9c8c, 'Ethereum', 'Aragon'), (0x48F300bD3C52c7dA6aAbDE4B683dEB27d38B9ABb, 'Ethereum', 'FinanceOpsMsig'), (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Ethereum', 'LiquidityRewardsMsig'), -(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager -(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 -(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 -(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 -(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager +(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager +(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 +(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 +(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 +(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager (0xE5576eB1dD4aA524D67Cf9a32C8742540252b6F4, 'Ethereum', 'LiquidityRewardMngr'), --Sushi Reward Manager (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Polygon', 'LiquidityRewardsMsig'), (0x9cd7477521B7d7E7F9e2F091D2eA0084e8AaA290, 'Ethereum', 'PolygonTeamRewardsMsig'), @@ -47,7 +48,7 @@ select * from (values (0xde06d17db9295fa8c4082d4f73ff81592a3ac437, 'Ethereum', 'RCCMsig'), (0x834560f580764bc2e0b16925f8bf229bb00cb759, 'Ethereum', 'TRPMsig') ) as list(address, chain, name) - + ), diversifications_addresses AS ( @@ -95,28 +96,28 @@ dai_referral_payments_addr AS ( NOT EXISTS (SELECT _recipient FROM {{source('lido_ethereum','AllowedRecipientsRegistry_evt_RecipientRemoved')}}) OR ( EXISTS (SELECT _recipient FROM {{source('lido_ethereum','AllowedRecipientsRegistry_evt_RecipientRemoved')}}) - AND + AND _recipient NOT IN (SELECT _recipient FROM {{source('lido_ethereum','AllowedRecipientsRegistry_evt_RecipientRemoved')}}) ) - ) + ) UNION ALL SELECT 0xaf8aE6955d07776aB690e565Ba6Fbc79B8dE3a5d --rhino ), -operating_expenses_txns AS ( +operating_expenses_txns AS ( SELECT - evt_block_time, - CAST(value AS DOUBLE) AS value, - evt_tx_hash, - contract_address, - "from", + evt_block_time, + CAST(value AS DOUBLE) AS value, + evt_tx_hash, + contract_address, + "from", to FROM {{source('erc20_ethereum','evt_transfer')}} WHERE contract_address IN (SELECT address FROM tokens) AND "from" IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('ATCMsig', 'PMLMsig', 'RCCMsig') AND chain = 'Ethereum' ) AND to NOT IN ( @@ -124,11 +125,11 @@ operating_expenses_txns AS ( UNION ALL SELECT address FROM intermediate_addresses UNION ALL - SELECT address FROM ldo_referral_payments_addr + SELECT address FROM ldo_referral_payments_addr UNION ALL SELECT 0x0000000000000000000000000000000000000000 UNION ALL - SELECT address FROM diversifications_addresses + SELECT address FROM diversifications_addresses ) UNION ALL --ETH outflow @@ -136,15 +137,15 @@ operating_expenses_txns AS ( block_time, CAST(tr.value AS DOUBLE) AS value, tx_hash, - 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, - "from", + 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, + "from", to FROM {{source('ethereum','traces')}} tr WHERE tr.success= True AND tr."from" IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('ATCMsig', 'PMLMsig', 'RCCMsig') AND chain = 'Ethereum' ) AND tr.type='call' @@ -153,18 +154,18 @@ operating_expenses_txns AS ( UNION ALL SELECT - evt_block_time, - -CAST(value AS DOUBLE) AS value, - evt_tx_hash, - contract_address, - "from", + evt_block_time, + -CAST(value AS DOUBLE) AS value, + evt_tx_hash, + contract_address, + "from", to FROM {{source('erc20_ethereum','evt_transfer')}} WHERE contract_address IN (SELECT address FROM tokens) AND to IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('ATCMsig', 'PMLMsig', 'RCCMsig') AND chain = 'Ethereum' ) AND "from" NOT IN ( @@ -172,11 +173,11 @@ operating_expenses_txns AS ( UNION ALL SELECT address FROM intermediate_addresses UNION ALL - SELECT address FROM ldo_referral_payments_addr + SELECT address FROM ldo_referral_payments_addr UNION ALL SELECT 0x0000000000000000000000000000000000000000 UNION ALL - SELECT address FROM diversifications_addresses + SELECT address FROM diversifications_addresses ) UNION ALL --ETH outflow @@ -184,15 +185,15 @@ operating_expenses_txns AS ( block_time, -CAST(tr.value AS DOUBLE) AS value, tx_hash, - 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, - "from", + 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, + "from", to FROM {{source('ethereum','traces')}} tr WHERE tr.success= True AND tr.to IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('ATCMsig', 'PMLMsig', 'RCCMsig') AND chain = 'Ethereum' ) AND tr.type='call' @@ -203,7 +204,7 @@ operating_expenses_txns AS ( SELECT - evt_block_time AS period, + evt_block_time AS period, contract_address AS token, value AS amount_token, evt_tx_hash diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_other_expenses.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_expenses.sql similarity index 89% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_other_expenses.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_expenses.sql index 698bacfd08d..88a08db5ca6 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_other_expenses.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_expenses.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'other_expenses', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -15,7 +16,7 @@ with tokens AS ( -select * from (values +select * from (values (0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32), --LDO (0x6B175474E89094C44Da98b954EedeAC495271d0F), --DAI (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --USDC @@ -32,11 +33,11 @@ multisigs_list AS ( (0x3e40d73eb977dc6a537af587d48316fee66e9c8c, 'Ethereum', 'Aragon'), (0x48F300bD3C52c7dA6aAbDE4B683dEB27d38B9ABb, 'Ethereum', 'FinanceOpsMsig'), (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Ethereum', 'LiquidityRewardsMsig'), - (0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager - (0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 - (0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 - (0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 - (0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager + (0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager + (0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 + (0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 + (0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 + (0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager (0xE5576eB1dD4aA524D67Cf9a32C8742540252b6F4, 'Ethereum', 'LiquidityRewardMngr'), --Sushi Reward Manager (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Polygon', 'LiquidityRewardsMsig'), (0x9cd7477521B7d7E7F9e2F091D2eA0084e8AaA290, 'Ethereum', 'PolygonTeamRewardsMsig'), @@ -49,7 +50,7 @@ multisigs_list AS ( (0xde06d17db9295fa8c4082d4f73ff81592a3ac437, 'Ethereum', 'RCCMsig'), (0x834560f580764bc2e0b16925f8bf229bb00cb759, 'Ethereum', 'TRPMsig') ) as list(address, chain, name) - + ), diversifications_addresses AS ( @@ -100,7 +101,7 @@ steth_referral_payments_addr AS ( ), stonks as ( - select * from (values + select * from (values ('STETH→DAI', 0x3e2D251275A92a8169A3B17A2C49016e2de492a7), ('STETH→USDC', 0xf4F6A03E3dbf0aA22083be80fDD340943d275Ea5), ('STETH→USDT', 0x7C2a1E25cA6D778eCaEBC8549371062487846aAF), @@ -114,9 +115,9 @@ stonks as ( ), cow_settlement as ( - select * from (values + select * from (values (0x9008D19f58AAbD9eD0D60971565AA8510560ab41) - ) as list(address) + ) as list(address) ), stonks_orders_txns as ( @@ -125,23 +126,23 @@ stonks_orders_txns as ( where "from" in ( select cast(replace(topic1, 0x000000000000000000000000, 0x) as varbinary) as order_addr from {{source('ethereum', 'logs')}} l - join stonks s on l.contract_address = s.address + join stonks s on l.contract_address = s.address and l.topic0 = 0x96a6d5477fba36522dca4102be8b3785435baf902ef6c4edebcb99850630c75f -- Stonks Deployed - ) + ) and to in (select address from cow_settlement) ), other_expenses_txns AS ( - SELECT + SELECT evt_block_time, - CAST(value AS DOUBLE) AS value, - evt_tx_hash, + CAST(value AS DOUBLE) AS value, + evt_tx_hash, contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE contract_address IN (SELECT address FROM tokens) AND "from" IN ( - SELECT - address + SELECT + address FROM multisigs_list WHERE name IN ('Aragon','FinanceOpsMsig') AND chain = 'Ethereum' ) @@ -152,18 +153,18 @@ other_expenses_txns AS ( UNION ALL SELECT address FROM ldo_referral_payments_addr UNION ALL - SELECT address FROM dai_referral_payments_addr + SELECT address FROM dai_referral_payments_addr UNION ALL SELECT address FROM steth_referral_payments_addr UNION ALL SELECT 0x0000000000000000000000000000000000000000 UNION ALL - SELECT address FROM diversifications_addresses + SELECT address FROM diversifications_addresses ) - AND evt_tx_hash NOT IN (select evt_tx_hash from stonks_orders_txns) + AND evt_tx_hash NOT IN (select evt_tx_hash from stonks_orders_txns) UNION ALL --ETH outflow - SELECT + SELECT block_time, CAST(tr.value AS DOUBLE) AS value, tx_hash, @@ -171,16 +172,16 @@ other_expenses_txns AS ( FROM {{source('ethereum','traces')}} tr WHERE tr.success = True AND tr."from" IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('Aragon','FinanceOpsMsig') AND chain = 'Ethereum' ) AND tr.to NOT IN ( - SELECT - address + SELECT + address FROM multisigs_list - UNION ALL + UNION ALL SELECT address FROM diversifications_addresses) AND tr.type='call' AND (tr.call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR tr.call_type IS NULL @@ -190,8 +191,8 @@ other_expenses_txns AS ( ) - SELECT - evt_block_time AS period, + SELECT + evt_block_time AS period, contract_address AS token, value AS amount_token, evt_tx_hash diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_other_income.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_income.sql similarity index 86% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_other_income.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_income.sql index 5004bee2e8b..6eec920ac67 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_other_income.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_other_income.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'other_income', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -13,7 +14,7 @@ --ref{{'lido_accounting_other_income'}} with tokens AS ( -select * from (values +select * from (values (0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32), --LDO (0x6B175474E89094C44Da98b954EedeAC495271d0F), --DAI (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --USDC @@ -30,11 +31,11 @@ select * from (values (0x3e40d73eb977dc6a537af587d48316fee66e9c8c, 'Ethereum', 'Aragon'), (0x48F300bD3C52c7dA6aAbDE4B683dEB27d38B9ABb, 'Ethereum', 'FinanceOpsMsig'), (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Ethereum', 'LiquidityRewardsMsig'), -(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager -(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 -(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 -(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 -(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager +(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager +(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 +(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 +(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 +(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager (0xE5576eB1dD4aA524D67Cf9a32C8742540252b6F4, 'Ethereum', 'LiquidityRewardMngr'), --Sushi Reward Manager (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Polygon', 'LiquidityRewardsMsig'), (0x9cd7477521B7d7E7F9e2F091D2eA0084e8AaA290, 'Ethereum', 'PolygonTeamRewardsMsig'), @@ -47,7 +48,7 @@ select * from (values (0xde06d17db9295fa8c4082d4f73ff81592a3ac437, 'Ethereum', 'RCCMsig'), (0x834560f580764bc2e0b16925f8bf229bb00cb759, 'Ethereum', 'TRPMsig') ) as list(address, chain, name) - + ), diversifications_addresses AS ( @@ -92,13 +93,13 @@ dai_referral_payments_addr AS ( SELECT _recipient AS address FROM {{source('lido_ethereum','AllowedRecipientsRegistry_evt_RecipientAdded')}} WHERE ( - NOT EXISTS (SELECT _recipient FROM {{source('lido_ethereum','AllowedRecipientsRegistry_evt_RecipientRemoved')}}) + NOT EXISTS (SELECT _recipient FROM {{source('lido_ethereum','AllowedRecipientsRegistry_evt_RecipientRemoved')}}) OR ( EXISTS (SELECT _recipient FROM {{source('lido_ethereum','AllowedRecipientsRegistry_evt_RecipientRemoved')}}) - AND + AND _recipient NOT IN (SELECT _recipient FROM {{source('lido_ethereum','AllowedRecipientsRegistry_evt_RecipientRemoved')}}) ) - ) + ) UNION ALL SELECT 0xaf8aE6955d07776aB690e565Ba6Fbc79B8dE3a5d --rhino ), @@ -109,16 +110,16 @@ steth_referral_payments_addr AS ( other_income_txns AS ( SELECT - evt_block_time, - CAST(value AS DOUBLE) AS value, - evt_tx_hash, + evt_block_time, + CAST(value AS DOUBLE) AS value, + evt_tx_hash, contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE contract_address IN (SELECT address FROM tokens) AND to IN ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('Aragon','FinanceOpsMsig') AND chain = 'Ethereum' ) AND "from" NOT IN ( @@ -126,20 +127,20 @@ other_income_txns AS ( UNION ALL SELECT address FROM ldo_referral_payments_addr UNION ALL - SELECT address FROM dai_referral_payments_addr + SELECT address FROM dai_referral_payments_addr UNION ALL SELECT address FROM steth_referral_payments_addr UNION ALL select 0x0000000000000000000000000000000000000000 UNION ALL - SELECT address FROM diversifications_addresses - ) + SELECT address FROM diversifications_addresses + ) UNION ALL --ETH staked by DAO SELECT - t.evt_block_time as period, - CAST(t.value AS DOUBLE) AS token_amount, - t.evt_tx_hash, + t.evt_block_time as period, + CAST(t.value AS DOUBLE) AS token_amount, + t.evt_tx_hash, t.contract_address FROM {{source('erc20_ethereum','evt_transfer')}} t join {{source('lido_ethereum','steth_evt_Submitted')}} s on t.evt_tx_hash = s.evt_tx_hash @@ -151,12 +152,12 @@ other_income_txns AS ( --Solana stSOL income-- stsol_income_txs AS ( - select - tx_id, - block_time AS period, - block_slot, - pre_token_balance, - post_token_balance, + select + tx_id, + block_time AS period, + block_slot, + pre_token_balance, + post_token_balance, token_balance_change AS delta FROM {{source('solana','account_activity')}} WHERE block_time >= CAST('2021-11-01' AS TIMESTAMP) @@ -168,23 +169,23 @@ stsol_income_txs AS ( ), stsol_income AS ( - SELECT + SELECT i.period AS period, '7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj' AS token, COALESCE(delta,0) AS amount_token, tx_id as evt_tx_hash - FROM stsol_income_txs i - + FROM stsol_income_txs i + ) SELECT * from ( SELECT - evt_block_time AS period, + evt_block_time AS period, contract_address AS token, value AS amount_token, evt_tx_hash FROM other_income_txns - + UNION ALL --ETH inflow SELECT @@ -195,22 +196,22 @@ SELECT * from ( FROM {{source('ethereum','traces')}} tr WHERE tr.success = True AND tr.to in ( - SELECT - address - FROM multisigs_list + SELECT + address + FROM multisigs_list WHERE name IN ('Aragon','FinanceOpsMsig') AND chain = 'Ethereum' ) - AND tr."from" NOT IN ( + AND tr."from" NOT IN ( SELECT address FROM multisigs_list - UNION ALL - SELECT address FROM diversifications_addresses + UNION ALL + SELECT address FROM diversifications_addresses ) AND tr.type='call' AND (tr.call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR tr.call_type IS NULL) - + UNION --stSOL to solana treasury SELECT - period, + period, from_base64('7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj') AS token, amount_token, from_base64(evt_tx_hash) diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_revenue.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_revenue.sql similarity index 91% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_revenue.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_revenue.sql index 9373633f012..9847c63cf48 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_revenue.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_revenue.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'revenue', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -13,7 +14,7 @@ --https://dune.com/queries/2011922 --ref{{'lido_accounting_revenue'}} -with +with addresses AS ( select * from (values (0x3e40d73eb977dc6a537af587d48316fee66e9c8c, 'Aragon'), @@ -23,28 +24,28 @@ select * from (values ) as list(address, name) ), -oracle_txns AS ( +oracle_txns AS ( SELECT evt_block_time AS period, (CAST(postTotalPooledEther AS DOUBLE)-CAST(preTotalPooledEther AS DOUBLE)) lido_rewards, evt_tx_hash FROM {{source('lido_ethereum','LegacyOracle_evt_PostTotalShares')}} - WHERE evt_block_time <= timestamp '2023-05-16 00:00' + WHERE evt_block_time <= timestamp '2023-05-16 00:00' ORDER BY 1 DESC ), -oraclev2_txns as ( - SELECT period, sum(treasury_revenue) as treasury_revenue, sum(operators_revenue) as operators_revenue, sum(insurance_revenue) as insurance_revenue, evt_tx_hash +oraclev2_txns as ( + SELECT period, sum(treasury_revenue) as treasury_revenue, sum(operators_revenue) as operators_revenue, sum(insurance_revenue) as insurance_revenue, evt_tx_hash FROM ( - SELECT + SELECT o.evt_block_time as period, case when t.to in (select address from addresses where name = 'Aragon') then cast(t.value as double) else 0 end AS treasury_revenue, case when t.to in (select address from addresses where name like 'NO%') then cast(t.value as double) else 0 end AS operators_revenue, case when t.to in (select address from addresses where name = 'InsuranceFund') then cast(t.value as double) else 0 end as insurance_revenue, o.evt_tx_hash FROM {{source('lido_ethereum','AccountingOracle_evt_ProcessingStarted')}} o - left join {{source('lido_ethereum','steth_evt_Transfer')}} t on o.evt_tx_hash = t.evt_tx_hash + left join {{source('lido_ethereum','steth_evt_Transfer')}} t on o.evt_tx_hash = t.evt_tx_hash and t."from" = 0x0000000000000000000000000000000000000000 and to in (select address from addresses) ) group by 1,5 @@ -52,16 +53,16 @@ oraclev2_txns as ( protocol_fee AS ( - SELECT - DATE_TRUNC('day', evt_block_time) AS period, + SELECT + DATE_TRUNC('day', evt_block_time) AS period, LEAD(DATE_TRUNC('day', evt_block_time), 1, NOW()) OVER (ORDER BY DATE_TRUNC('day', evt_block_time)) AS next_period, CAST(feeBasisPoints AS DOUBLE)/10000 AS points FROM {{source('lido_ethereum','steth_evt_FeeSet')}} ), protocol_fee_distribution AS ( - SELECT - DATE_TRUNC('day', evt_block_time) AS period, + SELECT + DATE_TRUNC('day', evt_block_time) AS period, LEAD(DATE_TRUNC('day', evt_block_time), 1, NOW()) OVER (ORDER BY DATE_TRUNC('day', evt_block_time)) AS next_period, CAST(insuranceFeeBasisPoints AS DOUBLE)/10000 AS insurance_points, CAST(operatorsFeeBasisPoints AS DOUBLE)/10000 AS operators_points, @@ -70,8 +71,8 @@ protocol_fee_distribution AS ( ) - SELECT - oracle_txns.period AS period, + SELECT + oracle_txns.period AS period, oracle_txns.evt_tx_hash, 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 AS token, lido_rewards AS total, @@ -89,8 +90,8 @@ protocol_fee_distribution AS ( union all - SELECT - oracle_txns.period AS period, + SELECT + oracle_txns.period AS period, oracle_txns.evt_tx_hash, 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 AS token, oracle_txns.treasury_revenue + oracle_txns.operators_revenue + oracle_txns.insurance_revenue AS total, diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_schema.yml b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_schema.yml similarity index 100% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_schema.yml rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_schema.yml diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_steth_referral_payment.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_steth_referral_payment.sql similarity index 85% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_steth_referral_payment.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_steth_referral_payment.sql index 176ea49830e..494e934de80 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_steth_referral_payment.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_steth_referral_payment.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'steth_referral_payment', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -14,7 +15,7 @@ --ref{{'lido_accounting_dai_referral_payment'}} with tokens AS ( -select * from (values +select * from (values (0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84) --stETH ) as tokens(address)), @@ -23,11 +24,11 @@ select * from (values (0x3e40d73eb977dc6a537af587d48316fee66e9c8c, 'Ethereum', 'Aragon'), (0x48F300bD3C52c7dA6aAbDE4B683dEB27d38B9ABb, 'Ethereum', 'FinanceOpsMsig'), (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Ethereum', 'LiquidityRewardsMsig'), -(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager -(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 -(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 -(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 -(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager +(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager +(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 +(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 +(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 +(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager (0xE5576eB1dD4aA524D67Cf9a32C8742540252b6F4, 'Ethereum', 'LiquidityRewardMngr'), --Sushi Reward Manager (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Polygon', 'LiquidityRewardsMsig'), (0x9cd7477521B7d7E7F9e2F091D2eA0084e8AaA290, 'Ethereum', 'PolygonTeamRewardsMsig'), @@ -40,7 +41,7 @@ select * from (values (0xde06d17db9295fa8c4082d4f73ff81592a3ac437, 'Ethereum', 'RCCMsig'), (0x834560f580764bc2e0b16925f8bf229bb00cb759, 'Ethereum', 'TRPMsig') ) as list(address, chain, name) - + ), @@ -52,7 +53,7 @@ steth_referral_payments_addr AS ( referral_payment_txns AS ( SELECT evt_block_time, - evt_tx_hash, + evt_tx_hash, contract_address, cast(value as double) as value FROM {{source('erc20_ethereum','evt_transfer')}} @@ -60,13 +61,13 @@ referral_payment_txns AS ( AND to IN ( SELECT address FROM steth_referral_payments_addr ) - AND evt_block_time >= CAST('2023-08-01 00:00' AS TIMESTAMP) + AND evt_block_time >= CAST('2023-08-01 00:00' AS TIMESTAMP) AND contract_address in (select address from tokens) - UNION ALL + UNION ALL SELECT evt_block_time, - evt_tx_hash, + evt_tx_hash, contract_address, -cast(value as double) FROM {{source('erc20_ethereum','evt_transfer')}} @@ -74,14 +75,14 @@ referral_payment_txns AS ( AND "from" IN ( SELECT address FROM steth_referral_payments_addr ) - AND evt_block_time >= CAST('2023-08-01 00:00' AS TIMESTAMP) + AND evt_block_time >= CAST('2023-08-01 00:00' AS TIMESTAMP) AND contract_address in (select address from tokens) ORDER BY evt_block_time -) +) SELECT evt_block_time as period, - evt_tx_hash, + evt_tx_hash, contract_address AS token, value AS amount_token - FROM referral_payment_txns \ No newline at end of file + FROM referral_payment_txns diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_trp_expenses.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_trp_expenses.sql similarity index 87% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_trp_expenses.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_trp_expenses.sql index 8391a30f8b0..6521769f9fc 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_trp_expenses.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_trp_expenses.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'trp_expenses', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -13,7 +14,7 @@ --ref{{'lido_accounting_trp_expenses'}} with tokens AS ( -select * from (values +select * from (values (0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32), --LDO (0x6B175474E89094C44Da98b954EedeAC495271d0F), --DAI (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --USDC @@ -29,11 +30,11 @@ select * from (values (0x3e40d73eb977dc6a537af587d48316fee66e9c8c, 'Ethereum', 'Aragon'), (0x48F300bD3C52c7dA6aAbDE4B683dEB27d38B9ABb, 'Ethereum', 'FinanceOpsMsig'), (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Ethereum', 'LiquidityRewardsMsig'), -(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager -(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 -(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 -(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 -(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager +(0x753D5167C31fBEB5b49624314d74A957Eb271709, 'Ethereum', 'LiquidityRewardMngr'),--Curve Rewards Manager +(0x1dD909cDdF3dbe61aC08112dC0Fdf2Ab949f79D8, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V1 +(0x55c8De1Ac17C1A937293416C9BCe5789CbBf61d1, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V2 +(0x86F6c353A0965eB069cD7f4f91C1aFEf8C725551, 'Ethereum', 'LiquidityRewardMngr'), --Balancer Rewards Manager V3 +(0xf5436129Cf9d8fa2a1cb6e591347155276550635, 'Ethereum', 'LiquidityRewardMngr'),--1inch Reward Manager (0xE5576eB1dD4aA524D67Cf9a32C8742540252b6F4, 'Ethereum', 'LiquidityRewardMngr'), --Sushi Reward Manager (0x87D93d9B2C672bf9c9642d853a8682546a5012B5, 'Polygon', 'LiquidityRewardsMsig'), (0x9cd7477521B7d7E7F9e2F091D2eA0084e8AaA290, 'Ethereum', 'PolygonTeamRewardsMsig'), @@ -46,7 +47,7 @@ select * from (values (0xde06d17db9295fa8c4082d4f73ff81592a3ac437, 'Ethereum', 'RCCMsig'), (0x834560f580764bc2e0b16925f8bf229bb00cb759, 'Ethereum', 'TRPMsig') ) as list(address, chain, name) - + ), intermediate_addresses AS ( @@ -63,33 +64,33 @@ select * from (values trp_expenses_txns AS ( - SELECT + SELECT evt_block_time, - CAST(value AS DOUBLE) AS value, - evt_tx_hash, + CAST(value AS DOUBLE) AS value, + evt_tx_hash, contract_address FROM {{source('erc20_ethereum','evt_transfer')}} WHERE contract_address = 0x5a98fcbea516cf06857215779fd812ca3bef1b32 AND "from" IN ( - SELECT - address + SELECT + address FROM multisigs_list WHERE name IN ('Aragon','FinanceOpsMsig') AND chain = 'Ethereum' ) AND to IN ( - SELECT - address + SELECT + address FROM multisigs_list WHERE name IN ('TRPMsig') AND chain = 'Ethereum' - ) - + ) + ) - SELECT - evt_block_time AS period, + SELECT + evt_block_time AS period, contract_address AS token, value AS amount_token, evt_tx_hash FROM trp_expenses_txns - + diff --git a/models/lido/accounting/ethereum/lido_accounting_ethereum_withdrawals.sql b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_withdrawals.sql similarity index 93% rename from models/lido/accounting/ethereum/lido_accounting_ethereum_withdrawals.sql rename to hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_withdrawals.sql index a227bd9a604..41dee557429 100644 --- a/models/lido/accounting/ethereum/lido_accounting_ethereum_withdrawals.sql +++ b/hourly_spellbook/models/_project/lido/accounting/ethereum/lido_accounting_ethereum_withdrawals.sql @@ -1,6 +1,7 @@ {{ config( + schema='lido_accounting_ethereum', alias = 'withdrawals', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -30,4 +31,4 @@ select time as period , withdrawn_principal*POWER(10, 18) as amount , date_trunc('day', time) as day from withdrawals -where withdrawn_principal != 0 \ No newline at end of file +where withdrawn_principal != 0 diff --git a/models/lido/lido_accounting.sql b/hourly_spellbook/models/_project/lido/lido_accounting.sql similarity index 96% rename from models/lido/lido_accounting.sql rename to hourly_spellbook/models/_project/lido/lido_accounting.sql index 0a0c109bc36..e84cfef4321 100644 --- a/models/lido/lido_accounting.sql +++ b/hourly_spellbook/models/_project/lido/lido_accounting.sql @@ -1,6 +1,7 @@ {{ config( + schema = 'lido', alias = 'accounting', - + materialized = 'table', file_format = 'delta', post_hook='{{ expose_spells(\'["ethereum"]\', @@ -13,7 +14,7 @@ with tokens AS ( select * from ( - values + values (0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32), --LDO (0x6B175474E89094C44Da98b954EedeAC495271d0F), --DAI (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), --USDC @@ -26,7 +27,7 @@ with tokens AS ( ), eth_prices as ( SELECT - CAST(DATE_TRUNC('day', minute) as date) AS period, + CAST(DATE_TRUNC('day', minute) as date) AS period, contract_address AS token, symbol, decimals, @@ -35,14 +36,14 @@ eth_prices as ( WHERE blockchain = 'ethereum' AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 AND DATE_TRUNC('day', minute) >= date '2020-12-01' - AND DATE_TRUNC('day', minute) <= DATE_TRUNC('day', NOW() - INTERVAL '1' DAY) + AND DATE_TRUNC('day', minute) <= DATE_TRUNC('day', NOW() - INTERVAL '1' DAY) AND EXTRACT(hour FROM minute) = 23 AND EXTRACT(minute FROM minute) = 59 - union all + union all SELECT - CAST(DATE_TRUNC('day', NOW()) as date) AS period, + CAST(DATE_TRUNC('day', NOW()) as date) AS period, contract_address AS token, symbol, decimals, @@ -50,13 +51,13 @@ eth_prices as ( FROM {{source('prices','usd')}} WHERE blockchain = 'ethereum' AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 - AND DATE_TRUNC('day', minute) = DATE_TRUNC('day', NOW() - INTERVAL '1' DAY) + AND DATE_TRUNC('day', minute) = DATE_TRUNC('day', NOW() - INTERVAL '1' DAY) AND EXTRACT(hour FROM minute) = 23 - AND EXTRACT(minute FROM minute) = 59 + AND EXTRACT(minute FROM minute) = 59 ), tokens_prices AS ( SELECT - CAST(DATE_TRUNC('day', prices.usd.minute) as date) AS period, + CAST(DATE_TRUNC('day', prices.usd.minute) as date) AS period, prices.usd.contract_address AS token, prices.usd.symbol, prices.usd.decimals, @@ -68,14 +69,14 @@ tokens_prices AS ( WHERE prices.usd.blockchain = 'ethereum' AND prices.usd.contract_address IN (SELECT address FROM tokens) AND DATE_TRUNC('day', minute) >= date '2020-12-01' - AND DATE_TRUNC('day', minute) <= DATE_TRUNC('day', NOW() - INTERVAL '1' DAY) + AND DATE_TRUNC('day', minute) <= DATE_TRUNC('day', NOW() - INTERVAL '1' DAY) AND EXTRACT(hour FROM prices.usd.minute) = 23 AND EXTRACT(minute FROM prices.usd.minute) = 59 - union all + union all - SELECT - CAST(date_trunc('minute',now()) as date) AS period, + SELECT + CAST(date_trunc('minute',now()) as date) AS period, p.contract_address AS token, p.symbol, p.decimals, @@ -86,14 +87,14 @@ tokens_prices AS ( left join eth_prices on DATE_TRUNC('day', p.minute) = eth_prices.period WHERE p.blockchain = 'ethereum' AND p.contract_address IN (SELECT address FROM tokens) - AND DATE_TRUNC('day', minute) = DATE_TRUNC('day', NOW() - INTERVAL '1' DAY) + AND DATE_TRUNC('day', minute) = DATE_TRUNC('day', NOW() - INTERVAL '1' DAY) AND EXTRACT(hour FROM p.minute) = 23 - AND EXTRACT(minute FROM p.minute) = 59 + AND EXTRACT(minute FROM p.minute) = 59 union all - SELECT - CAST(DATE_TRUNC('day', prices.usd.minute) as date) AS period, + SELECT + CAST(DATE_TRUNC('day', prices.usd.minute) as date) AS period, 0xedd1db59799c8b7753f141585986707812d783272eed8de22fab6b2a7d58ec0463, 'stSOL', 0, @@ -102,7 +103,7 @@ tokens_prices AS ( prices.usd.price/eth_prices.price as token_eth_price FROM {{source('prices','usd')}} left join eth_prices on DATE_TRUNC('day', prices.usd.minute) = eth_prices.period - WHERE prices.usd.symbol = 'stSOL' + WHERE prices.usd.symbol = 'stSOL' AND DATE_TRUNC('day', minute) >= date '2020-12-01' AND EXTRACT(hour FROM prices.usd.minute) = 23 AND EXTRACT(minute FROM prices.usd.minute) = 59 @@ -113,19 +114,19 @@ SELECT CAST(date_trunc('day', accounts.period) as date) as period, --partition accounts.secondary_label, accounts.account, accounts.category, - + SUM(coalesce(accounts.token_amount, 0))/coalesce(POWER(10,coalesce(tokens_prices.decimals, pt.decimals)),1) AS value_base_token, - - CASE WHEN pt.symbol = 'WETH' THEN 'ETH' - WHEN tokens_prices.token = 0xedd1db59799c8b7753f141585986707812d783272eed8de22fab6b2a7d58ec0463--0x3764486257586d63693364543855465957595a7765424c5867796375375933694c3674724b6e31593741526a + + CASE WHEN pt.symbol = 'WETH' THEN 'ETH' + WHEN tokens_prices.token = 0xedd1db59799c8b7753f141585986707812d783272eed8de22fab6b2a7d58ec0463--0x3764486257586d63693364543855465957595a7765424c5867796375375933694c3674724b6e31593741526a THEN 'stSOL' ELSE pt.symbol END AS base_token, coalesce(tokens_prices.token, accounts.token) AS base_token_address, - + coalesce(SUM(accounts.token_amount*tokens_prices.price)/POWER(10,coalesce(tokens_prices.decimals, pt.decimals)), 0) AS value_usd, case when coalesce(tokens_prices.token, accounts.token) = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 - then SUM(coalesce(accounts.token_amount, 0))/coalesce(POWER(10,coalesce(tokens_prices.decimals, pt.decimals)),1) - else coalesce(SUM(accounts.token_amount*tokens_prices.token_eth_price)/POWER(10,coalesce(tokens_prices.decimals, pt.decimals)), 0) + then SUM(coalesce(accounts.token_amount, 0))/coalesce(POWER(10,coalesce(tokens_prices.decimals, pt.decimals)),1) + else coalesce(SUM(accounts.token_amount*tokens_prices.token_eth_price)/POWER(10,coalesce(tokens_prices.decimals, pt.decimals)), 0) end AS value_eth, coalesce(tokens_prices.price, 0) as token_price, coalesce(tokens_prices.token_eth_price, 0) as token_eth_price @@ -139,7 +140,7 @@ FROM ( '1.1.2.1. Increases(+)' AS category, COALESCE(cast(amount as double),0) AS token_amount, 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 as token --ETH - from {{ref('lido_accounting_ethereum_buffer_inflow')}} + from {{ref('lido_accounting_ethereum_buffer_inflow')}} union all @@ -237,7 +238,7 @@ FROM ( '3.2. Operating Performance' AS secondary_label, '3.2.1. Net Revenue' AS account, '3.2.1.1. Gross staking rewards (+)' AS category, - case when date_trunc('day', period)<= cast('2023-05-15' as timestamp) then COALESCE(total,0) + case when date_trunc('day', period)<= cast('2023-05-15' as timestamp) then COALESCE(total,0) else COALESCE(insurance_revenue,0) + COALESCE(operators_revenue,0) + COALESCE(treasury_revenue,0) + COALESCE(depositors_revenue, 0) end AS token_amount, token @@ -251,7 +252,7 @@ FROM ( '1.3. Protocol Assets' AS secondary_label, '1.3.1. Protocol Assets' AS account, '1.3.1.1. stETH' AS category, - case when date_trunc('day', period)<= cast('2023-05-15' as timestamp) then COALESCE(total,0) + case when date_trunc('day', period)<= cast('2023-05-15' as timestamp) then COALESCE(total,0) else COALESCE(insurance_revenue,0) + COALESCE(operators_revenue,0) + COALESCE(treasury_revenue,0) + COALESCE(depositors_revenue, 0) end AS token_amount, coalesce(token, 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84) AS token @@ -267,7 +268,7 @@ FROM ( '3. Surplus' AS primary_label, '3.2. Operating Performance' AS secondary_label, '3.2.1. Net Revenue' AS account, - '3.2.1.2. Staking rewards to holders (-)' AS category, + '3.2.1.2. Staking rewards to holders (-)' AS category, -COALESCE(depositors_revenue,0), coalesce(token ,0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84) AS token FROM {{ref('lido_accounting_ethereum_revenue')}} @@ -293,7 +294,7 @@ FROM ( '3. Surplus' AS primary_label, '3.2. Operating Performance' AS secondary_label, '3.2.2. Cost of Revenue' AS account, - '3.2.2.1. Staking rewards to node operators (-)' AS category, + '3.2.2.1. Staking rewards to node operators (-)' AS category, -COALESCE(operators_revenue,0), coalesce(token ,0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84) AS token FROM {{ref('lido_accounting_ethereum_revenue')}} @@ -312,10 +313,10 @@ FROM ( UNION ALL - -- ========================================================= Provisions for slashing set aside + -- ========================================================= Provisions for slashing set aside -- On the same side of the balance sheet, a decrease in equity must be associated with an increase in liabilities to balance -- Slashing provision should go to an effective liability account through the following steps: - -- 1. Recognize the expense and the contra asset account + -- 1. Recognize the expense and the contra asset account -- 2. Recognize the slashing liability and the associated asset account SELECT period, @@ -323,7 +324,7 @@ FROM ( '3. Surplus' AS primary_label, '3.2. Operating Performance' AS secondary_label, '3.2.2. Cost of Revenue' AS account, - '3.2.2.2. Provision for slashing (-)' AS category, + '3.2.2.2. Provision for slashing (-)' AS category, -COALESCE(insurance_revenue,0), coalesce(token,0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84) AS token FROM {{ref('lido_accounting_ethereum_revenue')}} @@ -386,7 +387,7 @@ FROM ( '1. Assets' AS primary_label, '1.3. Protocol Assets' AS secondary_label, '1.3.1. Protocol Assets' AS account, - '1.3.1.1. stETH' AS category, + '1.3.1.1. stETH' AS category, -0, 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 AS base_token FROM {{ref('lido_accounting_ethereum_revenue')}} @@ -404,7 +405,7 @@ FROM ( '3.2.3.2. Deposit Referrals' AS category, -COALESCE(CAST(amount_token AS DOUBLE), 0), token - + FROM {{ref('lido_accounting_ethereum_ldo_referral_payment')}} UNION ALL @@ -431,7 +432,7 @@ FROM ( token FROM {{ref('lido_accounting_ethereum_dai_referral_payment')}} - UNION ALL + UNION ALL SELECT period, evt_tx_hash, @@ -486,10 +487,10 @@ FROM ( WHEN token = 0x6B175474E89094C44Da98b954EedeAC495271d0F THEN '1.3.1.2. DAI' WHEN token = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 THEN '1.3.1.3. ETH' ELSE '1.3.1.4. Other' - END AS category, + END AS category, -COALESCE(amount_token,0), token - + FROM {{ref('lido_accounting_ethereum_liquidity_incentives')}} WHERE token NOT IN (0x5a98fcbea516cf06857215779fd812ca3bef1b32) @@ -552,7 +553,7 @@ FROM ( '3.2.4. Operating expenses' AS account, '3.2.4.2. LEGO grants' AS category, -amount_token, - token + token FROM {{ref('lido_accounting_ethereum_lego_expenses')}} @@ -574,7 +575,7 @@ FROM ( FROM {{ref('lido_accounting_ethereum_lego_expenses')}} WHERE token NOT IN (0x5a98fcbea516cf06857215779fd812ca3bef1b32) - UNION ALL + UNION ALL SELECT period, evt_tx_hash, @@ -597,7 +598,7 @@ FROM ( '3.2.4. Operating expenses' AS account, '3.2.4.1. Operating expenses' AS category, -amount_token AS value, - token + token FROM {{ref('lido_accounting_ethereum_operating_expenses')}} UNION ALL @@ -642,7 +643,7 @@ FROM ( '3.2.4. Operating expenses' AS account, '3.2.4.4. Other' AS category, -amount_token, - token + token FROM {{ref('lido_accounting_ethereum_other_expenses')}} WHERE token NOT IN (0x5a98fcbea516cf06857215779fd812ca3bef1b32) @@ -676,7 +677,7 @@ FROM ( '3.2.4. Operating expenses' AS account, '3.2.4.1. Operating expenses' AS category, -amount_token, - token + token FROM {{ref('lido_accounting_ethereum_other_expenses')}} WHERE token IN (0x5a98fcbea516cf06857215779fd812ca3bef1b32) and evt_tx_hash <> 0xbee211044ed8f7c8e390c759388d864e4f2500a3f318552f5f522952ba7932fc @@ -704,7 +705,7 @@ FROM ( '3.2.4. Operating expenses' AS account, '3.2.4.3. TRP grants' AS category, -amount_token, - token + token FROM {{ref('lido_accounting_ethereum_trp_expenses')}} WHERE token IN (0x5a98fcbea516cf06857215779fd812ca3bef1b32) @@ -752,11 +753,11 @@ FROM ( END AS category, amount_token, token - FROM {{ref('lido_accounting_ethereum_other_income')}} + FROM {{ref('lido_accounting_ethereum_other_income')}} WHERE token NOT IN (0x5a98fcbea516cf06857215779fd812ca3bef1b32) - UNION ALL + UNION ALL SELECT period, @@ -784,7 +785,7 @@ FROM ( '1. Assets' AS primary_label, '1.3. Protocol Assets' AS secondary_label, '1.3.1. Protocol Assets' AS account, - CASE + CASE WHEN token in (0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84, 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0) THEN '1.3.1.1. stETH' WHEN token = 0x6B175474E89094C44Da98b954EedeAC495271d0F THEN '1.3.1.2. DAI' WHEN token = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 THEN '1.3.1.3. ETH' @@ -799,7 +800,7 @@ FROM ( LEFT JOIN tokens_prices ON CAST(date_trunc('day', accounts.period) as date) = tokens_prices.period AND ( ( - (accounts.token) = (tokens_prices.token) + (accounts.token) = (tokens_prices.token) AND (accounts.token) != 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 ) OR @@ -808,6 +809,6 @@ AND ( AND accounts.token = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 ) ) -LEFT JOIN {{ref('prices_tokens')}} pt ON accounts.token = pt.contract_address +LEFT JOIN {{source('prices','tokens')}} pt ON accounts.token = pt.contract_address GROUP BY 1,2,3,4,5,6,8,9, tokens_prices.decimals, pt.decimals, tokens_prices.price, tokens_prices.token_eth_price -ORDER BY period DESC \ No newline at end of file +ORDER BY period DESC diff --git a/models/lido/lido_liquidity.sql b/hourly_spellbook/models/_project/lido/lido_liquidity.sql similarity index 82% rename from models/lido/lido_liquidity.sql rename to hourly_spellbook/models/_project/lido/lido_liquidity.sql index 781f2e22b48..eadd5c77c34 100644 --- a/models/lido/lido_liquidity.sql +++ b/hourly_spellbook/models/_project/lido/lido_liquidity.sql @@ -1,6 +1,7 @@ {{ config( + schema = 'lido', alias = 'liquidity', - + post_hook='{{ expose_spells(\'["ethereum", "arbitrum", "optimism", "base", "zksync"]\', "project", "lido_liquidity", @@ -9,7 +10,7 @@ }} {% set lido_liquidity_models = [ - + ref('lido_liquidity_arbitrum_wombat_pools'), ref('lido_liquidity_arbitrum_kyberswap_pools'), ref('lido_liquidity_arbitrum_kyberswap_v2_pools'), @@ -54,7 +55,7 @@ ref('lido_liquidity_scroll_zebra_pools') ] %} -{% set project_start_date = '2020-12-15'%} +{% set project_start_date = '2020-12-15'%} with dates as ( @@ -65,14 +66,14 @@ cross join unnest(day) as days(day) ) , volumes as ( -select u.call_block_time as time, -cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth -from {{source('lido_ethereum','WstETH_call_unwrap')}} u -where call_success = TRUE +select u.call_block_time as time, +cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth +from {{source('lido_ethereum','WstETH_call_unwrap')}} u +where call_success = TRUE union all -select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth +select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth from {{source('lido_ethereum','WstETH_call_wrap')}} u -where call_success = TRUE +where call_success = TRUE ) @@ -80,39 +81,39 @@ where call_success = TRUE SELECT day, rate as rate0, value_partition, first_value(rate) over (partition by value_partition order by day) as rate, lead(day,1,date_trunc('day', now() + interval '1' day)) over(order by day) as next_day - + FROM ( select day, rate, sum(case when rate is null then 0 else 1 end) over (order by day) as value_partition from ( -select date_trunc('day', d.day) as day, +select date_trunc('day', d.day) as day, sum(cast(steth as double))/sum(cast(wsteth as double)) AS rate from dates d -left join volumes v on date_trunc('day', v.time) = date_trunc('day', d.day) +left join volumes v on date_trunc('day', v.time) = date_trunc('day', d.day) group by 1 )) ) -, pools as ( +, pools as ( SELECT * FROM ( {% for k_model in lido_liquidity_models %} - SELECT pool_name, - pool, - blockchain, - project, - cast(fee as double) as fee, - time, + SELECT pool_name, + pool, + blockchain, + project, + cast(fee as double) as fee, + time, LEAD(time, 1, now() + INTERVAL '1' day) OVER (PARTITION BY pool ORDER BY time NULLS FIRST ) AS next_time, - main_token, + main_token, main_token_symbol, - paired_token, - paired_token_symbol, - sum(main_token_reserve) over(partition by pool, main_token order by time) as main_token_reserve, + paired_token, + paired_token_symbol, + sum(main_token_reserve) over(partition by pool, main_token order by time) as main_token_reserve, sum(paired_token_reserve) over(partition by pool, paired_token order by time) as paired_token_reserve, - main_token_usd_price*sum(main_token_reserve) over(partition by pool, main_token order by time) as main_token_usd_reserve, - paired_token_usd_price*sum(paired_token_reserve) over(partition by pool, paired_token order by time) as paired_token_usd_reserve, + main_token_usd_price*sum(main_token_reserve) over(partition by pool, main_token order by time) as main_token_usd_reserve, + paired_token_usd_price*sum(paired_token_reserve) over(partition by pool, paired_token order by time) as paired_token_usd_reserve, trading_volume FROM {{ k_model }} {% if not loop.last %} @@ -130,23 +131,23 @@ FROM ( ) -SELECT l.pool_name, - l.pool, - l.blockchain, - l.project, - l.fee, - d.day as time, - l.main_token, +SELECT l.pool_name, + l.pool, + l.blockchain, + l.project, + l.fee, + d.day as time, + l.main_token, l.main_token_symbol, - l.paired_token, - l.paired_token_symbol, - case when l.main_token_symbol = 'stETH' and l.pool != 0x4028daac072e492d34a3afdbef0ba7e35d8b55c4 - then l.main_token_reserve* rate else l.main_token_reserve end as main_token_reserve, + l.paired_token, + l.paired_token_symbol, + case when l.main_token_symbol = 'stETH' and l.pool != 0x4028daac072e492d34a3afdbef0ba7e35d8b55c4 + then l.main_token_reserve* rate else l.main_token_reserve end as main_token_reserve, l.paired_token_reserve, - l.main_token_usd_reserve, - l.paired_token_usd_reserve, + l.main_token_usd_reserve, + l.paired_token_usd_reserve, coalesce(vol.trading_volume, 0) as trading_volume FROM pools_per_dates d LEFT JOIN pools AS l on d.day >= DATE_TRUNC('day', l.time) and d.day < DATE_TRUNC('day', l.next_time) and d.pool = l.pool LEFT JOIN pools AS vol on d.day = DATE_TRUNC('day', vol.time) and d.pool = vol.pool -WHERE l.pool is not null \ No newline at end of file +WHERE l.pool is not null diff --git a/models/lido/lido_schema.yml b/hourly_spellbook/models/_project/lido/lido_schema.yml similarity index 100% rename from models/lido/lido_schema.yml rename to hourly_spellbook/models/_project/lido/lido_schema.yml diff --git a/models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_balancer_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_balancer_pools.sql similarity index 100% rename from models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_balancer_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_balancer_pools.sql diff --git a/models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_camelot_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_camelot_pools.sql similarity index 100% rename from models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_camelot_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_camelot_pools.sql diff --git a/models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_curve_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_curve_pools.sql similarity index 100% rename from models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_curve_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_curve_pools.sql diff --git a/models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_kyberswap_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_kyberswap_pools.sql similarity index 100% rename from models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_kyberswap_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_kyberswap_pools.sql diff --git a/models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_kyberswap_v2_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_kyberswap_v2_pools.sql similarity index 100% rename from models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_kyberswap_v2_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_kyberswap_v2_pools.sql diff --git a/models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_ramses_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_ramses_pools.sql similarity index 100% rename from models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_ramses_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_ramses_pools.sql diff --git a/models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_schema.yml b/hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_schema.yml similarity index 100% rename from models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_schema.yml rename to hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_schema.yml diff --git a/models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_uniswap_v3_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_uniswap_v3_pools.sql similarity index 100% rename from models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_uniswap_v3_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_uniswap_v3_pools.sql diff --git a/models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_wombat_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_wombat_pools.sql similarity index 100% rename from models/lido/liquidity/arbitrum/lido_liquidity_arbitrum_wombat_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/arbitrum/lido_liquidity_arbitrum_wombat_pools.sql diff --git a/models/lido/liquidity/base/lido_liquidity_base_aerodrome_cl_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/base/lido_liquidity_base_aerodrome_cl_pools.sql similarity index 100% rename from models/lido/liquidity/base/lido_liquidity_base_aerodrome_cl_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/base/lido_liquidity_base_aerodrome_cl_pools.sql diff --git a/models/lido/liquidity/base/lido_liquidity_base_aerodrome_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/base/lido_liquidity_base_aerodrome_pools.sql similarity index 100% rename from models/lido/liquidity/base/lido_liquidity_base_aerodrome_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/base/lido_liquidity_base_aerodrome_pools.sql diff --git a/models/lido/liquidity/base/lido_liquidity_base_kyberswap_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/base/lido_liquidity_base_kyberswap_pools.sql similarity index 100% rename from models/lido/liquidity/base/lido_liquidity_base_kyberswap_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/base/lido_liquidity_base_kyberswap_pools.sql diff --git a/models/lido/liquidity/base/lido_liquidity_base_schema.yml b/hourly_spellbook/models/_project/lido/liquidity/base/lido_liquidity_base_schema.yml similarity index 100% rename from models/lido/liquidity/base/lido_liquidity_base_schema.yml rename to hourly_spellbook/models/_project/lido/liquidity/base/lido_liquidity_base_schema.yml diff --git a/models/lido/liquidity/base/lido_liquidity_base_uniswap_v3_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/base/lido_liquidity_base_uniswap_v3_pools.sql similarity index 100% rename from models/lido/liquidity/base/lido_liquidity_base_uniswap_v3_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/base/lido_liquidity_base_uniswap_v3_pools.sql diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_balancer_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_balancer_pools.sql similarity index 93% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_balancer_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_balancer_pools.sql index df87589df7f..8aec58d6c63 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_balancer_pools.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_balancer_pools.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'balancer_pools', + schema='lido_liquidity_ethereum', + alias = 'balancer_pools', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -9,23 +10,23 @@ spell_type = "project", spell_name = "lido_liquidity", contributors = \'["pipistrella"]\') }}' - + ) }} -{% set project_start_date = '2021-08-13' %} +{% set project_start_date = '2021-08-13' %} -with +with volumes as ( -select u.call_block_time as time, -cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth -from {{source('lido_ethereum','WstETH_call_unwrap')}} u -where call_success = TRUE +select u.call_block_time as time, +cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth +from {{source('lido_ethereum','WstETH_call_unwrap')}} u +where call_success = TRUE union all -select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth +select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth from {{source('lido_ethereum','WstETH_call_wrap')}} u -where call_success = TRUE +where call_success = TRUE ) @@ -33,14 +34,14 @@ where call_success = TRUE SELECT day, rate as rate0, value_partition, first_value(rate) over (partition by value_partition order by day) as rate, lead(day,1,date_trunc('day', now() + interval '1' day)) over(order by day) as next_day - + FROM ( select day, rate, sum(case when rate is null then 0 else 1 end) over (order by day) as value_partition from ( -select date_trunc('day', v.time) as day, +select date_trunc('day', v.time) as day, sum(cast(steth as double))/sum(cast(wsteth as double)) AS rate -from volumes v +from volumes v group by 1 )) @@ -62,7 +63,7 @@ group by 1 group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date @@ -73,8 +74,8 @@ group by 1 , pools(pool_id, poolAddress) as ( -values -(0x32296969EF14EB0C6D29669C550D4A0449130230000200000000000000000080, 0x32296969ef14eb0c6d29669c550d4a0449130230), +values +(0x32296969EF14EB0C6D29669C550D4A0449130230000200000000000000000080, 0x32296969ef14eb0c6d29669c550d4a0449130230), (0x5AEE1E99FE86960377DE9F88689616916D5DCABE000000000000000000000467, 0x5AEE1E99FE86960377DE9F88689616916D5DCABE), (0x42ed016f826165c2e5976fe5bc3df540c5ad0af700000000000000000000058b, 0x42ed016f826165c2e5976fe5bc3df540c5ad0af7), (0x9C6D47FF73E0F5E51BE5FD53236E3F595C5793F200020000000000000000042C, 0x9C6D47FF73E0F5E51BE5FD53236E3F595C5793F2), @@ -83,7 +84,7 @@ values (0x25ACCB7943FD73DDA5E23BA6329085A3C24BFB6A000200000000000000000387, 0x25ACCB7943FD73DDA5E23BA6329085A3C24BFB6A), (0x93d199263632a4ef4bb438f1feb99e57b4b5f0bd0000000000000000000005c2, 0x93d199263632a4ef4bb438f1feb99e57b4b5f0bd), (0x54ca50ee86616379420cc56718e12566aa75abbe000200000000000000000610, 0x54ca50ee86616379420cc56718e12566aa75abbe) - + ) @@ -124,8 +125,8 @@ WHERE call_create.output_0 in (select distinct poolAddress from pools) , sfrxeth_rate as ( select time, lead(time, 1 , date_trunc('hour', now()) + interval '1' hour) over (order by time) as next_time, rate from ( - select - date_trunc('hour', call_block_time) as time, + select + date_trunc('hour', call_block_time) as time, avg(CAST(output_0 AS DOUBLE))/POW(10,18) as rate from {{source('frax_ethereum','sfrxETH_call_pricePerShare')}} {% if not is_incremental() %} @@ -134,14 +135,14 @@ from ( WHERE {{ incremental_predicate('call_block_time') }} {% endif %} and call_success - + GROUP BY 1) order by 1 desc ) , wusdm_rate as ( - select - date_trunc('day', evt_block_time) as time, + select + date_trunc('day', evt_block_time) as time, avg(CAST(value AS DOUBLE))/POW(10,18) as rate from {{source('mountain_ethereum','USDM_evt_RewardMultiplier')}} {% if not is_incremental() %} @@ -149,9 +150,9 @@ from ( {% else %} WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} - + GROUP BY 1 -) +) , tokens_prices_daily AS ( SELECT distinct @@ -172,7 +173,7 @@ from ( group by 1,2,3,4 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), contract_address as token, symbol, decimals, @@ -201,7 +202,7 @@ from ( union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), 0x60D604890feaa0b5460B28A424407c24fe89374a as token, 'bb-a-WETH', 18, @@ -218,7 +219,7 @@ SELECT distinct 18, avg(price*r.rate) AS price FROM {{source('prices','usd')}} p - left join sfrxeth_rate r on DATE_TRUNC('day', minute) >= r.time and DATE_TRUNC('day', minute) < r.next_time + left join sfrxeth_rate r on DATE_TRUNC('day', minute) >= r.time and DATE_TRUNC('day', minute) < r.next_time {% if not is_incremental() %} WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} @@ -250,7 +251,7 @@ SELECT distinct 'wUSDM', 18, avg(r.rate) AS price - FROM wusdm_rate r + FROM wusdm_rate r {% if not is_incremental() %} WHERE DATE_TRUNC('day', r.time) >= DATE '{{ project_start_date }}' {% else %} @@ -258,8 +259,8 @@ SELECT distinct {% endif %} group by 1,2,3,4 - - + + ) , wsteth_prices_hourly AS ( @@ -405,16 +406,16 @@ SELECT distinct p1.symbol AS token_symbol, amount as token_balance_raw, amount / POWER(10, 18) AS token_balance, - COALESCE(p1.price, steth_prices_daily.price*r.rate) AS price, + COALESCE(p1.price, steth_prices_daily.price*r.rate) AS price, 0 as row_numb - FROM balance b + FROM balance b LEFT JOIN tokens_prices_daily p1 ON p1.time = b.day AND p1.token = b.token - LEFT JOIN wsteth_rate r on b.day >= r.day and b.day < r.next_day + LEFT JOIN wsteth_rate r on b.day >= r.day and b.day < r.next_day LEFT JOIN steth_prices_daily on steth_prices_daily.time = b.day WHERE b.token = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 - + union all - + SELECT day, pool_id, @@ -422,9 +423,9 @@ SELECT distinct p1.symbol AS token_symbol, amount as token_balance_raw, amount / POWER(10, p1.decimals) AS token_balance, - COALESCE(p1.price, 0) AS price, + COALESCE(p1.price, 0) AS price, row_number() OVER(PARTITION BY day,pool_id ORDER BY day, pool_id, b.token) as row_numb - FROM balance b + FROM balance b LEFT JOIN tokens_prices_daily p1 ON p1.time = b.day AND p1.token = b.token WHERE b.token not in (select poolAddress from pools union all @@ -432,7 +433,7 @@ SELECT distinct ) , reserves as ( -select main.day, main.pool_id, +select main.day, main.pool_id, main_token, main_token_symbol, main_token_reserve, main_token_usd_price, paired1_token, paired1_token_symbol, paired1_token_reserve, paired1_token_usd_price --paired2_token, paired2_token_symbol, paired2_token_reserve, paired2_token_usd_reserve @@ -446,7 +447,7 @@ SELECT coalesce(price, 0) AS main_token_usd_price FROM usd_balance b where token = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) main -join +join ( SELECT b.day, @@ -457,7 +458,7 @@ SELECT coalesce(price, 0) AS paired1_token_usd_price FROM usd_balance b where token != 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 and cast(row_numb as int) = int '1') paired1 -on main.day = paired1.day and main.pool_id = paired1.pool_id +on main.day = paired1.day and main.pool_id = paired1.pool_id /*left join ( SELECT b.day, @@ -468,16 +469,16 @@ SELECT coalesce(amount_usd, 0) AS paired2_token_usd_reserve FROM cumulative_usd_balance b where token != 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 and cast(row_numb as int) = int '2') paired2 -on main.day = paired2.day and main.pool_id = paired2.pool_id +on main.day = paired2.day and main.pool_id = paired2.pool_id */ ) -, trading_volume as ( +, trading_volume as ( select date_trunc('day', s.evt_block_time) as time, poolId, sum( - case when tokenOut = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then wsteth_price.price*amountOut/1e18 - when tokenIn = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then wsteth_price.price*amountIn/1e18 + case when tokenOut = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then wsteth_price.price*amountOut/1e18 + when tokenIn = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then wsteth_price.price*amountIn/1e18 else 0 end) as trading_volume from {{source('balancer_v2_ethereum','Vault_evt_Swap')}} s left join wsteth_prices_hourly wsteth_price on date_trunc('hour', s.evt_block_time) >= wsteth_price.time and date_trunc('hour', s.evt_block_time) < wsteth_price.next_time @@ -485,16 +486,16 @@ on main.day = paired2.day and main.pool_id = paired2.pool_id WHERE DATE_TRUNC('day', s.evt_block_time) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('s.evt_block_time') }} - {% endif %} + {% endif %} and s.poolId in (select pool_id from pools) group by 1,2 -) +) , all_metrics as ( -select pool_id as pool, 'ethereum' as blockchain, 'balancer' as project, 0 as fee, -cast(day as date) as time, -case when pool_id = 0x32296969EF14EB0C6D29669C550D4A0449130230000200000000000000000080 then 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 else main_token end as main_token, -case when pool_id = 0x32296969EF14EB0C6D29669C550D4A0449130230000200000000000000000080 then 'wstETH' else main_token_symbol end as main_token_symbol, +select pool_id as pool, 'ethereum' as blockchain, 'balancer' as project, 0 as fee, +cast(day as date) as time, +case when pool_id = 0x32296969EF14EB0C6D29669C550D4A0449130230000200000000000000000080 then 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 else main_token end as main_token, +case when pool_id = 0x32296969EF14EB0C6D29669C550D4A0449130230000200000000000000000080 then 'wstETH' else main_token_symbol end as main_token_symbol, paired1_token as paired_token, paired1_token_symbol as paired_token_symbol, --||case when paired2_token_symbol is null then '' else '/'||paired2_token_symbol end as paired_token_symbol, @@ -509,9 +510,9 @@ order by day desc, pool_id ) -select +select blockchain ||' '|| project ||' '|| coalesce(paired_token_symbol,'unknown') ||':'|| main_token_symbol ||'('|| substring(cast(pool as varchar),64) ||')' as pool_name, -* +* from all_metrics diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_conc_pool.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_conc_pool.sql similarity index 86% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_conc_pool.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_conc_pool.sql index 1ecb79f36f7..7c4161895c3 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_conc_pool.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_conc_pool.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'curve_steth_conc_pool', + schema='lido_liquidity_ethereum', + alias = 'curve_steth_conc_pool', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,7 +13,7 @@ ) }} -{% set project_start_date = '2022-05-12' %} +{% set project_start_date = '2022-05-12' %} @@ -24,14 +25,14 @@ cross join unnest(day) as days(day) ) , volumes as ( -select u.call_block_time as time, -cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth -from {{source('lido_ethereum','WstETH_call_unwrap')}} u -where call_success = TRUE +select u.call_block_time as time, +cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth +from {{source('lido_ethereum','WstETH_call_unwrap')}} u +where call_success = TRUE union all -select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth +select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth from {{source('lido_ethereum','WstETH_call_wrap')}} u -where call_success = TRUE +where call_success = TRUE ) @@ -39,15 +40,15 @@ where call_success = TRUE SELECT day, rate as rate0, value_partition, first_value(rate) over (partition by value_partition order by day) as rate, lead(day,1,date_trunc('day', now() + interval '1' day)) over(order by day) as next_day - + FROM ( select day, rate, sum(case when rate is null then 0 else 1 end) over (order by day) as value_partition from ( -select date_trunc('day', d.day) as day, +select date_trunc('day', d.day) as day, sum(cast(steth as double))/sum(cast(wsteth as double)) AS rate from dates d -left join volumes v on date_trunc('day', v.time) = date_trunc('day', d.day) +left join volumes v on date_trunc('day', v.time) = date_trunc('day', d.day) group by 1 )) @@ -67,10 +68,10 @@ from {{source('erc20_ethereum','evt_Transfer')}} t WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} - and contract_address = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 - and to = 0x828b154032950C8ff7CF8085D841723Db2696056 - - + and contract_address = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 + and to = 0x828b154032950C8ff7CF8085D841723Db2696056 + + group by 1,4 ) @@ -87,10 +88,10 @@ from {{source('erc20_ethereum','evt_Transfer')}} t {% else %} WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} - and contract_address = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 - and "from" = 0x828b154032950C8ff7CF8085D841723Db2696056 - - + and contract_address = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 + and "from" = 0x828b154032950C8ff7CF8085D841723Db2696056 + + group by 1, 4 ) @@ -103,10 +104,10 @@ select * from steth_out ) , steth_balances as ( -select time, +select time, sum(steth_balance) as steth, sum(coalesce(wsteth_balance,steth_balance)) as wsteth -from daily_balances b +from daily_balances b group by time order by 1 ) @@ -121,9 +122,9 @@ from {{source('erc20_ethereum','evt_Transfer')}} t {% else %} WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} - and contract_address = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 - and to = 0x828b154032950C8ff7CF8085D841723Db2696056 - + and contract_address = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 + and to = 0x828b154032950C8ff7CF8085D841723Db2696056 + group by 1 ) @@ -138,8 +139,8 @@ from {{source('erc20_ethereum','evt_Transfer')}} t WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} and contract_address = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 - and "from" = 0x828b154032950C8ff7CF8085D841723Db2696056 - + and "from" = 0x828b154032950C8ff7CF8085D841723Db2696056 + group by 1 ) @@ -153,7 +154,7 @@ select * from weth_out ) , weth_balances as ( -select time, +select time, sum(weth_balance) as weth from weth_daily_balances b group by 1 @@ -177,15 +178,15 @@ order by 1 group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date and blockchain = 'ethereum' and symbol = 'WETH' - - -) + + +) , weth_prices_hourly AS ( select time @@ -203,8 +204,8 @@ order by 1 {% endif %} and blockchain = 'ethereum' and symbol = 'WETH' - -)) + +)) , steth_prices_daily AS ( SELECT distinct @@ -223,7 +224,7 @@ order by 1 group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date @@ -232,9 +233,9 @@ order by 1 ) -, token_exchange_hourly as( +, token_exchange_hourly as( select date_trunc('hour', evt_block_time) as time - , sum(case when cast(sold_id as int) = int '0' then cast(tokens_sold as double) + , sum(case when cast(sold_id as int) = int '0' then cast(tokens_sold as double) else cast(tokens_bought as double) end) as eth_amount_raw from {{source('curvefi_ethereum','stETHconcentrated_evt_TokenExchange')}} c {% if not is_incremental() %} @@ -242,46 +243,46 @@ order by 1 {% else %} WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} - + group by 1 - + ) , trading_volume_hourly as ( select t.time - , t.eth_amount_raw * wp.price as volume_raw + , t.eth_amount_raw * wp.price as volume_raw from token_exchange_hourly t left join weth_prices_hourly wp on t.time = wp.time order by 1 ) -, trading_volume as ( +, trading_volume as ( select distinct date_trunc('day', time) as time , sum(volume_raw)/1e18 as volume - from trading_volume_hourly + from trading_volume_hourly GROUP by 1 ) -select 'ethereum curve WETH:stETH concentrated 0.04' as pool_name, - 0x828b154032950C8ff7CF8085D841723Db2696056 as pool, - 'ethereum' as blockchain, +select 'ethereum curve WETH:stETH concentrated 0.04' as pool_name, + 0x828b154032950C8ff7CF8085D841723Db2696056 as pool, + 'ethereum' as blockchain, 'curve' as project, 0.04 as fee, - cast(b.time as date) as time, - 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 as main_token, + cast(b.time as date) as time, + 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 as main_token, 'stETH' as main_token_symbol, - 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 as paired_token, + 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 as paired_token, 'WETH' as paired_token_symbol, wsteth as main_token_reserve, coalesce(eth.weth, 0) as paired_token_reserve, coalesce(stethp.price*r.rate, wethp.price*r.rate) as main_token_usd_price, wethp.price as paired_token_usd_price, v.volume as trading_volume -from steth_balances b +from steth_balances b left join weth_balances eth on b.time = eth.time -left join steth_prices_daily stethp on b.time = stethp.time -left join weth_prices_daily wethp on b.time = wethp.time +left join steth_prices_daily stethp on b.time = stethp.time +left join weth_prices_daily wethp on b.time = wethp.time left join trading_volume v on b.time = v.time -left join wsteth_rate r on b.time >= r.day and b.time < r.next_day +left join wsteth_rate r on b.time >= r.day and b.time < r.next_day order by 1 diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_frxeth_pool.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_frxeth_pool.sql similarity index 85% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_frxeth_pool.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_frxeth_pool.sql index 1e574e3c580..75e529f84ff 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_frxeth_pool.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_frxeth_pool.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'curve_steth_frxeth_pool', + schema='lido_liquidity_ethereum', + alias = 'curve_steth_frxeth_pool', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,7 +13,7 @@ ) }} -{% set project_start_date = '2023-02-22' %} +{% set project_start_date = '2023-02-22' %} @@ -22,17 +23,17 @@ select days.day from day_seq cross join unnest(day) as days(day) ) - + , volumes as ( -select u.call_block_time as time, -cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth -from {{source('lido_ethereum','WstETH_call_unwrap')}} u -where call_success = TRUE +select u.call_block_time as time, +cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth +from {{source('lido_ethereum','WstETH_call_unwrap')}} u +where call_success = TRUE union all -select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth +select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth from {{source('lido_ethereum','WstETH_call_wrap')}} u -where call_success = TRUE +where call_success = TRUE ) @@ -40,15 +41,15 @@ where call_success = TRUE SELECT day, rate as rate0, value_partition, first_value(rate) over (partition by value_partition order by day) as rate, lead(day,1,date_trunc('day', now() + interval '1' day)) over(order by day) as next_day - + FROM ( select day, rate, sum(case when rate is null then 0 else 1 end) over (order by day) as value_partition from ( -select date_trunc('day', d.day) as day, +select date_trunc('day', d.day) as day, sum(cast(steth as double))/sum(cast(wsteth as double)) AS rate from dates d -left join volumes v on date_trunc('day', v.time) = date_trunc('day', d.day) +left join volumes v on date_trunc('day', v.time) = date_trunc('day', d.day) group by 1 )) @@ -67,9 +68,9 @@ from {{source('erc20_ethereum','evt_Transfer')}} t {% else %} WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} - and contract_address = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 + and contract_address = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 and to = 0x4d9f9D15101EEC665F77210cB999639f760F831E - + group by 1,4 ) @@ -87,10 +88,10 @@ from {{source('erc20_ethereum','evt_Transfer')}} t WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} - and contract_address = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 - and "from" = 0x4d9f9D15101EEC665F77210cB999639f760F831E - - + and contract_address = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 + and "from" = 0x4d9f9D15101EEC665F77210cB999639f760F831E + + group by 1, 4 ) @@ -103,9 +104,9 @@ select * from steth_out ) , steth_balances as ( -select time, +select time, sum(steth_balance) steth, - sum(coalesce(wsteth_balance,steth_balance)) as wsteth + sum(coalesce(wsteth_balance,steth_balance)) as wsteth from daily_balances b group by 1 order by 1 @@ -121,9 +122,9 @@ from {{source('erc20_ethereum','evt_Transfer')}} t {% else %} WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} - and contract_address = 0x5e8422345238f34275888049021821e8e08caa1f - and to = 0x4d9f9d15101eec665f77210cb999639f760f831e - + and contract_address = 0x5e8422345238f34275888049021821e8e08caa1f + and to = 0x4d9f9d15101eec665f77210cb999639f760f831e + group by 1 ) @@ -138,8 +139,8 @@ from {{source('erc20_ethereum','evt_Transfer')}} t WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} and contract_address = 0x5e8422345238f34275888049021821e8e08caa1f - and "from" = 0x4d9f9d15101eec665f77210cb999639f760f831e - + and "from" = 0x4d9f9d15101eec665f77210cb999639f760f831e + group by 1 ) @@ -153,7 +154,7 @@ select * from frxeth_out ) , frxeth_balances as ( -select time, +select time, sum(frxeth_balance) as frxeth from frxeth_daily_balances b group by 1 @@ -161,8 +162,8 @@ order by 1 ) , frx_eth_rate as ( -select call_block_time as time, -lead(call_block_time, 1, now() + interval '1' day) over (order by call_block_time) as next_time, +select call_block_time as time, +lead(call_block_time, 1, now() + interval '1' day) over (order by call_block_time) as next_time, output_0/1e18 as rate from {{source('curvefi_ethereum','frxeth_eth_pool_call_price_oracle')}} {% if not is_incremental() %} @@ -183,22 +184,22 @@ from {{source('curvefi_ethereum','frxeth_eth_pool_call_price_oracle')}} WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} and date_trunc('day', minute) < current_date and blockchain = 'ethereum' and symbol = 'WETH' group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date and blockchain = 'ethereum' and symbol = 'WETH' - - -) + + +) , steth_prices_hourly AS ( select time @@ -214,11 +215,11 @@ from {{source('curvefi_ethereum','frxeth_eth_pool_call_price_oracle')}} {% else %} WHERE {{ incremental_predicate('p.minute') }} {% endif %} - + and blockchain = 'ethereum' and contract_address = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 - -)) + +)) , steth_prices_daily AS ( SELECT distinct @@ -230,14 +231,14 @@ from {{source('curvefi_ethereum','frxeth_eth_pool_call_price_oracle')}} {% else %} WHERE {{ incremental_predicate('p.minute') }} {% endif %} - + and date_trunc('day', minute) < current_date and blockchain = 'ethereum' and contract_address = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date @@ -246,7 +247,7 @@ from {{source('curvefi_ethereum','frxeth_eth_pool_call_price_oracle')}} ) -, token_exchange_hourly as( +, token_exchange_hourly as( select date_trunc('hour', evt_block_time) as time , sum(case when cast(sold_id as int) = int '0' then cast(tokens_sold as double) else cast(tokens_bought as double) end) as steth_amount_raw from {{source('curvefi_ethereum','frxETH_stETH_evt_TokenExchange')}} c @@ -256,45 +257,45 @@ from {{source('curvefi_ethereum','frxeth_eth_pool_call_price_oracle')}} WHERE {{ incremental_predicate('c.evt_block_time') }} {% endif %} group by 1 - + ) , trading_volume_hourly as ( select t.time - , t.steth_amount_raw * wp.price as volume_raw + , t.steth_amount_raw * wp.price as volume_raw from token_exchange_hourly t left join steth_prices_hourly wp on t.time = wp.time order by 1 ) -, trading_volume as ( +, trading_volume as ( select distinct date_trunc('day', time) as time , sum(volume_raw)/1e18 as volume - from trading_volume_hourly + from trading_volume_hourly GROUP by 1 ) -select 'ethereum curve frxETH:stETH 0.04' as pool_name, - 0x4d9f9D15101EEC665F77210cB999639f760F831E as pool, - 'ethereum' as blockchain, +select 'ethereum curve frxETH:stETH 0.04' as pool_name, + 0x4d9f9D15101EEC665F77210cB999639f760F831E as pool, + 'ethereum' as blockchain, 'curve' as project, 0.04 as fee, - cast(b.time as date) as time, - 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 as main_token, + cast(b.time as date) as time, + 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 as main_token, 'stETH' as main_token_symbol, - 0x5E8422345238F34275888049021821E8E08CAa1f as paired_token, + 0x5E8422345238F34275888049021821E8E08CAa1f as paired_token, 'frxETH' as paired_token_symbol, wsteth as main_token_reserve, coalesce(frxeth.frxeth, 0) as paired_token_reserve, coalesce(stethp.price*r.rate, wethp.price*r.rate) as main_token_usd_price, wethp.price*coalesce(fr.rate,1) as paired_token_usd_price, v.volume as trading_volume -from steth_balances b -left join wsteth_rate r on b.time >= r.day and b.time < r.next_day -left join frxeth_balances frxeth on b.time = frxeth.time -left join steth_prices_daily stethp on b.time = stethp.time -left join weth_prices_daily wethp on b.time = wethp.time -left join frx_eth_rate fr on b.time >= fr.time and b.time < fr.next_time +from steth_balances b +left join wsteth_rate r on b.time >= r.day and b.time < r.next_day +left join frxeth_balances frxeth on b.time = frxeth.time +left join steth_prices_daily stethp on b.time = stethp.time +left join weth_prices_daily wethp on b.time = wethp.time +left join frx_eth_rate fr on b.time >= fr.time and b.time < fr.next_time left join trading_volume v on b.time = v.time order by 1 diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_ng_pool.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_ng_pool.sql similarity index 88% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_ng_pool.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_ng_pool.sql index ed9ce8c29ba..ed4b8439807 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_ng_pool.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_ng_pool.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'curve_steth_ng_pool', + schema='lido_liquidity_ethereum', + alias = 'curve_steth_ng_pool', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,7 +13,7 @@ ) }} -{% set project_start_date = '2023-05-16' %} +{% set project_start_date = '2023-05-16' %} @@ -24,14 +25,14 @@ cross join unnest(day) as days(day) ) , volumes as ( -select u.call_block_time as time, -cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth -from {{source('lido_ethereum','WstETH_call_unwrap')}} u -where call_success = TRUE +select u.call_block_time as time, +cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth +from {{source('lido_ethereum','WstETH_call_unwrap')}} u +where call_success = TRUE union all -select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth +select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth from {{source('lido_ethereum','WstETH_call_wrap')}} u -where call_success = TRUE +where call_success = TRUE ) @@ -39,15 +40,15 @@ where call_success = TRUE SELECT day, rate as rate0, value_partition, first_value(rate) over (partition by value_partition order by day) as rate, lead(day,1,date_trunc('day', now() + interval '1' day)) over(order by day) as next_day - + FROM ( select day, rate, sum(case when rate is null then 0 else 1 end) over (order by day) as value_partition from ( -select date_trunc('day', d.day) as day, +select date_trunc('day', d.day) as day, sum(cast(steth as double))/sum(cast(wsteth as double)) AS rate from dates d -left join volumes v on date_trunc('day', v.time) = date_trunc('day', d.day) +left join volumes v on date_trunc('day', v.time) = date_trunc('day', d.day) group by 1 )) @@ -85,7 +86,7 @@ from {{source('erc20_ethereum','evt_Transfer')}} t WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} and contract_address = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 - and "from" = 0x21e27a5e5513d6e65c4f830167390997aa84843a + and "from" = 0x21e27a5e5513d6e65c4f830167390997aa84843a group by 1, 4 ) @@ -98,7 +99,7 @@ select * from steth_out ) , steth_balances as ( -select time, +select time, sum(steth_balance) as steth, sum(coalesce(wsteth_balance,steth_balance))as wsteth from daily_balances b @@ -117,11 +118,11 @@ FROM ( WHERE DATE_TRUNC('day', block_time) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('block_time') }} - {% endif %} + {% endif %} AND "from" = 0x21e27a5e5513d6e65c4f830167390997aa84843a AND success AND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR call_type IS null) - + UNION ALL @@ -136,12 +137,12 @@ FROM ( AND to = 0x21e27a5e5513d6e65c4f830167390997aa84843a AND success AND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR call_type IS null) - + UNION ALL - + -- gas costs - SELECT block_time, "from" AS address, -cast(gas_price as double)*cast(gas_used as double)/1e18 + SELECT block_time, "from" AS address, -cast(gas_price as double)*cast(gas_used as double)/1e18 FROM {{source('ethereum','transactions')}} et {% if not is_incremental() %} WHERE DATE_TRUNC('day', block_time) >= DATE '{{ project_start_date }}' @@ -153,7 +154,7 @@ FROM ( ) t group by 1 -) +) , weth_prices_daily AS ( SELECT distinct @@ -171,15 +172,15 @@ group by 1 group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date and blockchain = 'ethereum' and symbol = 'WETH' - - -) + + +) , weth_prices_hourly AS ( select time @@ -195,11 +196,11 @@ group by 1 {% else %} WHERE {{ incremental_predicate('p.minute') }} {% endif %} - + and blockchain = 'ethereum' and symbol = 'WETH' - -)) + +)) , steth_prices_daily AS ( SELECT distinct @@ -217,7 +218,7 @@ group by 1 group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date @@ -226,7 +227,7 @@ group by 1 ) -, token_exchange_hourly as( +, token_exchange_hourly as( select date_trunc('hour', evt_block_time) as time , sum(case when cast(sold_id as int) = int '0' then cast(tokens_sold as double) else cast(tokens_bought as double) end) as eth_amount_raw from {{source('curvefi_ethereum','stETHng_evt_TokenExchange')}} c @@ -237,45 +238,45 @@ group by 1 {% endif %} group by 1 - + ) , trading_volume_hourly as ( select t.time - , t.eth_amount_raw * wp.price as volume_raw + , t.eth_amount_raw * wp.price as volume_raw from token_exchange_hourly t left join weth_prices_hourly wp on t.time = wp.time order by 1 ) -, trading_volume as ( +, trading_volume as ( select distinct date_trunc('day', time) as time , sum(volume_raw)/1e18 as volume - from trading_volume_hourly + from trading_volume_hourly GROUP by 1 ) -select 'ethereum curve ETH:stETH NG 0.04' as pool_name, - 0x21e27a5e5513d6e65c4f830167390997aa84843a as pool, - 'ethereum' as blockchain, +select 'ethereum curve ETH:stETH NG 0.04' as pool_name, + 0x21e27a5e5513d6e65c4f830167390997aa84843a as pool, + 'ethereum' as blockchain, 'curve' as project, 0.04 as fee, - cast(b.time as date) as time, - 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 as main_token, + cast(b.time as date) as time, + 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 as main_token, 'stETH' as main_token_symbol, - 0x0000000000000000000000000000000000000000 as paired_token, + 0x0000000000000000000000000000000000000000 as paired_token, 'ETH' as paired_token_symbol, wsteth as main_token_reserve, coalesce(eth.eth_amount, 0) as paired_token_reserve, coalesce(stethp.price*r.rate, wethp.price*r.rate) as main_token_usd_price, wethp.price as paired_token_usd_price, v.volume as trading_volume -from steth_balances b +from steth_balances b left join eth_balances eth on b.time = eth.time -left join steth_prices_daily stethp on b.time = stethp.time -left join weth_prices_daily wethp on b.time = wethp.time +left join steth_prices_daily stethp on b.time = stethp.time +left join weth_prices_daily wethp on b.time = wethp.time left join trading_volume v on b.time = v.time -left join wsteth_rate r on b.time >= r.day and b.time < r.next_day -order by 1 \ No newline at end of file +left join wsteth_rate r on b.time >= r.day and b.time < r.next_day +order by 1 diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_pool.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_pool.sql similarity index 87% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_pool.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_pool.sql index 39c738cd066..9930ebc264d 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_pool.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_steth_pool.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'curve_steth_pool', + schema='lido_liquidity_ethereum', + alias = 'curve_steth_pool', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,7 +13,7 @@ ) }} -{% set project_start_date = '2021-01-05' %} +{% set project_start_date = '2021-01-05' %} @@ -22,32 +23,32 @@ select days.day from day_seq cross join unnest(day) as days(day) ) - + , volumes as ( -select u.call_block_time as time, -cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth -from {{source('lido_ethereum','WstETH_call_unwrap')}} u -where call_success = TRUE +select u.call_block_time as time, +cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth +from {{source('lido_ethereum','WstETH_call_unwrap')}} u +where call_success = TRUE union all -select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth +select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth from {{source('lido_ethereum','WstETH_call_wrap')}} u -where call_success = TRUE +where call_success = TRUE ) , wsteth_rate as ( SELECT day, rate as rate0, value_partition, first_value(rate) over (partition by value_partition order by day) as rate, lead(day,1,date_trunc('day', now() + interval '1' day)) over(order by day) as next_day - + FROM ( select day, rate, sum(case when rate is null then 0 else 1 end) over (order by day) as value_partition from ( -select date_trunc('day', d.day) as day, +select date_trunc('day', d.day) as day, case when date_trunc('day', d.day) = date '{{ project_start_date }}' then 1 else sum(cast(steth as double))/sum(cast(wsteth as double)) end AS rate from dates d -left join volumes v on date_trunc('day', v.time) = date_trunc('day', d.day) +left join volumes v on date_trunc('day', v.time) = date_trunc('day', d.day) group by 1 )) @@ -67,7 +68,7 @@ from {{source('erc20_ethereum','evt_Transfer')}} t WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} and contract_address = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 - and to = 0xdc24316b9ae028f1497c275eb9192a3ea0f67022 + and to = 0xdc24316b9ae028f1497c275eb9192a3ea0f67022 group by 1,4 ) @@ -84,8 +85,8 @@ from {{source('erc20_ethereum','evt_Transfer')}} t {% else %} WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} - and contract_address = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 - and "from" = 0xdc24316b9ae028f1497c275eb9192a3ea0f67022 + and contract_address = 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 + and "from" = 0xdc24316b9ae028f1497c275eb9192a3ea0f67022 group by 1, 4 ) @@ -121,7 +122,7 @@ FROM ( AND"from" = 0xDC24316b9AE028F1497c275EB9192a3Ea0f67022 AND success AND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR call_type IS null) - + UNION ALL -- inbound transfers @@ -135,11 +136,11 @@ FROM ( AND to = 0xDC24316b9AE028F1497c275EB9192a3Ea0f67022 AND success AND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR call_type IS null) - + UNION ALL - + -- gas costs - SELECT block_time, -cast(gas_price as double)*cast(gas_used as double)/1e18 + SELECT block_time, -cast(gas_price as double)*cast(gas_used as double)/1e18 FROM {{source('ethereum','transactions')}} et {% if not is_incremental() %} WHERE DATE_TRUNC('day', block_time) >= DATE '{{ project_start_date }}' @@ -152,7 +153,7 @@ FROM ( group by 1 -) +) , weth_prices_daily AS ( SELECT distinct @@ -163,22 +164,22 @@ group by 1 WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} and date_trunc('day', minute) < current_date and blockchain = 'ethereum' and symbol = 'WETH' group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date and blockchain = 'ethereum' and symbol = 'WETH' - - -) + + +) , weth_prices_hourly AS ( select time @@ -196,8 +197,8 @@ group by 1 {% endif %} and blockchain = 'ethereum' and symbol = 'WETH' - -)) + +)) , steth_prices_daily AS ( SELECT distinct @@ -215,7 +216,7 @@ group by 1 group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date @@ -224,7 +225,7 @@ group by 1 ) -, token_exchange_hourly as( +, token_exchange_hourly as( select date_trunc('hour', evt_block_time) as time , sum(case when cast(sold_id as int) = int '0' then cast(tokens_sold as double) else cast(tokens_bought as double) end) as eth_amount_raw from {{source('curvefi_ethereum','steth_swap_evt_TokenExchange')}} c @@ -234,45 +235,45 @@ group by 1 WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} group by 1 - + ) , trading_volume_hourly as ( select t.time - , t.eth_amount_raw * wp.price as volume_raw + , t.eth_amount_raw * wp.price as volume_raw from token_exchange_hourly t left join weth_prices_hourly wp on t.time = wp.time order by 1 ) -, trading_volume as ( +, trading_volume as ( select distinct date_trunc('day', time) as time , sum(volume_raw)/1e18 as volume - from trading_volume_hourly + from trading_volume_hourly GROUP by 1 ) -select 'ethereum curve ETH:stETH 0.04' as pool_name, - 0xDC24316b9AE028F1497c275EB9192a3Ea0f67022 as pool, - 'ethereum' as blockchain, +select 'ethereum curve ETH:stETH 0.04' as pool_name, + 0xDC24316b9AE028F1497c275EB9192a3Ea0f67022 as pool, + 'ethereum' as blockchain, 'curve' as project, 0.04 as fee, - cast(b.time as date) as time, - 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 as main_token, + cast(b.time as date) as time, + 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 as main_token, 'stETH' as main_token_symbol, - 0x0000000000000000000000000000000000000000 as paired_token, + 0x0000000000000000000000000000000000000000 as paired_token, 'ETH' as paired_token_symbol, wsteth as main_token_reserve, coalesce(eth.eth_amount, 0) as paired_token_reserve, coalesce(stethp.price*r.rate, wethp.price*r.rate) as main_token_usd_price, wethp.price as paired_token_usd_price, v.volume as trading_volume -from steth_balances b -left join eth_balances eth on b.time = eth.time -left join steth_prices_daily stethp on b.time = stethp.time -left join weth_prices_daily wethp on b.time = wethp.time +from steth_balances b +left join eth_balances eth on b.time = eth.time +left join steth_prices_daily stethp on b.time = stethp.time +left join weth_prices_daily wethp on b.time = wethp.time left join trading_volume v on b.time = v.time -left join wsteth_rate r on b.time >= r.day and b.time < r.next_day -order by 1 \ No newline at end of file +left join wsteth_rate r on b.time >= r.day and b.time < r.next_day +order by 1 diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_wsteth_reth_pool.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_wsteth_reth_pool.sql similarity index 88% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_wsteth_reth_pool.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_wsteth_reth_pool.sql index 7923ea30411..b5e600b9b26 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_wsteth_reth_pool.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_curve_wsteth_reth_pool.sql @@ -1,6 +1,6 @@ {{ config( - - alias = 'curve_wsteth_reth_pool', + schema='lido_liquidity_ethereum', + alias = 'curve_wsteth_reth_pool', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -13,12 +13,12 @@ ) }} -{% set project_start_date = '2022-02-22' %} +{% set project_start_date = '2022-02-22' %} + +with -with - wsteth_in as ( select DATE_TRUNC('day', evt_block_time) as time, @@ -29,8 +29,8 @@ from {{source('erc20_ethereum','evt_Transfer')}} t {% else %} WHERE DATE_TRUNC('day', evt_block_time) >= DATE_TRUNC('day', NOW() - INTERVAL '1' day) {% endif %} - and contract_address = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 - and to = 0x447Ddd4960d9fdBF6af9a790560d0AF76795CB08 + and contract_address = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 + and to = 0x447Ddd4960d9fdBF6af9a790560d0AF76795CB08 group by 1 ) @@ -46,7 +46,7 @@ from {{source('erc20_ethereum','evt_Transfer')}} t {% endif %} and contract_address = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 and "from" = 0x447Ddd4960d9fdBF6af9a790560d0AF76795CB08 - + group by 1 ) @@ -59,7 +59,7 @@ select * from wsteth_out ) , wsteth_balances as ( -select time, +select time, sum(wsteth_balance) as wsteth from wsteth_daily_balances b group by 1 @@ -107,7 +107,7 @@ select * from reth_out , reth_balances as ( select time, sum(reth_balance) reth -from reth_daily_balances +from reth_daily_balances group by 1 order by 1 ) @@ -129,15 +129,15 @@ order by 1 group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date and blockchain = 'ethereum' and contract_address = 0xae78736Cd615f374D3085123A210448E74Fc6393 - - -) + + +) , wsteth_prices_hourly AS ( select time @@ -155,8 +155,8 @@ order by 1 {% endif %} and blockchain = 'ethereum' and contract_address = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 - -)) + +)) , wsteth_prices_daily AS ( SELECT distinct @@ -174,7 +174,7 @@ order by 1 group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date @@ -183,7 +183,7 @@ order by 1 ) -, token_exchange_hourly as( +, token_exchange_hourly as( select date_trunc('hour', evt_block_time) as time , sum(case when cast(sold_id as int) = int '0' then cast(tokens_sold as double) else cast(tokens_bought as double) end) as eth_amount_raw from {{source('curvefi_ethereum','rETHwstETH_evt_TokenExchange')}} c @@ -193,43 +193,43 @@ order by 1 WHERE {{ incremental_predicate('evt_block_time') }} {% endif %} group by 1 - + ) , trading_volume_hourly as ( select t.time - , t.eth_amount_raw * wp.price as volume_raw + , t.eth_amount_raw * wp.price as volume_raw from token_exchange_hourly t left join wsteth_prices_hourly wp on t.time = wp.time order by 1 ) -, trading_volume as ( +, trading_volume as ( select distinct date_trunc('day', time) as time , sum(volume_raw)/1e18 as volume - from trading_volume_hourly + from trading_volume_hourly GROUP by 1 ) -select 'ethereum curve rETH:wstETH 0.04' as pool_name, - 0x447Ddd4960d9fdBF6af9a790560d0AF76795CB08 as pool, - 'ethereum' as blockchain, +select 'ethereum curve rETH:wstETH 0.04' as pool_name, + 0x447Ddd4960d9fdBF6af9a790560d0AF76795CB08 as pool, + 'ethereum' as blockchain, 'curve' as project, 0.04 as fee, - cast(b.time as date) as time, - 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 as main_token, + cast(b.time as date) as time, + 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 as main_token, 'wstETH' as main_token_symbol, - 0xae78736Cd615f374D3085123A210448E74Fc6393 as paired_token, + 0xae78736Cd615f374D3085123A210448E74Fc6393 as paired_token, 'rETH' as paired_token_symbol, wsteth as main_token_reserve, coalesce(reth.reth, 0) as paired_token_reserve, coalesce(wstethp.price, 0)as main_token_usd_price, rethp.price as paired_token_usd_price, v.volume as trading_volume -from wsteth_balances b -left join reth_balances reth on b.time = reth.time -left join wsteth_prices_daily wstethp on b.time = wstethp.time -left join reth_prices_daily rethp on b.time = rethp.time +from wsteth_balances b +left join reth_balances reth on b.time = reth.time +left join wsteth_prices_daily wstethp on b.time = wstethp.time +left join reth_prices_daily rethp on b.time = rethp.time left join trading_volume v on b.time = v.time order by 1 diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_kyberswap_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_kyberswap_pools.sql similarity index 85% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_kyberswap_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_kyberswap_pools.sql index 83ceb801b87..8438aa6aa52 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_kyberswap_pools.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_kyberswap_pools.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'kyberswap_pools', + schema='lido_liquidity_ethereum', + alias = 'kyberswap_pools', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,9 +13,9 @@ ) }} -{% set project_start_date = '2022-10-28' %} +{% set project_start_date = '2022-10-28' %} -with +with pools as ( select pool as address, 'ethereum' as blockchain, 'kyberswap' as project, cast(swapFeeUnits as double)/1000 as fee @@ -32,9 +33,9 @@ where token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 union select token0 from {{ source('kyber_ethereum', 'Elastic_Factory_evt_PoolCreated') }} -where token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 -union -select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 +where token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 +union +select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) t ) @@ -50,14 +51,14 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} and date_trunc('day', minute) < current_date and blockchain = 'ethereum' - and contract_address in (select address from tokens) + and contract_address in (select address from tokens) group by 1,2,3,4 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), contract_address as token, decimals, symbol, @@ -69,12 +70,12 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) , tokens_prices_hourly AS ( - select time, - lead(time,1, DATE_TRUNC('hour', now() + interval '1' hour)) over (partition by token order by time) as next_time, + select time, + lead(time,1, DATE_TRUNC('hour', now() + interval '1' hour)) over (partition by token order by time) as next_time, token, price, decimals, symbol from ( SELECT distinct - DATE_TRUNC('hour', minute) time, + DATE_TRUNC('hour', minute) time, contract_address as token, decimals, symbol, @@ -86,19 +87,19 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 WHERE {{ incremental_predicate('p.minute') }} {% endif %} and blockchain = 'ethereum' - and contract_address in (select address from tokens) + and contract_address in (select address from tokens) ) p ) , swap_events as ( - select + select date_trunc('day', sw.evt_block_time) as time, sw.contract_address as pool, cr.token0, cr.token1, sum(cast(deltaQty0 as DOUBLE)) as amount0, sum(cast(deltaQty1 as DOUBLE)) as amount1 - + from {{ source('kyber_ethereum', 'Elastic_Pool_evt_swap') }} sw left join {{ source('kyber_ethereum', 'Elastic_Factory_evt_PoolCreated') }} cr on sw.contract_address = cr.pool {% if not is_incremental() %} @@ -106,12 +107,12 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% else %} WHERE {{ incremental_predicate('sw.evt_block_time') }} {% endif %} - and sw.contract_address in (select address from pools) + and sw.contract_address in (select address from pools) group by 1,2,3,4 -) - +) + , mint_events as ( - select + select date_trunc('day', mt.evt_block_time) as time, mt.contract_address as pool, cr.token0, cr.token1, @@ -124,13 +125,13 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% else %} WHERE {{ incremental_predicate('mt.evt_block_time') }} {% endif %} - and mt.contract_address in (select address from pools) + and mt.contract_address in (select address from pools) group by 1,2,3,4 - + ) - + , burn_events as ( - select + select date_trunc('day', bn.evt_block_time) as time, bn.contract_address as pool, cr.token0, cr.token1, @@ -143,17 +144,17 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% else %} WHERE {{ incremental_predicate('bn.evt_block_time') }} {% endif %} - and bn.contract_address in (select address from pools) + and bn.contract_address in (select address from pools) group by 1,2,3,4 union all - select - date_trunc('day', bn.evt_block_time), + select + date_trunc('day', bn.evt_block_time), bn.contract_address as pool, cr.token0, cr.token1, - (-1) * sum(cast(qty0 as double)) as amount0, - (-1) * sum(cast(qty1 as double)) as amount1 + (-1) * sum(cast(qty0 as double)) as amount0, + (-1) * sum(cast(qty1 as double)) as amount1 from {{ source('kyber_ethereum', 'Elastic_Pool_evt_BurnRTokens') }} bn left join {{ source('kyber_ethereum', 'Elastic_Factory_evt_PoolCreated') }} cr on bn.contract_address = cr.pool {% if not is_incremental() %} @@ -161,32 +162,32 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% else %} WHERE {{ incremental_predicate('bn.evt_block_time') }} {% endif %} - and bn.contract_address in (select address from pools) + and bn.contract_address in (select address from pools) group by 1,2,3,4 ) - + , daily_delta_balance as ( select time, pool, token0, token1, sum(coalesce(amount0, 0)) as amount0, sum(coalesce(amount1, 0)) as amount1 - from ( - select time, pool, token0, token1, amount0, amount1 + from ( + select time, pool, token0, token1, amount0, amount1 from swap_events union all - select time, pool, token0, token1, amount0, amount1 + select time, pool, token0, token1, amount0, amount1 from mint_events union all - select time, pool, token0, token1, amount0, amount1 + select time, pool, token0, token1, amount0, amount1 from burn_events ) balance group by 1,2,3,4 ) - + , pool_liquidity as ( - select time, - pool, - token0, - token1, - sum(amount0) as amount0, + select time, + pool, + token0, + token1, + sum(amount0) as amount0, sum(amount1) as amount1 from daily_delta_balance group by 1,2,3,4 @@ -195,14 +196,14 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 , swap_events_hourly as ( select hour, pool, token0, token1, sum(amount0) as amount0, sum(amount1) as amount1 from ( - select + select date_trunc('hour', sw.evt_block_time) as hour, sw.contract_address as pool, cr.token0, cr.token1, coalesce(sum(cast(abs(deltaQty0) as DOUBLE)),0) as amount0, coalesce(sum(cast(abs(deltaQty1) as DOUBLE)),0) as amount1 - - from {{source('kyber_ethereum','Elastic_Pool_evt_swap')}} sw + + from {{source('kyber_ethereum','Elastic_Pool_evt_swap')}} sw left join {{source('kyber_ethereum','Elastic_Factory_evt_PoolCreated')}} cr on sw.contract_address = cr.pool {% if not is_incremental() %} WHERE DATE_TRUNC('day', sw.evt_block_time) >= DATE '{{ project_start_date }}' @@ -213,14 +214,14 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 group by 1,2,3,4 ) a group by 1,2,3,4 -) +) , trading_volume_hourly as ( select hour as time, pool, token0, amount0, p.price, coalesce(p.price*amount0/power(10, p.decimals),0) as volume - from swap_events_hourly s + from swap_events_hourly s left join tokens t on s.token0 = t.address left join tokens_prices_hourly p on s.hour >= p.time and s.hour < p.next_time and s.token0 = p.token - + ) , trading_volume as ( @@ -230,27 +231,27 @@ group by 1,2 ) , all_metrics as ( -select l.pool, pools.blockchain, pools.project, pools.fee, cast(l.time as date) as time, +select l.pool, pools.blockchain, pools.project, pools.fee, cast(l.time as date) as time, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then token0 else token1 end main_token, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p0.symbol else p1.symbol end main_token_symbol, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then token1 else token0 end paired_token, - case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p1.symbol else p0.symbol end paired_token_symbol, + case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p1.symbol else p0.symbol end paired_token_symbol, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then amount0/power(10, p0.decimals) else amount1/power(10, p1.decimals) end main_token_reserve, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then amount1/power(10, p1.decimals) else amount0/power(10, p0.decimals) end paired_token_reserve, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p0.price else p1.price end as main_token_usd_price, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p1.price else p0.price end as paired_token_usd_price, volume as trading_volume -from pool_liquidity l +from pool_liquidity l left join pools on l.pool = pools.address left join tokens t0 on l.token0 = t0.address left join tokens t1 on l.token1 = t1.address left join tokens_prices_daily p0 on l.time = p0.time and l.token0 = p0.token left join tokens_prices_daily p1 on l.time = p1.time and l.token1 = p1.token left join trading_volume tv on l.time = tv.time and l.pool = tv.pool -) +) -select blockchain||' '||project||' '||paired_token_symbol||':'||main_token_symbol||' '||format('%,.3f',round(coalesce(fee,0),4)) as pool_name,* +select blockchain||' '||project||' '||paired_token_symbol||':'||main_token_symbol||' '||format('%,.3f',round(coalesce(fee,0),4)) as pool_name,* from all_metrics diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_kyberswap_v2_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_kyberswap_v2_pools.sql similarity index 85% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_kyberswap_v2_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_kyberswap_v2_pools.sql index 525245ee540..6e5ea6aefaa 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_kyberswap_v2_pools.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_kyberswap_v2_pools.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'kyberswap_v2_pools', + schema='lido_liquidity_ethereum', + alias = 'kyberswap_v2_pools', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,9 +13,9 @@ ) }} -{% set project_start_date = '2023-09-10' %} +{% set project_start_date = '2023-09-10' %} -with +with pools as ( select pool as address, 'ethereum' as blockchain, 'kyberswap' as project, max(cast(swapFeeUnits as double))/1000 as fee @@ -32,9 +33,9 @@ where token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 union select token0 from {{ source('kyber_ethereum', 'ElasticFactoryV2_evt_PoolCreated') }} -where token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 -union -select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 +where token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 +union +select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) t ) @@ -50,14 +51,14 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} and date_trunc('day', minute) < current_date and blockchain = 'ethereum' - and contract_address in (select address from tokens) + and contract_address in (select address from tokens) group by 1,2,3,4 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), contract_address as token, decimals, symbol, @@ -69,12 +70,12 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) , tokens_prices_hourly AS ( - select time, - lead(time,1, DATE_TRUNC('hour', now() + interval '1' hour)) over (partition by token order by time) as next_time, + select time, + lead(time,1, DATE_TRUNC('hour', now() + interval '1' hour)) over (partition by token order by time) as next_time, token, price, decimals, symbol from ( SELECT distinct - DATE_TRUNC('hour', minute) time, + DATE_TRUNC('hour', minute) time, contract_address as token, decimals, symbol, @@ -86,19 +87,19 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 WHERE {{ incremental_predicate('p.minute') }} {% endif %} and blockchain = 'ethereum' - and contract_address in (select address from tokens) + and contract_address in (select address from tokens) ) p ) , swap_events as ( - select + select date_trunc('day', sw.evt_block_time) as time, sw.contract_address as pool, cr.token0, cr.token1, sum(cast(deltaQty0 as DOUBLE)) as amount0, sum(cast(deltaQty1 as DOUBLE)) as amount1 - + from {{ source('kyber_ethereum', 'ElasticPoolV2_evt_Swap') }} sw left join {{ source('kyber_ethereum', 'ElasticFactoryV2_evt_PoolCreated') }} cr on sw.contract_address = cr.pool {% if not is_incremental() %} @@ -106,12 +107,12 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% else %} WHERE {{ incremental_predicate('sw.evt_block_time') }} {% endif %} - and sw.contract_address in (select address from pools) + and sw.contract_address in (select address from pools) group by 1,2,3,4 -) - +) + , mint_events as ( - select + select date_trunc('day', mt.evt_block_time) as time, mt.contract_address as pool, cr.token0, cr.token1, @@ -124,13 +125,13 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% else %} WHERE {{ incremental_predicate('mt.evt_block_time') }} {% endif %} - and mt.contract_address in (select address from pools) + and mt.contract_address in (select address from pools) group by 1,2,3,4 - + ) - + , burn_events as ( - select + select date_trunc('day', bn.evt_block_time) as time, bn.contract_address as pool, cr.token0, cr.token1, @@ -143,17 +144,17 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% else %} WHERE {{ incremental_predicate('bn.evt_block_time') }} {% endif %} - and bn.contract_address in (select address from pools) + and bn.contract_address in (select address from pools) group by 1,2,3,4 union all - select - date_trunc('day', bn.evt_block_time), + select + date_trunc('day', bn.evt_block_time), bn.contract_address as pool, cr.token0, cr.token1, - (-1) * sum(cast(qty0 as double)) as amount0, - (-1) * sum(cast(qty1 as double)) as amount1 + (-1) * sum(cast(qty0 as double)) as amount0, + (-1) * sum(cast(qty1 as double)) as amount1 from {{ source('kyber_ethereum', 'ElasticPoolV2_evt_BurnRTokens') }} bn left join {{ source('kyber_ethereum', 'ElasticFactoryV2_evt_PoolCreated') }} cr on bn.contract_address = cr.pool {% if not is_incremental() %} @@ -161,32 +162,32 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% else %} WHERE {{ incremental_predicate('bn.evt_block_time') }} {% endif %} - and bn.contract_address in (select address from pools) + and bn.contract_address in (select address from pools) group by 1,2,3,4 ) - + , daily_delta_balance as ( select time, pool, token0, token1, sum(coalesce(amount0, 0)) as amount0, sum(coalesce(amount1, 0)) as amount1 - from ( - select time, pool, token0, token1, amount0, amount1 + from ( + select time, pool, token0, token1, amount0, amount1 from swap_events union all - select time, pool, token0, token1, amount0, amount1 + select time, pool, token0, token1, amount0, amount1 from mint_events union all - select time, pool, token0, token1, amount0, amount1 + select time, pool, token0, token1, amount0, amount1 from burn_events ) balance group by 1,2,3,4 ) - + , pool_liquidity as ( - select time, - pool, - token0, - token1, - sum(amount0) as amount0, + select time, + pool, + token0, + token1, + sum(amount0) as amount0, sum(amount1) as amount1 from daily_delta_balance group by 1,2,3,4 @@ -195,14 +196,14 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 , swap_events_hourly as ( select hour, pool, token0, token1, sum(amount0) as amount0, sum(amount1) as amount1 from ( - select + select date_trunc('hour', sw.evt_block_time) as hour, sw.contract_address as pool, cr.token0, cr.token1, coalesce(sum(cast(abs(deltaQty0) as DOUBLE)),0) as amount0, coalesce(sum(cast(abs(deltaQty1) as DOUBLE)),0) as amount1 - - from {{source('kyber_ethereum','ElasticPoolV2_evt_Swap')}} sw + + from {{source('kyber_ethereum','ElasticPoolV2_evt_Swap')}} sw left join {{source('kyber_ethereum','ElasticFactoryV2_evt_PoolCreated')}} cr on sw.contract_address = cr.pool {% if not is_incremental() %} WHERE DATE_TRUNC('day', sw.evt_block_time) >= DATE '{{ project_start_date }}' @@ -213,14 +214,14 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 group by 1,2,3,4 ) a group by 1,2,3,4 -) +) , trading_volume_hourly as ( select hour as time, pool, token0, amount0, p.price, coalesce(p.price*amount0/power(10, p.decimals),0) as volume - from swap_events_hourly s + from swap_events_hourly s left join tokens t on s.token0 = t.address left join tokens_prices_hourly p on s.hour >= p.time and s.hour < p.next_time and s.token0 = p.token - + ) , trading_volume as ( @@ -230,27 +231,27 @@ group by 1,2 ) , all_metrics as ( -select l.pool, pools.blockchain, pools.project, pools.fee, cast(l.time as date) as time, +select l.pool, pools.blockchain, pools.project, pools.fee, cast(l.time as date) as time, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then token0 else token1 end main_token, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p0.symbol else p1.symbol end main_token_symbol, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then token1 else token0 end paired_token, - case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p1.symbol else p0.symbol end paired_token_symbol, + case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p1.symbol else p0.symbol end paired_token_symbol, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then amount0/power(10, p0.decimals) else amount1/power(10, p1.decimals) end main_token_reserve, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then amount1/power(10, p1.decimals) else amount0/power(10, p0.decimals) end paired_token_reserve, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p0.price else p1.price end as main_token_usd_price, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p1.price else p0.price end as paired_token_usd_price, volume as trading_volume -from pool_liquidity l +from pool_liquidity l left join pools on l.pool = pools.address left join tokens t0 on l.token0 = t0.address left join tokens t1 on l.token1 = t1.address left join tokens_prices_daily p0 on l.time = p0.time and l.token0 = p0.token left join tokens_prices_daily p1 on l.time = p1.time and l.token1 = p1.token left join trading_volume tv on l.time = tv.time and l.pool = tv.pool -) +) -select blockchain||' '||project||' '||paired_token_symbol||':'||main_token_symbol||' '||format('%,.3f',round(coalesce(fee,0),4)) as pool_name, * +select blockchain||' '||project||' '||paired_token_symbol||':'||main_token_symbol||' '||format('%,.3f',round(coalesce(fee,0),4)) as pool_name, * from all_metrics diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_maverick_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_maverick_pools.sql similarity index 87% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_maverick_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_maverick_pools.sql index a8c8638bb6e..b7e8a74ccc9 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_maverick_pools.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_maverick_pools.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'maverick_pools', + schema='lido_liquidity_ethereum', + alias = 'maverick_pools', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,14 +13,14 @@ ) }} -{% set project_start_date = '2023-02-21' %} +{% set project_start_date = '2023-02-21' %} -with +with pools as ( -select distinct poolAddress, tokenA, tokenB, cast(fee as double)/1e16 as fee +select distinct poolAddress, tokenA, tokenB, cast(fee as double)/1e16 as fee from {{source('maverick_v1_ethereum','factory_evt_PoolCreated')}} -where tokenA = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 +where tokenA = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 or tokenB = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 ) @@ -34,7 +35,7 @@ union select tokenB from {{source('maverick_v1_ethereum','factory_evt_PoolCreated')}} where tokenA = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 -union +union select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) t ) @@ -51,14 +52,14 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} and date_trunc('day', minute) < current_date and blockchain = 'ethereum' and contract_address in (select address from tokens) group by 1,2,3,4 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), contract_address as token, symbol, decimals, @@ -69,25 +70,25 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 and contract_address in (select address from tokens) ) -, wsteth_prices_hourly as ( +, wsteth_prices_hourly as ( select time, lead(time,1, DATE_TRUNC('hour', now() + interval '1' hour)) over (order by time) as next_time, price from ( SELECT distinct - DATE_TRUNC('hour', minute) time, + DATE_TRUNC('hour', minute) time, last_value(price) over (partition by DATE_TRUNC('hour', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} p {% if not is_incremental() %} WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} and blockchain = 'ethereum' and contract_address = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) p ) , swap_events as ( - select + select date_trunc('day', sw.evt_block_time) as time, sw.contract_address as pool, cr.tokenA, cr.tokenB, @@ -100,16 +101,16 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% else %} WHERE {{ incremental_predicate('sw.evt_block_time') }} {% endif %} - and sw.contract_address in (select poolAddress from pools) + and sw.contract_address in (select poolAddress from pools) group by 1,2,3,4 ) , addliquidity_events as ( - select date_trunc('day', call_block_time) as time, + select date_trunc('day', call_block_time) as time, a.contract_address as pool, cr.tokenA, cr.tokenB, sum(cast(output_tokenAAmount as double)) as amountA, - sum(cast(output_tokenBAmount as double)) as amountB + sum(cast(output_tokenBAmount as double)) as amountB from {{source('maverick_v1_ethereum','pool_call_addLiquidity')}} a left join {{source('maverick_v1_ethereum','factory_evt_PoolCreated')}} cr on a.contract_address = cr.poolAddress {% if not is_incremental() %} @@ -117,13 +118,13 @@ left join {{source('maverick_v1_ethereum','factory_evt_PoolCreated')}} cr on a.c {% else %} WHERE {{ incremental_predicate('a.call_block_time') }} {% endif %} - and a.call_success + and a.call_success and a.contract_address in (select poolAddress from pools) group by 1,2,3,4 ) , removeliquidity_events as ( -select date_trunc('day', call_block_time) as time, +select date_trunc('day', call_block_time) as time, a.contract_address as pool, cr.tokenA, cr.tokenB, (-1)*sum(cast(output_tokenAOut as double)) as amountA, @@ -135,8 +136,8 @@ left join {{source('maverick_v1_ethereum','factory_evt_PoolCreated')}} cr on a.c {% else %} WHERE {{ incremental_predicate('a.call_block_time') }} {% endif %} - and a.call_success - and a.contract_address in (select poolAddress from pools) + and a.call_success + and a.contract_address in (select poolAddress from pools) group by 1,2,3,4 ) @@ -168,7 +169,7 @@ SELECT time, pools.fee, b.tokenB, coalesce((SUM(amountA)),0) AS amountA, coalesce((SUM(amountB)),0) AS amountB -FROM daily_delta_balance b +FROM daily_delta_balance b left join pools on b.pool = pools.poolAddress GROUP BY 1,2,3,4,5 ) @@ -176,14 +177,14 @@ GROUP BY 1,2,3,4,5 , wsteth_traded_hourly as ( - select + select date_trunc('hour', sw.evt_block_time) as time, sw.contract_address as pool, cr.tokenA, cr.tokenB, - sum(case when (cr.tokenA = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 and tokenAIn = true) then amountIn - when (cr.tokenA = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 and tokenAIn = false) then amountOut - when (cr.tokenA != 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 and tokenAIn = true) then amountOut - when (cr.tokenA != 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 and tokenAIn = false) then amountIn + sum(case when (cr.tokenA = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 and tokenAIn = true) then amountIn + when (cr.tokenA = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 and tokenAIn = false) then amountOut + when (cr.tokenA != 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 and tokenAIn = true) then amountOut + when (cr.tokenA != 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 and tokenAIn = false) then amountIn end) as amount from {{source('maverick_v1_ethereum','pool_evt_Swap')}} sw left join {{source('maverick_v1_ethereum','factory_evt_PoolCreated')}} cr on sw.contract_address = cr.poolAddress @@ -198,30 +199,30 @@ GROUP BY 1,2,3,4,5 ) , trading_volume_hourly as ( -select t.time, pool, t.amount*wp.price as volume_raw +select t.time, pool, t.amount*wp.price as volume_raw from wsteth_traded_hourly t left join wsteth_prices_hourly wp on date_trunc('hour',t.time) >= wp.time and date_trunc('hour',t.time) < wp.next_time order by 1,2 ) -, trading_volume as ( +, trading_volume as ( select distinct date_trunc('day', time) as time - , pool + , pool , sum(volume_raw)/1e18 as volume - from trading_volume_hourly + from trading_volume_hourly GROUP by 1,2 ) , all_metrics as ( -select +select o.pool, 'ethereum' as blockchain, 'maverick' as project, format('%,.3f',round(coalesce(fee,0),4)) as fee, - cast(o.time as date) time, - case when o.tokenA = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 then o.tokenA else o.tokenB end as main_token, + cast(o.time as date) time, + case when o.tokenA = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 then o.tokenA else o.tokenB end as main_token, case when o.tokenA = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 then pA.symbol else pB.symbol end as main_token_symbol, - case when o.tokenA = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 then o.tokenB else o.tokenA end as paired_token, + case when o.tokenA = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 then o.tokenB else o.tokenA end as paired_token, case when o.tokenA = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 then pB.symbol else pA.symbol end as paired_token_symbol, case when o.tokenA = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 then amountA/power(10,pA.decimals) else amountB/power(10,pB.decimals) end as main_token_reserve, case when o.tokenA = 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0 then amountB/power(10,pB.decimals) else amountA/power(10,pA.decimals) end as paired_token_reserve, diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_pancakeswap_v3_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_pancakeswap_v3_pools.sql similarity index 87% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_pancakeswap_v3_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_pancakeswap_v3_pools.sql index 1ce44e4f37a..357da2fa9b2 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_pancakeswap_v3_pools.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_pancakeswap_v3_pools.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'pancakeswap_v3_pools', + schema='lido_liquidity_ethereum', + alias = 'pancakeswap_v3_pools', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,9 +13,9 @@ ) }} -{% set project_start_date = '2023-04-03' %} +{% set project_start_date = '2023-04-03' %} -with +with pools as ( select pool as address, 'ethereum' as blockchain, 'pancakeswap' as project, max(cast(fee as double))/10000 as fee @@ -32,9 +33,9 @@ where token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 union select token0 from {{ source('pancakeswap_v3_ethereum','PancakeV3Factory_evt_PoolCreated')}} -where token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 -union -select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 +where token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 +union +select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) t ) @@ -50,14 +51,14 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} and date_trunc('day', minute) < current_date and blockchain = 'ethereum' - and contract_address in (select address from tokens) + and contract_address in (select address from tokens) group by 1,2,3,4 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), contract_address as token, decimals, symbol, @@ -69,12 +70,12 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) , tokens_prices_hourly AS ( - select time, - lead(time,1, DATE_TRUNC('hour', now() + interval '1' hour)) over (partition by token order by time) as next_time, + select time, + lead(time,1, DATE_TRUNC('hour', now() + interval '1' hour)) over (partition by token order by time) as next_time, token, price, decimals, symbol from ( SELECT distinct - DATE_TRUNC('hour', minute) time, + DATE_TRUNC('hour', minute) time, contract_address as token, decimals, symbol, @@ -86,19 +87,19 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 WHERE {{ incremental_predicate('p.minute') }} {% endif %} and blockchain = 'ethereum' - and contract_address in (select address from tokens) + and contract_address in (select address from tokens) ) p ) , swap_events as ( - select + select date_trunc('day', sw.evt_block_time) as time, sw.contract_address as pool, cr.token0, cr.token1, sum(cast(amount0 as DOUBLE)) as amount0, sum(cast(amount1 as DOUBLE)) as amount1 - + from {{ source('pancakeswap_v3_ethereum', 'PancakeV3Pool_evt_Swap') }} sw left join {{ source('pancakeswap_v3_ethereum', 'PancakeV3Factory_evt_PoolCreated') }} cr on sw.contract_address = cr.pool {% if not is_incremental() %} @@ -106,12 +107,12 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% else %} WHERE {{ incremental_predicate('sw.evt_block_time') }} {% endif %} - and sw.contract_address in (select address from pools) + and sw.contract_address in (select address from pools) group by 1,2,3,4 -) - +) + , mint_events as ( - select + select date_trunc('day', mt.evt_block_time) as time, mt.contract_address as pool, cr.token0, cr.token1, @@ -124,13 +125,13 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% else %} WHERE {{ incremental_predicate('mt.evt_block_time') }} {% endif %} - and mt.contract_address in (select address from pools) + and mt.contract_address in (select address from pools) group by 1,2,3,4 - + ) - + , burn_events as ( - select + select date_trunc('day', bn.evt_block_time) as time, bn.contract_address as pool, cr.token0, cr.token1, @@ -143,9 +144,9 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% else %} WHERE {{ incremental_predicate('bn.evt_block_time') }} {% endif %} - and bn.contract_address in (select address from pools) + and bn.contract_address in (select address from pools) group by 1,2,3,4 - + ) , collect_events AS ( @@ -167,29 +168,29 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 {% endif %} and c.contract_address IN (SELECT address FROM pools) ) - - + + , daily_delta_balance as ( select time, pool, token0, token1, sum(coalesce(amount0, 0)) as amount0, sum(coalesce(amount1, 0)) as amount1 - from ( - select time, pool, token0, token1, amount0, amount1 + from ( + select time, pool, token0, token1, amount0, amount1 from swap_events union all - select time, pool, token0, token1, amount0, amount1 + select time, pool, token0, token1, amount0, amount1 from mint_events union all - select time, pool, token0, token1, amount0, amount1 + select time, pool, token0, token1, amount0, amount1 from collect_events ) balance group by 1,2,3,4 ) - + , pool_liquidity as ( - select time, - pool, - token0, - token1, - sum(amount0) as amount0, + select time, + pool, + token0, + token1, + sum(amount0) as amount0, sum(amount1) as amount1 from daily_delta_balance group by 1,2,3,4 @@ -198,14 +199,14 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 , swap_events_hourly as ( select hour, pool, token0, token1, sum(amount0) as amount0, sum(amount1) as amount1 from ( - select + select date_trunc('hour', sw.evt_block_time) as hour, sw.contract_address as pool, cr.token0, cr.token1, coalesce(sum(cast(abs(amount0) as DOUBLE)),0) as amount0, coalesce(sum(cast(abs(amount1) as DOUBLE)),0) as amount1 - - from {{source('pancakeswap_v3_ethereum','PancakeV3Pool_evt_Swap')}} sw + + from {{source('pancakeswap_v3_ethereum','PancakeV3Pool_evt_Swap')}} sw left join {{source('pancakeswap_v3_ethereum','PancakeV3Factory_evt_PoolCreated')}} cr on sw.contract_address = cr.pool {% if not is_incremental() %} WHERE DATE_TRUNC('day', sw.evt_block_time) >= DATE '{{ project_start_date }}' @@ -216,14 +217,14 @@ select 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 group by 1,2,3,4 ) a group by 1,2,3,4 -) +) , trading_volume_hourly as ( select hour as time, pool, token0, amount0, p.price, coalesce(p.price*amount0/power(10, p.decimals),0) as volume - from swap_events_hourly s + from swap_events_hourly s left join tokens t on s.token0 = t.address left join tokens_prices_hourly p on s.hour >= p.time and s.hour < p.next_time and s.token0 = p.token - + ) , trading_volume as ( @@ -233,27 +234,27 @@ group by 1,2 ) , all_metrics as ( -select l.pool, pools.blockchain, pools.project, pools.fee, cast(l.time as date) as time, +select l.pool, pools.blockchain, pools.project, pools.fee, cast(l.time as date) as time, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then token0 else token1 end main_token, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p0.symbol else p1.symbol end main_token_symbol, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then token1 else token0 end paired_token, - case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p1.symbol else p0.symbol end paired_token_symbol, + case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p1.symbol else p0.symbol end paired_token_symbol, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then amount0/power(10, p0.decimals) else amount1/power(10, p1.decimals) end main_token_reserve, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then amount1/power(10, p1.decimals) else amount0/power(10, p0.decimals) end paired_token_reserve, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p0.price else p1.price end as main_token_usd_price, case when token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 then p1.price else p0.price end as paired_token_usd_price, volume as trading_volume -from pool_liquidity l +from pool_liquidity l left join pools on l.pool = pools.address left join tokens t0 on l.token0 = t0.address left join tokens t1 on l.token1 = t1.address left join tokens_prices_daily p0 on l.time = p0.time and l.token0 = p0.token left join tokens_prices_daily p1 on l.time = p1.time and l.token1 = p1.token left join trading_volume tv on l.time = tv.time and l.pool = tv.pool -) +) -select blockchain||' '||project||' '||COALESCE(paired_token_symbol, 'unknown')||':'||main_token_symbol||' '||format('%,.3f',round(coalesce(fee,0),4)) as pool_name,* +select blockchain||' '||project||' '||COALESCE(paired_token_symbol, 'unknown')||':'||main_token_symbol||' '||format('%,.3f',round(coalesce(fee,0),4)) as pool_name,* from all_metrics diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_schema.yml b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_schema.yml similarity index 100% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_schema.yml rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_schema.yml diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_solidly_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_solidly_pools.sql similarity index 93% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_solidly_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_solidly_pools.sql index 5e7b827721c..df4eef41838 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_solidly_pools.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_solidly_pools.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'solidly_pools', + schema='lido_liquidity_ethereum', + alias = 'solidly_pools', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,19 +13,19 @@ ) }} -{% set project_start_date = '2023-11-02' %} +{% set project_start_date = '2023-11-02' %} -with +with volumes as ( -select u.call_block_time as time, -cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth -from {{source('lido_ethereum','WstETH_call_unwrap')}} u -where call_success = TRUE +select u.call_block_time as time, +cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth +from {{source('lido_ethereum','WstETH_call_unwrap')}} u +where call_success = TRUE union all -select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth +select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth from {{source('lido_ethereum','WstETH_call_wrap')}} u -where call_success = TRUE +where call_success = TRUE ) @@ -32,14 +33,14 @@ where call_success = TRUE SELECT day, rate as rate0, value_partition, first_value(rate) over (partition by value_partition order by day) as rate, lead(day,1,date_trunc('day', now() + interval '1' day)) over(order by day) as next_day - + FROM ( select day, rate, sum(case when rate is null then 0 else 1 end) over (order by day) as value_partition from ( -select date_trunc('day', v.time) as day, +select date_trunc('day', v.time) as day, sum(cast(steth as double))/sum(cast(wsteth as double)) AS rate -from volumes v +from volumes v group by 1 )) @@ -61,7 +62,7 @@ group by 1 group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date @@ -80,10 +81,10 @@ group by 1 FROM {{source('solidly_ethereum','SolidlyV3Factory_evt_PoolCreated')}} WHERE - token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 - OR token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 + token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 + OR token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) - + , tokens AS ( SELECT DISTINCT @@ -92,22 +93,22 @@ group by 1 ( SELECT token1 AS token FROM {{source('solidly_ethereum','SolidlyV3Factory_evt_PoolCreated')}} - WHERE token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 + WHERE token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 UNION SELECT token0 FROM {{source('solidly_ethereum','SolidlyV3Factory_evt_PoolCreated')}} - WHERE token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 + WHERE token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 UNION - SELECT 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 + SELECT 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) AS t - + ) - + , tokens_prices_daily AS ( SELECT DISTINCT DATE_TRUNC('day', minute) AS time, contract_address AS token, - decimals, + decimals, symbol, AVG(price) AS price FROM @@ -117,7 +118,7 @@ group by 1 WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} AND DATE_TRUNC('day', minute) < current_date AND blockchain = 'ethereum' AND contract_address IN (SELECT address FROM tokens ) @@ -126,7 +127,7 @@ group by 1 SELECT DISTINCT DATE_TRUNC('day', minute), contract_address AS token, - decimals, + decimals, symbol, LAST_VALUE(price) OVER ( PARTITION BY @@ -143,13 +144,13 @@ group by 1 AND blockchain = 'ethereum' AND contract_address IN (SELECT address FROM tokens ) ), - + tokens_prices_hourly AS ( SELECT DISTINCT DATE_TRUNC('hour', minute) AS time, LEAD(DATE_TRUNC('hour', minute),1,DATE_TRUNC('hour', NOW() + INTERVAL '1' hour)) OVER (PARTITION BY contract_address ORDER BY DATE_TRUNC('hour', minute) NULLS FIRST) AS next_time, contract_address AS token, - decimals, + decimals, symbol, LAST_VALUE(price) OVER ( PARTITION BY @@ -165,12 +166,12 @@ group by 1 WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} AND blockchain = 'ethereum' AND contract_address IN (SELECT address FROM tokens) - + ) - + , swap_events AS ( SELECT DATE_TRUNC('day', sw.evt_block_time) AS time, @@ -209,9 +210,9 @@ group by 1 {% endif %} and mt.contract_address IN (SELECT address FROM pools) GROUP BY 1, 2, 3, 4 - + ) - + , collect_events AS ( SELECT c.evt_block_time AS time, @@ -231,10 +232,10 @@ group by 1 {% endif %} and c.contract_address IN (SELECT address FROM pools) ) - + , daily_delta_balance AS ( - + SELECT time, pool, @@ -284,9 +285,9 @@ group by 1 2, 3, 4 - + ) - + , pool_liquidity AS ( SELECT time, @@ -295,10 +296,10 @@ group by 1 d.token1, SUM(amount0) AS amount0, SUM(amount1) AS amount1 - FROM daily_delta_balance d + FROM daily_delta_balance d GROUP BY 1,2,3,4 ) - + , swap_events_hourly AS ( SELECT sw.evt_block_time as time, @@ -308,7 +309,7 @@ group by 1 COALESCE(SUM(CAST(ABS(amount0) AS DOUBLE)), 0) AS amount0, COALESCE(SUM(CAST(ABS(amount1) AS DOUBLE)), 0) AS amount1 FROM - {{source('solidly_ethereum','SolidlyV3Pool_evt_Swap')}} AS sw + {{source('solidly_ethereum','SolidlyV3Pool_evt_Swap')}} AS sw inner join pools on sw.contract_address = pools.address {% if not is_incremental() %} @@ -316,12 +317,12 @@ group by 1 {% else %} WHERE {{ incremental_predicate('sw.evt_block_time') }} {% endif %} - + GROUP BY 1, 2, 3, 4 - + ) - - + + , trading_volume AS ( SELECT date_trunc('day', s.time) AS time, @@ -332,9 +333,9 @@ group by 1 LEFT JOIN tokens_prices_hourly AS p ON date_trunc('hour', s.time) >= p.time AND date_trunc('hour', s.time) < p.next_time AND s.token0 = p.token - group by 1,2 + group by 1,2 ) - + , all_metrics AS ( SELECT l.pool, @@ -382,7 +383,7 @@ group by 1 LEFT JOIN tokens AS t1 ON l.token1 = t1.address LEFT JOIN tokens_prices_daily AS p0 ON l.time = p0.time AND l.token0 = p0.token LEFT JOIN tokens_prices_daily AS p1 ON l.time = p1.time AND l.token1 = p1.token - LEFT JOIN wsteth_rate r on l.time >= r.day and l.time < r.next_day + LEFT JOIN wsteth_rate r on l.time >= r.day and l.time < r.next_day LEFT JOIN steth_prices_daily on steth_prices_daily.time = l.time LEFT JOIN trading_volume AS tv ON l.time = tv.time AND l.pool = tv.pool ) diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_uniswap_v2_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_uniswap_v2_pools.sql similarity index 92% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_uniswap_v2_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_uniswap_v2_pools.sql index fd3b52fdcd8..ad556251d70 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_uniswap_v2_pools.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_uniswap_v2_pools.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'uniswap_v2_pools', + schema='lido_liquidity_ethereum', + alias = 'uniswap_v2_pools', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,7 +13,7 @@ ) }} -{% set project_start_date = '2020-12-19' %} +{% set project_start_date = '2020-12-19' %} with dates as ( with day_seq as (select (sequence(cast('{{ project_start_date }}' as date), current_date, interval '1' day)) as day) @@ -20,20 +21,20 @@ select days.day from day_seq cross join unnest(day) as days(day) ) - - + + , pools AS ( SELECT pair AS address, 'ethereum' AS blockchain, 'uniswap_v2' AS project, - 0.003 as fee, + 0.003 as fee, token0, token1 FROM {{source('uniswap_v2_ethereum','Factory_evt_PairCreated')}} WHERE pair = 0x4028daac072e492d34a3afdbef0ba7e35d8b55c4 ) - + , tokens AS ( @@ -53,14 +54,14 @@ cross join unnest(day) as days(day) UNION SELECT 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 ) AS t - + ) - + , tokens_prices_daily AS ( SELECT DISTINCT DATE_TRUNC('day', minute) AS time, contract_address AS token, - decimals, + decimals, symbol, AVG(price) AS price FROM {{source('prices','usd')}} p @@ -77,7 +78,7 @@ cross join unnest(day) as days(day) SELECT DISTINCT DATE_TRUNC('day', minute), contract_address AS token, - decimals, + decimals, symbol, LAST_VALUE(price) OVER ( PARTITION BY @@ -93,14 +94,14 @@ cross join unnest(day) as days(day) AND blockchain = 'ethereum' AND contract_address IN (SELECT address FROM tokens ) ) - - + + , tokens_prices_hourly AS ( SELECT DISTINCT DATE_TRUNC('hour', minute) AS time, LEAD(DATE_TRUNC('hour', minute),1,DATE_TRUNC('hour', NOW() + INTERVAL '1' hour)) OVER (PARTITION BY contract_address ORDER BY DATE_TRUNC('hour', minute) NULLS FIRST) AS next_time, contract_address AS token, - decimals, + decimals, symbol, LAST_VALUE(price) OVER ( PARTITION BY @@ -118,9 +119,9 @@ cross join unnest(day) as days(day) {% endif %} AND blockchain = 'ethereum' AND contract_address IN (SELECT address FROM tokens) - + ) - + , swap_events AS ( SELECT DATE_TRUNC('day', sw.evt_block_time) AS time, @@ -132,7 +133,7 @@ cross join unnest(day) as days(day) FROM {{source('uniswap_v2_ethereum','Pair_evt_Swap')}} as sw LEFT JOIN {{source('uniswap_v2_ethereum','Factory_evt_PairCreated')}} AS cr ON sw.contract_address = cr.pair - + {% if not is_incremental() %} WHERE DATE_TRUNC('day', sw.evt_block_time) >= DATE '{{ project_start_date }}' {% else %} @@ -141,7 +142,7 @@ cross join unnest(day) as days(day) and sw.contract_address IN (SELECT address FROM pools) GROUP BY 1,2,3,4 ) - + , mint_events AS ( SELECT DATE_TRUNC('day', mt.evt_block_time) AS time, @@ -159,7 +160,7 @@ cross join unnest(day) as days(day) {% endif %} and mt.contract_address IN (SELECT address FROM pools) GROUP BY 1, 2, 3, 4 - + ) , burn_events AS ( @@ -180,33 +181,33 @@ cross join unnest(day) as days(day) and bn.contract_address IN (SELECT address FROM pools) GROUP BY 1, 2, 3, 4 ) - + , daily_delta_balance as ( select time, pool, token0, token1, sum(coalesce(amount0, 0)) as amount0, sum(coalesce(amount1, 0)) as amount1 - from ( - select time, pool, token0, token1, amount0, amount1 + from ( + select time, pool, token0, token1, amount0, amount1 from swap_events union all - select time, pool, token0, token1, amount0, amount1 + select time, pool, token0, token1, amount0, amount1 from mint_events union all - select time, pool, token0, token1, amount0, amount1 + select time, pool, token0, token1, amount0, amount1 from burn_events ) balance group by 1,2,3,4 ) - + , pool_liquidity as ( - select time, - pool, - token0, - token1, - sum(amount0) as amount0, + select time, + pool, + token0, + token1, + sum(amount0) as amount0, sum(amount1) as amount1 from daily_delta_balance group by 1,2,3,4 ) - + , swap_events_hourly AS ( SELECT sw.evt_block_time as time, @@ -216,18 +217,18 @@ cross join unnest(day) as days(day) COALESCE(SUM(CAST(ABS(amount0In+amount0Out) AS DOUBLE)), 0) AS amount0, COALESCE(SUM(CAST(ABS(amount1In+amount1Out) AS DOUBLE)), 0) AS amount1 FROM - {{source('uniswap_v2_ethereum','Pair_evt_Swap')}} AS sw + {{source('uniswap_v2_ethereum','Pair_evt_Swap')}} AS sw inner join pools on sw.contract_address = pools.address {% if not is_incremental() %} WHERE DATE_TRUNC('day', sw.evt_block_time) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('sw.evt_block_time') }} - {% endif %} + {% endif %} GROUP BY 1, 2, 3, 4 - + ) - - + + , trading_volume AS ( SELECT date_trunc('day', s.time) AS time, @@ -238,16 +239,16 @@ cross join unnest(day) as days(day) LEFT JOIN tokens_prices_hourly AS p ON date_trunc('hour', s.time) >= p.time AND date_trunc('hour', s.time) < p.next_time AND s.token0 = p.token - group by 1,2 + group by 1,2 ) - + , all_metrics AS ( - - select l.pool, pools.blockchain, pools.project, pools.fee, cast(l.time as date) as time, + + select l.pool, pools.blockchain, pools.project, pools.fee, cast(l.time as date) as time, case when l.token0 = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 then l.token0 else l.token1 end main_token, case when l.token0 = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 then coalesce(p0.symbol, 'stETH') else coalesce(p1.symbol, 'stETH') end main_token_symbol, case when l.token0 = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 then l.token1 else l.token0 end paired_token, - case when l.token0 = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 then p1.symbol else p0.symbol end paired_token_symbol, + case when l.token0 = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 then p1.symbol else p0.symbol end paired_token_symbol, --it's right only for uni v2 stETH:ETH pool case when l.token0 = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 then amount0/power(10, coalesce(p0.decimals, p1.decimals)) else amount1/power(10, coalesce(p1.decimals, p0.decimals)) end main_token_reserve, case when l.token0 = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 then amount1/power(10, p1.decimals) else amount0/power(10, p0.decimals) end paired_token_reserve, @@ -255,7 +256,7 @@ cross join unnest(day) as days(day) case when l.token0 = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 then coalesce(p0.price, p1.price) else coalesce(p1.price, p0.price) end as main_token_usd_price, case when l.token0 = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 then p1.price else p0.price end as paired_token_usd_price, volume as trading_volume -from pool_liquidity l +from pool_liquidity l left join pools on l.pool = pools.address left join tokens t0 on l.token0 = t0.address left join tokens t1 on l.token1 = t1.address @@ -263,8 +264,8 @@ left join tokens_prices_daily p0 on l.time = p0.time and l.token0 = p0.token left join tokens_prices_daily p1 on l.time = p1.time and l.token1 = p1.token left join trading_volume AS tv ON l.time = tv.time AND l.pool = tv.pool ) - - -select blockchain||' '||project||' '||COALESCE(paired_token_symbol, 'unknown')||':'||main_token_symbol||' '||format('%,.3f',round(coalesce(fee,0),4)) as pool_name,* + + +select blockchain||' '||project||' '||COALESCE(paired_token_symbol, 'unknown')||':'||main_token_symbol||' '||format('%,.3f',round(coalesce(fee,0),4)) as pool_name,* from all_metrics diff --git a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_uniswap_v3_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_uniswap_v3_pools.sql similarity index 93% rename from models/lido/liquidity/ethereum/lido_liquidity_ethereum_uniswap_v3_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_uniswap_v3_pools.sql index 5c01710c7c5..57d5fced874 100644 --- a/models/lido/liquidity/ethereum/lido_liquidity_ethereum_uniswap_v3_pools.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/ethereum/lido_liquidity_ethereum_uniswap_v3_pools.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'uniswap_v3_pools', + schema='lido_liquidity_ethereum', + alias = 'uniswap_v3_pools', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -12,19 +13,19 @@ ) }} -{% set project_start_date = '2021-05-05' %} +{% set project_start_date = '2021-05-05' %} -with +with volumes as ( -select u.call_block_time as time, -cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth -from {{source('lido_ethereum','WstETH_call_unwrap')}} u -where call_success = TRUE +select u.call_block_time as time, +cast(output_0 as double) as steth, cast(_wstETHAmount as double) as wsteth +from {{source('lido_ethereum','WstETH_call_unwrap')}} u +where call_success = TRUE union all -select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth +select u.call_block_time, cast(_stETHAmount as double) as steth, cast(output_0 as double) as wsteth from {{source('lido_ethereum','WstETH_call_wrap')}} u -where call_success = TRUE +where call_success = TRUE ) @@ -32,14 +33,14 @@ where call_success = TRUE SELECT day, rate as rate0, value_partition, first_value(rate) over (partition by value_partition order by day) as rate, lead(day,1,date_trunc('day', now() + interval '1' day)) over(order by day) as next_day - + FROM ( select day, rate, sum(case when rate is null then 0 else 1 end) over (order by day) as value_partition from ( -select date_trunc('day', v.time) as day, +select date_trunc('day', v.time) as day, sum(cast(steth as double))/sum(cast(wsteth as double)) AS rate -from volumes v +from volumes v group by 1 )) @@ -61,7 +62,7 @@ group by 1 group by 1 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), last_value(price) over (partition by DATE_TRUNC('day', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} WHERE date_trunc('day', minute) = current_date @@ -80,10 +81,10 @@ group by 1 FROM {{source('uniswap_v3_ethereum','Factory_evt_PoolCreated')}} WHERE - token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 - OR token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 + token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 + OR token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) - + , tokens AS ( SELECT DISTINCT @@ -92,22 +93,22 @@ group by 1 ( SELECT token1 AS token FROM {{source('uniswap_v3_ethereum','Factory_evt_PoolCreated')}} - WHERE token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 + WHERE token0 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 UNION SELECT token0 FROM {{source('uniswap_v3_ethereum','Factory_evt_PoolCreated')}} - WHERE token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 + WHERE token1 = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 UNION - SELECT 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 + SELECT 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0 ) AS t - + ) - + , tokens_prices_daily AS ( SELECT DISTINCT DATE_TRUNC('day', minute) AS time, contract_address AS token, - decimals, + decimals, symbol, AVG(price) AS price FROM @@ -117,7 +118,7 @@ group by 1 WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} AND DATE_TRUNC('day', minute) < current_date AND blockchain = 'ethereum' AND contract_address IN (SELECT address FROM tokens ) @@ -126,7 +127,7 @@ group by 1 SELECT DISTINCT DATE_TRUNC('day', minute) AS time, 0xd5f7838f5c461feff7fe49ea5ebaf7728bb0adfa AS token, --mETH - decimals, + decimals, 'mETH', AVG(price) AS price FROM @@ -140,7 +141,7 @@ group by 1 SELECT DISTINCT DATE_TRUNC('day', minute), contract_address AS token, - decimals, + decimals, symbol, LAST_VALUE(price) OVER ( PARTITION BY @@ -157,13 +158,13 @@ group by 1 AND blockchain = 'ethereum' AND contract_address IN (SELECT address FROM tokens ) ), - + tokens_prices_hourly AS ( SELECT DISTINCT DATE_TRUNC('hour', minute) AS time, LEAD(DATE_TRUNC('hour', minute),1,DATE_TRUNC('hour', NOW() + INTERVAL '1' hour)) OVER (PARTITION BY contract_address ORDER BY DATE_TRUNC('hour', minute) NULLS FIRST) AS next_time, contract_address AS token, - decimals, + decimals, symbol, LAST_VALUE(price) OVER ( PARTITION BY @@ -179,12 +180,12 @@ group by 1 WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} AND blockchain = 'ethereum' AND contract_address IN (SELECT address FROM tokens) - + ) - + , swap_events AS ( SELECT DATE_TRUNC('day', sw.evt_block_time) AS time, @@ -223,9 +224,9 @@ group by 1 {% endif %} and mt.contract_address IN (SELECT address FROM pools) GROUP BY 1, 2, 3, 4 - + ) - + , collect_events AS ( SELECT c.evt_block_time AS time, @@ -245,10 +246,10 @@ group by 1 {% endif %} and c.contract_address IN (SELECT address FROM pools) ) - + , daily_delta_balance AS ( - + SELECT time, pool, @@ -298,9 +299,9 @@ group by 1 2, 3, 4 - + ) - + , pool_liquidity AS ( SELECT time, @@ -309,10 +310,10 @@ group by 1 d.token1, SUM(amount0) AS amount0, SUM(amount1) AS amount1 - FROM daily_delta_balance d + FROM daily_delta_balance d GROUP BY 1,2,3,4 ) - + , swap_events_hourly AS ( SELECT sw.evt_block_time as time, @@ -322,7 +323,7 @@ group by 1 COALESCE(SUM(CAST(ABS(amount0) AS DOUBLE)), 0) AS amount0, COALESCE(SUM(CAST(ABS(amount1) AS DOUBLE)), 0) AS amount1 FROM - {{source('uniswap_v3_ethereum','Pair_evt_Swap')}} AS sw + {{source('uniswap_v3_ethereum','Pair_evt_Swap')}} AS sw inner join pools on sw.contract_address = pools.address {% if not is_incremental() %} @@ -330,12 +331,12 @@ group by 1 {% else %} WHERE {{ incremental_predicate('sw.evt_block_time') }} {% endif %} - + GROUP BY 1, 2, 3, 4 - + ) - - + + , trading_volume AS ( SELECT date_trunc('day', s.time) AS time, @@ -346,9 +347,9 @@ group by 1 LEFT JOIN tokens_prices_hourly AS p ON date_trunc('hour', s.time) >= p.time AND date_trunc('hour', s.time) < p.next_time AND s.token0 = p.token - group by 1,2 + group by 1,2 ) - + , all_metrics AS ( SELECT l.pool, @@ -396,7 +397,7 @@ group by 1 LEFT JOIN tokens AS t1 ON l.token1 = t1.address LEFT JOIN tokens_prices_daily AS p0 ON l.time = p0.time AND l.token0 = p0.token LEFT JOIN tokens_prices_daily AS p1 ON l.time = p1.time AND l.token1 = p1.token - LEFT JOIN wsteth_rate r on l.time >= r.day and l.time < r.next_day + LEFT JOIN wsteth_rate r on l.time >= r.day and l.time < r.next_day LEFT JOIN steth_prices_daily on steth_prices_daily.time = l.time LEFT JOIN trading_volume AS tv ON l.time = tv.time AND l.pool = tv.pool ) diff --git a/models/lido/liquidity/linea/lido_liquidity_linea_schema.yml b/hourly_spellbook/models/_project/lido/liquidity/linea/lido_liquidity_linea_schema.yml similarity index 100% rename from models/lido/liquidity/linea/lido_liquidity_linea_schema.yml rename to hourly_spellbook/models/_project/lido/liquidity/linea/lido_liquidity_linea_schema.yml diff --git a/models/lido/liquidity/linea/lido_liquidity_linea_syncswap_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/linea/lido_liquidity_linea_syncswap_pools.sql similarity index 100% rename from models/lido/liquidity/linea/lido_liquidity_linea_syncswap_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/linea/lido_liquidity_linea_syncswap_pools.sql diff --git a/models/lido/liquidity/optimism/lido_liquidity_optimism_balancer_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_balancer_pools.sql similarity index 100% rename from models/lido/liquidity/optimism/lido_liquidity_optimism_balancer_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_balancer_pools.sql diff --git a/models/lido/liquidity/optimism/lido_liquidity_optimism_curve_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_curve_pools.sql similarity index 100% rename from models/lido/liquidity/optimism/lido_liquidity_optimism_curve_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_curve_pools.sql diff --git a/models/lido/liquidity/optimism/lido_liquidity_optimism_kyberswap_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_kyberswap_pools.sql similarity index 100% rename from models/lido/liquidity/optimism/lido_liquidity_optimism_kyberswap_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_kyberswap_pools.sql diff --git a/models/lido/liquidity/optimism/lido_liquidity_optimism_kyberswap_v2_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_kyberswap_v2_pools.sql similarity index 100% rename from models/lido/liquidity/optimism/lido_liquidity_optimism_kyberswap_v2_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_kyberswap_v2_pools.sql diff --git a/models/lido/liquidity/optimism/lido_liquidity_optimism_schema.yml b/hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_schema.yml similarity index 100% rename from models/lido/liquidity/optimism/lido_liquidity_optimism_schema.yml rename to hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_schema.yml diff --git a/models/lido/liquidity/optimism/lido_liquidity_optimism_uniswap_v3_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_uniswap_v3_pools.sql similarity index 100% rename from models/lido/liquidity/optimism/lido_liquidity_optimism_uniswap_v3_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_uniswap_v3_pools.sql diff --git a/models/lido/liquidity/optimism/lido_liquidity_optimism_velodrome_cl_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_velodrome_cl_pools.sql similarity index 100% rename from models/lido/liquidity/optimism/lido_liquidity_optimism_velodrome_cl_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_velodrome_cl_pools.sql diff --git a/models/lido/liquidity/optimism/lido_liquidity_optimism_velodrome_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_velodrome_pools.sql similarity index 100% rename from models/lido/liquidity/optimism/lido_liquidity_optimism_velodrome_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_velodrome_pools.sql diff --git a/models/lido/liquidity/optimism/lido_liquidity_optimism_velodrome_v2_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_velodrome_v2_pools.sql similarity index 100% rename from models/lido/liquidity/optimism/lido_liquidity_optimism_velodrome_v2_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/optimism/lido_liquidity_optimism_velodrome_v2_pools.sql diff --git a/models/lido/liquidity/polygon/lido_liquidity_polygon_balancer_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/polygon/lido_liquidity_polygon_balancer_pools.sql similarity index 100% rename from models/lido/liquidity/polygon/lido_liquidity_polygon_balancer_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/polygon/lido_liquidity_polygon_balancer_pools.sql diff --git a/models/lido/liquidity/polygon/lido_liquidity_polygon_kyberswap_v2_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/polygon/lido_liquidity_polygon_kyberswap_v2_pools.sql similarity index 100% rename from models/lido/liquidity/polygon/lido_liquidity_polygon_kyberswap_v2_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/polygon/lido_liquidity_polygon_kyberswap_v2_pools.sql diff --git a/models/lido/liquidity/polygon/lido_liquidity_polygon_schema.yml b/hourly_spellbook/models/_project/lido/liquidity/polygon/lido_liquidity_polygon_schema.yml similarity index 100% rename from models/lido/liquidity/polygon/lido_liquidity_polygon_schema.yml rename to hourly_spellbook/models/_project/lido/liquidity/polygon/lido_liquidity_polygon_schema.yml diff --git a/models/lido/liquidity/polygon/lido_liquidity_polygon_uniswap_v3_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/polygon/lido_liquidity_polygon_uniswap_v3_pools.sql similarity index 100% rename from models/lido/liquidity/polygon/lido_liquidity_polygon_uniswap_v3_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/polygon/lido_liquidity_polygon_uniswap_v3_pools.sql diff --git a/models/lido/liquidity/scroll/lido_liquidity_scroll_schema.yml b/hourly_spellbook/models/_project/lido/liquidity/scroll/lido_liquidity_scroll_schema.yml similarity index 100% rename from models/lido/liquidity/scroll/lido_liquidity_scroll_schema.yml rename to hourly_spellbook/models/_project/lido/liquidity/scroll/lido_liquidity_scroll_schema.yml diff --git a/models/lido/liquidity/scroll/lido_liquidity_scroll_syncswap_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/scroll/lido_liquidity_scroll_syncswap_pools.sql similarity index 100% rename from models/lido/liquidity/scroll/lido_liquidity_scroll_syncswap_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/scroll/lido_liquidity_scroll_syncswap_pools.sql diff --git a/models/lido/liquidity/scroll/lido_liquidity_scroll_zebra_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/scroll/lido_liquidity_scroll_zebra_pools.sql similarity index 100% rename from models/lido/liquidity/scroll/lido_liquidity_scroll_zebra_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/scroll/lido_liquidity_scroll_zebra_pools.sql diff --git a/models/lido/liquidity/zksync/lido_liquidity_zksync_maverick_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/zksync/lido_liquidity_zksync_maverick_pools.sql similarity index 88% rename from models/lido/liquidity/zksync/lido_liquidity_zksync_maverick_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/zksync/lido_liquidity_zksync_maverick_pools.sql index 8561750c36e..e79032ab767 100644 --- a/models/lido/liquidity/zksync/lido_liquidity_zksync_maverick_pools.sql +++ b/hourly_spellbook/models/_project/lido/liquidity/zksync/lido_liquidity_zksync_maverick_pools.sql @@ -1,5 +1,6 @@ {{ config( - alias = 'maverick_pools_zksync', + schema='lido_liquidity_zksync', + alias = 'maverick_pools_zksync', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -9,16 +10,16 @@ spell_type = "project", spell_name = "lido_liquidity", contributors = \'["pipistrella"]\') }}' - + ) }} -{% set project_start_date = '2024-01-17' %} +{% set project_start_date = '2024-01-17' %} -with +with pools as ( -select distinct poolAddress, tokenA, tokenB, cast(fee as double)/1e16 as fee +select distinct poolAddress, tokenA, tokenB, cast(fee as double)/1e16 as fee from {{source('maverick_v1_zksync','factory_evt_PoolCreated')}} where tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 or tokenB = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 @@ -35,7 +36,7 @@ union select tokenB from {{source('maverick_v1_zksync','factory_evt_PoolCreated')}} where tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 -union +union select 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 ) t ) @@ -52,14 +53,14 @@ select 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} and date_trunc('day', minute) < current_date and blockchain = 'zksync' and contract_address in (select address from tokens) group by 1,2,3,4 union all SELECT distinct - DATE_TRUNC('day', minute), + DATE_TRUNC('day', minute), contract_address as token, symbol, decimals, @@ -70,25 +71,25 @@ select 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 and contract_address in (select address from tokens) ) -, wsteth_prices_hourly as ( +, wsteth_prices_hourly as ( select time, lead(time,1, DATE_TRUNC('hour', now() + interval '1' hour)) over (order by time) as next_time, price from ( SELECT distinct - DATE_TRUNC('hour', minute) time, + DATE_TRUNC('hour', minute) time, last_value(price) over (partition by DATE_TRUNC('hour', minute), contract_address ORDER BY minute range between unbounded preceding AND unbounded following) AS price FROM {{source('prices','usd')}} p {% if not is_incremental() %} WHERE DATE_TRUNC('day', p.minute) >= DATE '{{ project_start_date }}' {% else %} WHERE {{ incremental_predicate('p.minute') }} - {% endif %} + {% endif %} and blockchain = 'zksync' and contract_address = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 ) p ) , swap_events as ( - select + select date_trunc('day', sw.evt_block_time) as time, sw.contract_address as pool, cr.tokenA, cr.tokenB, @@ -101,16 +102,16 @@ select 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 {% else %} WHERE {{ incremental_predicate('sw.evt_block_time') }} {% endif %} - and sw.contract_address in (select poolAddress from pools) + and sw.contract_address in (select poolAddress from pools) group by 1,2,3,4 ) , addliquidity_events as ( - select date_trunc('day', call_block_time) as time, + select date_trunc('day', call_block_time) as time, a.contract_address as pool, cr.tokenA, cr.tokenB, sum(cast(output_tokenAAmount as double)) as amountA, - sum(cast(output_tokenBAmount as double)) as amountB + sum(cast(output_tokenBAmount as double)) as amountB from {{source('maverick_v1_zksync','pool_call_addLiquidity')}} a left join {{source('maverick_v1_zksync','factory_evt_PoolCreated')}} cr on a.contract_address = cr.poolAddress {% if not is_incremental() %} @@ -118,13 +119,13 @@ left join {{source('maverick_v1_zksync','factory_evt_PoolCreated')}} cr on a.con {% else %} WHERE {{ incremental_predicate('a.call_block_time') }} {% endif %} - and a.call_success + and a.call_success and a.contract_address in (select poolAddress from pools) group by 1,2,3,4 ) , removeliquidity_events as ( -select date_trunc('day', call_block_time) as time, +select date_trunc('day', call_block_time) as time, a.contract_address as pool, cr.tokenA, cr.tokenB, (-1)*sum(cast(output_tokenAOut as double)) as amountA, @@ -136,8 +137,8 @@ left join {{source('maverick_v1_zksync','factory_evt_PoolCreated')}} cr on a.con {% else %} WHERE {{ incremental_predicate('a.call_block_time') }} {% endif %} - and a.call_success - and a.contract_address in (select poolAddress from pools) + and a.call_success + and a.contract_address in (select poolAddress from pools) group by 1,2,3,4 ) @@ -169,7 +170,7 @@ SELECT time, pools.fee, b.tokenB, coalesce((SUM(amountA)),0) AS amountA, coalesce((SUM(amountB)),0) AS amountB -FROM daily_delta_balance b +FROM daily_delta_balance b left join pools on b.pool = pools.poolAddress GROUP BY 1,2,3,4,5 ) @@ -177,14 +178,14 @@ GROUP BY 1,2,3,4,5 , wsteth_traded_hourly as ( - select + select date_trunc('hour', sw.evt_block_time) as time, sw.contract_address as pool, cr.tokenA, cr.tokenB, - sum(case when (cr.tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 and tokenAIn = true) then amountIn - when (cr.tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 and tokenAIn = false) then amountOut - when (cr.tokenA != 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 and tokenAIn = true) then amountOut - when (cr.tokenA != 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 and tokenAIn = false) then amountIn + sum(case when (cr.tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 and tokenAIn = true) then amountIn + when (cr.tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 and tokenAIn = false) then amountOut + when (cr.tokenA != 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 and tokenAIn = true) then amountOut + when (cr.tokenA != 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 and tokenAIn = false) then amountIn end) as amount from {{source('maverick_v1_zksync','pool_evt_Swap')}} sw left join {{source('maverick_v1_zksync','factory_evt_PoolCreated')}} cr on sw.contract_address = cr.poolAddress @@ -199,30 +200,30 @@ GROUP BY 1,2,3,4,5 ) , trading_volume_hourly as ( -select t.time, pool, t.amount*wp.price as volume_raw +select t.time, pool, t.amount*wp.price as volume_raw from wsteth_traded_hourly t left join wsteth_prices_hourly wp on date_trunc('hour',t.time) >= wp.time and date_trunc('hour',t.time) < wp.next_time order by 1,2 ) -, trading_volume as ( +, trading_volume as ( select distinct date_trunc('day', time) as time - , pool + , pool , sum(volume_raw)/1e18 as volume - from trading_volume_hourly + from trading_volume_hourly GROUP by 1,2 ) , all_metrics as ( -select +select o.pool, 'zksync' as blockchain, 'maverick' as project, format('%,.3f',round(coalesce(fee,0),4)) as fee, - cast(o.time as date) time, - case when o.tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 then o.tokenA else o.tokenB end as main_token, + cast(o.time as date) time, + case when o.tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 then o.tokenA else o.tokenB end as main_token, case when o.tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 then pA.symbol else pB.symbol end as main_token_symbol, - case when o.tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 then o.tokenB else o.tokenA end as paired_token, + case when o.tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 then o.tokenB else o.tokenA end as paired_token, case when o.tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 then pB.symbol else pA.symbol end as paired_token_symbol, case when o.tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 then amountA/power(10,pA.decimals) else amountB/power(10,pB.decimals) end as main_token_reserve, case when o.tokenA = 0x703b52F2b28fEbcB60E1372858AF5b18849FE867 then amountB/power(10,pB.decimals) else amountA/power(10,pA.decimals) end as paired_token_reserve, diff --git a/models/lido/liquidity/zksync/lido_liquidity_zksync_schema.yml b/hourly_spellbook/models/_project/lido/liquidity/zksync/lido_liquidity_zksync_schema.yml similarity index 100% rename from models/lido/liquidity/zksync/lido_liquidity_zksync_schema.yml rename to hourly_spellbook/models/_project/lido/liquidity/zksync/lido_liquidity_zksync_schema.yml diff --git a/models/lido/liquidity/zksync/lido_liquidity_zksync_syncswap_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/zksync/lido_liquidity_zksync_syncswap_pools.sql similarity index 100% rename from models/lido/liquidity/zksync/lido_liquidity_zksync_syncswap_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/zksync/lido_liquidity_zksync_syncswap_pools.sql diff --git a/models/lido/liquidity/zksync/lido_liquidity_zksync_syncswap_v2_pools.sql b/hourly_spellbook/models/_project/lido/liquidity/zksync/lido_liquidity_zksync_syncswap_v2_pools.sql similarity index 100% rename from models/lido/liquidity/zksync/lido_liquidity_zksync_syncswap_v2_pools.sql rename to hourly_spellbook/models/_project/lido/liquidity/zksync/lido_liquidity_zksync_syncswap_v2_pools.sql diff --git a/models/safe/arbitrum/safe_arbitrum_eth_transfers.sql b/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_eth_transfers.sql similarity index 100% rename from models/safe/arbitrum/safe_arbitrum_eth_transfers.sql rename to hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_eth_transfers.sql diff --git a/models/safe/arbitrum/safe_arbitrum_safes.sql b/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_safes.sql similarity index 100% rename from models/safe/arbitrum/safe_arbitrum_safes.sql rename to hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_safes.sql diff --git a/models/safe/arbitrum/safe_arbitrum_schema.yml b/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_schema.yml similarity index 100% rename from models/safe/arbitrum/safe_arbitrum_schema.yml rename to hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_schema.yml diff --git a/models/safe/arbitrum/safe_arbitrum_singletons.sql b/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_singletons.sql similarity index 100% rename from models/safe/arbitrum/safe_arbitrum_singletons.sql rename to hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_singletons.sql diff --git a/models/safe/arbitrum/safe_arbitrum_transactions.sql b/hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_transactions.sql similarity index 100% rename from models/safe/arbitrum/safe_arbitrum_transactions.sql rename to hourly_spellbook/models/_project/safe/arbitrum/safe_arbitrum_transactions.sql diff --git a/models/safe/avalanche_c/safe_avalanche_c_avax_transfers.sql b/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_avax_transfers.sql similarity index 100% rename from models/safe/avalanche_c/safe_avalanche_c_avax_transfers.sql rename to hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_avax_transfers.sql diff --git a/models/safe/avalanche_c/safe_avalanche_c_safes.sql b/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_safes.sql similarity index 100% rename from models/safe/avalanche_c/safe_avalanche_c_safes.sql rename to hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_safes.sql diff --git a/models/safe/avalanche_c/safe_avalanche_c_schema.yml b/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_schema.yml similarity index 100% rename from models/safe/avalanche_c/safe_avalanche_c_schema.yml rename to hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_schema.yml diff --git a/models/safe/avalanche_c/safe_avalanche_c_singletons.sql b/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_singletons.sql similarity index 100% rename from models/safe/avalanche_c/safe_avalanche_c_singletons.sql rename to hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_singletons.sql diff --git a/models/safe/avalanche_c/safe_avalanche_c_transactions.sql b/hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_transactions.sql similarity index 100% rename from models/safe/avalanche_c/safe_avalanche_c_transactions.sql rename to hourly_spellbook/models/_project/safe/avalanche_c/safe_avalanche_c_transactions.sql diff --git a/models/safe/base/safe_base_eth_transfers.sql b/hourly_spellbook/models/_project/safe/base/safe_base_eth_transfers.sql similarity index 100% rename from models/safe/base/safe_base_eth_transfers.sql rename to hourly_spellbook/models/_project/safe/base/safe_base_eth_transfers.sql diff --git a/models/safe/base/safe_base_safes.sql b/hourly_spellbook/models/_project/safe/base/safe_base_safes.sql similarity index 100% rename from models/safe/base/safe_base_safes.sql rename to hourly_spellbook/models/_project/safe/base/safe_base_safes.sql diff --git a/models/safe/base/safe_base_schema.yml b/hourly_spellbook/models/_project/safe/base/safe_base_schema.yml similarity index 100% rename from models/safe/base/safe_base_schema.yml rename to hourly_spellbook/models/_project/safe/base/safe_base_schema.yml diff --git a/models/safe/base/safe_base_singletons.sql b/hourly_spellbook/models/_project/safe/base/safe_base_singletons.sql similarity index 100% rename from models/safe/base/safe_base_singletons.sql rename to hourly_spellbook/models/_project/safe/base/safe_base_singletons.sql diff --git a/models/safe/base/safe_base_transactions.sql b/hourly_spellbook/models/_project/safe/base/safe_base_transactions.sql similarity index 100% rename from models/safe/base/safe_base_transactions.sql rename to hourly_spellbook/models/_project/safe/base/safe_base_transactions.sql diff --git a/models/safe/bnb/safe_bnb_bnb_transfers.sql b/hourly_spellbook/models/_project/safe/bnb/safe_bnb_bnb_transfers.sql similarity index 100% rename from models/safe/bnb/safe_bnb_bnb_transfers.sql rename to hourly_spellbook/models/_project/safe/bnb/safe_bnb_bnb_transfers.sql diff --git a/models/safe/bnb/safe_bnb_safes.sql b/hourly_spellbook/models/_project/safe/bnb/safe_bnb_safes.sql similarity index 100% rename from models/safe/bnb/safe_bnb_safes.sql rename to hourly_spellbook/models/_project/safe/bnb/safe_bnb_safes.sql diff --git a/models/safe/bnb/safe_bnb_schema.yml b/hourly_spellbook/models/_project/safe/bnb/safe_bnb_schema.yml similarity index 100% rename from models/safe/bnb/safe_bnb_schema.yml rename to hourly_spellbook/models/_project/safe/bnb/safe_bnb_schema.yml diff --git a/models/safe/bnb/safe_bnb_singletons.sql b/hourly_spellbook/models/_project/safe/bnb/safe_bnb_singletons.sql similarity index 100% rename from models/safe/bnb/safe_bnb_singletons.sql rename to hourly_spellbook/models/_project/safe/bnb/safe_bnb_singletons.sql diff --git a/models/safe/bnb/safe_bnb_transactions.sql b/hourly_spellbook/models/_project/safe/bnb/safe_bnb_transactions.sql similarity index 100% rename from models/safe/bnb/safe_bnb_transactions.sql rename to hourly_spellbook/models/_project/safe/bnb/safe_bnb_transactions.sql diff --git a/models/safe/celo/safe_celo_celo_transfers.sql b/hourly_spellbook/models/_project/safe/celo/safe_celo_celo_transfers.sql similarity index 100% rename from models/safe/celo/safe_celo_celo_transfers.sql rename to hourly_spellbook/models/_project/safe/celo/safe_celo_celo_transfers.sql diff --git a/models/safe/celo/safe_celo_safes.sql b/hourly_spellbook/models/_project/safe/celo/safe_celo_safes.sql similarity index 100% rename from models/safe/celo/safe_celo_safes.sql rename to hourly_spellbook/models/_project/safe/celo/safe_celo_safes.sql diff --git a/models/safe/celo/safe_celo_schema.yml b/hourly_spellbook/models/_project/safe/celo/safe_celo_schema.yml similarity index 100% rename from models/safe/celo/safe_celo_schema.yml rename to hourly_spellbook/models/_project/safe/celo/safe_celo_schema.yml diff --git a/models/safe/celo/safe_celo_singletons.sql b/hourly_spellbook/models/_project/safe/celo/safe_celo_singletons.sql similarity index 100% rename from models/safe/celo/safe_celo_singletons.sql rename to hourly_spellbook/models/_project/safe/celo/safe_celo_singletons.sql diff --git a/models/safe/celo/safe_celo_transactions.sql b/hourly_spellbook/models/_project/safe/celo/safe_celo_transactions.sql similarity index 100% rename from models/safe/celo/safe_celo_transactions.sql rename to hourly_spellbook/models/_project/safe/celo/safe_celo_transactions.sql diff --git a/models/safe/ethereum/safe_ethereum_eth_transfers.sql b/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_eth_transfers.sql similarity index 100% rename from models/safe/ethereum/safe_ethereum_eth_transfers.sql rename to hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_eth_transfers.sql diff --git a/models/safe/ethereum/safe_ethereum_safes.sql b/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_safes.sql similarity index 100% rename from models/safe/ethereum/safe_ethereum_safes.sql rename to hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_safes.sql diff --git a/models/safe/ethereum/safe_ethereum_schema.yml b/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_schema.yml similarity index 100% rename from models/safe/ethereum/safe_ethereum_schema.yml rename to hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_schema.yml diff --git a/models/safe/ethereum/safe_ethereum_signer_thresholds.sql b/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_signer_thresholds.sql similarity index 100% rename from models/safe/ethereum/safe_ethereum_signer_thresholds.sql rename to hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_signer_thresholds.sql diff --git a/models/safe/ethereum/safe_ethereum_singletons.sql b/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_singletons.sql similarity index 100% rename from models/safe/ethereum/safe_ethereum_singletons.sql rename to hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_singletons.sql diff --git a/models/safe/ethereum/safe_ethereum_transactions.sql b/hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_transactions.sql similarity index 100% rename from models/safe/ethereum/safe_ethereum_transactions.sql rename to hourly_spellbook/models/_project/safe/ethereum/safe_ethereum_transactions.sql diff --git a/models/safe/fantom/safe_fantom_safes.sql b/hourly_spellbook/models/_project/safe/fantom/safe_fantom_safes.sql similarity index 100% rename from models/safe/fantom/safe_fantom_safes.sql rename to hourly_spellbook/models/_project/safe/fantom/safe_fantom_safes.sql diff --git a/models/safe/fantom/safe_fantom_schema.yml b/hourly_spellbook/models/_project/safe/fantom/safe_fantom_schema.yml similarity index 100% rename from models/safe/fantom/safe_fantom_schema.yml rename to hourly_spellbook/models/_project/safe/fantom/safe_fantom_schema.yml diff --git a/models/safe/fantom/safe_fantom_singletons.sql b/hourly_spellbook/models/_project/safe/fantom/safe_fantom_singletons.sql similarity index 100% rename from models/safe/fantom/safe_fantom_singletons.sql rename to hourly_spellbook/models/_project/safe/fantom/safe_fantom_singletons.sql diff --git a/models/safe/fantom/safe_fantom_transactions.sql b/hourly_spellbook/models/_project/safe/fantom/safe_fantom_transactions.sql similarity index 100% rename from models/safe/fantom/safe_fantom_transactions.sql rename to hourly_spellbook/models/_project/safe/fantom/safe_fantom_transactions.sql diff --git a/models/safe/gnosis/safe_gnosis_safes.sql b/hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_safes.sql similarity index 100% rename from models/safe/gnosis/safe_gnosis_safes.sql rename to hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_safes.sql diff --git a/models/safe/gnosis/safe_gnosis_schema.yml b/hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_schema.yml similarity index 100% rename from models/safe/gnosis/safe_gnosis_schema.yml rename to hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_schema.yml diff --git a/models/safe/gnosis/safe_gnosis_singletons.sql b/hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_singletons.sql similarity index 100% rename from models/safe/gnosis/safe_gnosis_singletons.sql rename to hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_singletons.sql diff --git a/models/safe/gnosis/safe_gnosis_transactions.sql b/hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_transactions.sql similarity index 100% rename from models/safe/gnosis/safe_gnosis_transactions.sql rename to hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_transactions.sql diff --git a/models/safe/gnosis/safe_gnosis_xdai_transfers.sql b/hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_xdai_transfers.sql similarity index 100% rename from models/safe/gnosis/safe_gnosis_xdai_transfers.sql rename to hourly_spellbook/models/_project/safe/gnosis/safe_gnosis_xdai_transfers.sql diff --git a/models/safe/goerli/safe_goerli_eth_transfers.sql b/hourly_spellbook/models/_project/safe/goerli/safe_goerli_eth_transfers.sql similarity index 100% rename from models/safe/goerli/safe_goerli_eth_transfers.sql rename to hourly_spellbook/models/_project/safe/goerli/safe_goerli_eth_transfers.sql diff --git a/models/safe/goerli/safe_goerli_safes.sql b/hourly_spellbook/models/_project/safe/goerli/safe_goerli_safes.sql similarity index 100% rename from models/safe/goerli/safe_goerli_safes.sql rename to hourly_spellbook/models/_project/safe/goerli/safe_goerli_safes.sql diff --git a/models/safe/goerli/safe_goerli_schema.yml b/hourly_spellbook/models/_project/safe/goerli/safe_goerli_schema.yml similarity index 100% rename from models/safe/goerli/safe_goerli_schema.yml rename to hourly_spellbook/models/_project/safe/goerli/safe_goerli_schema.yml diff --git a/models/safe/goerli/safe_goerli_singletons.sql b/hourly_spellbook/models/_project/safe/goerli/safe_goerli_singletons.sql similarity index 100% rename from models/safe/goerli/safe_goerli_singletons.sql rename to hourly_spellbook/models/_project/safe/goerli/safe_goerli_singletons.sql diff --git a/models/safe/goerli/safe_goerli_transactions.sql b/hourly_spellbook/models/_project/safe/goerli/safe_goerli_transactions.sql similarity index 100% rename from models/safe/goerli/safe_goerli_transactions.sql rename to hourly_spellbook/models/_project/safe/goerli/safe_goerli_transactions.sql diff --git a/models/safe/optimism/safe_optimism_eth_transfers.sql b/hourly_spellbook/models/_project/safe/optimism/safe_optimism_eth_transfers.sql similarity index 100% rename from models/safe/optimism/safe_optimism_eth_transfers.sql rename to hourly_spellbook/models/_project/safe/optimism/safe_optimism_eth_transfers.sql diff --git a/models/safe/optimism/safe_optimism_safes.sql b/hourly_spellbook/models/_project/safe/optimism/safe_optimism_safes.sql similarity index 100% rename from models/safe/optimism/safe_optimism_safes.sql rename to hourly_spellbook/models/_project/safe/optimism/safe_optimism_safes.sql diff --git a/models/safe/optimism/safe_optimism_schema.yml b/hourly_spellbook/models/_project/safe/optimism/safe_optimism_schema.yml similarity index 100% rename from models/safe/optimism/safe_optimism_schema.yml rename to hourly_spellbook/models/_project/safe/optimism/safe_optimism_schema.yml diff --git a/models/safe/optimism/safe_optimism_singletons.sql b/hourly_spellbook/models/_project/safe/optimism/safe_optimism_singletons.sql similarity index 100% rename from models/safe/optimism/safe_optimism_singletons.sql rename to hourly_spellbook/models/_project/safe/optimism/safe_optimism_singletons.sql diff --git a/models/safe/optimism/safe_optimism_transactions.sql b/hourly_spellbook/models/_project/safe/optimism/safe_optimism_transactions.sql similarity index 100% rename from models/safe/optimism/safe_optimism_transactions.sql rename to hourly_spellbook/models/_project/safe/optimism/safe_optimism_transactions.sql diff --git a/models/safe/polygon/safe_polygon_matic_transfers.sql b/hourly_spellbook/models/_project/safe/polygon/safe_polygon_matic_transfers.sql similarity index 100% rename from models/safe/polygon/safe_polygon_matic_transfers.sql rename to hourly_spellbook/models/_project/safe/polygon/safe_polygon_matic_transfers.sql diff --git a/models/safe/polygon/safe_polygon_safes.sql b/hourly_spellbook/models/_project/safe/polygon/safe_polygon_safes.sql similarity index 100% rename from models/safe/polygon/safe_polygon_safes.sql rename to hourly_spellbook/models/_project/safe/polygon/safe_polygon_safes.sql diff --git a/models/safe/polygon/safe_polygon_schema.yml b/hourly_spellbook/models/_project/safe/polygon/safe_polygon_schema.yml similarity index 100% rename from models/safe/polygon/safe_polygon_schema.yml rename to hourly_spellbook/models/_project/safe/polygon/safe_polygon_schema.yml diff --git a/models/safe/polygon/safe_polygon_singletons.sql b/hourly_spellbook/models/_project/safe/polygon/safe_polygon_singletons.sql similarity index 100% rename from models/safe/polygon/safe_polygon_singletons.sql rename to hourly_spellbook/models/_project/safe/polygon/safe_polygon_singletons.sql diff --git a/models/safe/polygon/safe_polygon_transactions.sql b/hourly_spellbook/models/_project/safe/polygon/safe_polygon_transactions.sql similarity index 100% rename from models/safe/polygon/safe_polygon_transactions.sql rename to hourly_spellbook/models/_project/safe/polygon/safe_polygon_transactions.sql diff --git a/models/safe/safe_native_transfers_all.sql b/hourly_spellbook/models/_project/safe/safe_native_transfers_all.sql similarity index 100% rename from models/safe/safe_native_transfers_all.sql rename to hourly_spellbook/models/_project/safe/safe_native_transfers_all.sql diff --git a/models/safe/safe_safes_all.sql b/hourly_spellbook/models/_project/safe/safe_safes_all.sql similarity index 100% rename from models/safe/safe_safes_all.sql rename to hourly_spellbook/models/_project/safe/safe_safes_all.sql diff --git a/models/safe/safe_schema.yml b/hourly_spellbook/models/_project/safe/safe_schema.yml similarity index 100% rename from models/safe/safe_schema.yml rename to hourly_spellbook/models/_project/safe/safe_schema.yml diff --git a/models/safe/safe_transactions_all.sql b/hourly_spellbook/models/_project/safe/safe_transactions_all.sql similarity index 100% rename from models/safe/safe_transactions_all.sql rename to hourly_spellbook/models/_project/safe/safe_transactions_all.sql diff --git a/models/safe/zkevm/safe_zkevm_matic_transfers.sql b/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_matic_transfers.sql similarity index 100% rename from models/safe/zkevm/safe_zkevm_matic_transfers.sql rename to hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_matic_transfers.sql diff --git a/models/safe/zkevm/safe_zkevm_safes.sql b/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_safes.sql similarity index 100% rename from models/safe/zkevm/safe_zkevm_safes.sql rename to hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_safes.sql diff --git a/models/safe/zkevm/safe_zkevm_schema.yml b/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_schema.yml similarity index 100% rename from models/safe/zkevm/safe_zkevm_schema.yml rename to hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_schema.yml diff --git a/models/safe/zkevm/safe_zkevm_singletons.sql b/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_singletons.sql similarity index 100% rename from models/safe/zkevm/safe_zkevm_singletons.sql rename to hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_singletons.sql diff --git a/models/safe/zkevm/safe_zkevm_transactions.sql b/hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_transactions.sql similarity index 100% rename from models/safe/zkevm/safe_zkevm_transactions.sql rename to hourly_spellbook/models/_project/safe/zkevm/safe_zkevm_transactions.sql diff --git a/models/safe/zksync/safe_zksync_eth_transfers.sql b/hourly_spellbook/models/_project/safe/zksync/safe_zksync_eth_transfers.sql similarity index 100% rename from models/safe/zksync/safe_zksync_eth_transfers.sql rename to hourly_spellbook/models/_project/safe/zksync/safe_zksync_eth_transfers.sql diff --git a/models/safe/zksync/safe_zksync_safes.sql b/hourly_spellbook/models/_project/safe/zksync/safe_zksync_safes.sql similarity index 100% rename from models/safe/zksync/safe_zksync_safes.sql rename to hourly_spellbook/models/_project/safe/zksync/safe_zksync_safes.sql diff --git a/models/safe/zksync/safe_zksync_schema.yml b/hourly_spellbook/models/_project/safe/zksync/safe_zksync_schema.yml similarity index 100% rename from models/safe/zksync/safe_zksync_schema.yml rename to hourly_spellbook/models/_project/safe/zksync/safe_zksync_schema.yml diff --git a/models/safe/zksync/safe_zksync_singletons.sql b/hourly_spellbook/models/_project/safe/zksync/safe_zksync_singletons.sql similarity index 100% rename from models/safe/zksync/safe_zksync_singletons.sql rename to hourly_spellbook/models/_project/safe/zksync/safe_zksync_singletons.sql diff --git a/models/safe/zksync/safe_zksync_transactions.sql b/hourly_spellbook/models/_project/safe/zksync/safe_zksync_transactions.sql similarity index 100% rename from models/safe/zksync/safe_zksync_transactions.sql rename to hourly_spellbook/models/_project/safe/zksync/safe_zksync_transactions.sql diff --git a/models/abi/abi_schema.yml b/hourly_spellbook/models/_sector/abi/abi_schema.yml similarity index 100% rename from models/abi/abi_schema.yml rename to hourly_spellbook/models/_sector/abi/abi_schema.yml diff --git a/models/abi/abi_signatures.sql b/hourly_spellbook/models/_sector/abi/abi_signatures.sql similarity index 100% rename from models/abi/abi_signatures.sql rename to hourly_spellbook/models/_sector/abi/abi_signatures.sql diff --git a/models/_sector/account_abstraction/erc4337/_schema.yml b/hourly_spellbook/models/_sector/account_abstraction/erc4337/_schema.yml similarity index 100% rename from models/_sector/account_abstraction/erc4337/_schema.yml rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/_schema.yml diff --git a/models/_sector/account_abstraction/erc4337/account_abstraction_erc4337_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/account_abstraction_erc4337_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/account_abstraction_erc4337_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/account_abstraction_erc4337_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/account_abstraction_erc4337_userops.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/account_abstraction_erc4337_userops.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/account_abstraction_erc4337_userops.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/account_abstraction_erc4337_userops.sql diff --git a/models/_sector/account_abstraction/erc4337/arbitrum/_schema.yml b/hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/_schema.yml similarity index 100% rename from models/_sector/account_abstraction/erc4337/arbitrum/_schema.yml rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/_schema.yml diff --git a/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_userops.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_userops.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_userops.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_userops.sql diff --git a/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_5_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_5_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_5_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_5_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_5_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_5_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_5_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_5_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_6_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_6_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_6_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_6_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_6_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_6_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_6_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/arbitrum/account_abstraction_erc4337_arbitrum_v0_6_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/avalanche_c/_schema.yml b/hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/_schema.yml similarity index 100% rename from models/_sector/account_abstraction/erc4337/avalanche_c/_schema.yml rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/_schema.yml diff --git a/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_userops.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_userops.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_userops.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_userops.sql diff --git a/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_5_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_5_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_5_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_5_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_5_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_5_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_5_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_5_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_6_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_6_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_6_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_6_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_6_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_6_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_6_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/avalanche_c/account_abstraction_erc4337_avalanche_c_v0_6_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/base/_schema.yml b/hourly_spellbook/models/_sector/account_abstraction/erc4337/base/_schema.yml similarity index 100% rename from models/_sector/account_abstraction/erc4337/base/_schema.yml rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/base/_schema.yml diff --git a/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_userops.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_userops.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_userops.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_userops.sql diff --git a/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_6_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_6_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_6_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_6_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_6_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_6_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_6_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_6_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_7_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_7_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_7_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_7_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_7_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_7_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_7_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/base/account_abstraction_erc4337_base_v0_7_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/bnb/_schema.yml b/hourly_spellbook/models/_sector/account_abstraction/erc4337/bnb/_schema.yml similarity index 100% rename from models/_sector/account_abstraction/erc4337/bnb/_schema.yml rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/bnb/_schema.yml diff --git a/models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_userops.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_userops.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_userops.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_userops.sql diff --git a/models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_v0_6_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_v0_6_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_v0_6_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_v0_6_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_v0_6_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_v0_6_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_v0_6_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/bnb/account_abstraction_erc4337_bnb_v0_6_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/celo/_schema.yml b/hourly_spellbook/models/_sector/account_abstraction/erc4337/celo/_schema.yml similarity index 100% rename from models/_sector/account_abstraction/erc4337/celo/_schema.yml rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/celo/_schema.yml diff --git a/models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_userops.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_userops.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_userops.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_userops.sql diff --git a/models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_v0_6_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_v0_6_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_v0_6_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_v0_6_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_v0_6_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_v0_6_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_v0_6_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/celo/account_abstraction_erc4337_celo_v0_6_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/ethereum/_schema.yml b/hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/_schema.yml similarity index 100% rename from models/_sector/account_abstraction/erc4337/ethereum/_schema.yml rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/_schema.yml diff --git a/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_userops.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_userops.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_userops.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_userops.sql diff --git a/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_5_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_5_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_5_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_5_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_5_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_5_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_5_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_5_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_6_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_6_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_6_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_6_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_6_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_6_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_6_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/ethereum/account_abstraction_erc4337_ethereum_v0_6_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/gnosis/_schema.yml b/hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/_schema.yml similarity index 100% rename from models/_sector/account_abstraction/erc4337/gnosis/_schema.yml rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/_schema.yml diff --git a/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_userops.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_userops.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_userops.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_userops.sql diff --git a/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_5_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_5_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_5_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_5_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_5_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_5_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_5_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_5_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_6_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_6_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_6_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_6_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_6_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_6_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_6_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/gnosis/account_abstraction_erc4337_gnosis_v0_6_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/optimism/_schema.yml b/hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/_schema.yml similarity index 100% rename from models/_sector/account_abstraction/erc4337/optimism/_schema.yml rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/_schema.yml diff --git a/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_userops.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_userops.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_userops.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_userops.sql diff --git a/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_5_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_5_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_5_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_5_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_5_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_5_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_5_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_5_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_6_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_6_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_6_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_6_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_6_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_6_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_6_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/optimism/account_abstraction_erc4337_optimism_v0_6_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/polygon/_schema.yml b/hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/_schema.yml similarity index 100% rename from models/_sector/account_abstraction/erc4337/polygon/_schema.yml rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/_schema.yml diff --git a/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_userops.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_userops.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_userops.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_userops.sql diff --git a/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_5_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_5_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_5_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_5_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_5_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_5_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_5_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_5_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_6_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_6_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_6_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_6_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_6_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_6_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_6_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/polygon/account_abstraction_erc4337_polygon_v0_6_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/zora/_schema.yml b/hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/_schema.yml similarity index 100% rename from models/_sector/account_abstraction/erc4337/zora/_schema.yml rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/_schema.yml diff --git a/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_userops.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_userops.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_userops.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_userops.sql diff --git a/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_6_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_6_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_6_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_6_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_6_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_6_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_6_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_6_userops_basics.sql diff --git a/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_7_account_deployed.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_7_account_deployed.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_7_account_deployed.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_7_account_deployed.sql diff --git a/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_7_userops_basics.sql b/hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_7_userops_basics.sql similarity index 100% rename from models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_7_userops_basics.sql rename to hourly_spellbook/models/_sector/account_abstraction/erc4337/zora/account_abstraction_erc4337_zora_v0_7_userops_basics.sql diff --git a/models/blobs/ethereum/_schema.yml b/hourly_spellbook/models/_sector/blobs/ethereum/_schema.yml similarity index 100% rename from models/blobs/ethereum/_schema.yml rename to hourly_spellbook/models/_sector/blobs/ethereum/_schema.yml diff --git a/models/blobs/ethereum/blobs_based_submitters.sql b/hourly_spellbook/models/_sector/blobs/ethereum/blobs_based_submitters.sql similarity index 100% rename from models/blobs/ethereum/blobs_based_submitters.sql rename to hourly_spellbook/models/_sector/blobs/ethereum/blobs_based_submitters.sql diff --git a/models/blobs/ethereum/blobs_submitters.sql b/hourly_spellbook/models/_sector/blobs/ethereum/blobs_submitters.sql similarity index 100% rename from models/blobs/ethereum/blobs_submitters.sql rename to hourly_spellbook/models/_sector/blobs/ethereum/blobs_submitters.sql diff --git a/models/blobs/ethereum/ethereum_blob_submissions.sql b/hourly_spellbook/models/_sector/blobs/ethereum/ethereum_blob_submissions.sql similarity index 100% rename from models/blobs/ethereum/ethereum_blob_submissions.sql rename to hourly_spellbook/models/_sector/blobs/ethereum/ethereum_blob_submissions.sql diff --git a/models/blobs/ethereum/ethereum_blobs.sql b/hourly_spellbook/models/_sector/blobs/ethereum/ethereum_blobs.sql similarity index 100% rename from models/blobs/ethereum/ethereum_blobs.sql rename to hourly_spellbook/models/_sector/blobs/ethereum/ethereum_blobs.sql diff --git a/hourly_spellbook/models/_sector/cex/_schema.yml b/hourly_spellbook/models/_sector/cex/_schema.yml new file mode 100644 index 00000000000..e3fba19548e --- /dev/null +++ b/hourly_spellbook/models/_sector/cex/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: cex_info + meta: + blockchain: ethereum, bnb, avalanche_c, optimism, arbitrum, polygon, fantom, base, zksync, celo, zora + sector: cex + contributors: hildobby + config: + tags: ['dex', 'ethereum', 'bnb', 'avalanche_c', 'optimism', 'arbitrum', 'polygon', 'fantom', 'base', 'zksync', 'celo', 'zora', 'info'] + description: > + CEXs info + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - cex_name + columns: + - name: cex_name + description: "CEX name" + - name: x_username + description: "Username on X" + - name: cex + description: "Is it a CEX?" + - name: payment_infra + description: "Is it payment infrastructure custodian?" diff --git a/models/cex/cex_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/cex_addresses.sql similarity index 100% rename from models/cex/cex_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/cex_addresses.sql diff --git a/models/cex/cex_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/cex_schema.yml similarity index 71% rename from models/cex/cex_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/cex_schema.yml index 8267fad4c9b..dff6462ced6 100644 --- a/models/cex/cex_schema.yml +++ b/hourly_spellbook/models/_sector/cex/addresses/cex_schema.yml @@ -53,26 +53,3 @@ models: description: "Who added the address" - name: added_date description: "Date the address was added on" - - - name: cex_info - meta: - blockchain: ethereum, bnb, avalanche_c, optimism, arbitrum, polygon, fantom, base, zksync, celo, zora - sector: cex - contributors: hildobby - config: - tags: ['dex', 'ethereum', 'bnb', 'avalanche_c', 'optimism', 'arbitrum', 'polygon', 'fantom', 'base', 'zksync', 'celo', 'zora', 'info'] - description: > - CEXs info - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - cex_name - columns: - - name: cex_name - description: "CEX name" - - name: x_username - description: "Username on X" - - name: cex - description: "Is it a CEX?" - - name: payment_infra - description: "Is it payment infrastructure custodian?" \ No newline at end of file diff --git a/models/cex/algorand/cex_algorand_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/algorand/cex_algorand_addresses.sql similarity index 100% rename from models/cex/algorand/cex_algorand_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/algorand/cex_algorand_addresses.sql diff --git a/models/cex/algorand/cex_algorand_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/algorand/cex_algorand_schema.yml similarity index 100% rename from models/cex/algorand/cex_algorand_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/algorand/cex_algorand_schema.yml diff --git a/models/cex/aptos/cex_aptos_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/aptos/cex_aptos_addresses.sql similarity index 100% rename from models/cex/aptos/cex_aptos_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/aptos/cex_aptos_addresses.sql diff --git a/models/cex/aptos/cex_aptos_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/aptos/cex_aptos_schema.yml similarity index 100% rename from models/cex/aptos/cex_aptos_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/aptos/cex_aptos_schema.yml diff --git a/models/cex/arbitrum/cex_arbitrum_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/arbitrum/cex_arbitrum_addresses.sql similarity index 100% rename from models/cex/arbitrum/cex_arbitrum_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/arbitrum/cex_arbitrum_addresses.sql diff --git a/models/cex/arbitrum/cex_arbitrum_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/arbitrum/cex_arbitrum_schema.yml similarity index 100% rename from models/cex/arbitrum/cex_arbitrum_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/arbitrum/cex_arbitrum_schema.yml diff --git a/models/cex/avalanche_c/cex_avalanche_c_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/avalanche_c/cex_avalanche_c_addresses.sql similarity index 100% rename from models/cex/avalanche_c/cex_avalanche_c_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/avalanche_c/cex_avalanche_c_addresses.sql diff --git a/models/cex/avalanche_c/cex_avalanche_c_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/avalanche_c/cex_avalanche_c_schema.yml similarity index 100% rename from models/cex/avalanche_c/cex_avalanche_c_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/avalanche_c/cex_avalanche_c_schema.yml diff --git a/models/cex/base/cex_base_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/base/cex_base_addresses.sql similarity index 100% rename from models/cex/base/cex_base_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/base/cex_base_addresses.sql diff --git a/models/cex/base/cex_base_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/base/cex_base_schema.yml similarity index 100% rename from models/cex/base/cex_base_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/base/cex_base_schema.yml diff --git a/models/cex/bitcoin/cex_bitcoin_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/bitcoin/cex_bitcoin_addresses.sql similarity index 100% rename from models/cex/bitcoin/cex_bitcoin_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/bitcoin/cex_bitcoin_addresses.sql diff --git a/models/cex/bitcoin/cex_bitcoin_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/bitcoin/cex_bitcoin_schema.yml similarity index 100% rename from models/cex/bitcoin/cex_bitcoin_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/bitcoin/cex_bitcoin_schema.yml diff --git a/models/cex/bnb/cex_bnb_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/bnb/cex_bnb_addresses.sql similarity index 100% rename from models/cex/bnb/cex_bnb_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/bnb/cex_bnb_addresses.sql diff --git a/models/cex/bnb/cex_bnb_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/bnb/cex_bnb_schema.yml similarity index 100% rename from models/cex/bnb/cex_bnb_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/bnb/cex_bnb_schema.yml diff --git a/models/cex/cardano/cex_cardano_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/cardano/cex_cardano_addresses.sql similarity index 100% rename from models/cex/cardano/cex_cardano_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/cardano/cex_cardano_addresses.sql diff --git a/models/cex/cardano/cex_cardano_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/cardano/cex_cardano_schema.yml similarity index 100% rename from models/cex/cardano/cex_cardano_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/cardano/cex_cardano_schema.yml diff --git a/models/cex/celo/cex_celo_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/celo/cex_celo_addresses.sql similarity index 100% rename from models/cex/celo/cex_celo_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/celo/cex_celo_addresses.sql diff --git a/models/cex/celo/cex_celo_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/celo/cex_celo_schema.yml similarity index 100% rename from models/cex/celo/cex_celo_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/celo/cex_celo_schema.yml diff --git a/models/cex/cex_evms_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/cex_evms_addresses.sql similarity index 100% rename from models/cex/cex_evms_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/cex_evms_addresses.sql diff --git a/models/cex/cosmos/cex_cosmos_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/cosmos/cex_cosmos_addresses.sql similarity index 100% rename from models/cex/cosmos/cex_cosmos_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/cosmos/cex_cosmos_addresses.sql diff --git a/models/cex/cosmos/cex_cosmos_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/cosmos/cex_cosmos_schema.yml similarity index 100% rename from models/cex/cosmos/cex_cosmos_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/cosmos/cex_cosmos_schema.yml diff --git a/models/cex/elrond/cex_elrond_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/elrond/cex_elrond_addresses.sql similarity index 100% rename from models/cex/elrond/cex_elrond_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/elrond/cex_elrond_addresses.sql diff --git a/models/cex/elrond/cex_elrond_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/elrond/cex_elrond_schema.yml similarity index 100% rename from models/cex/elrond/cex_elrond_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/elrond/cex_elrond_schema.yml diff --git a/models/cex/eos/cex_eos_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/eos/cex_eos_addresses.sql similarity index 100% rename from models/cex/eos/cex_eos_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/eos/cex_eos_addresses.sql diff --git a/models/cex/eos/cex_eos_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/eos/cex_eos_schema.yml similarity index 100% rename from models/cex/eos/cex_eos_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/eos/cex_eos_schema.yml diff --git a/models/cex/ethereum/cex_ethereum_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/ethereum/cex_ethereum_addresses.sql similarity index 100% rename from models/cex/ethereum/cex_ethereum_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/ethereum/cex_ethereum_addresses.sql diff --git a/models/cex/ethereum/cex_ethereum_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/ethereum/cex_ethereum_schema.yml similarity index 100% rename from models/cex/ethereum/cex_ethereum_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/ethereum/cex_ethereum_schema.yml diff --git a/models/cex/fantom/cex_fantom_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/fantom/cex_fantom_addresses.sql similarity index 100% rename from models/cex/fantom/cex_fantom_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/fantom/cex_fantom_addresses.sql diff --git a/models/cex/fantom/cex_fantom_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/fantom/cex_fantom_schema.yml similarity index 100% rename from models/cex/fantom/cex_fantom_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/fantom/cex_fantom_schema.yml diff --git a/models/cex/gnosis/cex_gnosis_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/gnosis/cex_gnosis_addresses.sql similarity index 100% rename from models/cex/gnosis/cex_gnosis_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/gnosis/cex_gnosis_addresses.sql diff --git a/models/cex/gnosis/cex_gnosis_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/gnosis/cex_gnosis_schema.yml similarity index 100% rename from models/cex/gnosis/cex_gnosis_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/gnosis/cex_gnosis_schema.yml diff --git a/models/cex/injective/cex_injective_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/injective/cex_injective_addresses.sql similarity index 100% rename from models/cex/injective/cex_injective_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/injective/cex_injective_addresses.sql diff --git a/models/cex/injective/cex_injective_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/injective/cex_injective_schema.yml similarity index 100% rename from models/cex/injective/cex_injective_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/injective/cex_injective_schema.yml diff --git a/models/cex/linea/cex_linea_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/linea/cex_linea_addresses.sql similarity index 100% rename from models/cex/linea/cex_linea_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/linea/cex_linea_addresses.sql diff --git a/models/cex/linea/cex_linea_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/linea/cex_linea_schema.yml similarity index 100% rename from models/cex/linea/cex_linea_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/linea/cex_linea_schema.yml diff --git a/models/cex/litecoin/cex_litecoin_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/litecoin/cex_litecoin_addresses.sql similarity index 100% rename from models/cex/litecoin/cex_litecoin_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/litecoin/cex_litecoin_addresses.sql diff --git a/models/cex/litecoin/cex_litecoin_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/litecoin/cex_litecoin_schema.yml similarity index 100% rename from models/cex/litecoin/cex_litecoin_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/litecoin/cex_litecoin_schema.yml diff --git a/models/cex/optimism/cex_optimism_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/optimism/cex_optimism_addresses.sql similarity index 100% rename from models/cex/optimism/cex_optimism_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/optimism/cex_optimism_addresses.sql diff --git a/models/cex/optimism/cex_optimism_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/optimism/cex_optimism_schema.yml similarity index 100% rename from models/cex/optimism/cex_optimism_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/optimism/cex_optimism_schema.yml diff --git a/models/cex/polkadot/cex_polkadot_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/polkadot/cex_polkadot_addresses.sql similarity index 100% rename from models/cex/polkadot/cex_polkadot_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/polkadot/cex_polkadot_addresses.sql diff --git a/models/cex/polkadot/cex_polkadot_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/polkadot/cex_polkadot_schema.yml similarity index 100% rename from models/cex/polkadot/cex_polkadot_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/polkadot/cex_polkadot_schema.yml diff --git a/models/cex/polygon/cex_polygon_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/polygon/cex_polygon_addresses.sql similarity index 100% rename from models/cex/polygon/cex_polygon_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/polygon/cex_polygon_addresses.sql diff --git a/models/cex/polygon/cex_polygon_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/polygon/cex_polygon_schema.yml similarity index 100% rename from models/cex/polygon/cex_polygon_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/polygon/cex_polygon_schema.yml diff --git a/models/cex/ripple/cex_ripple_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/ripple/cex_ripple_addresses.sql similarity index 100% rename from models/cex/ripple/cex_ripple_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/ripple/cex_ripple_addresses.sql diff --git a/models/cex/ripple/cex_ripple_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/ripple/cex_ripple_schema.yml similarity index 100% rename from models/cex/ripple/cex_ripple_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/ripple/cex_ripple_schema.yml diff --git a/models/cex/scroll/cex_scroll_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/scroll/cex_scroll_addresses.sql similarity index 100% rename from models/cex/scroll/cex_scroll_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/scroll/cex_scroll_addresses.sql diff --git a/models/cex/scroll/cex_scroll_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/scroll/cex_scroll_schema.yml similarity index 100% rename from models/cex/scroll/cex_scroll_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/scroll/cex_scroll_schema.yml diff --git a/models/cex/solana/cex_solana_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/solana/cex_solana_addresses.sql similarity index 100% rename from models/cex/solana/cex_solana_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/solana/cex_solana_addresses.sql diff --git a/models/cex/solana/cex_solana_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/solana/cex_solana_schema.yml similarity index 100% rename from models/cex/solana/cex_solana_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/solana/cex_solana_schema.yml diff --git a/models/cex/tron/cex_tron_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/tron/cex_tron_addresses.sql similarity index 100% rename from models/cex/tron/cex_tron_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/tron/cex_tron_addresses.sql diff --git a/models/cex/tron/cex_tron_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/tron/cex_tron_schema.yml similarity index 100% rename from models/cex/tron/cex_tron_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/tron/cex_tron_schema.yml diff --git a/models/cex/zilliqa/cex_zilliqa_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/zilliqa/cex_zilliqa_addresses.sql similarity index 100% rename from models/cex/zilliqa/cex_zilliqa_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/zilliqa/cex_zilliqa_addresses.sql diff --git a/models/cex/zilliqa/cex_zilliqa_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/zilliqa/cex_zilliqa_schema.yml similarity index 100% rename from models/cex/zilliqa/cex_zilliqa_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/zilliqa/cex_zilliqa_schema.yml diff --git a/models/cex/zkevm/cex_zkevm_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/zkevm/cex_zkevm_addresses.sql similarity index 100% rename from models/cex/zkevm/cex_zkevm_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/zkevm/cex_zkevm_addresses.sql diff --git a/models/cex/zkevm/cex_zkevm_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/zkevm/cex_zkevm_schema.yml similarity index 100% rename from models/cex/zkevm/cex_zkevm_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/zkevm/cex_zkevm_schema.yml diff --git a/models/cex/zksync/cex_zksync_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/zksync/cex_zksync_addresses.sql similarity index 100% rename from models/cex/zksync/cex_zksync_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/zksync/cex_zksync_addresses.sql diff --git a/models/cex/zksync/cex_zksync_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/zksync/cex_zksync_schema.yml similarity index 100% rename from models/cex/zksync/cex_zksync_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/zksync/cex_zksync_schema.yml diff --git a/models/cex/zora/cex_zora_addresses.sql b/hourly_spellbook/models/_sector/cex/addresses/chains/zora/cex_zora_addresses.sql similarity index 100% rename from models/cex/zora/cex_zora_addresses.sql rename to hourly_spellbook/models/_sector/cex/addresses/chains/zora/cex_zora_addresses.sql diff --git a/models/cex/zora/cex_zora_schema.yml b/hourly_spellbook/models/_sector/cex/addresses/chains/zora/cex_zora_schema.yml similarity index 100% rename from models/cex/zora/cex_zora_schema.yml rename to hourly_spellbook/models/_sector/cex/addresses/chains/zora/cex_zora_schema.yml diff --git a/models/cex/cex_info.sql b/hourly_spellbook/models/_sector/cex/cex_info.sql similarity index 100% rename from models/cex/cex_info.sql rename to hourly_spellbook/models/_sector/cex/cex_info.sql diff --git a/models/_sector/cex/flows/_schema.yml b/hourly_spellbook/models/_sector/cex/flows/_schema.yml similarity index 100% rename from models/_sector/cex/flows/_schema.yml rename to hourly_spellbook/models/_sector/cex/flows/_schema.yml diff --git a/models/_sector/cex/flows/cex_flows.sql b/hourly_spellbook/models/_sector/cex/flows/cex_flows.sql similarity index 100% rename from models/_sector/cex/flows/cex_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/cex_flows.sql diff --git a/models/_sector/cex/flows/chains/_schema.yml b/hourly_spellbook/models/_sector/cex/flows/chains/_schema.yml similarity index 100% rename from models/_sector/cex/flows/chains/_schema.yml rename to hourly_spellbook/models/_sector/cex/flows/chains/_schema.yml diff --git a/models/_sector/cex/flows/chains/cex_arbitrum_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_arbitrum_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_arbitrum_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_arbitrum_flows.sql index b09c7161823..86018681d59 100644 --- a/models/_sector/cex/flows/chains/cex_arbitrum_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_arbitrum_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'arbitrum' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_avalanche_c_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_avalanche_c_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_avalanche_c_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_avalanche_c_flows.sql index 22a0b2444ac..ff8b56279b5 100644 --- a/models/_sector/cex/flows/chains/cex_avalanche_c_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_avalanche_c_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'avalanche_c' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_base_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_base_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_base_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_base_flows.sql index 9b3fbf3715f..7cbfa2c0392 100644 --- a/models/_sector/cex/flows/chains/cex_base_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_base_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'base' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_bnb_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_bnb_flows.sql similarity index 85% rename from models/_sector/cex/flows/chains/cex_bnb_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_bnb_flows.sql index 6c0835a32e5..da35f77809f 100644 --- a/models/_sector/cex/flows/chains/cex_bnb_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_bnb_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'bnb' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_celo_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_celo_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_celo_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_celo_flows.sql index 25652b74a4b..3df8da317ce 100644 --- a/models/_sector/cex/flows/chains/cex_celo_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_celo_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'celo' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_ethereum_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_ethereum_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_ethereum_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_ethereum_flows.sql index 6e350105bed..1542fa4fef2 100644 --- a/models/_sector/cex/flows/chains/cex_ethereum_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_ethereum_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'ethereum' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_fantom_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_fantom_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_fantom_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_fantom_flows.sql index 24633279b16..52963e188e1 100644 --- a/models/_sector/cex/flows/chains/cex_fantom_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_fantom_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'fantom' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_gnosis_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_gnosis_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_gnosis_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_gnosis_flows.sql index b23a4d23f8d..f66231dd5a1 100644 --- a/models/_sector/cex/flows/chains/cex_gnosis_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_gnosis_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'gnosis' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_linea_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_linea_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_linea_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_linea_flows.sql index 322e0221061..e045bb13687 100644 --- a/models/_sector/cex/flows/chains/cex_linea_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_linea_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'linea' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_optimism_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_optimism_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_optimism_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_optimism_flows.sql index f6b3927f014..46602a7a083 100644 --- a/models/_sector/cex/flows/chains/cex_optimism_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_optimism_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'optimism' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_polygon_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_polygon_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_polygon_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_polygon_flows.sql index a15b4e96faa..31162601bee 100644 --- a/models/_sector/cex/flows/chains/cex_polygon_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_polygon_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'polygon' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_scroll_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_scroll_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_scroll_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_scroll_flows.sql index 236543d1031..4d760c95495 100644 --- a/models/_sector/cex/flows/chains/cex_scroll_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_scroll_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'scroll' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_zkevm_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_zkevm_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_zkevm_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_zkevm_flows.sql index 9e4466e1c6c..728ecd0216a 100644 --- a/models/_sector/cex/flows/chains/cex_zkevm_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_zkevm_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'zkevm' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_zksync_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_zksync_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_zksync_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_zksync_flows.sql index a73331e5938..254231a725c 100644 --- a/models/_sector/cex/flows/chains/cex_zksync_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_zksync_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'zksync' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/cex/flows/chains/cex_zora_flows.sql b/hourly_spellbook/models/_sector/cex/flows/chains/cex_zora_flows.sql similarity index 86% rename from models/_sector/cex/flows/chains/cex_zora_flows.sql rename to hourly_spellbook/models/_sector/cex/flows/chains/cex_zora_flows.sql index d1cae1594da..8702ac2c2a2 100644 --- a/models/_sector/cex/flows/chains/cex_zora_flows.sql +++ b/hourly_spellbook/models/_sector/cex/flows/chains/cex_zora_flows.sql @@ -1,7 +1,7 @@ {% set blockchain = 'zora' %} {{ config( - + schema = 'cex_' + blockchain, alias = 'flows', materialized = 'incremental', @@ -14,6 +14,6 @@ {{cex_flows( blockchain = blockchain - , transfers = ref('tokens_' + blockchain + '_transfers') + , transfers = source('tokens_' + blockchain , 'transfers') , addresses = ref('cex_' + blockchain + '_addresses') -)}} \ No newline at end of file +)}} diff --git a/models/_sector/lending/_schema.yml b/hourly_spellbook/models/_sector/lending/_schema.yml similarity index 100% rename from models/_sector/lending/_schema.yml rename to hourly_spellbook/models/_sector/lending/_schema.yml diff --git a/models/_sector/lending/borrow/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/_schema.yml diff --git a/models/_sector/lending/borrow/arbitrum/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/arbitrum/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/arbitrum/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/arbitrum/_schema.yml diff --git a/models/_sector/lending/borrow/arbitrum/lending_arbitrum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/arbitrum/lending_arbitrum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/arbitrum/lending_arbitrum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/arbitrum/lending_arbitrum_base_borrow.sql diff --git a/models/_sector/lending/borrow/arbitrum/platforms/aave_v3_arbitrum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/arbitrum/platforms/aave_v3_arbitrum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/arbitrum/platforms/aave_v3_arbitrum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/arbitrum/platforms/aave_v3_arbitrum_base_borrow.sql diff --git a/models/_sector/lending/borrow/arbitrum/platforms/compound_v3_arbitrum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/arbitrum/platforms/compound_v3_arbitrum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/arbitrum/platforms/compound_v3_arbitrum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/arbitrum/platforms/compound_v3_arbitrum_base_borrow.sql diff --git a/models/_sector/lending/borrow/arbitrum/platforms/granary_arbitrum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/arbitrum/platforms/granary_arbitrum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/arbitrum/platforms/granary_arbitrum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/arbitrum/platforms/granary_arbitrum_base_borrow.sql diff --git a/models/_sector/lending/borrow/arbitrum/platforms/lodestar_v0_arbitrum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/arbitrum/platforms/lodestar_v0_arbitrum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/arbitrum/platforms/lodestar_v0_arbitrum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/arbitrum/platforms/lodestar_v0_arbitrum_base_borrow.sql diff --git a/models/_sector/lending/borrow/arbitrum/platforms/lodestar_v1_arbitrum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/arbitrum/platforms/lodestar_v1_arbitrum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/arbitrum/platforms/lodestar_v1_arbitrum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/arbitrum/platforms/lodestar_v1_arbitrum_base_borrow.sql diff --git a/models/_sector/lending/borrow/arbitrum/platforms/radiant_arbitrum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/arbitrum/platforms/radiant_arbitrum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/arbitrum/platforms/radiant_arbitrum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/arbitrum/platforms/radiant_arbitrum_base_borrow.sql diff --git a/models/_sector/lending/borrow/avalanche_c/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/avalanche_c/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/avalanche_c/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/avalanche_c/_schema.yml diff --git a/models/_sector/lending/borrow/avalanche_c/lending_avalanche_c_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/avalanche_c/lending_avalanche_c_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/avalanche_c/lending_avalanche_c_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/avalanche_c/lending_avalanche_c_base_borrow.sql diff --git a/models/_sector/lending/borrow/avalanche_c/platforms/aave_v2_avalanche_c_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/avalanche_c/platforms/aave_v2_avalanche_c_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/avalanche_c/platforms/aave_v2_avalanche_c_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/avalanche_c/platforms/aave_v2_avalanche_c_base_borrow.sql diff --git a/models/_sector/lending/borrow/avalanche_c/platforms/aave_v3_avalanche_c_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/avalanche_c/platforms/aave_v3_avalanche_c_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/avalanche_c/platforms/aave_v3_avalanche_c_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/avalanche_c/platforms/aave_v3_avalanche_c_base_borrow.sql diff --git a/models/_sector/lending/borrow/avalanche_c/platforms/benqi_avalanche_c_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/avalanche_c/platforms/benqi_avalanche_c_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/avalanche_c/platforms/benqi_avalanche_c_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/avalanche_c/platforms/benqi_avalanche_c_base_borrow.sql diff --git a/models/_sector/lending/borrow/avalanche_c/platforms/granary_avalanche_c_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/avalanche_c/platforms/granary_avalanche_c_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/avalanche_c/platforms/granary_avalanche_c_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/avalanche_c/platforms/granary_avalanche_c_base_borrow.sql diff --git a/models/_sector/lending/borrow/base/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/base/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/base/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/base/_schema.yml diff --git a/models/_sector/lending/borrow/base/lending_base_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/base/lending_base_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/base/lending_base_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/base/lending_base_base_borrow.sql diff --git a/models/_sector/lending/borrow/base/platforms/aave_v3_base_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/base/platforms/aave_v3_base_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/base/platforms/aave_v3_base_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/base/platforms/aave_v3_base_base_borrow.sql diff --git a/models/_sector/lending/borrow/base/platforms/compound_v3_base_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/base/platforms/compound_v3_base_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/base/platforms/compound_v3_base_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/base/platforms/compound_v3_base_base_borrow.sql diff --git a/models/_sector/lending/borrow/base/platforms/granary_base_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/base/platforms/granary_base_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/base/platforms/granary_base_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/base/platforms/granary_base_base_borrow.sql diff --git a/models/_sector/lending/borrow/base/platforms/moonwell_base_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/base/platforms/moonwell_base_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/base/platforms/moonwell_base_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/base/platforms/moonwell_base_base_borrow.sql diff --git a/models/_sector/lending/borrow/base/platforms/seamlessprotocol_base_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/base/platforms/seamlessprotocol_base_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/base/platforms/seamlessprotocol_base_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/base/platforms/seamlessprotocol_base_base_borrow.sql diff --git a/models/_sector/lending/borrow/base/platforms/sonne_finance_base_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/base/platforms/sonne_finance_base_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/base/platforms/sonne_finance_base_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/base/platforms/sonne_finance_base_base_borrow.sql diff --git a/models/_sector/lending/borrow/bnb/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/bnb/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/bnb/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/bnb/_schema.yml diff --git a/models/_sector/lending/borrow/bnb/lending_bnb_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/bnb/lending_bnb_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/bnb/lending_bnb_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/bnb/lending_bnb_base_borrow.sql diff --git a/models/_sector/lending/borrow/bnb/platforms/aave_v3_bnb_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/bnb/platforms/aave_v3_bnb_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/bnb/platforms/aave_v3_bnb_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/bnb/platforms/aave_v3_bnb_base_borrow.sql diff --git a/models/_sector/lending/borrow/bnb/platforms/granary_bnb_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/bnb/platforms/granary_bnb_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/bnb/platforms/granary_bnb_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/bnb/platforms/granary_bnb_base_borrow.sql diff --git a/models/_sector/lending/borrow/bnb/platforms/radiant_bnb_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/bnb/platforms/radiant_bnb_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/bnb/platforms/radiant_bnb_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/bnb/platforms/radiant_bnb_base_borrow.sql diff --git a/models/_sector/lending/borrow/celo/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/celo/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/celo/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/celo/_schema.yml diff --git a/models/_sector/lending/borrow/celo/lending_celo_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/celo/lending_celo_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/celo/lending_celo_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/celo/lending_celo_base_borrow.sql diff --git a/models/_sector/lending/borrow/celo/platforms/moola_celo_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/celo/platforms/moola_celo_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/celo/platforms/moola_celo_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/celo/platforms/moola_celo_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/ethereum/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/ethereum/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/_schema.yml diff --git a/models/_sector/lending/borrow/ethereum/lending_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/lending_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/lending_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/lending_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/platforms/aave_v1_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/aave_v1_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/platforms/aave_v1_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/aave_v1_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/platforms/aave_v2_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/aave_v2_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/platforms/aave_v2_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/aave_v2_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/platforms/aave_v3_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/aave_v3_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/platforms/aave_v3_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/aave_v3_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/platforms/compound_v2_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/compound_v2_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/platforms/compound_v2_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/compound_v2_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/platforms/compound_v3_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/compound_v3_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/platforms/compound_v3_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/compound_v3_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/platforms/fluxfinance_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/fluxfinance_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/platforms/fluxfinance_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/fluxfinance_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/platforms/granary_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/granary_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/platforms/granary_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/granary_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/platforms/morpho_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/morpho_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/platforms/morpho_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/morpho_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/platforms/radiant_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/radiant_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/platforms/radiant_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/radiant_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/platforms/spark_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/spark_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/platforms/spark_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/spark_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/platforms/strike_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/strike_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/platforms/strike_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/strike_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/ethereum/platforms/uwulend_ethereum_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/uwulend_ethereum_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/ethereum/platforms/uwulend_ethereum_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/ethereum/platforms/uwulend_ethereum_base_borrow.sql diff --git a/models/_sector/lending/borrow/fantom/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/fantom/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/fantom/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/fantom/_schema.yml diff --git a/models/_sector/lending/borrow/fantom/lending_fantom_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/fantom/lending_fantom_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/fantom/lending_fantom_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/fantom/lending_fantom_base_borrow.sql diff --git a/models/_sector/lending/borrow/fantom/platforms/aave_v3_fantom_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/fantom/platforms/aave_v3_fantom_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/fantom/platforms/aave_v3_fantom_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/fantom/platforms/aave_v3_fantom_base_borrow.sql diff --git a/models/_sector/lending/borrow/fantom/platforms/granary_fantom_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/fantom/platforms/granary_fantom_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/fantom/platforms/granary_fantom_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/fantom/platforms/granary_fantom_base_borrow.sql diff --git a/models/_sector/lending/borrow/gnosis/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/gnosis/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/gnosis/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/gnosis/_schema.yml diff --git a/models/_sector/lending/borrow/gnosis/lending_gnosis_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/gnosis/lending_gnosis_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/gnosis/lending_gnosis_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/gnosis/lending_gnosis_base_borrow.sql diff --git a/models/_sector/lending/borrow/gnosis/platforms/aave_v3_gnosis_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/gnosis/platforms/aave_v3_gnosis_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/gnosis/platforms/aave_v3_gnosis_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/gnosis/platforms/aave_v3_gnosis_base_borrow.sql diff --git a/models/_sector/lending/borrow/gnosis/platforms/agave_gnosis_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/gnosis/platforms/agave_gnosis_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/gnosis/platforms/agave_gnosis_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/gnosis/platforms/agave_gnosis_base_borrow.sql diff --git a/models/_sector/lending/borrow/gnosis/platforms/realt_rmm_v1_gnosis_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/gnosis/platforms/realt_rmm_v1_gnosis_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/gnosis/platforms/realt_rmm_v1_gnosis_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/gnosis/platforms/realt_rmm_v1_gnosis_base_borrow.sql diff --git a/models/_sector/lending/borrow/gnosis/platforms/realt_rmm_v2_gnosis_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/gnosis/platforms/realt_rmm_v2_gnosis_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/gnosis/platforms/realt_rmm_v2_gnosis_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/gnosis/platforms/realt_rmm_v2_gnosis_base_borrow.sql diff --git a/models/_sector/lending/borrow/lending_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/lending_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/lending_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/lending_base_borrow.sql diff --git a/models/_sector/lending/borrow/lending_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/lending_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/lending_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/lending_borrow.sql diff --git a/models/_sector/lending/borrow/optimism/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/optimism/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/optimism/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/optimism/_schema.yml diff --git a/models/_sector/lending/borrow/optimism/lending_optimism_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/optimism/lending_optimism_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/optimism/lending_optimism_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/optimism/lending_optimism_base_borrow.sql diff --git a/models/_sector/lending/borrow/optimism/platforms/aave_v3_optimism_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/optimism/platforms/aave_v3_optimism_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/optimism/platforms/aave_v3_optimism_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/optimism/platforms/aave_v3_optimism_base_borrow.sql diff --git a/models/_sector/lending/borrow/optimism/platforms/granary_optimism_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/optimism/platforms/granary_optimism_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/optimism/platforms/granary_optimism_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/optimism/platforms/granary_optimism_base_borrow.sql diff --git a/models/_sector/lending/borrow/optimism/platforms/sonne_finance_optimism_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/optimism/platforms/sonne_finance_optimism_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/optimism/platforms/sonne_finance_optimism_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/optimism/platforms/sonne_finance_optimism_base_borrow.sql diff --git a/models/_sector/lending/borrow/polygon/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/polygon/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/polygon/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/polygon/_schema.yml diff --git a/models/_sector/lending/borrow/polygon/lending_polygon_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/polygon/lending_polygon_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/polygon/lending_polygon_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/polygon/lending_polygon_base_borrow.sql diff --git a/models/_sector/lending/borrow/polygon/platforms/aave_v2_polygon_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/polygon/platforms/aave_v2_polygon_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/polygon/platforms/aave_v2_polygon_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/polygon/platforms/aave_v2_polygon_base_borrow.sql diff --git a/models/_sector/lending/borrow/polygon/platforms/aave_v3_polygon_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/polygon/platforms/aave_v3_polygon_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/polygon/platforms/aave_v3_polygon_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/polygon/platforms/aave_v3_polygon_base_borrow.sql diff --git a/models/_sector/lending/borrow/polygon/platforms/compound_v3_polygon_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/polygon/platforms/compound_v3_polygon_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/polygon/platforms/compound_v3_polygon_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/polygon/platforms/compound_v3_polygon_base_borrow.sql diff --git a/models/_sector/lending/borrow/scroll/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/scroll/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/scroll/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/scroll/_schema.yml diff --git a/models/_sector/lending/borrow/scroll/lending_scroll_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/scroll/lending_scroll_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/scroll/lending_scroll_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/scroll/lending_scroll_base_borrow.sql diff --git a/models/_sector/lending/borrow/scroll/platforms/aave_v3_scroll_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/scroll/platforms/aave_v3_scroll_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/scroll/platforms/aave_v3_scroll_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/scroll/platforms/aave_v3_scroll_base_borrow.sql diff --git a/models/_sector/lending/borrow/scroll/platforms/layer_bank_scroll_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/scroll/platforms/layer_bank_scroll_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/scroll/platforms/layer_bank_scroll_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/scroll/platforms/layer_bank_scroll_base_borrow.sql diff --git a/models/_sector/lending/borrow/zksync/_schema.yml b/hourly_spellbook/models/_sector/lending/borrow/zksync/_schema.yml similarity index 100% rename from models/_sector/lending/borrow/zksync/_schema.yml rename to hourly_spellbook/models/_sector/lending/borrow/zksync/_schema.yml diff --git a/models/_sector/lending/borrow/zksync/lending_zksync_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/zksync/lending_zksync_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/zksync/lending_zksync_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/zksync/lending_zksync_base_borrow.sql diff --git a/models/_sector/lending/borrow/zksync/platforms/zerolend_zksync_base_borrow.sql b/hourly_spellbook/models/_sector/lending/borrow/zksync/platforms/zerolend_zksync_base_borrow.sql similarity index 100% rename from models/_sector/lending/borrow/zksync/platforms/zerolend_zksync_base_borrow.sql rename to hourly_spellbook/models/_sector/lending/borrow/zksync/platforms/zerolend_zksync_base_borrow.sql diff --git a/models/benqi/avalanche_c/benqi_finance_avalanche_c_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/benqi_finance_avalanche_c_ctokens.sql similarity index 100% rename from models/benqi/avalanche_c/benqi_finance_avalanche_c_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/benqi_finance_avalanche_c_ctokens.sql diff --git a/models/compound/ethereum/compound_v2_ethereum_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/compound_v2_ethereum_ctokens.sql similarity index 100% rename from models/compound/ethereum/compound_v2_ethereum_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/compound_v2_ethereum_ctokens.sql diff --git a/models/compound/arbitrum/compound_v3_arbitrum_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_arbitrum_ctokens.sql similarity index 100% rename from models/compound/arbitrum/compound_v3_arbitrum_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/compound_v3_arbitrum_ctokens.sql diff --git a/models/compound/base/compound_v3_base_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_base_ctokens.sql similarity index 100% rename from models/compound/base/compound_v3_base_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/compound_v3_base_ctokens.sql diff --git a/models/compound/ethereum/compound_v3_ethereum_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_ethereum_ctokens.sql similarity index 100% rename from models/compound/ethereum/compound_v3_ethereum_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/compound_v3_ethereum_ctokens.sql diff --git a/models/compound/polygon/compound_v3_polygon_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/compound_v3_polygon_ctokens.sql similarity index 100% rename from models/compound/polygon/compound_v3_polygon_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/compound_v3_polygon_ctokens.sql diff --git a/models/fluxfinance/ethereum/fluxfinance_ethereum_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/fluxfinance_ethereum_ctokens.sql similarity index 100% rename from models/fluxfinance/ethereum/fluxfinance_ethereum_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/fluxfinance_ethereum_ctokens.sql diff --git a/models/layer_bank/scroll/layer_bank_scroll_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/layer_bank_scroll_ctokens.sql similarity index 100% rename from models/layer_bank/scroll/layer_bank_scroll_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/layer_bank_scroll_ctokens.sql diff --git a/models/lodestar/arbitrum/lodestar_arbitrum_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/lodestar_arbitrum_ctokens.sql similarity index 100% rename from models/lodestar/arbitrum/lodestar_arbitrum_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/lodestar_arbitrum_ctokens.sql diff --git a/models/moonwell/base/moonwell_base_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/moonwell_base_ctokens.sql similarity index 100% rename from models/moonwell/base/moonwell_base_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/moonwell_base_ctokens.sql diff --git a/models/sonne_finance/base/sonne_finance_base_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/sonne_finance_base_ctokens.sql similarity index 100% rename from models/sonne_finance/base/sonne_finance_base_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/sonne_finance_base_ctokens.sql diff --git a/models/sonne_finance/optimism/sonne_finance_optimism_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/sonne_finance_optimism_ctokens.sql similarity index 100% rename from models/sonne_finance/optimism/sonne_finance_optimism_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/sonne_finance_optimism_ctokens.sql diff --git a/models/strike/ethereum/strike_lending_ethereum_ctokens.sql b/hourly_spellbook/models/_sector/lending/ctokens/strike_lending_ethereum_ctokens.sql similarity index 100% rename from models/strike/ethereum/strike_lending_ethereum_ctokens.sql rename to hourly_spellbook/models/_sector/lending/ctokens/strike_lending_ethereum_ctokens.sql diff --git a/models/_sector/lending/flashloans/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/_schema.yml diff --git a/models/_sector/lending/flashloans/arbitrum/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/arbitrum/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/arbitrum/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/arbitrum/_schema.yml diff --git a/models/_sector/lending/flashloans/arbitrum/lending_arbitrum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/arbitrum/lending_arbitrum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/arbitrum/lending_arbitrum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/arbitrum/lending_arbitrum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/arbitrum/platforms/aave_v3_arbitrum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/arbitrum/platforms/aave_v3_arbitrum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/arbitrum/platforms/aave_v3_arbitrum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/arbitrum/platforms/aave_v3_arbitrum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/arbitrum/platforms/balancer_v2_arbitrum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/arbitrum/platforms/balancer_v2_arbitrum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/arbitrum/platforms/balancer_v2_arbitrum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/arbitrum/platforms/balancer_v2_arbitrum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/arbitrum/platforms/granary_arbitrum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/arbitrum/platforms/granary_arbitrum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/arbitrum/platforms/granary_arbitrum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/arbitrum/platforms/granary_arbitrum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/arbitrum/platforms/radiant_arbitrum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/arbitrum/platforms/radiant_arbitrum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/arbitrum/platforms/radiant_arbitrum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/arbitrum/platforms/radiant_arbitrum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/avalanche_c/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/avalanche_c/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/avalanche_c/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/avalanche_c/_schema.yml diff --git a/models/_sector/lending/flashloans/avalanche_c/lending_avalanche_c_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/avalanche_c/lending_avalanche_c_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/avalanche_c/lending_avalanche_c_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/avalanche_c/lending_avalanche_c_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/avalanche_c/platforms/aave_v2_avalanche_c_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/avalanche_c/platforms/aave_v2_avalanche_c_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/avalanche_c/platforms/aave_v2_avalanche_c_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/avalanche_c/platforms/aave_v2_avalanche_c_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/avalanche_c/platforms/aave_v3_avalanche_c_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/avalanche_c/platforms/aave_v3_avalanche_c_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/avalanche_c/platforms/aave_v3_avalanche_c_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/avalanche_c/platforms/aave_v3_avalanche_c_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/avalanche_c/platforms/balancer_v2_avalanche_c_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/avalanche_c/platforms/balancer_v2_avalanche_c_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/avalanche_c/platforms/balancer_v2_avalanche_c_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/avalanche_c/platforms/balancer_v2_avalanche_c_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/avalanche_c/platforms/granary_avalanche_c_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/avalanche_c/platforms/granary_avalanche_c_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/avalanche_c/platforms/granary_avalanche_c_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/avalanche_c/platforms/granary_avalanche_c_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/base/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/base/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/base/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/base/_schema.yml diff --git a/models/_sector/lending/flashloans/base/lending_base_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/base/lending_base_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/base/lending_base_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/base/lending_base_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/base/platforms/aave_v3_base_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/base/platforms/aave_v3_base_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/base/platforms/aave_v3_base_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/base/platforms/aave_v3_base_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/base/platforms/balancer_v2_base_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/base/platforms/balancer_v2_base_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/base/platforms/balancer_v2_base_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/base/platforms/balancer_v2_base_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/base/platforms/granary_base_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/base/platforms/granary_base_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/base/platforms/granary_base_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/base/platforms/granary_base_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/base/platforms/seamlessprotocol_base_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/base/platforms/seamlessprotocol_base_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/base/platforms/seamlessprotocol_base_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/base/platforms/seamlessprotocol_base_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/bnb/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/bnb/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/bnb/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/bnb/_schema.yml diff --git a/models/_sector/lending/flashloans/bnb/lending_bnb_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/bnb/lending_bnb_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/bnb/lending_bnb_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/bnb/lending_bnb_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/bnb/platforms/aave_v3_bnb_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/bnb/platforms/aave_v3_bnb_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/bnb/platforms/aave_v3_bnb_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/bnb/platforms/aave_v3_bnb_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/bnb/platforms/granary_bnb_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/bnb/platforms/granary_bnb_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/bnb/platforms/granary_bnb_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/bnb/platforms/granary_bnb_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/bnb/platforms/radiant_bnb_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/bnb/platforms/radiant_bnb_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/bnb/platforms/radiant_bnb_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/bnb/platforms/radiant_bnb_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/celo/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/celo/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/celo/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/celo/_schema.yml diff --git a/models/_sector/lending/flashloans/celo/lending_celo_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/celo/lending_celo_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/celo/lending_celo_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/celo/lending_celo_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/celo/platforms/moola_celo_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/celo/platforms/moola_celo_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/celo/platforms/moola_celo_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/celo/platforms/moola_celo_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/ethereum/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/ethereum/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/ethereum/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/ethereum/_schema.yml diff --git a/models/_sector/lending/flashloans/ethereum/lending_ethereum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/ethereum/lending_ethereum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/ethereum/lending_ethereum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/ethereum/lending_ethereum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/ethereum/platforms/aave_v1_ethereum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/aave_v1_ethereum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/ethereum/platforms/aave_v1_ethereum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/aave_v1_ethereum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/ethereum/platforms/aave_v2_ethereum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/aave_v2_ethereum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/ethereum/platforms/aave_v2_ethereum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/aave_v2_ethereum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/ethereum/platforms/aave_v3_ethereum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/aave_v3_ethereum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/ethereum/platforms/aave_v3_ethereum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/aave_v3_ethereum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/ethereum/platforms/balancer_v2_ethereum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/balancer_v2_ethereum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/ethereum/platforms/balancer_v2_ethereum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/balancer_v2_ethereum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/ethereum/platforms/granary_ethereum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/granary_ethereum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/ethereum/platforms/granary_ethereum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/granary_ethereum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/ethereum/platforms/morpho_ethereum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/morpho_ethereum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/ethereum/platforms/morpho_ethereum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/morpho_ethereum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/ethereum/platforms/radiant_ethereum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/radiant_ethereum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/ethereum/platforms/radiant_ethereum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/radiant_ethereum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/ethereum/platforms/spark_ethereum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/spark_ethereum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/ethereum/platforms/spark_ethereum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/spark_ethereum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/ethereum/platforms/uwulend_ethereum_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/uwulend_ethereum_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/ethereum/platforms/uwulend_ethereum_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/ethereum/platforms/uwulend_ethereum_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/fantom/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/fantom/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/fantom/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/fantom/_schema.yml diff --git a/models/_sector/lending/flashloans/fantom/lending_fantom_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/fantom/lending_fantom_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/fantom/lending_fantom_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/fantom/lending_fantom_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/fantom/platforms/aave_v3_fantom_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/fantom/platforms/aave_v3_fantom_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/fantom/platforms/aave_v3_fantom_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/fantom/platforms/aave_v3_fantom_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/fantom/platforms/granary_fantom_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/fantom/platforms/granary_fantom_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/fantom/platforms/granary_fantom_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/fantom/platforms/granary_fantom_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/gnosis/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/gnosis/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/gnosis/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/gnosis/_schema.yml diff --git a/models/_sector/lending/flashloans/gnosis/lending_gnosis_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/gnosis/lending_gnosis_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/gnosis/lending_gnosis_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/gnosis/lending_gnosis_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/gnosis/platforms/aave_v3_gnosis_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/gnosis/platforms/aave_v3_gnosis_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/gnosis/platforms/aave_v3_gnosis_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/gnosis/platforms/aave_v3_gnosis_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/gnosis/platforms/agave_gnosis_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/gnosis/platforms/agave_gnosis_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/gnosis/platforms/agave_gnosis_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/gnosis/platforms/agave_gnosis_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/gnosis/platforms/balancer_v2_gnosis_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/gnosis/platforms/balancer_v2_gnosis_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/gnosis/platforms/balancer_v2_gnosis_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/gnosis/platforms/balancer_v2_gnosis_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/gnosis/platforms/realt_rmm_v1_gnosis_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/gnosis/platforms/realt_rmm_v1_gnosis_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/gnosis/platforms/realt_rmm_v1_gnosis_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/gnosis/platforms/realt_rmm_v1_gnosis_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/gnosis/platforms/realt_rmm_v2_gnosis_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/gnosis/platforms/realt_rmm_v2_gnosis_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/gnosis/platforms/realt_rmm_v2_gnosis_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/gnosis/platforms/realt_rmm_v2_gnosis_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/lending_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/lending_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/lending_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/lending_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/lending_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/lending_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/lending_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/lending_flashloans.sql diff --git a/models/_sector/lending/flashloans/optimism/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/optimism/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/optimism/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/optimism/_schema.yml diff --git a/models/_sector/lending/flashloans/optimism/lending_optimism_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/optimism/lending_optimism_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/optimism/lending_optimism_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/optimism/lending_optimism_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/optimism/platforms/aave_v3_optimism_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/optimism/platforms/aave_v3_optimism_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/optimism/platforms/aave_v3_optimism_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/optimism/platforms/aave_v3_optimism_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/optimism/platforms/balancer_v2_optimism_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/optimism/platforms/balancer_v2_optimism_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/optimism/platforms/balancer_v2_optimism_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/optimism/platforms/balancer_v2_optimism_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/optimism/platforms/granary_optimism_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/optimism/platforms/granary_optimism_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/optimism/platforms/granary_optimism_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/optimism/platforms/granary_optimism_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/polygon/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/polygon/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/polygon/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/polygon/_schema.yml diff --git a/models/_sector/lending/flashloans/polygon/lending_polygon_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/polygon/lending_polygon_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/polygon/lending_polygon_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/polygon/lending_polygon_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/polygon/platforms/aave_v2_polygon_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/polygon/platforms/aave_v2_polygon_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/polygon/platforms/aave_v2_polygon_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/polygon/platforms/aave_v2_polygon_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/polygon/platforms/aave_v3_polygon_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/polygon/platforms/aave_v3_polygon_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/polygon/platforms/aave_v3_polygon_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/polygon/platforms/aave_v3_polygon_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/polygon/platforms/balancer_v2_polygon_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/polygon/platforms/balancer_v2_polygon_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/polygon/platforms/balancer_v2_polygon_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/polygon/platforms/balancer_v2_polygon_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/scroll/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/scroll/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/scroll/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/scroll/_schema.yml diff --git a/models/_sector/lending/flashloans/scroll/lending_scroll_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/scroll/lending_scroll_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/scroll/lending_scroll_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/scroll/lending_scroll_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/scroll/platforms/aave_v3_scroll_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/scroll/platforms/aave_v3_scroll_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/scroll/platforms/aave_v3_scroll_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/scroll/platforms/aave_v3_scroll_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/zkevm/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/zkevm/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/zkevm/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/zkevm/_schema.yml diff --git a/models/_sector/lending/flashloans/zkevm/lending_zkevm_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/zkevm/lending_zkevm_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/zkevm/lending_zkevm_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/zkevm/lending_zkevm_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/zkevm/platforms/balancer_v2_zkevm_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/zkevm/platforms/balancer_v2_zkevm_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/zkevm/platforms/balancer_v2_zkevm_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/zkevm/platforms/balancer_v2_zkevm_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/zksync/_schema.yml b/hourly_spellbook/models/_sector/lending/flashloans/zksync/_schema.yml similarity index 100% rename from models/_sector/lending/flashloans/zksync/_schema.yml rename to hourly_spellbook/models/_sector/lending/flashloans/zksync/_schema.yml diff --git a/models/_sector/lending/flashloans/zksync/lending_zksync_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/zksync/lending_zksync_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/zksync/lending_zksync_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/zksync/lending_zksync_base_flashloans.sql diff --git a/models/_sector/lending/flashloans/zksync/platforms/zerolend_zksync_base_flashloans.sql b/hourly_spellbook/models/_sector/lending/flashloans/zksync/platforms/zerolend_zksync_base_flashloans.sql similarity index 100% rename from models/_sector/lending/flashloans/zksync/platforms/zerolend_zksync_base_flashloans.sql rename to hourly_spellbook/models/_sector/lending/flashloans/zksync/platforms/zerolend_zksync_base_flashloans.sql diff --git a/models/_sector/lending/lending_info.sql b/hourly_spellbook/models/_sector/lending/lending_info.sql similarity index 100% rename from models/_sector/lending/lending_info.sql rename to hourly_spellbook/models/_sector/lending/lending_info.sql diff --git a/models/_sector/lending/supply/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/_schema.yml similarity index 100% rename from models/_sector/lending/supply/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/_schema.yml diff --git a/models/_sector/lending/supply/arbitrum/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/arbitrum/_schema.yml similarity index 100% rename from models/_sector/lending/supply/arbitrum/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/arbitrum/_schema.yml diff --git a/models/_sector/lending/supply/arbitrum/lending_arbitrum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/arbitrum/lending_arbitrum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/arbitrum/lending_arbitrum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/arbitrum/lending_arbitrum_base_supply.sql diff --git a/models/_sector/lending/supply/arbitrum/platforms/aave_v3_arbitrum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/arbitrum/platforms/aave_v3_arbitrum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/arbitrum/platforms/aave_v3_arbitrum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/arbitrum/platforms/aave_v3_arbitrum_base_supply.sql diff --git a/models/_sector/lending/supply/arbitrum/platforms/compound_v3_arbitrum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/arbitrum/platforms/compound_v3_arbitrum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/arbitrum/platforms/compound_v3_arbitrum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/arbitrum/platforms/compound_v3_arbitrum_base_supply.sql diff --git a/models/_sector/lending/supply/arbitrum/platforms/granary_arbitrum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/arbitrum/platforms/granary_arbitrum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/arbitrum/platforms/granary_arbitrum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/arbitrum/platforms/granary_arbitrum_base_supply.sql diff --git a/models/_sector/lending/supply/arbitrum/platforms/lodestar_v0_arbitrum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/arbitrum/platforms/lodestar_v0_arbitrum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/arbitrum/platforms/lodestar_v0_arbitrum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/arbitrum/platforms/lodestar_v0_arbitrum_base_supply.sql diff --git a/models/_sector/lending/supply/arbitrum/platforms/lodestar_v1_arbitrum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/arbitrum/platforms/lodestar_v1_arbitrum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/arbitrum/platforms/lodestar_v1_arbitrum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/arbitrum/platforms/lodestar_v1_arbitrum_base_supply.sql diff --git a/models/_sector/lending/supply/arbitrum/platforms/radiant_arbitrum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/arbitrum/platforms/radiant_arbitrum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/arbitrum/platforms/radiant_arbitrum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/arbitrum/platforms/radiant_arbitrum_base_supply.sql diff --git a/models/_sector/lending/supply/avalanche_c/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/avalanche_c/_schema.yml similarity index 100% rename from models/_sector/lending/supply/avalanche_c/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/avalanche_c/_schema.yml diff --git a/models/_sector/lending/supply/avalanche_c/lending_avalanche_c_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/avalanche_c/lending_avalanche_c_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/avalanche_c/lending_avalanche_c_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/avalanche_c/lending_avalanche_c_base_supply.sql diff --git a/models/_sector/lending/supply/avalanche_c/platforms/aave_v2_avalanche_c_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/avalanche_c/platforms/aave_v2_avalanche_c_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/avalanche_c/platforms/aave_v2_avalanche_c_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/avalanche_c/platforms/aave_v2_avalanche_c_base_supply.sql diff --git a/models/_sector/lending/supply/avalanche_c/platforms/aave_v3_avalanche_c_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/avalanche_c/platforms/aave_v3_avalanche_c_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/avalanche_c/platforms/aave_v3_avalanche_c_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/avalanche_c/platforms/aave_v3_avalanche_c_base_supply.sql diff --git a/models/_sector/lending/supply/avalanche_c/platforms/benqi_avalanche_c_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/avalanche_c/platforms/benqi_avalanche_c_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/avalanche_c/platforms/benqi_avalanche_c_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/avalanche_c/platforms/benqi_avalanche_c_base_supply.sql diff --git a/models/_sector/lending/supply/avalanche_c/platforms/granary_avalanche_c_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/avalanche_c/platforms/granary_avalanche_c_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/avalanche_c/platforms/granary_avalanche_c_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/avalanche_c/platforms/granary_avalanche_c_base_supply.sql diff --git a/models/_sector/lending/supply/base/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/base/_schema.yml similarity index 100% rename from models/_sector/lending/supply/base/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/base/_schema.yml diff --git a/models/_sector/lending/supply/base/lending_base_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/base/lending_base_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/base/lending_base_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/base/lending_base_base_supply.sql diff --git a/models/_sector/lending/supply/base/platforms/aave_v3_base_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/base/platforms/aave_v3_base_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/base/platforms/aave_v3_base_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/base/platforms/aave_v3_base_base_supply.sql diff --git a/models/_sector/lending/supply/base/platforms/compound_v3_base_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/base/platforms/compound_v3_base_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/base/platforms/compound_v3_base_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/base/platforms/compound_v3_base_base_supply.sql diff --git a/models/_sector/lending/supply/base/platforms/granary_base_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/base/platforms/granary_base_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/base/platforms/granary_base_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/base/platforms/granary_base_base_supply.sql diff --git a/models/_sector/lending/supply/base/platforms/moonwell_base_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/base/platforms/moonwell_base_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/base/platforms/moonwell_base_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/base/platforms/moonwell_base_base_supply.sql diff --git a/models/_sector/lending/supply/base/platforms/seamlessprotocol_base_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/base/platforms/seamlessprotocol_base_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/base/platforms/seamlessprotocol_base_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/base/platforms/seamlessprotocol_base_base_supply.sql diff --git a/models/_sector/lending/supply/base/platforms/sonne_finance_base_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/base/platforms/sonne_finance_base_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/base/platforms/sonne_finance_base_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/base/platforms/sonne_finance_base_base_supply.sql diff --git a/models/_sector/lending/supply/bnb/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/bnb/_schema.yml similarity index 100% rename from models/_sector/lending/supply/bnb/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/bnb/_schema.yml diff --git a/models/_sector/lending/supply/bnb/lending_bnb_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/bnb/lending_bnb_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/bnb/lending_bnb_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/bnb/lending_bnb_base_supply.sql diff --git a/models/_sector/lending/supply/bnb/platforms/aave_v3_bnb_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/bnb/platforms/aave_v3_bnb_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/bnb/platforms/aave_v3_bnb_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/bnb/platforms/aave_v3_bnb_base_supply.sql diff --git a/models/_sector/lending/supply/bnb/platforms/granary_bnb_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/bnb/platforms/granary_bnb_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/bnb/platforms/granary_bnb_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/bnb/platforms/granary_bnb_base_supply.sql diff --git a/models/_sector/lending/supply/bnb/platforms/radiant_bnb_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/bnb/platforms/radiant_bnb_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/bnb/platforms/radiant_bnb_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/bnb/platforms/radiant_bnb_base_supply.sql diff --git a/models/_sector/lending/supply/celo/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/celo/_schema.yml similarity index 100% rename from models/_sector/lending/supply/celo/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/celo/_schema.yml diff --git a/models/_sector/lending/supply/celo/lending_celo_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/celo/lending_celo_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/celo/lending_celo_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/celo/lending_celo_base_supply.sql diff --git a/models/_sector/lending/supply/celo/platforms/moola_celo_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/celo/platforms/moola_celo_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/celo/platforms/moola_celo_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/celo/platforms/moola_celo_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/ethereum/_schema.yml similarity index 100% rename from models/_sector/lending/supply/ethereum/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/ethereum/_schema.yml diff --git a/models/_sector/lending/supply/ethereum/lending_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/lending_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/lending_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/lending_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/platforms/aave_v1_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/aave_v1_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/platforms/aave_v1_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/aave_v1_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/platforms/aave_v2_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/aave_v2_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/platforms/aave_v2_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/aave_v2_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/platforms/aave_v3_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/aave_v3_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/platforms/aave_v3_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/aave_v3_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/platforms/compound_v2_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/compound_v2_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/platforms/compound_v2_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/compound_v2_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/platforms/compound_v3_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/compound_v3_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/platforms/compound_v3_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/compound_v3_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/platforms/fluxfinance_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/fluxfinance_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/platforms/fluxfinance_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/fluxfinance_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/platforms/granary_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/granary_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/platforms/granary_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/granary_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/platforms/morpho_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/morpho_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/platforms/morpho_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/morpho_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/platforms/radiant_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/radiant_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/platforms/radiant_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/radiant_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/platforms/spark_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/spark_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/platforms/spark_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/spark_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/platforms/strike_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/strike_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/platforms/strike_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/strike_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/ethereum/platforms/uwulend_ethereum_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/uwulend_ethereum_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/ethereum/platforms/uwulend_ethereum_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/ethereum/platforms/uwulend_ethereum_base_supply.sql diff --git a/models/_sector/lending/supply/fantom/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/fantom/_schema.yml similarity index 100% rename from models/_sector/lending/supply/fantom/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/fantom/_schema.yml diff --git a/models/_sector/lending/supply/fantom/lending_fantom_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/fantom/lending_fantom_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/fantom/lending_fantom_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/fantom/lending_fantom_base_supply.sql diff --git a/models/_sector/lending/supply/fantom/platforms/aave_v3_fantom_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/fantom/platforms/aave_v3_fantom_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/fantom/platforms/aave_v3_fantom_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/fantom/platforms/aave_v3_fantom_base_supply.sql diff --git a/models/_sector/lending/supply/fantom/platforms/granary_fantom_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/fantom/platforms/granary_fantom_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/fantom/platforms/granary_fantom_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/fantom/platforms/granary_fantom_base_supply.sql diff --git a/models/_sector/lending/supply/gnosis/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/gnosis/_schema.yml similarity index 100% rename from models/_sector/lending/supply/gnosis/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/gnosis/_schema.yml diff --git a/models/_sector/lending/supply/gnosis/lending_gnosis_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/gnosis/lending_gnosis_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/gnosis/lending_gnosis_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/gnosis/lending_gnosis_base_supply.sql diff --git a/models/_sector/lending/supply/gnosis/platforms/aave_v3_gnosis_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/gnosis/platforms/aave_v3_gnosis_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/gnosis/platforms/aave_v3_gnosis_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/gnosis/platforms/aave_v3_gnosis_base_supply.sql diff --git a/models/_sector/lending/supply/gnosis/platforms/agave_gnosis_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/gnosis/platforms/agave_gnosis_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/gnosis/platforms/agave_gnosis_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/gnosis/platforms/agave_gnosis_base_supply.sql diff --git a/models/_sector/lending/supply/gnosis/platforms/realt_rmm_v1_gnosis_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/gnosis/platforms/realt_rmm_v1_gnosis_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/gnosis/platforms/realt_rmm_v1_gnosis_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/gnosis/platforms/realt_rmm_v1_gnosis_base_supply.sql diff --git a/models/_sector/lending/supply/gnosis/platforms/realt_rmm_v2_gnosis_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/gnosis/platforms/realt_rmm_v2_gnosis_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/gnosis/platforms/realt_rmm_v2_gnosis_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/gnosis/platforms/realt_rmm_v2_gnosis_base_supply.sql diff --git a/models/_sector/lending/supply/lending_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/lending_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/lending_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/lending_base_supply.sql diff --git a/models/_sector/lending/supply/lending_supply.sql b/hourly_spellbook/models/_sector/lending/supply/lending_supply.sql similarity index 100% rename from models/_sector/lending/supply/lending_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/lending_supply.sql diff --git a/models/_sector/lending/supply/optimism/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/optimism/_schema.yml similarity index 100% rename from models/_sector/lending/supply/optimism/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/optimism/_schema.yml diff --git a/models/_sector/lending/supply/optimism/lending_optimism_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/optimism/lending_optimism_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/optimism/lending_optimism_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/optimism/lending_optimism_base_supply.sql diff --git a/models/_sector/lending/supply/optimism/platforms/aave_v3_optimism_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/optimism/platforms/aave_v3_optimism_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/optimism/platforms/aave_v3_optimism_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/optimism/platforms/aave_v3_optimism_base_supply.sql diff --git a/models/_sector/lending/supply/optimism/platforms/granary_optimism_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/optimism/platforms/granary_optimism_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/optimism/platforms/granary_optimism_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/optimism/platforms/granary_optimism_base_supply.sql diff --git a/models/_sector/lending/supply/optimism/platforms/sonne_finance_optimism_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/optimism/platforms/sonne_finance_optimism_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/optimism/platforms/sonne_finance_optimism_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/optimism/platforms/sonne_finance_optimism_base_supply.sql diff --git a/models/_sector/lending/supply/polygon/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/polygon/_schema.yml similarity index 100% rename from models/_sector/lending/supply/polygon/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/polygon/_schema.yml diff --git a/models/_sector/lending/supply/polygon/lending_polygon_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/polygon/lending_polygon_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/polygon/lending_polygon_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/polygon/lending_polygon_base_supply.sql diff --git a/models/_sector/lending/supply/polygon/platforms/aave_v2_polygon_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/polygon/platforms/aave_v2_polygon_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/polygon/platforms/aave_v2_polygon_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/polygon/platforms/aave_v2_polygon_base_supply.sql diff --git a/models/_sector/lending/supply/polygon/platforms/aave_v3_polygon_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/polygon/platforms/aave_v3_polygon_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/polygon/platforms/aave_v3_polygon_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/polygon/platforms/aave_v3_polygon_base_supply.sql diff --git a/models/_sector/lending/supply/polygon/platforms/compound_v3_polygon_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/polygon/platforms/compound_v3_polygon_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/polygon/platforms/compound_v3_polygon_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/polygon/platforms/compound_v3_polygon_base_supply.sql diff --git a/models/_sector/lending/supply/scroll/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/scroll/_schema.yml similarity index 100% rename from models/_sector/lending/supply/scroll/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/scroll/_schema.yml diff --git a/models/_sector/lending/supply/scroll/lending_scroll_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/scroll/lending_scroll_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/scroll/lending_scroll_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/scroll/lending_scroll_base_supply.sql diff --git a/models/_sector/lending/supply/scroll/platforms/aave_v3_scroll_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/scroll/platforms/aave_v3_scroll_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/scroll/platforms/aave_v3_scroll_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/scroll/platforms/aave_v3_scroll_base_supply.sql diff --git a/models/_sector/lending/supply/scroll/platforms/layer_bank_scroll_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/scroll/platforms/layer_bank_scroll_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/scroll/platforms/layer_bank_scroll_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/scroll/platforms/layer_bank_scroll_base_supply.sql diff --git a/models/_sector/lending/supply/zksync/_schema.yml b/hourly_spellbook/models/_sector/lending/supply/zksync/_schema.yml similarity index 100% rename from models/_sector/lending/supply/zksync/_schema.yml rename to hourly_spellbook/models/_sector/lending/supply/zksync/_schema.yml diff --git a/models/_sector/lending/supply/zksync/lending_zksync_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/zksync/lending_zksync_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/zksync/lending_zksync_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/zksync/lending_zksync_base_supply.sql diff --git a/models/_sector/lending/supply/zksync/platforms/zerolend_zksync_base_supply.sql b/hourly_spellbook/models/_sector/lending/supply/zksync/platforms/zerolend_zksync_base_supply.sql similarity index 100% rename from models/_sector/lending/supply/zksync/platforms/zerolend_zksync_base_supply.sql rename to hourly_spellbook/models/_sector/lending/supply/zksync/platforms/zerolend_zksync_base_supply.sql diff --git a/models/_sector/perpetual/perpetual_schema.yml b/hourly_spellbook/models/_sector/perpetual/perpetual_schema.yml similarity index 100% rename from models/_sector/perpetual/perpetual_schema.yml rename to hourly_spellbook/models/_sector/perpetual/perpetual_schema.yml diff --git a/models/_sector/perpetual/perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/avt/optimism/avt_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/avt/optimism/avt_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/avt/optimism/avt_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/avt/optimism/avt_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/avt/optimism/avt_optimism_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/avt/optimism/avt_optimism_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/avt/optimism/avt_optimism_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/avt/optimism/avt_optimism_schema.yml diff --git a/models/_sector/perpetual/projects/avt/optimism/avt_v1_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/avt/optimism/avt_v1_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/avt/optimism/avt_v1_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/avt/optimism/avt_v1_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_schema.yml diff --git a/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_sources.yml b/hourly_spellbook/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_sources.yml similarity index 100% rename from models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_sources.yml rename to hourly_spellbook/models/_sector/perpetual/projects/basemax_finance/base/basemax_finance_base_sources.yml diff --git a/models/_sector/perpetual/projects/bmx/base/bmx_base_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/bmx/base/bmx_base_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/bmx/base/bmx_base_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/bmx/base/bmx_base_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/bmx/base/bmx_base_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/bmx/base/bmx_base_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/bmx/base/bmx_base_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/bmx/base/bmx_base_schema.yml diff --git a/models/_sector/perpetual/projects/bmx/base/bmx_base_sources.yml b/hourly_spellbook/models/_sector/perpetual/projects/bmx/base/bmx_base_sources.yml similarity index 100% rename from models/_sector/perpetual/projects/bmx/base/bmx_base_sources.yml rename to hourly_spellbook/models/_sector/perpetual/projects/bmx/base/bmx_base_sources.yml diff --git a/models/_sector/perpetual/projects/emdx/avalanche_c/emdx_avalanche_c_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/emdx/avalanche_c/emdx_avalanche_c_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/emdx/avalanche_c/emdx_avalanche_c_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/emdx/avalanche_c/emdx_avalanche_c_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/emdx/avalanche_c/emdx_avalanche_c_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/emdx/avalanche_c/emdx_avalanche_c_schema.yml similarity index 96% rename from models/_sector/perpetual/projects/emdx/avalanche_c/emdx_avalanche_c_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/emdx/avalanche_c/emdx_avalanche_c_schema.yml index 1ad00ae9612..86d87390f78 100644 --- a/models/_sector/perpetual/projects/emdx/avalanche_c/emdx_avalanche_c_schema.yml +++ b/hourly_spellbook/models/_sector/perpetual/projects/emdx/avalanche_c/emdx_avalanche_c_schema.yml @@ -20,10 +20,10 @@ models: - version - tx_hash - evt_index - - check_perpetuals_seed: - blockchain: avalanche_c - project: emdx - version: 1 +# - check_perpetuals_seed: +# blockchain: avalanche_c +# project: emdx +# version: 1 columns: - &blockchain name: blockchain diff --git a/models/_sector/perpetual/projects/fxdx/optimism/fxdx_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/fxdx/optimism/fxdx_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/fxdx/optimism/fxdx_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/fxdx/optimism/fxdx_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/fxdx/optimism/fxdx_optimism_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/fxdx/optimism/fxdx_optimism_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/fxdx/optimism/fxdx_optimism_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/fxdx/optimism/fxdx_optimism_schema.yml diff --git a/models/_sector/perpetual/projects/fxdx/optimism/fxdx_v2_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/fxdx/optimism/fxdx_v2_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/fxdx/optimism/fxdx_v2_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/fxdx/optimism/fxdx_v2_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/gmx/gmx_arbitrum_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/gmx/gmx_arbitrum_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/gmx/gmx_arbitrum_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/gmx/gmx_arbitrum_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/gmx/gmx_arbitrum_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/gmx/gmx_arbitrum_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/gmx/gmx_arbitrum_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/gmx/gmx_arbitrum_schema.yml diff --git a/models/_sector/perpetual/projects/gmx/gmx_avalanche_c_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/gmx/gmx_avalanche_c_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/gmx/gmx_avalanche_c_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/gmx/gmx_avalanche_c_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/gmx/gmx_avalanche_c_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/gmx/gmx_avalanche_c_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/gmx/gmx_avalanche_c_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/gmx/gmx_avalanche_c_schema.yml diff --git a/models/_sector/perpetual/projects/gmx/gmx_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/gmx/gmx_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/gmx/gmx_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/gmx/gmx_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/gmx/gmx_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/gmx/gmx_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/gmx/gmx_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/gmx/gmx_schema.yml diff --git a/models/_sector/perpetual/projects/hubble_exchange/avalanche_c/hubble_exchange_avalanche_c_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/hubble_exchange/avalanche_c/hubble_exchange_avalanche_c_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/hubble_exchange/avalanche_c/hubble_exchange_avalanche_c_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/hubble_exchange/avalanche_c/hubble_exchange_avalanche_c_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/hubble_exchange/avalanche_c/hubble_exchange_avalanche_c_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/hubble_exchange/avalanche_c/hubble_exchange_avalanche_c_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/hubble_exchange/avalanche_c/hubble_exchange_avalanche_c_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/hubble_exchange/avalanche_c/hubble_exchange_avalanche_c_schema.yml diff --git a/models/_sector/perpetual/projects/immortalx/celo/immortalx_celo_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/immortalx/celo/immortalx_celo_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/immortalx/celo/immortalx_celo_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/immortalx/celo/immortalx_celo_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/immortalx/celo/immortalx_celo_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/immortalx/celo/immortalx_celo_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/immortalx/celo/immortalx_celo_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/immortalx/celo/immortalx_celo_schema.yml diff --git a/models/_sector/perpetual/projects/immortalx/immortalx_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/immortalx/immortalx_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/immortalx/immortalx_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/immortalx/immortalx_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/immortalx/immortalx_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/immortalx/immortalx_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/immortalx/immortalx_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/immortalx/immortalx_schema.yml diff --git a/models/_sector/perpetual/projects/meridian/base/meridian_base_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/meridian/base/meridian_base_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/meridian/base/meridian_base_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/meridian/base/meridian_base_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/meridian/base/meridian_base_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/meridian/base/meridian_base_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/meridian/base/meridian_base_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/meridian/base/meridian_base_schema.yml diff --git a/models/_sector/perpetual/projects/meridian/base/meridian_base_sources.yml b/hourly_spellbook/models/_sector/perpetual/projects/meridian/base/meridian_base_sources.yml similarity index 100% rename from models/_sector/perpetual/projects/meridian/base/meridian_base_sources.yml rename to hourly_spellbook/models/_sector/perpetual/projects/meridian/base/meridian_base_sources.yml diff --git a/models/_sector/perpetual/projects/minerva_money/minerva_money_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/minerva_money/minerva_money_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/minerva_money/minerva_money_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/minerva_money/minerva_money_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/minerva_money/minerva_money_optimism_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/minerva_money/minerva_money_optimism_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/minerva_money/minerva_money_optimism_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/minerva_money/minerva_money_optimism_schema.yml diff --git a/models/_sector/perpetual/projects/minerva_money/minerva_v1_money_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/minerva_money/minerva_v1_money_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/minerva_money/minerva_v1_money_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/minerva_money/minerva_v1_money_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/mummy_finance/base/mummy_finance_base_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/mummy_finance/base/mummy_finance_base_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/mummy_finance/base/mummy_finance_base_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/mummy_finance/base/mummy_finance_base_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/mummy_finance/base/mummy_finance_base_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/mummy_finance/base/mummy_finance_base_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/mummy_finance/base/mummy_finance_base_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/mummy_finance/base/mummy_finance_base_schema.yml diff --git a/models/_sector/perpetual/projects/mummy_finance/base/mummy_finance_base_sources.yml b/hourly_spellbook/models/_sector/perpetual/projects/mummy_finance/base/mummy_finance_base_sources.yml similarity index 100% rename from models/_sector/perpetual/projects/mummy_finance/base/mummy_finance_base_sources.yml rename to hourly_spellbook/models/_sector/perpetual/projects/mummy_finance/base/mummy_finance_base_sources.yml diff --git a/models/_sector/perpetual/projects/mummy_finance/optimism/mummy_finance_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/mummy_finance/optimism/mummy_finance_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/mummy_finance/optimism/mummy_finance_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/mummy_finance/optimism/mummy_finance_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/mummy_finance/optimism/mummy_finance_optimism_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/mummy_finance/optimism/mummy_finance_optimism_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/mummy_finance/optimism/mummy_finance_optimism_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/mummy_finance/optimism/mummy_finance_optimism_schema.yml diff --git a/models/_sector/perpetual/projects/mummy_finance/optimism/mummy_finance_v1_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/mummy_finance/optimism/mummy_finance_v1_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/mummy_finance/optimism/mummy_finance_v1_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/mummy_finance/optimism/mummy_finance_v1_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/mux_protocol/optimism/mux_protocol_optimism_asset_added.sql b/hourly_spellbook/models/_sector/perpetual/projects/mux_protocol/optimism/mux_protocol_optimism_asset_added.sql similarity index 100% rename from models/_sector/perpetual/projects/mux_protocol/optimism/mux_protocol_optimism_asset_added.sql rename to hourly_spellbook/models/_sector/perpetual/projects/mux_protocol/optimism/mux_protocol_optimism_asset_added.sql diff --git a/models/_sector/perpetual/projects/mux_protocol/optimism/mux_protocol_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/mux_protocol/optimism/mux_protocol_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/mux_protocol/optimism/mux_protocol_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/mux_protocol/optimism/mux_protocol_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/mux_protocol/optimism/mux_protocol_optimism_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/mux_protocol/optimism/mux_protocol_optimism_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/mux_protocol/optimism/mux_protocol_optimism_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/mux_protocol/optimism/mux_protocol_optimism_schema.yml diff --git a/models/_sector/perpetual/projects/nether_fi/base/nether_fi_base_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/nether_fi/base/nether_fi_base_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/nether_fi/base/nether_fi_base_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/nether_fi/base/nether_fi_base_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/nether_fi/base/nether_fi_base_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/nether_fi/base/nether_fi_base_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/nether_fi/base/nether_fi_base_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/nether_fi/base/nether_fi_base_schema.yml diff --git a/models/_sector/perpetual/projects/nex/nex_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/nex/nex_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/nex/nex_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/nex/nex_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/nex/nex_optimism_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/nex/nex_optimism_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/nex/nex_optimism_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/nex/nex_optimism_schema.yml diff --git a/models/_sector/perpetual/projects/opx_finance/optimism/opx_finance_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/opx_finance/optimism/opx_finance_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/opx_finance/optimism/opx_finance_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/opx_finance/optimism/opx_finance_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/opx_finance/optimism/opx_finance_optimism_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/opx_finance/optimism/opx_finance_optimism_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/opx_finance/optimism/opx_finance_optimism_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/opx_finance/optimism/opx_finance_optimism_schema.yml diff --git a/models/_sector/perpetual/projects/opx_finance/optimism/opx_finance_v1_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/opx_finance/optimism/opx_finance_v1_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/opx_finance/optimism/opx_finance_v1_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/opx_finance/optimism/opx_finance_v1_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/perpetual_protocol/optimism/perpetual_protocol_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/perpetual_protocol/optimism/perpetual_protocol_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/perpetual_protocol/optimism/perpetual_protocol_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/perpetual_protocol/optimism/perpetual_protocol_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/perpetual_protocol/optimism/perpetual_protocol_optimism_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/perpetual_protocol/optimism/perpetual_protocol_optimism_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/perpetual_protocol/optimism/perpetual_protocol_optimism_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/perpetual_protocol/optimism/perpetual_protocol_optimism_schema.yml diff --git a/models/_sector/perpetual/projects/perpetual_protocol/optimism/perpetual_protocol_v2_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/perpetual_protocol/optimism/perpetual_protocol_v2_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/perpetual_protocol/optimism/perpetual_protocol_v2_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/perpetual_protocol/optimism/perpetual_protocol_v2_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/perpetual_protocol/perpetual_protocol_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/perpetual_protocol/perpetual_protocol_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/perpetual_protocol/perpetual_protocol_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/perpetual_protocol/perpetual_protocol_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/perpetual_protocol/perpetual_protocol_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/perpetual_protocol/perpetual_protocol_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/perpetual_protocol/perpetual_protocol_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/perpetual_protocol/perpetual_protocol_schema.yml diff --git a/models/_sector/perpetual/projects/pika/optimism/pika_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/pika/optimism/pika_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/pika/optimism/pika_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/pika/optimism/pika_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/pika/optimism/pika_optimism_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/pika/optimism/pika_optimism_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/pika/optimism/pika_optimism_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/pika/optimism/pika_optimism_schema.yml diff --git a/models/_sector/perpetual/projects/pika/optimism/pika_v1_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/pika/optimism/pika_v1_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/pika/optimism/pika_v1_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/pika/optimism/pika_v1_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/pika/optimism/pika_v2_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/pika/optimism/pika_v2_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/pika/optimism/pika_v2_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/pika/optimism/pika_v2_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/pika/optimism/pika_v3_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/pika/optimism/pika_v3_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/pika/optimism/pika_v3_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/pika/optimism/pika_v3_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/pika/pika_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/pika/pika_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/pika/pika_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/pika/pika_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/pika/pika_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/pika/pika_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/pika/pika_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/pika/pika_schema.yml diff --git a/models/_sector/perpetual/projects/synthetix/base/synthetix_base_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/synthetix/base/synthetix_base_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/synthetix/base/synthetix_base_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/synthetix/base/synthetix_base_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/synthetix/base/synthetix_base_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/synthetix/base/synthetix_base_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/synthetix/base/synthetix_base_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/synthetix/base/synthetix_base_schema.yml diff --git a/models/_sector/perpetual/projects/synthetix/base/synthetix_v3_base_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/synthetix/base/synthetix_v3_base_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/synthetix/base/synthetix_v3_base_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/synthetix/base/synthetix_v3_base_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/synthetix/optimism/synthetix_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/synthetix/optimism/synthetix_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/synthetix/optimism/synthetix_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/synthetix/optimism/synthetix_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/synthetix/optimism/synthetix_optimism_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/synthetix/optimism/synthetix_optimism_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/synthetix/optimism/synthetix_optimism_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/synthetix/optimism/synthetix_optimism_schema.yml diff --git a/models/_sector/perpetual/projects/synthetix/optimism/synthetix_v1_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/synthetix/optimism/synthetix_v1_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/synthetix/optimism/synthetix_v1_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/synthetix/optimism/synthetix_v1_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/synthetix/optimism/synthetix_v2_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/synthetix/optimism/synthetix_v2_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/synthetix/optimism/synthetix_v2_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/synthetix/optimism/synthetix_v2_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/synthetix/synthetix_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/synthetix/synthetix_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/synthetix/synthetix_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/synthetix/synthetix_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/synthetix/synthetix_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/synthetix/synthetix_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/synthetix/synthetix_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/synthetix/synthetix_schema.yml diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_add_margin.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_add_margin.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_add_margin.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_add_margin.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_asset_added.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_asset_added.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_asset_added.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_asset_added.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_close_position.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_close_position.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_close_position.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_close_position.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_contracts_positions.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_contracts_positions.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_contracts_positions.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_contracts_positions.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_fees_distributed.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_fees_distributed.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_fees_distributed.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_fees_distributed.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_limit_cancel.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_limit_cancel.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_limit_cancel.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_limit_cancel.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_limit_order.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_limit_order.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_limit_order.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_limit_order.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_liquidate_position.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_liquidate_position.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_liquidate_position.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_liquidate_position.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_modify_margin.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_modify_margin.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_modify_margin.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_modify_margin.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_open_position.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_open_position.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_open_position.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_open_position.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_close_position.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_close_position.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_close_position.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_close_position.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_fees_distributed.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_fees_distributed.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_fees_distributed.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_fees_distributed.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_limit_cancel.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_limit_cancel.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_limit_cancel.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_limit_cancel.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_limit_order.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_limit_order.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_limit_order.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_limit_order.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_open_position.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_open_position.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_open_position.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_options_open_position.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/events/tigris_arbitrum_events_schema.yml diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_close.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_close.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_close.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_close.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_leverage.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_leverage.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_leverage.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_leverage.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_liquidation.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_liquidation.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_liquidation.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_liquidation.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_margin.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_margin.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_margin.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_margin.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/positions/tigris_arbitrum_positions_schema.yml diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_options_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_options_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_options_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_options_trades.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_schema.yml diff --git a/models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/arbitrum/tigris_arbitrum_trades.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_add_margin.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_add_margin.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_add_margin.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_add_margin.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_asset_added.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_asset_added.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_asset_added.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_asset_added.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_close_position.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_close_position.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_close_position.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_close_position.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_contracts_positions.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_contracts_positions.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_contracts_positions.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_contracts_positions.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_fees_distributed.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_fees_distributed.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_fees_distributed.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_fees_distributed.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_limit_cancel.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_limit_cancel.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_limit_cancel.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_limit_cancel.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_limit_order.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_limit_order.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_limit_order.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_limit_order.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_liquidate_position.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_liquidate_position.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_liquidate_position.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_liquidate_position.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_modify_margin.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_modify_margin.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_modify_margin.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_modify_margin.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_open_position.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_open_position.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_open_position.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_open_position.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_close_position.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_close_position.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_close_position.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_close_position.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_fees_distributed.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_fees_distributed.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_fees_distributed.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_fees_distributed.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_limit_cancel.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_limit_cancel.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_limit_cancel.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_limit_cancel.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_limit_order.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_limit_order.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_limit_order.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_limit_order.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_open_position.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_open_position.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_open_position.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_options_open_position.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/events/tigris_polygon_events_schema.yml diff --git a/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_close.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_close.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_close.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_close.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_leverage.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_leverage.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_leverage.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_leverage.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_liquidation.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_liquidation.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_liquidation.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_liquidation.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_margin.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_margin.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_margin.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_margin.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/positions/tigris_polygon_positions_schema.yml diff --git a/models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_options_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_options_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_options_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_options_trades.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_schema.yml diff --git a/models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/polygon/tigris_polygon_trades.sql diff --git a/models/_sector/perpetual/projects/tigris/tigris_options_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/tigris_options_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/tigris_options_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/tigris_options_trades.sql diff --git a/models/_sector/perpetual/projects/tigris/tigris_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/tigris_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/tigris_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/tigris_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/tigris/tigris_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/tigris_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/tigris_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/tigris_trades.sql diff --git a/models/_sector/perpetual/projects/tigris/tigris_trades_pnl.sql b/hourly_spellbook/models/_sector/perpetual/projects/tigris/tigris_trades_pnl.sql similarity index 100% rename from models/_sector/perpetual/projects/tigris/tigris_trades_pnl.sql rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/tigris_trades_pnl.sql diff --git a/models/_sector/perpetual/projects/tigris/tigris_trades_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/tigris/tigris_trades_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/tigris/tigris_trades_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/tigris/tigris_trades_schema.yml diff --git a/models/_sector/perpetual/projects/unidex/optimism/unidex_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/unidex/optimism/unidex_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/unidex/optimism/unidex_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/unidex/optimism/unidex_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/unidex/optimism/unidex_optimism_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/unidex/optimism/unidex_optimism_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/unidex/optimism/unidex_optimism_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/unidex/optimism/unidex_optimism_schema.yml diff --git a/models/_sector/perpetual/projects/unidex/optimism/unidex_v1_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/unidex/optimism/unidex_v1_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/unidex/optimism/unidex_v1_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/unidex/optimism/unidex_v1_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/unidex/optimism/unidex_v2_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/unidex/optimism/unidex_v2_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/unidex/optimism/unidex_v2_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/unidex/optimism/unidex_v2_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/unidex/optimism/unidex_v3_optimism_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/unidex/optimism/unidex_v3_optimism_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/unidex/optimism/unidex_v3_optimism_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/unidex/optimism/unidex_v3_optimism_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/unidex/unidex_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/unidex/unidex_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/unidex/unidex_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/unidex/unidex_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/unidex/unidex_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/unidex/unidex_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/unidex/unidex_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/unidex/unidex_schema.yml diff --git a/models/_sector/perpetual/projects/vela_exchange/arbitrum/vela_exchange_arbitrum_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/vela_exchange/arbitrum/vela_exchange_arbitrum_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/vela_exchange/arbitrum/vela_exchange_arbitrum_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/vela_exchange/arbitrum/vela_exchange_arbitrum_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/vela_exchange/arbitrum/vela_exchange_arbitrum_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/vela_exchange/arbitrum/vela_exchange_arbitrum_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/vela_exchange/arbitrum/vela_exchange_arbitrum_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/vela_exchange/arbitrum/vela_exchange_arbitrum_schema.yml diff --git a/models/_sector/perpetual/projects/vela_exchange/base/vela_exchange_base_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/vela_exchange/base/vela_exchange_base_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/vela_exchange/base/vela_exchange_base_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/vela_exchange/base/vela_exchange_base_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/vela_exchange/base/vela_exchange_base_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/vela_exchange/base/vela_exchange_base_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/vela_exchange/base/vela_exchange_base_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/vela_exchange/base/vela_exchange_base_schema.yml diff --git a/models/_sector/perpetual/projects/vela_exchange/vela_exchange_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/vela_exchange/vela_exchange_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/vela_exchange/vela_exchange_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/vela_exchange/vela_exchange_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/vela_exchange/vela_exchange_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/vela_exchange/vela_exchange_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/vela_exchange/vela_exchange_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/vela_exchange/vela_exchange_schema.yml diff --git a/models/_sector/perpetual/projects/voodoo_trade/base/voodoo_trade_base_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/voodoo_trade/base/voodoo_trade_base_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/voodoo_trade/base/voodoo_trade_base_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/voodoo_trade/base/voodoo_trade_base_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/voodoo_trade/base/voodoo_trade_base_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/voodoo_trade/base/voodoo_trade_base_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/voodoo_trade/base/voodoo_trade_base_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/voodoo_trade/base/voodoo_trade_base_schema.yml diff --git a/models/_sector/perpetual/projects/voodoo_trade/base/voodoo_trade_base_sources.yml b/hourly_spellbook/models/_sector/perpetual/projects/voodoo_trade/base/voodoo_trade_base_sources.yml similarity index 100% rename from models/_sector/perpetual/projects/voodoo_trade/base/voodoo_trade_base_sources.yml rename to hourly_spellbook/models/_sector/perpetual/projects/voodoo_trade/base/voodoo_trade_base_sources.yml diff --git a/models/_sector/perpetual/projects/xena_finance/base/xena_finance_base_perpetual_trades.sql b/hourly_spellbook/models/_sector/perpetual/projects/xena_finance/base/xena_finance_base_perpetual_trades.sql similarity index 100% rename from models/_sector/perpetual/projects/xena_finance/base/xena_finance_base_perpetual_trades.sql rename to hourly_spellbook/models/_sector/perpetual/projects/xena_finance/base/xena_finance_base_perpetual_trades.sql diff --git a/models/_sector/perpetual/projects/xena_finance/base/xena_finance_base_schema.yml b/hourly_spellbook/models/_sector/perpetual/projects/xena_finance/base/xena_finance_base_schema.yml similarity index 100% rename from models/_sector/perpetual/projects/xena_finance/base/xena_finance_base_schema.yml rename to hourly_spellbook/models/_sector/perpetual/projects/xena_finance/base/xena_finance_base_schema.yml diff --git a/models/_sector/perpetual/projects/xena_finance/base/xena_finance_base_sources.yml b/hourly_spellbook/models/_sector/perpetual/projects/xena_finance/base/xena_finance_base_sources.yml similarity index 100% rename from models/_sector/perpetual/projects/xena_finance/base/xena_finance_base_sources.yml rename to hourly_spellbook/models/_sector/perpetual/projects/xena_finance/base/xena_finance_base_sources.yml diff --git a/models/prices/prices_schema.yml b/hourly_spellbook/models/_sector/prices/prices_schema.yml similarity index 57% rename from models/prices/prices_schema.yml rename to hourly_spellbook/models/_sector/prices/prices_schema.yml index 43cfc78274b..fe91722adaf 100644 --- a/models/prices/prices_schema.yml +++ b/hourly_spellbook/models/_sector/prices/prices_schema.yml @@ -1,54 +1,6 @@ version: 2 models: - - name: prices_tokens - meta: - blockchain: arbitrum, avalanche_c, gnosis, polygon, optimism, ethereum, bnb, solana, fantom, celo, base, zksync, zora, linea, zkevm, blast, sei - sector: prices - contributors: aalan3, hildobby, pipistrella, viniabussafi, jeff-dude - config: - tags: ['prices', 'tokens', 'usd'] - description: "Price tokens" - columns: - - &token_id - name: token_id - description: "Id of the token at coinpaprika. This id is required to pull the price feed data. NOTE: Not all tokens are listed at coinpaprika - consider using price data from DEX sources in this case or submit a listing request at coinpaprika." - - &blockchain - name: blockchain - description: "Native blockchain of the token, if any" - - &contract_address - name: contract_address - description: "Contract address of the token, if any" - tests: - - not_zero_address - - &symbol - name: symbol - description: "Token symbol" - - &decimals - name: decimals - description: "Number of decimals for the token contract" - - - name: prices_native_tokens - meta: - blockchain: arbitrum, avalanche_c, gnosis, polygon, optimism, ethereum, bnb, solana, fantom, celo, zksync, zora, sei - sector: prices - contributors: aalan3, jeff-dude - config: - tags: ['prices', 'tokens', 'usd'] - description: "Price tokens for native tokens for all chains" - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - blockchain - - contract_address - - symbol - columns: - - *token_id - - *blockchain - - *contract_address - - *symbol - - *decimals - - name: prices_usd_latest meta: sector: prices @@ -111,26 +63,6 @@ models: description: "USD price of a token" test: not_null - - name: prices_trusted_tokens - meta: - sector: prices - contributors: hosuke - config: - tags: [ 'prices', 'stability' ] - description: "List of trusted tokens across blockchains" - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - blockchain - - contract_address - columns: - - name: blockchain - description: "Native blockchain of the token" - - name: symbol - description: "Token symbol" - - name: contract_address - description: "Contract address of the token" - - name: prices_usd_daily meta: sector: prices diff --git a/models/prices/prices_usd_daily.sql b/hourly_spellbook/models/_sector/prices/prices_usd_daily.sql similarity index 100% rename from models/prices/prices_usd_daily.sql rename to hourly_spellbook/models/_sector/prices/prices_usd_daily.sql diff --git a/models/prices/prices_usd_forward_fill.sql b/hourly_spellbook/models/_sector/prices/prices_usd_forward_fill.sql similarity index 100% rename from models/prices/prices_usd_forward_fill.sql rename to hourly_spellbook/models/_sector/prices/prices_usd_forward_fill.sql diff --git a/models/prices/prices_usd_latest.sql b/hourly_spellbook/models/_sector/prices/prices_usd_latest.sql similarity index 100% rename from models/prices/prices_usd_latest.sql rename to hourly_spellbook/models/_sector/prices/prices_usd_latest.sql diff --git a/models/prices/prices_usd_latest_historical.sql b/hourly_spellbook/models/_sector/prices/prices_usd_latest_historical.sql similarity index 100% rename from models/prices/prices_usd_latest_historical.sql rename to hourly_spellbook/models/_sector/prices/prices_usd_latest_historical.sql diff --git a/models/prices/prices_usd_monitor.sql b/hourly_spellbook/models/_sector/prices/prices_usd_monitor.sql similarity index 100% rename from models/prices/prices_usd_monitor.sql rename to hourly_spellbook/models/_sector/prices/prices_usd_monitor.sql diff --git a/models/rollup_economics/ethereum/l1_blob_fees.sql b/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_blob_fees.sql similarity index 100% rename from models/rollup_economics/ethereum/l1_blob_fees.sql rename to hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_blob_fees.sql diff --git a/models/rollup_economics/ethereum/l1_data_fees.sql b/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees.sql similarity index 96% rename from models/rollup_economics/ethereum/l1_data_fees.sql rename to hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees.sql index e640c67fc34..1a2e609ee61 100644 --- a/models/rollup_economics/ethereum/l1_data_fees.sql +++ b/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_data_fees.sql @@ -1,6 +1,6 @@ {{ config( schema = 'rollup_economics_ethereum', - alias = 'l1_data_fees', + alias = 'l1_data_fees', materialized = 'incremental', file_format = 'delta', incremental_strategy = 'merge', @@ -41,7 +41,7 @@ with tx_batch_appends as ( call_block_number as block_number FROM {{ source('arbitrum_ethereum','SequencerInbox_call_addSequencerL2BatchFromOrigin') }} o WHERE call_success = true - AND call_tx_hash NOT IN + AND call_tx_hash NOT IN ( SELECT evt_tx_hash FROM {{ source('arbitrum_ethereum', 'SequencerInbox_evt_SequencerBatchDeliveredFromOrigin') }} o WHERE evt_block_time >= timestamp '2022-01-01' @@ -86,7 +86,7 @@ with tx_batch_appends as ( UNION ALL - SELECT + SELECT hash as tx_hash, block_time, block_number @@ -115,8 +115,8 @@ with tx_batch_appends as ( AND p.minute >= date_trunc('day', now() - interval '7' day) {% endif %} - UNION ALL - + UNION ALL + SELECT lower(protocol_name) as name, block_number, @@ -129,14 +129,14 @@ with tx_batch_appends as ( FROM ( SELECT protocol_name, t.block_time, t.block_number, t.hash, t.gas_used, t.gas_price, length(t.data) as data_length, {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used FROM {{ source('ethereum','transactions') }} as t - INNER JOIN {{ ref('addresses_ethereum_optimism_batchinbox_combinations') }} as op + INNER JOIN {{ source('addresses_ethereum','optimism_batchinbox_combinations') }} as op ON t."from" = op.l1_batch_inbox_from_address AND t.to = op.l1_batch_inbox_to_address WHERE t.block_time >= timestamp '2020-01-01' UNION ALL SELECT protocol_name, t.block_time, t.block_number, t.hash, t.gas_used, t.gas_price, length(t.data) as data_length, {{ evm_get_calldata_gas_from_data('t.data') }} AS calldata_gas_used FROM {{ source('ethereum','transactions') }} as t - INNER JOIN {{ ref('addresses_ethereum_optimism_outputoracle_combinations') }} as op + INNER JOIN {{ source('addresses_ethereum','optimism_outputoracle_combinations') }} as op ON t."from" = op.l2_output_oracle_from_address AND t.to = op.l2_output_oracle_to_address WHERE t.block_time >= timestamp '2020-01-01' @@ -153,8 +153,8 @@ with tx_batch_appends as ( WHERE b.block_time >= date_trunc('day', now() - interval '7' day) {% endif %} - UNION ALL - + UNION ALL + SELECT 'starknet' AS chain, t.block_number, @@ -181,8 +181,8 @@ with tx_batch_appends as ( AND t.block_time >= date_trunc('day', now() - interval '7' day) {% endif %} - UNION ALL - + UNION ALL + SELECT 'imx' AS chain, -- imx state updates to L1 through the Data Availability Committee, imx uses offchain DA t.block_number, @@ -209,8 +209,8 @@ with tx_batch_appends as ( AND t.block_time >= date_trunc('day', now() - interval '7' day) {% endif %} - UNION ALL - + UNION ALL + SELECT 'zksync lite' AS name, t.block_number, @@ -241,8 +241,8 @@ with tx_batch_appends as ( AND t.block_time >= date_trunc('day', now() - interval '7' day) {% endif %} - UNION ALL - + UNION ALL + SELECT 'zksync era' AS chain, t.block_number, @@ -284,8 +284,8 @@ with tx_batch_appends as ( AND t.block_time >= date_trunc('day', now() - interval '7' day) {% endif %} - UNION ALL - + UNION ALL + SELECT 'polygon zkevm' AS chain, t.block_number, @@ -303,9 +303,9 @@ with tx_batch_appends as ( {% if is_incremental() %} AND p.minute >= date_trunc('day', now() - interval '7' day) {% endif %} - WHERE + WHERE ( - t.to = 0x5132a183e9f3cb7c848b0aac5ae0c4f0491b7ab2 -- old proxy + t.to = 0x5132a183e9f3cb7c848b0aac5ae0c4f0491b7ab2 -- old proxy OR t.to = 0x519E42c24163192Dca44CD3fBDCEBF6be9130987 -- new proxy (as of block 19218878) ) AND bytearray_substring(t.data, 1, 4) IN ( @@ -318,8 +318,8 @@ with tx_batch_appends as ( AND t.block_time >= date_trunc('day', now() - interval '7' day) {% endif %} - UNION ALL - + UNION ALL + SELECT 'linea' AS chain, t.block_number, @@ -347,8 +347,8 @@ with tx_batch_appends as ( AND t.block_time >= date_trunc('day', now() - interval '7' day) {% endif %} - UNION ALL - + UNION ALL + SELECT 'scroll' AS chain, t.block_number, @@ -373,8 +373,8 @@ with tx_batch_appends as ( AND t.block_time >= date_trunc('day', now() - interval '7' day) {% endif %} - UNION ALL - + UNION ALL + SELECT 'loopring' AS chain, t.block_number, @@ -394,13 +394,13 @@ with tx_batch_appends as ( {% endif %} WHERE t.to = 0x153CdDD727e407Cb951f728F24bEB9A5FaaA8512 AND bytearray_substring(t.data, 1, 4) = 0xdcb2aa31 -- submitBlocksWithCallbacks (proof verified immediately) - AND t.block_time >= timestamp '2021-03-23' + AND t.block_time >= timestamp '2021-03-23' {% if is_incremental() %} AND t.block_time >= date_trunc('day', now() - interval '7' day) {% endif %} - UNION ALL - + UNION ALL + SELECT 'Mantle' AS chain, t.block_number, @@ -432,14 +432,14 @@ with tx_batch_appends as ( OR bytearray_substring(t.data, 1, 4) = 0x58942e73 -- confirmDataStore (DA2) OR bytearray_substring(t.data, 1, 4) = 0xdcf49ea7 -- initDataStore (DA2) ) - AND t.block_time >= timestamp '2023-06-27' + AND t.block_time >= timestamp '2023-06-27' {% if is_incremental() %} AND t.block_time >= date_trunc('day', now() - interval '7' day) {% endif %} ) ,block_basefees as ( - SELECT + SELECT b.number as block_number , b.base_fee_per_gas , b.time diff --git a/models/rollup_economics/ethereum/l1_fees.sql b/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_fees.sql similarity index 100% rename from models/rollup_economics/ethereum/l1_fees.sql rename to hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_fees.sql diff --git a/models/rollup_economics/ethereum/l1_verification_fees.sql b/hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees.sql similarity index 100% rename from models/rollup_economics/ethereum/l1_verification_fees.sql rename to hourly_spellbook/models/_sector/rollup_economics/ethereum/l1_verification_fees.sql diff --git a/models/rollup_economics/ethereum/l2_revenue.sql b/hourly_spellbook/models/_sector/rollup_economics/ethereum/l2_revenue.sql similarity index 100% rename from models/rollup_economics/ethereum/l2_revenue.sql rename to hourly_spellbook/models/_sector/rollup_economics/ethereum/l2_revenue.sql diff --git a/models/rollup_economics/ethereum/rollup_economics_ethereum_schema.yml b/hourly_spellbook/models/_sector/rollup_economics/ethereum/rollup_economics_ethereum_schema.yml similarity index 100% rename from models/rollup_economics/ethereum/rollup_economics_ethereum_schema.yml rename to hourly_spellbook/models/_sector/rollup_economics/ethereum/rollup_economics_ethereum_schema.yml diff --git a/models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_binance.sql b/hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_binance.sql similarity index 100% rename from models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_binance.sql rename to hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_binance.sql diff --git a/models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_bitcoin_suisse.sql b/hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_bitcoin_suisse.sql similarity index 100% rename from models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_bitcoin_suisse.sql rename to hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_bitcoin_suisse.sql diff --git a/models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_chorusone.sql b/hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_chorusone.sql similarity index 100% rename from models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_chorusone.sql rename to hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_chorusone.sql diff --git a/models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_coinbase.sql b/hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_coinbase.sql similarity index 89% rename from models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_coinbase.sql rename to hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_coinbase.sql index bf491cb4dd7..850255af005 100644 --- a/models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_coinbase.sql +++ b/hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_coinbase.sql @@ -18,7 +18,7 @@ FROM ( , et.block_time FROM {{ source('ethereum', 'traces') }} et INNER JOIN {{ source('ethereum', 'traces') }} et2 ON et2."from"=et."from" - AND et2.to IN (SELECT address FROM {{ ref('cex_ethereum_addresses') }} WHERE cex_name = 'Coinbase') + AND et2.to IN (SELECT address FROM {{ source('cex', 'addresses') }} WHERE blockchain = 'ethereum' AND cex_name = 'Coinbase') {% if not is_incremental() %} AND et2.block_time >= DATE'2020-10-14' {% endif %} @@ -36,4 +36,4 @@ FROM ( AND et."from" != 0x1ef753934c40a72a60eab12a68b6f8854439aa78 GROUP BY et."from", et.block_time ) coinbase -GROUP BY coinbase.address \ No newline at end of file +GROUP BY coinbase.address diff --git a/models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_darma_capital.sql b/hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_darma_capital.sql similarity index 100% rename from models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_darma_capital.sql rename to hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_darma_capital.sql diff --git a/models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_stakewise_v3.sql b/hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_stakewise_v3.sql similarity index 100% rename from models/staking/ethereum/entities/entity_specific/staking_ethereum_entities_stakewise_v3.sql rename to hourly_spellbook/models/_sector/staking/ethereum/entities/entity_specific/staking_ethereum_entities_stakewise_v3.sql diff --git a/models/staking/ethereum/entities/staking_ethereum_entities_batch_contracts_pubkey.sql b/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_batch_contracts_pubkey.sql similarity index 100% rename from models/staking/ethereum/entities/staking_ethereum_entities_batch_contracts_pubkey.sql rename to hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_batch_contracts_pubkey.sql diff --git a/models/staking/ethereum/entities/staking_ethereum_entities_batch_contracts_tx_from.sql b/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_batch_contracts_tx_from.sql similarity index 100% rename from models/staking/ethereum/entities/staking_ethereum_entities_batch_contracts_tx_from.sql rename to hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_batch_contracts_tx_from.sql diff --git a/models/staking/ethereum/entities/staking_ethereum_entities_contracts.sql b/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_contracts.sql similarity index 100% rename from models/staking/ethereum/entities/staking_ethereum_entities_contracts.sql rename to hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_contracts.sql diff --git a/models/staking/ethereum/entities/staking_ethereum_entities_depositor_addresses.sql b/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_depositor_addresses.sql similarity index 100% rename from models/staking/ethereum/entities/staking_ethereum_entities_depositor_addresses.sql rename to hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_depositor_addresses.sql diff --git a/models/staking/ethereum/entities/staking_ethereum_entities_schema.yml b/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_schema.yml similarity index 100% rename from models/staking/ethereum/entities/staking_ethereum_entities_schema.yml rename to hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_schema.yml diff --git a/models/staking/ethereum/entities/staking_ethereum_entities_tx_from_addresses.sql b/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_tx_from_addresses.sql similarity index 100% rename from models/staking/ethereum/entities/staking_ethereum_entities_tx_from_addresses.sql rename to hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_tx_from_addresses.sql diff --git a/models/staking/ethereum/entities/staking_ethereum_entities_withdrawal_credentials.sql b/hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_withdrawal_credentials.sql similarity index 100% rename from models/staking/ethereum/entities/staking_ethereum_entities_withdrawal_credentials.sql rename to hourly_spellbook/models/_sector/staking/ethereum/entities/staking_ethereum_entities_withdrawal_credentials.sql diff --git a/models/staking/ethereum/staking_ethereum_deposits.sql b/hourly_spellbook/models/_sector/staking/ethereum/staking_ethereum_deposits.sql similarity index 100% rename from models/staking/ethereum/staking_ethereum_deposits.sql rename to hourly_spellbook/models/_sector/staking/ethereum/staking_ethereum_deposits.sql diff --git a/models/staking/ethereum/staking_ethereum_entities.sql b/hourly_spellbook/models/_sector/staking/ethereum/staking_ethereum_entities.sql similarity index 100% rename from models/staking/ethereum/staking_ethereum_entities.sql rename to hourly_spellbook/models/_sector/staking/ethereum/staking_ethereum_entities.sql diff --git a/models/staking/ethereum/staking_ethereum_flows.sql b/hourly_spellbook/models/_sector/staking/ethereum/staking_ethereum_flows.sql similarity index 100% rename from models/staking/ethereum/staking_ethereum_flows.sql rename to hourly_spellbook/models/_sector/staking/ethereum/staking_ethereum_flows.sql diff --git a/models/staking/ethereum/staking_ethereum_info.sql b/hourly_spellbook/models/_sector/staking/ethereum/staking_ethereum_info.sql similarity index 100% rename from models/staking/ethereum/staking_ethereum_info.sql rename to hourly_spellbook/models/_sector/staking/ethereum/staking_ethereum_info.sql diff --git a/models/staking/ethereum/staking_ethereum_schema.yml b/hourly_spellbook/models/_sector/staking/ethereum/staking_ethereum_schema.yml similarity index 100% rename from models/staking/ethereum/staking_ethereum_schema.yml rename to hourly_spellbook/models/_sector/staking/ethereum/staking_ethereum_schema.yml diff --git a/hourly_spellbook/package-lock.yml b/hourly_spellbook/package-lock.yml new file mode 100644 index 00000000000..c0962720778 --- /dev/null +++ b/hourly_spellbook/package-lock.yml @@ -0,0 +1,4 @@ +packages: +- package: dbt-labs/dbt_utils + version: 1.1.1 +sha1_hash: 23451c207c1d4dd71b5925f12a5cd66f2ebb2b3b diff --git a/hourly_spellbook/packages.yml b/hourly_spellbook/packages.yml new file mode 100644 index 00000000000..6152b330974 --- /dev/null +++ b/hourly_spellbook/packages.yml @@ -0,0 +1,3 @@ +packages: + - package: dbt-labs/dbt_utils + version: 1.1.1 \ No newline at end of file diff --git a/hourly_spellbook/profiles.yml b/hourly_spellbook/profiles.yml new file mode 100644 index 00000000000..10d52bd460f --- /dev/null +++ b/hourly_spellbook/profiles.yml @@ -0,0 +1,12 @@ +spellbook-local: + target: dev + outputs: + dev: + type: trino + user: trino + password: trino + host: trino + port: 1234 + database: hive + schema: wizard + threads: 1 \ No newline at end of file diff --git a/seeds/_sector/account_abstraction/erc4337/_schema.yml b/hourly_spellbook/seeds/_sector/account_abstraction/erc4337/_schema.yml similarity index 100% rename from seeds/_sector/account_abstraction/erc4337/_schema.yml rename to hourly_spellbook/seeds/_sector/account_abstraction/erc4337/_schema.yml diff --git a/seeds/_sector/account_abstraction/erc4337/account_abstraction_erc4337_account_deployed_seed.csv b/hourly_spellbook/seeds/_sector/account_abstraction/erc4337/account_abstraction_erc4337_account_deployed_seed.csv similarity index 100% rename from seeds/_sector/account_abstraction/erc4337/account_abstraction_erc4337_account_deployed_seed.csv rename to hourly_spellbook/seeds/_sector/account_abstraction/erc4337/account_abstraction_erc4337_account_deployed_seed.csv diff --git a/seeds/_sector/account_abstraction/erc4337/account_abstraction_erc4337_userops_seed.csv b/hourly_spellbook/seeds/_sector/account_abstraction/erc4337/account_abstraction_erc4337_userops_seed.csv similarity index 100% rename from seeds/_sector/account_abstraction/erc4337/account_abstraction_erc4337_userops_seed.csv rename to hourly_spellbook/seeds/_sector/account_abstraction/erc4337/account_abstraction_erc4337_userops_seed.csv diff --git a/seeds/_sector/lending/_schema.yml b/hourly_spellbook/seeds/_sector/lending/_schema.yml similarity index 100% rename from seeds/_sector/lending/_schema.yml rename to hourly_spellbook/seeds/_sector/lending/_schema.yml diff --git a/seeds/_sector/lending/aave_arbitrum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_arbitrum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_arbitrum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_arbitrum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/aave_arbitrum_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_arbitrum_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_arbitrum_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_arbitrum_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/aave_arbitrum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_arbitrum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_arbitrum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_arbitrum_base_supply_seed.csv diff --git a/seeds/_sector/lending/aave_avalanche_c_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_avalanche_c_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_avalanche_c_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_avalanche_c_base_borrow_seed.csv diff --git a/seeds/_sector/lending/aave_avalanche_c_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_avalanche_c_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_avalanche_c_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_avalanche_c_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/aave_avalanche_c_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_avalanche_c_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_avalanche_c_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_avalanche_c_base_supply_seed.csv diff --git a/seeds/_sector/lending/aave_base_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_base_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_base_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_base_base_borrow_seed.csv diff --git a/seeds/_sector/lending/aave_base_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_base_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_base_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_base_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/aave_base_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_base_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_base_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_base_base_supply_seed.csv diff --git a/seeds/_sector/lending/aave_bnb_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_bnb_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_bnb_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_bnb_base_borrow_seed.csv diff --git a/seeds/_sector/lending/aave_bnb_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_bnb_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_bnb_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_bnb_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/aave_bnb_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_bnb_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_bnb_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_bnb_base_supply_seed.csv diff --git a/seeds/_sector/lending/aave_ethereum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_ethereum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_ethereum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_ethereum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/aave_ethereum_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_ethereum_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_ethereum_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_ethereum_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/aave_ethereum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_ethereum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_ethereum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_ethereum_base_supply_seed.csv diff --git a/seeds/_sector/lending/aave_fantom_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_fantom_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_fantom_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_fantom_base_borrow_seed.csv diff --git a/seeds/_sector/lending/aave_fantom_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_fantom_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_fantom_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_fantom_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/aave_fantom_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_fantom_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_fantom_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_fantom_base_supply_seed.csv diff --git a/seeds/_sector/lending/aave_gnosis_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_gnosis_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_gnosis_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_gnosis_base_borrow_seed.csv diff --git a/seeds/_sector/lending/aave_gnosis_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_gnosis_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_gnosis_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_gnosis_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/aave_gnosis_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_gnosis_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_gnosis_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_gnosis_base_supply_seed.csv diff --git a/seeds/_sector/lending/aave_optimism_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_optimism_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_optimism_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_optimism_base_borrow_seed.csv diff --git a/seeds/_sector/lending/aave_optimism_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_optimism_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_optimism_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_optimism_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/aave_optimism_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_optimism_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_optimism_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_optimism_base_supply_seed.csv diff --git a/seeds/_sector/lending/aave_polygon_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_polygon_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_polygon_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_polygon_base_borrow_seed.csv diff --git a/seeds/_sector/lending/aave_polygon_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_polygon_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_polygon_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_polygon_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/aave_polygon_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_polygon_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_polygon_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_polygon_base_supply_seed.csv diff --git a/seeds/_sector/lending/aave_scroll_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_scroll_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_scroll_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_scroll_base_borrow_seed.csv diff --git a/seeds/_sector/lending/aave_scroll_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_scroll_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_scroll_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_scroll_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/aave_scroll_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/aave_scroll_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/aave_scroll_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/aave_scroll_base_supply_seed.csv diff --git a/seeds/_sector/lending/agave_gnosis_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/agave_gnosis_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/agave_gnosis_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/agave_gnosis_base_borrow_seed.csv diff --git a/seeds/_sector/lending/agave_gnosis_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/agave_gnosis_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/agave_gnosis_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/agave_gnosis_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/agave_gnosis_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/agave_gnosis_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/agave_gnosis_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/agave_gnosis_base_supply_seed.csv diff --git a/seeds/_sector/lending/benqi_avalanche_c_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/benqi_avalanche_c_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/benqi_avalanche_c_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/benqi_avalanche_c_base_borrow_seed.csv diff --git a/seeds/_sector/lending/benqi_avalanche_c_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/benqi_avalanche_c_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/benqi_avalanche_c_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/benqi_avalanche_c_base_supply_seed.csv diff --git a/seeds/_sector/lending/compound_arbitrum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/compound_arbitrum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/compound_arbitrum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/compound_arbitrum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/compound_arbitrum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/compound_arbitrum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/compound_arbitrum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/compound_arbitrum_base_supply_seed.csv diff --git a/seeds/_sector/lending/compound_base_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/compound_base_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/compound_base_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/compound_base_base_borrow_seed.csv diff --git a/seeds/_sector/lending/compound_base_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/compound_base_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/compound_base_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/compound_base_base_supply_seed.csv diff --git a/seeds/_sector/lending/compound_ethereum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/compound_ethereum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/compound_ethereum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/compound_ethereum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/compound_ethereum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/compound_ethereum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/compound_ethereum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/compound_ethereum_base_supply_seed.csv diff --git a/seeds/_sector/lending/compound_polygon_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/compound_polygon_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/compound_polygon_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/compound_polygon_base_borrow_seed.csv diff --git a/seeds/_sector/lending/compound_polygon_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/compound_polygon_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/compound_polygon_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/compound_polygon_base_supply_seed.csv diff --git a/seeds/_sector/lending/fluxfinance_ethereum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/fluxfinance_ethereum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/fluxfinance_ethereum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/fluxfinance_ethereum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/fluxfinance_ethereum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/fluxfinance_ethereum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/fluxfinance_ethereum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/fluxfinance_ethereum_base_supply_seed.csv diff --git a/seeds/_sector/lending/granary_arbitrum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_arbitrum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_arbitrum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_arbitrum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/granary_arbitrum_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_arbitrum_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_arbitrum_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_arbitrum_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/granary_arbitrum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_arbitrum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_arbitrum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_arbitrum_base_supply_seed.csv diff --git a/seeds/_sector/lending/granary_avalanche_c_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_avalanche_c_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_avalanche_c_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_avalanche_c_base_borrow_seed.csv diff --git a/seeds/_sector/lending/granary_avalanche_c_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_avalanche_c_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_avalanche_c_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_avalanche_c_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/granary_avalanche_c_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_avalanche_c_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_avalanche_c_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_avalanche_c_base_supply_seed.csv diff --git a/seeds/_sector/lending/granary_base_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_base_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_base_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_base_base_borrow_seed.csv diff --git a/seeds/_sector/lending/granary_base_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_base_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_base_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_base_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/granary_base_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_base_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_base_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_base_base_supply_seed.csv diff --git a/seeds/_sector/lending/granary_bnb_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_bnb_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_bnb_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_bnb_base_borrow_seed.csv diff --git a/seeds/_sector/lending/granary_bnb_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_bnb_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_bnb_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_bnb_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/granary_bnb_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_bnb_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_bnb_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_bnb_base_supply_seed.csv diff --git a/seeds/_sector/lending/granary_ethereum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_ethereum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_ethereum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_ethereum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/granary_ethereum_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_ethereum_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_ethereum_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_ethereum_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/granary_ethereum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_ethereum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_ethereum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_ethereum_base_supply_seed.csv diff --git a/seeds/_sector/lending/granary_fantom_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_fantom_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_fantom_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_fantom_base_borrow_seed.csv diff --git a/seeds/_sector/lending/granary_fantom_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_fantom_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_fantom_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_fantom_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/granary_fantom_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_fantom_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_fantom_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_fantom_base_supply_seed.csv diff --git a/seeds/_sector/lending/granary_optimism_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_optimism_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_optimism_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_optimism_base_borrow_seed.csv diff --git a/seeds/_sector/lending/granary_optimism_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_optimism_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_optimism_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_optimism_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/granary_optimism_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/granary_optimism_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/granary_optimism_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/granary_optimism_base_supply_seed.csv diff --git a/seeds/_sector/lending/layer_bank_scroll_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/layer_bank_scroll_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/layer_bank_scroll_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/layer_bank_scroll_base_borrow_seed.csv diff --git a/seeds/_sector/lending/layer_bank_scroll_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/layer_bank_scroll_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/layer_bank_scroll_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/layer_bank_scroll_base_supply_seed.csv diff --git a/seeds/_sector/lending/lodestar_arbitrum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/lodestar_arbitrum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/lodestar_arbitrum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/lodestar_arbitrum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/lodestar_arbitrum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/lodestar_arbitrum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/lodestar_arbitrum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/lodestar_arbitrum_base_supply_seed.csv diff --git a/seeds/_sector/lending/moola_celo_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/moola_celo_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/moola_celo_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/moola_celo_base_borrow_seed.csv diff --git a/seeds/_sector/lending/moola_celo_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/moola_celo_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/moola_celo_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/moola_celo_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/moola_celo_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/moola_celo_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/moola_celo_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/moola_celo_base_supply_seed.csv diff --git a/seeds/_sector/lending/moonwell_base_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/moonwell_base_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/moonwell_base_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/moonwell_base_base_borrow_seed.csv diff --git a/seeds/_sector/lending/moonwell_base_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/moonwell_base_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/moonwell_base_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/moonwell_base_base_supply_seed.csv diff --git a/seeds/_sector/lending/radiant_arbitrum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/radiant_arbitrum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/radiant_arbitrum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/radiant_arbitrum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/radiant_arbitrum_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/radiant_arbitrum_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/radiant_arbitrum_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/radiant_arbitrum_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/radiant_arbitrum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/radiant_arbitrum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/radiant_arbitrum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/radiant_arbitrum_base_supply_seed.csv diff --git a/seeds/_sector/lending/radiant_bnb_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/radiant_bnb_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/radiant_bnb_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/radiant_bnb_base_borrow_seed.csv diff --git a/seeds/_sector/lending/radiant_bnb_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/radiant_bnb_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/radiant_bnb_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/radiant_bnb_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/radiant_bnb_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/radiant_bnb_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/radiant_bnb_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/radiant_bnb_base_supply_seed.csv diff --git a/seeds/_sector/lending/radiant_ethereum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/radiant_ethereum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/radiant_ethereum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/radiant_ethereum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/radiant_ethereum_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/radiant_ethereum_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/radiant_ethereum_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/radiant_ethereum_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/radiant_ethereum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/radiant_ethereum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/radiant_ethereum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/radiant_ethereum_base_supply_seed.csv diff --git a/seeds/_sector/lending/realt_rmm_gnosis_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/realt_rmm_gnosis_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/realt_rmm_gnosis_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/realt_rmm_gnosis_base_borrow_seed.csv diff --git a/seeds/_sector/lending/realt_rmm_gnosis_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/realt_rmm_gnosis_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/realt_rmm_gnosis_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/realt_rmm_gnosis_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/realt_rmm_gnosis_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/realt_rmm_gnosis_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/realt_rmm_gnosis_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/realt_rmm_gnosis_base_supply_seed.csv diff --git a/seeds/_sector/lending/seamlessprotocol_base_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/seamlessprotocol_base_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/seamlessprotocol_base_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/seamlessprotocol_base_base_borrow_seed.csv diff --git a/seeds/_sector/lending/seamlessprotocol_base_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/seamlessprotocol_base_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/seamlessprotocol_base_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/seamlessprotocol_base_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/seamlessprotocol_base_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/seamlessprotocol_base_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/seamlessprotocol_base_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/seamlessprotocol_base_base_supply_seed.csv diff --git a/seeds/_sector/lending/sonne_finance_base_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/sonne_finance_base_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/sonne_finance_base_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/sonne_finance_base_base_borrow_seed.csv diff --git a/seeds/_sector/lending/sonne_finance_base_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/sonne_finance_base_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/sonne_finance_base_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/sonne_finance_base_base_supply_seed.csv diff --git a/seeds/_sector/lending/sonne_finance_optimism_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/sonne_finance_optimism_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/sonne_finance_optimism_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/sonne_finance_optimism_base_borrow_seed.csv diff --git a/seeds/_sector/lending/sonne_finance_optimism_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/sonne_finance_optimism_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/sonne_finance_optimism_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/sonne_finance_optimism_base_supply_seed.csv diff --git a/seeds/_sector/lending/spark_ethereum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/spark_ethereum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/spark_ethereum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/spark_ethereum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/spark_ethereum_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/spark_ethereum_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/spark_ethereum_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/spark_ethereum_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/spark_ethereum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/spark_ethereum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/spark_ethereum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/spark_ethereum_base_supply_seed.csv diff --git a/seeds/_sector/lending/strike_ethereum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/strike_ethereum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/strike_ethereum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/strike_ethereum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/strike_ethereum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/strike_ethereum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/strike_ethereum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/strike_ethereum_base_supply_seed.csv diff --git a/seeds/_sector/lending/uwulend_ethereum_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/uwulend_ethereum_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/uwulend_ethereum_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/uwulend_ethereum_base_borrow_seed.csv diff --git a/seeds/_sector/lending/uwulend_ethereum_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/uwulend_ethereum_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/uwulend_ethereum_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/uwulend_ethereum_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/uwulend_ethereum_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/uwulend_ethereum_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/uwulend_ethereum_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/uwulend_ethereum_base_supply_seed.csv diff --git a/seeds/_sector/lending/zerolend_zksync_base_borrow_seed.csv b/hourly_spellbook/seeds/_sector/lending/zerolend_zksync_base_borrow_seed.csv similarity index 100% rename from seeds/_sector/lending/zerolend_zksync_base_borrow_seed.csv rename to hourly_spellbook/seeds/_sector/lending/zerolend_zksync_base_borrow_seed.csv diff --git a/seeds/_sector/lending/zerolend_zksync_base_flashloans_seed.csv b/hourly_spellbook/seeds/_sector/lending/zerolend_zksync_base_flashloans_seed.csv similarity index 100% rename from seeds/_sector/lending/zerolend_zksync_base_flashloans_seed.csv rename to hourly_spellbook/seeds/_sector/lending/zerolend_zksync_base_flashloans_seed.csv diff --git a/seeds/_sector/lending/zerolend_zksync_base_supply_seed.csv b/hourly_spellbook/seeds/_sector/lending/zerolend_zksync_base_supply_seed.csv similarity index 100% rename from seeds/_sector/lending/zerolend_zksync_base_supply_seed.csv rename to hourly_spellbook/seeds/_sector/lending/zerolend_zksync_base_supply_seed.csv diff --git a/seeds/perpetual/trades/_schema.yml b/hourly_spellbook/seeds/_sector/perpetual/trades/_schema.yml similarity index 100% rename from seeds/perpetual/trades/_schema.yml rename to hourly_spellbook/seeds/_sector/perpetual/trades/_schema.yml diff --git a/seeds/perpetual/trades/perpetual_trades_seed.csv b/hourly_spellbook/seeds/_sector/perpetual/trades/perpetual_trades_seed.csv similarity index 100% rename from seeds/perpetual/trades/perpetual_trades_seed.csv rename to hourly_spellbook/seeds/_sector/perpetual/trades/perpetual_trades_seed.csv diff --git a/tests/lido/ethereum/lido_ethereum_accounting_test.sql b/hourly_spellbook/tests/_project/lido/ethereum/lido_ethereum_accounting_test.sql similarity index 100% rename from tests/lido/ethereum/lido_ethereum_accounting_test.sql rename to hourly_spellbook/tests/_project/lido/ethereum/lido_ethereum_accounting_test.sql diff --git a/tests/lido/ethereum/lido_ethereum_liquidity_kyberswap_test.sql b/hourly_spellbook/tests/_project/lido/ethereum/lido_ethereum_liquidity_kyberswap_test.sql similarity index 100% rename from tests/lido/ethereum/lido_ethereum_liquidity_kyberswap_test.sql rename to hourly_spellbook/tests/_project/lido/ethereum/lido_ethereum_liquidity_kyberswap_test.sql diff --git a/tests/safe/arbitrum/safe_arbitrum_eth_transfers_test.sql b/hourly_spellbook/tests/_project/safe/arbitrum/safe_arbitrum_eth_transfers_test.sql similarity index 100% rename from tests/safe/arbitrum/safe_arbitrum_eth_transfers_test.sql rename to hourly_spellbook/tests/_project/safe/arbitrum/safe_arbitrum_eth_transfers_test.sql diff --git a/tests/safe/arbitrum/safe_arbitrum_safes_test.sql b/hourly_spellbook/tests/_project/safe/arbitrum/safe_arbitrum_safes_test.sql similarity index 100% rename from tests/safe/arbitrum/safe_arbitrum_safes_test.sql rename to hourly_spellbook/tests/_project/safe/arbitrum/safe_arbitrum_safes_test.sql diff --git a/tests/safe/arbitrum/safe_arbitrum_singletons_test.sql b/hourly_spellbook/tests/_project/safe/arbitrum/safe_arbitrum_singletons_test.sql similarity index 100% rename from tests/safe/arbitrum/safe_arbitrum_singletons_test.sql rename to hourly_spellbook/tests/_project/safe/arbitrum/safe_arbitrum_singletons_test.sql diff --git a/tests/safe/arbitrum/safe_arbitrum_transactions_test.sql b/hourly_spellbook/tests/_project/safe/arbitrum/safe_arbitrum_transactions_test.sql similarity index 100% rename from tests/safe/arbitrum/safe_arbitrum_transactions_test.sql rename to hourly_spellbook/tests/_project/safe/arbitrum/safe_arbitrum_transactions_test.sql diff --git a/tests/safe/avalanche_c/safe_avalanche_c_avax_transfers_test.sql b/hourly_spellbook/tests/_project/safe/avalanche_c/safe_avalanche_c_avax_transfers_test.sql similarity index 100% rename from tests/safe/avalanche_c/safe_avalanche_c_avax_transfers_test.sql rename to hourly_spellbook/tests/_project/safe/avalanche_c/safe_avalanche_c_avax_transfers_test.sql diff --git a/tests/safe/avalanche_c/safe_avalanche_c_safes_test.sql b/hourly_spellbook/tests/_project/safe/avalanche_c/safe_avalanche_c_safes_test.sql similarity index 100% rename from tests/safe/avalanche_c/safe_avalanche_c_safes_test.sql rename to hourly_spellbook/tests/_project/safe/avalanche_c/safe_avalanche_c_safes_test.sql diff --git a/tests/safe/avalanche_c/safe_avalanche_c_singletons_test.sql b/hourly_spellbook/tests/_project/safe/avalanche_c/safe_avalanche_c_singletons_test.sql similarity index 100% rename from tests/safe/avalanche_c/safe_avalanche_c_singletons_test.sql rename to hourly_spellbook/tests/_project/safe/avalanche_c/safe_avalanche_c_singletons_test.sql diff --git a/tests/safe/avalanche_c/safe_avalanche_c_transactions_test.sql b/hourly_spellbook/tests/_project/safe/avalanche_c/safe_avalanche_c_transactions_test.sql similarity index 100% rename from tests/safe/avalanche_c/safe_avalanche_c_transactions_test.sql rename to hourly_spellbook/tests/_project/safe/avalanche_c/safe_avalanche_c_transactions_test.sql diff --git a/tests/safe/bnb/safe_bnb_bnb_transfers_test.sql b/hourly_spellbook/tests/_project/safe/bnb/safe_bnb_bnb_transfers_test.sql similarity index 100% rename from tests/safe/bnb/safe_bnb_bnb_transfers_test.sql rename to hourly_spellbook/tests/_project/safe/bnb/safe_bnb_bnb_transfers_test.sql diff --git a/tests/safe/bnb/safe_bnb_safes_test.sql b/hourly_spellbook/tests/_project/safe/bnb/safe_bnb_safes_test.sql similarity index 100% rename from tests/safe/bnb/safe_bnb_safes_test.sql rename to hourly_spellbook/tests/_project/safe/bnb/safe_bnb_safes_test.sql diff --git a/tests/safe/bnb/safe_bnb_singletons_test.sql b/hourly_spellbook/tests/_project/safe/bnb/safe_bnb_singletons_test.sql similarity index 100% rename from tests/safe/bnb/safe_bnb_singletons_test.sql rename to hourly_spellbook/tests/_project/safe/bnb/safe_bnb_singletons_test.sql diff --git a/tests/safe/bnb/safe_bnb_transactions_test.sql b/hourly_spellbook/tests/_project/safe/bnb/safe_bnb_transactions_test.sql similarity index 100% rename from tests/safe/bnb/safe_bnb_transactions_test.sql rename to hourly_spellbook/tests/_project/safe/bnb/safe_bnb_transactions_test.sql diff --git a/tests/safe/ethereum/eth_transfers_check_sum.sql b/hourly_spellbook/tests/_project/safe/ethereum/eth_transfers_check_sum.sql similarity index 100% rename from tests/safe/ethereum/eth_transfers_check_sum.sql rename to hourly_spellbook/tests/_project/safe/ethereum/eth_transfers_check_sum.sql diff --git a/tests/safe/ethereum/safe_ethereum_safes_test.sql b/hourly_spellbook/tests/_project/safe/ethereum/safe_ethereum_safes_test.sql similarity index 100% rename from tests/safe/ethereum/safe_ethereum_safes_test.sql rename to hourly_spellbook/tests/_project/safe/ethereum/safe_ethereum_safes_test.sql diff --git a/tests/safe/ethereum/safe_ethereum_singletons_test.sql b/hourly_spellbook/tests/_project/safe/ethereum/safe_ethereum_singletons_test.sql similarity index 100% rename from tests/safe/ethereum/safe_ethereum_singletons_test.sql rename to hourly_spellbook/tests/_project/safe/ethereum/safe_ethereum_singletons_test.sql diff --git a/tests/safe/ethereum/safe_ethereum_transactions_test.sql b/hourly_spellbook/tests/_project/safe/ethereum/safe_ethereum_transactions_test.sql similarity index 100% rename from tests/safe/ethereum/safe_ethereum_transactions_test.sql rename to hourly_spellbook/tests/_project/safe/ethereum/safe_ethereum_transactions_test.sql diff --git a/tests/safe/fantom/safe_fantom_safes_test.sql b/hourly_spellbook/tests/_project/safe/fantom/safe_fantom_safes_test.sql similarity index 100% rename from tests/safe/fantom/safe_fantom_safes_test.sql rename to hourly_spellbook/tests/_project/safe/fantom/safe_fantom_safes_test.sql diff --git a/tests/safe/fantom/safe_fantom_singletons_test.sql b/hourly_spellbook/tests/_project/safe/fantom/safe_fantom_singletons_test.sql similarity index 100% rename from tests/safe/fantom/safe_fantom_singletons_test.sql rename to hourly_spellbook/tests/_project/safe/fantom/safe_fantom_singletons_test.sql diff --git a/tests/safe/fantom/safe_fantom_transactions_test.sql b/hourly_spellbook/tests/_project/safe/fantom/safe_fantom_transactions_test.sql similarity index 100% rename from tests/safe/fantom/safe_fantom_transactions_test.sql rename to hourly_spellbook/tests/_project/safe/fantom/safe_fantom_transactions_test.sql diff --git a/tests/safe/gnosis/safe_gnosis_safes_test.sql b/hourly_spellbook/tests/_project/safe/gnosis/safe_gnosis_safes_test.sql similarity index 100% rename from tests/safe/gnosis/safe_gnosis_safes_test.sql rename to hourly_spellbook/tests/_project/safe/gnosis/safe_gnosis_safes_test.sql diff --git a/tests/safe/gnosis/safe_gnosis_singletons_test.sql b/hourly_spellbook/tests/_project/safe/gnosis/safe_gnosis_singletons_test.sql similarity index 100% rename from tests/safe/gnosis/safe_gnosis_singletons_test.sql rename to hourly_spellbook/tests/_project/safe/gnosis/safe_gnosis_singletons_test.sql diff --git a/tests/safe/gnosis/safe_gnosis_transactions_test.sql b/hourly_spellbook/tests/_project/safe/gnosis/safe_gnosis_transactions_test.sql similarity index 100% rename from tests/safe/gnosis/safe_gnosis_transactions_test.sql rename to hourly_spellbook/tests/_project/safe/gnosis/safe_gnosis_transactions_test.sql diff --git a/tests/safe/gnosis/safe_gnosis_xdai_transfers_test.sql b/hourly_spellbook/tests/_project/safe/gnosis/safe_gnosis_xdai_transfers_test.sql similarity index 100% rename from tests/safe/gnosis/safe_gnosis_xdai_transfers_test.sql rename to hourly_spellbook/tests/_project/safe/gnosis/safe_gnosis_xdai_transfers_test.sql diff --git a/tests/safe/goerli/safe_goerli_eth_transfers_test.sql b/hourly_spellbook/tests/_project/safe/goerli/safe_goerli_eth_transfers_test.sql similarity index 100% rename from tests/safe/goerli/safe_goerli_eth_transfers_test.sql rename to hourly_spellbook/tests/_project/safe/goerli/safe_goerli_eth_transfers_test.sql diff --git a/tests/safe/goerli/safe_goerli_safes_test.sql b/hourly_spellbook/tests/_project/safe/goerli/safe_goerli_safes_test.sql similarity index 100% rename from tests/safe/goerli/safe_goerli_safes_test.sql rename to hourly_spellbook/tests/_project/safe/goerli/safe_goerli_safes_test.sql diff --git a/tests/safe/goerli/safe_goerli_singletons_test.sql b/hourly_spellbook/tests/_project/safe/goerli/safe_goerli_singletons_test.sql similarity index 100% rename from tests/safe/goerli/safe_goerli_singletons_test.sql rename to hourly_spellbook/tests/_project/safe/goerli/safe_goerli_singletons_test.sql diff --git a/tests/safe/goerli/safe_goerli_transactions_test.sql b/hourly_spellbook/tests/_project/safe/goerli/safe_goerli_transactions_test.sql similarity index 100% rename from tests/safe/goerli/safe_goerli_transactions_test.sql rename to hourly_spellbook/tests/_project/safe/goerli/safe_goerli_transactions_test.sql diff --git a/tests/safe/optimism/safe_optimism_eth_transfers_test.sql b/hourly_spellbook/tests/_project/safe/optimism/safe_optimism_eth_transfers_test.sql similarity index 100% rename from tests/safe/optimism/safe_optimism_eth_transfers_test.sql rename to hourly_spellbook/tests/_project/safe/optimism/safe_optimism_eth_transfers_test.sql diff --git a/tests/safe/optimism/safe_optimism_safes_test.sql b/hourly_spellbook/tests/_project/safe/optimism/safe_optimism_safes_test.sql similarity index 100% rename from tests/safe/optimism/safe_optimism_safes_test.sql rename to hourly_spellbook/tests/_project/safe/optimism/safe_optimism_safes_test.sql diff --git a/tests/safe/optimism/safe_optimism_singletons_test.sql b/hourly_spellbook/tests/_project/safe/optimism/safe_optimism_singletons_test.sql similarity index 100% rename from tests/safe/optimism/safe_optimism_singletons_test.sql rename to hourly_spellbook/tests/_project/safe/optimism/safe_optimism_singletons_test.sql diff --git a/tests/safe/optimism/safe_optimism_transactions_test.sql b/hourly_spellbook/tests/_project/safe/optimism/safe_optimism_transactions_test.sql similarity index 100% rename from tests/safe/optimism/safe_optimism_transactions_test.sql rename to hourly_spellbook/tests/_project/safe/optimism/safe_optimism_transactions_test.sql diff --git a/tests/safe/polygon/safe_polygon_matic_transfers_test.sql b/hourly_spellbook/tests/_project/safe/polygon/safe_polygon_matic_transfers_test.sql similarity index 100% rename from tests/safe/polygon/safe_polygon_matic_transfers_test.sql rename to hourly_spellbook/tests/_project/safe/polygon/safe_polygon_matic_transfers_test.sql diff --git a/tests/safe/polygon/safe_polygon_safes_test.sql b/hourly_spellbook/tests/_project/safe/polygon/safe_polygon_safes_test.sql similarity index 100% rename from tests/safe/polygon/safe_polygon_safes_test.sql rename to hourly_spellbook/tests/_project/safe/polygon/safe_polygon_safes_test.sql diff --git a/tests/safe/polygon/safe_polygon_singletons_test.sql b/hourly_spellbook/tests/_project/safe/polygon/safe_polygon_singletons_test.sql similarity index 100% rename from tests/safe/polygon/safe_polygon_singletons_test.sql rename to hourly_spellbook/tests/_project/safe/polygon/safe_polygon_singletons_test.sql diff --git a/tests/safe/polygon/safe_polygon_transactions_test.sql b/hourly_spellbook/tests/_project/safe/polygon/safe_polygon_transactions_test.sql similarity index 100% rename from tests/safe/polygon/safe_polygon_transactions_test.sql rename to hourly_spellbook/tests/_project/safe/polygon/safe_polygon_transactions_test.sql diff --git a/tests/safe/safe_safes_all_test.sql b/hourly_spellbook/tests/_project/safe/safe_safes_all_test.sql similarity index 100% rename from tests/safe/safe_safes_all_test.sql rename to hourly_spellbook/tests/_project/safe/safe_safes_all_test.sql diff --git a/tests/prices/prices_sd_latest_check_all_tokens_present.sql b/hourly_spellbook/tests/_sector/prices/prices_sd_latest_check_all_tokens_present.sql similarity index 100% rename from tests/prices/prices_sd_latest_check_all_tokens_present.sql rename to hourly_spellbook/tests/_sector/prices/prices_sd_latest_check_all_tokens_present.sql diff --git a/tests/generic/check_lending_base_borrow_seed.sql b/hourly_spellbook/tests/generic/check_lending_base_borrow_seed.sql similarity index 100% rename from tests/generic/check_lending_base_borrow_seed.sql rename to hourly_spellbook/tests/generic/check_lending_base_borrow_seed.sql diff --git a/tests/generic/check_lending_base_flashloans_seed.sql b/hourly_spellbook/tests/generic/check_lending_base_flashloans_seed.sql similarity index 100% rename from tests/generic/check_lending_base_flashloans_seed.sql rename to hourly_spellbook/tests/generic/check_lending_base_flashloans_seed.sql diff --git a/tests/generic/check_lending_base_supply_seed.sql b/hourly_spellbook/tests/generic/check_lending_base_supply_seed.sql similarity index 100% rename from tests/generic/check_lending_base_supply_seed.sql rename to hourly_spellbook/tests/generic/check_lending_base_supply_seed.sql diff --git a/tests/generic/check_perpetuals_seed.sql b/hourly_spellbook/tests/generic/check_perpetuals_seed.sql similarity index 74% rename from tests/generic/check_perpetuals_seed.sql rename to hourly_spellbook/tests/generic/check_perpetuals_seed.sql index d9a26563144..7ca63b0c3c3 100644 --- a/tests/generic/check_perpetuals_seed.sql +++ b/hourly_spellbook/tests/generic/check_perpetuals_seed.sql @@ -2,11 +2,9 @@ -- actual implementation in macros/test-helpers/check_seed.sql {% test check_perpetuals_seed(model, blockchain=None, project=None, version=None) %} - {%- set seed_file = ref('perpetual_trades_seed') -%} {%- set seed_check_columns = ['market_address','trade'] -%} {%- set seed_matching_columns = ['block_date','blockchain','project','version','tx_hash'] -%} {%- set filter = {'blockchain':blockchain, 'project':project, 'version':version} -%} + {{ check_seed_macro(model,ref('perpetual_trades_seed'),seed_matching_columns,seed_check_columns,filter) }} - {{ check_seed_macro(model,seed_file,seed_matching_columns,seed_check_columns,filter) }} - -{% endtest %} \ No newline at end of file +{% endtest %} diff --git a/tests/generic/perpetual_trades_market_address.sql b/hourly_spellbook/tests/generic/perpetual_trades_market_address.sql similarity index 100% rename from tests/generic/perpetual_trades_market_address.sql rename to hourly_spellbook/tests/generic/perpetual_trades_market_address.sql diff --git a/tests/generic/not_zero_address.sql b/macros/generic-tests/not_zero_address.sql similarity index 100% rename from tests/generic/not_zero_address.sql rename to macros/generic-tests/not_zero_address.sql diff --git a/macros/models/_project/balancer/balancer_bpt_prices_macro.sql b/macros/models/_project/balancer/balancer_bpt_prices_macro.sql index 197c0216018..4e71e626d50 100644 --- a/macros/models/_project/balancer/balancer_bpt_prices_macro.sql +++ b/macros/models/_project/balancer/balancer_bpt_prices_macro.sql @@ -1,7 +1,7 @@ -{% macro +{% macro balancer_v2_compatible_bpt_prices_macro( blockchain, version, project_decoded_as, base_spells_namespace, pool_labels_spell - ) + ) %} WITH pool_labels AS ( @@ -31,7 +31,7 @@ WITH pool_labels AS ( token_address, decimals, price - FROM {{ ref('gyroscope_gyro_tokens') }} + FROM {{ source('gyroscope','gyro_tokens') }} WHERE blockchain = '{{blockchain}}' ), @@ -73,7 +73,7 @@ WITH pool_labels AS ( CROSS JOIN UNNEST (tokens) WITH ORDINALITY as t(tokens,i) CROSS JOIN UNNEST (deltas) WITH ORDINALITY as d(deltas,i) CROSS JOIN UNNEST (protocolFeeAmounts) WITH ORDINALITY as p(protocolFeeAmounts,i) - WHERE t.i = d.i + WHERE t.i = d.i AND d.i = p.i ORDER BY 1,2,3 ), @@ -177,19 +177,19 @@ WITH pool_labels AS ( ROW_NUMBER() OVER (partition by b.day, b.pool_id ORDER BY SUM(b.protocol_liquidity_usd) ASC) AS pricing_count, --to avoid double count in pools with multiple pricing assets SUM(b.protocol_liquidity_usd) / COALESCE(SUM(w.normalized_weight), 1) AS protocol_liquidity FROM cumulative_usd_balance b - LEFT JOIN {{ ref(base_spells_namespace + '_pools_tokens_weights') }} w ON b.pool_id = w.pool_id + LEFT JOIN {{ ref(base_spells_namespace + '_pools_tokens_weights') }} w ON b.pool_id = w.pool_id AND b.token = w.token_address AND b.protocol_liquidity_usd > 0 - LEFT JOIN {{ ref('balancer_token_whitelist') }} q ON b.token = q.address + LEFT JOIN {{ source('balancer','token_whitelist') }} q ON b.token = q.address AND b.blockchain = q.chain LEFT JOIN pool_labels p ON p.pool_id = BYTEARRAY_SUBSTRING(b.pool_id, 1, 20) - WHERE q.name IS NOT NULL + WHERE q.name IS NOT NULL AND p.pool_type IN ('weighted') -- filters for weighted pools with pricing assets AND w.blockchain = '{{blockchain}}' AND w.version = '{{version}}' GROUP BY 1, 2, 3, 4 ), - + weighted_pool_liquidity_estimates_2 AS( SELECT e.day, e.pool_id, @@ -197,7 +197,7 @@ WITH pool_labels AS ( FROM weighted_pool_liquidity_estimates e GROUP BY 1,2 ), - + tvl AS( SELECT c.day, @@ -208,9 +208,9 @@ WITH pool_labels AS ( FROM cumulative_usd_balance c FULL OUTER JOIN weighted_pool_liquidity_estimates_2 b ON c.day = b.day AND c.pool_id = b.pool_id - LEFT JOIN {{ ref(base_spells_namespace + '_pools_tokens_weights') }} w ON b.pool_id = w.pool_id + LEFT JOIN {{ ref(base_spells_namespace + '_pools_tokens_weights') }} w ON b.pool_id = w.pool_id AND w.blockchain = '{{blockchain}}' - AND w.version = '{{version}}' + AND w.version = '{{version}}' AND w.token_address = c.token LEFT JOIN pool_labels p ON p.pool_id = BYTEARRAY_SUBSTRING(c.pool_id, 1, 20) GROUP BY 1, 2, 3, 4 @@ -219,11 +219,11 @@ WITH pool_labels AS ( -- trade based formulation, for Linear Pools (former BPT prices spell) bpt_trades AS ( - SELECT * + SELECT * FROM {{ source(project_decoded_as + '_' + blockchain, 'Vault_evt_Swap') }} v LEFT JOIN pool_labels l ON bytearray_substring(v.poolId, 1, 20) = l.pool_id WHERE v.tokenIn = bytearray_substring(v.poolId, 1, 20) OR v.tokenOut = bytearray_substring(v.poolId, 1, 20) - ), + ), all_trades_info AS ( SELECT @@ -328,7 +328,7 @@ WITH pool_labels AS ( GROUP BY 1, 2, 3 ) - SELECT + SELECT l.day, l.blockchain, l.version, @@ -337,12 +337,12 @@ WITH pool_labels AS ( pl.pool_type, CASE WHEN median_price IS NOT NULL THEN p.median_price - ELSE l.liquidity / s.supply + ELSE l.liquidity / s.supply END AS bpt_price FROM tvl l LEFT JOIN {{ ref(base_spells_namespace + '_bpt_supply') }} s ON l.pool_address = s.token_address AND l.blockchain = s.blockchain - AND l.version = s.version + AND l.version = s.version AND l.day = s.day LEFT JOIN price_formulation p ON p.day = l.day AND p.contract_address = l.pool_address LEFT JOIN pool_labels pl ON pl.pool_id = l.pool_address diff --git a/macros/models/_project/balancer/balancer_liquidity_macro.sql b/macros/models/_project/balancer/balancer_liquidity_macro.sql index 1a12e15913b..ec2af9780c6 100644 --- a/macros/models/_project/balancer/balancer_liquidity_macro.sql +++ b/macros/models/_project/balancer/balancer_liquidity_macro.sql @@ -1,7 +1,7 @@ -{% macro +{% macro balancer_v2_compatible_liquidity_macro( blockchain, version, project_decoded_as, base_spells_namespace, pool_labels_spell - ) + ) %} WITH pool_labels AS ( @@ -31,21 +31,21 @@ WITH pool_labels AS ( approx_percentile(median_price, 0.5) AS price, sum(sample_size) AS sample_size FROM {{ source('dex', 'prices') }} - WHERE - ('{{blockchain}}' != 'fantom' OR + WHERE + ('{{blockchain}}' != 'fantom' OR ('{{blockchain}}' = 'fantom' AND contract_address NOT IN (0xde1e704dae0b4051e80dabb26ab6ad6c12262da0, 0x5ddb92a5340fd0ead3987d3661afcd6104c3b757))) --broken price feeds GROUP BY 1, 2 HAVING sum(sample_size) > 3 ), dex_prices_2 AS( - SELECT + SELECT day, token, price, lag(price) OVER(PARTITION BY token ORDER BY day) AS previous_price FROM dex_prices_1 - ), + ), dex_prices AS ( SELECT @@ -67,9 +67,9 @@ WITH pool_labels AS ( WHERE blockchain = '{{blockchain}}' AND version = '{{version}}' ), - + eth_prices AS ( - SELECT + SELECT DATE_TRUNC('day', minute) as day, AVG(price) as eth_price FROM {{ source('prices', 'usd') }} @@ -82,7 +82,7 @@ WITH pool_labels AS ( token_address, decimals, price - FROM {{ ref('gyroscope_gyro_tokens') }} + FROM {{ source('gyroscope','gyro_tokens') }} WHERE blockchain = '{{blockchain}}' ), @@ -124,7 +124,7 @@ WITH pool_labels AS ( CROSS JOIN UNNEST (tokens) WITH ORDINALITY as t(tokens,i) CROSS JOIN UNNEST (deltas) WITH ORDINALITY as d(deltas,i) CROSS JOIN UNNEST (protocolFeeAmounts) WITH ORDINALITY as p(protocolFeeAmounts,i) - WHERE t.i = d.i + WHERE t.i = d.i AND d.i = p.i ORDER BY 1,2,3 ), @@ -222,7 +222,7 @@ WITH pool_labels AS ( LEFT JOIN dex_prices p2 ON p2.day <= c.day AND c.day < p2.day_of_next_change AND p2.token = b.token - LEFT JOIN bpt_prices p3 ON p3.day = b.day + LEFT JOIN bpt_prices p3 ON p3.day = b.day AND p3.token = b.token LEFT JOIN gyro_prices p4 ON p4.token_address = b.token WHERE b.token != BYTEARRAY_SUBSTRING(b.pool_id, 1, 20) @@ -238,19 +238,19 @@ WITH pool_labels AS ( SUM(b.protocol_liquidity_usd) / COALESCE(SUM(w.normalized_weight), 1) AS protocol_liquidity, SUM(b.pool_liquidity_usd) / COALESCE(SUM(w.normalized_weight), 1) AS pool_liquidity FROM cumulative_usd_balance b - LEFT JOIN {{ ref(base_spells_namespace + '_pools_tokens_weights') }} w ON b.pool_id = w.pool_id + LEFT JOIN {{ ref(base_spells_namespace + '_pools_tokens_weights') }} w ON b.pool_id = w.pool_id AND b.token = w.token_address AND b.pool_liquidity_usd > 0 - LEFT JOIN {{ ref('balancer_token_whitelist') }} q ON b.token = q.address + LEFT JOIN {{ source('balancer','token_whitelist') }} q ON b.token = q.address AND b.blockchain = q.chain LEFT JOIN pool_labels p ON p.pool_id = BYTEARRAY_SUBSTRING(b.pool_id, 1, 20) - WHERE q.name IS NOT NULL + WHERE q.name IS NOT NULL AND p.pool_type IN ('weighted') -- filters for weighted pools with pricing assets AND w.blockchain = '{{blockchain}}' - AND w.version = '{{version}}' + AND w.version = '{{version}}' GROUP BY 1, 2, 3, 4 ), - + weighted_pool_liquidity_estimates_2 AS( SELECT e.day, e.pool_id, @@ -259,7 +259,7 @@ WITH pool_labels AS ( FROM weighted_pool_liquidity_estimates e GROUP BY 1,2 ) - + SELECT c.day, c.pool_id, @@ -279,10 +279,10 @@ WITH pool_labels AS ( FROM cumulative_usd_balance c FULL OUTER JOIN weighted_pool_liquidity_estimates_2 b ON c.day = b.day AND c.pool_id = b.pool_id - LEFT JOIN {{ ref(base_spells_namespace + '_pools_tokens_weights') }} w ON b.pool_id = w.pool_id + LEFT JOIN {{ ref(base_spells_namespace + '_pools_tokens_weights') }} w ON b.pool_id = w.pool_id AND w.blockchain = '{{blockchain}}' - AND w.version = '{{version}}' + AND w.version = '{{version}}' AND w.token_address = c.token - LEFT JOIN eth_prices e ON e.day = c.day + LEFT JOIN eth_prices e ON e.day = c.day LEFT JOIN pool_labels p ON p.pool_id = BYTEARRAY_SUBSTRING(c.pool_id, 1, 20) {% endmacro %} diff --git a/macros/models/_project/balancer/balancer_token_balance_changes_daily_agg_macro.sql b/macros/models/_project/balancer/balancer_token_balance_changes_daily_agg_macro.sql index ad9cd783869..8930036313b 100644 --- a/macros/models/_project/balancer/balancer_token_balance_changes_daily_agg_macro.sql +++ b/macros/models/_project/balancer/balancer_token_balance_changes_daily_agg_macro.sql @@ -1,7 +1,7 @@ -{% macro +{% macro balancer_v2_compatible_token_balance_changes_daily_agg_macro( blockchain, version, project_decoded_as, base_spells_namespace - ) + ) %} WITH prices AS ( @@ -33,13 +33,13 @@ WITH ), dex_prices_2 AS( - SELECT + SELECT day, token, price, lag(price) OVER(PARTITION BY token ORDER BY day) AS previous_price FROM dex_prices_1 - ), + ), dex_prices AS ( SELECT @@ -66,7 +66,7 @@ WITH ), eth_prices AS ( - SELECT + SELECT DATE_TRUNC('day', minute) as day, AVG(price) as eth_price FROM {{ source('prices', 'usd') }} @@ -82,7 +82,7 @@ WITH token_address, decimals, price - FROM {{ ref('gyroscope_gyro_tokens') }} + FROM {{ source('gyroscope','gyro_tokens') }} WHERE blockchain = '{{blockchain}}' ), @@ -125,7 +125,7 @@ WITH LEFT JOIN dex_prices p2 ON p2.day <= c.day AND c.day < p2.day_of_next_change AND p2.token = b.token_address - LEFT JOIN bpt_prices p3 ON p3.day = b.block_date + LEFT JOIN bpt_prices p3 ON p3.day = b.block_date AND p3.token = b.token_address LEFT JOIN gyro_prices p4 ON p4.token_address = b.token_address WHERE b.token_address != BYTEARRAY_SUBSTRING(b.pool_id, 1, 20) @@ -140,15 +140,15 @@ WITH ROW_NUMBER() OVER (PARTITION BY b.block_date, b.pool_id ORDER BY SUM(b.daily_amount_usd) ASC) AS pricing_count, --to avoid double count in pools with multiple pricing assets SUM(b.daily_amount_usd) / COALESCE(SUM(w.normalized_weight), 1) AS weighted_daily_amount_usd FROM daily_usd_balance b - LEFT JOIN {{ ref(base_spells_namespace + '_pools_tokens_weights') }} w ON b.pool_id = w.pool_id + LEFT JOIN {{ ref(base_spells_namespace + '_pools_tokens_weights') }} w ON b.pool_id = w.pool_id AND b.token_address = w.token_address AND b.daily_amount_usd > 0 - LEFT JOIN {{ ref('balancer_token_whitelist') }} q ON b.token_address = q.address + LEFT JOIN {{ source('balancer','token_whitelist') }} q ON b.token_address = q.address AND b.blockchain = q.chain - WHERE q.name IS NOT NULL + WHERE q.name IS NOT NULL AND b.pool_type = 'weighted' -- filters for weighted pools with pricing assets AND w.blockchain = '{{blockchain}}' - AND w.version = '2' + AND w.version = '2' GROUP BY 1, 2, 3, 4 ), @@ -176,9 +176,9 @@ WITH FROM daily_usd_balance c FULL OUTER JOIN weighted_pool_amount_estimates_2 b ON c.block_date = b.block_date AND c.pool_id = b.pool_id - LEFT JOIN {{ ref(base_spells_namespace + '_pools_tokens_weights') }} w ON b.pool_id = w.pool_id + LEFT JOIN {{ ref(base_spells_namespace + '_pools_tokens_weights') }} w ON b.pool_id = w.pool_id AND w.blockchain = '{{blockchain}}' - AND w.version = '2' + AND w.version = '2' AND w.token_address = c.token_address - LEFT JOIN eth_prices e ON e.day = c.block_date - {% endmacro %} \ No newline at end of file + LEFT JOIN eth_prices e ON e.day = c.block_date + {% endmacro %} diff --git a/macros/models/_sector/add_pool_price_usd.sql b/macros/models/_sector/add_pool_price_usd.sql index 7a1524d02cc..ec9f380a8d9 100644 --- a/macros/models/_sector/add_pool_price_usd.sql +++ b/macros/models/_sector/add_pool_price_usd.sql @@ -13,7 +13,7 @@ WITH trusted_tokens AS ( SELECT contract_address , blockchain - FROM {{ ref('prices_trusted_tokens') }} + FROM {{ source('prices','trusted_tokens') }} ) , prices AS ( SELECT diff --git a/macros/models/_sector/fungible/fungible_transfers.sql b/macros/models/_sector/fungible/fungible_transfers.sql index 1b1df9c2514..ce474794dd9 100644 --- a/macros/models/_sector/fungible/fungible_transfers.sql +++ b/macros/models/_sector/fungible/fungible_transfers.sql @@ -20,9 +20,9 @@ WITH transfers AS ( WHERE success AND (call_type NOT IN ('delegatecall', 'callcode', 'staticcall') OR call_type IS null) AND value > UINT256 '0' - + UNION ALL - + SELECT t.evt_block_time AS block_time , t.evt_block_number AS block_number , t.value AS amount_raw @@ -58,10 +58,10 @@ SELECT '{{blockchain}}' as blockchain FROM transfers t INNER JOIN {{ transactions }} et ON et.block_number=t.block_number AND et.hash=t.tx_hash -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = '{{blockchain}}' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = '{{blockchain}}' AND (pu.contract_address=t.contract_address OR t.contract_address IS NULL AND pu.contract_address=(SELECT wrapped_native_token_address FROM {{ ref('evms_info') }} WHERE blockchain='{{blockchain}}') ) AND pu.minute = date_trunc('minute', t.block_time) -{% endmacro %} \ No newline at end of file +{% endmacro %} diff --git a/macros/models/_sector/social/enrich_social_trades.sql b/macros/models/_sector/social/enrich_social_trades.sql index ebdacf91e78..d0fbba8ea33 100644 --- a/macros/models/_sector/social/enrich_social_trades.sql +++ b/macros/models/_sector/social/enrich_social_trades.sql @@ -29,7 +29,7 @@ INNER JOIN {{ref('evms_info')}} info LEFT JOIN {{source('tokens', 'erc20')}} tok ON tok.blockchain = t.blockchain AND tok.contract_address = t.currency_contract -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = t.blockchain AND ( pu.contract_address=info.wrapped_native_token_address @@ -44,4 +44,4 @@ WHERE {{ incremental_predicate('t.block_time') }} {% endif %} -{% endmacro %} \ No newline at end of file +{% endmacro %} diff --git a/models/_sector/airdrops/arbitrum/projects/arbitrum_arbitrum_airdrop_claims.sql b/models/_sector/airdrops/arbitrum/projects/arbitrum_arbitrum_airdrop_claims.sql index c1b4e154618..ad8ba18751f 100644 --- a/models/_sector/airdrops/arbitrum/projects/arbitrum_arbitrum_airdrop_claims.sql +++ b/models/_sector/airdrops/arbitrum/projects/arbitrum_arbitrum_airdrop_claims.sql @@ -1,6 +1,6 @@ {{ config( - + schema = 'arbitrum_arbitrum', alias = 'airdrop_claims', materialized = 'incremental', @@ -41,7 +41,7 @@ SELECT 'arbitrum' AS blockchain , 'ARB' AS token_symbol , t.evt_index FROM {{ source('arbitrum_arbitrum', 'TokenDistributor_evt_HasClaimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'arbitrum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'arbitrum' AND pu.contract_address= {{arb_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) {% if is_incremental() %} @@ -49,4 +49,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'arbitrum' {% endif %} {% if is_incremental() %} WHERE t.evt_block_time >= date_trunc('day', now() - interval '7' Day) -{% endif %} \ No newline at end of file +{% endif %} diff --git a/models/_sector/airdrops/avalanche_c/projects/pangolin_avalanche_c_airdrop_claims.sql b/models/_sector/airdrops/avalanche_c/projects/pangolin_avalanche_c_airdrop_claims.sql index 1de3503e9d4..a2aaf56edde 100644 --- a/models/_sector/airdrops/avalanche_c/projects/pangolin_avalanche_c_airdrop_claims.sql +++ b/models/_sector/airdrops/avalanche_c/projects/pangolin_avalanche_c_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'avalanche_c' AS blockchain , 'PNG' AS token_symbol , t.evt_index FROM {{ source('pangolin_exchange_avalanche_c', 'Airdrop_evt_PngClaimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'avalanche_c' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'avalanche_c' AND pu.contract_address= {{png_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2021-02-09' AND timestamp '2021-03-10' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2021-02-09' AND timestamp '2021-03-10' diff --git a/models/_sector/airdrops/bnb/projects/ellipsis_finance_bnb_airdrop_claims.sql b/models/_sector/airdrops/bnb/projects/ellipsis_finance_bnb_airdrop_claims.sql index 37610ae3e8d..85c96996e5d 100644 --- a/models/_sector/airdrops/bnb/projects/ellipsis_finance_bnb_airdrop_claims.sql +++ b/models/_sector/airdrops/bnb/projects/ellipsis_finance_bnb_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'bnb' AS blockchain , 'EPS' AS token_symbol , t.evt_index FROM {{ source('ellipsis_finance_bnb', 'AirdropClaim_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'bnb' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'bnb' AND pu.contract_address= {{eps_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2021-03-24' AND timestamp '2022-04-01' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2021-03-24' AND timestamp '2022-04-01' diff --git a/models/_sector/airdrops/ethereum/projects/ampleforth_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/ampleforth_ethereum_airdrop_claims.sql index ba948180a41..d4781851a76 100644 --- a/models/_sector/airdrops/ethereum/projects/ampleforth_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/ampleforth_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'FORTH' AS token_symbol , t.evt_index FROM {{ source('erc20_ethereum', 'evt_transfer') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{forth_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) WHERE t.evt_block_time BETWEEN CAST('2021-04-20' as timestamp) AND CAST('2022-04-16' as timestamp) diff --git a/models/_sector/airdrops/ethereum/projects/apecoin_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/apecoin_ethereum_airdrop_claims.sql index 4904568788f..71d4a6f7d4a 100644 --- a/models/_sector/airdrops/ethereum/projects/apecoin_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/apecoin_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'APE' AS token_symbol , t.evt_index FROM {{ source('apecoin_ethereum', 'AirdropGrapesToken_evt_AirDrop') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{ape_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN CAST('2022-03-17' as TIMESTAMP) AND CAST('2022-06-16' as timestamp) \ No newline at end of file +WHERE t.evt_block_time BETWEEN CAST('2022-03-17' as TIMESTAMP) AND CAST('2022-06-16' as timestamp) diff --git a/models/_sector/airdrops/ethereum/projects/arkham_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/arkham_ethereum_airdrop_claims.sql index 7351de70249..31a14f42408 100644 --- a/models/_sector/airdrops/ethereum/projects/arkham_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/arkham_ethereum_airdrop_claims.sql @@ -1,6 +1,6 @@ {{ config( - + schema = 'arkham_ethereum', alias = 'airdrop_claims', materialized = 'table', @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'ARKM' AS token_symbol , t.evt_index FROM {{ source('arkham_ethereum', 'Airdrop_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{arkm_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time >= CAST('2023-07-18' as TIMESTAMP) \ No newline at end of file +WHERE t.evt_block_time >= CAST('2023-07-18' as TIMESTAMP) diff --git a/models/_sector/airdrops/ethereum/projects/bend_dao_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/bend_dao_ethereum_airdrop_claims.sql index 45bec83f8e1..cc9cf171b55 100644 --- a/models/_sector/airdrops/ethereum/projects/bend_dao_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/bend_dao_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'BEND' AS token_symbol , t.evt_index FROM {{ source('benddao_ethereum', 'MerkleDistributor_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{bend_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN CAST('2022-03-21' as timestamp) AND CAST('2022-06-19' as timestamp) \ No newline at end of file +WHERE t.evt_block_time BETWEEN CAST('2022-03-21' as timestamp) AND CAST('2022-06-19' as timestamp) diff --git a/models/_sector/airdrops/ethereum/projects/blur_ethereum_airdrop_1_claims.sql b/models/_sector/airdrops/ethereum/projects/blur_ethereum_airdrop_1_claims.sql index 5d0a930a034..e9517e8cdc3 100644 --- a/models/_sector/airdrops/ethereum/projects/blur_ethereum_airdrop_1_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/blur_ethereum_airdrop_1_claims.sql @@ -1,6 +1,6 @@ {{ config( - + schema = 'blur_ethereum', alias = 'airdrop_1_claims', materialized = 'incremental', @@ -41,7 +41,7 @@ SELECT 'ethereum' AS blockchain , 'BLUR' AS token_symbol , t.evt_index FROM {{ source('blur_ethereum', 'BlurAirdrop_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{blur_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) {% if is_incremental() %} @@ -49,4 +49,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' {% endif %} {% if is_incremental() %} WHERE t.evt_block_time >= date_trunc('day', now() - interval '7' Day) -{% endif %} \ No newline at end of file +{% endif %} diff --git a/models/_sector/airdrops/ethereum/projects/botto_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/botto_ethereum_airdrop_claims.sql index a87a266b5d9..a099be25eed 100644 --- a/models/_sector/airdrops/ethereum/projects/botto_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/botto_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'BOTTO' AS token_symbol , t.evt_index FROM {{ source('botto_ethereum', 'BottoAirdrop_evt_AirdropTransfer') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{botto_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2021-10-07' AND timestamp '2022-01-09' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2021-10-07' AND timestamp '2022-01-09' diff --git a/models/_sector/airdrops/ethereum/projects/component_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/component_ethereum_airdrop_claims.sql index c9d485af4d3..e74fd040054 100644 --- a/models/_sector/airdrops/ethereum/projects/component_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/component_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'CMP' AS token_symbol , t.evt_index FROM {{ source('component_ethereum', 'MerkleDistributor_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{cmp_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2021-04-27' AND timestamp '2021-07-29' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2021-04-27' AND timestamp '2021-07-29' diff --git a/models/_sector/airdrops/ethereum/projects/cow_protocol_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/cow_protocol_ethereum_airdrop_claims.sql index f64e37dff9f..d4fbb6f7bc9 100644 --- a/models/_sector/airdrops/ethereum/projects/cow_protocol_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/cow_protocol_ethereum_airdrop_claims.sql @@ -43,7 +43,7 @@ SELECT 'COW' AS token_symbol, t.evt_index FROM {{ source('cow_protocol_ethereum', 'CowProtocolVirtualToken_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address={{cow_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2022-02-11' AND timestamp '2022-03-26' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2022-02-11' AND timestamp '2022-03-26' diff --git a/models/_sector/airdrops/ethereum/projects/dappradar_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/dappradar_ethereum_airdrop_claims.sql index f9496c46152..69a9030b522 100644 --- a/models/_sector/airdrops/ethereum/projects/dappradar_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/dappradar_ethereum_airdrop_claims.sql @@ -41,7 +41,7 @@ SELECT 'ethereum' AS blockchain , 'RADAR' AS token_symbol , t.evt_index FROM {{ source('dappradar_ethereum', 'Airdrop_evt_TokenClaimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{radar_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2021-12-14' AND timestamp '2022-03-20' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2021-12-14' AND timestamp '2022-03-20' diff --git a/models/_sector/airdrops/ethereum/projects/dydx_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/dydx_ethereum_airdrop_claims.sql index a0717b0707a..33f286fa9f1 100644 --- a/models/_sector/airdrops/ethereum/projects/dydx_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/dydx_ethereum_airdrop_claims.sql @@ -1,6 +1,6 @@ {{ config( - + schema = 'dydx_ethereum', alias = 'airdrop_claims', materialized = 'incremental', @@ -41,7 +41,7 @@ SELECT 'ethereum' AS blockchain , 'DYDX' AS token_symbol , t.evt_index FROM {{ source('erc20_ethereum', 'evt_transfer') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{dydx_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) {% if is_incremental() %} @@ -52,4 +52,4 @@ AND t."from" = 0x639192d54431f8c816368d3fb4107bc168d0e871 AND t.evt_block_time > timestamp '2021-09-08' {% if is_incremental() %} AND t.evt_block_time >= date_trunc('day', now() - interval '7' Day) -{% endif %} \ No newline at end of file +{% endif %} diff --git a/models/_sector/airdrops/ethereum/projects/ens_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/ens_ethereum_airdrop_claims.sql index 9ab8e0b46ca..0e74eafe865 100644 --- a/models/_sector/airdrops/ethereum/projects/ens_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/ens_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'ENS' AS token_symbol , t.evt_index FROM {{ source('ethereumnameservice_ethereum', 'ENSToken_evt_Claim') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{ens_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) WHERE t.evt_block_time BETWEEN timestamp '2021-11-09' AND timestamp '2022-11-25' diff --git a/models/_sector/airdrops/ethereum/projects/forefront_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/forefront_ethereum_airdrop_claims.sql index b8f4492d49c..e673468ad56 100644 --- a/models/_sector/airdrops/ethereum/projects/forefront_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/forefront_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'FF' AS token_symbol , evt_index FROM {{ source('forefront_ethereum', 'ForefrontMerkle_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{ff_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2021-03-31' AND timestamp '2021-04-16' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2021-03-31' AND timestamp '2021-04-16' diff --git a/models/_sector/airdrops/ethereum/projects/forta_network_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/forta_network_ethereum_airdrop_claims.sql index 0dc6c965ade..2dfdc707777 100644 --- a/models/_sector/airdrops/ethereum/projects/forta_network_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/forta_network_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'FORT' AS token_symbol , t.evt_index FROM {{ source('forta_network_ethereum', 'Airdrop_evt_TokensReleased') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{forta_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2022-06-14' AND timestamp '2022-09-16' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2022-06-14' AND timestamp '2022-09-16' diff --git a/models/_sector/airdrops/ethereum/projects/galxe_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/galxe_ethereum_airdrop_claims.sql index 6f32cd983cb..e924358d5a7 100644 --- a/models/_sector/airdrops/ethereum/projects/galxe_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/galxe_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'GAL' AS token_symbol , t.evt_index FROM {{ source('galaxy_ethereum', 'MerkleDistributor_Airdrop_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{gal_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2022-05-05' AND timestamp '2022-06-05' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2022-05-05' AND timestamp '2022-06-05' diff --git a/models/_sector/airdrops/ethereum/projects/gas_dao_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/gas_dao_ethereum_airdrop_claims.sql index 72b30e370be..0c1b2095b17 100644 --- a/models/_sector/airdrops/ethereum/projects/gas_dao_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/gas_dao_ethereum_airdrop_claims.sql @@ -1,6 +1,6 @@ {{ config( - + schema = 'gas_dao_ethereum', alias = 'airdrop_claims', materialized = 'incremental', @@ -41,7 +41,7 @@ SELECT 'ethereum' AS blockchain , 'GAS' AS token_symbol , t.evt_index FROM {{ source('gas_dao_ethereum', 'GASToken_evt_Claim') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{gas_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) {% if is_incremental() %} @@ -49,4 +49,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' {% endif %} {% if is_incremental() %} WHERE t.evt_block_time >= date_trunc('day', now() - interval '7' Day) -{% endif %} \ No newline at end of file +{% endif %} diff --git a/models/_sector/airdrops/ethereum/projects/genie_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/genie_ethereum_airdrop_claims.sql index dafd00a8cf5..0d973ebbe54 100644 --- a/models/_sector/airdrops/ethereum/projects/genie_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/genie_ethereum_airdrop_claims.sql @@ -1,6 +1,6 @@ {{ config( - + schema = 'genie_ethereum', alias = 'airdrop_claims', materialized = 'incremental', @@ -31,7 +31,7 @@ SELECT 'ethereum' AS blockchain , 'USDC' AS token_symbol , t.evt_index FROM {{ source('uniswap_ethereum', 'MerkleDistributorWithDeadline_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{usdc_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) {% if is_incremental() %} @@ -40,4 +40,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' WHERE t.evt_block_time >= timestamp '2022-11-23' {% if is_incremental() %} AND t.evt_block_time >= date_trunc('day', now() - interval '7' Day) -{% endif %} \ No newline at end of file +{% endif %} diff --git a/models/_sector/airdrops/ethereum/projects/gitcoin_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/gitcoin_ethereum_airdrop_claims.sql index 445964fba75..c5065c52349 100644 --- a/models/_sector/airdrops/ethereum/projects/gitcoin_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/gitcoin_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'GTC' AS token_symbol , t.evt_index FROM {{ source('gitcoin_ethereum', 'TokenDistributor_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{gtc_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2021-05-24' AND timestamp '2021-06-24' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2021-05-24' AND timestamp '2021-06-24' diff --git a/models/_sector/airdrops/ethereum/projects/hop_protocol_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/hop_protocol_ethereum_airdrop_claims.sql index 4786d4d5ab2..3ae18ddaeb2 100644 --- a/models/_sector/airdrops/ethereum/projects/hop_protocol_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/hop_protocol_ethereum_airdrop_claims.sql @@ -1,6 +1,6 @@ {{ config( - + schema = 'hop_protocol_ethereum', alias = 'airdrop_claims', materialized = 'incremental', @@ -41,7 +41,7 @@ SELECT 'ethereum' AS blockchain , 'HOP' AS token_symbol , t.evt_index FROM {{ source('hop_protocol_ethereum', 'HOPToken_evt_Claim') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{hop_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) {% if is_incremental() %} @@ -49,4 +49,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' {% endif %} {% if is_incremental() %} WHERE t.evt_block_time >= date_trunc('day', now() - interval '7' Day) -{% endif %} \ No newline at end of file +{% endif %} diff --git a/models/_sector/airdrops/ethereum/projects/looksrare_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/looksrare_ethereum_airdrop_claims.sql index 1d05aec3c58..ed53544600a 100644 --- a/models/_sector/airdrops/ethereum/projects/looksrare_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/looksrare_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'LOOKS' AS token_symbol , t.evt_index FROM {{ source('looksrare_ethereum', 'LooksRareAirdrop_evt_AirdropRewardsClaim') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{looks_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2022-01-10' AND timestamp '2022-03-19' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2022-01-10' AND timestamp '2022-03-19' diff --git a/models/_sector/airdrops/ethereum/projects/notional_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/notional_ethereum_airdrop_claims.sql index db615ba8a55..453740acc6e 100644 --- a/models/_sector/airdrops/ethereum/projects/notional_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/notional_ethereum_airdrop_claims.sql @@ -1,6 +1,6 @@ {{ config( - + schema = 'notional_ethereum', alias = 'airdrop_claims', materialized = 'incremental', @@ -41,7 +41,7 @@ SELECT 'ethereum' AS blockchain , 'NOTE' AS token_symbol , t.evt_index FROM {{ source('notional_ethereum', 'MerkleDistributor_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{note_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) {% if is_incremental() %} @@ -49,4 +49,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' {% endif %} {% if is_incremental() %} WHERE t.evt_block_time >= date_trunc('day', now() - interval '7' Day) -{% endif %} \ No newline at end of file +{% endif %} diff --git a/models/_sector/airdrops/ethereum/projects/oneinch_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/oneinch_ethereum_airdrop_claims.sql index cc83033c280..8f3937c851b 100644 --- a/models/_sector/airdrops/ethereum/projects/oneinch_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/oneinch_ethereum_airdrop_claims.sql @@ -42,7 +42,7 @@ SELECT 'ethereum' AS blockchain , '1INCH' AS token_symbol , t.evt_index FROM {{ source('oneinch_ethereum', 'MerkleDistributor_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{oinch_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) {% if is_incremental() %} @@ -50,4 +50,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' {% endif %} {% if is_incremental() %} WHERE {{incremental_predicate('t.evt_block_time')}} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/models/_sector/airdrops/ethereum/projects/paladin_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/paladin_ethereum_airdrop_claims.sql index 60312358fa0..494405ec242 100644 --- a/models/_sector/airdrops/ethereum/projects/paladin_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/paladin_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'PAL' AS token_symbol , t.evt_index FROM {{ source('paladin_ethereum', 'MerkleDistributor_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{pal_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2021-11-03' AND timestamp '2022-02-02' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2021-11-03' AND timestamp '2022-02-02' diff --git a/models/_sector/airdrops/ethereum/projects/pooltogether_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/pooltogether_ethereum_airdrop_claims.sql index 3b8968f3c3d..6ed03254c53 100644 --- a/models/_sector/airdrops/ethereum/projects/pooltogether_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/pooltogether_ethereum_airdrop_claims.sql @@ -1,6 +1,6 @@ {{ config( - + schema = 'pooltogether_ethereum', alias = 'airdrop_claims', materialized = 'incremental', @@ -41,7 +41,7 @@ SELECT 'ethereum' AS blockchain , 'POOL' AS token_symbol , t.evt_index FROM {{ source('pooltogether_ethereum', 'MerkleDistributor_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{pool_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) {% if is_incremental() %} @@ -49,4 +49,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' {% endif %} {% if is_incremental() %} WHERE t.evt_block_time >= date_trunc('day', now() - interval '7' Day) -{% endif %} \ No newline at end of file +{% endif %} diff --git a/models/_sector/airdrops/ethereum/projects/ribbon_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/ribbon_ethereum_airdrop_claims.sql index a028b9e1cac..54642120a93 100644 --- a/models/_sector/airdrops/ethereum/projects/ribbon_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/ribbon_ethereum_airdrop_claims.sql @@ -1,6 +1,6 @@ {{ config( - + schema = 'ribbon_ethereum', alias = 'airdrop_claims', materialized = 'incremental', @@ -41,7 +41,7 @@ SELECT 'ethereum' AS blockchain , 'RBN' AS token_symbol , t.evt_index FROM {{ source('ribbon_ethereum', 'MerkleDistributor_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{rbn_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) {% if is_incremental() %} @@ -49,4 +49,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' {% endif %} {% if is_incremental() %} WHERE t.evt_block_time >= date_trunc('day', now() - interval '7' Day) -{% endif %} \ No newline at end of file +{% endif %} diff --git a/models/_sector/airdrops/ethereum/projects/shapeshift_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/shapeshift_ethereum_airdrop_claims.sql index ffde3283a07..2b55d53f509 100644 --- a/models/_sector/airdrops/ethereum/projects/shapeshift_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/shapeshift_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'FOX' AS token_symbol , t.evt_index FROM {{ source('shapeshift_ethereum', 'TokenDistributor_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{fox_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2021-07-08' AND timestamp '2021-10-22' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2021-07-08' AND timestamp '2021-10-22' diff --git a/models/_sector/airdrops/ethereum/projects/snowswap_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/snowswap_ethereum_airdrop_claims.sql index ead00e16fa6..20eb63b5095 100644 --- a/models/_sector/airdrops/ethereum/projects/snowswap_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/snowswap_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'SNOW' AS token_symbol , t.evt_index FROM {{ source('snowswap_ethereum', 'MerkleDistributor_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{snow_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2020-10-14' AND timestamp '2020-10-31' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2020-10-14' AND timestamp '2020-10-31' diff --git a/models/_sector/airdrops/ethereum/projects/sudoswap_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/sudoswap_ethereum_airdrop_claims.sql index 18f3748e07c..abee2ab431d 100644 --- a/models/_sector/airdrops/ethereum/projects/sudoswap_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/sudoswap_ethereum_airdrop_claims.sql @@ -1,6 +1,6 @@ {{ config( - + schema = 'sudoswap_ethereum', alias = 'airdrop_claims', materialized = 'incremental', @@ -41,7 +41,7 @@ SELECT 'ethereum' AS blockchain , 'SUDO' AS token_symbol , t.evt_index FROM {{ source('sudoswap_ethereum', 'Astrodrop_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{sudo_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) {% if is_incremental() %} @@ -49,4 +49,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' {% endif %} {% if is_incremental() %} WHERE t.evt_block_time >= date_trunc('day', now() - interval '7' Day) -{% endif %} \ No newline at end of file +{% endif %} diff --git a/models/_sector/airdrops/ethereum/projects/tokenfy_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/tokenfy_ethereum_airdrop_claims.sql index 81f1a1d3976..b50da84fc17 100644 --- a/models/_sector/airdrops/ethereum/projects/tokenfy_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/tokenfy_ethereum_airdrop_claims.sql @@ -42,7 +42,7 @@ SELECT 'ethereum' AS blockchain FROM {{ source('erc20_ethereum', 'evt_transfer') }} t INNER JOIN {{source( 'tokenfy_ethereum', 'Tokenfy_call_claim' ) }} c ON c.call_block_number=t.evt_block_number AND c.call_tx_hash=t.evt_tx_hash -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{tknfy_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2022-01-21' AND timestamp '2022-02-05' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2022-01-21' AND timestamp '2022-02-05' diff --git a/models/_sector/airdrops/ethereum/projects/tornado_cash_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/tornado_cash_ethereum_airdrop_claims.sql index 3ba9b21948f..f2a60b5d606 100644 --- a/models/_sector/airdrops/ethereum/projects/tornado_cash_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/tornado_cash_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'TORN' AS token_symbol , t.evt_index FROM {{ source('erc20_ethereum', 'evt_transfer') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address = {{torn_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) WHERE t.evt_block_time BETWEEN TIMESTAMP '2020-12-18' AND TIMESTAMP '2021-12-13' diff --git a/models/_sector/airdrops/ethereum/projects/uniswap_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/uniswap_ethereum_airdrop_claims.sql index 525592ad039..4f7b25b9b84 100644 --- a/models/_sector/airdrops/ethereum/projects/uniswap_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/uniswap_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'UNI' AS token_symbol , t.evt_index FROM {{ source('uniswap_ethereum', 'MerkleDistributor_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address = {{uni_token_address}} AND pu.minute = date_trunc('minute', t.evt_block_time) {% if is_incremental() %} @@ -48,4 +48,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' {% endif %} {% if is_incremental() %} WHERE t.evt_block_time >= date_trunc('day', now() - interval '7' day) -{% endif %} \ No newline at end of file +{% endif %} diff --git a/models/_sector/airdrops/ethereum/projects/x2y2_ethereum_airdrop_claims.sql b/models/_sector/airdrops/ethereum/projects/x2y2_ethereum_airdrop_claims.sql index b0ddf974c09..bc7df505196 100644 --- a/models/_sector/airdrops/ethereum/projects/x2y2_ethereum_airdrop_claims.sql +++ b/models/_sector/airdrops/ethereum/projects/x2y2_ethereum_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'ethereum' AS blockchain , 'X2Y2' AS token_symbol , t.evt_index FROM {{ source('erc20_ethereum', 'evt_transfer') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'ethereum' AND pu.contract_address= {{xtyt_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) WHERE t.evt_block_time BETWEEN timestamp '2022-02-15' AND timestamp '2022-03-31' diff --git a/models/_sector/airdrops/gnosis/projects/giveth_gnosis_airdrop_claims.sql b/models/_sector/airdrops/gnosis/projects/giveth_gnosis_airdrop_claims.sql index 14dbab5e98e..98595c68480 100644 --- a/models/_sector/airdrops/gnosis/projects/giveth_gnosis_airdrop_claims.sql +++ b/models/_sector/airdrops/gnosis/projects/giveth_gnosis_airdrop_claims.sql @@ -40,7 +40,7 @@ SELECT 'gnosis' AS blockchain , 'GIV' AS token_symbol , t.evt_index FROM {{ source('giveth_gnosis', 'MerkleDistro_evt_Claimed') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu ON pu.blockchain = 'gnosis' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu ON pu.blockchain = 'gnosis' AND pu.contract_address= {{giv_token_address}} AND pu.minute=date_trunc('minute', t.evt_block_time) -WHERE t.evt_block_time BETWEEN timestamp '2021-12-24' AND timestamp '2022-12-31' \ No newline at end of file +WHERE t.evt_block_time BETWEEN timestamp '2021-12-24' AND timestamp '2022-12-31' diff --git a/models/_sector/dex/pools/dex_pools_metrics_daily.sql b/models/_sector/dex/pools/dex_pools_metrics_daily.sql index 8a06e8b7c37..94423f60d12 100644 --- a/models/_sector/dex/pools/dex_pools_metrics_daily.sql +++ b/models/_sector/dex/pools/dex_pools_metrics_daily.sql @@ -14,7 +14,7 @@ }} {% set dex_pool_metrics_models = [ - ref('balancer_pools_metrics_daily') + source('balancer','pools_metrics_daily') ] %} diff --git a/models/_sector/labels/addresses/__single_category_labels__/aave_v2/labels_aave_v2_annual_liquidations.sql b/models/_sector/labels/addresses/__single_category_labels__/aave_v2/labels_aave_v2_annual_liquidations.sql index 450c13d7ef3..b4a7ed63f0c 100644 --- a/models/_sector/labels/addresses/__single_category_labels__/aave_v2/labels_aave_v2_annual_liquidations.sql +++ b/models/_sector/labels/addresses/__single_category_labels__/aave_v2/labels_aave_v2_annual_liquidations.sql @@ -4,14 +4,14 @@ WITH mev_addresses AS ( - SELECT + SELECT address FROM {{ ref('labels_mev_ethereum') }} ) , aave_v2_annual_liquidations AS ( - SELECT - * + SELECT + * FROM {{ source('aave_v2_ethereum', 'LendingPool_evt_LiquidationCall') }} WHERE evt_block_time > now() - INTERVAL '365' day ) @@ -27,7 +27,7 @@ SELECT , m.address AS liquidator FROM aave_v2_annual_liquidations a LEFT JOIN mev_addresses m ON m.address = a.liquidator -LEFT JOIN {{ ref('prices_tokens') }} p +LEFT JOIN {{ source('prices','tokens') }} p ON p.contract_address = a.collateralAsset AND p.blockchain = 'ethereum' ) @@ -38,7 +38,7 @@ SELECT , address AS address , case when liquidator is not null then 'MEV' else 'non-MEV' - end as name + end as name , 'liquidation type' AS category , 'paulx' AS contributor , 'query' AS source diff --git a/models/_sector/labels/addresses/__single_category_labels__/aave_v2/labels_aave_v2_daily_deposit_size.sql b/models/_sector/labels/addresses/__single_category_labels__/aave_v2/labels_aave_v2_daily_deposit_size.sql index 96bbc2542c0..5ec5b711f54 100644 --- a/models/_sector/labels/addresses/__single_category_labels__/aave_v2/labels_aave_v2_daily_deposit_size.sql +++ b/models/_sector/labels/addresses/__single_category_labels__/aave_v2/labels_aave_v2_daily_deposit_size.sql @@ -2,24 +2,24 @@ alias = 'aave_v2_deposit_size' )}} -with latest_net_deposits AS ( - with annual_flows AS ( - SELECT +with latest_net_deposits AS ( + with annual_flows AS ( + SELECT d.evt_block_time , d.user , cast(d.amount as double) / pow(10, p.decimals) AS amount , d.reserve , p.symbol , d.contract_address AS lendingpool_contract - FROM {{ source('aave_v2_ethereum', 'LendingPool_evt_Deposit')}} d - LEFT JOIN {{ ref('prices_tokens') }} p + FROM {{ source('aave_v2_ethereum', 'LendingPool_evt_Deposit')}} d + LEFT JOIN {{ source('prices','tokens') }} p ON p.contract_address = d.reserve AND p.blockchain = 'ethereum' WHERE evt_block_time > NOW() - INTERVAL '1' day - + UNION ALL - - SELECT + + SELECT w.evt_block_time , w.user , cast(w.amount as double) * -1 / pow(10, p.decimals) AS amount @@ -27,14 +27,14 @@ with latest_net_deposits AS ( , p.symbol , w.contract_address AS lendingpool_contract FROM {{ source('aave_v2_ethereum', 'LendingPool_evt_Withdraw')}} w - LEFT JOIN {{ ref('prices_tokens') }} p + LEFT JOIN {{ source('prices','tokens') }} p ON p.contract_address = w.reserve AND p.blockchain = 'ethereum' WHERE evt_block_time > NOW() - INTERVAL '1' day ) - + , annual_net_deposit AS ( - SELECT + SELECT user , SUM(amount) AS net_deposit , reserve @@ -45,7 +45,7 @@ with latest_net_deposits AS ( GROUP BY 1,3,4,5 ORDER BY net_deposit DESC ) - + , ordered_annual_net_deposit AS ( SELECT row_number() OVER (partition by a.user, a.reserve ORDER BY a.evt_block_time DESC) AS rn @@ -56,14 +56,14 @@ with latest_net_deposits AS ( , a.evt_block_time FROM annual_net_deposit a ) - + SELECT user , net_deposit , reserve , symbol , evt_block_time - FROM ordered_annual_net_deposit + FROM ordered_annual_net_deposit WHERE rn = 1 ORDER BY net_deposit DESC ) @@ -77,12 +77,12 @@ with latest_net_deposits AS ( , cast(d.availableLiquidity as double) / pow(10, p.decimals) AS available_liquidity , d.call_block_time FROM {{ source('aave_v2_ethereum', 'DefaultReserveInterestRateStrategy_call_calculateInterestRates')}} d - LEFT JOIN {{ ref('prices_tokens') }} p + LEFT JOIN {{ source('prices','tokens') }} p ON p.contract_address = d.reserve AND p.blockchain = 'ethereum' ORDER BY call_block_time DESC ) - + SELECT reserve , symbol @@ -109,7 +109,7 @@ LEFT JOIN latest_available_liquidity l ON d.reserve = l.reserve AND d.symbol = l , final_base_label AS ( SELECT 'ethereum' AS blockchain - , user AS address + , user AS address , case when COALESCE(largest_deposit_pct, 0) <= 1 then 'Small Depositor' when largest_deposit_pct <= 10 then 'Sizeable Depositor' else 'Large Depositor' @@ -124,7 +124,7 @@ SELECT , net_deposit , available_liquidity , largest_deposit_pct - , symbol + , symbol FROM calc_deposit_pct ) @@ -139,4 +139,4 @@ SELECT , updated_at , model_name , label_type -FROM final_base_label \ No newline at end of file +FROM final_base_label diff --git a/models/_sector/labels/addresses/__single_category_labels__/balancer_v2/labels_balancer_v2_gauges_ethereum.sql b/models/_sector/labels/addresses/__single_category_labels__/balancer_v2/labels_balancer_v2_gauges_ethereum.sql index aad04be36e5..07b9abcaf31 100644 --- a/models/_sector/labels/addresses/__single_category_labels__/balancer_v2/labels_balancer_v2_gauges_ethereum.sql +++ b/models/_sector/labels/addresses/__single_category_labels__/balancer_v2/labels_balancer_v2_gauges_ethereum.sql @@ -1,5 +1,5 @@ {{config( - + alias = 'balancer_v2_gauges_ethereum', post_hook='{{ expose_spells(\'["ethereum"]\', "sector", @@ -44,7 +44,7 @@ FROM INNER JOIN {{ source('balancer_ethereum', 'CappedLiquidityGaugeFactory_call_create') }} call ON call.call_tx_hash = evt.evt_tx_hash LEFT JOIN {{ source('labels', 'balancer_v2_pools_ethereum') }} pools ON pools.address = call.pool -UNION ALL +UNION ALL SELECT 'ethereum' AS blockchain, @@ -60,7 +60,7 @@ SELECT 'balancer_v2_gauges_ethereum' AS model_name, 'identifier' AS label_type FROM - {{ ref('balancer_single_recipient_gauges') }} + {{ source('balancer','single_recipient_gauges') }} WHERE blockchain = 'ethereum'), @@ -82,7 +82,7 @@ INNER JOIN gauges g ON g.address = c.addr , g.pool_address , g.child_gauge_address , g.name - , CASE WHEN c.rn = 1 + , CASE WHEN c.rn = 1 THEN 'active' ELSE 'inactive' END AS status diff --git a/models/_sector/labels/addresses/__single_category_labels__/cex_users/labels_cex_users.sql b/models/_sector/labels/addresses/__single_category_labels__/cex_users/labels_cex_users.sql index fc93a4c00f3..25c5e1284d9 100644 --- a/models/_sector/labels/addresses/__single_category_labels__/cex_users/labels_cex_users.sql +++ b/models/_sector/labels/addresses/__single_category_labels__/cex_users/labels_cex_users.sql @@ -1,5 +1,5 @@ {{config( - + alias = 'cex_users', post_hook='{{ expose_spells(\'["optimism","ethereum"]\', "sector", @@ -36,7 +36,7 @@ FROM ( 'cex_users_withdrawals' model_name, 'persona' as label_type FROM {{source('erc20_' + chain, 'evt_transfer')}} t - INNER JOIN {{ref('cex_addresses')}} c ON '{{chain}}' = c.blockchain + INNER JOIN {{source('cex','addresses')}} c ON '{{chain}}' = c.blockchain AND t."from" = c.address {% if not loop.last %} @@ -44,4 +44,4 @@ FROM ( {% endif %} {% endfor %} ) a -GROUP BY 1,2,3,4,5,6,7,8,9,10 --distinct if erc20 and eth \ No newline at end of file +GROUP BY 1,2,3,4,5,6,7,8,9,10 --distinct if erc20 and eth diff --git a/models/_sector/labels/addresses/__single_category_labels__/likely_bots/op_chains/labels_op_chains_likely_bot_addresses.sql b/models/_sector/labels/addresses/__single_category_labels__/likely_bots/op_chains/labels_op_chains_likely_bot_addresses.sql index e90c682ed6f..ffe0e0264a5 100644 --- a/models/_sector/labels/addresses/__single_category_labels__/likely_bots/op_chains/labels_op_chains_likely_bot_addresses.sql +++ b/models/_sector/labels/addresses/__single_category_labels__/likely_bots/op_chains/labels_op_chains_likely_bot_addresses.sql @@ -33,7 +33,7 @@ WITH sender_transfer_rates AS ( WHEN EXISTS (SELECT 1 FROM {{ source('nft_' + chain,'transfers') }} r WHERE t.hash = r.tx_hash AND t.block_number = r.block_number AND blockchain = '{{chain}}') THEN 1 ELSE 0 END) AS num_token_tfer_txs , SUM(CASE WHEN EXISTS (SELECT 1 FROM {{ source('dex', 'trades') }} r WHERE t.hash = r.tx_hash AND t.block_time = r.block_time AND r.block_month = DATE_TRUNC('month',r.block_time) AND blockchain = '{{chain}}') THEN 1 ELSE 0 END) AS num_dex_trade_txs - , SUM(CASE WHEN EXISTS (SELECT 1 FROM {{ ref('perpetual_trades') }} r WHERE t.hash = r.tx_hash AND t.block_time = r.block_time AND r.block_month = DATE_TRUNC('month',r.block_time) AND blockchain = '{{chain}}') THEN 1 ELSE 0 END) AS num_perp_trade_txs + , SUM(CASE WHEN EXISTS (SELECT 1 FROM {{ source('perpetual','trades') }} r WHERE t.hash = r.tx_hash AND t.block_time = r.block_time AND r.block_month = DATE_TRUNC('month',r.block_time) AND blockchain = '{{chain}}') THEN 1 ELSE 0 END) AS num_perp_trade_txs , SUM(CASE WHEN EXISTS (SELECT 1 FROM {{ source('nft', 'trades') }} r WHERE t.hash = r.tx_hash AND t.block_number = r.block_number AND r.block_month = DATE_TRUNC('month',r.block_time) AND blockchain = '{{chain}}') THEN 1 ELSE 0 END) AS num_nft_trade_txs FROM {{ source( chain ,'transactions') }} t diff --git a/models/_sector/labels/addresses/__single_category_labels__/likely_bots/op_chains/labels_op_chains_likely_bot_contracts.sql b/models/_sector/labels/addresses/__single_category_labels__/likely_bots/op_chains/labels_op_chains_likely_bot_contracts.sql index 9c00229812f..106e09fdfe1 100644 --- a/models/_sector/labels/addresses/__single_category_labels__/likely_bots/op_chains/labels_op_chains_likely_bot_contracts.sql +++ b/models/_sector/labels/addresses/__single_category_labels__/likely_bots/op_chains/labels_op_chains_likely_bot_contracts.sql @@ -35,7 +35,7 @@ FROM ( WHEN EXISTS (SELECT 1 FROM {{ source('nft_' + chain,'transfers') }} r WHERE t.hash = r.tx_hash AND t.block_number = r.block_number ) THEN 1 ELSE 0 END) AS num_token_tfer_txs, SUM(CASE WHEN EXISTS (SELECT 1 FROM {{ source('dex', 'trades') }} r WHERE t.hash = r.tx_hash AND t.block_time = r.block_time AND r.block_month = DATE_TRUNC('month',r.block_time) AND blockchain = '{{chain}}') THEN 1 ELSE 0 END) AS num_dex_trade_txs, - SUM(CASE WHEN EXISTS (SELECT 1 FROM {{ ref('perpetual_trades') }} r WHERE t.hash = r.tx_hash AND t.block_time = r.block_time AND r.block_month = DATE_TRUNC('month',r.block_time) AND blockchain = '{{chain}}') THEN 1 ELSE 0 END) AS num_perp_trade_txs, + SUM(CASE WHEN EXISTS (SELECT 1 FROM {{ source('perpetual','trades') }} r WHERE t.hash = r.tx_hash AND t.block_time = r.block_time AND r.block_month = DATE_TRUNC('month',r.block_time) AND blockchain = '{{chain}}') THEN 1 ELSE 0 END) AS num_perp_trade_txs, SUM(CASE WHEN EXISTS (SELECT 1 FROM {{ source('nft', 'trades') }} r WHERE t.hash = r.tx_hash AND t.block_number = r.block_number AND r.block_month = DATE_TRUNC('month',r.block_time) AND blockchain = '{{chain}}') THEN 1 ELSE 0 END) AS num_nft_trade_txs, COUNT(*) AS num_txs, COUNT(DISTINCT "from") AS num_senders, COUNT(*)/COUNT(DISTINCT "from") AS txs_per_sender, diff --git a/models/_sector/labels/addresses/__single_category_labels__/op_perpetual/labels_op_perpetual_traders.sql b/models/_sector/labels/addresses/__single_category_labels__/op_perpetual/labels_op_perpetual_traders.sql index 9ffb0dbddf0..b8e44fe13d1 100644 --- a/models/_sector/labels/addresses/__single_category_labels__/op_perpetual/labels_op_perpetual_traders.sql +++ b/models/_sector/labels/addresses/__single_category_labels__/op_perpetual/labels_op_perpetual_traders.sql @@ -5,19 +5,19 @@ WITH perps_trades_count AS (SELECT trader, COUNT(trader) AS trades_count -FROM {{ ref('perpetual_trades') }} +FROM {{ source('perpetual','trades') }} WHERE blockchain = 'optimism' GROUP BY trader ORDER BY trades_count DESC), percentile_perp_trades AS -(SELECT approx_percentile (trades_count, 0.95) AS "0.95p", +(SELECT approx_percentile (trades_count, 0.95) AS "0.95p", approx_percentile(trades_count, 0.65) AS "0.65p" FROM perps_trades_count), perp_traders AS (SELECT trader AS address, -(CASE +(CASE WHEN trades_count >= (SELECT "0.95p" FROM percentile_perp_trades) THEN 'Elite Perp Trader' WHEN trades_count >= (SELECT "0.65p" FROM percentile_perp_trades) THEN 'Active Perp Trader' ELSE 'Normie Perp Trader' diff --git a/models/_sector/labels/addresses/__single_category_labels__/safe/labels_safe_ethereum.sql b/models/_sector/labels/addresses/__single_category_labels__/safe/labels_safe_ethereum.sql index 57940a759a8..806c648eb0e 100644 --- a/models/_sector/labels/addresses/__single_category_labels__/safe/labels_safe_ethereum.sql +++ b/models/_sector/labels/addresses/__single_category_labels__/safe/labels_safe_ethereum.sql @@ -1,5 +1,5 @@ {{config( - + alias = 'safe_ethereum' )}} @@ -14,4 +14,4 @@ SELECT now() as updated_at, 'safe_ethereum' AS model_name, 'persona' AS label_type -FROM {{ ref('safe_ethereum_safes') }} \ No newline at end of file +FROM {{ source('safe_ethereum','safes') }} diff --git a/models/_sector/labels/addresses/dex/persona/smart_dex_traders/ethereum/labels_smart_dex_traders_ethereum.sql b/models/_sector/labels/addresses/dex/persona/smart_dex_traders/ethereum/labels_smart_dex_traders_ethereum.sql index 4bbbc2e7eea..76304375722 100644 --- a/models/_sector/labels/addresses/dex/persona/smart_dex_traders/ethereum/labels_smart_dex_traders_ethereum.sql +++ b/models/_sector/labels/addresses/dex/persona/smart_dex_traders/ethereum/labels_smart_dex_traders_ethereum.sql @@ -1,5 +1,5 @@ {{config( - + alias = 'smart_dex_traders_ethereum' )}} /* @@ -8,54 +8,54 @@ ** ref link: https://duneanalytics.notion.site/Dune-Labels-Hackathon-2023-9c1edd4b776a44699a1524bf4131105d ** ** What questions does this label help to solve? -** 1. "How many real users are trading on our DEX?" - It's hard for dune wizards to figure out +** 1. "How many real users are trading on our DEX?" - It's hard for dune wizards to figure out ** how many "real" (ie. human, retail) traders are trading on a DEX. Although dune wizards -** have existing labels such as labels.contracts to identify and filter +** have existing labels such as labels.contracts to identify and filter ** out trades that take place via contract interactions, this does not catch all bot activity. ** -** "Real" user activity is an important metric for DEX projects to track, in order -** to advise product strategy and development effectively. +** "Real" user activity is an important metric for DEX projects to track, in order +** to advise product strategy and development effectively. ** ** > This label seeks to identify "human-like" behavior based on heuristics. ** ** 2. "Who are the top performing retail traders on our DEX?" - While there are dashboards ** that track portfolio performance eg. @defimochi's https://dune.com/defimochi/token-god-mode, -** most of the top traders are bots due to the challange of identifying real users. +** most of the top traders are bots due to the challange of identifying real users. +** +** For DEX projects, this is a strong indicator that power users are attacted to the platform. ** -** For DEX projects, this is a strong indicator that power users are attacted to the platform. +** > This label seeks to identify top Retail DEX traders based on Average Cost Basis analysis. ** -** > This label seeks to identify top Retail DEX traders based on Average Cost Basis analysis. -** ** How this label defines a Smart DEX Trader: ** 1. Trader = An address exhibitiing "human-like" behavior (Retail trader, ie. not a bot) ** 2. Smart = A trader having a portfolio with high profit multiples -** -** Scope: +** +** Scope: ** To limit the results returned from this label, the scope is defined as: ** 1. DEX Trades on Ethereum ** 2. Portfolio performance over the last 60 days ** 3. Top 10% of retail traders ranked by profit multiple ** ** Considerations (limitations): -** 1. Heuristics used to detect retail (human-like) behavior are subjective and +** 1. Heuristics used to detect retail (human-like) behavior are subjective and ** oversimplified. This means that the results returned may have false positives (bots) and ** false negatives (excluded real retail traders). ** 2. A simple portfolio profitability model based on average cost basis is used. Transaction -** fees, LP and Farming activity are not considered in this model. -** +** fees, LP and Farming activity are not considered in this model. +** ** Future work: ** 1. How may we test the effectiveness of this label? ** 2. How may we improve, or move away from, "real user" heuristics? ** 3. How may we improve portfolio monitoring and profitability metrics? -** -** Disclaimer: -** 1. As with anything on the internet, please review the code before using it in -** production. +** +** Disclaimer: +** 1. As with anything on the internet, please review the code before using it in +** production. ** 2. Feedback and suggestions are welcome! I'm sure there's lots of room for improvement. ** Find me on Dune discord: Stone#6981 */ -with +with /* ** In this section, we remove contract addresses as we assume retail traders would not be swapping via contracts. @@ -63,7 +63,7 @@ with -- Get all swappers on Ethereum in the last 60 days swappers as ( - select + select block_date, block_time, token_bought_symbol, @@ -76,8 +76,8 @@ swappers as ( taker, tx_hash from {{ source('dex', 'trades') }} - where - blockchain = 'ethereum' + where + blockchain = 'ethereum' and block_date > now() - interval '60' day -- remove missing data https://discordapp.com/channels/757637422384283659/757641002138730588/903537780007784510 and token_bought_symbol != '' @@ -114,29 +114,29 @@ swappers as ( -- H1. A retail trader does not execute the same amount of trades every day. eg, takes weekends off, prefers mondays. -- Trades taken should tend twards weekends or weekdays. ie. skewness <> 0 , filter_by_weekday as ( - select taker, + select taker, skewness(day_of_week(block_date)) as trading_day_variance from swappers_address_only group by 1 having - -- Note on day-of-week skewness: + -- Note on day-of-week skewness: -- negative/positive = distribution of trades is towards end/start of the week -- zero = distribution of trades is even across all days of the week -- NaN = data does not provide sufficient information about its distribution (skewness(day_of_week(block_date)) > 0 or skewness(day_of_week(block_date)) < 0) ) --- H2. A retail trader trades takes breaks between trades. +-- H2. A retail trader trades takes breaks between trades. -- ie. average time between trades > 60 mins , time_between_trades as ( - select + select taker, date_diff('second', lag(block_time, 1) over (partition by taker order by block_time), block_time) / 60 as time_between_trades_mins from swappers_address_only ) -- Note: We can't have nested aggregate functions, so breaking it up into two CTEs , filter_by_average_time_between_trades as ( - select + select taker, avg(time_between_trades_mins) as average_time_between_trades_mins from time_between_trades @@ -146,7 +146,7 @@ swappers as ( ) -- Apply all filters to get retail swappers -, all_filters as ( +, all_filters as ( select t.taker as taker from filter_by_average_time_between_trades as t left join (select taker from filter_by_weekday) as w on t.taker = w.taker @@ -161,14 +161,14 @@ swappers as ( /* ** In this section, we assess the trader's portfolio based on the following metrics: -** P1. Portfolio profit based on average cost-basis +** P1. Portfolio profit based on average cost-basis ** P2. Profit multiples */ -- Get latest prices , prices as ( select symbol, price, contract_address as token_address - from {{ ref('prices_usd_latest') }} + from {{ source('prices','usd_latest') }} where blockchain = 'ethereum' ) @@ -177,7 +177,7 @@ swappers as ( -- buy profit = token_bought_amount * (current price - amount_usd/ token_bought_amount) -- sell profit = token_sold_amount * (current price - amount_usd/ token_sold_amount) , buys as ( - select + select 'buy' as action, block_time, token_sold_symbol, @@ -185,7 +185,7 @@ swappers as ( token_bought_symbol, token_bought_address as token_bought_address, token_bought_amount, - amount_usd, + amount_usd, taker, amount_usd / token_bought_amount as cost_basis, project as venue @@ -199,15 +199,15 @@ swappers as ( and amount_usd is not NULL ) , buys_profit as ( - select b.*, - p.price as market_price_usd, - b.token_bought_amount * (p.price - b.amount_usd / b.token_bought_amount) as estimated_profit - from buys as b + select b.*, + p.price as market_price_usd, + b.token_bought_amount * (p.price - b.amount_usd / b.token_bought_amount) as estimated_profit + from buys as b left join prices as p on b.token_bought_address = p.token_address where p.price is not NULL ) , sells as ( - select + select 'sell' as action, block_time, token_sold_symbol, @@ -215,7 +215,7 @@ swappers as ( token_bought_symbol, token_bought_address token_bought_address, token_sold_amount, - amount_usd, + amount_usd, taker, amount_usd / token_sold_amount as cost_basis, project as venue @@ -229,15 +229,15 @@ swappers as ( and amount_usd is not NULL ) , sells_profit as ( - select s.*, - p.price as market_price_usd, - s.token_sold_amount * (p.price - s.amount_usd / s.token_sold_amount) as estimated_profit + select s.*, + p.price as market_price_usd, + s.token_sold_amount * (p.price - s.amount_usd / s.token_sold_amount) as estimated_profit from sells as s left join prices as p on s.token_sold_address = p.token_address where p.price is not NULL ) , profit_leaderboard as ( - select taker, + select taker, sum(estimated_profit) as total_profit_USD, sum(estimated_profit) / sum(amount_usd) as profit_multiple from ( @@ -246,11 +246,11 @@ swappers as ( select * from buys_profit ) group by 1 - having sum(estimated_profit) > 0 + having sum(estimated_profit) > 0 ) -- Apply filter to get retail leaderboard , retail_leaderboard as ( - select + select r.taker as taker, p.total_profit_USD as total_profit_USD, p.profit_multiple as profit_multiple @@ -261,31 +261,31 @@ swappers as ( -- Get top 10% of retail traders , percentiles as ( - select taker, + select taker, total_profit_USD, profit_multiple, percent_rank() over (order by profit_multiple) as percent_rank from retail_leaderboard ) , retail_top_percent as ( - select taker, + select taker, total_profit_USD, profit_multiple, - percent_rank + percent_rank from percentiles where percent_rank >= 0.90 ) -select +select 'ethereum' as blockchain, - taker as address, - 'Top 10% Dex Traders (Retail)' as name, - 'dex' as category, + taker as address, + 'Top 10% Dex Traders (Retail)' as name, + 'dex' as category, 'stone' as contributor, 'query' as source, TIMESTAMP '2023-03-14' as created_at, now() as updated_at, - 'smart_dex_traders' as model_name, + 'smart_dex_traders' as model_name, 'persona' as label_type from retail_top_percent diff --git a/models/_sector/labels/addresses/infrastructure/identifier/eth_stakers/labels_eth_stakers.sql b/models/_sector/labels/addresses/infrastructure/identifier/eth_stakers/labels_eth_stakers.sql index a5d08996f8f..bb0bef0e39f 100644 --- a/models/_sector/labels/addresses/infrastructure/identifier/eth_stakers/labels_eth_stakers.sql +++ b/models/_sector/labels/addresses/infrastructure/identifier/eth_stakers/labels_eth_stakers.sql @@ -16,7 +16,7 @@ WITH identified_stakers AS ( , NOW() AS updated_at , 'eth_stakers' AS model_name , 'identifier' as label_type - FROM {{ ref('staking_ethereum_entities') }} + FROM {{ source('staking_ethereum','entities') }} ) , unidentified_stakers AS ( @@ -42,4 +42,4 @@ WITH identified_stakers AS ( SELECT * FROM identified_stakers UNION ALL -SELECT * FROM unidentified_stakers \ No newline at end of file +SELECT * FROM unidentified_stakers diff --git a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_arbitrum.sql b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_arbitrum.sql index 4952844f984..688ddf58e5c 100644 --- a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_arbitrum.sql +++ b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_arbitrum.sql @@ -1,5 +1,5 @@ {{config( - + alias = 'cex_arbitrum', post_hook='{{ expose_spells(\'["arbitrum"]\', "sector", @@ -16,4 +16,5 @@ SELECT blockchain , NOW() AS updated_at , 'cex_' || blockchain AS model_name , 'identifier' AS label_type -FROM {{ ref('cex_arbitrum_addresses') }} \ No newline at end of file +FROM {{ source('cex','addresses') }} +WHERE blockchain = 'arbitrum' diff --git a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_avalanche_c.sql b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_avalanche_c.sql index 20a67670ee4..5b67eac1c17 100644 --- a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_avalanche_c.sql +++ b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_avalanche_c.sql @@ -1,5 +1,5 @@ {{config( - + alias = 'cex_avalanche_c', post_hook='{{ expose_spells(\'["avalanche_c"]\', "sector", @@ -16,4 +16,5 @@ SELECT blockchain , NOW() AS updated_at , 'cex_' || blockchain AS model_name , 'identifier' AS label_type -FROM {{ ref('cex_avalanche_c_addresses') }} \ No newline at end of file +FROM {{ source('cex','addresses') }} +WHERE blockchain = 'avalanche_c' diff --git a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_bitcoin.sql b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_bitcoin.sql index 465086d87da..9c824607205 100644 --- a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_bitcoin.sql +++ b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_bitcoin.sql @@ -1,5 +1,5 @@ {{config( - + alias = 'cex_bitcoin', post_hook='{{ expose_spells(\'["bitcoin"]\', "sector", @@ -7,7 +7,7 @@ \'["hildobby"]\') }}')}} SELECT blockchain -, from_base58(address) as address +, from_base58(cast(address as varchar)) as address , distinct_name AS name , 'institution' AS category , added_by AS contributor @@ -16,5 +16,6 @@ SELECT blockchain , NOW() AS updated_at , 'cex_' || blockchain AS model_name , 'identifier' AS label_type -FROM {{ ref('cex_bitcoin_addresses') }} -WHERE regexp_like(address, '^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$') +FROM {{ source('cex','addresses') }} +WHERE blockchain = 'bitcoin' +AND regexp_like(cast(address as varchar), '^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$') diff --git a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_bnb.sql b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_bnb.sql index 36a5f7f31e0..b73db275154 100644 --- a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_bnb.sql +++ b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_bnb.sql @@ -1,5 +1,5 @@ {{config( - + alias = 'cex_bnb', post_hook='{{ expose_spells(\'["bnb"]\', "sector", @@ -16,4 +16,5 @@ SELECT blockchain , NOW() AS updated_at , 'cex_' || blockchain AS model_name , 'identifier' AS label_type -FROM {{ ref('cex_bnb_addresses') }} \ No newline at end of file +FROM {{ source('cex','addresses') }} +WHERE blockchain = 'bnb' diff --git a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_ethereum.sql b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_ethereum.sql index 7ebbf6966a4..46a2a3a3733 100644 --- a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_ethereum.sql +++ b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_ethereum.sql @@ -1,5 +1,5 @@ {{config( - + alias = 'cex_ethereum', post_hook='{{ expose_spells(\'["ethereum"]\', "sector", @@ -16,4 +16,5 @@ SELECT blockchain , NOW() AS updated_at , 'cex_' || blockchain AS model_name , 'identifier' AS label_type -FROM {{ ref('cex_ethereum_addresses') }} \ No newline at end of file +FROM {{ source('cex','addresses') }} +WHERE blockchain = 'ethereum' diff --git a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_fantom.sql b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_fantom.sql index 2873257fb77..6b80ef54c11 100644 --- a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_fantom.sql +++ b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_fantom.sql @@ -1,5 +1,5 @@ {{config( - + alias = 'cex_fantom', post_hook='{{ expose_spells(\'["fantom"]\', "sector", @@ -16,4 +16,5 @@ SELECT blockchain , NOW() AS updated_at , 'cex_' || blockchain AS model_name , 'identifier' AS label_type -FROM {{ ref('cex_fantom_addresses') }} \ No newline at end of file +FROM {{ source('cex','addresses') }} +WHERE blockchain = 'fantom' diff --git a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_optimism.sql b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_optimism.sql index 1ab8d849462..65109d20317 100644 --- a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_optimism.sql +++ b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_optimism.sql @@ -1,5 +1,5 @@ {{config( - + alias = 'cex_optimism', post_hook='{{ expose_spells(\'["optimism"]\', "sector", @@ -16,4 +16,5 @@ SELECT blockchain , NOW() AS updated_at , 'cex_' || blockchain AS model_name , 'identifier' AS label_type -FROM {{ ref('cex_optimism_addresses') }} \ No newline at end of file +FROM {{ source('cex','addresses') }} +WHERE blockchain = 'optimism' diff --git a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_polygon.sql b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_polygon.sql index 0dd631a49d7..cc57eb8fde4 100644 --- a/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_polygon.sql +++ b/models/_sector/labels/addresses/institution/identifier/cex/labels_cex_polygon.sql @@ -1,5 +1,5 @@ {{config( - + alias = 'cex_polygon', post_hook='{{ expose_spells(\'["polygon"]\', "sector", @@ -16,4 +16,5 @@ SELECT blockchain , NOW() AS updated_at , 'cex_' || blockchain AS model_name , 'identifier' AS label_type -FROM {{ ref('cex_polygon_addresses') }} \ No newline at end of file +FROM {{ source('cex','addresses') }} +WHERE blockchain = 'polygon' diff --git a/models/_sector/labels/addresses/social/identifier/ens/labels_ens.sql b/models/_sector/labels/addresses/social/identifier/ens/labels_ens.sql index 8ded3e2f02b..f34302fb15a 100644 --- a/models/_sector/labels/addresses/social/identifier/ens/labels_ens.sql +++ b/models/_sector/labels/addresses/social/identifier/ens/labels_ens.sql @@ -1,5 +1,5 @@ {{config(alias = 'ens', - + materialized = 'table', file_format = 'delta', unique_key = ['blockchain','address'], @@ -31,10 +31,10 @@ FROM ( address, name ,row_number() over (partition by address order by block_time asc) as ordering - from {{ ref('ens_resolver_latest') }} + from {{ source('ens','resolver_latest') }} ) where ordering = 1 ) res - FULL OUTER JOIN {{ ref('ens_reverse_latest') }} rev + FULL OUTER JOIN {{ source('ens','reverse_latest') }} rev ON res.address = rev.address ) ens @@ -48,7 +48,7 @@ FROM ( -- 'query' AS source, -- date('2022-10-06') as created_at, -- now() as modified_at ---FROM {{ ref('ens_resolver_latest') }} +--FROM {{ source('ens','resolver_latest') }} --UNION --SELECT 'ethereum' as blockchain, -- address, @@ -58,5 +58,5 @@ FROM ( -- 'query' AS source, -- date('2022-10-06') as created_at, -- now() as modified_at ---FROM {{ ref('ens_reverse_latest') }} +--FROM {{ source('ens','reverse_latest') }} diff --git a/models/_sector/labels/addresses/social/persona/ens/labels_three_letter_ens_count.sql b/models/_sector/labels/addresses/social/persona/ens/labels_three_letter_ens_count.sql index a924fbad839..a6a7d0563c7 100644 --- a/models/_sector/labels/addresses/social/persona/ens/labels_three_letter_ens_count.sql +++ b/models/_sector/labels/addresses/social/persona/ens/labels_three_letter_ens_count.sql @@ -1,14 +1,14 @@ {{config( - + alias = 'three_letter_ens_count' )}} WITH three_letter_ens_count AS ( - SELECT + SELECT owner, count(owner) as ens_count FROM - {{ ref('ens_view_registrations') }} + {{ source('ens','view_registrations') }} WHERE length(name) = 3 @@ -28,4 +28,4 @@ SELECT 'personas' as label_type, concat('Number of three letter ENS Domains owned: ', CAST(ens_count AS VARCHAR)) as name FROM three_letter_ens_count -WHERE owner is not null \ No newline at end of file +WHERE owner is not null diff --git a/models/aave/arbitrum/aave_arbitrum_flashloans.sql b/models/aave/arbitrum/aave_arbitrum_flashloans.sql index 645c18e2434..2853e756ced 100644 --- a/models/aave/arbitrum/aave_arbitrum_flashloans.sql +++ b/models/aave/arbitrum/aave_arbitrum_flashloans.sql @@ -26,6 +26,6 @@ select block_number, tx_hash, evt_index -from {{ ref('lending_flashloans') }} +from {{ source('lending','flashloans') }} where blockchain = 'arbitrum' and project = 'aave' diff --git a/models/aave/avalanche_c/aave_avalanche_c_flashloans.sql b/models/aave/avalanche_c/aave_avalanche_c_flashloans.sql index eb648b547e9..09db672e4a9 100644 --- a/models/aave/avalanche_c/aave_avalanche_c_flashloans.sql +++ b/models/aave/avalanche_c/aave_avalanche_c_flashloans.sql @@ -26,6 +26,6 @@ select block_number, tx_hash, evt_index -from {{ ref('lending_flashloans') }} +from {{ source('lending','flashloans') }} where blockchain = 'avalanche_c' and project = 'aave' diff --git a/models/aave/base/aave_base_flashloans.sql b/models/aave/base/aave_base_flashloans.sql index 3e75732ed0a..3cc7953ba4a 100644 --- a/models/aave/base/aave_base_flashloans.sql +++ b/models/aave/base/aave_base_flashloans.sql @@ -26,6 +26,6 @@ select block_number, tx_hash, evt_index -from {{ ref('lending_flashloans') }} +from {{ source('lending','flashloans') }} where blockchain = 'base' and project = 'aave' diff --git a/models/aave/ethereum/aave_ethereum_borrow.sql b/models/aave/ethereum/aave_ethereum_borrow.sql index ae3101bdae9..dbdf5d2aac2 100644 --- a/models/aave/ethereum/aave_ethereum_borrow.sql +++ b/models/aave/ethereum/aave_ethereum_borrow.sql @@ -30,6 +30,6 @@ select project_contract_address, tx_hash, evt_index -from {{ ref('lending_borrow') }} +from {{ source('lending','borrow') }} where blockchain = 'ethereum' and project = 'aave' diff --git a/models/aave/ethereum/aave_ethereum_flashloans.sql b/models/aave/ethereum/aave_ethereum_flashloans.sql index 706bb7e1b42..dbffd26fb1c 100644 --- a/models/aave/ethereum/aave_ethereum_flashloans.sql +++ b/models/aave/ethereum/aave_ethereum_flashloans.sql @@ -26,6 +26,6 @@ select block_number, tx_hash, evt_index -from {{ ref('lending_flashloans') }} +from {{ source('lending','flashloans') }} where blockchain = 'ethereum' and project = 'aave' diff --git a/models/aave/ethereum/aave_ethereum_supply.sql b/models/aave/ethereum/aave_ethereum_supply.sql index 0827b2fbda5..9674cf0f290 100644 --- a/models/aave/ethereum/aave_ethereum_supply.sql +++ b/models/aave/ethereum/aave_ethereum_supply.sql @@ -29,6 +29,6 @@ select project_contract_address, tx_hash, evt_index -from {{ ref('lending_supply') }} +from {{ source('lending','supply') }} where blockchain = 'ethereum' and project = 'aave' diff --git a/models/aave/fantom/aave_fantom_flashloans.sql b/models/aave/fantom/aave_fantom_flashloans.sql index e29ca988b05..152b506b2fd 100644 --- a/models/aave/fantom/aave_fantom_flashloans.sql +++ b/models/aave/fantom/aave_fantom_flashloans.sql @@ -26,6 +26,6 @@ select block_number, tx_hash, evt_index -from {{ ref('lending_flashloans') }} +from {{ source('lending','flashloans') }} where blockchain = 'fantom' and project = 'aave' diff --git a/models/aave/optimism/aave_optimism_borrow.sql b/models/aave/optimism/aave_optimism_borrow.sql index 62be5759f04..9de1c83e864 100644 --- a/models/aave/optimism/aave_optimism_borrow.sql +++ b/models/aave/optimism/aave_optimism_borrow.sql @@ -30,6 +30,6 @@ select project_contract_address, tx_hash, evt_index -from {{ ref('lending_borrow') }} +from {{ source('lending','borrow') }} where blockchain = 'optimism' and project = 'aave' diff --git a/models/aave/optimism/aave_optimism_flashloans.sql b/models/aave/optimism/aave_optimism_flashloans.sql index e92d3a555c3..41eb2bc9b37 100644 --- a/models/aave/optimism/aave_optimism_flashloans.sql +++ b/models/aave/optimism/aave_optimism_flashloans.sql @@ -26,6 +26,6 @@ select block_number, tx_hash, evt_index -from {{ ref('lending_flashloans') }} +from {{ source('lending','flashloans') }} where blockchain = 'optimism' and project = 'aave' diff --git a/models/aave/optimism/aave_optimism_supply.sql b/models/aave/optimism/aave_optimism_supply.sql index 94999f2c6de..53d59d3c7b3 100644 --- a/models/aave/optimism/aave_optimism_supply.sql +++ b/models/aave/optimism/aave_optimism_supply.sql @@ -29,6 +29,6 @@ select project_contract_address, tx_hash, evt_index -from {{ ref('lending_supply') }} +from {{ source('lending','supply') }} where blockchain = 'optimism' and project = 'aave' diff --git a/models/aave/polygon/aave_polygon_flashloans.sql b/models/aave/polygon/aave_polygon_flashloans.sql index f7a10f4f524..7e3bbc4c9d6 100644 --- a/models/aave/polygon/aave_polygon_flashloans.sql +++ b/models/aave/polygon/aave_polygon_flashloans.sql @@ -26,6 +26,6 @@ select block_number, tx_hash, evt_index -from {{ ref('lending_flashloans') }} +from {{ source('lending','flashloans') }} where blockchain = 'polygon' and project = 'aave' diff --git a/models/compound/ethereum/compound_ethereum_borrow.sql b/models/compound/ethereum/compound_ethereum_borrow.sql index dd7775a1730..c7825fe85b5 100644 --- a/models/compound/ethereum/compound_ethereum_borrow.sql +++ b/models/compound/ethereum/compound_ethereum_borrow.sql @@ -30,6 +30,6 @@ select project_contract_address, tx_hash, evt_index -from {{ ref('lending_borrow') }} +from {{ source('lending','borrow') }} where blockchain = 'ethereum' and project = 'compound' diff --git a/models/compound/ethereum/compound_ethereum_schema.yml b/models/compound/ethereum/compound_ethereum_schema.yml index 91feab51859..71a5237f65b 100644 --- a/models/compound/ethereum/compound_ethereum_schema.yml +++ b/models/compound/ethereum/compound_ethereum_schema.yml @@ -99,25 +99,6 @@ models: name: description description: "Description of the proposal" - - name: compound_v2_ethereum_ctokens - meta: - blockchain: ethereum - sector: lending - project: compound_v2 - contributors: bizzyvinci - config: - tags: ['ethereum', 'compound', 'compound_v2', 'cToken', 'cEther', 'cErc20'] - description: "All compound v2 cTokens" - columns: - - name: asset_symbol - description: "Underlying asset symbol" - - name: ctoken_address - description: "cToken address" - - name: asset_address - description: "Underlying asset address" - - name: decimals_mantissa - description: "10 raise to power decimals of underlying asset" - - name: compound_ethereum_supply meta: blockchain: ethereum diff --git a/models/compound/ethereum/compound_ethereum_supply.sql b/models/compound/ethereum/compound_ethereum_supply.sql index 32ede1d7a53..892f9c0a79b 100644 --- a/models/compound/ethereum/compound_ethereum_supply.sql +++ b/models/compound/ethereum/compound_ethereum_supply.sql @@ -29,6 +29,6 @@ select project_contract_address, tx_hash, evt_index -from {{ ref('lending_supply') }} +from {{ source('lending','supply') }} where blockchain = 'ethereum' and project = 'compound' diff --git a/models/dao/ens/_schema.yml b/models/dao/ens/_schema.yml new file mode 100644 index 00000000000..b8dcea7225a --- /dev/null +++ b/models/dao/ens/_schema.yml @@ -0,0 +1,100 @@ +version: 2 + +models: + - name: ens_ethereum_votes + meta: + blockchain: ethereum + sector: dao + contributors: soispoke + config: + tags: ['ethereum', 'votes', 'dao', 'cross-chain'] + description: > + DAO votes on all chains across all contracts and versions + columns: + - name: blockchain + - name: project + description: "Project name of the DAO" + - name: version + description: "Version of the contract built and deployed by the DAO project" + - name: block_time + description: "UTC event block time of each DAO vote" + - name: tx_hash + description: "Unique transaction hash value tied to each vote on the DAO" + - &dao_name + name: dao_name + description: "DAO name" + - &dao_address + name: dao_address + description: "DAO wallet address" + - &proposal_id + name: proposal_id + - &votes + name: votes + description: "Votes weighted by the amount of governance tokens" + - &votes_share + name: votes_share + description: "Votes share in percent for a given proposal" + - &token_symbol + name: token_symbol + - &token_address + name: token_address + - &votes_value_usd + name: votes_value_usd + description: "USD amount of governance tokens used at the time of the vote" + - &voter_address + name: voter_address + - &support + name: support + description: "0 = Against, 1 = For, 2 = Abstain votes" + tests: + - accepted_values: + values: ['for', 'against', 'abstain'] + - &reason + name: reason + description: "Optional onchain comments to explain votes" + + - name: ens_ethereum_proposals + meta: + blockchain: ethereum + sector: dao + contributors: soispoke + config: + tags: ['ethereum', 'proposals', 'dao', 'cross-chain'] + description: > + DAO proposals on all chains across all contracts and versions + columns: + - name: blockchain + - name: project + description: "Project name of the DAO" + - name: version + description: "Version of the contract built and deployed by the DAO project" + - name: created_at + description: "UTC event block time at which the proposal was created" + - name: tx_hash + description: "Unique transaction hash value tied to each DAO proposal" + - *dao_name + - *dao_address + - name: proposal_id + tests: + - unique + - &votes_for + name: votes_for + - &votes_against + name: votes_against + - &votes_total + name: votes_total + description: "Total number of governance tokens used to vote on a given DAO proposal" + - &number_of_voters + name: number_of_voters + - &participation + name: participation + description: "Participation in percent: Number of governance tokens used to vote / Total token supply" + - &status + name: status + description: "Proposal status: Queued, Active, Executed, Canceled or Defeated" + tests: + - accepted_values: + values: ['Queued', 'Active', 'Executed', 'Canceled','Defeated'] + - &description + name: description + description: "Description of the proposal" diff --git a/models/ens/ens_ethereum_proposals.sql b/models/dao/ens/ens_ethereum_proposals.sql similarity index 100% rename from models/ens/ens_ethereum_proposals.sql rename to models/dao/ens/ens_ethereum_proposals.sql diff --git a/models/ens/ens_ethereum_votes.sql b/models/dao/ens/ens_ethereum_votes.sql similarity index 100% rename from models/ens/ens_ethereum_votes.sql rename to models/dao/ens/ens_ethereum_votes.sql diff --git a/models/dex/dex_flashloans.sql b/models/dex/dex_flashloans.sql index 41a15f76d25..3323b357e12 100644 --- a/models/dex/dex_flashloans.sql +++ b/models/dex/dex_flashloans.sql @@ -15,7 +15,7 @@ {% set flashloan_models = [ ref('aave_flashloans') -, ref('balancer_flashloans') +, source('balancer','flashloans') , ref('dydx_ethereum_flashloans') , ref('uniswap_flashloans') , ref('euler_ethereum_flashloans') diff --git a/models/dex/dex_incentive_mappings.sql b/models/dex/dex_incentive_mappings.sql index 57b28ba4d43..8725771c881 100644 --- a/models/dex/dex_incentive_mappings.sql +++ b/models/dex/dex_incentive_mappings.sql @@ -1,6 +1,6 @@ {{ config( alias = 'incentive_mappings', - + post_hook='{{ expose_spells(\'["optimism","base"]\', "sector", "dex", @@ -10,7 +10,7 @@ {% set dex_inc_models = [ - ref('balancer_gauge_mappings') + source('balancer','gauge_mappings') ,ref('velodrome_optimism_bribe_mappings') ,ref('aerodrome_base_bribe_mappings') ] %} @@ -29,7 +29,7 @@ FROM ( incentives_type, evt_block_time, evt_block_number, - contract_address, + contract_address, evt_tx_hash, evt_index diff --git a/models/moola/celo/moola_celo_borrow.sql b/models/moola/celo/moola_celo_borrow.sql index 40f2418fb40..09cc001b9df 100644 --- a/models/moola/celo/moola_celo_borrow.sql +++ b/models/moola/celo/moola_celo_borrow.sql @@ -28,6 +28,6 @@ select block_number, tx_hash, evt_index -from {{ ref('lending_borrow') }} +from {{ source('lending','borrow') }} where blockchain = 'celo' and project = 'moola' diff --git a/models/moola/celo/moola_celo_flashloans.sql b/models/moola/celo/moola_celo_flashloans.sql index cd2d32f03df..3ae85837f40 100644 --- a/models/moola/celo/moola_celo_flashloans.sql +++ b/models/moola/celo/moola_celo_flashloans.sql @@ -26,6 +26,6 @@ select block_number, tx_hash, evt_index -from {{ ref('lending_flashloans') }} +from {{ source('lending','flashloans') }} where blockchain = 'celo' and project = 'moola' diff --git a/models/moola/celo/moola_celo_supply.sql b/models/moola/celo/moola_celo_supply.sql index 7af87527746..58f86e8cea2 100644 --- a/models/moola/celo/moola_celo_supply.sql +++ b/models/moola/celo/moola_celo_supply.sql @@ -27,6 +27,6 @@ select block_number, tx_hash, evt_index -from {{ ref('lending_supply') }} +from {{ source('lending','supply') }} where blockchain = 'celo' and project = 'moola' diff --git a/models/moonwell/base/moonwell_base_schema.yml b/models/moonwell/base/moonwell_base_schema.yml deleted file mode 100644 index 1154dc6b4ac..00000000000 --- a/models/moonwell/base/moonwell_base_schema.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: 2 - -models: - - name: moonwell_base_ctokens - meta: - blockchain: base - sector: lending - project: moonwell - contributors: tomfutago - config: - tags: ['base', 'lending', 'compound', 'moonwell'] - description: "All moonwell cTokens" - columns: - - name: asset_symbol - description: "Underlying asset symbol" - - name: ctoken_address - description: "cToken address" - - name: asset_address - description: "Underlying asset address" diff --git a/models/nexusmutual/ethereum/capital_pool/nexusmutual_ethereum_capital_pool_transfers.sql b/models/nexusmutual/ethereum/capital_pool/nexusmutual_ethereum_capital_pool_transfers.sql index 08a1ab17190..d2dfd0d2dc8 100644 --- a/models/nexusmutual/ethereum/capital_pool/nexusmutual_ethereum_capital_pool_transfers.sql +++ b/models/nexusmutual/ethereum/capital_pool/nexusmutual_ethereum_capital_pool_transfers.sql @@ -41,7 +41,7 @@ transfer_in as ( contract_address, unique_key, tx_hash - from {{ ref('tokens_ethereum_transfers') }} + from {{ source('tokens_ethereum','transfers') }} where block_time >= timestamp '2019-05-01' and "to" in (select contract_address from nexusmutual_contracts) and symbol in ('ETH', 'DAI', 'stETH', 'rETH', 'USDC') @@ -61,7 +61,7 @@ transfer_out as ( contract_address, unique_key, tx_hash - from {{ ref('tokens_ethereum_transfers') }} + from {{ source('tokens_ethereum','transfers') }} where block_time >= timestamp '2019-05-01' and "from" in (select contract_address from nexusmutual_contracts) and symbol in ('ETH', 'DAI', 'stETH', 'rETH', 'USDC') @@ -81,7 +81,7 @@ transfer_nxmty_in as ( contract_address, unique_key, tx_hash - from {{ ref('tokens_ethereum_transfers') }} + from {{ source('tokens_ethereum','transfers') }} where block_time >= timestamp '2022-05-27' and "to" in (select contract_address from nexusmutual_contracts) and contract_address = 0x27f23c710dd3d878fe9393d93465fed1302f2ebd --NXMTY @@ -101,7 +101,7 @@ transfer_nxmty_out as ( contract_address, unique_key, tx_hash - from {{ ref('tokens_ethereum_transfers') }} + from {{ source('tokens_ethereum','transfers') }} where block_time >= timestamp '2022-05-27' and "from" in (select contract_address from nexusmutual_contracts) and contract_address = 0x27f23c710dd3d878fe9393d93465fed1302f2ebd --NXMTY diff --git a/models/sudoswap/ethereum/sudoswap_ethereum_pool_trades_agg_day.sql b/models/sudoswap/ethereum/sudoswap_ethereum_pool_trades_agg_day.sql index 736e5e97e8b..f73186e109b 100644 --- a/models/sudoswap/ethereum/sudoswap_ethereum_pool_trades_agg_day.sql +++ b/models/sudoswap/ethereum/sudoswap_ethereum_pool_trades_agg_day.sql @@ -42,7 +42,7 @@ SELECT END ) AS nft_change_trading FROM {{ source('sudoswap_ethereum','base_trades') }} t -LEFT JOIN {{ ref('prices_usd_forward_fill') }} usd +LEFT JOIN {{ source('prices','usd_forward_fill') }} usd ON usd.blockchain = null and usd.symbol = 'ETH' AND usd.minute = date_trunc('minute',t.block_time) {% if not is_incremental() %} diff --git a/models/zerion/arbitrum/zerion_arbitrum_trades.sql b/models/zerion/arbitrum/zerion_arbitrum_trades.sql index 84d2ba2be29..ae63e28b9b8 100644 --- a/models/zerion/arbitrum/zerion_arbitrum_trades.sql +++ b/models/zerion/arbitrum/zerion_arbitrum_trades.sql @@ -89,7 +89,7 @@ SELECT 'arbitrum' AS blockchain ELSE CAST(trades.zerion_fee_amount_raw/POWER(10, COALESCE(trades.tok_sold_decimals, pu_sold.decimals)) AS double) END AS double) AS zerion_fee_amount_original FROM zerion_trades trades -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='arbitrum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_sold ON pu_sold.blockchain='arbitrum' AND pu_sold.contract_address=trades.token_sold_address AND pu_sold.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -98,7 +98,7 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='ar {% if is_incremental() %} AND pu_sold.minute >= date_trunc('day', now() - interval '7' day) {% endif %} -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain='arbitrum' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_bought ON pu_bought.blockchain='arbitrum' AND pu_bought.contract_address=trades.token_bought_address AND pu_bought.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -106,4 +106,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain {% endif %} {% if is_incremental() %} AND pu_bought.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} \ No newline at end of file + {% endif %} diff --git a/models/zerion/avalanche_c/zerion_avalanche_c_trades.sql b/models/zerion/avalanche_c/zerion_avalanche_c_trades.sql index 1da3dd70299..656f164fb33 100644 --- a/models/zerion/avalanche_c/zerion_avalanche_c_trades.sql +++ b/models/zerion/avalanche_c/zerion_avalanche_c_trades.sql @@ -89,7 +89,7 @@ SELECT 'avalanche_c' AS blockchain ELSE CAST(trades.zerion_fee_amount_raw/POWER(10, COALESCE(trades.tok_sold_decimals, pu_sold.decimals)) AS double) END AS double) AS zerion_fee_amount_original FROM zerion_trades trades -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='avalanche_c' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_sold ON pu_sold.blockchain='avalanche_c' AND pu_sold.contract_address=trades.token_sold_address AND pu_sold.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -98,7 +98,7 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='av {% if is_incremental() %} AND pu_sold.minute >= date_trunc('day', now() - interval '7' day) {% endif %} -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain='avalanche_c' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_bought ON pu_bought.blockchain='avalanche_c' AND pu_bought.contract_address=trades.token_bought_address AND pu_bought.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -106,4 +106,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain {% endif %} {% if is_incremental() %} AND pu_bought.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} \ No newline at end of file + {% endif %} diff --git a/models/zerion/bnb/zerion_bnb_trades.sql b/models/zerion/bnb/zerion_bnb_trades.sql index e8667d583ba..177581560fd 100644 --- a/models/zerion/bnb/zerion_bnb_trades.sql +++ b/models/zerion/bnb/zerion_bnb_trades.sql @@ -91,7 +91,7 @@ SELECT 'bnb' AS blockchain ELSE CAST(trades.zerion_fee_amount_raw/POWER(10, COALESCE(trades.tok_sold_decimals, pu_sold.decimals)) AS double) END AS double) AS zerion_fee_amount_original FROM zerion_trades trades -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='bnb' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_sold ON pu_sold.blockchain='bnb' AND pu_sold.contract_address=trades.token_sold_address AND pu_sold.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -100,7 +100,7 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='bn {% if is_incremental() %} AND pu_sold.minute >= date_trunc('day', now() - interval '7' day) {% endif %} -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain='bnb' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_bought ON pu_bought.blockchain='bnb' AND pu_bought.contract_address=trades.token_bought_address AND pu_bought.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -108,4 +108,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain {% endif %} {% if is_incremental() %} AND pu_bought.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} \ No newline at end of file + {% endif %} diff --git a/models/zerion/fantom/zerion_fantom_trades.sql b/models/zerion/fantom/zerion_fantom_trades.sql index e7351a773e0..7d434ac81e1 100644 --- a/models/zerion/fantom/zerion_fantom_trades.sql +++ b/models/zerion/fantom/zerion_fantom_trades.sql @@ -89,7 +89,7 @@ SELECT 'fantom' AS blockchain ELSE CAST(trades.zerion_fee_amount_raw/POWER(10, COALESCE(trades.tok_sold_decimals, pu_sold.decimals)) AS double) END AS double) AS zerion_fee_amount_original FROM zerion_trades trades -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='fantom' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_sold ON pu_sold.blockchain='fantom' AND pu_sold.contract_address=trades.token_sold_address AND pu_sold.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -98,7 +98,7 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='fa {% if is_incremental() %} AND pu_sold.minute >= date_trunc('day', now() - interval '7' day) {% endif %} -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain='fantom' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_bought ON pu_bought.blockchain='fantom' AND pu_bought.contract_address=trades.token_bought_address AND pu_bought.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -106,4 +106,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain {% endif %} {% if is_incremental() %} AND pu_bought.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} \ No newline at end of file + {% endif %} diff --git a/models/zerion/gnosis/zerion_gnosis_trades.sql b/models/zerion/gnosis/zerion_gnosis_trades.sql index c23b8c838ac..1f64d0e1892 100644 --- a/models/zerion/gnosis/zerion_gnosis_trades.sql +++ b/models/zerion/gnosis/zerion_gnosis_trades.sql @@ -89,7 +89,7 @@ SELECT 'gnosis' AS blockchain ELSE CAST(trades.zerion_fee_amount_raw/POWER(10, COALESCE(trades.tok_sold_decimals, pu_sold.decimals)) AS double) END AS double) AS zerion_fee_amount_original FROM zerion_trades trades -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='gnosis' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_sold ON pu_sold.blockchain='gnosis' AND pu_sold.contract_address=trades.token_sold_address AND pu_sold.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -98,7 +98,7 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='gn {% if is_incremental() %} AND pu_sold.minute >= date_trunc('day', now() - interval '7' day) {% endif %} -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain='gnosis' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_bought ON pu_bought.blockchain='gnosis' AND pu_bought.contract_address=trades.token_bought_address AND pu_bought.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -106,4 +106,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain {% endif %} {% if is_incremental() %} AND pu_bought.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} \ No newline at end of file + {% endif %} diff --git a/models/zerion/optimism/zerion_optimism_trades.sql b/models/zerion/optimism/zerion_optimism_trades.sql index 6542227699a..8902bb24078 100644 --- a/models/zerion/optimism/zerion_optimism_trades.sql +++ b/models/zerion/optimism/zerion_optimism_trades.sql @@ -89,7 +89,7 @@ SELECT 'optimism' AS blockchain ELSE CAST(trades.zerion_fee_amount_raw/POWER(10, COALESCE(trades.tok_sold_decimals, pu_sold.decimals)) AS double) END AS double) AS zerion_fee_amount_original FROM zerion_trades trades -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='optimism' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_sold ON pu_sold.blockchain='optimism' AND pu_sold.contract_address=trades.token_sold_address AND pu_sold.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -98,7 +98,7 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='op {% if is_incremental() %} AND pu_sold.minute >= date_trunc('day', now() - interval '7' day) {% endif %} -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain='optimism' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_bought ON pu_bought.blockchain='optimism' AND pu_bought.contract_address=trades.token_bought_address AND pu_bought.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -106,4 +106,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain {% endif %} {% if is_incremental() %} AND pu_bought.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} \ No newline at end of file + {% endif %} diff --git a/models/zerion/polygon/zerion_polygon_trades.sql b/models/zerion/polygon/zerion_polygon_trades.sql index 5d20b786388..72283363533 100644 --- a/models/zerion/polygon/zerion_polygon_trades.sql +++ b/models/zerion/polygon/zerion_polygon_trades.sql @@ -89,7 +89,7 @@ SELECT 'polygon' AS blockchain ELSE CAST(trades.zerion_fee_amount_raw/POWER(10, COALESCE(trades.tok_sold_decimals, pu_sold.decimals)) AS double) END AS double) AS zerion_fee_amount_original FROM zerion_trades trades -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='polygon' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_sold ON pu_sold.blockchain='polygon' AND pu_sold.contract_address=trades.token_sold_address AND pu_sold.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -98,7 +98,7 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_sold ON pu_sold.blockchain='po {% if is_incremental() %} AND pu_sold.minute >= date_trunc('day', now() - interval '7' day) {% endif %} -LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain='polygon' +LEFT JOIN {{ source('prices','usd_forward_fill') }} pu_bought ON pu_bought.blockchain='polygon' AND pu_bought.contract_address=trades.token_bought_address AND pu_bought.minute=date_trunc('minute', trades.block_time) {% if not is_incremental() %} @@ -106,4 +106,4 @@ LEFT JOIN {{ ref('prices_usd_forward_fill') }} pu_bought ON pu_bought.blockchain {% endif %} {% if is_incremental() %} AND pu_bought.minute >= date_trunc('day', now() - interval '7' day) - {% endif %} \ No newline at end of file + {% endif %} diff --git a/models/staking/solana/staking_solana_schema.yml b/solana/models/_sector/staking/solana/staking_solana_schema.yml similarity index 100% rename from models/staking/solana/staking_solana_schema.yml rename to solana/models/_sector/staking/solana/staking_solana_schema.yml diff --git a/models/staking/solana/staking_solana_stake_actions.sql b/solana/models/_sector/staking/solana/staking_solana_stake_actions.sql similarity index 100% rename from models/staking/solana/staking_solana_stake_actions.sql rename to solana/models/_sector/staking/solana/staking_solana_stake_actions.sql diff --git a/sources/_subprojects/daily_spellbook/_sources.yml b/sources/_subprojects_outputs/daily_spellbook/_sources.yml similarity index 73% rename from sources/_subprojects/daily_spellbook/_sources.yml rename to sources/_subprojects_outputs/daily_spellbook/_sources.yml index 197b52c324a..3974a4dbf55 100644 --- a/sources/_subprojects/daily_spellbook/_sources.yml +++ b/sources/_subprojects_outputs/daily_spellbook/_sources.yml @@ -7,7 +7,7 @@ sources: - name: chainlink_ethereum tables: - name: price_feeds - + - name: contracts tables: - name: system_predeploys @@ -15,4 +15,8 @@ sources: - name: contracts_optimism tables: - name: disperse_contracts - - name: contract_creator_project_mapping \ No newline at end of file + - name: contract_creator_project_mapping + + - name: labels + tables: + - name: addresses diff --git a/sources/_subprojects/dex/_sources.yml b/sources/_subprojects_outputs/dex/_sources.yml similarity index 100% rename from sources/_subprojects/dex/_sources.yml rename to sources/_subprojects_outputs/dex/_sources.yml diff --git a/sources/_subprojects/evms/_sources.yml b/sources/_subprojects_outputs/evms/_sources.yml similarity index 100% rename from sources/_subprojects/evms/_sources.yml rename to sources/_subprojects_outputs/evms/_sources.yml diff --git a/sources/_subprojects_outputs/hourly_spellbook/_sources.yml b/sources/_subprojects_outputs/hourly_spellbook/_sources.yml new file mode 100644 index 00000000000..f00aaa31743 --- /dev/null +++ b/sources/_subprojects_outputs/hourly_spellbook/_sources.yml @@ -0,0 +1,44 @@ +version: 2 + +sources: + - name: cex + tables: + - name: addresses + + - name: ens + tables: + - name: reverse_latest + - name: resolver_latest + - name: view_registrations + + - name: prices + tables: + - name: usd_latest + - name: usd_daily + - name: usd_forward_fill + + - name: lending + tables: + - name: borrow + - name: supply + - name: flashloans + + - name: balancer + tables: + - name: gauge_mappings + - name: flashloans + - name: pools_metrics_daily + - name: token_whitelist + - name: single_recipient_gauges + + - name: staking_ethereum + tables: + - name: entities + + - name: safe_ethereum + tables: + - name: safes + + - name: perpetual + tables: + - name: trades diff --git a/sources/_subprojects/nft/_sources.yml b/sources/_subprojects_outputs/nft/_sources.yml similarity index 100% rename from sources/_subprojects/nft/_sources.yml rename to sources/_subprojects_outputs/nft/_sources.yml diff --git a/sources/_subprojects/spellbook/_sources.yml b/sources/_subprojects_outputs/spellbook/_sources.yml similarity index 91% rename from sources/_subprojects/spellbook/_sources.yml rename to sources/_subprojects_outputs/spellbook/_sources.yml index eb74934c821..8b408b53869 100644 --- a/sources/_subprojects/spellbook/_sources.yml +++ b/sources/_subprojects_outputs/spellbook/_sources.yml @@ -47,9 +47,6 @@ sources: - name: addresses_events_fantom tables: - name: first_funded_by - - name: lending - tables: - - name: flashloans - name: bridge_optimism tables: - name: standard_bridge_flows @@ -59,11 +56,7 @@ sources: - name: cex_optimism tables: - name: addresses - - name: prices - tables: - - name: usd_forward_fill - - name: trusted_tokens - - name: usd_latest + - name: op_retropgf_optimism tables: - name: recipients @@ -99,6 +92,12 @@ sources: - name: balancer tables: - name: bpt_prices - - name: tokens + + - name: addresses_ethereum + tables: + - name: optimism_batchinbox_combinations + - name: optimism_outputoracle_combinations + + - name: gyroscope tables: - - name: transfers + - name: gyro_tokens diff --git a/sources/_subprojects/tokens/_sources.yml b/sources/_subprojects_outputs/tokens/_sources.yml similarity index 99% rename from sources/_subprojects/tokens/_sources.yml rename to sources/_subprojects_outputs/tokens/_sources.yml index 65e6053ffbb..307ada90bb2 100644 --- a/sources/_subprojects/tokens/_sources.yml +++ b/sources/_subprojects_outputs/tokens/_sources.yml @@ -347,3 +347,8 @@ sources: data_type: varchar - name: vault_token data_type: varbinary + + - name: prices + tables: + - name: trusted_tokens + - name: tokens diff --git a/sources/_subprojects_outputs/tokens/transfers.yml b/sources/_subprojects_outputs/tokens/transfers.yml new file mode 100644 index 00000000000..b3aa7e4efbb --- /dev/null +++ b/sources/_subprojects_outputs/tokens/transfers.yml @@ -0,0 +1,66 @@ +version: 2 +sources: + - name: tokens + tables: + - name: transfers + - name: tokens_arbitrum + tables: + - name: transfers + + - name: tokens_avalanche_c + tables: + - name: transfers + + - name: tokens_base + tables: + - name: transfers + + - name: tokens_bnb + tables: + - name: transfers + + - name: tokens_celo + tables: + - name: transfers + + - name: tokens_ethereum + tables: + - name: transfers + + - name: tokens_fantom + tables: + - name: transfers + + - name: tokens_gnosis + tables: + - name: transfers + + - name: tokens_linea + tables: + - name: transfers + + - name: tokens_optimism + tables: + - name: transfers + + - name: tokens_polygon + tables: + - name: transfers + + - name: tokens_scroll + tables: + - name: transfers + + - name: tokens_zkevm + tables: + - name: transfers + + - name: tokens_zksync + tables: + - name: transfers + + - name: tokens_zora + tables: + - name: transfers + + diff --git a/tests/aave/ethereum/aave_borrow_test.sql b/tests/aave/ethereum/aave_borrow_test.sql index b45d2c6f2e3..3f916308a12 100644 --- a/tests/aave/ethereum/aave_borrow_test.sql +++ b/tests/aave/ethereum/aave_borrow_test.sql @@ -1,6 +1,6 @@ with unit_test1 as (select case - when usd_amount = 499785 then true + when amount_usd = 499785 then true else false end as test from {{ ref('aave_ethereum_borrow' )}} diff --git a/tests/aave/ethereum/aave_supply_test.sql b/tests/aave/ethereum/aave_supply_test.sql index 6229046486e..4eb6f525d26 100644 --- a/tests/aave/ethereum/aave_supply_test.sql +++ b/tests/aave/ethereum/aave_supply_test.sql @@ -1,6 +1,6 @@ with unit_test1 as (select case - when usd_amount = -21150 then true + when amount_usd = -21150 then true else false end as test from {{ ref('aave_ethereum_supply' )}} diff --git a/tests/aave/optimism/aave_optimism_borrow_test.sql b/tests/aave/optimism/aave_optimism_borrow_test.sql index dac531cb673..39aec607dff 100644 --- a/tests/aave/optimism/aave_optimism_borrow_test.sql +++ b/tests/aave/optimism/aave_optimism_borrow_test.sql @@ -1,6 +1,6 @@ with unit_test1 as (select case - when usd_amount = 0.999989 then true + when amount_usd = 0.999989 then true else false end as test from {{ ref('aave_optimism_borrow' )}} diff --git a/tests/aave/optimism/aave_optimism_supply_test.sql b/tests/aave/optimism/aave_optimism_supply_test.sql index 5861aab63bf..b515eca1621 100644 --- a/tests/aave/optimism/aave_optimism_supply_test.sql +++ b/tests/aave/optimism/aave_optimism_supply_test.sql @@ -1,6 +1,6 @@ with unit_test1 as (select case - when usd_amount = 1.31305 then true + when amount_usd = 1.31305 then true else false end as test from {{ ref('aave_optimism_supply' )}} diff --git a/tests/compound/ethereum/compound_borrow_test.sql b/tests/compound/ethereum/compound_borrow_test.sql index b365d55f188..73637585ee7 100644 --- a/tests/compound/ethereum/compound_borrow_test.sql +++ b/tests/compound/ethereum/compound_borrow_test.sql @@ -23,7 +23,7 @@ unit_test2 as ( unit_test3 as ( -- cErc20 repayBorrow select case - when usd_amount = -2127.8925117492 then true + when amount_usd = -2127.8925117492 then true else false end as test from {{ ref('compound_ethereum_borrow') }} @@ -34,7 +34,7 @@ unit_test3 as ( unit_test4 as ( -- cEther repayBorrow select case - when usd_amount = -1385143.24 then true + when amount_usd = -1385143.24 then true else false end as test from {{ ref('compound_ethereum_borrow') }} diff --git a/tests/compound/ethereum/compound_supply_test.sql b/tests/compound/ethereum/compound_supply_test.sql index 88f8680a9cd..243ef5ec9fa 100644 --- a/tests/compound/ethereum/compound_supply_test.sql +++ b/tests/compound/ethereum/compound_supply_test.sql @@ -23,7 +23,7 @@ unit_test2 as ( unit_test3 as ( -- cErc20 redeem select case - when usd_amount = -4506433.947672356 then true + when amount_usd = -4506433.947672356 then true else false end as test from {{ ref('compound_ethereum_supply') }} @@ -34,7 +34,7 @@ unit_test3 as ( unit_test4 as ( -- cEther redeem select case - when usd_amount = -25.819310507320957 then true + when amount_usd = -25.819310507320957 then true else false end as test from {{ ref('compound_ethereum_supply') }} diff --git a/tokens/dbt_project.yml b/tokens/dbt_project.yml index c5acf564523..52d11a5d113 100644 --- a/tokens/dbt_project.yml +++ b/tokens/dbt_project.yml @@ -22,22 +22,20 @@ vars: # These configurations specify where dbt should look for different types of files. # You don't need to change these! model-paths: ["models", "../sources"] -# analysis-paths: ["analyses"] # test-paths: ["tests"] # seed-paths: ["seeds"] macro-paths: ["../macros"] -# snapshot-paths: ["snapshots"] target-path: "target" # directory which will store compiled SQL files clean-targets: # directories to be removed by `dbt clean` - "target" - "dbt_packages" -# defining search order of macro invokation +# defining search order of macro invokation dispatch: - macro_namespace: dbt_utils search_order: ['trino_utils', 'dbt_utils'] - + # Configuring models # Full documentation: https://docs.getdbt.com/docs/configuring-models models: @@ -54,10 +52,10 @@ models: +materialized: view +schema: no_schema # this should be overriden in model specific configs +view_security: invoker - + aave: +schema: aave - + tokens: +schema: tokens +materialized: table @@ -115,4 +113,4 @@ models: the_granary: +schema: the_granary optimism: - +schema: the_granary_optimism \ No newline at end of file + +schema: the_granary_optimism diff --git a/models/prices/README.md b/tokens/models/prices/README.md similarity index 100% rename from models/prices/README.md rename to tokens/models/prices/README.md diff --git a/models/prices/arbitrum/prices_arbitrum_schema.yml b/tokens/models/prices/arbitrum/prices_arbitrum_schema.yml similarity index 100% rename from models/prices/arbitrum/prices_arbitrum_schema.yml rename to tokens/models/prices/arbitrum/prices_arbitrum_schema.yml diff --git a/models/prices/arbitrum/prices_arbitrum_tokens.sql b/tokens/models/prices/arbitrum/prices_arbitrum_tokens.sql similarity index 100% rename from models/prices/arbitrum/prices_arbitrum_tokens.sql rename to tokens/models/prices/arbitrum/prices_arbitrum_tokens.sql diff --git a/models/prices/avalanche_c/prices_avalanche_c_schema.yml b/tokens/models/prices/avalanche_c/prices_avalanche_c_schema.yml similarity index 100% rename from models/prices/avalanche_c/prices_avalanche_c_schema.yml rename to tokens/models/prices/avalanche_c/prices_avalanche_c_schema.yml diff --git a/models/prices/avalanche_c/prices_avalanche_c_tokens.sql b/tokens/models/prices/avalanche_c/prices_avalanche_c_tokens.sql similarity index 100% rename from models/prices/avalanche_c/prices_avalanche_c_tokens.sql rename to tokens/models/prices/avalanche_c/prices_avalanche_c_tokens.sql diff --git a/models/prices/base/prices_base_schema.yml b/tokens/models/prices/base/prices_base_schema.yml similarity index 100% rename from models/prices/base/prices_base_schema.yml rename to tokens/models/prices/base/prices_base_schema.yml diff --git a/models/prices/base/prices_base_tokens.sql b/tokens/models/prices/base/prices_base_tokens.sql similarity index 100% rename from models/prices/base/prices_base_tokens.sql rename to tokens/models/prices/base/prices_base_tokens.sql diff --git a/models/prices/bitcoin/prices_bitcoin_schema.yml b/tokens/models/prices/bitcoin/prices_bitcoin_schema.yml similarity index 100% rename from models/prices/bitcoin/prices_bitcoin_schema.yml rename to tokens/models/prices/bitcoin/prices_bitcoin_schema.yml diff --git a/models/prices/bitcoin/prices_bitcoin_tokens.sql b/tokens/models/prices/bitcoin/prices_bitcoin_tokens.sql similarity index 100% rename from models/prices/bitcoin/prices_bitcoin_tokens.sql rename to tokens/models/prices/bitcoin/prices_bitcoin_tokens.sql diff --git a/models/prices/blast/prices_blast_schema.yml b/tokens/models/prices/blast/prices_blast_schema.yml similarity index 100% rename from models/prices/blast/prices_blast_schema.yml rename to tokens/models/prices/blast/prices_blast_schema.yml diff --git a/models/prices/blast/prices_blast_tokens.sql b/tokens/models/prices/blast/prices_blast_tokens.sql similarity index 100% rename from models/prices/blast/prices_blast_tokens.sql rename to tokens/models/prices/blast/prices_blast_tokens.sql diff --git a/models/prices/bnb/prices_bnb_schema.yml b/tokens/models/prices/bnb/prices_bnb_schema.yml similarity index 100% rename from models/prices/bnb/prices_bnb_schema.yml rename to tokens/models/prices/bnb/prices_bnb_schema.yml diff --git a/models/prices/bnb/prices_bnb_tokens.sql b/tokens/models/prices/bnb/prices_bnb_tokens.sql similarity index 100% rename from models/prices/bnb/prices_bnb_tokens.sql rename to tokens/models/prices/bnb/prices_bnb_tokens.sql diff --git a/models/prices/cardano/prices_cardano_schema.yml b/tokens/models/prices/cardano/prices_cardano_schema.yml similarity index 100% rename from models/prices/cardano/prices_cardano_schema.yml rename to tokens/models/prices/cardano/prices_cardano_schema.yml diff --git a/models/prices/cardano/prices_cardano_tokens.sql b/tokens/models/prices/cardano/prices_cardano_tokens.sql similarity index 100% rename from models/prices/cardano/prices_cardano_tokens.sql rename to tokens/models/prices/cardano/prices_cardano_tokens.sql diff --git a/models/prices/celo/prices_celo_schema.yml b/tokens/models/prices/celo/prices_celo_schema.yml similarity index 100% rename from models/prices/celo/prices_celo_schema.yml rename to tokens/models/prices/celo/prices_celo_schema.yml diff --git a/models/prices/celo/prices_celo_tokens.sql b/tokens/models/prices/celo/prices_celo_tokens.sql similarity index 100% rename from models/prices/celo/prices_celo_tokens.sql rename to tokens/models/prices/celo/prices_celo_tokens.sql diff --git a/models/prices/ethereum/prices_ethereum_schema.yml b/tokens/models/prices/ethereum/prices_ethereum_schema.yml similarity index 100% rename from models/prices/ethereum/prices_ethereum_schema.yml rename to tokens/models/prices/ethereum/prices_ethereum_schema.yml diff --git a/models/prices/ethereum/prices_ethereum_tokens.sql b/tokens/models/prices/ethereum/prices_ethereum_tokens.sql similarity index 100% rename from models/prices/ethereum/prices_ethereum_tokens.sql rename to tokens/models/prices/ethereum/prices_ethereum_tokens.sql diff --git a/models/prices/fantom/prices_fantom_schema.yml b/tokens/models/prices/fantom/prices_fantom_schema.yml similarity index 100% rename from models/prices/fantom/prices_fantom_schema.yml rename to tokens/models/prices/fantom/prices_fantom_schema.yml diff --git a/models/prices/fantom/prices_fantom_tokens.sql b/tokens/models/prices/fantom/prices_fantom_tokens.sql similarity index 100% rename from models/prices/fantom/prices_fantom_tokens.sql rename to tokens/models/prices/fantom/prices_fantom_tokens.sql diff --git a/models/prices/gnosis/prices_gnosis_schema.yml b/tokens/models/prices/gnosis/prices_gnosis_schema.yml similarity index 100% rename from models/prices/gnosis/prices_gnosis_schema.yml rename to tokens/models/prices/gnosis/prices_gnosis_schema.yml diff --git a/models/prices/gnosis/prices_gnosis_tokens.sql b/tokens/models/prices/gnosis/prices_gnosis_tokens.sql similarity index 100% rename from models/prices/gnosis/prices_gnosis_tokens.sql rename to tokens/models/prices/gnosis/prices_gnosis_tokens.sql diff --git a/models/prices/linea/prices_linea_schema.yml b/tokens/models/prices/linea/prices_linea_schema.yml similarity index 100% rename from models/prices/linea/prices_linea_schema.yml rename to tokens/models/prices/linea/prices_linea_schema.yml diff --git a/models/prices/linea/prices_linea_tokens.sql b/tokens/models/prices/linea/prices_linea_tokens.sql similarity index 100% rename from models/prices/linea/prices_linea_tokens.sql rename to tokens/models/prices/linea/prices_linea_tokens.sql diff --git a/models/prices/mantle/prices_mantle_schema.yml b/tokens/models/prices/mantle/prices_mantle_schema.yml similarity index 100% rename from models/prices/mantle/prices_mantle_schema.yml rename to tokens/models/prices/mantle/prices_mantle_schema.yml diff --git a/models/prices/mantle/prices_mantle_tokens.sql b/tokens/models/prices/mantle/prices_mantle_tokens.sql similarity index 100% rename from models/prices/mantle/prices_mantle_tokens.sql rename to tokens/models/prices/mantle/prices_mantle_tokens.sql diff --git a/models/prices/optimism/prices_optimism_schema.yml b/tokens/models/prices/optimism/prices_optimism_schema.yml similarity index 100% rename from models/prices/optimism/prices_optimism_schema.yml rename to tokens/models/prices/optimism/prices_optimism_schema.yml diff --git a/models/prices/optimism/prices_optimism_tokens.sql b/tokens/models/prices/optimism/prices_optimism_tokens.sql similarity index 100% rename from models/prices/optimism/prices_optimism_tokens.sql rename to tokens/models/prices/optimism/prices_optimism_tokens.sql diff --git a/models/prices/optimism/prices_optimism_tokens_bridged.sql b/tokens/models/prices/optimism/prices_optimism_tokens_bridged.sql similarity index 100% rename from models/prices/optimism/prices_optimism_tokens_bridged.sql rename to tokens/models/prices/optimism/prices_optimism_tokens_bridged.sql diff --git a/models/prices/optimism/prices_optimism_tokens_curated.sql b/tokens/models/prices/optimism/prices_optimism_tokens_curated.sql similarity index 100% rename from models/prices/optimism/prices_optimism_tokens_curated.sql rename to tokens/models/prices/optimism/prices_optimism_tokens_curated.sql diff --git a/models/prices/polygon/prices_polygon_schema.yml b/tokens/models/prices/polygon/prices_polygon_schema.yml similarity index 100% rename from models/prices/polygon/prices_polygon_schema.yml rename to tokens/models/prices/polygon/prices_polygon_schema.yml diff --git a/models/prices/polygon/prices_polygon_tokens.sql b/tokens/models/prices/polygon/prices_polygon_tokens.sql similarity index 100% rename from models/prices/polygon/prices_polygon_tokens.sql rename to tokens/models/prices/polygon/prices_polygon_tokens.sql diff --git a/models/prices/prices_native_tokens.sql b/tokens/models/prices/prices_native_tokens.sql similarity index 100% rename from models/prices/prices_native_tokens.sql rename to tokens/models/prices/prices_native_tokens.sql diff --git a/tokens/models/prices/prices_schema.yml b/tokens/models/prices/prices_schema.yml new file mode 100644 index 00000000000..6c08e8a1e38 --- /dev/null +++ b/tokens/models/prices/prices_schema.yml @@ -0,0 +1,70 @@ +version: 2 + +models: + - name: prices_tokens + meta: + blockchain: arbitrum, avalanche_c, gnosis, polygon, optimism, ethereum, bnb, solana, fantom, celo, base, zksync, zora, linea, zkevm, blast, sei + sector: prices + contributors: aalan3, hildobby, pipistrella, viniabussafi, jeff-dude + config: + tags: ['prices', 'tokens', 'usd'] + description: "Price tokens" + columns: + - &token_id + name: token_id + description: "Id of the token at coinpaprika. This id is required to pull the price feed data. NOTE: Not all tokens are listed at coinpaprika - consider using price data from DEX sources in this case or submit a listing request at coinpaprika." + - &blockchain + name: blockchain + description: "Native blockchain of the token, if any" + - &contract_address + name: contract_address + description: "Contract address of the token, if any" + tests: + - not_zero_address + - &symbol + name: symbol + description: "Token symbol" + - &decimals + name: decimals + description: "Number of decimals for the token contract" + + - name: prices_native_tokens + meta: + blockchain: arbitrum, avalanche_c, gnosis, polygon, optimism, ethereum, bnb, solana, fantom, celo, zksync, zora, sei + sector: prices + contributors: aalan3, jeff-dude + config: + tags: ['prices', 'tokens', 'usd'] + description: "Price tokens for native tokens for all chains" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - contract_address + - symbol + columns: + - *token_id + - *blockchain + - *contract_address + - *symbol + - *decimals + + - name: prices_trusted_tokens + meta: + sector: prices + contributors: hosuke + config: + tags: [ 'prices', 'stability' ] + description: "List of trusted tokens across blockchains" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - contract_address + columns: + - name: blockchain + description: "Native blockchain of the token" + - name: symbol + description: "Token symbol" + - name: contract_address + description: "Contract address of the token" diff --git a/models/prices/prices_tokens.sql b/tokens/models/prices/prices_tokens.sql similarity index 100% rename from models/prices/prices_tokens.sql rename to tokens/models/prices/prices_tokens.sql diff --git a/models/prices/prices_trusted_tokens.sql b/tokens/models/prices/prices_trusted_tokens.sql similarity index 100% rename from models/prices/prices_trusted_tokens.sql rename to tokens/models/prices/prices_trusted_tokens.sql diff --git a/models/prices/scroll/prices_scroll_schema.yml b/tokens/models/prices/scroll/prices_scroll_schema.yml similarity index 100% rename from models/prices/scroll/prices_scroll_schema.yml rename to tokens/models/prices/scroll/prices_scroll_schema.yml diff --git a/models/prices/scroll/prices_scroll_tokens.sql b/tokens/models/prices/scroll/prices_scroll_tokens.sql similarity index 100% rename from models/prices/scroll/prices_scroll_tokens.sql rename to tokens/models/prices/scroll/prices_scroll_tokens.sql diff --git a/models/prices/sei/_schema.yml b/tokens/models/prices/sei/_schema.yml similarity index 100% rename from models/prices/sei/_schema.yml rename to tokens/models/prices/sei/_schema.yml diff --git a/models/prices/sei/prices_sei_tokens.sql b/tokens/models/prices/sei/prices_sei_tokens.sql similarity index 100% rename from models/prices/sei/prices_sei_tokens.sql rename to tokens/models/prices/sei/prices_sei_tokens.sql diff --git a/models/prices/solana/prices_solana_schema.yml b/tokens/models/prices/solana/prices_solana_schema.yml similarity index 100% rename from models/prices/solana/prices_solana_schema.yml rename to tokens/models/prices/solana/prices_solana_schema.yml diff --git a/models/prices/solana/prices_solana_tokens.sql b/tokens/models/prices/solana/prices_solana_tokens.sql similarity index 100% rename from models/prices/solana/prices_solana_tokens.sql rename to tokens/models/prices/solana/prices_solana_tokens.sql diff --git a/models/prices/zkevm/prices_zkevm_schema.yml b/tokens/models/prices/zkevm/prices_zkevm_schema.yml similarity index 100% rename from models/prices/zkevm/prices_zkevm_schema.yml rename to tokens/models/prices/zkevm/prices_zkevm_schema.yml diff --git a/models/prices/zkevm/prices_zkevm_tokens.sql b/tokens/models/prices/zkevm/prices_zkevm_tokens.sql similarity index 100% rename from models/prices/zkevm/prices_zkevm_tokens.sql rename to tokens/models/prices/zkevm/prices_zkevm_tokens.sql diff --git a/models/prices/zksync/prices_zksync_schema.yml b/tokens/models/prices/zksync/prices_zksync_schema.yml similarity index 100% rename from models/prices/zksync/prices_zksync_schema.yml rename to tokens/models/prices/zksync/prices_zksync_schema.yml diff --git a/models/prices/zksync/prices_zksync_tokens.sql b/tokens/models/prices/zksync/prices_zksync_tokens.sql similarity index 100% rename from models/prices/zksync/prices_zksync_tokens.sql rename to tokens/models/prices/zksync/prices_zksync_tokens.sql diff --git a/models/prices/zora/prices_zora_schema.yml b/tokens/models/prices/zora/prices_zora_schema.yml similarity index 100% rename from models/prices/zora/prices_zora_schema.yml rename to tokens/models/prices/zora/prices_zora_schema.yml diff --git a/models/prices/zora/prices_zora_tokens.sql b/tokens/models/prices/zora/prices_zora_tokens.sql similarity index 100% rename from models/prices/zora/prices_zora_tokens.sql rename to tokens/models/prices/zora/prices_zora_tokens.sql diff --git a/models/_sector/tokens/arbitrum/_schema.yml b/tokens/models/transfers_and_balances/arbitrum/_schema.yml similarity index 100% rename from models/_sector/tokens/arbitrum/_schema.yml rename to tokens/models/transfers_and_balances/arbitrum/_schema.yml diff --git a/models/_sector/tokens/arbitrum/tokens_arbitrum_balances.sql b/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_balances.sql similarity index 100% rename from models/_sector/tokens/arbitrum/tokens_arbitrum_balances.sql rename to tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_balances.sql diff --git a/models/_sector/tokens/arbitrum/tokens_arbitrum_balances_daily.sql b/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_balances_daily.sql similarity index 100% rename from models/_sector/tokens/arbitrum/tokens_arbitrum_balances_daily.sql rename to tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_balances_daily.sql diff --git a/models/_sector/tokens/arbitrum/tokens_arbitrum_balances_daily_agg.sql b/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_balances_daily_agg.sql similarity index 100% rename from models/_sector/tokens/arbitrum/tokens_arbitrum_balances_daily_agg.sql rename to tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_balances_daily_agg.sql diff --git a/models/_sector/tokens/arbitrum/tokens_arbitrum_balances_daily_agg_base.sql b/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_balances_daily_agg_base.sql similarity index 100% rename from models/_sector/tokens/arbitrum/tokens_arbitrum_balances_daily_agg_base.sql rename to tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_balances_daily_agg_base.sql diff --git a/models/_sector/tokens/arbitrum/tokens_arbitrum_base_transfers.sql b/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_base_transfers.sql similarity index 100% rename from models/_sector/tokens/arbitrum/tokens_arbitrum_base_transfers.sql rename to tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_base_transfers.sql diff --git a/models/_sector/tokens/arbitrum/tokens_arbitrum_transfers.sql b/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_transfers.sql similarity index 93% rename from models/_sector/tokens/arbitrum/tokens_arbitrum_transfers.sql rename to tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_transfers.sql index 67cd594509f..91d9471e85c 100644 --- a/models/_sector/tokens/arbitrum/tokens_arbitrum_transfers.sql +++ b/tokens/models/transfers_and_balances/arbitrum/tokens_arbitrum_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_arbitrum_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2021-05-29' , blockchain = 'arbitrum' ) -}} \ No newline at end of file +}} diff --git a/models/_sector/tokens/avalanche_c/_schema.yml b/tokens/models/transfers_and_balances/avalanche_c/_schema.yml similarity index 100% rename from models/_sector/tokens/avalanche_c/_schema.yml rename to tokens/models/transfers_and_balances/avalanche_c/_schema.yml diff --git a/models/_sector/tokens/avalanche_c/tokens_avalanche_c_balances.sql b/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_balances.sql similarity index 100% rename from models/_sector/tokens/avalanche_c/tokens_avalanche_c_balances.sql rename to tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_balances.sql diff --git a/models/_sector/tokens/avalanche_c/tokens_avalanche_c_balances_daily.sql b/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_balances_daily.sql similarity index 100% rename from models/_sector/tokens/avalanche_c/tokens_avalanche_c_balances_daily.sql rename to tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_balances_daily.sql diff --git a/models/_sector/tokens/avalanche_c/tokens_avalanche_c_balances_daily_agg.sql b/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_balances_daily_agg.sql similarity index 100% rename from models/_sector/tokens/avalanche_c/tokens_avalanche_c_balances_daily_agg.sql rename to tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_balances_daily_agg.sql diff --git a/models/_sector/tokens/avalanche_c/tokens_avalanche_c_balances_daily_agg_base.sql b/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_balances_daily_agg_base.sql similarity index 100% rename from models/_sector/tokens/avalanche_c/tokens_avalanche_c_balances_daily_agg_base.sql rename to tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_balances_daily_agg_base.sql diff --git a/models/_sector/tokens/avalanche_c/tokens_avalanche_c_base_transfers.sql b/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_base_transfers.sql similarity index 100% rename from models/_sector/tokens/avalanche_c/tokens_avalanche_c_base_transfers.sql rename to tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_base_transfers.sql diff --git a/models/_sector/tokens/avalanche_c/tokens_avalanche_c_transfers.sql b/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_transfers.sql similarity index 93% rename from models/_sector/tokens/avalanche_c/tokens_avalanche_c_transfers.sql rename to tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_transfers.sql index f8aca154aae..f1c8fc32019 100644 --- a/models/_sector/tokens/avalanche_c/tokens_avalanche_c_transfers.sql +++ b/tokens/models/transfers_and_balances/avalanche_c/tokens_avalanche_c_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_avalanche_c_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2020-09-23' , blockchain = 'avalanche_c' ) -}} \ No newline at end of file +}} diff --git a/models/_sector/tokens/base/_schema.yml b/tokens/models/transfers_and_balances/base/_schema.yml similarity index 100% rename from models/_sector/tokens/base/_schema.yml rename to tokens/models/transfers_and_balances/base/_schema.yml diff --git a/models/_sector/tokens/base/tokens_base_balances.sql b/tokens/models/transfers_and_balances/base/tokens_base_balances.sql similarity index 100% rename from models/_sector/tokens/base/tokens_base_balances.sql rename to tokens/models/transfers_and_balances/base/tokens_base_balances.sql diff --git a/models/_sector/tokens/base/tokens_base_balances_daily.sql b/tokens/models/transfers_and_balances/base/tokens_base_balances_daily.sql similarity index 100% rename from models/_sector/tokens/base/tokens_base_balances_daily.sql rename to tokens/models/transfers_and_balances/base/tokens_base_balances_daily.sql diff --git a/models/_sector/tokens/base/tokens_base_balances_daily_agg.sql b/tokens/models/transfers_and_balances/base/tokens_base_balances_daily_agg.sql similarity index 100% rename from models/_sector/tokens/base/tokens_base_balances_daily_agg.sql rename to tokens/models/transfers_and_balances/base/tokens_base_balances_daily_agg.sql diff --git a/models/_sector/tokens/base/tokens_base_balances_daily_agg_base.sql b/tokens/models/transfers_and_balances/base/tokens_base_balances_daily_agg_base.sql similarity index 100% rename from models/_sector/tokens/base/tokens_base_balances_daily_agg_base.sql rename to tokens/models/transfers_and_balances/base/tokens_base_balances_daily_agg_base.sql diff --git a/models/_sector/tokens/base/tokens_base_base_transfers.sql b/tokens/models/transfers_and_balances/base/tokens_base_base_transfers.sql similarity index 100% rename from models/_sector/tokens/base/tokens_base_base_transfers.sql rename to tokens/models/transfers_and_balances/base/tokens_base_base_transfers.sql diff --git a/models/_sector/tokens/base/tokens_base_transfers.sql b/tokens/models/transfers_and_balances/base/tokens_base_transfers.sql similarity index 93% rename from models/_sector/tokens/base/tokens_base_transfers.sql rename to tokens/models/transfers_and_balances/base/tokens_base_transfers.sql index ee807150002..9761d7ba542 100644 --- a/models/_sector/tokens/base/tokens_base_transfers.sql +++ b/tokens/models/transfers_and_balances/base/tokens_base_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_base_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2023-06-15' , blockchain = 'base' ) -}} \ No newline at end of file +}} diff --git a/models/balances/bitcoin/balances_bitcoin_satoshi_day.sql b/tokens/models/transfers_and_balances/bitcoin/balances_bitcoin_satoshi_day.sql similarity index 100% rename from models/balances/bitcoin/balances_bitcoin_satoshi_day.sql rename to tokens/models/transfers_and_balances/bitcoin/balances_bitcoin_satoshi_day.sql diff --git a/models/balances/bitcoin/balances_bitcoin_satoshi_latest_day.sql b/tokens/models/transfers_and_balances/bitcoin/balances_bitcoin_satoshi_latest_day.sql similarity index 100% rename from models/balances/bitcoin/balances_bitcoin_satoshi_latest_day.sql rename to tokens/models/transfers_and_balances/bitcoin/balances_bitcoin_satoshi_latest_day.sql diff --git a/models/balances/bitcoin/balances_bitcoin_schema.yml b/tokens/models/transfers_and_balances/bitcoin/balances_bitcoin_schema.yml similarity index 100% rename from models/balances/bitcoin/balances_bitcoin_schema.yml rename to tokens/models/transfers_and_balances/bitcoin/balances_bitcoin_schema.yml diff --git a/models/transfers/bitcoin/transfers_bitcoin_satoshi.sql b/tokens/models/transfers_and_balances/bitcoin/transfers_bitcoin_satoshi.sql similarity index 100% rename from models/transfers/bitcoin/transfers_bitcoin_satoshi.sql rename to tokens/models/transfers_and_balances/bitcoin/transfers_bitcoin_satoshi.sql diff --git a/models/transfers/bitcoin/transfers_bitcoin_satoshi_agg_day.sql b/tokens/models/transfers_and_balances/bitcoin/transfers_bitcoin_satoshi_agg_day.sql similarity index 100% rename from models/transfers/bitcoin/transfers_bitcoin_satoshi_agg_day.sql rename to tokens/models/transfers_and_balances/bitcoin/transfers_bitcoin_satoshi_agg_day.sql diff --git a/models/transfers/bitcoin/transfers_bitcoin_satoshi_rolling_day.sql b/tokens/models/transfers_and_balances/bitcoin/transfers_bitcoin_satoshi_rolling_day.sql similarity index 100% rename from models/transfers/bitcoin/transfers_bitcoin_satoshi_rolling_day.sql rename to tokens/models/transfers_and_balances/bitcoin/transfers_bitcoin_satoshi_rolling_day.sql diff --git a/models/transfers/bitcoin/transfers_bitcoin_schema.yml b/tokens/models/transfers_and_balances/bitcoin/transfers_bitcoin_schema.yml similarity index 100% rename from models/transfers/bitcoin/transfers_bitcoin_schema.yml rename to tokens/models/transfers_and_balances/bitcoin/transfers_bitcoin_schema.yml diff --git a/models/_sector/tokens/blast/_schema.yml b/tokens/models/transfers_and_balances/blast/_schema.yml similarity index 100% rename from models/_sector/tokens/blast/_schema.yml rename to tokens/models/transfers_and_balances/blast/_schema.yml diff --git a/models/_sector/tokens/blast/tokens_blast_base_transfers.sql b/tokens/models/transfers_and_balances/blast/tokens_blast_base_transfers.sql similarity index 100% rename from models/_sector/tokens/blast/tokens_blast_base_transfers.sql rename to tokens/models/transfers_and_balances/blast/tokens_blast_base_transfers.sql diff --git a/models/_sector/tokens/blast/tokens_blast_transfers.sql b/tokens/models/transfers_and_balances/blast/tokens_blast_transfers.sql similarity index 93% rename from models/_sector/tokens/blast/tokens_blast_transfers.sql rename to tokens/models/transfers_and_balances/blast/tokens_blast_transfers.sql index 0f85fc3bf16..402d5198397 100644 --- a/models/_sector/tokens/blast/tokens_blast_transfers.sql +++ b/tokens/models/transfers_and_balances/blast/tokens_blast_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_blast_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2020-04-22' , blockchain = 'blast' ) -}} \ No newline at end of file +}} diff --git a/models/_sector/tokens/bnb/_schema.yml b/tokens/models/transfers_and_balances/bnb/_schema.yml similarity index 100% rename from models/_sector/tokens/bnb/_schema.yml rename to tokens/models/transfers_and_balances/bnb/_schema.yml diff --git a/models/_sector/tokens/bnb/tokens_bnb_balances.sql b/tokens/models/transfers_and_balances/bnb/tokens_bnb_balances.sql similarity index 100% rename from models/_sector/tokens/bnb/tokens_bnb_balances.sql rename to tokens/models/transfers_and_balances/bnb/tokens_bnb_balances.sql diff --git a/models/_sector/tokens/bnb/tokens_bnb_base_transfers.sql b/tokens/models/transfers_and_balances/bnb/tokens_bnb_base_transfers.sql similarity index 100% rename from models/_sector/tokens/bnb/tokens_bnb_base_transfers.sql rename to tokens/models/transfers_and_balances/bnb/tokens_bnb_base_transfers.sql diff --git a/models/_sector/tokens/bnb/tokens_bnb_transfers.sql b/tokens/models/transfers_and_balances/bnb/tokens_bnb_transfers.sql similarity index 93% rename from models/_sector/tokens/bnb/tokens_bnb_transfers.sql rename to tokens/models/transfers_and_balances/bnb/tokens_bnb_transfers.sql index 2a4025e3147..6ef4e17834b 100644 --- a/models/_sector/tokens/bnb/tokens_bnb_transfers.sql +++ b/tokens/models/transfers_and_balances/bnb/tokens_bnb_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_bnb_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2020-08-29' , blockchain = 'bnb' ) -}} \ No newline at end of file +}} diff --git a/models/_sector/tokens/celo/_schema.yml b/tokens/models/transfers_and_balances/celo/_schema.yml similarity index 100% rename from models/_sector/tokens/celo/_schema.yml rename to tokens/models/transfers_and_balances/celo/_schema.yml diff --git a/models/_sector/tokens/celo/tokens_celo_base_transfers.sql b/tokens/models/transfers_and_balances/celo/tokens_celo_base_transfers.sql similarity index 100% rename from models/_sector/tokens/celo/tokens_celo_base_transfers.sql rename to tokens/models/transfers_and_balances/celo/tokens_celo_base_transfers.sql diff --git a/models/_sector/tokens/celo/tokens_celo_transfers.sql b/tokens/models/transfers_and_balances/celo/tokens_celo_transfers.sql similarity index 93% rename from models/_sector/tokens/celo/tokens_celo_transfers.sql rename to tokens/models/transfers_and_balances/celo/tokens_celo_transfers.sql index 3ca9bc9a303..88f1706f1f5 100644 --- a/models/_sector/tokens/celo/tokens_celo_transfers.sql +++ b/tokens/models/transfers_and_balances/celo/tokens_celo_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_celo_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2020-04-22' , blockchain = 'celo' ) -}} \ No newline at end of file +}} diff --git a/models/_sector/tokens/ethereum/_schema.yml b/tokens/models/transfers_and_balances/ethereum/_schema.yml similarity index 100% rename from models/_sector/tokens/ethereum/_schema.yml rename to tokens/models/transfers_and_balances/ethereum/_schema.yml diff --git a/models/_sector/tokens/ethereum/tokens_ethereum_balances.sql b/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_balances.sql similarity index 100% rename from models/_sector/tokens/ethereum/tokens_ethereum_balances.sql rename to tokens/models/transfers_and_balances/ethereum/tokens_ethereum_balances.sql diff --git a/models/_sector/tokens/ethereum/tokens_ethereum_balances_daily.sql b/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_balances_daily.sql similarity index 100% rename from models/_sector/tokens/ethereum/tokens_ethereum_balances_daily.sql rename to tokens/models/transfers_and_balances/ethereum/tokens_ethereum_balances_daily.sql diff --git a/models/_sector/tokens/ethereum/tokens_ethereum_balances_daily_agg.sql b/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_balances_daily_agg.sql similarity index 100% rename from models/_sector/tokens/ethereum/tokens_ethereum_balances_daily_agg.sql rename to tokens/models/transfers_and_balances/ethereum/tokens_ethereum_balances_daily_agg.sql diff --git a/models/_sector/tokens/ethereum/tokens_ethereum_balances_daily_agg_base.sql b/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_balances_daily_agg_base.sql similarity index 100% rename from models/_sector/tokens/ethereum/tokens_ethereum_balances_daily_agg_base.sql rename to tokens/models/transfers_and_balances/ethereum/tokens_ethereum_balances_daily_agg_base.sql diff --git a/models/_sector/tokens/ethereum/tokens_ethereum_base_transfers.sql b/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_base_transfers.sql similarity index 100% rename from models/_sector/tokens/ethereum/tokens_ethereum_base_transfers.sql rename to tokens/models/transfers_and_balances/ethereum/tokens_ethereum_base_transfers.sql diff --git a/models/_sector/tokens/ethereum/tokens_ethereum_transfers.sql b/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_transfers.sql similarity index 93% rename from models/_sector/tokens/ethereum/tokens_ethereum_transfers.sql rename to tokens/models/transfers_and_balances/ethereum/tokens_ethereum_transfers.sql index 93472331063..b92d827b3b8 100644 --- a/models/_sector/tokens/ethereum/tokens_ethereum_transfers.sql +++ b/tokens/models/transfers_and_balances/ethereum/tokens_ethereum_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_ethereum_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2015-08-07' , blockchain = 'ethereum' ) -}} \ No newline at end of file +}} diff --git a/models/_sector/tokens/fantom/_schema.yml b/tokens/models/transfers_and_balances/fantom/_schema.yml similarity index 100% rename from models/_sector/tokens/fantom/_schema.yml rename to tokens/models/transfers_and_balances/fantom/_schema.yml diff --git a/models/_sector/tokens/fantom/tokens_fantom_base_transfers.sql b/tokens/models/transfers_and_balances/fantom/tokens_fantom_base_transfers.sql similarity index 100% rename from models/_sector/tokens/fantom/tokens_fantom_base_transfers.sql rename to tokens/models/transfers_and_balances/fantom/tokens_fantom_base_transfers.sql diff --git a/models/_sector/tokens/fantom/tokens_fantom_transfers.sql b/tokens/models/transfers_and_balances/fantom/tokens_fantom_transfers.sql similarity index 93% rename from models/_sector/tokens/fantom/tokens_fantom_transfers.sql rename to tokens/models/transfers_and_balances/fantom/tokens_fantom_transfers.sql index ccc58283a08..215b152dc80 100644 --- a/models/_sector/tokens/fantom/tokens_fantom_transfers.sql +++ b/tokens/models/transfers_and_balances/fantom/tokens_fantom_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_fantom_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2019-12-27' , blockchain = 'fantom' ) -}} \ No newline at end of file +}} diff --git a/models/_sector/tokens/gnosis/_schema.yml b/tokens/models/transfers_and_balances/gnosis/_schema.yml similarity index 100% rename from models/_sector/tokens/gnosis/_schema.yml rename to tokens/models/transfers_and_balances/gnosis/_schema.yml diff --git a/models/_sector/tokens/gnosis/tokens_gnosis_base_transfers.sql b/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_transfers.sql similarity index 100% rename from models/_sector/tokens/gnosis/tokens_gnosis_base_transfers.sql rename to tokens/models/transfers_and_balances/gnosis/tokens_gnosis_base_transfers.sql diff --git a/models/_sector/tokens/gnosis/tokens_gnosis_transfers.sql b/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_transfers.sql similarity index 93% rename from models/_sector/tokens/gnosis/tokens_gnosis_transfers.sql rename to tokens/models/transfers_and_balances/gnosis/tokens_gnosis_transfers.sql index 36db9e9e3fb..1b03a3bd9c3 100644 --- a/models/_sector/tokens/gnosis/tokens_gnosis_transfers.sql +++ b/tokens/models/transfers_and_balances/gnosis/tokens_gnosis_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_gnosis_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2018-10-09' , blockchain = 'gnosis' ) -}} \ No newline at end of file +}} diff --git a/models/_sector/tokens/linea/_schema.yml b/tokens/models/transfers_and_balances/linea/_schema.yml similarity index 100% rename from models/_sector/tokens/linea/_schema.yml rename to tokens/models/transfers_and_balances/linea/_schema.yml diff --git a/models/_sector/tokens/linea/tokens_linea_balances.sql b/tokens/models/transfers_and_balances/linea/tokens_linea_balances.sql similarity index 100% rename from models/_sector/tokens/linea/tokens_linea_balances.sql rename to tokens/models/transfers_and_balances/linea/tokens_linea_balances.sql diff --git a/models/_sector/tokens/linea/tokens_linea_balances_daily.sql b/tokens/models/transfers_and_balances/linea/tokens_linea_balances_daily.sql similarity index 100% rename from models/_sector/tokens/linea/tokens_linea_balances_daily.sql rename to tokens/models/transfers_and_balances/linea/tokens_linea_balances_daily.sql diff --git a/models/_sector/tokens/linea/tokens_linea_balances_daily_agg.sql b/tokens/models/transfers_and_balances/linea/tokens_linea_balances_daily_agg.sql similarity index 100% rename from models/_sector/tokens/linea/tokens_linea_balances_daily_agg.sql rename to tokens/models/transfers_and_balances/linea/tokens_linea_balances_daily_agg.sql diff --git a/models/_sector/tokens/linea/tokens_linea_balances_daily_agg_base.sql b/tokens/models/transfers_and_balances/linea/tokens_linea_balances_daily_agg_base.sql similarity index 100% rename from models/_sector/tokens/linea/tokens_linea_balances_daily_agg_base.sql rename to tokens/models/transfers_and_balances/linea/tokens_linea_balances_daily_agg_base.sql diff --git a/models/_sector/tokens/linea/tokens_linea_base_transfers.sql b/tokens/models/transfers_and_balances/linea/tokens_linea_base_transfers.sql similarity index 100% rename from models/_sector/tokens/linea/tokens_linea_base_transfers.sql rename to tokens/models/transfers_and_balances/linea/tokens_linea_base_transfers.sql diff --git a/models/_sector/tokens/linea/tokens_linea_transfers.sql b/tokens/models/transfers_and_balances/linea/tokens_linea_transfers.sql similarity index 94% rename from models/_sector/tokens/linea/tokens_linea_transfers.sql rename to tokens/models/transfers_and_balances/linea/tokens_linea_transfers.sql index 059a9bc6f93..0ec82c4053d 100644 --- a/models/_sector/tokens/linea/tokens_linea_transfers.sql +++ b/tokens/models/transfers_and_balances/linea/tokens_linea_transfers.sql @@ -19,7 +19,7 @@ base_transfers = ref('tokens_linea_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2023-07-06' , blockchain = 'linea' ) diff --git a/models/_sector/tokens/mantle/_schema.yml b/tokens/models/transfers_and_balances/mantle/_schema.yml similarity index 100% rename from models/_sector/tokens/mantle/_schema.yml rename to tokens/models/transfers_and_balances/mantle/_schema.yml diff --git a/models/_sector/tokens/mantle/tokens_mantle_base_transfers.sql b/tokens/models/transfers_and_balances/mantle/tokens_mantle_base_transfers.sql similarity index 100% rename from models/_sector/tokens/mantle/tokens_mantle_base_transfers.sql rename to tokens/models/transfers_and_balances/mantle/tokens_mantle_base_transfers.sql diff --git a/models/_sector/tokens/mantle/tokens_mantle_transfers.sql b/tokens/models/transfers_and_balances/mantle/tokens_mantle_transfers.sql similarity index 93% rename from models/_sector/tokens/mantle/tokens_mantle_transfers.sql rename to tokens/models/transfers_and_balances/mantle/tokens_mantle_transfers.sql index 00313a8e899..9afb14a44fc 100644 --- a/models/_sector/tokens/mantle/tokens_mantle_transfers.sql +++ b/tokens/models/transfers_and_balances/mantle/tokens_mantle_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_mantle_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2020-04-22' , blockchain = 'mantle' ) -}} \ No newline at end of file +}} diff --git a/models/_sector/tokens/optimism/_schema.yml b/tokens/models/transfers_and_balances/optimism/_schema.yml similarity index 100% rename from models/_sector/tokens/optimism/_schema.yml rename to tokens/models/transfers_and_balances/optimism/_schema.yml diff --git a/models/_sector/tokens/optimism/tokens_optimism_balances.sql b/tokens/models/transfers_and_balances/optimism/tokens_optimism_balances.sql similarity index 100% rename from models/_sector/tokens/optimism/tokens_optimism_balances.sql rename to tokens/models/transfers_and_balances/optimism/tokens_optimism_balances.sql diff --git a/models/_sector/tokens/optimism/tokens_optimism_balances_daily.sql b/tokens/models/transfers_and_balances/optimism/tokens_optimism_balances_daily.sql similarity index 100% rename from models/_sector/tokens/optimism/tokens_optimism_balances_daily.sql rename to tokens/models/transfers_and_balances/optimism/tokens_optimism_balances_daily.sql diff --git a/models/_sector/tokens/optimism/tokens_optimism_balances_daily_agg.sql b/tokens/models/transfers_and_balances/optimism/tokens_optimism_balances_daily_agg.sql similarity index 100% rename from models/_sector/tokens/optimism/tokens_optimism_balances_daily_agg.sql rename to tokens/models/transfers_and_balances/optimism/tokens_optimism_balances_daily_agg.sql diff --git a/models/_sector/tokens/optimism/tokens_optimism_balances_daily_agg_base.sql b/tokens/models/transfers_and_balances/optimism/tokens_optimism_balances_daily_agg_base.sql similarity index 100% rename from models/_sector/tokens/optimism/tokens_optimism_balances_daily_agg_base.sql rename to tokens/models/transfers_and_balances/optimism/tokens_optimism_balances_daily_agg_base.sql diff --git a/models/_sector/tokens/optimism/tokens_optimism_base_transfers.sql b/tokens/models/transfers_and_balances/optimism/tokens_optimism_base_transfers.sql similarity index 100% rename from models/_sector/tokens/optimism/tokens_optimism_base_transfers.sql rename to tokens/models/transfers_and_balances/optimism/tokens_optimism_base_transfers.sql diff --git a/models/_sector/tokens/optimism/tokens_optimism_transfers.sql b/tokens/models/transfers_and_balances/optimism/tokens_optimism_transfers.sql similarity index 93% rename from models/_sector/tokens/optimism/tokens_optimism_transfers.sql rename to tokens/models/transfers_and_balances/optimism/tokens_optimism_transfers.sql index d743a3a2e71..fcb6e410e13 100644 --- a/models/_sector/tokens/optimism/tokens_optimism_transfers.sql +++ b/tokens/models/transfers_and_balances/optimism/tokens_optimism_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_optimism_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2021-11-11' , blockchain = 'optimism' ) -}} \ No newline at end of file +}} diff --git a/models/_sector/tokens/polygon/_schema.yml b/tokens/models/transfers_and_balances/polygon/_schema.yml similarity index 100% rename from models/_sector/tokens/polygon/_schema.yml rename to tokens/models/transfers_and_balances/polygon/_schema.yml diff --git a/models/_sector/tokens/polygon/tokens_polygon_balances.sql b/tokens/models/transfers_and_balances/polygon/tokens_polygon_balances.sql similarity index 100% rename from models/_sector/tokens/polygon/tokens_polygon_balances.sql rename to tokens/models/transfers_and_balances/polygon/tokens_polygon_balances.sql diff --git a/models/_sector/tokens/polygon/tokens_polygon_balances_daily.sql b/tokens/models/transfers_and_balances/polygon/tokens_polygon_balances_daily.sql similarity index 100% rename from models/_sector/tokens/polygon/tokens_polygon_balances_daily.sql rename to tokens/models/transfers_and_balances/polygon/tokens_polygon_balances_daily.sql diff --git a/models/_sector/tokens/polygon/tokens_polygon_balances_daily_agg.sql b/tokens/models/transfers_and_balances/polygon/tokens_polygon_balances_daily_agg.sql similarity index 100% rename from models/_sector/tokens/polygon/tokens_polygon_balances_daily_agg.sql rename to tokens/models/transfers_and_balances/polygon/tokens_polygon_balances_daily_agg.sql diff --git a/models/_sector/tokens/polygon/tokens_polygon_balances_daily_agg_base.sql b/tokens/models/transfers_and_balances/polygon/tokens_polygon_balances_daily_agg_base.sql similarity index 100% rename from models/_sector/tokens/polygon/tokens_polygon_balances_daily_agg_base.sql rename to tokens/models/transfers_and_balances/polygon/tokens_polygon_balances_daily_agg_base.sql diff --git a/models/_sector/tokens/polygon/tokens_polygon_base_transfers.sql b/tokens/models/transfers_and_balances/polygon/tokens_polygon_base_transfers.sql similarity index 100% rename from models/_sector/tokens/polygon/tokens_polygon_base_transfers.sql rename to tokens/models/transfers_and_balances/polygon/tokens_polygon_base_transfers.sql diff --git a/models/_sector/tokens/polygon/tokens_polygon_transfers.sql b/tokens/models/transfers_and_balances/polygon/tokens_polygon_transfers.sql similarity index 93% rename from models/_sector/tokens/polygon/tokens_polygon_transfers.sql rename to tokens/models/transfers_and_balances/polygon/tokens_polygon_transfers.sql index f6fd21e2e68..93e9ec6486c 100644 --- a/models/_sector/tokens/polygon/tokens_polygon_transfers.sql +++ b/tokens/models/transfers_and_balances/polygon/tokens_polygon_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_polygon_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2020-05-30' , blockchain = 'polygon' ) -}} \ No newline at end of file +}} diff --git a/models/_sector/tokens/scroll/_schema.yml b/tokens/models/transfers_and_balances/scroll/_schema.yml similarity index 100% rename from models/_sector/tokens/scroll/_schema.yml rename to tokens/models/transfers_and_balances/scroll/_schema.yml diff --git a/models/_sector/tokens/scroll/tokens_scroll_balances.sql b/tokens/models/transfers_and_balances/scroll/tokens_scroll_balances.sql similarity index 100% rename from models/_sector/tokens/scroll/tokens_scroll_balances.sql rename to tokens/models/transfers_and_balances/scroll/tokens_scroll_balances.sql diff --git a/models/_sector/tokens/scroll/tokens_scroll_balances_daily.sql b/tokens/models/transfers_and_balances/scroll/tokens_scroll_balances_daily.sql similarity index 100% rename from models/_sector/tokens/scroll/tokens_scroll_balances_daily.sql rename to tokens/models/transfers_and_balances/scroll/tokens_scroll_balances_daily.sql diff --git a/models/_sector/tokens/scroll/tokens_scroll_balances_daily_agg.sql b/tokens/models/transfers_and_balances/scroll/tokens_scroll_balances_daily_agg.sql similarity index 100% rename from models/_sector/tokens/scroll/tokens_scroll_balances_daily_agg.sql rename to tokens/models/transfers_and_balances/scroll/tokens_scroll_balances_daily_agg.sql diff --git a/models/_sector/tokens/scroll/tokens_scroll_balances_daily_agg_base.sql b/tokens/models/transfers_and_balances/scroll/tokens_scroll_balances_daily_agg_base.sql similarity index 100% rename from models/_sector/tokens/scroll/tokens_scroll_balances_daily_agg_base.sql rename to tokens/models/transfers_and_balances/scroll/tokens_scroll_balances_daily_agg_base.sql diff --git a/models/_sector/tokens/scroll/tokens_scroll_base_transfers.sql b/tokens/models/transfers_and_balances/scroll/tokens_scroll_base_transfers.sql similarity index 100% rename from models/_sector/tokens/scroll/tokens_scroll_base_transfers.sql rename to tokens/models/transfers_and_balances/scroll/tokens_scroll_base_transfers.sql diff --git a/models/_sector/tokens/scroll/tokens_scroll_transfers.sql b/tokens/models/transfers_and_balances/scroll/tokens_scroll_transfers.sql similarity index 94% rename from models/_sector/tokens/scroll/tokens_scroll_transfers.sql rename to tokens/models/transfers_and_balances/scroll/tokens_scroll_transfers.sql index 72453e28968..99a1b5e2531 100644 --- a/models/_sector/tokens/scroll/tokens_scroll_transfers.sql +++ b/tokens/models/transfers_and_balances/scroll/tokens_scroll_transfers.sql @@ -19,7 +19,7 @@ base_transfers = ref('tokens_scroll_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2023-02-15' , blockchain = 'scroll' ) diff --git a/models/_sector/tokens/tokens_transfers.sql b/tokens/models/transfers_and_balances/tokens_transfers.sql similarity index 100% rename from models/_sector/tokens/tokens_transfers.sql rename to tokens/models/transfers_and_balances/tokens_transfers.sql diff --git a/models/_sector/tokens/zkevm/_schema.yml b/tokens/models/transfers_and_balances/zkevm/_schema.yml similarity index 100% rename from models/_sector/tokens/zkevm/_schema.yml rename to tokens/models/transfers_and_balances/zkevm/_schema.yml diff --git a/models/_sector/tokens/zkevm/tokens_zkevm_base_transfers.sql b/tokens/models/transfers_and_balances/zkevm/tokens_zkevm_base_transfers.sql similarity index 100% rename from models/_sector/tokens/zkevm/tokens_zkevm_base_transfers.sql rename to tokens/models/transfers_and_balances/zkevm/tokens_zkevm_base_transfers.sql diff --git a/models/_sector/tokens/zkevm/tokens_zkevm_transfers.sql b/tokens/models/transfers_and_balances/zkevm/tokens_zkevm_transfers.sql similarity index 94% rename from models/_sector/tokens/zkevm/tokens_zkevm_transfers.sql rename to tokens/models/transfers_and_balances/zkevm/tokens_zkevm_transfers.sql index f28cabb314c..d9021ba8454 100644 --- a/models/_sector/tokens/zkevm/tokens_zkevm_transfers.sql +++ b/tokens/models/transfers_and_balances/zkevm/tokens_zkevm_transfers.sql @@ -19,7 +19,7 @@ base_transfers = ref('tokens_zkevm_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2023-03-24' , blockchain = 'zkevm' ) diff --git a/models/_sector/tokens/zksync/_schema.yml b/tokens/models/transfers_and_balances/zksync/_schema.yml similarity index 100% rename from models/_sector/tokens/zksync/_schema.yml rename to tokens/models/transfers_and_balances/zksync/_schema.yml diff --git a/models/_sector/tokens/zksync/tokens_zksync_base_transfers.sql b/tokens/models/transfers_and_balances/zksync/tokens_zksync_base_transfers.sql similarity index 100% rename from models/_sector/tokens/zksync/tokens_zksync_base_transfers.sql rename to tokens/models/transfers_and_balances/zksync/tokens_zksync_base_transfers.sql diff --git a/models/_sector/tokens/zksync/tokens_zksync_transfers.sql b/tokens/models/transfers_and_balances/zksync/tokens_zksync_transfers.sql similarity index 93% rename from models/_sector/tokens/zksync/tokens_zksync_transfers.sql rename to tokens/models/transfers_and_balances/zksync/tokens_zksync_transfers.sql index fac09414bbe..e65163c1953 100644 --- a/models/_sector/tokens/zksync/tokens_zksync_transfers.sql +++ b/tokens/models/transfers_and_balances/zksync/tokens_zksync_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_zksync_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2023-02-15' , blockchain = 'zksync' ) -}} \ No newline at end of file +}} diff --git a/models/_sector/tokens/zora/_schema.yml b/tokens/models/transfers_and_balances/zora/_schema.yml similarity index 100% rename from models/_sector/tokens/zora/_schema.yml rename to tokens/models/transfers_and_balances/zora/_schema.yml diff --git a/models/_sector/tokens/zora/tokens_zora_base_transfers.sql b/tokens/models/transfers_and_balances/zora/tokens_zora_base_transfers.sql similarity index 100% rename from models/_sector/tokens/zora/tokens_zora_base_transfers.sql rename to tokens/models/transfers_and_balances/zora/tokens_zora_base_transfers.sql diff --git a/models/_sector/tokens/zora/tokens_zora_transfers.sql b/tokens/models/transfers_and_balances/zora/tokens_zora_transfers.sql similarity index 93% rename from models/_sector/tokens/zora/tokens_zora_transfers.sql rename to tokens/models/transfers_and_balances/zora/tokens_zora_transfers.sql index 5997aeb6e79..f611877aed6 100644 --- a/models/_sector/tokens/zora/tokens_zora_transfers.sql +++ b/tokens/models/transfers_and_balances/zora/tokens_zora_transfers.sql @@ -19,8 +19,8 @@ base_transfers = ref('tokens_zora_base_transfers') , tokens_erc20_model = source('tokens', 'erc20') , prices_model = source('prices', 'usd') - , evms_info_model = ref('evms_info') + , evms_info_model = source('evms','info') , transfers_start_date = '2023-06-13' , blockchain = 'zora' ) -}} \ No newline at end of file +}}