From 79162f26330b73f6246fd1afef805b4d731ba513 Mon Sep 17 00:00:00 2001 From: 0xRob <83790096+0xRobin@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:24:56 +0200 Subject: [PATCH 01/12] restructure macros (#6450) * move macros * adapt docs to new structure * fix file path references --- .gitignore | 4 +-- .../deprecated_udfs}/base58_decode.sql | 0 .../deprecated_udfs}/bytea2numeric_v3.sql | 0 .../deprecated_udfs}/get_balancer_link.sql | 0 .../deprecated_udfs}/get_chain_explorer.sql | 0 .../get_chain_explorer_address.sql | 0 .../get_chain_explorer_tx_hash.sql | 0 .../get_chain_native_token.sql | 0 .../deprecated_udfs}/get_href.sql | 0 {macros => dbt_macros}/dune/__init__.py | 0 {macros => dbt_macros}/dune/adapters.sql | 0 .../dune/create_bindings.sql | 0 .../dune/enforce_join_distribution.sql | 0 .../dune/expose_dataset.sql | 0 {macros => dbt_macros}/dune/expose_spells.sql | 0 .../dune/expose_spells_hide_trino.sql | 0 .../dune/generate_alias_name.sql | 0 .../dune/generate_schema_name.sql | 0 {macros => dbt_macros}/dune/incremental.sql | 0 .../incremental_days_forward_predicate.sql | 0 .../dune/incremental_predicate.sql | 0 .../dune/is_incremental.sql | 0 {macros => dbt_macros}/dune/macros_schema.yml | 0 {macros => dbt_macros}/dune/mark_as_spell.sql | 0 .../dune/no-relation-listing.sql | 0 .../dune/optimize_spell.sql | 0 {macros => dbt_macros}/dune/ref.sql | 0 {macros => dbt_macros}/dune/return_node.sql | 0 {macros => dbt_macros}/dune/schema.sql | 0 .../dune/set_trino_session_property.sql | 0 {macros => dbt_macros}/dune/source.sql | 0 .../check_column_types_macro.sql | 0 .../generic-tests/check_seed_macro.sql | 0 .../equal_rowcount_with_sources.sql | 0 .../generic-tests/not_zero_address.sql | 0 .../shared}/add_tx_columns.sql | 0 .../shared}/all_evm_chains.sql | 0 .../shared}/all_op_chains.sql | 0 .../balancer/balancer_bpt_prices_macro.sql | 0 .../balancer/balancer_bpt_supply_macro.sql | 0 .../balancer/balancer_liquidity_macro.sql | 0 ...l_token_supply_changes_daily_agg_macro.sql | 0 ...lancer_pool_token_supply_changes_macro.sql | 0 .../balancer/balancer_protocol_fee_macro.sql | 0 ..._token_balance_changes_daily_agg_macro.sql | 0 .../balancer_token_balance_changes_macro.sql | 0 .../balancer/balancer_transfers_bpt_macro.sql | 0 .../evm_get_calldata_gas_from_data.sql | 0 .../daily_spellbook/dbt_project.yml | 2 +- .../chainlink/chainlink_ccip_macro.sql | 0 .../creator_tokens_inspect_contracts.sql | 0 .../_meta/oneinch_mapped_contracts_macro.sql | 0 ...project_swaps_exposed_blockchains_list.sql | 0 ...neinch_project_orders_cfg_events_macro.sql | 0 ...einch_project_orders_cfg_methods_macro.sql | 0 .../project/oneinch_project_calls_macro.sql | 0 .../project/oneinch_project_orders_macro.sql | 0 .../oneinch_project_orders_raw_logs_macro.sql | 0 ...neinch_project_orders_raw_traces_macro.sql | 0 .../project/oneinch_project_swaps_macro.sql | 0 .../project}/yield_yak/yield_yak_balances.sql | 0 .../yield_yak_deposits_withdraws.sql | 0 .../yield_yak/yield_yak_reinvests.sql | 0 .../yield_yak/yield_yak_strategies.sql | 0 .../yield_yak/yield_yak_user_yrt_balances.sql | 0 .../yield_yak/yield_yak_yak_adapter_swaps.sql | 0 .../yield_yak/yield_yak_yak_swaps.sql | 0 .../yield_yak/yield_yak_yield_strategies.sql | 0 .../addresses_events_first_activity.sql | 0 .../addresses_events_first_funded_by.sql | 0 .../macros/sector/alm}/add_pool_price_usd.sql | 0 .../sector}/alm/arrakis_compatible_trades.sql | 0 .../macros/sector}/attestation/eas.sql | 0 .../contracts_base_iterated_creators.sql | 0 .../contracts_base_starting_level.sql | 0 .../contracts/contracts_contract_mapping.sql | 0 .../find_self_destruct_contracts.sql | 0 .../sector}/dex/uniswap_compatible_pools.sql | 0 .../fungible/balances_fungible_day.sql | 0 .../fungible/balances_fungible_hour.sql | 0 .../fungible/balances_fungible_latest.sql | 0 .../balances_fungible_noncompliant.sql | 0 .../sector}/fungible/fungible_transfers.sql | 0 .../macros/sector}/gas/gas_prices.sql | 0 .../sector}/inscription/inscription_all.sql | 0 .../inscription/inscription_deploys.sql | 0 .../sector}/inscription/inscription_mints.sql | 0 .../referral/enrich_referral_rewards.sql | 0 .../platforms/fabric_referral_rewards.sql | 0 .../platforms/mintfun_referral_rewards.sql | 0 .../platforms/mirror_referral_rewards.sql | 0 .../platforms/paragraph_referral_rewards.sql | 0 .../platforms/rabbithole_referral_rewards.sql | 0 .../platforms/soundxyz_referral_rewards.sql | 0 .../soundxyz_v2_referral_rewards.sql | 0 .../platforms/zora_referral_rewards.sql | 0 .../sector}/social/enrich_social_trades.sql | 0 .../transfers/erc20/transfers_erc20.sql | 0 .../erc20/transfers_erc20_agg_day.sql | 0 .../erc20/transfers_erc20_agg_hour.sql | 0 .../erc20/transfers_erc20_rolling_day.sql | 0 .../erc20/transfers_erc20_rolling_hour.sql | 0 .../models/_sector/alm/README.md | 2 +- .../models/contracts/readme.md | 2 +- dbt_subprojects/dex/dbt_project.yml | 2 +- .../dex/macros}/add_amount_usd.sql | 0 .../models/_project/zeroex}/bytea2numeric.sql | 0 dbt_subprojects/dex/models/trades/readme.md | 2 +- .../hourly_spellbook/dbt_project.yml | 2 +- .../erc4337_account_deployed.sql | 0 .../erc4337_userops_basics.sql | 0 .../erc4337_userops_enrichments.sql | 0 .../macros/sector}/cex/cex_evms.sql | 0 .../macros/sector}/cex/cex_flows.sql | 0 .../lending_aave_compatible_borrow.sql | 0 .../lending_aave_compatible_flashloans.sql | 0 .../lending_aave_compatible_supply.sql | 0 .../lending_compound_compatible_borrow.sql | 0 .../lending_compound_compatible_supply.sql | 0 .../sector}/lending/lending_enrich_borrow.sql | 0 .../lending/lending_enrich_flashloans.sql | 0 .../sector}/lending/lending_enrich_supply.sql | 0 dbt_subprojects/nft/dbt_project.yml | 2 +- .../nft/macros/platforms}/seaport_traces.sql | 0 dbt_subprojects/solana/dbt_project.yml | 2 +- dbt_subprojects/tokens/dbt_project.yml | 2 +- .../macros/balances}/balances_daily.sql | 0 .../macros/balances}/balances_daily_agg.sql | 0 .../macros/balances}/balances_enrich.sql | 0 .../macros/balances}/balances_fix_schema.sql | 0 .../macros/balances}/create_balances.sql | 0 .../macros/transfers}/transfers_base.sql | 0 .../transfers_base_wrapped_token.sql | 0 .../macros/transfers}/transfers_enrich.sql | 0 docs/macros/macro_overview.md | 23 ++++++------- docs/models/model_config_block.md | 2 +- docs/models/model_overview.md | 2 +- docs/seeds/seed_overview.md | 2 +- macros/public/public_macros_schema.yml | 33 ------------------- scripts/alter_table_locations.py | 2 +- 140 files changed, 27 insertions(+), 59 deletions(-) rename {macros/public => dbt_macros/deprecated_udfs}/base58_decode.sql (100%) rename {macros/public => dbt_macros/deprecated_udfs}/bytea2numeric_v3.sql (100%) rename {macros/public => dbt_macros/deprecated_udfs}/get_balancer_link.sql (100%) rename {macros/public => dbt_macros/deprecated_udfs}/get_chain_explorer.sql (100%) rename {macros/public => dbt_macros/deprecated_udfs}/get_chain_explorer_address.sql (100%) rename {macros/public => dbt_macros/deprecated_udfs}/get_chain_explorer_tx_hash.sql (100%) rename {macros/public => dbt_macros/deprecated_udfs}/get_chain_native_token.sql (100%) rename {macros/public => dbt_macros/deprecated_udfs}/get_href.sql (100%) rename {macros => dbt_macros}/dune/__init__.py (100%) rename {macros => dbt_macros}/dune/adapters.sql (100%) rename {macros => dbt_macros}/dune/create_bindings.sql (100%) rename {macros => dbt_macros}/dune/enforce_join_distribution.sql (100%) rename {macros => dbt_macros}/dune/expose_dataset.sql (100%) rename {macros => dbt_macros}/dune/expose_spells.sql (100%) rename {macros => dbt_macros}/dune/expose_spells_hide_trino.sql (100%) rename {macros => dbt_macros}/dune/generate_alias_name.sql (100%) rename {macros => dbt_macros}/dune/generate_schema_name.sql (100%) rename {macros => dbt_macros}/dune/incremental.sql (100%) rename {macros => dbt_macros}/dune/incremental_days_forward_predicate.sql (100%) rename {macros => dbt_macros}/dune/incremental_predicate.sql (100%) rename {macros => dbt_macros}/dune/is_incremental.sql (100%) rename {macros => dbt_macros}/dune/macros_schema.yml (100%) rename {macros => dbt_macros}/dune/mark_as_spell.sql (100%) rename {macros => dbt_macros}/dune/no-relation-listing.sql (100%) rename {macros => dbt_macros}/dune/optimize_spell.sql (100%) rename {macros => dbt_macros}/dune/ref.sql (100%) rename {macros => dbt_macros}/dune/return_node.sql (100%) rename {macros => dbt_macros}/dune/schema.sql (100%) rename {macros => dbt_macros}/dune/set_trino_session_property.sql (100%) rename {macros => dbt_macros}/dune/source.sql (100%) rename {macros => dbt_macros}/generic-tests/check_column_types_macro.sql (100%) rename {macros => dbt_macros}/generic-tests/check_seed_macro.sql (100%) rename {macros => dbt_macros}/generic-tests/equal_rowcount_with_sources.sql (100%) rename {macros => dbt_macros}/generic-tests/not_zero_address.sql (100%) rename {macros/models/_sector => dbt_macros/shared}/add_tx_columns.sql (100%) rename {macros/public => dbt_macros/shared}/all_evm_chains.sql (100%) rename {macros/public => dbt_macros/shared}/all_op_chains.sql (100%) rename {macros/models/_project => dbt_macros/shared}/balancer/balancer_bpt_prices_macro.sql (100%) rename {macros/models/_project => dbt_macros/shared}/balancer/balancer_bpt_supply_macro.sql (100%) rename {macros/models/_project => dbt_macros/shared}/balancer/balancer_liquidity_macro.sql (100%) rename {macros/models/_project => dbt_macros/shared}/balancer/balancer_pool_token_supply_changes_daily_agg_macro.sql (100%) rename {macros/models/_project => dbt_macros/shared}/balancer/balancer_pool_token_supply_changes_macro.sql (100%) rename {macros/models/_project => dbt_macros/shared}/balancer/balancer_protocol_fee_macro.sql (100%) rename {macros/models/_project => dbt_macros/shared}/balancer/balancer_token_balance_changes_daily_agg_macro.sql (100%) rename {macros/models/_project => dbt_macros/shared}/balancer/balancer_token_balance_changes_macro.sql (100%) rename {macros/models/_project => dbt_macros/shared}/balancer/balancer_transfers_bpt_macro.sql (100%) rename {macros/public => dbt_macros/shared}/evm_get_calldata_gas_from_data.sql (100%) rename {macros/models/_project => dbt_subprojects/daily_spellbook/macros/project}/chainlink/chainlink_ccip_macro.sql (100%) rename {macros/models/_project => dbt_subprojects/daily_spellbook/macros/project}/limitbreak/creator_tokens/creator_tokens_inspect_contracts.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models/_project => project}/oneinch/_meta/oneinch_mapped_contracts_macro.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models/_project => project}/oneinch/_meta/oneinch_project_swaps_exposed_blockchains_list.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models/_project => project}/oneinch/project/cfg/oneinch_project_orders_cfg_events_macro.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models/_project => project}/oneinch/project/cfg/oneinch_project_orders_cfg_methods_macro.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models/_project => project}/oneinch/project/oneinch_project_calls_macro.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models/_project => project}/oneinch/project/oneinch_project_orders_macro.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models/_project => project}/oneinch/project/oneinch_project_orders_raw_logs_macro.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models/_project => project}/oneinch/project/oneinch_project_orders_raw_traces_macro.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models/_project => project}/oneinch/project/oneinch_project_swaps_macro.sql (100%) rename {macros/models/_project => dbt_subprojects/daily_spellbook/macros/project}/yield_yak/yield_yak_balances.sql (100%) rename {macros/models/_project => dbt_subprojects/daily_spellbook/macros/project}/yield_yak/yield_yak_deposits_withdraws.sql (100%) rename {macros/models/_project => dbt_subprojects/daily_spellbook/macros/project}/yield_yak/yield_yak_reinvests.sql (100%) rename {macros/models/_project => dbt_subprojects/daily_spellbook/macros/project}/yield_yak/yield_yak_strategies.sql (100%) rename {macros/models/_project => dbt_subprojects/daily_spellbook/macros/project}/yield_yak/yield_yak_user_yrt_balances.sql (100%) rename {macros/models/_project => dbt_subprojects/daily_spellbook/macros/project}/yield_yak/yield_yak_yak_adapter_swaps.sql (100%) rename {macros/models/_project => dbt_subprojects/daily_spellbook/macros/project}/yield_yak/yield_yak_yak_swaps.sql (100%) rename {macros/models/_project => dbt_subprojects/daily_spellbook/macros/project}/yield_yak/yield_yak_yield_strategies.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models => }/sector/addresses_events/addresses_events_first_activity.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models => }/sector/addresses_events/addresses_events_first_funded_by.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector/alm}/add_pool_price_usd.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/alm/arrakis_compatible_trades.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/attestation/eas.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models => }/sector/contracts/contracts_base_iterated_creators.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models => }/sector/contracts/contracts_base_starting_level.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models => }/sector/contracts/contracts_contract_mapping.sql (100%) rename dbt_subprojects/daily_spellbook/macros/{models => }/sector/contracts/find_self_destruct_contracts.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/dex/uniswap_compatible_pools.sql (100%) rename {macros/models/_sector/balances => dbt_subprojects/daily_spellbook/macros/sector}/fungible/balances_fungible_day.sql (100%) rename {macros/models/_sector/balances => dbt_subprojects/daily_spellbook/macros/sector}/fungible/balances_fungible_hour.sql (100%) rename {macros/models/_sector/balances => dbt_subprojects/daily_spellbook/macros/sector}/fungible/balances_fungible_latest.sql (100%) rename {macros/models/_sector/balances => dbt_subprojects/daily_spellbook/macros/sector}/fungible/balances_fungible_noncompliant.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/fungible/fungible_transfers.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/gas/gas_prices.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/inscription/inscription_all.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/inscription/inscription_deploys.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/inscription/inscription_mints.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/referral/enrich_referral_rewards.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/referral/platforms/fabric_referral_rewards.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/referral/platforms/mintfun_referral_rewards.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/referral/platforms/mirror_referral_rewards.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/referral/platforms/paragraph_referral_rewards.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/referral/platforms/rabbithole_referral_rewards.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/referral/platforms/soundxyz_referral_rewards.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/referral/platforms/soundxyz_v2_referral_rewards.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/referral/platforms/zora_referral_rewards.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/social/enrich_social_trades.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/transfers/erc20/transfers_erc20.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/transfers/erc20/transfers_erc20_agg_day.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/transfers/erc20/transfers_erc20_agg_hour.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/transfers/erc20/transfers_erc20_rolling_day.sql (100%) rename {macros/models/_sector => dbt_subprojects/daily_spellbook/macros/sector}/transfers/erc20/transfers_erc20_rolling_hour.sql (100%) rename {macros/models/_sector => dbt_subprojects/dex/macros}/add_amount_usd.sql (100%) rename {macros/public => dbt_subprojects/dex/macros/models/_project/zeroex}/bytea2numeric.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/account_abstraction/erc4337_account_deployed.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/account_abstraction/erc4337_userops_basics.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/account_abstraction/erc4337_userops_enrichments.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/cex/cex_evms.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/cex/cex_flows.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/lending/lending_aave_compatible_borrow.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/lending/lending_aave_compatible_flashloans.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/lending/lending_aave_compatible_supply.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/lending/lending_compound_compatible_borrow.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/lending/lending_compound_compatible_supply.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/lending/lending_enrich_borrow.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/lending/lending_enrich_flashloans.sql (100%) rename {macros/models/_sector => dbt_subprojects/hourly_spellbook/macros/sector}/lending/lending_enrich_supply.sql (100%) rename {macros/models/_project/seaport => dbt_subprojects/nft/macros/platforms}/seaport_traces.sql (100%) rename {macros/models/_sector/tokens => dbt_subprojects/tokens/macros/balances}/balances_daily.sql (100%) rename {macros/models/_sector/tokens => dbt_subprojects/tokens/macros/balances}/balances_daily_agg.sql (100%) rename {macros/models/_sector/tokens => dbt_subprojects/tokens/macros/balances}/balances_enrich.sql (100%) rename {macros/models/_sector/tokens => dbt_subprojects/tokens/macros/balances}/balances_fix_schema.sql (100%) rename {macros/models/_sector/tokens => dbt_subprojects/tokens/macros/balances}/create_balances.sql (100%) rename {macros/models/_sector/tokens => dbt_subprojects/tokens/macros/transfers}/transfers_base.sql (100%) rename {macros/models/_sector/tokens => dbt_subprojects/tokens/macros/transfers}/transfers_base_wrapped_token.sql (100%) rename {macros/models/_sector/tokens => dbt_subprojects/tokens/macros/transfers}/transfers_enrich.sql (100%) delete mode 100644 macros/public/public_macros_schema.yml diff --git a/.gitignore b/.gitignore index e851b9b7bbd..1a1c62c9df8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ .DS_Store .vscode manifest.json -macros/dune/create_views_of_dependencies.sql -macros/dune/alter_table_locations.sql +dbt_macros/dune/create_views_of_dependencies.sql +dbt_macros/dune/alter_table_locations.sql scripts/integration_test/test_diffs_tokens/* .vs diff --git a/macros/public/base58_decode.sql b/dbt_macros/deprecated_udfs/base58_decode.sql similarity index 100% rename from macros/public/base58_decode.sql rename to dbt_macros/deprecated_udfs/base58_decode.sql diff --git a/macros/public/bytea2numeric_v3.sql b/dbt_macros/deprecated_udfs/bytea2numeric_v3.sql similarity index 100% rename from macros/public/bytea2numeric_v3.sql rename to dbt_macros/deprecated_udfs/bytea2numeric_v3.sql diff --git a/macros/public/get_balancer_link.sql b/dbt_macros/deprecated_udfs/get_balancer_link.sql similarity index 100% rename from macros/public/get_balancer_link.sql rename to dbt_macros/deprecated_udfs/get_balancer_link.sql diff --git a/macros/public/get_chain_explorer.sql b/dbt_macros/deprecated_udfs/get_chain_explorer.sql similarity index 100% rename from macros/public/get_chain_explorer.sql rename to dbt_macros/deprecated_udfs/get_chain_explorer.sql diff --git a/macros/public/get_chain_explorer_address.sql b/dbt_macros/deprecated_udfs/get_chain_explorer_address.sql similarity index 100% rename from macros/public/get_chain_explorer_address.sql rename to dbt_macros/deprecated_udfs/get_chain_explorer_address.sql diff --git a/macros/public/get_chain_explorer_tx_hash.sql b/dbt_macros/deprecated_udfs/get_chain_explorer_tx_hash.sql similarity index 100% rename from macros/public/get_chain_explorer_tx_hash.sql rename to dbt_macros/deprecated_udfs/get_chain_explorer_tx_hash.sql diff --git a/macros/public/get_chain_native_token.sql b/dbt_macros/deprecated_udfs/get_chain_native_token.sql similarity index 100% rename from macros/public/get_chain_native_token.sql rename to dbt_macros/deprecated_udfs/get_chain_native_token.sql diff --git a/macros/public/get_href.sql b/dbt_macros/deprecated_udfs/get_href.sql similarity index 100% rename from macros/public/get_href.sql rename to dbt_macros/deprecated_udfs/get_href.sql diff --git a/macros/dune/__init__.py b/dbt_macros/dune/__init__.py similarity index 100% rename from macros/dune/__init__.py rename to dbt_macros/dune/__init__.py diff --git a/macros/dune/adapters.sql b/dbt_macros/dune/adapters.sql similarity index 100% rename from macros/dune/adapters.sql rename to dbt_macros/dune/adapters.sql diff --git a/macros/dune/create_bindings.sql b/dbt_macros/dune/create_bindings.sql similarity index 100% rename from macros/dune/create_bindings.sql rename to dbt_macros/dune/create_bindings.sql diff --git a/macros/dune/enforce_join_distribution.sql b/dbt_macros/dune/enforce_join_distribution.sql similarity index 100% rename from macros/dune/enforce_join_distribution.sql rename to dbt_macros/dune/enforce_join_distribution.sql diff --git a/macros/dune/expose_dataset.sql b/dbt_macros/dune/expose_dataset.sql similarity index 100% rename from macros/dune/expose_dataset.sql rename to dbt_macros/dune/expose_dataset.sql diff --git a/macros/dune/expose_spells.sql b/dbt_macros/dune/expose_spells.sql similarity index 100% rename from macros/dune/expose_spells.sql rename to dbt_macros/dune/expose_spells.sql diff --git a/macros/dune/expose_spells_hide_trino.sql b/dbt_macros/dune/expose_spells_hide_trino.sql similarity index 100% rename from macros/dune/expose_spells_hide_trino.sql rename to dbt_macros/dune/expose_spells_hide_trino.sql diff --git a/macros/dune/generate_alias_name.sql b/dbt_macros/dune/generate_alias_name.sql similarity index 100% rename from macros/dune/generate_alias_name.sql rename to dbt_macros/dune/generate_alias_name.sql diff --git a/macros/dune/generate_schema_name.sql b/dbt_macros/dune/generate_schema_name.sql similarity index 100% rename from macros/dune/generate_schema_name.sql rename to dbt_macros/dune/generate_schema_name.sql diff --git a/macros/dune/incremental.sql b/dbt_macros/dune/incremental.sql similarity index 100% rename from macros/dune/incremental.sql rename to dbt_macros/dune/incremental.sql diff --git a/macros/dune/incremental_days_forward_predicate.sql b/dbt_macros/dune/incremental_days_forward_predicate.sql similarity index 100% rename from macros/dune/incremental_days_forward_predicate.sql rename to dbt_macros/dune/incremental_days_forward_predicate.sql diff --git a/macros/dune/incremental_predicate.sql b/dbt_macros/dune/incremental_predicate.sql similarity index 100% rename from macros/dune/incremental_predicate.sql rename to dbt_macros/dune/incremental_predicate.sql diff --git a/macros/dune/is_incremental.sql b/dbt_macros/dune/is_incremental.sql similarity index 100% rename from macros/dune/is_incremental.sql rename to dbt_macros/dune/is_incremental.sql diff --git a/macros/dune/macros_schema.yml b/dbt_macros/dune/macros_schema.yml similarity index 100% rename from macros/dune/macros_schema.yml rename to dbt_macros/dune/macros_schema.yml diff --git a/macros/dune/mark_as_spell.sql b/dbt_macros/dune/mark_as_spell.sql similarity index 100% rename from macros/dune/mark_as_spell.sql rename to dbt_macros/dune/mark_as_spell.sql diff --git a/macros/dune/no-relation-listing.sql b/dbt_macros/dune/no-relation-listing.sql similarity index 100% rename from macros/dune/no-relation-listing.sql rename to dbt_macros/dune/no-relation-listing.sql diff --git a/macros/dune/optimize_spell.sql b/dbt_macros/dune/optimize_spell.sql similarity index 100% rename from macros/dune/optimize_spell.sql rename to dbt_macros/dune/optimize_spell.sql diff --git a/macros/dune/ref.sql b/dbt_macros/dune/ref.sql similarity index 100% rename from macros/dune/ref.sql rename to dbt_macros/dune/ref.sql diff --git a/macros/dune/return_node.sql b/dbt_macros/dune/return_node.sql similarity index 100% rename from macros/dune/return_node.sql rename to dbt_macros/dune/return_node.sql diff --git a/macros/dune/schema.sql b/dbt_macros/dune/schema.sql similarity index 100% rename from macros/dune/schema.sql rename to dbt_macros/dune/schema.sql diff --git a/macros/dune/set_trino_session_property.sql b/dbt_macros/dune/set_trino_session_property.sql similarity index 100% rename from macros/dune/set_trino_session_property.sql rename to dbt_macros/dune/set_trino_session_property.sql diff --git a/macros/dune/source.sql b/dbt_macros/dune/source.sql similarity index 100% rename from macros/dune/source.sql rename to dbt_macros/dune/source.sql diff --git a/macros/generic-tests/check_column_types_macro.sql b/dbt_macros/generic-tests/check_column_types_macro.sql similarity index 100% rename from macros/generic-tests/check_column_types_macro.sql rename to dbt_macros/generic-tests/check_column_types_macro.sql diff --git a/macros/generic-tests/check_seed_macro.sql b/dbt_macros/generic-tests/check_seed_macro.sql similarity index 100% rename from macros/generic-tests/check_seed_macro.sql rename to dbt_macros/generic-tests/check_seed_macro.sql diff --git a/macros/generic-tests/equal_rowcount_with_sources.sql b/dbt_macros/generic-tests/equal_rowcount_with_sources.sql similarity index 100% rename from macros/generic-tests/equal_rowcount_with_sources.sql rename to dbt_macros/generic-tests/equal_rowcount_with_sources.sql diff --git a/macros/generic-tests/not_zero_address.sql b/dbt_macros/generic-tests/not_zero_address.sql similarity index 100% rename from macros/generic-tests/not_zero_address.sql rename to dbt_macros/generic-tests/not_zero_address.sql diff --git a/macros/models/_sector/add_tx_columns.sql b/dbt_macros/shared/add_tx_columns.sql similarity index 100% rename from macros/models/_sector/add_tx_columns.sql rename to dbt_macros/shared/add_tx_columns.sql diff --git a/macros/public/all_evm_chains.sql b/dbt_macros/shared/all_evm_chains.sql similarity index 100% rename from macros/public/all_evm_chains.sql rename to dbt_macros/shared/all_evm_chains.sql diff --git a/macros/public/all_op_chains.sql b/dbt_macros/shared/all_op_chains.sql similarity index 100% rename from macros/public/all_op_chains.sql rename to dbt_macros/shared/all_op_chains.sql diff --git a/macros/models/_project/balancer/balancer_bpt_prices_macro.sql b/dbt_macros/shared/balancer/balancer_bpt_prices_macro.sql similarity index 100% rename from macros/models/_project/balancer/balancer_bpt_prices_macro.sql rename to dbt_macros/shared/balancer/balancer_bpt_prices_macro.sql diff --git a/macros/models/_project/balancer/balancer_bpt_supply_macro.sql b/dbt_macros/shared/balancer/balancer_bpt_supply_macro.sql similarity index 100% rename from macros/models/_project/balancer/balancer_bpt_supply_macro.sql rename to dbt_macros/shared/balancer/balancer_bpt_supply_macro.sql diff --git a/macros/models/_project/balancer/balancer_liquidity_macro.sql b/dbt_macros/shared/balancer/balancer_liquidity_macro.sql similarity index 100% rename from macros/models/_project/balancer/balancer_liquidity_macro.sql rename to dbt_macros/shared/balancer/balancer_liquidity_macro.sql diff --git a/macros/models/_project/balancer/balancer_pool_token_supply_changes_daily_agg_macro.sql b/dbt_macros/shared/balancer/balancer_pool_token_supply_changes_daily_agg_macro.sql similarity index 100% rename from macros/models/_project/balancer/balancer_pool_token_supply_changes_daily_agg_macro.sql rename to dbt_macros/shared/balancer/balancer_pool_token_supply_changes_daily_agg_macro.sql diff --git a/macros/models/_project/balancer/balancer_pool_token_supply_changes_macro.sql b/dbt_macros/shared/balancer/balancer_pool_token_supply_changes_macro.sql similarity index 100% rename from macros/models/_project/balancer/balancer_pool_token_supply_changes_macro.sql rename to dbt_macros/shared/balancer/balancer_pool_token_supply_changes_macro.sql diff --git a/macros/models/_project/balancer/balancer_protocol_fee_macro.sql b/dbt_macros/shared/balancer/balancer_protocol_fee_macro.sql similarity index 100% rename from macros/models/_project/balancer/balancer_protocol_fee_macro.sql rename to dbt_macros/shared/balancer/balancer_protocol_fee_macro.sql diff --git a/macros/models/_project/balancer/balancer_token_balance_changes_daily_agg_macro.sql b/dbt_macros/shared/balancer/balancer_token_balance_changes_daily_agg_macro.sql similarity index 100% rename from macros/models/_project/balancer/balancer_token_balance_changes_daily_agg_macro.sql rename to dbt_macros/shared/balancer/balancer_token_balance_changes_daily_agg_macro.sql diff --git a/macros/models/_project/balancer/balancer_token_balance_changes_macro.sql b/dbt_macros/shared/balancer/balancer_token_balance_changes_macro.sql similarity index 100% rename from macros/models/_project/balancer/balancer_token_balance_changes_macro.sql rename to dbt_macros/shared/balancer/balancer_token_balance_changes_macro.sql diff --git a/macros/models/_project/balancer/balancer_transfers_bpt_macro.sql b/dbt_macros/shared/balancer/balancer_transfers_bpt_macro.sql similarity index 100% rename from macros/models/_project/balancer/balancer_transfers_bpt_macro.sql rename to dbt_macros/shared/balancer/balancer_transfers_bpt_macro.sql diff --git a/macros/public/evm_get_calldata_gas_from_data.sql b/dbt_macros/shared/evm_get_calldata_gas_from_data.sql similarity index 100% rename from macros/public/evm_get_calldata_gas_from_data.sql rename to dbt_macros/shared/evm_get_calldata_gas_from_data.sql diff --git a/dbt_subprojects/daily_spellbook/dbt_project.yml b/dbt_subprojects/daily_spellbook/dbt_project.yml index 75966ee0ed2..dfb8ba12c2a 100644 --- a/dbt_subprojects/daily_spellbook/dbt_project.yml +++ b/dbt_subprojects/daily_spellbook/dbt_project.yml @@ -24,7 +24,7 @@ vars: model-paths: ["models", "../../sources"] test-paths: ["tests"] seed-paths: ["seeds"] -macro-paths: ["macros", "../../macros"] +macro-paths: ["macros", "../../dbt_macros"] target-path: "target" # directory which will store compiled SQL files clean-targets: # directories to be removed by `dbt clean` diff --git a/macros/models/_project/chainlink/chainlink_ccip_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/chainlink/chainlink_ccip_macro.sql similarity index 100% rename from macros/models/_project/chainlink/chainlink_ccip_macro.sql rename to dbt_subprojects/daily_spellbook/macros/project/chainlink/chainlink_ccip_macro.sql diff --git a/macros/models/_project/limitbreak/creator_tokens/creator_tokens_inspect_contracts.sql b/dbt_subprojects/daily_spellbook/macros/project/limitbreak/creator_tokens/creator_tokens_inspect_contracts.sql similarity index 100% rename from macros/models/_project/limitbreak/creator_tokens/creator_tokens_inspect_contracts.sql rename to dbt_subprojects/daily_spellbook/macros/project/limitbreak/creator_tokens/creator_tokens_inspect_contracts.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/_meta/oneinch_mapped_contracts_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/_meta/oneinch_mapped_contracts_macro.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/_meta/oneinch_mapped_contracts_macro.sql rename to dbt_subprojects/daily_spellbook/macros/project/oneinch/_meta/oneinch_mapped_contracts_macro.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/_meta/oneinch_project_swaps_exposed_blockchains_list.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/_meta/oneinch_project_swaps_exposed_blockchains_list.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/_meta/oneinch_project_swaps_exposed_blockchains_list.sql rename to dbt_subprojects/daily_spellbook/macros/project/oneinch/_meta/oneinch_project_swaps_exposed_blockchains_list.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/cfg/oneinch_project_orders_cfg_events_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/cfg/oneinch_project_orders_cfg_events_macro.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/cfg/oneinch_project_orders_cfg_events_macro.sql rename to dbt_subprojects/daily_spellbook/macros/project/oneinch/project/cfg/oneinch_project_orders_cfg_events_macro.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/cfg/oneinch_project_orders_cfg_methods_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/cfg/oneinch_project_orders_cfg_methods_macro.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/cfg/oneinch_project_orders_cfg_methods_macro.sql rename to dbt_subprojects/daily_spellbook/macros/project/oneinch/project/cfg/oneinch_project_orders_cfg_methods_macro.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/oneinch_project_calls_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_calls_macro.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/oneinch_project_calls_macro.sql rename to dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_calls_macro.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/oneinch_project_orders_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_macro.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/oneinch_project_orders_macro.sql rename to dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_macro.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/oneinch_project_orders_raw_logs_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_raw_logs_macro.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/oneinch_project_orders_raw_logs_macro.sql rename to dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_raw_logs_macro.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/oneinch_project_orders_raw_traces_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_raw_traces_macro.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/oneinch_project_orders_raw_traces_macro.sql rename to dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_orders_raw_traces_macro.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/oneinch_project_swaps_macro.sql b/dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_swaps_macro.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/_project/oneinch/project/oneinch_project_swaps_macro.sql rename to dbt_subprojects/daily_spellbook/macros/project/oneinch/project/oneinch_project_swaps_macro.sql diff --git a/macros/models/_project/yield_yak/yield_yak_balances.sql b/dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_balances.sql similarity index 100% rename from macros/models/_project/yield_yak/yield_yak_balances.sql rename to dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_balances.sql diff --git a/macros/models/_project/yield_yak/yield_yak_deposits_withdraws.sql b/dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_deposits_withdraws.sql similarity index 100% rename from macros/models/_project/yield_yak/yield_yak_deposits_withdraws.sql rename to dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_deposits_withdraws.sql diff --git a/macros/models/_project/yield_yak/yield_yak_reinvests.sql b/dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_reinvests.sql similarity index 100% rename from macros/models/_project/yield_yak/yield_yak_reinvests.sql rename to dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_reinvests.sql diff --git a/macros/models/_project/yield_yak/yield_yak_strategies.sql b/dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_strategies.sql similarity index 100% rename from macros/models/_project/yield_yak/yield_yak_strategies.sql rename to dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_strategies.sql diff --git a/macros/models/_project/yield_yak/yield_yak_user_yrt_balances.sql b/dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_user_yrt_balances.sql similarity index 100% rename from macros/models/_project/yield_yak/yield_yak_user_yrt_balances.sql rename to dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_user_yrt_balances.sql diff --git a/macros/models/_project/yield_yak/yield_yak_yak_adapter_swaps.sql b/dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_yak_adapter_swaps.sql similarity index 100% rename from macros/models/_project/yield_yak/yield_yak_yak_adapter_swaps.sql rename to dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_yak_adapter_swaps.sql diff --git a/macros/models/_project/yield_yak/yield_yak_yak_swaps.sql b/dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_yak_swaps.sql similarity index 100% rename from macros/models/_project/yield_yak/yield_yak_yak_swaps.sql rename to dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_yak_swaps.sql diff --git a/macros/models/_project/yield_yak/yield_yak_yield_strategies.sql b/dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_yield_strategies.sql similarity index 100% rename from macros/models/_project/yield_yak/yield_yak_yield_strategies.sql rename to dbt_subprojects/daily_spellbook/macros/project/yield_yak/yield_yak_yield_strategies.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/sector/addresses_events/addresses_events_first_activity.sql b/dbt_subprojects/daily_spellbook/macros/sector/addresses_events/addresses_events_first_activity.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/sector/addresses_events/addresses_events_first_activity.sql rename to dbt_subprojects/daily_spellbook/macros/sector/addresses_events/addresses_events_first_activity.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/sector/addresses_events/addresses_events_first_funded_by.sql b/dbt_subprojects/daily_spellbook/macros/sector/addresses_events/addresses_events_first_funded_by.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/sector/addresses_events/addresses_events_first_funded_by.sql rename to dbt_subprojects/daily_spellbook/macros/sector/addresses_events/addresses_events_first_funded_by.sql diff --git a/macros/models/_sector/add_pool_price_usd.sql b/dbt_subprojects/daily_spellbook/macros/sector/alm/add_pool_price_usd.sql similarity index 100% rename from macros/models/_sector/add_pool_price_usd.sql rename to dbt_subprojects/daily_spellbook/macros/sector/alm/add_pool_price_usd.sql diff --git a/macros/models/_sector/alm/arrakis_compatible_trades.sql b/dbt_subprojects/daily_spellbook/macros/sector/alm/arrakis_compatible_trades.sql similarity index 100% rename from macros/models/_sector/alm/arrakis_compatible_trades.sql rename to dbt_subprojects/daily_spellbook/macros/sector/alm/arrakis_compatible_trades.sql diff --git a/macros/models/_sector/attestation/eas.sql b/dbt_subprojects/daily_spellbook/macros/sector/attestation/eas.sql similarity index 100% rename from macros/models/_sector/attestation/eas.sql rename to dbt_subprojects/daily_spellbook/macros/sector/attestation/eas.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/sector/contracts/contracts_base_iterated_creators.sql b/dbt_subprojects/daily_spellbook/macros/sector/contracts/contracts_base_iterated_creators.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/sector/contracts/contracts_base_iterated_creators.sql rename to dbt_subprojects/daily_spellbook/macros/sector/contracts/contracts_base_iterated_creators.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/sector/contracts/contracts_base_starting_level.sql b/dbt_subprojects/daily_spellbook/macros/sector/contracts/contracts_base_starting_level.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/sector/contracts/contracts_base_starting_level.sql rename to dbt_subprojects/daily_spellbook/macros/sector/contracts/contracts_base_starting_level.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/sector/contracts/contracts_contract_mapping.sql b/dbt_subprojects/daily_spellbook/macros/sector/contracts/contracts_contract_mapping.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/sector/contracts/contracts_contract_mapping.sql rename to dbt_subprojects/daily_spellbook/macros/sector/contracts/contracts_contract_mapping.sql diff --git a/dbt_subprojects/daily_spellbook/macros/models/sector/contracts/find_self_destruct_contracts.sql b/dbt_subprojects/daily_spellbook/macros/sector/contracts/find_self_destruct_contracts.sql similarity index 100% rename from dbt_subprojects/daily_spellbook/macros/models/sector/contracts/find_self_destruct_contracts.sql rename to dbt_subprojects/daily_spellbook/macros/sector/contracts/find_self_destruct_contracts.sql diff --git a/macros/models/_sector/dex/uniswap_compatible_pools.sql b/dbt_subprojects/daily_spellbook/macros/sector/dex/uniswap_compatible_pools.sql similarity index 100% rename from macros/models/_sector/dex/uniswap_compatible_pools.sql rename to dbt_subprojects/daily_spellbook/macros/sector/dex/uniswap_compatible_pools.sql diff --git a/macros/models/_sector/balances/fungible/balances_fungible_day.sql b/dbt_subprojects/daily_spellbook/macros/sector/fungible/balances_fungible_day.sql similarity index 100% rename from macros/models/_sector/balances/fungible/balances_fungible_day.sql rename to dbt_subprojects/daily_spellbook/macros/sector/fungible/balances_fungible_day.sql diff --git a/macros/models/_sector/balances/fungible/balances_fungible_hour.sql b/dbt_subprojects/daily_spellbook/macros/sector/fungible/balances_fungible_hour.sql similarity index 100% rename from macros/models/_sector/balances/fungible/balances_fungible_hour.sql rename to dbt_subprojects/daily_spellbook/macros/sector/fungible/balances_fungible_hour.sql diff --git a/macros/models/_sector/balances/fungible/balances_fungible_latest.sql b/dbt_subprojects/daily_spellbook/macros/sector/fungible/balances_fungible_latest.sql similarity index 100% rename from macros/models/_sector/balances/fungible/balances_fungible_latest.sql rename to dbt_subprojects/daily_spellbook/macros/sector/fungible/balances_fungible_latest.sql diff --git a/macros/models/_sector/balances/fungible/balances_fungible_noncompliant.sql b/dbt_subprojects/daily_spellbook/macros/sector/fungible/balances_fungible_noncompliant.sql similarity index 100% rename from macros/models/_sector/balances/fungible/balances_fungible_noncompliant.sql rename to dbt_subprojects/daily_spellbook/macros/sector/fungible/balances_fungible_noncompliant.sql diff --git a/macros/models/_sector/fungible/fungible_transfers.sql b/dbt_subprojects/daily_spellbook/macros/sector/fungible/fungible_transfers.sql similarity index 100% rename from macros/models/_sector/fungible/fungible_transfers.sql rename to dbt_subprojects/daily_spellbook/macros/sector/fungible/fungible_transfers.sql diff --git a/macros/models/_sector/gas/gas_prices.sql b/dbt_subprojects/daily_spellbook/macros/sector/gas/gas_prices.sql similarity index 100% rename from macros/models/_sector/gas/gas_prices.sql rename to dbt_subprojects/daily_spellbook/macros/sector/gas/gas_prices.sql diff --git a/macros/models/_sector/inscription/inscription_all.sql b/dbt_subprojects/daily_spellbook/macros/sector/inscription/inscription_all.sql similarity index 100% rename from macros/models/_sector/inscription/inscription_all.sql rename to dbt_subprojects/daily_spellbook/macros/sector/inscription/inscription_all.sql diff --git a/macros/models/_sector/inscription/inscription_deploys.sql b/dbt_subprojects/daily_spellbook/macros/sector/inscription/inscription_deploys.sql similarity index 100% rename from macros/models/_sector/inscription/inscription_deploys.sql rename to dbt_subprojects/daily_spellbook/macros/sector/inscription/inscription_deploys.sql diff --git a/macros/models/_sector/inscription/inscription_mints.sql b/dbt_subprojects/daily_spellbook/macros/sector/inscription/inscription_mints.sql similarity index 100% rename from macros/models/_sector/inscription/inscription_mints.sql rename to dbt_subprojects/daily_spellbook/macros/sector/inscription/inscription_mints.sql diff --git a/macros/models/_sector/referral/enrich_referral_rewards.sql b/dbt_subprojects/daily_spellbook/macros/sector/referral/enrich_referral_rewards.sql similarity index 100% rename from macros/models/_sector/referral/enrich_referral_rewards.sql rename to dbt_subprojects/daily_spellbook/macros/sector/referral/enrich_referral_rewards.sql diff --git a/macros/models/_sector/referral/platforms/fabric_referral_rewards.sql b/dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/fabric_referral_rewards.sql similarity index 100% rename from macros/models/_sector/referral/platforms/fabric_referral_rewards.sql rename to dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/fabric_referral_rewards.sql diff --git a/macros/models/_sector/referral/platforms/mintfun_referral_rewards.sql b/dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/mintfun_referral_rewards.sql similarity index 100% rename from macros/models/_sector/referral/platforms/mintfun_referral_rewards.sql rename to dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/mintfun_referral_rewards.sql diff --git a/macros/models/_sector/referral/platforms/mirror_referral_rewards.sql b/dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/mirror_referral_rewards.sql similarity index 100% rename from macros/models/_sector/referral/platforms/mirror_referral_rewards.sql rename to dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/mirror_referral_rewards.sql diff --git a/macros/models/_sector/referral/platforms/paragraph_referral_rewards.sql b/dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/paragraph_referral_rewards.sql similarity index 100% rename from macros/models/_sector/referral/platforms/paragraph_referral_rewards.sql rename to dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/paragraph_referral_rewards.sql diff --git a/macros/models/_sector/referral/platforms/rabbithole_referral_rewards.sql b/dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/rabbithole_referral_rewards.sql similarity index 100% rename from macros/models/_sector/referral/platforms/rabbithole_referral_rewards.sql rename to dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/rabbithole_referral_rewards.sql diff --git a/macros/models/_sector/referral/platforms/soundxyz_referral_rewards.sql b/dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/soundxyz_referral_rewards.sql similarity index 100% rename from macros/models/_sector/referral/platforms/soundxyz_referral_rewards.sql rename to dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/soundxyz_referral_rewards.sql diff --git a/macros/models/_sector/referral/platforms/soundxyz_v2_referral_rewards.sql b/dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/soundxyz_v2_referral_rewards.sql similarity index 100% rename from macros/models/_sector/referral/platforms/soundxyz_v2_referral_rewards.sql rename to dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/soundxyz_v2_referral_rewards.sql diff --git a/macros/models/_sector/referral/platforms/zora_referral_rewards.sql b/dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/zora_referral_rewards.sql similarity index 100% rename from macros/models/_sector/referral/platforms/zora_referral_rewards.sql rename to dbt_subprojects/daily_spellbook/macros/sector/referral/platforms/zora_referral_rewards.sql diff --git a/macros/models/_sector/social/enrich_social_trades.sql b/dbt_subprojects/daily_spellbook/macros/sector/social/enrich_social_trades.sql similarity index 100% rename from macros/models/_sector/social/enrich_social_trades.sql rename to dbt_subprojects/daily_spellbook/macros/sector/social/enrich_social_trades.sql diff --git a/macros/models/_sector/transfers/erc20/transfers_erc20.sql b/dbt_subprojects/daily_spellbook/macros/sector/transfers/erc20/transfers_erc20.sql similarity index 100% rename from macros/models/_sector/transfers/erc20/transfers_erc20.sql rename to dbt_subprojects/daily_spellbook/macros/sector/transfers/erc20/transfers_erc20.sql diff --git a/macros/models/_sector/transfers/erc20/transfers_erc20_agg_day.sql b/dbt_subprojects/daily_spellbook/macros/sector/transfers/erc20/transfers_erc20_agg_day.sql similarity index 100% rename from macros/models/_sector/transfers/erc20/transfers_erc20_agg_day.sql rename to dbt_subprojects/daily_spellbook/macros/sector/transfers/erc20/transfers_erc20_agg_day.sql diff --git a/macros/models/_sector/transfers/erc20/transfers_erc20_agg_hour.sql b/dbt_subprojects/daily_spellbook/macros/sector/transfers/erc20/transfers_erc20_agg_hour.sql similarity index 100% rename from macros/models/_sector/transfers/erc20/transfers_erc20_agg_hour.sql rename to dbt_subprojects/daily_spellbook/macros/sector/transfers/erc20/transfers_erc20_agg_hour.sql diff --git a/macros/models/_sector/transfers/erc20/transfers_erc20_rolling_day.sql b/dbt_subprojects/daily_spellbook/macros/sector/transfers/erc20/transfers_erc20_rolling_day.sql similarity index 100% rename from macros/models/_sector/transfers/erc20/transfers_erc20_rolling_day.sql rename to dbt_subprojects/daily_spellbook/macros/sector/transfers/erc20/transfers_erc20_rolling_day.sql diff --git a/macros/models/_sector/transfers/erc20/transfers_erc20_rolling_hour.sql b/dbt_subprojects/daily_spellbook/macros/sector/transfers/erc20/transfers_erc20_rolling_hour.sql similarity index 100% rename from macros/models/_sector/transfers/erc20/transfers_erc20_rolling_hour.sql rename to dbt_subprojects/daily_spellbook/macros/sector/transfers/erc20/transfers_erc20_rolling_hour.sql diff --git a/dbt_subprojects/daily_spellbook/models/_sector/alm/README.md b/dbt_subprojects/daily_spellbook/models/_sector/alm/README.md index 64b40fc9f58..3028dc91773 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/alm/README.md +++ b/dbt_subprojects/daily_spellbook/models/_sector/alm/README.md @@ -74,7 +74,7 @@ Adoption of `arrakis_` for macro names. ### Macro Usage Example -Below is an example of how to use the [`arrakis_compatible_v2_trades` macro](/macros/models/_sector/alm/arrakis_compatible_trades.sql) macro within our project. This macro is designed to standardize the trades data for projects compatible with Arrakis V2 on various blockchains. +Below is an example of how to use the [`arrakis_compatible_v2_trades` macro](/dbt_macros/models/_sector/alm/arrakis_compatible_trades.sql) macro within our project. This macro is designed to standardize the trades data for projects compatible with Arrakis V2 on various blockchains. ```sql {{ diff --git a/dbt_subprojects/daily_spellbook/models/contracts/readme.md b/dbt_subprojects/daily_spellbook/models/contracts/readme.md index 346cb484827..5a1c63f33ec 100644 --- a/dbt_subprojects/daily_spellbook/models/contracts/readme.md +++ b/dbt_subprojects/daily_spellbook/models/contracts/readme.md @@ -9,7 +9,7 @@ # Contract Mapping -Table models are defined in [`macros/models/_sector/contracts`](/macros/models/_sector/contracts) +Table models are defined in [`macros/models/_sector/contracts`](../macros/models/_sector/contracts) This repository contains all the source code for `contracts.contract_mapping` that you can use to join contract addresses on each chain to pull our mapped project names in the `contract_project` field. diff --git a/dbt_subprojects/dex/dbt_project.yml b/dbt_subprojects/dex/dbt_project.yml index b528db1479f..bb65226ad1a 100644 --- a/dbt_subprojects/dex/dbt_project.yml +++ b/dbt_subprojects/dex/dbt_project.yml @@ -22,7 +22,7 @@ vars: model-paths: ["models", "../../sources"] test-paths: ["tests"] seed-paths: ["seeds"] -macro-paths: ["macros", "../../macros"] +macro-paths: ["macros", "../../dbt_macros"] target-path: "target" # directory which will store compiled SQL files clean-targets: # directories to be removed by `dbt clean` diff --git a/macros/models/_sector/add_amount_usd.sql b/dbt_subprojects/dex/macros/add_amount_usd.sql similarity index 100% rename from macros/models/_sector/add_amount_usd.sql rename to dbt_subprojects/dex/macros/add_amount_usd.sql diff --git a/macros/public/bytea2numeric.sql b/dbt_subprojects/dex/macros/models/_project/zeroex/bytea2numeric.sql similarity index 100% rename from macros/public/bytea2numeric.sql rename to dbt_subprojects/dex/macros/models/_project/zeroex/bytea2numeric.sql diff --git a/dbt_subprojects/dex/models/trades/readme.md b/dbt_subprojects/dex/models/trades/readme.md index d8da71f3644..28aca882ad7 100644 --- a/dbt_subprojects/dex/models/trades/readme.md +++ b/dbt_subprojects/dex/models/trades/readme.md @@ -74,7 +74,7 @@ Adoption of the `base_` prefix for table aliases and `uniswap_` for macro names. ### Macro Usage Example -One of the key components in the dex.trades redesign is the utilization of dbt macros to standardize and simplify the process of data transformation across different blockchains and projects. Below is an example of how to use the [`uniswap_compatible_v2_trades` macro](/macros/models/_sector/dex/uniswap_compatible_trades.sql) macro within our project. This macro is designed to standardize the trades data for projects compatible with Uniswap V2 on various blockchains. +One of the key components in the dex.trades redesign is the utilization of dbt macros to standardize and simplify the process of data transformation across different blockchains and projects. Below is an example of how to use the [`uniswap_compatible_v2_trades` macro](/dbt_subprojects/dex/macros/models/_project/uniswap_compatible_trades.sql) macro within our project. This macro is designed to standardize the trades data for projects compatible with Uniswap V2 on various blockchains. ```sql {{ diff --git a/dbt_subprojects/hourly_spellbook/dbt_project.yml b/dbt_subprojects/hourly_spellbook/dbt_project.yml index e2c130aea99..6b876a7018b 100644 --- a/dbt_subprojects/hourly_spellbook/dbt_project.yml +++ b/dbt_subprojects/hourly_spellbook/dbt_project.yml @@ -24,7 +24,7 @@ vars: model-paths: ["models", "../../sources"] test-paths: ["tests"] seed-paths: ["seeds"] -macro-paths: ["macros", "../../macros"] +macro-paths: ["macros", "../../dbt_macros"] target-path: "target" # directory which will store compiled SQL files clean-targets: # directories to be removed by `dbt clean` diff --git a/macros/models/_sector/account_abstraction/erc4337_account_deployed.sql b/dbt_subprojects/hourly_spellbook/macros/sector/account_abstraction/erc4337_account_deployed.sql similarity index 100% rename from macros/models/_sector/account_abstraction/erc4337_account_deployed.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/account_abstraction/erc4337_account_deployed.sql diff --git a/macros/models/_sector/account_abstraction/erc4337_userops_basics.sql b/dbt_subprojects/hourly_spellbook/macros/sector/account_abstraction/erc4337_userops_basics.sql similarity index 100% rename from macros/models/_sector/account_abstraction/erc4337_userops_basics.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/account_abstraction/erc4337_userops_basics.sql diff --git a/macros/models/_sector/account_abstraction/erc4337_userops_enrichments.sql b/dbt_subprojects/hourly_spellbook/macros/sector/account_abstraction/erc4337_userops_enrichments.sql similarity index 100% rename from macros/models/_sector/account_abstraction/erc4337_userops_enrichments.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/account_abstraction/erc4337_userops_enrichments.sql diff --git a/macros/models/_sector/cex/cex_evms.sql b/dbt_subprojects/hourly_spellbook/macros/sector/cex/cex_evms.sql similarity index 100% rename from macros/models/_sector/cex/cex_evms.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/cex/cex_evms.sql diff --git a/macros/models/_sector/cex/cex_flows.sql b/dbt_subprojects/hourly_spellbook/macros/sector/cex/cex_flows.sql similarity index 100% rename from macros/models/_sector/cex/cex_flows.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/cex/cex_flows.sql diff --git a/macros/models/_sector/lending/lending_aave_compatible_borrow.sql b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_aave_compatible_borrow.sql similarity index 100% rename from macros/models/_sector/lending/lending_aave_compatible_borrow.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_aave_compatible_borrow.sql diff --git a/macros/models/_sector/lending/lending_aave_compatible_flashloans.sql b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_aave_compatible_flashloans.sql similarity index 100% rename from macros/models/_sector/lending/lending_aave_compatible_flashloans.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_aave_compatible_flashloans.sql diff --git a/macros/models/_sector/lending/lending_aave_compatible_supply.sql b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_aave_compatible_supply.sql similarity index 100% rename from macros/models/_sector/lending/lending_aave_compatible_supply.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_aave_compatible_supply.sql diff --git a/macros/models/_sector/lending/lending_compound_compatible_borrow.sql b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_compound_compatible_borrow.sql similarity index 100% rename from macros/models/_sector/lending/lending_compound_compatible_borrow.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_compound_compatible_borrow.sql diff --git a/macros/models/_sector/lending/lending_compound_compatible_supply.sql b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_compound_compatible_supply.sql similarity index 100% rename from macros/models/_sector/lending/lending_compound_compatible_supply.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_compound_compatible_supply.sql diff --git a/macros/models/_sector/lending/lending_enrich_borrow.sql b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_enrich_borrow.sql similarity index 100% rename from macros/models/_sector/lending/lending_enrich_borrow.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_enrich_borrow.sql diff --git a/macros/models/_sector/lending/lending_enrich_flashloans.sql b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_enrich_flashloans.sql similarity index 100% rename from macros/models/_sector/lending/lending_enrich_flashloans.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_enrich_flashloans.sql diff --git a/macros/models/_sector/lending/lending_enrich_supply.sql b/dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_enrich_supply.sql similarity index 100% rename from macros/models/_sector/lending/lending_enrich_supply.sql rename to dbt_subprojects/hourly_spellbook/macros/sector/lending/lending_enrich_supply.sql diff --git a/dbt_subprojects/nft/dbt_project.yml b/dbt_subprojects/nft/dbt_project.yml index ef8e0d4d805..44a463c85e0 100644 --- a/dbt_subprojects/nft/dbt_project.yml +++ b/dbt_subprojects/nft/dbt_project.yml @@ -25,7 +25,7 @@ model-paths: ["models", "../../sources"] # ../tests/* should be added to a separate shared folder test-paths: ["tests"] seed-paths: ["seeds"] -macro-paths: ["macros", "../../macros"] +macro-paths: ["macros", "../../dbt_macros"] target-path: "target" # directory which will store compiled SQL files clean-targets: # directories to be removed by `dbt clean` diff --git a/macros/models/_project/seaport/seaport_traces.sql b/dbt_subprojects/nft/macros/platforms/seaport_traces.sql similarity index 100% rename from macros/models/_project/seaport/seaport_traces.sql rename to dbt_subprojects/nft/macros/platforms/seaport_traces.sql diff --git a/dbt_subprojects/solana/dbt_project.yml b/dbt_subprojects/solana/dbt_project.yml index 2da4be32bbf..b5d2e7c03da 100644 --- a/dbt_subprojects/solana/dbt_project.yml +++ b/dbt_subprojects/solana/dbt_project.yml @@ -22,7 +22,7 @@ vars: model-paths: ["models", "../../sources"] test-paths: ["tests"] seed-paths: ["seeds"] -macro-paths: ["macros", "../../macros"] +macro-paths: ["macros", "../../dbt_macros"] target-path: "target" # directory which will store compiled SQL files clean-targets: # directories to be removed by `dbt clean` diff --git a/dbt_subprojects/tokens/dbt_project.yml b/dbt_subprojects/tokens/dbt_project.yml index ed5240470cb..38efe8f47ad 100644 --- a/dbt_subprojects/tokens/dbt_project.yml +++ b/dbt_subprojects/tokens/dbt_project.yml @@ -24,7 +24,7 @@ vars: model-paths: ["models", "../../sources"] # test-paths: ["tests"] # seed-paths: ["seeds"] -macro-paths: ["../../macros"] +macro-paths: ["macros", "../../dbt_macros"] target-path: "target" # directory which will store compiled SQL files clean-targets: # directories to be removed by `dbt clean` diff --git a/macros/models/_sector/tokens/balances_daily.sql b/dbt_subprojects/tokens/macros/balances/balances_daily.sql similarity index 100% rename from macros/models/_sector/tokens/balances_daily.sql rename to dbt_subprojects/tokens/macros/balances/balances_daily.sql diff --git a/macros/models/_sector/tokens/balances_daily_agg.sql b/dbt_subprojects/tokens/macros/balances/balances_daily_agg.sql similarity index 100% rename from macros/models/_sector/tokens/balances_daily_agg.sql rename to dbt_subprojects/tokens/macros/balances/balances_daily_agg.sql diff --git a/macros/models/_sector/tokens/balances_enrich.sql b/dbt_subprojects/tokens/macros/balances/balances_enrich.sql similarity index 100% rename from macros/models/_sector/tokens/balances_enrich.sql rename to dbt_subprojects/tokens/macros/balances/balances_enrich.sql diff --git a/macros/models/_sector/tokens/balances_fix_schema.sql b/dbt_subprojects/tokens/macros/balances/balances_fix_schema.sql similarity index 100% rename from macros/models/_sector/tokens/balances_fix_schema.sql rename to dbt_subprojects/tokens/macros/balances/balances_fix_schema.sql diff --git a/macros/models/_sector/tokens/create_balances.sql b/dbt_subprojects/tokens/macros/balances/create_balances.sql similarity index 100% rename from macros/models/_sector/tokens/create_balances.sql rename to dbt_subprojects/tokens/macros/balances/create_balances.sql diff --git a/macros/models/_sector/tokens/transfers_base.sql b/dbt_subprojects/tokens/macros/transfers/transfers_base.sql similarity index 100% rename from macros/models/_sector/tokens/transfers_base.sql rename to dbt_subprojects/tokens/macros/transfers/transfers_base.sql diff --git a/macros/models/_sector/tokens/transfers_base_wrapped_token.sql b/dbt_subprojects/tokens/macros/transfers/transfers_base_wrapped_token.sql similarity index 100% rename from macros/models/_sector/tokens/transfers_base_wrapped_token.sql rename to dbt_subprojects/tokens/macros/transfers/transfers_base_wrapped_token.sql diff --git a/macros/models/_sector/tokens/transfers_enrich.sql b/dbt_subprojects/tokens/macros/transfers/transfers_enrich.sql similarity index 100% rename from macros/models/_sector/tokens/transfers_enrich.sql rename to dbt_subprojects/tokens/macros/transfers/transfers_enrich.sql diff --git a/docs/macros/macro_overview.md b/docs/macros/macro_overview.md index d6974119e73..3f41909e082 100644 --- a/docs/macros/macro_overview.md +++ b/docs/macros/macro_overview.md @@ -4,19 +4,20 @@ There are various use cases for macros in DBT, but the main focus for wizards in ## Directory Path for Macros -- Path: `spellbook/macros/models/` -- Within this path, there are two main subdirectories: +Path: `dbt_subprojects//macros/`
+Within this path, there are two main subdirectories, replicating the structure in `models/`: - 1. **\_project** + 1. **\project** - For standalone project spell lineages. - 2. **\_sector** + 2. **\sector** - For sector-level spell lineages, e.g., `dex.trades` lineage. - - **Note**: The ‘\_’ prefix in directory paths is used to keep them at the top & easily accessible, reserved for the most frequently used directories. +Some exceptions to the project specific path are listed in [other macro use cases](#other-macro-use-cases) +### My Multi Word Header ## Design Principles for Macros -Following [this](/macros/models/_sector/dex/uniswap_compatible_trades.sql) example, where uniswap compatible projects code lives, the key design principles include: +Following [this](/dbt_subprojects/dex/macros/models/_project/uniswap_compatible_trades.sql) example, where uniswap compatible projects code lives, the key design principles include: - **Assign Arguments** - Define arguments expected to be passed in via each model that calls the macro. @@ -27,7 +28,7 @@ Following [this](/macros/models/_sector/dex/uniswap_compatible_trades.sql) examp - **Multiple Macros in One File** - It's common to have multiple macros within a single file, such as various versions of the uniswap contract code. Group similar macros together logically. -Within models, such as uniswap v2, call macro code with [this approach](/models/_sector/dex/trades/ethereum/platforms/uniswap_v2_ethereum_base_trades.sql). +Within models, such as uniswap v2, call macro code with [this approach](/dbt_subprojects/dex/target/compiled/dex/models/trades/ethereum/platforms/uniswap_v2_ethereum_base_trades.sql). ## When to Use a Macro @@ -46,13 +47,13 @@ Within models, such as uniswap v2, call macro code with [this approach](/models/ ## Other Macro Use Cases -1. **Generic Test Queries** +1. **Generic Test Queries** (`dbt_macros/generic-tests`) - Seed tests within model schema files call a seed macro containing the test query. -2. **Universal Use Cases in Spellbook** +2. **Universal Use Cases in Spellbook** (`dbt_macros/shared`) - incremental predicates, containing the incremental filter which can be controlled in one location and called across multiple models. - incremental days forward, which can chunk data from the source into smaller time frames to help bypass performance limitations. - - Macros with lists for for-loops in models, like [`all_evm_chains`](/macros/public/all_evm_chains.sql). -3. **Dune Team Specific Cases** + - Macros with lists for for-loops in models, like [`all_evm_chains`](/dbt_macros/shared/all_evm_chains.sql). +3. **Dune Team Specific Cases** (`dbt_macros/dune`) - Overriding dbt-trino core macros for Spellbook-specific scenarios. - Backend database specific code in pre or post hooks for spell optimization. diff --git a/docs/models/model_config_block.md b/docs/models/model_config_block.md index 73a26ae3fe4..94aa5a39f82 100644 --- a/docs/models/model_config_block.md +++ b/docs/models/model_config_block.md @@ -35,7 +35,7 @@ Each model within Spellbook contains a config block with various properties. Dep 4. **incremental_predicates** - Filters the target to the same date range as the source, for improved performance & less data in memory. - - Universal incremental macro can be found [here](/macros/incremental_predicate.sql). + - Universal incremental macro can be found [here](/dbt_macros/dune/incremental_predicate.sql). - **Note**: This is a newer addition to Spellbook. Please add this property for new incremental spells. ## Optional Configs for Materialized as Table / Incremental diff --git a/docs/models/model_overview.md b/docs/models/model_overview.md index 394147e62c2..e54f0e21948 100644 --- a/docs/models/model_overview.md +++ b/docs/models/model_overview.md @@ -68,7 +68,7 @@ Required for DBT to understand the models within the project. Key areas within s - If is incremental checks, done via jinja syntax - This needs to be applied on all sources which have events / transactions / any time-series data set - If no, full refresh and/or initial historical load on incremental model and bypass incremental filter, but apply filter for earliest date of activity for particular model - - If yes, apply [incremental predicate macro](/macros/incremental_predicate.sql) filter [on the source](/macros/models/_sector/dex/uniswap_compatible_trades.sql#L29-L32), to match incremental predicate filter on target in the config block + - If yes, apply [incremental predicate macro](/dbt_macros/dune/incremental_predicate.sql) filter [on the source](/dbt_subprojects/dex/macros/models/_project/uniswap_compatible_trades.sql#L29-L32), to match incremental predicate filter on target in the config block - Optional use cases: - Lookup to existing spell, within itself, using the {{ this }} syntax diff --git a/docs/seeds/seed_overview.md b/docs/seeds/seed_overview.md index c649b173b64..232dce54c1a 100644 --- a/docs/seeds/seed_overview.md +++ b/docs/seeds/seed_overview.md @@ -14,7 +14,7 @@ Seeds will be required in these sector-level spell additions to ensure proper le 3. Within the [model schema file](/models/_sector/dex/trades/arbitrum/_schema.yml#L20-L23), call the [generic seed test](/tests/generic/check_dex_base_trades_seed.sql) with parameters necessary: - Seed file name. - Filter(s) for project versions, if the spell is split into versions per project. -4. Ultimately, following the above steps, the test query built and executed against seed files lives in the generic seed macro [here](/macros/generic-tests/check_seed_macro.sql). +4. Ultimately, following the above steps, the test query built and executed against seed files lives in the generic seed macro [here](/dbt_macros/generic-tests/check_seed_macro.sql). ## How Do I Track Seed Tests Running During Development? diff --git a/macros/public/public_macros_schema.yml b/macros/public/public_macros_schema.yml deleted file mode 100644 index af6251654c7..00000000000 --- a/macros/public/public_macros_schema.yml +++ /dev/null @@ -1,33 +0,0 @@ -version: 2 - -macros: - - name: all_evm_chains - description: "gets array list of all EVM chains" - - name: get_href - description: "Converts a link and text to the clickable href link" - - name: get_chain_native_token - description: "gets either the symbol, prices_symbol, or prices_address" - - name: get_chain_explorer - description: "Converts chain to explorer base url" - - name: bytea2numeric_v3 - description: "Creates the bytea2numeric_v3 function, which converts a hex string to a numeric value and supports up to 64 hex chars" - - name: bytea2numeric - description: "Converts a string to a numeric value" - arguments: - - name: column_name - type: column name or expression - description: "The name of a column, or an expression — anything that can be `select`-ed as a column" - - name: base58_decode - description: "Decodes a base58 encoded string to a hex string" - arguments: - - name: value - type: column name or expression - description: "Valid base58 string" - - name: get_balancer_link - description: "Returns a link to access a specific pool on the Balancer app, based on its blockchain and pool ID" - - name: evm_get_calldata_gas_from_data - description: "Returns the amount of gas used by transaction data (given a data field) by EVM specification" - arguments: - - name: data_field - type: varbinary - description: "Field containing calldata" diff --git a/scripts/alter_table_locations.py b/scripts/alter_table_locations.py index e92c35d5910..5e02d511448 100644 --- a/scripts/alter_table_locations.py +++ b/scripts/alter_table_locations.py @@ -72,7 +72,7 @@ def get_rename_command(self, table_dict): return rename_command def generate_macro_file(self, tables_dict): - f = open("../macros/dune/alter_table_locations.sql", 'w') + f = open("../dbt_macros/dune/alter_table_locations.sql", 'w') f.write("{% macro alter_table_locations() %}") for table, table_dict in tables_dict.items(): # alter_command = self.get_alter_command(table_dict) From 80c3127294a961979188231722ec62bfb9f549cd Mon Sep 17 00:00:00 2001 From: Andrew <47720952+andrewhong5297@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:45:07 -0400 Subject: [PATCH 02/12] add gas mantle models (#6509) * add models * final changes to match eth structure --------- Co-authored-by: jeff-dude --- .../fees/{gas_fees_schema.yml => _schema.yml} | 6 +- .../models/_sector/gas/fees/gas_fees.sql | 23 +++--- .../_sector/gas/fees/mantle/_schema.yml | 78 +++++++++++++++++++ .../gas/fees/mantle/gas_mantle_fees.sql | 54 +++++++++++++ 4 files changed, 147 insertions(+), 14 deletions(-) rename dbt_subprojects/daily_spellbook/models/_sector/gas/fees/{gas_fees_schema.yml => _schema.yml} (94%) create mode 100644 dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/_schema.yml create mode 100644 dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/_schema.yml similarity index 94% rename from dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees_schema.yml rename to dbt_subprojects/daily_spellbook/models/_sector/gas/fees/_schema.yml index 944d4b3ddd7..c0b56f1560b 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees_schema.yml +++ b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/_schema.yml @@ -3,11 +3,11 @@ version: 2 models: - name: gas_fees meta: - blockchain: ethereum, bnb, avalanche_c, optimism, arbitrum, zksync, zora, base, scroll + blockchain: ethereum, bnb, avalanche_c, optimism, arbitrum, zksync, zora, base, scroll, mantle sector: gas - contributors: soispoke + contributors: soispoke, ilemi, 0xRob, jeff-dude config: - tags: ['ethereum', 'bnb', 'avalanche_c', 'optimism', 'arbitrum','zksync','zora','scroll','gas', 'fees'] + tags: ['ethereum', 'bnb', 'avalanche_c', 'optimism', 'arbitrum','zksync','zora','scroll','mantle','gas','fees'] description: > Gas Fees across chains columns: diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees.sql index dfc5beb0a3e..a6546623b79 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees.sql +++ b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees.sql @@ -1,23 +1,24 @@ {{ config( schema = 'gas', alias = 'fees', - post_hook='{{ expose_spells(\'["ethereum","bnb","avalanche_c","optimism","arbitrum","zksync","zora","base","scroll"]\', + post_hook='{{ expose_spells(\'["ethereum","bnb","avalanche_c","optimism","arbitrum","zksync","zora","base","scroll","mantle"]\', "sector", "gas", - \'["soispoke"]\') }}' + \'["soispoke", "ilemi", "0xRob", "jeff-dude"]\') }}' ) }} {% set gas_fees_models = [ -'gas_ethereum_fees', -'gas_bnb_fees', -'gas_avalanche_c_fees', -'gas_optimism_fees', -'gas_arbitrum_fees', -'gas_zksync_fees', -'gas_zora_fees', -'gas_base_fees', -'gas_scroll_fees' + 'gas_ethereum_fees', + 'gas_bnb_fees', + 'gas_avalanche_c_fees', + 'gas_optimism_fees', + 'gas_arbitrum_fees', + 'gas_zksync_fees', + 'gas_zora_fees', + 'gas_base_fees', + 'gas_scroll_fees', + 'gas_mantle_fees' ] %} SELECT * diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/_schema.yml b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/_schema.yml new file mode 100644 index 00000000000..df57aff9b91 --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/_schema.yml @@ -0,0 +1,78 @@ +version: 2 + +models: + - name: gas_mantle_fees + meta: + blockchain: mantle + sector: gas + contributors: soispoke, ilemi + config: + tags: ['mantle', 'gas', 'fees'] + description: > + Gas Fees on mantle rollup Layer 2 + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_number + - tx_hash + columns: + - &blockchain + name: blockchain + description: "Blockchain name" + - &block_time + name: block_time + description: "Timestamp for block event time in UTC" + - &block_number + name: block_number + description: "Block number" + - &tx_hash + name: tx_hash + description: "Primary key of the transaction" + - &tx_sender + name: tx_sender + description: "Initiated the transaction" + - &tx_receiver + name: tx_receiver + description: "Received the transaction" + - &native_token_symbol + name: native_token_symbol + description: "Symbol of native token (ETH) for the Ethereum Blockchain" + - &tx_amount_native + name: tx_amount_native + description: "Amount of native tokens (ETH) transferred from sender to recipient" + - &tx_amount_usd + name: tx_amount_usd + description: "Amount of $USD transferred from sender to recipient" + - &tx_fee_native + name: tx_fee_native + description: "Total amount of native tokens (ETH) paid in gas fees" + - &tx_fee_usd + name: tx_fee_usd + description: "Total amount of $USD paid in gas fees" + - &burned_native + name: burned_native + description: "Total amount of native tokens (ETH) burned for this transaction, not applicable to L2 because transactions only indirectly burn gas on L1" + - &burned_usd + name: burned_usd + description: "Total amount of $USD burned for this transaction, not applicable to L2 because transactions only indirectly burn gas on L1" + - &validator + name: validator + description: "Address of blockchain validator for this transaction within the block, also referred to as miner before the Merge when Ethereum's consensus mechanism was PoW" + - &gas_price_gwei + name: gas_price_gwei + description: "Gas price (per gas unit) denoted in gwei" + - &gas_price_usd + name: gas_price_usd + description: "Gas price (per gas unit) denoted in $USD" + - &gas_used + name: gas_used + description: "Amount of L2 gas units consumed by the transaction" + - &gas_limit + name: gas_limit + description: "Maximum amount of gas units that can be consumed by the transaction on zksync L2" + - &gas_usage_percent + name: gas_usage_percent + description: "Percentage of Gas Used relative to the gas limit on zksync L2" + - &type + name: type + description: "Legacy (Pre Typed-Transactions), AccessList (EIP-2930), DynamicFee (EIP-1559), EIP-712, or Priority (L1 -> L2 Transactions)" diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql new file mode 100644 index 00000000000..8b2b8f0d10d --- /dev/null +++ b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql @@ -0,0 +1,54 @@ +{{ config( + schema = 'gas_mantle', + alias = 'fees', + partition_by = ['block_month'], + materialized = 'incremental', + file_format = 'delta', + incremental_strategy='merge', + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + unique_key = ['tx_hash','block_number'] + ) +}} + +SELECT + 'mantle' as blockchain, + date_trunc('day', block_time) AS block_date, + CAST(date_trunc('month', block_time) AS DATE) AS block_month, + block_number, + block_time, + txns.hash AS tx_hash, + txns."from" AS tx_sender, + txns.to AS tx_receiver, + 'ETH' as native_token_symbol, + value/1e18 AS tx_amount_native, + value/1e18 * p.price AS tx_amount_usd, + (l1_fee/1e18 + ((txns.gas_used/1e18) * txns.gas_price)) as tx_fee_native, + (l1_fee/1e18 + ((txns.gas_used/1e18) * txns.gas_price)) * p.price AS tx_fee_usd, + cast(NULL as double) AS burned_native, -- Not applicable for L2s + cast(NULL as double) AS burned_usd, -- Not applicable for L2s + cast(NULL as VARBINARY) as validator, -- Not applicable for L2s + txns.gas_price/1e9 as gas_price_gwei, + txns.gas_price/1e18 * p.price as gas_price_usd, + txns.gas_used as gas_used, + txns.gas_limit as gas_limit, + CASE + WHEN txns.gas_limit = 0 THEN NULL + WHEN txns.gas_limit != 0 THEN txns.gas_used / txns.gas_limit * 100 + END AS gas_usage_percent, + type as transaction_type +FROM {{ source('mantle','transactions') }} txns +INNER JOIN {{ source('mantle','blocks') }} blocks + ON blocks.number = txns.block_number + {% if is_incremental() %} + AND {{ incremental_predicate('blocks.time') }} + {% endif %} +LEFT JOIN {{ source('prices','usd') }} p + ON p.minute = date_trunc('minute', txns.block_time) + AND p.blockchain = 'mantle' + AND p.symbol = 'WETH' + {% if is_incremental() %} + AND {{ incremental_predicate('p.minute') }} + {% endif %} +{% if is_incremental() %} +WHERE {{ incremental_predicate('txns.block_time') }} +{% endif %} \ No newline at end of file From 8c9c788fcbc7f016ed2376a3bf616a8ca51b9f63 Mon Sep 17 00:00:00 2001 From: 0xRob <83790096+0xRobin@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:45:20 +0200 Subject: [PATCH 03/12] fix bug in ethereum gas.fees (#6512) --- .../gas/fees/ethereum/gas_ethereum_fees.sql | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees.sql index 6a6d43b8130..2a8c193676f 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees.sql +++ b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/ethereum/gas_ethereum_fees.sql @@ -54,14 +54,23 @@ SELECT blocks.difficulty, txns.type AS transaction_type FROM {{ source('ethereum', 'transactions') }} txns -INNER JOIN {{ source('ethereum', 'blocks') }} blocks ON txns.block_number = blocks.number -LEFT JOIN {{ source('ethereum', 'blobs_submissions') }} blob ON txns.hash = blob.tx_hash -LEFT JOIN {{ source('prices', 'usd') }} p ON p.minute = date_trunc('minute', txns.block_time) - AND p.blockchain = 'ethereum' - AND p.symbol = 'WETH' - {% if is_incremental() %} - AND {{ incremental_predicate('p.minute') }} -WHERE {{ incremental_predicate('txns.block_time') }} +INNER JOIN {{ source('ethereum', 'blocks') }} blocks + ON txns.block_number = blocks.number + {% if is_incremental() %} AND {{ incremental_predicate('blocks.time') }} + {% endif %} +LEFT JOIN {{ source('ethereum', 'blobs_submissions') }} blob + ON txns.hash = blob.tx_hash + {% if is_incremental() %} AND {{ incremental_predicate('blob.block_time') }} + {% endif %} +LEFT JOIN {{ source('prices', 'usd') }} p + ON p.minute = date_trunc('minute', txns.block_time) + AND p.blockchain = 'ethereum' + AND p.symbol = 'WETH' + {% if is_incremental() %} + AND {{ incremental_predicate('p.minute') }} + {% endif %} +{% if is_incremental() %} +WHERE {{ incremental_predicate('txns.block_time') }} {% endif %} From 518328842025d43814954b77ed1b84657b65c785 Mon Sep 17 00:00:00 2001 From: Mansi <122999960+IrishLatte19@users.noreply.github.com> Date: Wed, 7 Aug 2024 00:42:41 +0530 Subject: [PATCH 04/12] Added CROWD token (#6514) --- .../tokens/models/prices/polygon/prices_polygon_tokens.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbt_subprojects/tokens/models/prices/polygon/prices_polygon_tokens.sql b/dbt_subprojects/tokens/models/prices/polygon/prices_polygon_tokens.sql index 2ab1ec16357..bfe2f7ef28b 100644 --- a/dbt_subprojects/tokens/models/prices/polygon/prices_polygon_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/polygon/prices_polygon_tokens.sql @@ -136,7 +136,8 @@ FROM ('usdv-verified-usd', 'polygon', 'USDV', 0x323665443cef804a3b5206103304bd4872ea4253, 6), ('zro-layerzero', 'polygon', 'ZRO', 0x6985884c4392d348587b19cb9eaaf157f13271cd, 18), ('next-connext-eth', 'polygon', 'NEXT', 0x58b9cb810a68a7f3e1e4f8cb45d1b9b3c79705e8, 18), - ('usdm-mountain-protocol-usd', 'polygon', 'USDM', 0x57f5e098cad7a3d1eed53991d4d66c45c9af7812, 18) + ('usdm-mountain-protocol-usd', 'polygon', 'USDM', 0x57f5e098cad7a3d1eed53991d4d66c45c9af7812, 18), + ('crowd-crowdswap', 'polygon', 'CROWD', 0x483dd3425278c1f79f377f1034d9d2cae55648b6, 18) ) as temp (token_id, blockchain, symbol, contract_address, decimals) where contract_address not in ( 0xef938b6da8576a896f6e0321ef80996f4890f9c4 -- DG, bad price feed From 0be4cbaf56f5d2a4d1cf851168bfc825b186d3c2 Mon Sep 17 00:00:00 2001 From: catherine-2 <95732099+catherine-2@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:12:54 -0700 Subject: [PATCH 05/12] [quick] Metadata updates - Art Blocks (#6513) * typos * retry typo * art blocks updates --- ...hereum_metadata_art_blocks_collections.sql | 90 ++++++++++++++++++- .../nft_ethereum_metadata_bright_moments.sql | 2 +- 2 files changed, 90 insertions(+), 2 deletions(-) diff --git a/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_art_blocks_collections.sql b/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_art_blocks_collections.sql index 328d77a88e3..60b5871b66f 100644 --- a/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_art_blocks_collections.sql +++ b/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_art_blocks_collections.sql @@ -104,7 +104,7 @@ , (0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270, 92, 1000000, 'Libertad Parametrizada', 'zJorge', 'Factory', 'N/A', '0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270-92') , (0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270, 93, 1000000, 'Sigils', 'espina', 'Factory', 'N/A', '0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270-93') , (0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270, 94, 1000000, 'Portal', 'Jeff Davis', 'Playground', 'N/A', '0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270-94') - , (0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270, 95, 1000000, 'CryptoVenetian', 'Bright Moments', 'Factory', 'N/A', '0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270-95') + , (0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270, 95, 1000000, 'CryptoVenetian', 'Qian Qian', 'Factory', 'N/A', '0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270-95') , (0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270, 96, 1000000, 'Gravity 12', 'Jimmy Herdberg', 'Factory', 'N/A', '0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270-96') , (0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270, 97, 1000000, '[Dis]entanglement', 'onlygenerated', 'Factory', 'N/A', '0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270-97') , (0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270, 98, 1000000, 'sail-o-bots', 'sturec', 'Factory', 'N/A', '0xa7d8d9ef8d8ce8992df33d8b8cf4aebabd5bd270-98') @@ -379,6 +379,29 @@ , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 385, 1000000, 'Dipolar', 'Junia Farquhar', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-385') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 399, 1000000, 'The Field', 'Beervangeer', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-399') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 407, 1000000, 'The Harvest', 'Per Kristian Stoveland', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-407') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 406, 1000000, 'WaVyScApE', 'Holger Lippmann', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-406') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 412, 1000000, 'Cerebellum', 'Laya Mathikshara & Santiago', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-412') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 416, 1000000, 'Calian', 'Eric De Giuli', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-416') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 417, 1000000, 'Ceramics', 'Charlotte Dann', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-417') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 426, 1000000, 'Cargo', 'Kim Asendorf', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-426') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 423, 1000000, 'Solar Transits', 'Robert Hodgin', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-423') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 433, 1000000, 'Still Moving', 'Nathaniel Stern and Sasha Stiles', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-433') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 428, 1000000, 'Memories of Digital Data', 'Kazuhiro Tanimoto', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-428') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 455, 1000000, 'Human Unreadable', 'Operator', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-455') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 418, 1000000, 'Neural Sediments', 'Eko33', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-418') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 457, 1000000, 'Dopamine Machines', 'Steve Pikelny', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-457') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 456, 1000000, 'Spaghetti Bones', 'Joshua Bagley', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-456') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 462, 1000000, 'Gumbo', 'Mathias Isaksen', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-462') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 466, 1000000, 'Torrent', 'Jeres', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-466') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 471, 1000000, 'This Is Not A Rock', 'Nicole Vella', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-471') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 472, 1000000, 'because unless until', 'ixnayokay', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-472') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 482, 1000000, 'Trichro-matic', 'MountVitruvius', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-482') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 483, 1000000, 'Naïve', 'Olga Fradina', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-483') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 484, 1000000, 'Blind Spots', 'Shaderism', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-484') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 486, 1000000, 'Proscenium', 'remnynt', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-486') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 487, 1000000, 'Cytographia', 'Golan Levin', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-487') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 488, 1000000, 'Växt', 'Tengil', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-488') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 493, 1000000, 'Melancholic Magical Maiden', 'Emi Kusano', 'Curated', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-493') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 374, 1000000, 'Ottocento', 'Berubara', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-374') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 375, 1000000, 'Wabi Sabi', 'Kazuhiro Tanimoto', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-375') @@ -393,6 +416,7 @@ , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 388, 1000000, 'Your Story', 'encapsuled', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-388') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 389, 1000000, 'Miragem', 'Third Vision', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-389') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 390, 1000000, 'Imposter Syndrome', 'ippsketch', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-390') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 391, 1000000, 'Contrast Agent', 'Tim Richardson + Sean Zellmer', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-391') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 392, 1000000, 'Hyper Drive: A-Side', 'Ryan Bell', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-392') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 393, 1000000, 'Race Condition', 'Jonas Lund', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-393') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 394, 1000000, 'Volute', 'RVig', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-394') @@ -403,12 +427,73 @@ , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 400, 1000000, 'Such A Lovely Time', 'petitsapin', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-400') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 401, 1000000, 'Aragnation', 'Devi Parikh and Abhishek Das', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-401') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 404, 1000000, 'Ad Extremum Terrae', 'uMathA', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-404') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 405, 1000000, 'chaos comes with the summer haze', 'Cole Sternberg', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-405') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 408, 1000000, 'NimTeens', 'Bryan Brinkman', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-408') , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 409, 1000000, 'Tout tracé', 'Florian Zumbrunn', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-409') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 410, 1000000, 'Jenim', 'Orr Kislev & Alona Rodeh', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-410') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 411, 1000000, 'Symbol 1', 'Emily Weil', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-411') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 413, 1000000, 'Longing', 'phenomena', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-413') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 414, 1000000, 'KARMA', 'KALA', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-414') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 415, 1000000, 'Renders Game', 'MountVitruvius', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-415') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 419, 1000000, 'SL/CE', 'Stranger in the Q', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-419') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 420, 1000000, 'Coalition', 'Generative Artworks', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-420') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 421, 1000000, 'Rippling', 'Yi-Wen Lin', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-421') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 422, 1000000, 'SKEUOMORPHS', 'itsgalo', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-422') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 424, 1000000, 'Worlds Within', 'Jaosn Ting', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-424') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 425, 1000000, 'Mellifera', 'artplusbrad', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-425') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 427, 1000000, 'transparency', 'usnea', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-427') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 429, 1000000, 'ilumz', 'Wolffia Inc. & Motus Art', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-429') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 430, 1000000, 'Fushi No Reality - フシノゲンジツ', 'Samsy', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-430') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 431, 1000000, '(Dis)connected', 'Tibout Shaik', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-431') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 432, 1000000, 'Divergence', 'Loren Bednar', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-432') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 434, 1000000, 'Voyager', 'DisruptedStar', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-434') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 435, 1000000, 'Flows', 'ryley-o.eth', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-435') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 436, 1000000, 'UMK', 'Fernando Jerez', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-436') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 437, 1000000, 'Nära', 'Tengil', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-437') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 438, 1000000, 'Subtle', 'willstall', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-438') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 439, 1000000, 'Enigma', 'RalenArc', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-439') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 440, 1000000, 'Augury', 'LoVid', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-440') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 441, 1000000, 'Net Net Net', 'ilithya x Erin Wajufos', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-441') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 442, 1000000, 'Systems Madness', 'Claudia Hart and Andrew Blanton', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-442') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 443, 1000000, 'Dendro', 'Vebjørn Isaksen', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-443') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 444, 1000000, 'Meaningless', 'Amy Goodchild', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-444') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 445, 1000000, 'Assembly', 'Tezumie', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-445') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 446, 1000000, 'Invisibles', 'Ismahelio', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-446') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 447, 1000000, 'Semblance', 'rahul iyer', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-447') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 448, 1000000, 'Bright', 'Heeey', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-448') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 449, 1000000, 'Speak To Me', 'Lisa Orth', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-449') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 450, 1000000, 'Overload', 'Shvembldr', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-450') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 451, 1000000, 'Backwards', 'Asaf Slook', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-451') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 452, 1000000, 'Muttenz', 'wuwa', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-452') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 453, 1000000, 'Crypt', 'The Cyclops Group', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-453') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 454, 1000000, 'Flourish', 'Sterling Crispin', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-454') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 458, 1000000, 'Mycelia', 'JMY', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-458') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 459, 1000000, 'Seasky', 'Ralgo', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-459') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 460, 1000000, 'Exstasis', 'Grant Oesterling', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-460') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 461, 1000000, 'Sonoran Roadways', 'Jake Rockland', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-461') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 463, 1000000, 'l.o', 'Night Sea', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-463') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 464, 1000000, 'Kubikino', 'Carolina Melis', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-464') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 465, 1000000, 'Escherly Seeds', 'Martijn Cohen', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-465') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 467, 1000000, 'Glasshouse INAT', 'Aleksandra Jovanić', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-467') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 468, 1000000, 'Woman, Life, Freedom', 'Armaghan Fatemi', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-468') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 469, 1000000, 'Twos', 'Emily Edelman', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-469') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 470, 1000000, 'Forecast', 'Manuel Larino', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-470') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 473, 1000000, 'Fluiroso', 'Sebastián Brocher (CryptoArte)', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-473') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 474, 1000000, 'Lumina', 'DistCollective', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-474') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 475, 1000000, 'Recollection', 'Robert Hodgin', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-475') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 476, 1000000, 'Life and Love and Nothing', 'Nat Sarkissian', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-476') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 477, 1000000, 'siempre en mí, siempre en ti', 'Marcelo Soria-Rodríguez', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-477') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 478, 1000000, 'Lucky Clover', 'Sputniko!', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-478') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 479, 1000000, 'Bakhoor Assandal', 'Melissa Wiederrecht', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-479') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 480, 1000000, 'Axo', 'jiwa', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-480') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 481, 1000000, 'Immaterial', 'Bjørn Staal', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-481') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 489, 1000000, 'Balance', 'Kelly Milligan x Amber Vittoria', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-489') + , (0x99a9b7c1116f9ceeb1652de04d5969cce509b069, 490, 1000000, 'Twist', 'Rafaël Rozendaal', 'Presents', 'N/A', '0x99a9b7c1116f9ceeb1652de04d5969cce509b069-490') -- explorations , (0x942bc2d3e7a589fe5bd4a5c6ef9727dfd82f5c8a,0,1000000,'Friendship Bracelets','Alexis Andre','Explorations','N/A','0x942bc2d3e7a589fe5bd4a5c6ef9727dfd82f5c8a-0') , (0x942bc2d3e7a589fe5bd4a5c6ef9727dfd82f5c8a,1,1000000,'Marfa Yucca','Daniel Calderon Arenas','Explorations','N/A','0x942bc2d3e7a589fe5bd4a5c6ef9727dfd82f5c8a-1') + , (0x942bc2d3e7a589fe5bd4a5c6ef9727dfd82f5c8a,2,1000000,'marfaMESH','Harvey Rayner','Explorations','N/A','0x942bc2d3e7a589fe5bd4a5c6ef9727dfd82f5c8a-2') -- collaborations , (0x64780ce53f6e966e18a22af13a2f97369580ec11,0,1000000,'Petro National','John Gerrard','Art Blocks x Pace','N/A','0x64780ce53f6e966e18a22af13a2f97369580ec11-0') @@ -416,6 +501,9 @@ , (0x64780ce53f6e966e18a22af13a2f97369580ec11,2,1000000,'QWERTY','Tara Donovan','Art Blocks x Pace','N/A','0x64780ce53f6e966e18a22af13a2f97369580ec11-2') , (0x64780ce53f6e966e18a22af13a2f97369580ec11,3,1000000,'Contractions','Loie Hollowell','Art Blocks x Pace','N/A','0x64780ce53f6e966e18a22af13a2f97369580ec11-3') , (0x64780ce53f6e966e18a22af13a2f97369580ec11,4,1000000,'New Worlds','Robert Whitman','Art Blocks x Pace','N/A','0x64780ce53f6e966e18a22af13a2f97369580ec11-4') + , (0xea698596b6009a622c3ed00dd5a8b5d1cae4fc36,5,1000000,'PRELUDES','Trevor Paglen','Art Blocks x Pace','N/A','0xea698596b6009a622c3ed00dd5a8b5d1cae4fc36-5') + , (0xea698596b6009a622c3ed00dd5a8b5d1cae4fc36,6,1000000,'World Flag','John Gerrard','Art Blocks x Pace','N/A','0xea698596b6009a622c3ed00dd5a8b5d1cae4fc36-6') + , (0xea698596b6009a622c3ed00dd5a8b5d1cae4fc36,7,1000000,'Schema','DRIFT with Jeff Davis','Art Blocks x Pace','N/A','0xea698596b6009a622c3ed00dd5a8b5d1cae4fc36-7') ) as temp_table (contract_address, project_id, project_id_base_value, collection_name, artist_name, art_blocks_project_type, art_blocks_curated_season, art_collection_unique_id) diff --git a/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_bright_moments.sql b/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_bright_moments.sql index f1aa1274a36..a3560d2495d 100644 --- a/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_bright_moments.sql +++ b/dbt_subprojects/nft/models/nft_metrics/ethereum/metadata/nft_ethereum_metadata_bright_moments.sql @@ -59,7 +59,7 @@ from (VALUES , (0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676, 47, 1000000, 'Sparkling Goodbye', 'Licia He', 'Tokyo', '0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676-47') , (0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676, 48, 1000000, 'Undercurrents', 'Melissa Wiederrecht', 'Tokyo', '0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676-48') , (0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676, 49, 1000000, 'Margaret', 'qubibi', 'Tokyo', '0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676-49') - , (0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676, 50, 1000000, 'Nature finds a way.', 'Spongenuity.', 'Tokyo', '0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676-50') + , (0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676, 50, 1000000, 'Nature finds a way.', 'Spongenuity', 'Tokyo', '0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676-50') , (0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676, 51, 1000000, 'Marching Resonances', 'Shunsuke Takawo', 'Tokyo', '0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676-51') , (0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676, 52, 1000000, 'Kumono Shingou', 'zancan', 'Tokyo', '0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676-52') , (0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676, 53, 1000000, 'Hanabi', 'ykxotkx', 'Tokyo', '0x0a1bbd57033f57e7b6743621b79fcb9eb2ce3676-53') From 0a2436e51243742ca9c51dc3b05a2e0837c2b173 Mon Sep 17 00:00:00 2001 From: Rantum Date: Tue, 6 Aug 2024 12:13:23 -0700 Subject: [PATCH 06/12] add tokens to price & tokens list on Base (#6507) * initial Socialtokens view * Rename socialTokens to socialtokens.sql * Addded new tokens to list * Update socialtokens.sql * rmv social tokens file * add zeroex to dex_aggregator.trades * remove old branches * reset profiles.yml * remove * save * schema * undo trnsfesr changes * add base tokens to tokens and price lists * timi * remove dup --- .../tokens/models/prices/base/prices_base_tokens.sql | 6 +++++- .../tokens/models/tokens/base/tokens_base_erc20.sql | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dbt_subprojects/tokens/models/prices/base/prices_base_tokens.sql b/dbt_subprojects/tokens/models/prices/base/prices_base_tokens.sql index c923233a940..bfebc7628e9 100644 --- a/dbt_subprojects/tokens/models/prices/base/prices_base_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/base/prices_base_tokens.sql @@ -136,5 +136,9 @@ FROM ('brish-brish','base','BRISH',0x37f24b26bcefbfac7f261b97f8036da98f81a299, 18), ('gme5-gme-base','base','GME',0xbeb0fd48c2ba0f1aacad2814605f09e08a96b94e, 9), ('brrr-bucci','base','BRRR',0x1e0bb24ed6c806c01ef2f880a4b91adb90099ea7, 18), - ('bps-base-pro-shops','base','BPS',0xda761a290e01c69325d12d82ac402e5a73d62e81, 18) + ('bps-base-pro-shops','base','BPS',0xda761a290e01c69325d12d82ac402e5a73d62e81, 18), + ('timi-this-is-my-iguana','base','TIMI',0x9beec80e62aa257ced8b0edd8692f79ee8783777, 18), + ('french-french-on-base','base','FRENCH',0x013b6451e2b2131052d3473593bd786df5143faf, 18), + ('mrsmiggles-mrs-miggles','base','MRSMIGGLES',0x31b28012f61fc3600e1c076bafc9fd997fb2da90, 18), + ('king-king-of-memes','base','KING',0x420b0fa3de2efcf2b2fd04152eb1df36a09717cd, 18) ) as temp (token_id, blockchain, symbol, contract_address, decimals) diff --git a/dbt_subprojects/tokens/models/tokens/base/tokens_base_erc20.sql b/dbt_subprojects/tokens/models/tokens/base/tokens_base_erc20.sql index df3fba79f75..66f7758984d 100644 --- a/dbt_subprojects/tokens/models/tokens/base/tokens_base_erc20.sql +++ b/dbt_subprojects/tokens/models/tokens/base/tokens_base_erc20.sql @@ -246,4 +246,8 @@ FROM (VALUES , (0x6985884c4392d348587b19cb9eaaf157f13271cd, 'ZRO', 18) , (0x64b88c73A5DfA78D1713fE1b4c69a22d7E0faAa7, 'MAV', 18) , (0x0f1D1b7abAeC1Df25f2C4Db751686FC5233f6D3f, 'IMO', 18) + , (0x9beec80e62aa257ced8b0edd8692f79ee8783777, 'TIMI', 18) + , (0x013b6451e2b2131052d3473593bd786df5143faf, 'FRENCH', 18) + , (0x31b28012f61fc3600e1c076bafc9fd997fb2da90, 'MRSMIGGLES', 18) + , (0x420b0fa3de2efcf2b2fd04152eb1df36a09717cd, 'KING', 18) ) AS temp_table (contract_address, symbol, decimals) From 29820f911e91ef6399fa004aef2fc54fc09c95c0 Mon Sep 17 00:00:00 2001 From: viniabussafi <131974393+viniabussafi@users.noreply.github.com> Date: Tue, 6 Aug 2024 20:13:36 +0100 Subject: [PATCH 07/12] add missing token to tokens.erc20 (#6503) Co-authored-by: Huang Geyang --- .../tokens/models/tokens/ethereum/tokens_ethereum_erc20.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_erc20.sql b/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_erc20.sql index f8c510f8af0..4e0bf25a6ca 100644 --- a/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_erc20.sql +++ b/dbt_subprojects/tokens/models/tokens/ethereum/tokens_ethereum_erc20.sql @@ -4587,4 +4587,5 @@ FROM (VALUES , ( 0x63a0964A36c34E81959da5894ad888800e17405b, 'ShezETH', 18) , ( 0xDfFb77dB95E16B791178D28CF994b13E84036076, 'BLU', 18) , ( 0x866a2bf4e572cbcf37d5071a7a58503bfb36be1b, 'M', 6) + , ( 0x20157dbabb84e3bbfe68c349d0d44e48ae7b5ad2, 'dlcBTC', 8) ) AS temp_table (contract_address, symbol, decimals) From 03751acbfef26c818590fd03fdc4dd5c3f2e1b18 Mon Sep 17 00:00:00 2001 From: 0xRob <83790096+0xRobin@users.noreply.github.com> Date: Tue, 6 Aug 2024 21:13:52 +0200 Subject: [PATCH 08/12] EVM blockchain metrics (#6502) * ethereum blockchain metrics * syntax * syntax * syntax fix * unnest lag time * missing grouping * test this * fixezzz * incremental syntax errors * optimize incremental setup * remove active and returning * add chain_id * add chain_id * add all evm chains * add all evm chains --- .../macros/blockchain_address_metrics.sql | 31 +++++++ .../macros/blockchain_metrics.sql | 75 +++++++++++++++++ .../blockchain_metrics/arbitrum/_schema.yml | 25 ++++++ .../arbitrum/arbitrum_address_metrics.sql | 11 +++ .../arbitrum/arbitrum_metrics.sql | 15 ++++ .../avalanche_c/_schema.yml | 25 ++++++ .../avalanche_c_address_metrics.sql | 11 +++ .../avalanche_c/avalanche_c_metrics.sql | 15 ++++ .../blockchain_metrics/base/_schema.yml | 25 ++++++ .../base/base_address_metrics.sql | 11 +++ .../blockchain_metrics/base/base_metrics.sql | 15 ++++ .../blockchain_metrics/blast/_schema.yml | 25 ++++++ .../blast/blast_address_metrics.sql | 11 +++ .../blast/blast_metrics.sql | 15 ++++ .../blockchain_metrics/bnb/_schema.yml | 25 ++++++ .../bnb/bnb_address_metrics.sql | 11 +++ .../blockchain_metrics/bnb/bnb_metrics.sql | 15 ++++ .../blockchain_metrics/celo/_schema.yml | 25 ++++++ .../celo/celo_address_metrics.sql | 11 +++ .../blockchain_metrics/celo/celo_metrics.sql | 15 ++++ .../blockchain_metrics/ethereum/_schema.yml | 25 ++++++ .../ethereum/ethereum_address_metrics.sql | 11 +++ .../ethereum/ethereum_metrics.sql | 15 ++++ .../blockchain_metrics/fantom/_schema.yml | 25 ++++++ .../fantom/fantom_address_metrics.sql | 11 +++ .../fantom/fantom_metrics.sql | 15 ++++ .../blockchain_metrics/gnosis/_schema.yml | 25 ++++++ .../gnosis/gnosis_address_metrics.sql | 11 +++ .../gnosis/gnosis_metrics.sql | 15 ++++ .../blockchain_metrics/linea/_schema.yml | 25 ++++++ .../linea/linea_address_metrics.sql | 11 +++ .../linea/linea_metrics.sql | 15 ++++ .../blockchain_metrics/mantle/_schema.yml | 25 ++++++ .../mantle/mantle_address_metrics.sql | 11 +++ .../mantle/mantle_metrics.sql | 15 ++++ .../blockchain_metrics/optimism/_schema.yml | 25 ++++++ .../optimism/optimism_address_metrics.sql | 11 +++ .../optimism/optimism_metrics.sql | 15 ++++ .../blockchain_metrics/polygon/_schema.yml | 25 ++++++ .../polygon/polygon_address_metrics.sql | 11 +++ .../polygon/polygon_metrics.sql | 15 ++++ .../blockchain_metrics/scroll/_schema.yml | 25 ++++++ .../scroll/scroll_address_metrics.sql | 11 +++ .../scroll/scroll_metrics.sql | 15 ++++ .../blockchain_metrics/sei/_schema.yml | 25 ++++++ .../sei/sei_address_metrics.sql | 11 +++ .../blockchain_metrics/sei/sei_metrics.sql | 15 ++++ .../blockchain_metrics/zkevm/_schema.yml | 25 ++++++ .../zkevm/zkevm_address_metrics.sql | 11 +++ .../zkevm/zkevm_metrics.sql | 15 ++++ .../blockchain_metrics/zksync/_schema.yml | 25 ++++++ .../zksync/zksync_address_metrics.sql | 11 +++ .../zksync/zksync_metrics.sql | 15 ++++ .../blockchain_metrics/zora/_schema.yml | 25 ++++++ .../zora/zora_address_metrics.sql | 11 +++ .../blockchain_metrics/zora/zora_metrics.sql | 15 ++++ scripts/replicate_dbt_all_evms.py | 83 +++++++++++++++++++ 57 files changed, 1107 insertions(+) create mode 100644 dbt_subprojects/hourly_spellbook/macros/blockchain_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/macros/blockchain_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/_schema.yml create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_address_metrics.sql create mode 100644 dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_metrics.sql create mode 100644 scripts/replicate_dbt_all_evms.py diff --git a/dbt_subprojects/hourly_spellbook/macros/blockchain_address_metrics.sql b/dbt_subprojects/hourly_spellbook/macros/blockchain_address_metrics.sql new file mode 100644 index 00000000000..a1edf31f63c --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/macros/blockchain_address_metrics.sql @@ -0,0 +1,31 @@ +{% macro blockchain_address_metrics(blockchain) %} + +with run as ( +select + '{{blockchain}}' as blockchain + ,"from" as address + ,min(block_time) as min_block_time +from {{ source(blockchain,'transactions') }} tx +{% if is_incremental() %} +where {{ incremental_predicate('block_time') }} +{% endif %} +group by 1,2 +) + + +{% if is_incremental() %} +select + coalesce(o.blockchain, r.blockchain) as blockchain + ,coalesce(o.address, r.address) as address + ,coalesce(o.min_block_time, r.min_block_time) as min_block_time +from run r +left join {{this}} o +on r.blockchain = o.blockchain +and r.address = o.address +{% else %} +select * from run +{% endif %} + + +{% endmacro %} + diff --git a/dbt_subprojects/hourly_spellbook/macros/blockchain_metrics.sql b/dbt_subprojects/hourly_spellbook/macros/blockchain_metrics.sql new file mode 100644 index 00000000000..fea2fb95ff6 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/macros/blockchain_metrics.sql @@ -0,0 +1,75 @@ +{% macro blockchain_metrics(blockchain) %} + +WITH blocks as ( + select + '{{ blockchain }}' as blockchain + ,date_trunc('hour',"time") as block_hour + ,avg(date_diff('second',lag_time,"time")) as avg_block_time_seconds +from ( + select + time + ,lag(time) over (order by "time" asc) as lag_time + from {{source(blockchain,'blocks')}} + {% if is_incremental() %} + where {{ incremental_predicate('time') }} + {% endif %} +) +group by 1,2 +) + +, transactions as ( + select + '{{ blockchain }}' as blockchain + ,date_trunc('hour',block_time) as block_hour + ,count(hash) as tx_count + ,count_if(success) as tx_success_count + ,cast(count(hash) as double)/(60.0*60.0) as tx_per_second +from {{source(blockchain,'transactions')}} +{% if is_incremental() %} +where {{ incremental_predicate('block_time') }} +{% endif %} +group by 1,2 +) + +, new_addresses as ( + select + '{{blockchain}}' as blockchain + ,date_trunc('hour',min_block_time) as block_hour + ,count(distinct address) as new_addresses +from {{ref(blockchain ~ '_address_metrics')}} +{% if is_incremental() %} +where {{ incremental_predicate('min_block_time') }} +{% endif %} +group by 1,2 +) + +, new_contracts as ( + select + '{{ blockchain }}' as blockchain + ,date_trunc('hour',block_time) as block_hour + ,count(distinct address) as new_contracts +from {{source(blockchain,'creation_traces')}} +{% if is_incremental() %} +where {{ incremental_predicate('block_time') }} +{% endif %} +group by 1,2 +) + + +select + blockchain + ,chain_id + ,block_hour + ,tx_count + ,tx_success_count + ,cast(tx_success_count as double)/cast(tx_count as double) as tx_success_rate + ,avg_block_time_seconds + ,tx_per_second + ,new_addresses + ,new_contracts +from blocks +left join transactions using (blockchain, block_hour) +left join new_addresses using (blockchain, block_hour) +left join new_contracts using (blockchain, block_hour) +left join {{ source('evms','info') }} using (blockchain) +{% endmacro %} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/_schema.yml new file mode 100644 index 00000000000..098a3b7f7fd --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: arbitrum_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: arbitrum_metrics + meta: + blockchain: arbitrum + sector: metrics + contributors: 0xRob + config: + tags: [ 'arbitrum','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_address_metrics.sql new file mode 100644 index 00000000000..0834e317930 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='arbitrum', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('arbitrum')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_metrics.sql new file mode 100644 index 00000000000..dbfc17d98e8 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/arbitrum/arbitrum_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='arbitrum', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["arbitrum"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('arbitrum')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/_schema.yml new file mode 100644 index 00000000000..2af5e9746c3 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: avalanche_c_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: avalanche_c_metrics + meta: + blockchain: avalanche_c + sector: metrics + contributors: 0xRob + config: + tags: [ 'avalanche_c','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_address_metrics.sql new file mode 100644 index 00000000000..2f66fe559de --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='avalanche_c', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('avalanche_c')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_metrics.sql new file mode 100644 index 00000000000..22957e409cb --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/avalanche_c/avalanche_c_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='avalanche_c', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["avalanche_c"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('avalanche_c')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/_schema.yml new file mode 100644 index 00000000000..d26abcd4725 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: base_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: base_metrics + meta: + blockchain: base + sector: metrics + contributors: 0xRob + config: + tags: [ 'base','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_address_metrics.sql new file mode 100644 index 00000000000..61c7d183bb5 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='base', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('base')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_metrics.sql new file mode 100644 index 00000000000..1d877c0af92 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/base/base_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='base', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["base"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('base')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/_schema.yml new file mode 100644 index 00000000000..6c23816adbf --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: blast_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: blast_metrics + meta: + blockchain: blast + sector: metrics + contributors: 0xRob + config: + tags: [ 'blast','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_address_metrics.sql new file mode 100644 index 00000000000..e2edbe5cac4 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='blast', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('blast')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_metrics.sql new file mode 100644 index 00000000000..2f22365537c --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/blast/blast_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='blast', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["blast"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('blast')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/_schema.yml new file mode 100644 index 00000000000..17e3d61b8cc --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: bnb_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: bnb_metrics + meta: + blockchain: bnb + sector: metrics + contributors: 0xRob + config: + tags: [ 'bnb','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_address_metrics.sql new file mode 100644 index 00000000000..500cb32c54c --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='bnb', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('bnb')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_metrics.sql new file mode 100644 index 00000000000..3422d65a8ca --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/bnb/bnb_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='bnb', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["bnb"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('bnb')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/_schema.yml new file mode 100644 index 00000000000..51e267d55c6 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: celo_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: celo_metrics + meta: + blockchain: celo + sector: metrics + contributors: 0xRob + config: + tags: [ 'celo','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_address_metrics.sql new file mode 100644 index 00000000000..97835592259 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='celo', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('celo')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_metrics.sql new file mode 100644 index 00000000000..972e96afea9 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/celo/celo_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='celo', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["celo"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('celo')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/_schema.yml new file mode 100644 index 00000000000..f02f3d86df4 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: ethereum_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: ethereum_metrics + meta: + blockchain: ethereum + sector: metrics + contributors: 0xRob + config: + tags: [ 'ethereum','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_address_metrics.sql new file mode 100644 index 00000000000..8b64169762c --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='ethereum', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('ethereum')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_metrics.sql new file mode 100644 index 00000000000..c8d7c9b7d16 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/ethereum/ethereum_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='ethereum', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["ethereum"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('ethereum')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/_schema.yml new file mode 100644 index 00000000000..0227ec503b4 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: fantom_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: fantom_metrics + meta: + blockchain: fantom + sector: metrics + contributors: 0xRob + config: + tags: [ 'fantom','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_address_metrics.sql new file mode 100644 index 00000000000..a2013fe0f17 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='fantom', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('fantom')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_metrics.sql new file mode 100644 index 00000000000..85c4b9f415d --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/fantom/fantom_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='fantom', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["fantom"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('fantom')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/_schema.yml new file mode 100644 index 00000000000..f9e9b106dce --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: gnosis_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: gnosis_metrics + meta: + blockchain: gnosis + sector: metrics + contributors: 0xRob + config: + tags: [ 'gnosis','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_address_metrics.sql new file mode 100644 index 00000000000..a98e6bbf66a --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='gnosis', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('gnosis')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_metrics.sql new file mode 100644 index 00000000000..8475f4b5dfa --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/gnosis/gnosis_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='gnosis', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["gnosis"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('gnosis')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/_schema.yml new file mode 100644 index 00000000000..b722b5dce11 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: linea_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: linea_metrics + meta: + blockchain: linea + sector: metrics + contributors: 0xRob + config: + tags: [ 'linea','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_address_metrics.sql new file mode 100644 index 00000000000..7ae64d5ab46 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='linea', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('linea')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_metrics.sql new file mode 100644 index 00000000000..0816eeebb1c --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/linea/linea_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='linea', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["linea"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('linea')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/_schema.yml new file mode 100644 index 00000000000..e22693044eb --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: mantle_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: mantle_metrics + meta: + blockchain: mantle + sector: metrics + contributors: 0xRob + config: + tags: [ 'mantle','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_address_metrics.sql new file mode 100644 index 00000000000..c0d4d6565ef --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='mantle', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('mantle')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_metrics.sql new file mode 100644 index 00000000000..1ecbadf3a1e --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/mantle/mantle_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='mantle', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["mantle"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('mantle')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/_schema.yml new file mode 100644 index 00000000000..cde6f864128 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: optimism_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: optimism_metrics + meta: + blockchain: optimism + sector: metrics + contributors: 0xRob + config: + tags: [ 'optimism','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_address_metrics.sql new file mode 100644 index 00000000000..431d5b85cf1 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='optimism', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('optimism')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_metrics.sql new file mode 100644 index 00000000000..911d6c590ba --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/optimism/optimism_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='optimism', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["optimism"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('optimism')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/_schema.yml new file mode 100644 index 00000000000..080a3532e75 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: polygon_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: polygon_metrics + meta: + blockchain: polygon + sector: metrics + contributors: 0xRob + config: + tags: [ 'polygon','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_address_metrics.sql new file mode 100644 index 00000000000..555bbc9e729 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='polygon', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('polygon')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_metrics.sql new file mode 100644 index 00000000000..0955c4a5405 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/polygon/polygon_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='polygon', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["polygon"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('polygon')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/_schema.yml new file mode 100644 index 00000000000..aed8d5b1fb1 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: scroll_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: scroll_metrics + meta: + blockchain: scroll + sector: metrics + contributors: 0xRob + config: + tags: [ 'scroll','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_address_metrics.sql new file mode 100644 index 00000000000..d0215b7fb0d --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='scroll', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('scroll')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_metrics.sql new file mode 100644 index 00000000000..69e27701fea --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/scroll/scroll_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='scroll', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["scroll"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('scroll')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/_schema.yml new file mode 100644 index 00000000000..3afae23401a --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: sei_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: sei_metrics + meta: + blockchain: sei + sector: metrics + contributors: 0xRob + config: + tags: [ 'sei','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_address_metrics.sql new file mode 100644 index 00000000000..4c4ff4e2a5d --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='sei', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('sei')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_metrics.sql new file mode 100644 index 00000000000..53558869b15 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/sei/sei_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='sei', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["sei"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('sei')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/_schema.yml new file mode 100644 index 00000000000..52f54c3b099 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: zkevm_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: zkevm_metrics + meta: + blockchain: zkevm + sector: metrics + contributors: 0xRob + config: + tags: [ 'zkevm','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_address_metrics.sql new file mode 100644 index 00000000000..89e414c92cb --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='zkevm', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('zkevm')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_metrics.sql new file mode 100644 index 00000000000..e2e6a09b90b --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zkevm/zkevm_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='zkevm', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["zkevm"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('zkevm')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/_schema.yml new file mode 100644 index 00000000000..2f7b8292b05 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: zksync_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: zksync_metrics + meta: + blockchain: zksync + sector: metrics + contributors: 0xRob + config: + tags: [ 'zksync','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_address_metrics.sql new file mode 100644 index 00000000000..81da4492b20 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='zksync', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('zksync')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_metrics.sql new file mode 100644 index 00000000000..39ed8d6d8e1 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zksync/zksync_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='zksync', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["zksync"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('zksync')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/_schema.yml b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/_schema.yml new file mode 100644 index 00000000000..1b04f01bea1 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/_schema.yml @@ -0,0 +1,25 @@ +version: 2 + +models: + - name: zora_address_metrics + columns: + - name: blockchain + - name: address + tests: + - unique + - name: min_block_time + description: "block_time of the first transaction initiated by the address" + + - name: zora_metrics + meta: + blockchain: zora + sector: metrics + contributors: 0xRob + config: + tags: [ 'zora','metrics' ] + description: "fundamental blockchain metrics" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - blockchain + - block_hour diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_address_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_address_metrics.sql new file mode 100644 index 00000000000..1b8c2e8a8d7 --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_address_metrics.sql @@ -0,0 +1,11 @@ +{{ config( + schema='zora', + alias = 'address_metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['address'] + ) +}} + +{{blockchain_address_metrics('zora')}} diff --git a/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_metrics.sql b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_metrics.sql new file mode 100644 index 00000000000..0e9b1dee07a --- /dev/null +++ b/dbt_subprojects/hourly_spellbook/models/_sector/blockchain_metrics/zora/zora_metrics.sql @@ -0,0 +1,15 @@ +{{ config( + schema='zora', + alias = 'metrics', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['blockchain','block_hour'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_hour')], + post_hook='{{ expose_spells(\'["zora"]\', + "sector", + "metrics", + \'["0xRob"]\') }}') +}} + +{{blockchain_metrics('zora')}} diff --git a/scripts/replicate_dbt_all_evms.py b/scripts/replicate_dbt_all_evms.py new file mode 100644 index 00000000000..8a0244131cd --- /dev/null +++ b/scripts/replicate_dbt_all_evms.py @@ -0,0 +1,83 @@ +import os +import sys + +# List of valid evm chains +chains = [ + "arbitrum", "avalanche_c", "base", "blast", "bnb", "celo", "ethereum", + "fantom", "gnosis", "linea", "mantle", "optimism", "polygon", "scroll", + "sei", "zkevm", "zksync", "zora" +] + + +# Function to replace chain name in a string +def replace_chain_name(content, old_chain, new_chain): + return content.replace(old_chain, new_chain) + + +# Function to replicate the directory structure +def replicate_directory_structure(template_dir, chains): + # Infer the template chain name from the directory name + template_chain = os.path.basename(template_dir) + + # Check if the template chain is in the list of valid chains + if template_chain not in chains: + print(f"Error: The inferred template chain '{template_chain}' is not in the list of valid chains.") + sys.exit(1) + + # Infer the output base directory + output_base_dir = os.path.dirname(template_dir) + + for chain in chains: + # Skip the template chain itself + if chain == template_chain: + continue + + # Create a new directory for each chain + new_dir = os.path.join(output_base_dir, chain) + if not os.path.exists(new_dir): + os.makedirs(new_dir) + + # Copy and adapt files from the template directory + for root, dirs, files in os.walk(template_dir): + for file in files: + # Construct the source file path + src_file_path = os.path.join(root, file) + + # Read the file content + with open(src_file_path, 'r') as f: + content = f.read() + + # Replace any reference of the template chain name within the file content + new_content = replace_chain_name(content, template_chain, chain) + + # Replace the template chain name in the file name + new_file_name = file.replace(template_chain, chain) + new_file_path = os.path.join(new_dir, new_file_name) + + # Write the new content to the new file + with open(new_file_path, 'w') as f: + f.write(new_content) + + print(f"Created file: {new_file_path}") + + +# Main function to handle command line arguments +def main(): + if len(sys.argv) != 2: + print("Usage: python replicate_dbt_all_evms.py ") + sys.exit(1) + + # Get the template directory from command line arguments + template_dir = sys.argv[1] + + # Check if the provided directory exists + if not os.path.exists(template_dir): + print(f"Error: The directory '{template_dir}' does not exist.") + sys.exit(1) + + # Call the function to replicate the directory structure + replicate_directory_structure(template_dir, chains) + + +if __name__ == "__main__": + main() From c6f3f29669e81158d437e5e63da8735c24583d9c Mon Sep 17 00:00:00 2001 From: jeff-dude <102681548+jeff-dude@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:14:41 -0400 Subject: [PATCH 09/12] DUX-584 Initiate arbitrum nova (#6506) * add nova base sources * update nova blockchain name in info * add native arb price * add prices * add erc20 tokens --- .../daily_spellbook/models/evms/evms_info.sql | 2 +- .../prices/{prices_schema.yml => _schema.yml} | 4 +- .../tokens/models/prices/nova/_schema.yml | 29 ++ .../models/prices/nova/prices_nova_tokens.sql | 26 ++ .../models/prices/prices_native_tokens.sql | 1 + .../tokens/models/prices/prices_tokens.sql | 1 + .../models/prices/prices_trusted_tokens.sql | 7 +- .../tokens/{tokens_schema.yml => _schema.yml} | 4 +- .../tokens/models/tokens/nova/_schema.yml | 21 + .../models/tokens/nova/tokens_nova_erc20.sql | 20 + .../tokens/models/tokens/tokens_erc20.sql | 3 +- sources/_base_sources/nova_base_sources.yml | 382 ++++++++++++++++++ 12 files changed, 493 insertions(+), 7 deletions(-) rename dbt_subprojects/tokens/models/prices/{prices_schema.yml => _schema.yml} (96%) create mode 100644 dbt_subprojects/tokens/models/prices/nova/_schema.yml create mode 100644 dbt_subprojects/tokens/models/prices/nova/prices_nova_tokens.sql rename dbt_subprojects/tokens/models/tokens/{tokens_schema.yml => _schema.yml} (96%) create mode 100644 dbt_subprojects/tokens/models/tokens/nova/_schema.yml create mode 100644 dbt_subprojects/tokens/models/tokens/nova/tokens_nova_erc20.sql create mode 100644 sources/_base_sources/nova_base_sources.yml diff --git a/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql b/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql index 9f1852840fa..e7e953767fe 100644 --- a/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql +++ b/dbt_subprojects/daily_spellbook/models/evms/evms_info.sql @@ -41,7 +41,7 @@ FROM ( , (1088, 'metis_andromeda', 'Metis Andromeda', NULL, NULL, NULL, NULL, 'https://andromeda-explorer.metis.io/', timestamp '2021-11-18 22:19', 'Optimistic Virtual Machine', 'Ethereum', 'Ethereum') , (5000, 'mantle', 'Mantle', 'Layer 2', 'Optimistic Rollup', 'MNT', NULL, 'https://explorer.mantle.xyz/', timestamp '2023-07-02 18:21', 'Optimistic Virtual Machine', 'Ethereum', 'Ethereum') , (59144, 'linea', 'Linea', 'Layer 2', 'ZK Rollup', 'ETH', 0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f, 'https://lineascan.build/', timestamp '2023-07-06 13:15', NULL, 'Ethereum Blobs', 'Ethereum') - , (42170, 'arbitrum_nova', 'Arbitrum Nova', 'Layer 2', 'Optimistic Rollup', 'ETH', NULL, 'https://nova-explorer.arbitrum.io/', timestamp '2022-06-25 04:01', 'Arbitrum', 'Ethereum', 'Ethereum') + , (42170, 'nova', 'Arbitrum Nova', 'Layer 2', 'Optimistic Rollup', 'ETH', NULL, 'https://nova-explorer.arbitrum.io/', timestamp '2022-06-25 04:01', 'Arbitrum', 'Ethereum', 'Ethereum') , (288, 'boba', 'Boba Network', 'Layer 2', 'Optimistic Rollup', 'ETH', NULL, 'https://bobascan.com/', timestamp '2021-10-28 05:03', 'Optimistic Virtual Machine', 'Ethereum', 'Ethereum') , (7700, 'canto', 'Canto', 'Layer 2', NULL, 'ETH', NULL, 'https://evm.explorer.canto.io/', timestamp '2022-07-26 19:27', NULL, 'Ethereum', 'Ethereum') , (420, 'optimism_goerli', 'Optimism Goerli', 'Testnet', 'Optimistic Rollup', 'GTH', 0x4200000000000000000000000000000000000006, 'https://optimism-goerli.blockscout.com/', timestamp '2022-06-09 16:55', 'OP Stack', 'Goerli', 'Goerli') diff --git a/dbt_subprojects/tokens/models/prices/prices_schema.yml b/dbt_subprojects/tokens/models/prices/_schema.yml similarity index 96% rename from dbt_subprojects/tokens/models/prices/prices_schema.yml rename to dbt_subprojects/tokens/models/prices/_schema.yml index 6c08e8a1e38..4c52e2e0c21 100644 --- a/dbt_subprojects/tokens/models/prices/prices_schema.yml +++ b/dbt_subprojects/tokens/models/prices/_schema.yml @@ -3,7 +3,7 @@ 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 + blockchain: arbitrum, avalanche_c, gnosis, polygon, optimism, ethereum, bnb, solana, fantom, celo, base, zksync, zora, linea, zkevm, blast, sei, nova sector: prices contributors: aalan3, hildobby, pipistrella, viniabussafi, jeff-dude config: @@ -30,7 +30,7 @@ models: - name: prices_native_tokens meta: - blockchain: arbitrum, avalanche_c, gnosis, polygon, optimism, ethereum, bnb, solana, fantom, celo, zksync, zora, sei + blockchain: arbitrum, avalanche_c, gnosis, polygon, optimism, ethereum, bnb, solana, fantom, celo, zksync, zora, sei, nova sector: prices contributors: aalan3, jeff-dude config: diff --git a/dbt_subprojects/tokens/models/prices/nova/_schema.yml b/dbt_subprojects/tokens/models/prices/nova/_schema.yml new file mode 100644 index 00000000000..7d3fdea3299 --- /dev/null +++ b/dbt_subprojects/tokens/models/prices/nova/_schema.yml @@ -0,0 +1,29 @@ +version: 2 + +models: + - name: prices_nova_tokens + meta: + blockchain: nova + sector: prices + contributors: jeff-dude + config: + tags: ['prices', 'tokens', 'usd', 'nova'] + description: "Price tokens on nova EVM chain" + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - contract_address + columns: + - 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." + - name: blockchain + description: "Native blockchain of the token, if any" + tests: + - accepted_values: + values: [ "nova" ] + - name: contract_address + description: "Contract address of the token, if any" + - name: symbol + description: "Token symbol" + - name: decimals + description: "Number of decimals for the token contract" \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/prices/nova/prices_nova_tokens.sql b/dbt_subprojects/tokens/models/prices/nova/prices_nova_tokens.sql new file mode 100644 index 00000000000..a0aece87c2f --- /dev/null +++ b/dbt_subprojects/tokens/models/prices/nova/prices_nova_tokens.sql @@ -0,0 +1,26 @@ +{% set blockchain = 'nova' %} + +{{ config( + schema = 'prices_' + blockchain, + alias = 'tokens', + materialized = 'table', + file_format = 'delta', + tags = ['static'] + ) +}} + +SELECT + token_id + , '{{ blockchain }}' as blockchain + , symbol + , contract_address + , decimals +FROM +( + VALUES + ('arb-arbitrum', 'ARB', 0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD, 18) + , ('usdc-usd-coin', 'USDC', 0x750ba8b76187092B0D1E87E28daaf484d1b5273b, 6) + , ('wbtc-wrapped-bitcoin', 'WBTC', 0x1d05e4e72cD994cdF976181CfB0707345763564d, 8) + , ('weth-weth', 'WETH', 0x722E8BdD2ce80A4422E880164f2079488e115365, 18) + , ('dai-dai', 'DAI', 0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1, 18) +) as temp (token_id, symbol, contract_address, decimals) \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/prices/prices_native_tokens.sql b/dbt_subprojects/tokens/models/prices/prices_native_tokens.sql index cd506e2b4d5..5ef4a6af58d 100644 --- a/dbt_subprojects/tokens/models/prices/prices_native_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/prices_native_tokens.sql @@ -20,6 +20,7 @@ FROM ('apt-aptos', null, 'APT', null, null), ('ae-aeternity', null, 'AE', null, null), ('algo-algorand', null, 'ALGO', null, null), + ('arb-arbitrum', null, 'ARB', null, null), ('atom-cosmos', null, 'ATOM', null, null), ('avax-avalanche', null, 'AVAX', null, null), ('bch-bitcoin-cash', null, 'BCH', null, null), diff --git a/dbt_subprojects/tokens/models/prices/prices_tokens.sql b/dbt_subprojects/tokens/models/prices/prices_tokens.sql index 8b64af4d44a..92961322c2b 100644 --- a/dbt_subprojects/tokens/models/prices/prices_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/prices_tokens.sql @@ -34,6 +34,7 @@ ref('prices_native_tokens') ,ref('prices_mantle_tokens') ,ref('prices_blast_tokens') ,ref('prices_sei_tokens') +,ref('prices_nova_tokens') ] %} diff --git a/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql b/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql index d7723893d85..6c01f1c23b8 100644 --- a/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql +++ b/dbt_subprojects/tokens/models/prices/prices_trusted_tokens.sql @@ -123,5 +123,10 @@ FROM (VALUES ('arbitrum', 'USDC.e', 0xff970a61a04b1ca14834a43f5de4533ebddb5cc8), ('sei', 'WSEI', 0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7), ('sei', 'USDC', 0x3894085Ef7Ff0f0aeDf52E2A2704928d1Ec074F1), ('sei', 'USDT', 0xB75D0B03c06A926e488e2659DF1A861F860bD3d1), - ('sei', 'WETH', 0x160345fC359604fC6e70E3c5fAcbdE5F7A9342d8) + ('sei', 'WETH', 0x160345fC359604fC6e70E3c5fAcbdE5F7A9342d8), + ('nova', 'USDC', 0x750ba8b76187092B0D1E87E28daaf484d1b5273b), + ('nova', 'WBTC', 0x1d05e4e72cD994cdF976181CfB0707345763564d), + ('nova', 'DAI', 0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1), + ('nova', 'WETH', 0x722E8BdD2ce80A4422E880164f2079488e115365), + ('nova', 'ARB', 0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD) ) AS t (blockchain, symbol, contract_address) diff --git a/dbt_subprojects/tokens/models/tokens/tokens_schema.yml b/dbt_subprojects/tokens/models/tokens/_schema.yml similarity index 96% rename from dbt_subprojects/tokens/models/tokens/tokens_schema.yml rename to dbt_subprojects/tokens/models/tokens/_schema.yml index e3e5258f561..24973d74253 100644 --- a/dbt_subprojects/tokens/models/tokens/tokens_schema.yml +++ b/dbt_subprojects/tokens/models/tokens/_schema.yml @@ -3,11 +3,11 @@ version: 2 models: - name: tokens_erc20 meta: - blockchain: arbitrum, avalanche_c, bnb, ethereum, gnosis, mantle, optimism, fantom, polygon, base, blast, sepolia, sei + blockchain: arbitrum, avalanche_c, bnb, ethereum, gnosis, mantle, optimism, fantom, polygon, base, blast, sepolia, sei, nova sector: tokens contributors: hildobby, 0xManny, dot2dotseurat, soispoke, mtitus6, wuligy, angus_1, Henrystats, viniabussafi, jeff-dude config: - tags: ['tokens','erc20', 'arbitrum', 'avalanche_c', 'bnb', 'ethereum', 'gnosis', 'mantle', 'optimism', 'fantom', 'base', 'blast', 'sei'] + tags: ['tokens','erc20', 'arbitrum', 'avalanche_c', 'bnb', 'ethereum', 'gnosis', 'mantle', 'optimism', 'fantom', 'base', 'blast', 'sei', 'nova'] description: > Crosschain ERC20 tokens tests: diff --git a/dbt_subprojects/tokens/models/tokens/nova/_schema.yml b/dbt_subprojects/tokens/models/tokens/nova/_schema.yml new file mode 100644 index 00000000000..bfd8384bdb5 --- /dev/null +++ b/dbt_subprojects/tokens/models/tokens/nova/_schema.yml @@ -0,0 +1,21 @@ +version: 2 + +models: + - name: tokens_nova_erc20 + meta: + blockchain: nova + sector: tokens + project: erc20 + contributors: jeff-dude + config: + tags: ['table', 'erc20', 'nova'] + description: "ERC20 Token Addresses, Symbols and Decimals" + columns: + - name: contract_address + description: "ERC20 token contract address" + tests: + - unique + - name: symbol + description: "ERC20 token symbol" + - name: decimals + description: "Number of decimals, refers to how divisible an ERC20 token can be" diff --git a/dbt_subprojects/tokens/models/tokens/nova/tokens_nova_erc20.sql b/dbt_subprojects/tokens/models/tokens/nova/tokens_nova_erc20.sql new file mode 100644 index 00000000000..4d8929f619f --- /dev/null +++ b/dbt_subprojects/tokens/models/tokens/nova/tokens_nova_erc20.sql @@ -0,0 +1,20 @@ +{{ + config( + schema = 'tokens_nova' + ,alias = 'erc20' + ,tags = ['static'] + ,materialized = 'table' + ) +}} + +SELECT + contract_address + , symbol + , decimals +FROM (VALUES + (0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD, 'ARB', 18) + , (0x750ba8b76187092B0D1E87E28daaf484d1b5273b, 'USDC', 6) + , (0x1d05e4e72cD994cdF976181CfB0707345763564d, 'WBTC', 8) + , (0x722E8BdD2ce80A4422E880164f2079488e115365, 'WETH', 18) + , (0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1, 'DAI', 18) +) AS temp_table (contract_address, symbol, decimals) \ No newline at end of file diff --git a/dbt_subprojects/tokens/models/tokens/tokens_erc20.sql b/dbt_subprojects/tokens/models/tokens/tokens_erc20.sql index 4f5d73f0de8..fa5d8aac7b9 100644 --- a/dbt_subprojects/tokens/models/tokens/tokens_erc20.sql +++ b/dbt_subprojects/tokens/models/tokens/tokens_erc20.sql @@ -3,7 +3,7 @@ schema = 'tokens' ,alias = 'erc20' ,materialized = 'table' - ,post_hook='{{ expose_spells(\'["arbitrum","avalanche_c","base","bnb","celo","ethereum","fantom","fuse","gnosis","goerli","mantle","optimism","polygon","scroll","zkevm","zksync","zora","blast","sepolia","sei"]\', + ,post_hook='{{ expose_spells(\'["arbitrum","avalanche_c","base","bnb","celo","ethereum","fantom","fuse","gnosis","goerli","mantle","optimism","polygon","scroll","zkevm","zksync","zora","blast","sepolia","sei","nova"]\', "sector", "tokens", \'["bh2smith","0xManny","hildobby","soispoke","dot2dotseurat","mtitus6","wuligy","lgingerich","0xRob","jeff-dude","viniabussafi","IrishLatte19","angus_1","Henrystats"]\') }}' @@ -36,6 +36,7 @@ ,'tokens_blast': {'blockchain': 'blast', 'model': ref('tokens_blast_erc20')} ,'tokens_sepolia': {'blockchain': 'sepolia', 'model': ref('tokens_sepolia_erc20')} ,'tokens_sei': {'blockchain': 'sei', 'model': ref('tokens_sei_erc20')} + ,'tokens_nova': {'blockchain': 'nova', 'model': ref('tokens_nova_erc20')} } %} with diff --git a/sources/_base_sources/nova_base_sources.yml b/sources/_base_sources/nova_base_sources.yml new file mode 100644 index 00000000000..851d570cfee --- /dev/null +++ b/sources/_base_sources/nova_base_sources.yml @@ -0,0 +1,382 @@ +version: 2 + +sources: + # Base Tables + - name: nova + description: "Nova raw tables including transactions, traces and logs" + tables: + - name: transactions + description: "A Nova transaction refers to an action initiated by an externally-owned account (i.e., an account managed by a human, not a contract)." + columns: + - &block_time + name: block_time + description: "Timestamp for block event time in UTC" + - &block_number + name: block_number + - &value + name: value + description: "Amount of asset transferred from sender to recipient" + - name: gas_limit + description: "Maximum amount of gas units that can be consumed by the transaction" + - name: gas_price + description: "Gas price denoted in gwei, which itself is a denomination of ETH - each gwei is equal to 10-9 ETH" + - name: gas_used + description: "Number of gas units consumed by the transaction" + - name: max_fee_per_gas + description: "Maximum amount of gas willing to be paid for the transaction" + - name: max_priority_fee_per_gas + description: "Maximum amount of gas to be included as a tip to the miner" + - name: priority_fee_per_gas + description: "Market price for gas" + - name: nonce + description: "Number of confirmed transactions previously sent by this account" + - name: index + description: "Transaction index" + - &success + name: success + description: "Whether the transaction was completed successfully" + - &from + name: from + description: "Wallet address that initiated the transaction" + - &to + name: to + description: "Wallet address that received the transaction" + - &block_hash + name: block_hash + description: "Primary key of the block" + - name: data + description: "Any binary data payload" + - name: hash + description: "Primary key of the transaction" + tests: + - unique + - not_null + - name: type + description: "Transaction type" + - name: access_list + description: "Specifies a list of addresses and storage keys" + - name: chain_id + - &block_date + name: block_date + description: "Block event date in UTC" + + - name: traces + description: "A Nova trace is a small atomic action that modify the internal state of the Ethereum Virtual Machine. The three main trace types are call, create, and suicide." + columns: + - *block_time + - *block_number + - *value + - name: gas + description: "Amount of gas consumed by the trace" + - name: gas_used + description: "Number of gas units used by the trace" + - *block_hash + - name: success + description: "Whether the trace was completed successfully" + - &tx_index + name: tx_index + - &tx_from + name: tx_from + - &tx_to + name: tx_to + - name: subtraces + description: "Number of subtraces (i.e, number of calls at a particular level within a transaction)" + - name: error + description: "Error log" + - name: tx_success + description: "Whether the transaction was completed sucessfully" + - &tx_hash + name: tx_hash + description: "Primary key of the transaction" + - name: from + description: "Wallet address that initiated the trace" + - name: to + description: "Wallet address that received the trace" + - name: trace_address + description: "All returned traces, gives the exact location in the call trace" + - name: type + description: "Type of trace (e.g., call, create, suicide)" + - name: address + description: "Address of the trace creator" + - name: code + description: "Raw EVM code for the trace" + - name: call_type + description: "Hexadecimal representations of the trace's call type" + - name: input + description: "Input data for the trace" + - name: output + description: "Output data for the trace" + - name: refund_address + - name: revert_reason + - *block_date + + - name: logs + description: "A Base log can be used to describe an event within a smart contract, like a token transfer or a change of ownership." + columns: + - *block_time + - *block_number + - *block_hash + - name: contract_address + description: "Address of the Base smart contract generating the log" + - name: topic0 + description: "Topics are 32-byte (256 bit) “words” that are used to describe what’s going on in an event. The first topic usually consists of the signature of the name of the event that occurred, including the types (uint256, string, etc.) of its parameters." + - name: topic1 + description: "Second topic" + - name: topic2 + description: "Third topic" + - name: topic3 + description: "Fourth topic" + - name: data + description: "Additional data for the log. Data is not searchable (while topics are), but is a lot cheaper and can include large or complicated data like arrays or strings." + - *tx_hash + - name: index + description: "Log index" + - *tx_index + - *block_date + - *tx_from + - *tx_to + + - name: blocks + description: "Blocks are batches of transactions with a hash of the previous block in the chain. This links blocks together (in a chain) because hashes are cryptographically derived from the block data." + columns: + - name: time + - name: number + - name: gas_limit + - name: gas_used + - name: difficulty + - name: total_difficulty + - name: size + - name: base_fee_per_gas + - name: hash + - name: parent_hash + - name: miner + - name: nonce + - name: state_root + - name: transactions_root + - name: receipts_root + - name: date + + - name: contracts + description: "A view keeping track of what contracts are decoded on Dune on Nova; contains information associated with the decoded contract such as namespace, name, address, ABI." + columns: + - name: abi_id + - name: abi + description: "ABI of the decoded contract" + - name: address + description: "Address of the decoded contract" + - name: from + description: "Address that created/deployed this contract" + - name: code + description: "Code for contract creation" + - name: name + description: "Name of the decoded contract" + - name: namespace + description: "Namesapce of the decoded contract" + - name: dynamic + description: "Boolean indicating whether the contract is dynamic or not" + - name: base + description: "Boolean indicating whether the contract is the Nova contract or not" + - name: factory + description: "Boolean indicating whether the contract is a factory contract or not" + - name: detection_source + description: "Detection source: 'factory', 'base', or 'dynamic'" + tests: + - accepted_values: + values: ["factory", "base", "dynamic"] + - name: created_at + description: "Timestamp for contract creation" + + - name: creation_traces + description: "Nova creation traces" + columns: + - *block_time + - *block_number + - *tx_hash + - name: address + description: "Contract address created" + - name: from + description: "Contract creator address" + - name: code + description: "Contract code" + - name: block_month + + # ERC Transfer Tables + - name: erc20_nova + description: "Transfers events for ERC20 tokens on Nova." + tables: + - name: evt_transfer + description: "Transfers events for ERC20 tokens on Nova." + columns: + - name: contract_address + description: "ERC20 token contract address" + - &evt_tx_hash + name: evt_tx_hash + description: "Transaction hash of the event" + - &evt_tx_from + name: evt_tx_from + - &evt_tx_to + name: evt_tx_to + - &evt_tx_index + name: evt_tx_index + - &evt_index + name: evt_index + - &evt_block_time + name: evt_block_time + description: "Timestamp for block event time in UTC" + - &evt_block_number + name: evt_block_number + - &evt_block_date + name: evt_block_date + - *from + - *to + - name: value + description: "Amount of ERC20 token transferred" + + - name: evt_approval + description: "Approval events for ERC20 tokens on Nova." + columns: + - name: contract_address + description: "ERC20 token contract address" + - *evt_tx_hash + - *evt_tx_from + - *evt_tx_to + - *evt_tx_index + - *evt_index + - *evt_block_time + - *evt_block_number + - *evt_block_date + - &owner + name: owner + - &spender + name: spender + - *value + + - name: erc1155_nova + description: "Transfers events for ERC1155 tokens on Nova." + tables: + - name: evt_transfersingle + description: "Single transfers events for ERC1155 tokens on Nova." + columns: + - name: contract_address + description: "ERC1155 token contract address" + - *evt_tx_hash + - *evt_tx_from + - *evt_tx_to + - *evt_tx_index + - *evt_index + - *evt_index + - *evt_block_time + - *evt_block_number + - *evt_block_date + - *from + - name: id + description: "ERC1155 token ID" + - name: operator + description: "Addresses authorized (or approved) by a NFT owner to spend all of his token IDs." + - *to + - name: value + description: "Amount of ERC1155 token transferred" + + - name: evt_transferbatch + description: "Batch transfers events for ERC1155 tokens on Nova." + columns: + - name: contract_address + description: "ERC1155 token contract address" + - *evt_tx_hash + - *evt_tx_from + - *evt_tx_to + - *evt_tx_index + - *evt_index + - *evt_index + - *evt_block_time + - *evt_block_number + - *evt_block_date + - *from + - name: ids + description: "ERC1155 token IDs" + - name: operator + description: "Addresses authorized (or approved) by a NFT owner to spend all of his token IDs." + - *to + - name: values + description: "Amounts of ERC1155 token transferred" + + - name: evt_ApprovalForAll + description: "Approval for all events for ERC1155 tokens on Nova." + columns: + - name: contract_address + description: "ERC1155 token contract address" + - *evt_tx_hash + - *evt_tx_from + - *evt_tx_to + - *evt_tx_index + - *evt_index + - *evt_index + - *evt_block_time + - *evt_block_number + - *evt_block_date + - name: account + description: "Account" + - &approved + name: approved + description: "Is approved" + - &operator + name: operator + description: "Opperator" + + - name: erc721_nova + description: "Transfers events for ERC721 tokens on Nova." + tables: + - name: evt_transfer + description: "Transfers events for ERC721 tokens on Nova." + columns: + - name: contract_address + description: "ERC721 token contract address" + - *evt_tx_hash + - *evt_tx_from + - *evt_tx_to + - *evt_tx_index + - *evt_index + - *evt_index + - *evt_block_time + - *evt_block_number + - *evt_block_date + - *from + - *to + - name: tokenId + description: "ERC721 token ID." + + - name: evt_approval + description: "Approval events for ERC721 tokens on Nova." + columns: + - name: contract_address + description: "ERC721 token contract address" + - *evt_tx_hash + - *evt_tx_from + - *evt_tx_to + - *evt_tx_index + - *evt_index + - *evt_index + - *evt_block_time + - *evt_block_number + - *evt_block_date + - *approved + - *owner + - name: tokenId + description: "ERC721 token ID." + + - name: evt_ApprovalForAll + description: "Approval for all events for ERC721 tokens on Nova." + columns: + - name: contract_address + description: "ERC721 token contract address" + - *evt_tx_hash + - *evt_tx_from + - *evt_tx_to + - *evt_tx_index + - *evt_index + - *evt_index + - *evt_block_time + - *evt_block_number + - *evt_block_date + - *approved + - *operator From d9ec3cb2aa01d74932c4ccbb05be1b75314c2e7f Mon Sep 17 00:00:00 2001 From: Rantum Date: Tue, 6 Aug 2024 12:20:21 -0700 Subject: [PATCH 10/12] ZeroEx - add tag to deduped trades model (#6505) * initial Socialtokens view * Rename socialTokens to socialtokens.sql * Addded new tokens to list * Update socialtokens.sql * rmv social tokens file * add zeroex to dex_aggregator.trades * remove old branches * reset profiles.yml * remove * save * schema * undo trnsfesr changes * add zids to chain models and combined model * separate combined model to v1 / settler --- .../zeroex_arbitrum_settler_trades.sql | 1 + .../zeroex_avalanche_c_settler_trades.sql | 1 + .../base/zeroex_base_settler_trades.sql | 1 + .../zeroex/bnb/zeroex_bnb_settler_trades.sql | 1 + .../zeroex_ethereum_settler_trades.sql | 1 + .../zeroex_optimism_settler_trades.sql | 1 + .../polygon/zeroex_polygon_settler_trades.sql | 1 + .../zeroex/zeroex_api_fills_deduped.sql | 45 ++++++++++++++++++- 8 files changed, 51 insertions(+), 1 deletion(-) diff --git a/dbt_subprojects/dex/models/_projects/zeroex/arbitrum/zeroex_arbitrum_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/arbitrum/zeroex_arbitrum_settler_trades.sql index 108506c25a4..9f43b83dcc9 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/arbitrum/zeroex_arbitrum_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/arbitrum/zeroex_arbitrum_settler_trades.sql @@ -288,6 +288,7 @@ results_usd AS ( THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, maker, tag, + zid, tx_hash, tx_from, tx_to, diff --git a/dbt_subprojects/dex/models/_projects/zeroex/avalanche_c/zeroex_avalanche_c_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/avalanche_c/zeroex_avalanche_c_settler_trades.sql index 25717efbded..79e945f2723 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/avalanche_c/zeroex_avalanche_c_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/avalanche_c/zeroex_avalanche_c_settler_trades.sql @@ -288,6 +288,7 @@ results_usd AS ( THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, maker, tag, + zid, tx_hash, tx_from, tx_to, diff --git a/dbt_subprojects/dex/models/_projects/zeroex/base/zeroex_base_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/base/zeroex_base_settler_trades.sql index 712d5a4e0cc..1e8432bbd0b 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/base/zeroex_base_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/base/zeroex_base_settler_trades.sql @@ -288,6 +288,7 @@ results_usd AS ( THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, maker, tag, + zid, tx_hash, tx_from, tx_to, diff --git a/dbt_subprojects/dex/models/_projects/zeroex/bnb/zeroex_bnb_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/bnb/zeroex_bnb_settler_trades.sql index e57aeaf0a27..d55b5d7bc9f 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/bnb/zeroex_bnb_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/bnb/zeroex_bnb_settler_trades.sql @@ -290,6 +290,7 @@ results_usd AS ( THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, maker, tag, + zid, tx_hash, tx_from, tx_to, diff --git a/dbt_subprojects/dex/models/_projects/zeroex/ethereum/zeroex_ethereum_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/ethereum/zeroex_ethereum_settler_trades.sql index 63582db34d5..9d47858f093 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/ethereum/zeroex_ethereum_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/ethereum/zeroex_ethereum_settler_trades.sql @@ -290,6 +290,7 @@ results_usd AS ( THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, maker, tag, + zid, tx_hash, tx_from, tx_to, diff --git a/dbt_subprojects/dex/models/_projects/zeroex/optimism/zeroex_optimism_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/optimism/zeroex_optimism_settler_trades.sql index 4a397815b90..cc375f77354 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/optimism/zeroex_optimism_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/optimism/zeroex_optimism_settler_trades.sql @@ -290,6 +290,7 @@ results_usd AS ( THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, maker, tag, + zid, tx_hash, tx_from, tx_to, diff --git a/dbt_subprojects/dex/models/_projects/zeroex/polygon/zeroex_polygon_settler_trades.sql b/dbt_subprojects/dex/models/_projects/zeroex/polygon/zeroex_polygon_settler_trades.sql index e6b7a740eb6..efd880e20d3 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/polygon/zeroex_polygon_settler_trades.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/polygon/zeroex_polygon_settler_trades.sql @@ -290,6 +290,7 @@ results_usd AS ( THEN varbinary_substring(taker_indicator_string, 18,20) ELSE taker END AS taker, maker, tag, + zid, tx_hash, tx_from, tx_to, diff --git a/dbt_subprojects/dex/models/_projects/zeroex/zeroex_api_fills_deduped.sql b/dbt_subprojects/dex/models/_projects/zeroex/zeroex_api_fills_deduped.sql index 67797d869f6..581f0c8f66e 100644 --- a/dbt_subprojects/dex/models/_projects/zeroex/zeroex_api_fills_deduped.sql +++ b/dbt_subprojects/dex/models/_projects/zeroex/zeroex_api_fills_deduped.sql @@ -19,7 +19,10 @@ ,ref('zeroex_optimism_api_fills_deduped') ,ref('zeroex_polygon_api_fills_deduped') ,ref('zeroex_bnb_api_fills_deduped') - ,ref('zeroex_ethereum_settler_trades') +] %} + +{% set settler_models = [ + ref('zeroex_ethereum_settler_trades') ,ref('zeroex_base_settler_trades') ,ref('zeroex_polygon_settler_trades') ,ref('zeroex_optimism_settler_trades') @@ -56,6 +59,46 @@ FROM ( ,tx_to ,trace_address ,evt_index + ,affiliate_address + ,null as zid + FROM {{ model }} + {% if not loop.last %} + UNION ALL + {% endif %} + {% endfor %} +) + +UNION ALL + +SELECT * +FROM ( + {% for model in settler_models %} + SELECT + blockchain + ,version + ,block_month + ,block_date + ,block_time + ,maker_symbol + ,taker_symbol + ,token_pair + ,maker_token_amount + ,taker_token_amount + ,maker_token_amount_raw + ,taker_token_amount_raw + ,volume_usd + ,maker_token + ,taker_token + ,taker + ,maker + ,contract_address + ,tx_hash + ,tx_from + ,tx_to + ,trace_address + ,evt_index + ,tag as affiliate_address + ,zid FROM {{ model }} {% if not loop.last %} UNION ALL From 25ffd7da6fa0c093d9c48d90a050924448c38d9a Mon Sep 17 00:00:00 2001 From: Andrew <47720952+andrewhong5297@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:21:03 -0400 Subject: [PATCH 11/12] Solana staking improvements (#6496) * init commit * fix? * add * blocks * fix * bleh * ... * fixes * fix again * raw fix * remove predicates * add bal tracking * update * fix fix * add intermediary table because of memory limits * inc * l * max by * smaller memory? * comment * fix * fix * get next epoch start block instead of end block slot * add vote identities * add source * remove to other branch * remove base * Update solana_utils_epochs.sql * rerun * final tweaks * remove target filters for incrmental --------- Co-authored-by: jeff-dude --- .../models/_sector/staking/solana/_schema.yml | 113 ++++++++++++++++++ .../staking/solana/staking_solana_schema.yml | 39 ------ ...aking_solana_stake_account_delegations.sql | 77 ++++++++++++ ..._solana_validator_stake_account_epochs.sql | 30 +++++ ...ana_validator_stake_account_epochs_raw.sql | 39 ++++++ .../{solana_utils_schema.yml => _schema.yml} | 21 +++- .../solana_utils/solana_utils_epochs.sql | 44 +++++++ sources/_base_sources/solana_base_sources.yml | 2 + .../staking/solana/staking_solana_sources.yml | 4 + 9 files changed, 329 insertions(+), 40 deletions(-) create mode 100644 dbt_subprojects/solana/models/_sector/staking/solana/_schema.yml delete mode 100644 dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_schema.yml create mode 100644 dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_stake_account_delegations.sql create mode 100644 dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_validator_stake_account_epochs.sql create mode 100644 dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_validator_stake_account_epochs_raw.sql rename dbt_subprojects/solana/models/solana_utils/{solana_utils_schema.yml => _schema.yml} (82%) create mode 100644 dbt_subprojects/solana/models/solana_utils/solana_utils_epochs.sql diff --git a/dbt_subprojects/solana/models/_sector/staking/solana/_schema.yml b/dbt_subprojects/solana/models/_sector/staking/solana/_schema.yml new file mode 100644 index 00000000000..05d323714a6 --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/staking/solana/_schema.yml @@ -0,0 +1,113 @@ +version: 2 + +models: + - name: staking_solana_stake_actions + meta: + blockchain: solana + sector: staking + contributors: ilemi + config: + tags: ['solana', 'staking', 'actions'] + description: Solana Stake11111 program actions + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_time + - call_tx_id + - source + - destination + - stake + - authority + - call_outer_instruction_index + columns: + - name: stake + description: amount in stake moved + tests: + - not_null + - name: action + description: withdraw, merge, or split stake + - name: source + description: the account SOL was moved to + - name: destination + description: the account SOL was moved from + - name: authority + description: the account that owns the stake account + - name: block_slot + - name: block_time + - name: outer_instruction_index + - name: inner_instruction_index + - name: tx_id + - name: staking_solana_stake_account_delegations + meta: + blockchain: solana + sector: staking + contributors: ilemi + config: + tags: ['solana', 'staking', 'delegate'] + description: Solana stake account vote delegations over time + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - block_time + - block_slot + - stake_account + - vote_account + columns: + - name: stake_account + description: the stake account address + - name: vote_account + description: the vote account address being delegated to + - name: block_time + - name: block_slot + + - name: staking_solana_validator_stake_account_epochs_raw + meta: + blockchain: solana + sector: staking + contributors: ilemi + config: + tags: ['solana', 'staking', 'delegate'] + description: Solana validator stake accounts delegated for each epoch (includes only accounts delegated BEFORE epoch started) + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - epoch + - epoch_time + - stake_account + - vote_account + columns: + - name: stake_account + description: the stake account address + - name: vote_account + description: the vote account address being delegated to + - name: epoch + - name: epoch_time + - name: epoch_start_slot + - name: epoch_next_start_slot + + - name: staking_solana_validator_stake_account_epochs + meta: + blockchain: solana + sector: staking + contributors: ilemi + config: + tags: ['solana', 'staking', 'delegate'] + description: Solana validator stake accounts delegated for each epoch (includes only accounts delegated BEFORE epoch started) + tests: + - dbt_utils.unique_combination_of_columns: + combination_of_columns: + - epoch + - epoch_time + - stake_account + - vote_account + columns: + - name: stake_account + description: the stake account address + - name: vote_account + description: the vote account address being delegated to + - name: sol_balance + description: the SOL balance of the stake account at the start of the epoch + - name: epoch + - name: epoch_time + - name: epoch_start_slot + - name: epoch_next_start_slot \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_schema.yml b/dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_schema.yml deleted file mode 100644 index b513858c229..00000000000 --- a/dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_schema.yml +++ /dev/null @@ -1,39 +0,0 @@ -version: 2 - -models: - - name: staking_solana_stake_actions - meta: - blockchain: solana - sector: staking - contributors: ilemi - config: - tags: ['solana', 'staking', 'actions'] - description: Solana Stake11111 program actions - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - block_time - - call_tx_id - - source - - destination - - stake - - authority - - call_outer_instruction_index - columns: - - name: stake - description: amount in stake moved - tests: - - not_null - - name: action - description: withdraw, merge, or split stake - - name: source - description: the account SOL was moved to - - name: destination - description: the account SOL was moved from - - name: authority - description: the account that owns the stake account - - name: block_slot - - name: block_time - - name: outer_instruction_index - - name: inner_instruction_index - - name: tx_id \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_stake_account_delegations.sql b/dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_stake_account_delegations.sql new file mode 100644 index 00000000000..890f4b242fa --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_stake_account_delegations.sql @@ -0,0 +1,77 @@ +{{ config( + schema = 'staking_solana' + , alias = 'stake_account_delegations' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['block_time', 'block_slot', 'stake_account', 'vote_account'] + , post_hook='{{ expose_spells(\'["solana"]\', + "sector", + "staking", + \'["ilemi"]\') }}') +}} + +with + all_delegates as ( + --get all stake accounts, and get all of the vote accounts they have been delegated to over time + SELECT + distinct + account_stakeAccount + , account_voteAccount + , call_block_time + , call_block_slot + FROM ( + SELECT + account_stakeAccount + , account_voteAccount + , COALESCE(call_block_time, timestamp '1990-01-01 00:00:00') as call_block_time --fill in nulls, at a fake earlier date than split thing below + , call_block_slot + FROM {{ source ('stake_program_solana','stake_call_DelegateStake') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('call_block_time')}} + {% endif %} + + UNION ALL + + --SPLIT creates a new account, but copies vote delegation from original. We get that and also look for the latest delegation of the account. + SELECT + a.destination as account_stakeAccount + , COALESCE(del.account_voteAccount, old_vote.account_voteAccount) as account_voteAccount + , COALESCE(del.call_block_time, old_vote.call_block_time) as call_block_time + , COALESCE(del.call_block_slot, old_vote.call_block_slot) as call_block_slot + FROM {{ ref('staking_solana_stake_actions') }} a + --get inherited vote account + LEFT JOIN (SELECT + source + , del.account_voteAccount + , del.filled_block_time as call_block_time --fill in nulls with fake date + , del.filled_block_slot as call_block_slot + FROM {{ ref('staking_solana_stake_actions') }} a + LEFT JOIN (SELECT * + , COALESCE(call_block_time, timestamp '2000-01-01 00:00:00') as filled_block_time + , call_block_slot as filled_block_slot + FROM {{ source ('stake_program_solana','stake_call_DelegateStake') }} + ) del + ON del.account_stakeAccount = a.source + AND del.filled_block_time <= a.block_time + WHERE action = 'split' + ) as old_vote + ON old_vote.source = a.source --get source of split's delegated validator + AND old_vote.call_block_time <= a.block_time --before the split, not after + --get newly delegated vote accounts. some will still having missing vote accounts because of multiple splits - should have some sort of recursive split detection in the future. + LEFT JOIN {{ source ('stake_program_solana','stake_call_DelegateStake') }} del ON del.account_stakeAccount = a.destination + WHERE a.action = 'split' + {% if is_incremental() %} + and {{incremental_predicate('a.block_time')}} + {% endif %} + ) + ) + +SELECT + distinct + account_stakeAccount as stake_account + , account_voteAccount as vote_account + , call_block_time as block_time + , call_block_slot as block_slot +FROM all_delegates +WHERE account_voteAccount is not null --see note about split recursion above for why there are nulls \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_validator_stake_account_epochs.sql b/dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_validator_stake_account_epochs.sql new file mode 100644 index 00000000000..f3adfd2b2e3 --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_validator_stake_account_epochs.sql @@ -0,0 +1,30 @@ +{{ config( + schema = 'staking_solana' + , alias = 'validator_stake_account_epochs' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['epoch', 'epoch_time', 'stake_account', 'vote_account'] + , incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.epoch_time')] + , post_hook='{{ expose_spells(\'["solana"]\', + "sector", + "staking", + \'["ilemi"]\') }}') +}} + +SELECT + b.epoch + , b.epoch_time + , b.epoch_start_slot + , b.epoch_next_start_slot + , b.stake_account + , b.vote_account + , max_by(bal.sol_balance, bal.day) as sol_balance +FROM {{ ref('staking_solana_validator_stake_account_epochs_raw')}} b +LEFT JOIN {{ ref('solana_utils_daily_balances')}} bal ON bal.address = b.stake_account + AND bal.token_mint_address is null + AND bal.day <= date_trunc('day', b.epoch_time) +{% if is_incremental() %} +WHERE {{incremental_predicate('b.epoch_time')}} +{% endif %} +GROUP BY 1,2,3,4,5,6 \ No newline at end of file diff --git a/dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_validator_stake_account_epochs_raw.sql b/dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_validator_stake_account_epochs_raw.sql new file mode 100644 index 00000000000..ff6dd1975a6 --- /dev/null +++ b/dbt_subprojects/solana/models/_sector/staking/solana/staking_solana_validator_stake_account_epochs_raw.sql @@ -0,0 +1,39 @@ +{{ config( + schema = 'staking_solana' + , alias = 'validator_stake_account_epochs_raw' + , materialized = 'incremental' + , file_format = 'delta' + , incremental_strategy = 'merge' + , unique_key = ['epoch', 'epoch_time', 'stake_account', 'vote_account'] +) +}} + +--don't expose this table in DE +with + base as ( + SELECT + epoch.epoch + , epoch.block_time as epoch_time + , epoch.epoch_start_slot + , epoch.epoch_next_start_slot + , vote.stake_account + , max_by(vote.vote_account, vote.block_time) as vote_account --latest delegated vote before epoch started. then get the rewards from accounts per epoch. + FROM {{ ref('staking_solana_stake_account_delegations') }} vote + LEFT JOIN {{ ref('solana_utils_epochs') }} epoch + ON first_block_epoch = true --cross join + {% if is_incremental() %} + AND {{incremental_predicate('epoch.block_time')}} + {% endif %} + WHERE vote.block_slot < epoch.block_slot --only get changes to accounts before start of epoch + GROUP BY 1,2,3,4,5 + ) + +SELECT + epoch + , epoch_time + , epoch_start_slot + , epoch_next_start_slot + , stake_account + , vote_account +FROM base +WHERE vote_account is not null \ No newline at end of file diff --git a/dbt_subprojects/solana/models/solana_utils/solana_utils_schema.yml b/dbt_subprojects/solana/models/solana_utils/_schema.yml similarity index 82% rename from dbt_subprojects/solana/models/solana_utils/solana_utils_schema.yml rename to dbt_subprojects/solana/models/solana_utils/_schema.yml index 710076b9650..5d8df5400cf 100644 --- a/dbt_subprojects/solana/models/solana_utils/solana_utils_schema.yml +++ b/dbt_subprojects/solana/models/solana_utils/_schema.yml @@ -18,7 +18,26 @@ models: name: account_type - &updated_at name: updated_at - + + - name: solana_utils_epochs + meta: + blockchain: solana + contributors: [ilemi] + config: + tags: ['solana','epoch'] + description: > + epochs by block slot (432000 slots per epoch) + columns: + - name: block_time + - name: block_slot + tests: + - unique + - name: epoch + - name: first_block_epoch + - name: epoch_progress + - name: epoch_start_slot + - name: epoch_next_start_slot + - name: solana_utils_daily_balances meta: blockchain: solana diff --git a/dbt_subprojects/solana/models/solana_utils/solana_utils_epochs.sql b/dbt_subprojects/solana/models/solana_utils/solana_utils_epochs.sql new file mode 100644 index 00000000000..746b78efa84 --- /dev/null +++ b/dbt_subprojects/solana/models/solana_utils/solana_utils_epochs.sql @@ -0,0 +1,44 @@ + {{ + config( + schema = 'solana_utils', + alias = 'epochs', + materialized='incremental', + file_format = 'delta', + incremental_strategy = 'merge', + unique_key = ['block_slot'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], + post_hook='{{ expose_spells(\'["solana"]\', + "sector", + "solana_utils", + \'["ilemi"]\') }}') +}} + +with + base as ( + SELECT + time as block_time + , slot as block_slot + , floor(cast(slot as double) / 432000) as epoch --round down to get current epoch slot + , row_number() over (partition by floor(cast(slot as double) / 432000) + order by slot asc) as first_block_epoch + , row_number() over (partition by floor(cast(slot as double) / 432000) + order by slot desc) as last_block_epoch + , slot % 432000 as epoch_progress --blocks into epoch. might not always start at 0 because of skipped block slots. remember "height" shows actual non-skipped blocks but epoch follows total blocks. + FROM {{ source('solana','blocks') }} + {% if is_incremental() %} + WHERE {{incremental_predicate('time')}} + {% endif %} + ) + +SELECT + b.block_time + , b.block_slot + , b.epoch + , case when b.first_block_epoch = 1 then true else false end as first_block_epoch + , b.epoch_progress + , start.block_slot as epoch_start_slot + , next.block_slot as epoch_next_start_slot +FROM base b +LEFT JOIN base start ON start.epoch = b.epoch AND start.first_block_epoch = 1 +LEFT JOIN base next ON next.epoch = b.epoch + 1 AND next.first_block_epoch = 1 +order by block_time desc \ No newline at end of file diff --git a/sources/_base_sources/solana_base_sources.yml b/sources/_base_sources/solana_base_sources.yml index a357fc41507..2c69f264bdf 100644 --- a/sources/_base_sources/solana_base_sources.yml +++ b/sources/_base_sources/solana_base_sources.yml @@ -7,6 +7,8 @@ sources: freshness: warn_after: { count: 12, period: hour } tables: + - name: blocks + loaded_at_field: time - name: transactions loaded_at_field: block_time description: "A Solana transaction contains a compact-array of signatures, followed by a message. Each item in the signatures array is a digital signature of the given message.." diff --git a/sources/staking/solana/staking_solana_sources.yml b/sources/staking/solana/staking_solana_sources.yml index 61da4aecc10..902fb0a5048 100644 --- a/sources/staking/solana/staking_solana_sources.yml +++ b/sources/staking/solana/staking_solana_sources.yml @@ -13,4 +13,8 @@ sources: - name: stake_call_Withdraw loaded_at_field: evt_block_time - name: stake_call_Split + loaded_at_field: evt_block_time + - name: stake_call_Initialize + loaded_at_field: evt_block_time + - name: stake_call_InitializeChecked loaded_at_field: evt_block_time \ No newline at end of file From e742a6f432da81f0aef7931f02c0d16e086cb2c9 Mon Sep 17 00:00:00 2001 From: jeff-dude <102681548+jeff-dude@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:58:54 -0400 Subject: [PATCH 12/12] remove mantle for now (#6517) --- .../daily_spellbook/models/_sector/gas/fees/gas_fees.sql | 6 ++++-- .../models/_sector/gas/fees/mantle/gas_mantle_fees.sql | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees.sql index a6546623b79..4a56318c3ab 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees.sql +++ b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/gas_fees.sql @@ -17,10 +17,12 @@ 'gas_zksync_fees', 'gas_zora_fees', 'gas_base_fees', - 'gas_scroll_fees', - 'gas_mantle_fees' + 'gas_scroll_fees' ] %} +--remove mantle for now: + --'gas_mantle_fees' + SELECT * FROM ( {% for gas_model in gas_fees_models %} diff --git a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql index 8b2b8f0d10d..2406235eff9 100644 --- a/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql +++ b/dbt_subprojects/daily_spellbook/models/_sector/gas/fees/mantle/gas_mantle_fees.sql @@ -1,4 +1,5 @@ {{ config( + tags = ['prod_exclude'], schema = 'gas_mantle', alias = 'fees', partition_by = ['block_month'],