From 6623a042f307c40433b9e5affdfef8a5633d3269 Mon Sep 17 00:00:00 2001 From: drethereum <71602799+drethereum@users.noreply.github.com> Date: Thu, 8 May 2025 13:54:57 -0600 Subject: [PATCH] AN-5991/op-migration (#340) * streamline bronze * silver models * gold tables * docs, gha * bronze folders * macros * make file, packages, project yml, delete tests * remove silver nft transfers ref * sources * macro tests * update for fsc-evm changes - package, makefile, sources, dbt_project, workflows, docs * gold tags * add ethereum models back in * silver bridge tags * dex tags * lending tags * nft tags * added back protocols folder and tagged * temp package * docs * docs * wh * observability exclusions * 48 * v51 * 52 * 53 --------- Co-authored-by: sam --- .github/workflows/dbt_alter_all_gha_tasks.yml | 27 + .github/workflows/dbt_alter_gha_task.yml | 53 -- .github/workflows/dbt_alter_gha_tasks.yml | 32 + .../workflows/dbt_deploy_new_workflows.yml | 19 + .github/workflows/dbt_docs_update.yml | 71 +-- .github/workflows/dbt_integration_test.yml | 31 +- .github/workflows/dbt_run_abi_refresh.yml | 56 -- .github/workflows/dbt_run_adhoc.yml | 61 +- .github/workflows/dbt_run_dev_refresh.yml | 77 +-- .../workflows/dbt_run_full_observability.yml | 53 +- .github/workflows/dbt_run_heal_models.yml | 53 +- .github/workflows/dbt_run_operation_reorg.yml | 59 -- .../workflows/dbt_run_overflowed_traces.yml | 51 -- .github/workflows/dbt_run_scheduled_abis.yml | 22 + .../workflows/dbt_run_scheduled_curated.yml | 46 +- .../workflows/dbt_run_scheduled_decoder.yml | 19 + .github/workflows/dbt_run_scheduled_main.yml | 19 + .../dbt_run_scheduled_non_realtime.yml | 51 -- .../workflows/dbt_run_scheduled_scores.yml | 20 + .../dbt_run_streamline_chainhead.yml | 51 +- ...bt_run_streamline_decoded_logs_history.yml | 56 -- .../workflows/dbt_run_streamline_decoder.yml | 51 -- .../dbt_run_streamline_decoder_history.yml | 22 + .../workflows/dbt_run_streamline_history.yml | 19 + .../dbt_run_streamline_history_adhoc.yml | 77 --- .github/workflows/dbt_test_daily.yml | 59 +- .github/workflows/dbt_test_intraday.yml | 51 +- .github/workflows/dbt_test_monthly.yml | 57 +- .github/workflows/slack_notify.yml | 27 - Makefile | 111 +++- data/github_actions__workflows.csv | 8 - data/observability__exclusion_list.csv | 11 + dbt_project.yml | 135 ++-- macros/create_udfs.sql | 13 +- macros/dbt/incremental_predicates.sql | 22 - macros/decoder/decoded_logs_history.sql | 124 ---- macros/decoder/run_decoded_logs_history.sql | 29 - ...eamline_external_table_queries_decoder.sql | 101 --- .../streamline_external_table_queries.sql | 141 ----- .../main_package/logging/bronze.sql | 36 -- .../main_package/logging/complete.sql | 29 - .../main_package/logging/logging.sql | 36 -- .../main_package/logging/requests.sql | 55 -- .../streamline/set_default_variables.sql | 47 -- .../streamline/set_streamline_parameters.sql | 57 -- macros/streamline/api_integrations.sql | 25 - macros/streamline/get_base_table_udft.sql | 23 - macros/streamline/streamline_udfs.sql | 42 -- macros/tests/missing_decoding.sql | 26 - macros/tests/missing_txs.sql | 124 ---- macros/utils.sql | 78 --- models/bronze/api_udf/_retry_abis.sql | 88 --- .../api_udf/bronze_api__contract_abis.sql | 79 --- .../api_udf/bronze_api__contract_abis.yml | 23 - .../api_udf/bronze_api__token_reads.sql | 130 ---- .../api_udf/bronze_api__token_reads.yml | 19 - .../{ethereum => }/bronze__state_hashes.sql | 4 +- .../bronze__submission_hashes.sql | 4 +- models/bronze/labels/bronze__labels.sql | 25 - .../overflow/bronze__overflowed_traces.sql | 80 --- .../bronze__potential_overflowed_traces.sql | 80 --- ...bronze__complete_native_asset_metadata.sql | 26 - .../prices/bronze__complete_native_prices.sql | 29 - ...onze__complete_provider_asset_metadata.sql | 29 - .../bronze__complete_provider_prices.sql | 24 - .../bronze__complete_token_asset_metadata.sql | 28 - .../prices/bronze__complete_token_prices.sql | 31 - .../doc_descriptions/L1_fields/batch_size.md | 5 - .../L1_fields/l1_batch_root.md | 5 - .../L1_fields/l1_block_number.md | 5 - .../L1_fields/l1_block_timestamp.md | 5 - .../L1_fields/l1_fee_scalar.md | 5 - .../L1_fields/l1_gas_price.md | 5 - .../doc_descriptions/L1_fields/l1_gas_used.md | 5 - .../L1_fields/l1_state_root_batch_index.md | 5 - .../L1_fields/l1_state_root_tx_hash.md | 5 - .../L1_fields/l1_submission_batch_index.md | 5 - .../L1_fields/l1_submission_tx_hash.md | 5 - .../L1_fields/op_max_block.md | 5 - .../L1_fields/op_min_block.md | 5 - .../L1_fields/prev_total_elements.md | 5 - .../blocks/opt_block_header_json.md | 5 - .../doc_descriptions/blocks/opt_blockchain.md | 5 - .../blocks/opt_blocks_hash.md | 5 - .../blocks/opt_blocks_nonce.md | 5 - .../blocks/opt_blocks_table_doc.md | 5 - .../doc_descriptions/blocks/opt_difficulty.md | 5 - .../doc_descriptions/blocks/opt_extra_data.md | 5 - .../doc_descriptions/blocks/opt_gas_limit.md | 5 - .../doc_descriptions/blocks/opt_gas_used.md | 5 - models/doc_descriptions/blocks/opt_miner.md | 5 - models/doc_descriptions/blocks/opt_network.md | 5 - .../blocks/opt_parent_hash.md | 5 - .../blocks/opt_receipts_root.md | 5 - .../blocks/opt_sha3_uncles.md | 5 - models/doc_descriptions/blocks/opt_size.md | 5 - .../blocks/opt_total_difficulty.md | 5 - .../doc_descriptions/blocks/opt_tx_count.md | 5 - .../blocks/opt_uncle_blocks.md | 5 - .../bridge/evm_bridge_activity.md | 83 --- .../complete_lending_column_docs.md | 381 ----------- .../complete_lending_table_docs.md | 36 -- .../op_contracts_contract_address.md | 5 - .../contracts/op_contracts_symbol.md | 5 - .../contracts/op_contracts_table_doc.md | 5 - .../delegations/delegation_delegation_type.md | 5 - .../delegations/delegation_delegator.md | 5 - .../delegations/delegation_from_delegate.md | 5 - .../delegations/delegation_to_delegate.md | 5 - .../delegations/opt_delegations_table_doc.md | 5 - .../eth_dex_creation_block.md | 5 - .../eth_dex_creation_time.md | 5 - .../eth_dex_creation_tx.md | 5 - .../eth_dex_factory_address.md | 5 - .../eth_dex_lp_decimals.md | 15 - .../eth_dex_lp_symbols.md | 15 - .../eth_dex_lp_table_doc.md | 5 - .../eth_dex_lp_tokens.md | 15 - .../eth_dex_platform.md | 5 - .../eth_dex_pool_address.md | 5 - .../eth_dex_pool_name.md | 5 - .../eth_dex_swaps_amount_in.md | 5 - .../eth_dex_swaps_amount_in_unadj.md | 5 - .../eth_dex_swaps_amount_in_usd.md | 5 - .../eth_dex_swaps_amount_out.md | 5 - .../eth_dex_swaps_amount_out_unadj.md | 5 - .../eth_dex_swaps_amount_out_usd.md | 5 - .../eth_dex_swaps_sender.md | 5 - .../eth_dex_swaps_symbol_in.md | 5 - .../eth_dex_swaps_symbol_out.md | 5 - .../eth_dex_swaps_token_In.md | 5 - .../eth_dex_swaps_token_out.md | 5 - .../eth_dex_swaps_tx_to.md | 5 - .../eth_dex_token0.md | 5 - .../eth_dex_token1.md | 5 - .../eth_dex_tokens.md | 5 - .../eth_ez_dex_swaps_table_doc.md | 6 - .../opt_sushi__ez_swaps.md | 6 - .../event_logs/opt_event_index.md | 5 - .../event_logs/opt_event_inputs.md | 5 - .../event_logs/opt_event_name.md | 5 - .../event_logs/opt_event_removed.md | 5 - .../event_logs/opt_event_sig.md | 5 - .../event_logs/opt_log_id_events.md | 5 - .../event_logs/opt_logs_contract_address.md | 5 - .../event_logs/opt_logs_contract_name.md | 5 - .../event_logs/opt_logs_data.md | 5 - .../event_logs/opt_logs_table_doc.md | 5 - .../event_logs/opt_logs_tx_hash.md | 5 - .../event_logs/opt_origin_from.md | 5 - .../event_logs/opt_origin_to.md | 5 - .../doc_descriptions/event_logs/opt_topics.md | 5 - .../fsc_evm/L1_submission_fields.md | 95 --- models/doc_descriptions/fsc_evm/blocks.md | 158 ----- .../fsc_evm/complete_general.md | 65 -- models/doc_descriptions/fsc_evm/event_logs.md | 95 --- .../fsc_evm/evm_deprecations.md | 246 -------- models/doc_descriptions/fsc_evm/nft.md | 595 ------------------ models/doc_descriptions/fsc_evm/traces.md | 136 ---- .../doc_descriptions/fsc_evm/transactions.md | 207 ------ models/doc_descriptions/fsc_evm/transfers.md | 167 ----- .../doc_descriptions/general/deprecation.md | 11 - .../general/export_columns.md | 19 - .../general/opt_block_number.md | 5 - .../general/opt_block_timestamp.md | 5 - .../doc_descriptions/general/opt_decimals.md | 5 - .../general/opt_from_address.md | 5 - .../general/opt_ingested_at.md | 5 - models/doc_descriptions/general/opt_symbol.md | 5 - .../general/opt_to_address.md | 5 - .../general/precise_amounts.md | 17 - models/doc_descriptions/labels/op_label.md | 5 - .../labels/op_label_address.md | 5 - .../labels/op_label_address_name.md | 5 - .../labels/op_label_blockchain.md | 5 - .../labels/op_label_creator.md | 5 - .../labels/op_label_subtype.md | 5 - .../doc_descriptions/labels/op_label_type.md | 5 - .../labels/op_labels_table_doc.md | 5 - .../labels/table_dim_labels.md | 5 - .../nft/nft_aggregator_name.md | 5 - models/doc_descriptions/nft/nft_block_no.md | 5 - models/doc_descriptions/nft/nft_blocktime.md | 5 - .../doc_descriptions/nft/nft_buyer_address.md | 5 - .../doc_descriptions/nft/nft_creator_fee.md | 5 - .../nft/nft_creator_fee_usd.md | 5 - .../nft/nft_currency_address.md | 5 - .../nft/nft_currency_symbol.md | 5 - .../doc_descriptions/nft/nft_erc1155_value.md | 5 - .../doc_descriptions/nft/nft_event_index.md | 5 - models/doc_descriptions/nft/nft_event_type.md | 5 - .../nft/nft_events_table_doc.md | 5 - .../doc_descriptions/nft/nft_from_address.md | 5 - .../nft/nft_intra_event_index.md | 5 - models/doc_descriptions/nft/nft_metadata.md | 5 - models/doc_descriptions/nft/nft_mint_count.md | 5 - models/doc_descriptions/nft/nft_mint_doc.md | 5 - models/doc_descriptions/nft/nft_mint_price.md | 5 - .../nft/nft_mint_price_usd.md | 5 - .../doc_descriptions/nft/nft_mints_symbol.md | 5 - .../nft/nft_mints_token_address.md | 5 - .../nft/nft_mints_token_price.md | 5 - .../nft/nft_mints_token_price_usd.md | 5 - .../doc_descriptions/nft/nft_nft_address.md | 5 - .../nft/nft_nft_from_address.md | 5 - .../nft/nft_nft_to_address.md | 5 - .../doc_descriptions/nft/nft_origin_from.md | 5 - models/doc_descriptions/nft/nft_origin_sig.md | 5 - models/doc_descriptions/nft/nft_origin_to.md | 5 - .../nft/nft_platform_address.md | 5 - .../nft/nft_platform_exchange_version.md | 5 - .../doc_descriptions/nft/nft_platform_fee.md | 5 - .../nft/nft_platform_fee_usd.md | 5 - .../doc_descriptions/nft/nft_platform_name.md | 5 - models/doc_descriptions/nft/nft_price.md | 5 - models/doc_descriptions/nft/nft_price_usd.md | 5 - .../doc_descriptions/nft/nft_project_name.md | 5 - .../nft/nft_seller_address.md | 5 - models/doc_descriptions/nft/nft_to_address.md | 5 - models/doc_descriptions/nft/nft_tokenid.md | 5 - models/doc_descriptions/nft/nft_total_fees.md | 5 - .../nft/nft_total_fees_usd.md | 5 - .../doc_descriptions/nft/nft_transfer_doc.md | 5 - models/doc_descriptions/nft/nft_tx_fee.md | 5 - models/doc_descriptions/nft/nft_tx_fee_usd.md | 5 - models/doc_descriptions/nft/nft_tx_hash.md | 5 - models/doc_descriptions/prices/prices.md | 143 ----- .../doc_descriptions/stats/evm_stats_core.md | 71 --- .../traces/opt_traces_block_no.md | 5 - .../traces/opt_traces_blocktime.md | 5 - .../traces/opt_traces_call_data.md | 5 - .../traces/opt_traces_from.md | 5 - .../doc_descriptions/traces/opt_traces_gas.md | 5 - .../traces/opt_traces_gas_used.md | 5 - .../traces/opt_traces_identifier.md | 5 - .../traces/opt_traces_index.md | 5 - .../traces/opt_traces_input.md | 5 - .../traces/opt_traces_output.md | 5 - .../doc_descriptions/traces/opt_traces_sub.md | 5 - .../traces/opt_traces_table_doc.md | 5 - .../doc_descriptions/traces/opt_traces_to.md | 5 - .../traces/opt_traces_tx_hash.md | 5 - .../traces/opt_traces_type.md | 5 - .../traces/opt_traces_value.md | 5 - .../transactions/opt_cumulative_gas_used.md | 5 - .../transactions/opt_tx_block_hash.md | 5 - .../transactions/opt_tx_fee.md | 5 - .../transactions/opt_tx_gas_limit.md | 5 - .../transactions/opt_tx_gas_price.md | 5 - .../transactions/opt_tx_gas_used.md | 5 - .../transactions/opt_tx_hash.md | 5 - .../transactions/opt_tx_input_data.md | 5 - .../transactions/opt_tx_json.md | 5 - .../transactions/opt_tx_nonce.md | 5 - .../transactions/opt_tx_origin_sig.md | 5 - .../transactions/opt_tx_position.md | 5 - .../transactions/opt_tx_status.md | 5 - .../transactions/opt_tx_table_doc.md | 5 - .../transactions/opt_value.md | 5 - .../transfers/opt_eth_amount.md | 5 - .../transfers/opt_eth_amount_usd.md | 6 - .../opt_ez_eth_transfers_table_doc.md | 5 - .../transfers/opt_ez_transfer_table_doc.md | 5 - .../transfers/opt_log_id_transfers.md | 5 - .../transfers/opt_origin_from.md | 5 - .../transfers/opt_origin_to.md | 5 - .../transfers/opt_transfer_amount.md | 11 - .../transfers/opt_transfer_amount_usd.md | 5 - .../opt_transfer_contract_address.md | 5 - .../transfers/opt_transfer_from_address.md | 5 - .../transfers/opt_transfer_has_decimal.md | 5 - .../transfers/opt_transfer_has_price.md | 5 - .../transfers/opt_transfer_raw_amount.md | 11 - .../transfers/opt_transfer_to_address.md | 5 - .../transfers/opt_transfer_token_price.md | 5 - .../transfers/opt_transfer_tx_hash.md | 5 - .../velodrome/op_pool_address.md | 5 - .../velodrome/op_pool_name.md | 5 - .../velodrome/op_pool_type.md | 5 - .../velodrome/op_token0_address.md | 6 - .../velodrome/op_token0_symbol.md | 5 - .../velodrome/op_token1_address.md | 6 - .../velodrome/op_token1_symbol.md | 5 - .../velodrome/velo_claimed_table_doc.md | 9 - .../github_actions__current_task_status.sql | 6 - .../github_actions__current_task_status.yml | 18 - .../github_actions__task_history.sql | 5 - .../github_actions__task_performance.sql | 5 - .../github_actions__task_schedule.sql | 5 - .../github_actions/github_actions__tasks.sql | 5 - models/gold/core/core__dim_contract_abis.sql | 16 - models/gold/core/core__dim_contract_abis.yml | 19 - models/gold/core/core__dim_contracts.sql | 53 -- models/gold/core/core__dim_contracts.yml | 28 - models/gold/core/core__dim_dates.sql | 10 - models/gold/core/core__dim_labels.sql | 19 - models/gold/core/core__dim_labels.yml | 60 -- .../gold/core/core__ez_decoded_event_logs.sql | 70 --- .../gold/core/core__ez_decoded_event_logs.yml | 75 --- .../gold/core/core__ez_native_transfers.sql | 27 - .../gold/core/core__ez_native_transfers.yml | 42 -- models/gold/core/core__ez_token_transfers.sql | 45 -- models/gold/core/core__ez_token_transfers.yml | 59 -- models/gold/core/core__fact_blocks.sql | 143 ----- models/gold/core/core__fact_blocks.yml | 72 --- .../core/core__fact_decoded_event_logs.sql | 31 - .../core/core__fact_decoded_event_logs.yml | 28 - models/gold/core/core__fact_event_logs.sql | 44 -- models/gold/core/core__fact_event_logs.yml | 48 -- .../core__fact_l1_state_root_submissions.sql | 38 -- .../core__fact_l1_state_root_submissions.yml | 30 - .../gold/core/core__fact_l1_submissions.sql | 32 - .../gold/core/core__fact_l1_submissions.yml | 30 - .../gold/core/core__fact_token_transfers.sql | 36 -- .../gold/core/core__fact_token_transfers.yml | 38 -- models/gold/core/core__fact_traces.sql | 526 ---------------- models/gold/core/core__fact_traces.yml | 64 -- models/gold/core/core__fact_transactions.sql | 88 --- models/gold/core/core__fact_transactions.yml | 94 --- .../traces/test_gold__fact_traces_full.sql | 16 - .../traces/test_gold__fact_traces_full.yml | 121 ---- .../traces/test_gold__fact_traces_recent.sql | 16 - .../traces/test_gold__fact_traces_recent.yml | 120 ---- .../defi/defi__dim_dex_liquidity_pools.sql | 3 +- .../defi/defi__dim_dex_liquidity_pools.yml | 28 +- models/gold/defi/defi__ez_bridge_activity.sql | 3 +- models/gold/defi/defi__ez_bridge_activity.yml | 24 +- models/gold/defi/defi__ez_dex_swaps.sql | 6 +- models/gold/defi/defi__ez_dex_swaps.yml | 54 +- .../defi/lending/defi__ez_lending_borrows.sql | 3 +- .../defi/lending/defi__ez_lending_borrows.yml | 42 +- .../lending/defi__ez_lending_deposits.sql | 3 +- .../lending/defi__ez_lending_deposits.yml | 42 +- .../lending/defi__ez_lending_flashloans.sql | 3 +- .../lending/defi__ez_lending_flashloans.yml | 50 +- .../lending/defi__ez_lending_liquidations.sql | 3 +- .../lending/defi__ez_lending_liquidations.yml | 48 +- .../lending/defi__ez_lending_repayments.sql | 3 +- .../lending/defi__ez_lending_repayments.yml | 44 +- .../lending/defi__ez_lending_withdraws.sql | 3 +- .../lending/defi__ez_lending_withdraws.yml | 42 +- .../gold/governance/gov__fact_delegations.sql | 3 +- .../gold/governance/gov__fact_delegations.yml | 36 +- models/gold/nft/nft__ez_nft_sales.sql | 34 +- models/gold/nft/nft__ez_nft_sales.yml | 68 +- models/gold/nft/nft__ez_nft_transfers.sql | 56 -- models/gold/nft/nft__ez_nft_transfers.yml | 50 -- .../gold/price/price__dim_asset_metadata.sql | 19 - .../gold/price/price__dim_asset_metadata.yml | 26 - .../gold/price/price__ez_asset_metadata.sql | 35 -- .../gold/price/price__ez_asset_metadata.yml | 29 - models/gold/price/price__ez_prices_hourly.sql | 39 -- models/gold/price/price__ez_prices_hourly.yml | 30 - .../price/price__fact_prices_ohlc_hourly.sql | 19 - .../price/price__fact_prices_ohlc_hourly.yml | 24 - .../stats/stats__ez_core_metrics_hourly.sql | 38 -- .../stats/stats__ez_core_metrics_hourly.yml | 34 - .../general/__overview__.md => overview.md} | 70 ++- ...ver_observability__blocks_completeness.sql | 161 ----- ...observability__excluded_receipt_blocks.sql | 28 - ...ilver_observability__logs_completeness.sql | 119 ---- ...r_observability__receipts_completeness.sql | 124 ---- ...ver_observability__traces_completeness.sql | 119 ---- ...servability__transactions_completeness.sql | 117 ---- models/silver/abis/silver__abis.sql | 181 ------ models/silver/abis/silver__abis.yml | 8 - models/silver/abis/silver__bytecode_abis.sql | 76 --- models/silver/abis/silver__bytecode_abis.yml | 8 - .../abis/silver__complete_event_abis.sql | 216 ------- .../abis/silver__complete_event_abis.yml | 9 - .../silver/abis/silver__flat_event_abis.sql | 112 ---- models/silver/abis/silver__override_abis.sql | 8 - models/silver/abis/silver__proxies.sql | 104 --- models/silver/abis/silver__proxies.yml | 7 - .../abis/silver__user_verified_abis.sql | 550 ---------------- .../abis/silver__user_verified_abis.yml | 7 - models/silver/abis/silver__verified_abis.sql | 108 ---- models/silver/abis/silver__verified_abis.yml | 7 - models/silver/core/silver__blocks.sql | 78 --- .../silver/core/silver__confirmed_blocks.sql | 51 -- models/silver/core/silver__contracts.sql | 103 --- models/silver/core/silver__contracts.yml | 25 - .../silver/core/silver__created_contracts.sql | 44 -- .../silver/core/silver__created_contracts.yml | 29 - models/silver/core/silver__decoded_logs.sql | 239 ------- models/silver/core/silver__logs.sql | 195 ------ .../silver/core/silver__native_transfers.sql | 119 ---- models/silver/core/silver__ovm1_contracts.sql | 43 -- models/silver/core/silver__ovm1_contracts.yml | 8 - models/silver/core/silver__receipts.sql | 130 ---- .../core/silver__relevant_contracts.sql | 134 ---- .../core/silver__relevant_contracts.yml | 7 - models/silver/core/silver__traces.sql | 151 ----- models/silver/core/silver__transactions.sql | 448 ------------- models/silver/core/silver__transfers.sql | 292 --------- models/silver/core/silver__tx_count.sql | 38 -- .../tests/blocks/test_silver__blocks_full.sql | 9 - .../tests/blocks/test_silver__blocks_full.yml | 95 --- .../blocks/test_silver__blocks_recent.sql | 16 - .../blocks/test_silver__blocks_recent.yml | 27 - .../test_silver__confirmed_blocks_full.sql | 16 - .../test_silver__confirmed_blocks_full.yml | 34 - .../test_silver__confirmed_blocks_recent.sql | 16 - .../test_silver__confirmed_blocks_recent.yml | 34 - .../test_silver__decoded_logs_full.sql | 9 - .../test_silver__decoded_logs_full.yml | 52 -- .../test_silver__decoded_logs_recent.sql | 16 - .../test_silver__decoded_logs_recent.yml | 57 -- .../event_logs/test_silver__logs_full.sql | 9 - .../event_logs/test_silver__logs_full.yml | 77 --- .../event_logs/test_silver__logs_recent.sql | 16 - .../event_logs/test_silver__logs_recent.yml | 33 - .../receipts/test_silver__receipts_full.sql | 9 - .../receipts/test_silver__receipts_full.yml | 82 --- .../receipts/test_silver__receipts_recent.sql | 17 - .../receipts/test_silver__receipts_recent.yml | 28 - .../tests/traces/test_silver__traces_full.sql | 16 - .../tests/traces/test_silver__traces_full.yml | 52 -- .../traces/test_silver__traces_recent.sql | 16 - .../traces/test_silver__traces_recent.yml | 52 -- .../test_silver__transactions_full.sql | 16 - .../test_silver__transactions_full.yml | 119 ---- .../test_silver__transactions_recent.sql | 16 - .../test_silver__transactions_recent.yml | 22 - .../transfers/test_silver__transfers_full.sql | 9 - .../transfers/test_silver__transfers_full.yml | 70 --- .../test_silver__transfers_recent.sql | 16 - .../test_silver__transfers_recent.yml | 68 -- .../silver_bridge__across_fundsdeposited.sql | 2 +- ...silver_bridge__across_v3fundsdeposited.sql | 2 +- .../silver_bridge__allbridge_tokens_sent.sql | 2 +- ...r_bridge__axelar_contractcallwithtoken.sql | 2 +- .../silver_bridge__ccip_send_requested.sql | 2 +- .../silver_bridge__celer_cbridge_send.sql | 2 +- ...lver_bridge__dln_debridge_createdorder.sql | 2 +- .../eywa/silver_bridge__eywa_requestsent.sql | 2 +- .../hop/silver_bridge__hop_ammwrapper.sql | 2 +- .../silver_bridge__hop_l2canonicaltoken.sql | 2 +- .../hop/silver_bridge__hop_transfersent.sql | 2 +- .../meson/silver_bridge__meson_transfers.sql | 2 +- ...er_bridge__multichain_v7_loganyswapout.sql | 2 +- ...ilver_bridge__complete_bridge_activity.sql | 2 +- .../silver_bridge__stargate_createpool.sql | 2 +- .../stargate/silver_bridge__stargate_swap.sql | 2 +- ...er_bridge__symbiosis_synthesizerequest.sql | 2 +- .../silver_bridge__synapse_token_bridge.sql | 2 +- ...ver_bridge__synapse_tokenbridgeandswap.sql | 2 +- .../silver_bridge__wormhole_transfers.sql | 4 +- .../silver_dex__beethovenx_pools.sql | 2 +- .../silver_dex__beethovenx_swaps.sql | 2 +- .../dex/curve/silver_dex__curve_pools.sql | 2 +- .../dex/curve/silver_dex__curve_swaps.sql | 2 +- .../dex/dodo/silver_dex__dodo_v2_pools.sql | 2 +- .../dex/dodo/silver_dex__dodo_v2_swaps.sql | 2 +- .../dex/frax/silver_dex__fraxswap_pools.sql | 2 +- .../dex/frax/silver_dex__fraxswap_swaps.sql | 2 +- .../hashflow/silver_dex__hashflow_pools.sql | 2 +- .../hashflow/silver_dex__hashflow_swaps.sql | 2 +- .../silver_dex__hashflow_v3_pools.sql | 2 +- .../silver_dex__hashflow_v3_swaps.sql | 2 +- .../silver_dex__kyberswap_v1_static_pools.sql | 2 +- .../silver_dex__kyberswap_v1_static_swaps.sql | 2 +- ...silver_dex__kyberswap_v2_elastic_pools.sql | 2 +- ...silver_dex__kyberswap_v2_elastic_swaps.sql | 2 +- ...lver_dex__complete_dex_liquidity_pools.sql | 2 +- .../dex/silver_dex__complete_dex_swaps.sql | 2 +- .../dex/sushi/silver_dex__sushi_pools.sql | 2 +- .../dex/sushi/silver_dex__sushi_swaps.sql | 2 +- .../synthetix/silver_dex__synthetix_swaps.sql | 2 +- .../synthetix/silver_dex__synthetix_swaps.yml | 8 +- .../dex/uniswap/silver_dex__univ2_pools.sql | 2 +- .../dex/uniswap/silver_dex__univ2_swaps.sql | 2 +- .../dex/uniswap/silver_dex__univ3_pools.sql | 2 +- .../dex/uniswap/silver_dex__univ3_swaps.sql | 2 +- .../silver_dex__velodrome_v1_pools.sql | 2 +- .../silver_dex__velodrome_v1_swaps.sql | 2 +- .../silver_dex__velodrome_v2_pools.sql | 2 +- .../silver_dex__velodrome_v2_swaps.sql | 2 +- .../dex/woofi/silver_dex__woofi_swaps.sql | 2 +- .../lending/aave/silver__aave_borrows.sql | 2 +- .../lending/aave/silver__aave_deposits.sql | 2 +- .../lending/aave/silver__aave_flashloans.sql | 2 +- .../aave/silver__aave_liquidations.sql | 2 +- .../lending/aave/silver__aave_repayments.sql | 2 +- .../defi/lending/aave/silver__aave_tokens.sql | 2 +- .../lending/aave/silver__aave_withdraws.sql | 2 +- .../silver__complete_lending_borrows.sql | 2 +- .../silver__complete_lending_deposits.sql | 2 +- .../silver__complete_lending_flashloans.sql | 2 +- .../silver__complete_lending_liquidations.sql | 2 +- .../silver__complete_lending_repayments.sql | 2 +- .../silver__complete_lending_withdraws.sql | 2 +- .../exactly/silver__exactly_asset_details.sql | 2 +- .../exactly/silver__exactly_borrows.sql | 2 +- .../exactly/silver__exactly_deposits.sql | 2 +- .../exactly/silver__exactly_liquidations.sql | 2 +- .../exactly/silver__exactly_repayments.sql | 2 +- .../exactly/silver__exactly_withdraws.sql | 2 +- .../granary/silver__granary_borrows.sql | 2 +- .../granary/silver__granary_deposits.sql | 2 +- .../granary/silver__granary_flashloans.sql | 2 +- .../granary/silver__granary_liquidations.sql | 2 +- .../granary/silver__granary_repayments.sql | 2 +- .../granary/silver__granary_tokens.sql | 2 +- .../granary/silver__granary_withdraws.sql | 2 +- .../sonne/silver__sonne_asset_details.sql | 2 +- .../lending/sonne/silver__sonne_borrows.sql | 2 +- .../lending/sonne/silver__sonne_deposits.sql | 2 +- .../sonne/silver__sonne_liquidations.sql | 2 +- .../sonne/silver__sonne_repayments.sql | 2 +- .../lending/sonne/silver__sonne_withdraws.sql | 2 +- .../lending/tarot/silver__tarot_borrows.sql | 2 +- .../lending/tarot/silver__tarot_deposits.sql | 2 +- .../tarot/silver__tarot_liquidations.sql | 2 +- .../tarot/silver__tarot_liquidity_pools.sql | 2 +- .../tarot/silver__tarot_repayments.sql | 2 +- .../lending/tarot/silver__tarot_withdraws.sql | 2 +- .../silver/ethereum/silver__state_hashes.sql | 4 +- .../ethereum/silver__submission_hashes.sql | 4 +- .../silver/governance/silver__delegations.sql | 2 +- models/silver/labels/silver__labels.sql | 40 -- .../nft/sales/silver__aggregator_list.sql | 3 +- .../nft/sales/silver__complete_nft_sales.sql | 2 +- .../nft/sales/silver__element_sales.sql | 2 +- .../silver/nft/sales/silver__quix_sales.sql | 18 +- .../nft/sales/silver__quix_seaport_sales.sql | 8 +- .../nft/sales/silver__seaport_1_5_sales.sql | 2 +- .../nft/sales/silver__seaport_1_6_sales.sql | 2 +- models/silver/nft/silver__nft_transfers.sql | 446 ------------- models/silver/nft/silver__nft_transfers.yml | 66 -- .../silver__overflowed_traces.sql | 117 ---- .../silver__run_overflowed_traces.sql | 52 -- ...silver__complete_native_asset_metadata.sql | 38 -- ...silver__complete_native_asset_metadata.yml | 24 - .../prices/silver__complete_native_prices.sql | 42 -- .../prices/silver__complete_native_prices.yml | 37 -- ...lver__complete_provider_asset_metadata.sql | 38 -- ...lver__complete_provider_asset_metadata.yml | 26 - .../silver__complete_provider_prices.sql | 47 -- .../silver__complete_provider_prices.yml | 25 - .../silver__complete_token_asset_metadata.sql | 43 -- .../silver__complete_token_asset_metadata.yml | 28 - .../prices/silver__complete_token_prices.sql | 48 -- .../prices/silver__complete_token_prices.yml | 41 -- .../silver_olas__getservice_reads.sql | 2 +- .../silver_olas__registry_metadata.sql | 2 +- ...ilver_olas__registry_metadata_complete.sql | 3 +- .../metadata/silver_olas__registry_reads.sql | 2 +- .../silver_olas__create_service_multisigs.sql | 2 +- .../olas/silver_olas__service_event_logs.sql | 2 +- .../silver_olas__service_registrations.sql | 2 +- .../silver_stats__core_metrics_hourly.sql | 80 --- .../silver_stats__core_metrics_hourly.yml | 84 --- .../utilities/silver__number_sequence.sql | 13 - models/sources.yml | 95 ++- .../streamline/bronze/core/bronze__blocks.sql | 35 +- .../bronze/core/bronze__blocks_fr.sql | 22 +- .../bronze/core/bronze__blocks_fr_v1.sql | 38 +- .../bronze/core/bronze__blocks_fr_v2.sql | 36 +- .../bronze/core/bronze__confirm_blocks.sql | 35 +- .../bronze/core/bronze__confirm_blocks_fr.sql | 9 +- .../core/bronze__confirm_blocks_fr_v1.sql | 39 +- .../core/bronze__confirm_blocks_fr_v2.sql | 36 +- .../bronze/core/bronze__receipts.sql | 35 +- .../bronze/core/bronze__receipts_by_hash.sql | 0 .../core/bronze__receipts_by_hash_fr.sql | 0 .../bronze/core/bronze__receipts_fr.sql | 42 +- .../bronze/core/bronze__receipts_fr_v1.sql | 43 +- .../bronze/core/bronze__receipts_fr_v2.sql | 36 +- .../streamline/bronze/core/bronze__traces.sql | 35 +- .../bronze/core/bronze__traces_fr.sql | 9 +- .../bronze/core/bronze__traces_fr_v1.sql | 38 +- .../bronze/core/bronze__traces_fr_v2.sql | 36 +- .../bronze/core/bronze__transactions.sql | 35 +- .../bronze/core/bronze__transactions_fr.sql | 22 +- .../core/bronze__transactions_fr_v1.sql | 38 +- .../core/bronze__transactions_fr_v2.sql | 36 +- .../bronze/decoder/bronze__decoded_logs.sql | 19 +- .../decoder/bronze__decoded_logs_fr.sql | 8 +- .../decoder/bronze__decoded_logs_fr_v1.sql | 18 +- .../decoder/bronze__decoded_logs_fr_v2.sql | 19 +- .../streamline/silver/_24_hour_lookback.sql | 26 - models/streamline/silver/_block_lookback.sql | 11 - .../streamline/silver/_max_block_by_date.sql | 27 - .../streamline/silver/_max_block_by_hour.sql | 37 -- .../complete/streamline__blocks_complete.sql | 50 -- .../streamline__confirm_blocks_complete.sql | 50 -- .../streamline__receipts_complete.sql | 50 -- .../complete/streamline__traces_complete.sql | 50 -- .../streamline__transactions_complete.sql | 50 -- ...treamline__blocks_transactions_history.sql | 112 ---- .../streamline__confirm_blocks_history.sql | 133 ---- .../history/streamline__receipts_history.sql | 113 ---- .../history/streamline__traces_history.sql | 113 ---- ...reamline__blocks_transactions_realtime.sql | 126 ---- .../streamline__confirm_blocks_realtime.sql | 138 ---- .../streamline__receipts_realtime.sql | 130 ---- .../realtime/streamline__traces_realtime.sql | 127 ---- .../silver/core/retry/_missing_receipts.sql | 34 - .../silver/core/retry/_missing_traces.sql | 17 - .../silver/core/retry/_missing_txs.sql | 40 -- .../silver/core/retry/_unconfirmed_blocks.sql | 34 - .../silver/core/streamline__blocks.sql | 36 -- .../silver/core/streamline__get_chainhead.sql | 54 -- .../silver/core/streamline__get_chainhead.yml | 9 - .../streamline__decoded_logs_complete.sql | 50 -- .../streamline__decoded_logs_realtime.sql | 110 ---- packages.yml | 12 +- python/slack_alert.py | 74 --- tests/optimism/test_gold__missing_traces.sql | 2 - .../test_gold__recent_missing_traces.sql | 2 - .../test_silver__confirmed_blocks.sql | 1 - .../test_silver__missing_receipts.sql | 2 - .../test_silver__recent_confirmed_blocks.sql | 1 - .../test_silver__recent_missing_receipts.sql | 2 - 615 files changed, 1103 insertions(+), 18478 deletions(-) create mode 100644 .github/workflows/dbt_alter_all_gha_tasks.yml delete mode 100644 .github/workflows/dbt_alter_gha_task.yml create mode 100644 .github/workflows/dbt_alter_gha_tasks.yml create mode 100644 .github/workflows/dbt_deploy_new_workflows.yml delete mode 100644 .github/workflows/dbt_run_abi_refresh.yml delete mode 100644 .github/workflows/dbt_run_operation_reorg.yml delete mode 100644 .github/workflows/dbt_run_overflowed_traces.yml create mode 100644 .github/workflows/dbt_run_scheduled_abis.yml create mode 100644 .github/workflows/dbt_run_scheduled_decoder.yml create mode 100644 .github/workflows/dbt_run_scheduled_main.yml delete mode 100644 .github/workflows/dbt_run_scheduled_non_realtime.yml create mode 100644 .github/workflows/dbt_run_scheduled_scores.yml delete mode 100644 .github/workflows/dbt_run_streamline_decoded_logs_history.yml delete mode 100644 .github/workflows/dbt_run_streamline_decoder.yml create mode 100644 .github/workflows/dbt_run_streamline_decoder_history.yml create mode 100644 .github/workflows/dbt_run_streamline_history.yml delete mode 100644 .github/workflows/dbt_run_streamline_history_adhoc.yml delete mode 100644 .github/workflows/slack_notify.yml delete mode 100644 data/github_actions__workflows.csv create mode 100644 data/observability__exclusion_list.csv delete mode 100644 macros/dbt/incremental_predicates.sql delete mode 100644 macros/decoder/decoded_logs_history.sql delete mode 100644 macros/decoder/run_decoded_logs_history.sql delete mode 100644 macros/fsc_evm_temp/decoder_package/streamline_external_table_queries_decoder.sql delete mode 100644 macros/fsc_evm_temp/main_package/bronze/streamline_external_table_queries.sql delete mode 100644 macros/fsc_evm_temp/main_package/logging/bronze.sql delete mode 100644 macros/fsc_evm_temp/main_package/logging/complete.sql delete mode 100644 macros/fsc_evm_temp/main_package/logging/logging.sql delete mode 100644 macros/fsc_evm_temp/main_package/logging/requests.sql delete mode 100644 macros/fsc_evm_temp/main_package/streamline/set_default_variables.sql delete mode 100644 macros/fsc_evm_temp/main_package/streamline/set_streamline_parameters.sql delete mode 100644 macros/streamline/api_integrations.sql delete mode 100644 macros/streamline/get_base_table_udft.sql delete mode 100644 macros/streamline/streamline_udfs.sql delete mode 100644 macros/tests/missing_decoding.sql delete mode 100644 macros/tests/missing_txs.sql delete mode 100644 macros/utils.sql delete mode 100644 models/bronze/api_udf/_retry_abis.sql delete mode 100644 models/bronze/api_udf/bronze_api__contract_abis.sql delete mode 100644 models/bronze/api_udf/bronze_api__contract_abis.yml delete mode 100644 models/bronze/api_udf/bronze_api__token_reads.sql delete mode 100644 models/bronze/api_udf/bronze_api__token_reads.yml rename models/bronze/{ethereum => }/bronze__state_hashes.sql (94%) rename models/bronze/{ethereum => }/bronze__submission_hashes.sql (94%) delete mode 100644 models/bronze/labels/bronze__labels.sql delete mode 100644 models/bronze/overflow/bronze__overflowed_traces.sql delete mode 100644 models/bronze/overflow/bronze__potential_overflowed_traces.sql delete mode 100644 models/bronze/prices/bronze__complete_native_asset_metadata.sql delete mode 100644 models/bronze/prices/bronze__complete_native_prices.sql delete mode 100644 models/bronze/prices/bronze__complete_provider_asset_metadata.sql delete mode 100644 models/bronze/prices/bronze__complete_provider_prices.sql delete mode 100644 models/bronze/prices/bronze__complete_token_asset_metadata.sql delete mode 100644 models/bronze/prices/bronze__complete_token_prices.sql delete mode 100644 models/doc_descriptions/L1_fields/batch_size.md delete mode 100644 models/doc_descriptions/L1_fields/l1_batch_root.md delete mode 100644 models/doc_descriptions/L1_fields/l1_block_number.md delete mode 100644 models/doc_descriptions/L1_fields/l1_block_timestamp.md delete mode 100644 models/doc_descriptions/L1_fields/l1_fee_scalar.md delete mode 100644 models/doc_descriptions/L1_fields/l1_gas_price.md delete mode 100644 models/doc_descriptions/L1_fields/l1_gas_used.md delete mode 100644 models/doc_descriptions/L1_fields/l1_state_root_batch_index.md delete mode 100644 models/doc_descriptions/L1_fields/l1_state_root_tx_hash.md delete mode 100644 models/doc_descriptions/L1_fields/l1_submission_batch_index.md delete mode 100644 models/doc_descriptions/L1_fields/l1_submission_tx_hash.md delete mode 100644 models/doc_descriptions/L1_fields/op_max_block.md delete mode 100644 models/doc_descriptions/L1_fields/op_min_block.md delete mode 100644 models/doc_descriptions/L1_fields/prev_total_elements.md delete mode 100644 models/doc_descriptions/blocks/opt_block_header_json.md delete mode 100644 models/doc_descriptions/blocks/opt_blockchain.md delete mode 100644 models/doc_descriptions/blocks/opt_blocks_hash.md delete mode 100644 models/doc_descriptions/blocks/opt_blocks_nonce.md delete mode 100644 models/doc_descriptions/blocks/opt_blocks_table_doc.md delete mode 100644 models/doc_descriptions/blocks/opt_difficulty.md delete mode 100644 models/doc_descriptions/blocks/opt_extra_data.md delete mode 100644 models/doc_descriptions/blocks/opt_gas_limit.md delete mode 100644 models/doc_descriptions/blocks/opt_gas_used.md delete mode 100644 models/doc_descriptions/blocks/opt_miner.md delete mode 100644 models/doc_descriptions/blocks/opt_network.md delete mode 100644 models/doc_descriptions/blocks/opt_parent_hash.md delete mode 100644 models/doc_descriptions/blocks/opt_receipts_root.md delete mode 100644 models/doc_descriptions/blocks/opt_sha3_uncles.md delete mode 100644 models/doc_descriptions/blocks/opt_size.md delete mode 100644 models/doc_descriptions/blocks/opt_total_difficulty.md delete mode 100644 models/doc_descriptions/blocks/opt_tx_count.md delete mode 100644 models/doc_descriptions/blocks/opt_uncle_blocks.md delete mode 100644 models/doc_descriptions/bridge/evm_bridge_activity.md delete mode 100644 models/doc_descriptions/complete_lending/complete_lending_column_docs.md delete mode 100644 models/doc_descriptions/complete_lending/complete_lending_table_docs.md delete mode 100644 models/doc_descriptions/contracts/op_contracts_contract_address.md delete mode 100644 models/doc_descriptions/contracts/op_contracts_symbol.md delete mode 100644 models/doc_descriptions/contracts/op_contracts_table_doc.md delete mode 100644 models/doc_descriptions/delegations/delegation_delegation_type.md delete mode 100644 models/doc_descriptions/delegations/delegation_delegator.md delete mode 100644 models/doc_descriptions/delegations/delegation_from_delegate.md delete mode 100644 models/doc_descriptions/delegations/delegation_to_delegate.md delete mode 100644 models/doc_descriptions/delegations/opt_delegations_table_doc.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_creation_block.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_creation_time.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_creation_tx.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_factory_address.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_decimals.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_symbols.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_table_doc.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_tokens.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_platform.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_pool_address.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_pool_name.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_in.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_in_unadj.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_in_usd.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_out.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_out_unadj.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_out_usd.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_sender.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_symbol_in.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_symbol_out.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_token_In.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_token_out.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_tx_to.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_token0.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_token1.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_dex_tokens.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/eth_ez_dex_swaps_table_doc.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/opt_sushi__ez_swaps.md delete mode 100644 models/doc_descriptions/event_logs/opt_event_index.md delete mode 100644 models/doc_descriptions/event_logs/opt_event_inputs.md delete mode 100644 models/doc_descriptions/event_logs/opt_event_name.md delete mode 100644 models/doc_descriptions/event_logs/opt_event_removed.md delete mode 100644 models/doc_descriptions/event_logs/opt_event_sig.md delete mode 100644 models/doc_descriptions/event_logs/opt_log_id_events.md delete mode 100644 models/doc_descriptions/event_logs/opt_logs_contract_address.md delete mode 100644 models/doc_descriptions/event_logs/opt_logs_contract_name.md delete mode 100644 models/doc_descriptions/event_logs/opt_logs_data.md delete mode 100644 models/doc_descriptions/event_logs/opt_logs_table_doc.md delete mode 100644 models/doc_descriptions/event_logs/opt_logs_tx_hash.md delete mode 100644 models/doc_descriptions/event_logs/opt_origin_from.md delete mode 100644 models/doc_descriptions/event_logs/opt_origin_to.md delete mode 100644 models/doc_descriptions/event_logs/opt_topics.md delete mode 100644 models/doc_descriptions/fsc_evm/L1_submission_fields.md delete mode 100644 models/doc_descriptions/fsc_evm/blocks.md delete mode 100644 models/doc_descriptions/fsc_evm/complete_general.md delete mode 100644 models/doc_descriptions/fsc_evm/event_logs.md delete mode 100644 models/doc_descriptions/fsc_evm/evm_deprecations.md delete mode 100644 models/doc_descriptions/fsc_evm/nft.md delete mode 100644 models/doc_descriptions/fsc_evm/traces.md delete mode 100644 models/doc_descriptions/fsc_evm/transactions.md delete mode 100644 models/doc_descriptions/fsc_evm/transfers.md delete mode 100644 models/doc_descriptions/general/deprecation.md delete mode 100644 models/doc_descriptions/general/export_columns.md delete mode 100644 models/doc_descriptions/general/opt_block_number.md delete mode 100644 models/doc_descriptions/general/opt_block_timestamp.md delete mode 100644 models/doc_descriptions/general/opt_decimals.md delete mode 100644 models/doc_descriptions/general/opt_from_address.md delete mode 100644 models/doc_descriptions/general/opt_ingested_at.md delete mode 100644 models/doc_descriptions/general/opt_symbol.md delete mode 100644 models/doc_descriptions/general/opt_to_address.md delete mode 100644 models/doc_descriptions/general/precise_amounts.md delete mode 100644 models/doc_descriptions/labels/op_label.md delete mode 100644 models/doc_descriptions/labels/op_label_address.md delete mode 100644 models/doc_descriptions/labels/op_label_address_name.md delete mode 100644 models/doc_descriptions/labels/op_label_blockchain.md delete mode 100644 models/doc_descriptions/labels/op_label_creator.md delete mode 100644 models/doc_descriptions/labels/op_label_subtype.md delete mode 100644 models/doc_descriptions/labels/op_label_type.md delete mode 100644 models/doc_descriptions/labels/op_labels_table_doc.md delete mode 100644 models/doc_descriptions/labels/table_dim_labels.md delete mode 100644 models/doc_descriptions/nft/nft_aggregator_name.md delete mode 100644 models/doc_descriptions/nft/nft_block_no.md delete mode 100644 models/doc_descriptions/nft/nft_blocktime.md delete mode 100644 models/doc_descriptions/nft/nft_buyer_address.md delete mode 100644 models/doc_descriptions/nft/nft_creator_fee.md delete mode 100644 models/doc_descriptions/nft/nft_creator_fee_usd.md delete mode 100644 models/doc_descriptions/nft/nft_currency_address.md delete mode 100644 models/doc_descriptions/nft/nft_currency_symbol.md delete mode 100644 models/doc_descriptions/nft/nft_erc1155_value.md delete mode 100644 models/doc_descriptions/nft/nft_event_index.md delete mode 100644 models/doc_descriptions/nft/nft_event_type.md delete mode 100644 models/doc_descriptions/nft/nft_events_table_doc.md delete mode 100644 models/doc_descriptions/nft/nft_from_address.md delete mode 100644 models/doc_descriptions/nft/nft_intra_event_index.md delete mode 100644 models/doc_descriptions/nft/nft_metadata.md delete mode 100644 models/doc_descriptions/nft/nft_mint_count.md delete mode 100644 models/doc_descriptions/nft/nft_mint_doc.md delete mode 100644 models/doc_descriptions/nft/nft_mint_price.md delete mode 100644 models/doc_descriptions/nft/nft_mint_price_usd.md delete mode 100644 models/doc_descriptions/nft/nft_mints_symbol.md delete mode 100644 models/doc_descriptions/nft/nft_mints_token_address.md delete mode 100644 models/doc_descriptions/nft/nft_mints_token_price.md delete mode 100644 models/doc_descriptions/nft/nft_mints_token_price_usd.md delete mode 100644 models/doc_descriptions/nft/nft_nft_address.md delete mode 100644 models/doc_descriptions/nft/nft_nft_from_address.md delete mode 100644 models/doc_descriptions/nft/nft_nft_to_address.md delete mode 100644 models/doc_descriptions/nft/nft_origin_from.md delete mode 100644 models/doc_descriptions/nft/nft_origin_sig.md delete mode 100644 models/doc_descriptions/nft/nft_origin_to.md delete mode 100644 models/doc_descriptions/nft/nft_platform_address.md delete mode 100644 models/doc_descriptions/nft/nft_platform_exchange_version.md delete mode 100644 models/doc_descriptions/nft/nft_platform_fee.md delete mode 100644 models/doc_descriptions/nft/nft_platform_fee_usd.md delete mode 100644 models/doc_descriptions/nft/nft_platform_name.md delete mode 100644 models/doc_descriptions/nft/nft_price.md delete mode 100644 models/doc_descriptions/nft/nft_price_usd.md delete mode 100644 models/doc_descriptions/nft/nft_project_name.md delete mode 100644 models/doc_descriptions/nft/nft_seller_address.md delete mode 100644 models/doc_descriptions/nft/nft_to_address.md delete mode 100644 models/doc_descriptions/nft/nft_tokenid.md delete mode 100644 models/doc_descriptions/nft/nft_total_fees.md delete mode 100644 models/doc_descriptions/nft/nft_total_fees_usd.md delete mode 100644 models/doc_descriptions/nft/nft_transfer_doc.md delete mode 100644 models/doc_descriptions/nft/nft_tx_fee.md delete mode 100644 models/doc_descriptions/nft/nft_tx_fee_usd.md delete mode 100644 models/doc_descriptions/nft/nft_tx_hash.md delete mode 100644 models/doc_descriptions/prices/prices.md delete mode 100644 models/doc_descriptions/stats/evm_stats_core.md delete mode 100644 models/doc_descriptions/traces/opt_traces_block_no.md delete mode 100644 models/doc_descriptions/traces/opt_traces_blocktime.md delete mode 100644 models/doc_descriptions/traces/opt_traces_call_data.md delete mode 100644 models/doc_descriptions/traces/opt_traces_from.md delete mode 100644 models/doc_descriptions/traces/opt_traces_gas.md delete mode 100644 models/doc_descriptions/traces/opt_traces_gas_used.md delete mode 100644 models/doc_descriptions/traces/opt_traces_identifier.md delete mode 100644 models/doc_descriptions/traces/opt_traces_index.md delete mode 100644 models/doc_descriptions/traces/opt_traces_input.md delete mode 100644 models/doc_descriptions/traces/opt_traces_output.md delete mode 100644 models/doc_descriptions/traces/opt_traces_sub.md delete mode 100644 models/doc_descriptions/traces/opt_traces_table_doc.md delete mode 100644 models/doc_descriptions/traces/opt_traces_to.md delete mode 100644 models/doc_descriptions/traces/opt_traces_tx_hash.md delete mode 100644 models/doc_descriptions/traces/opt_traces_type.md delete mode 100644 models/doc_descriptions/traces/opt_traces_value.md delete mode 100644 models/doc_descriptions/transactions/opt_cumulative_gas_used.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_block_hash.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_fee.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_gas_limit.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_gas_price.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_gas_used.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_hash.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_input_data.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_json.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_nonce.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_origin_sig.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_position.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_status.md delete mode 100644 models/doc_descriptions/transactions/opt_tx_table_doc.md delete mode 100644 models/doc_descriptions/transactions/opt_value.md delete mode 100644 models/doc_descriptions/transfers/opt_eth_amount.md delete mode 100644 models/doc_descriptions/transfers/opt_eth_amount_usd.md delete mode 100644 models/doc_descriptions/transfers/opt_ez_eth_transfers_table_doc.md delete mode 100644 models/doc_descriptions/transfers/opt_ez_transfer_table_doc.md delete mode 100644 models/doc_descriptions/transfers/opt_log_id_transfers.md delete mode 100644 models/doc_descriptions/transfers/opt_origin_from.md delete mode 100644 models/doc_descriptions/transfers/opt_origin_to.md delete mode 100644 models/doc_descriptions/transfers/opt_transfer_amount.md delete mode 100644 models/doc_descriptions/transfers/opt_transfer_amount_usd.md delete mode 100644 models/doc_descriptions/transfers/opt_transfer_contract_address.md delete mode 100644 models/doc_descriptions/transfers/opt_transfer_from_address.md delete mode 100644 models/doc_descriptions/transfers/opt_transfer_has_decimal.md delete mode 100644 models/doc_descriptions/transfers/opt_transfer_has_price.md delete mode 100644 models/doc_descriptions/transfers/opt_transfer_raw_amount.md delete mode 100644 models/doc_descriptions/transfers/opt_transfer_to_address.md delete mode 100644 models/doc_descriptions/transfers/opt_transfer_token_price.md delete mode 100644 models/doc_descriptions/transfers/opt_transfer_tx_hash.md delete mode 100644 models/doc_descriptions/velodrome/op_pool_address.md delete mode 100644 models/doc_descriptions/velodrome/op_pool_name.md delete mode 100644 models/doc_descriptions/velodrome/op_pool_type.md delete mode 100644 models/doc_descriptions/velodrome/op_token0_address.md delete mode 100644 models/doc_descriptions/velodrome/op_token0_symbol.md delete mode 100644 models/doc_descriptions/velodrome/op_token1_address.md delete mode 100644 models/doc_descriptions/velodrome/op_token1_symbol.md delete mode 100644 models/doc_descriptions/velodrome/velo_claimed_table_doc.md delete mode 100644 models/github_actions/github_actions__current_task_status.sql delete mode 100644 models/github_actions/github_actions__current_task_status.yml delete mode 100644 models/github_actions/github_actions__task_history.sql delete mode 100644 models/github_actions/github_actions__task_performance.sql delete mode 100644 models/github_actions/github_actions__task_schedule.sql delete mode 100644 models/github_actions/github_actions__tasks.sql delete mode 100644 models/gold/core/core__dim_contract_abis.sql delete mode 100644 models/gold/core/core__dim_contract_abis.yml delete mode 100644 models/gold/core/core__dim_contracts.sql delete mode 100644 models/gold/core/core__dim_contracts.yml delete mode 100644 models/gold/core/core__dim_dates.sql delete mode 100644 models/gold/core/core__dim_labels.sql delete mode 100644 models/gold/core/core__dim_labels.yml delete mode 100644 models/gold/core/core__ez_decoded_event_logs.sql delete mode 100644 models/gold/core/core__ez_decoded_event_logs.yml delete mode 100644 models/gold/core/core__ez_native_transfers.sql delete mode 100644 models/gold/core/core__ez_native_transfers.yml delete mode 100644 models/gold/core/core__ez_token_transfers.sql delete mode 100644 models/gold/core/core__ez_token_transfers.yml delete mode 100644 models/gold/core/core__fact_blocks.sql delete mode 100644 models/gold/core/core__fact_blocks.yml delete mode 100644 models/gold/core/core__fact_decoded_event_logs.sql delete mode 100644 models/gold/core/core__fact_decoded_event_logs.yml delete mode 100644 models/gold/core/core__fact_event_logs.sql delete mode 100644 models/gold/core/core__fact_event_logs.yml delete mode 100644 models/gold/core/core__fact_l1_state_root_submissions.sql delete mode 100644 models/gold/core/core__fact_l1_state_root_submissions.yml delete mode 100644 models/gold/core/core__fact_l1_submissions.sql delete mode 100644 models/gold/core/core__fact_l1_submissions.yml delete mode 100644 models/gold/core/core__fact_token_transfers.sql delete mode 100644 models/gold/core/core__fact_token_transfers.yml delete mode 100644 models/gold/core/core__fact_traces.sql delete mode 100644 models/gold/core/core__fact_traces.yml delete mode 100644 models/gold/core/core__fact_transactions.sql delete mode 100644 models/gold/core/core__fact_transactions.yml delete mode 100644 models/gold/core/tests/traces/test_gold__fact_traces_full.sql delete mode 100644 models/gold/core/tests/traces/test_gold__fact_traces_full.yml delete mode 100644 models/gold/core/tests/traces/test_gold__fact_traces_recent.sql delete mode 100644 models/gold/core/tests/traces/test_gold__fact_traces_recent.yml delete mode 100644 models/gold/nft/nft__ez_nft_transfers.sql delete mode 100644 models/gold/nft/nft__ez_nft_transfers.yml delete mode 100644 models/gold/price/price__dim_asset_metadata.sql delete mode 100644 models/gold/price/price__dim_asset_metadata.yml delete mode 100644 models/gold/price/price__ez_asset_metadata.sql delete mode 100644 models/gold/price/price__ez_asset_metadata.yml delete mode 100644 models/gold/price/price__ez_prices_hourly.sql delete mode 100644 models/gold/price/price__ez_prices_hourly.yml delete mode 100644 models/gold/price/price__fact_prices_ohlc_hourly.sql delete mode 100644 models/gold/price/price__fact_prices_ohlc_hourly.yml delete mode 100644 models/gold/stats/stats__ez_core_metrics_hourly.sql delete mode 100644 models/gold/stats/stats__ez_core_metrics_hourly.yml rename models/{doc_descriptions/general/__overview__.md => overview.md} (69%) delete mode 100644 models/silver/_observability/silver_observability__blocks_completeness.sql delete mode 100644 models/silver/_observability/silver_observability__excluded_receipt_blocks.sql delete mode 100644 models/silver/_observability/silver_observability__logs_completeness.sql delete mode 100644 models/silver/_observability/silver_observability__receipts_completeness.sql delete mode 100644 models/silver/_observability/silver_observability__traces_completeness.sql delete mode 100644 models/silver/_observability/silver_observability__transactions_completeness.sql delete mode 100644 models/silver/abis/silver__abis.sql delete mode 100644 models/silver/abis/silver__abis.yml delete mode 100644 models/silver/abis/silver__bytecode_abis.sql delete mode 100644 models/silver/abis/silver__bytecode_abis.yml delete mode 100644 models/silver/abis/silver__complete_event_abis.sql delete mode 100644 models/silver/abis/silver__complete_event_abis.yml delete mode 100644 models/silver/abis/silver__flat_event_abis.sql delete mode 100644 models/silver/abis/silver__override_abis.sql delete mode 100644 models/silver/abis/silver__proxies.sql delete mode 100644 models/silver/abis/silver__proxies.yml delete mode 100644 models/silver/abis/silver__user_verified_abis.sql delete mode 100644 models/silver/abis/silver__user_verified_abis.yml delete mode 100644 models/silver/abis/silver__verified_abis.sql delete mode 100644 models/silver/abis/silver__verified_abis.yml delete mode 100644 models/silver/core/silver__blocks.sql delete mode 100644 models/silver/core/silver__confirmed_blocks.sql delete mode 100644 models/silver/core/silver__contracts.sql delete mode 100644 models/silver/core/silver__contracts.yml delete mode 100644 models/silver/core/silver__created_contracts.sql delete mode 100644 models/silver/core/silver__created_contracts.yml delete mode 100644 models/silver/core/silver__decoded_logs.sql delete mode 100644 models/silver/core/silver__logs.sql delete mode 100644 models/silver/core/silver__native_transfers.sql delete mode 100644 models/silver/core/silver__ovm1_contracts.sql delete mode 100644 models/silver/core/silver__ovm1_contracts.yml delete mode 100644 models/silver/core/silver__receipts.sql delete mode 100644 models/silver/core/silver__relevant_contracts.sql delete mode 100644 models/silver/core/silver__relevant_contracts.yml delete mode 100644 models/silver/core/silver__traces.sql delete mode 100644 models/silver/core/silver__transactions.sql delete mode 100644 models/silver/core/silver__transfers.sql delete mode 100644 models/silver/core/silver__tx_count.sql delete mode 100644 models/silver/core/tests/blocks/test_silver__blocks_full.sql delete mode 100644 models/silver/core/tests/blocks/test_silver__blocks_full.yml delete mode 100644 models/silver/core/tests/blocks/test_silver__blocks_recent.sql delete mode 100644 models/silver/core/tests/blocks/test_silver__blocks_recent.yml delete mode 100644 models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.sql delete mode 100644 models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.yml delete mode 100644 models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.sql delete mode 100644 models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.yml delete mode 100644 models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.sql delete mode 100644 models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.yml delete mode 100644 models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.sql delete mode 100644 models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.yml delete mode 100644 models/silver/core/tests/event_logs/test_silver__logs_full.sql delete mode 100644 models/silver/core/tests/event_logs/test_silver__logs_full.yml delete mode 100644 models/silver/core/tests/event_logs/test_silver__logs_recent.sql delete mode 100644 models/silver/core/tests/event_logs/test_silver__logs_recent.yml delete mode 100644 models/silver/core/tests/receipts/test_silver__receipts_full.sql delete mode 100644 models/silver/core/tests/receipts/test_silver__receipts_full.yml delete mode 100644 models/silver/core/tests/receipts/test_silver__receipts_recent.sql delete mode 100644 models/silver/core/tests/receipts/test_silver__receipts_recent.yml delete mode 100644 models/silver/core/tests/traces/test_silver__traces_full.sql delete mode 100644 models/silver/core/tests/traces/test_silver__traces_full.yml delete mode 100644 models/silver/core/tests/traces/test_silver__traces_recent.sql delete mode 100644 models/silver/core/tests/traces/test_silver__traces_recent.yml delete mode 100644 models/silver/core/tests/transactions/test_silver__transactions_full.sql delete mode 100644 models/silver/core/tests/transactions/test_silver__transactions_full.yml delete mode 100644 models/silver/core/tests/transactions/test_silver__transactions_recent.sql delete mode 100644 models/silver/core/tests/transactions/test_silver__transactions_recent.yml delete mode 100644 models/silver/core/tests/transfers/test_silver__transfers_full.sql delete mode 100644 models/silver/core/tests/transfers/test_silver__transfers_full.yml delete mode 100644 models/silver/core/tests/transfers/test_silver__transfers_recent.sql delete mode 100644 models/silver/core/tests/transfers/test_silver__transfers_recent.yml delete mode 100644 models/silver/labels/silver__labels.sql delete mode 100644 models/silver/nft/silver__nft_transfers.sql delete mode 100644 models/silver/nft/silver__nft_transfers.yml delete mode 100644 models/silver/overflow/formatted_views/silver__overflowed_traces.sql delete mode 100644 models/silver/overflow/run_models/silver__run_overflowed_traces.sql delete mode 100644 models/silver/prices/silver__complete_native_asset_metadata.sql delete mode 100644 models/silver/prices/silver__complete_native_asset_metadata.yml delete mode 100644 models/silver/prices/silver__complete_native_prices.sql delete mode 100644 models/silver/prices/silver__complete_native_prices.yml delete mode 100644 models/silver/prices/silver__complete_provider_asset_metadata.sql delete mode 100644 models/silver/prices/silver__complete_provider_asset_metadata.yml delete mode 100644 models/silver/prices/silver__complete_provider_prices.sql delete mode 100644 models/silver/prices/silver__complete_provider_prices.yml delete mode 100644 models/silver/prices/silver__complete_token_asset_metadata.sql delete mode 100644 models/silver/prices/silver__complete_token_asset_metadata.yml delete mode 100644 models/silver/prices/silver__complete_token_prices.sql delete mode 100644 models/silver/prices/silver__complete_token_prices.yml delete mode 100644 models/silver/stats/silver_stats__core_metrics_hourly.sql delete mode 100644 models/silver/stats/silver_stats__core_metrics_hourly.yml delete mode 100644 models/silver/utilities/silver__number_sequence.sql create mode 100644 models/streamline/bronze/core/bronze__receipts_by_hash.sql create mode 100644 models/streamline/bronze/core/bronze__receipts_by_hash_fr.sql delete mode 100644 models/streamline/silver/_24_hour_lookback.sql delete mode 100644 models/streamline/silver/_block_lookback.sql delete mode 100644 models/streamline/silver/_max_block_by_date.sql delete mode 100644 models/streamline/silver/_max_block_by_hour.sql delete mode 100644 models/streamline/silver/core/complete/streamline__blocks_complete.sql delete mode 100644 models/streamline/silver/core/complete/streamline__confirm_blocks_complete.sql delete mode 100644 models/streamline/silver/core/complete/streamline__receipts_complete.sql delete mode 100644 models/streamline/silver/core/complete/streamline__traces_complete.sql delete mode 100644 models/streamline/silver/core/complete/streamline__transactions_complete.sql delete mode 100644 models/streamline/silver/core/history/streamline__blocks_transactions_history.sql delete mode 100644 models/streamline/silver/core/history/streamline__confirm_blocks_history.sql delete mode 100644 models/streamline/silver/core/history/streamline__receipts_history.sql delete mode 100644 models/streamline/silver/core/history/streamline__traces_history.sql delete mode 100644 models/streamline/silver/core/realtime/streamline__blocks_transactions_realtime.sql delete mode 100644 models/streamline/silver/core/realtime/streamline__confirm_blocks_realtime.sql delete mode 100644 models/streamline/silver/core/realtime/streamline__receipts_realtime.sql delete mode 100644 models/streamline/silver/core/realtime/streamline__traces_realtime.sql delete mode 100644 models/streamline/silver/core/retry/_missing_receipts.sql delete mode 100644 models/streamline/silver/core/retry/_missing_traces.sql delete mode 100644 models/streamline/silver/core/retry/_missing_txs.sql delete mode 100644 models/streamline/silver/core/retry/_unconfirmed_blocks.sql delete mode 100644 models/streamline/silver/core/streamline__blocks.sql delete mode 100644 models/streamline/silver/core/streamline__get_chainhead.sql delete mode 100644 models/streamline/silver/core/streamline__get_chainhead.yml delete mode 100644 models/streamline/silver/decoded_logs/complete/streamline__decoded_logs_complete.sql delete mode 100644 models/streamline/silver/decoded_logs/realtime/streamline__decoded_logs_realtime.sql delete mode 100644 python/slack_alert.py delete mode 100644 tests/optimism/test_gold__missing_traces.sql delete mode 100644 tests/optimism/test_gold__recent_missing_traces.sql delete mode 100644 tests/optimism/test_silver__confirmed_blocks.sql delete mode 100644 tests/optimism/test_silver__missing_receipts.sql delete mode 100644 tests/optimism/test_silver__recent_confirmed_blocks.sql delete mode 100644 tests/optimism/test_silver__recent_missing_receipts.sql diff --git a/.github/workflows/dbt_alter_all_gha_tasks.yml b/.github/workflows/dbt_alter_all_gha_tasks.yml new file mode 100644 index 00000000..086327dd --- /dev/null +++ b/.github/workflows/dbt_alter_all_gha_tasks.yml @@ -0,0 +1,27 @@ +name: dbt_alter_all_gha_tasks +run-name: dbt_alter_all_gha_tasks + +on: + workflow_dispatch: + branches: + - "main" + inputs: + task_action: + type: choice + description: Action to perform on all tasks + required: true + options: + - RESUME + - SUSPEND + default: RESUME + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_alter_all_gha_tasks.yml@pre-release/v4-beta + with: + task_action: ${{ inputs.task_action }} + target: prod + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_alter_gha_task.yml b/.github/workflows/dbt_alter_gha_task.yml deleted file mode 100644 index 0d4008ec..00000000 --- a/.github/workflows/dbt_alter_gha_task.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: dbt_alter_gha_task -run-name: dbt_alter_gha_task - -on: - workflow_dispatch: - branches: - - "main" - inputs: - workflow_name: - type: string - description: Name of the workflow to perform the action on, no .yml extension - required: true - task_action: - type: choice - description: Action to perform - required: true - options: - - SUSPEND - - RESUME - default: SUSPEND - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - called_workflow_template: - uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_alter_gha_tasks.yml@AN-4374/upgrade-dbt-1.7 - with: - workflow_name: | - ${{ inputs.workflow_name }} - task_action: | - ${{ inputs.task_action }} - environment: workflow_prod - secrets: inherit - - notify-failure: - needs: [called_workflow_template] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_alter_gha_tasks.yml b/.github/workflows/dbt_alter_gha_tasks.yml new file mode 100644 index 00000000..be92ee58 --- /dev/null +++ b/.github/workflows/dbt_alter_gha_tasks.yml @@ -0,0 +1,32 @@ +name: dbt_alter_gha_tasks +run-name: dbt_alter_gha_tasks + +on: + workflow_dispatch: + branches: + - "main" + inputs: + workflow_name: + type: string + description: Name of the workflow to perform the action on, no .yml extension + required: true + task_action: + type: choice + description: Action to perform + required: true + options: + - SUSPEND + - RESUME + default: SUSPEND + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_alter_gha_tasks.yml@pre-release/v4-beta + with: + workflow_name: ${{ inputs.workflow_name }} + task_action: ${{ inputs.task_action }} + target: prod + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_deploy_new_workflows.yml b/.github/workflows/dbt_deploy_new_workflows.yml new file mode 100644 index 00000000..a9a877d3 --- /dev/null +++ b/.github/workflows/dbt_deploy_new_workflows.yml @@ -0,0 +1,19 @@ +name: dbt_deploy_new_workflows +run-name: dbt_deploy_new_workflows + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Deploy New Github Actions + command: | + make deploy_new_gha_tasks DBT_TARGET=prod + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_docs_update.yml b/.github/workflows/dbt_docs_update.yml index b4b38c97..10ec0ba2 100644 --- a/.github/workflows/dbt_docs_update.yml +++ b/.github/workflows/dbt_docs_update.yml @@ -5,75 +5,10 @@ on: branches: - "main" -env: - USE_VARS: "${{ vars.USE_VARS }}" - DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}" - DBT_VERSION: "${{ vars.DBT_VERSION }}" - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: refresh ddl for datashare - run: | - cnt=$(dbt ls -m fsc_utils.datashare._datashare___create_gold | wc -l ); if [ $cnt -eq 1 ]; then dbt run -m fsc_utils.datashare._datashare___create_gold; fi; - - name: checkout docs branch - run: | - git checkout -B docs origin/main - - name: generate dbt docs - run: dbt docs generate -t prod - - - name: move files to docs directory - run: | - mkdir -p ./docs - cp target/{catalog.json,manifest.json,index.html} docs/ - - name: clean up target directory - run: dbt clean - - - name: check for changes - run: git status - - - name: stage changed files - run: git add . - - - name: commit changed files - run: | - git config user.email "abc@xyz" - git config user.name "github-actions" - git commit -am "Auto-update docs" - - name: push changes to docs - run: | - git push -f --set-upstream origin docs - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_docs_update.yml@pre-release/v4-beta + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_integration_test.yml b/.github/workflows/dbt_integration_test.yml index 6fdabb3b..e625bc67 100644 --- a/.github/workflows/dbt_integration_test.yml +++ b/.github/workflows/dbt_integration_test.yml @@ -3,39 +3,20 @@ run-name: ${{ github.event.inputs.branch }} on: workflow_dispatch: + branches: + - "main" inputs: environment: - required: true type: string + required: true concurrency: ${{ github.workflow }} jobs: - prepare_vars: - runs-on: ubuntu-latest - environment: - name: ${{ inputs.environment }} - outputs: - warehouse: ${{ steps.set_outputs.outputs.warehouse }} - steps: - - name: Set warehouse output - id: set_outputs - run: | - echo "warehouse=${{ vars.WAREHOUSE }}" >> $GITHUB_OUTPUT - called_workflow_template: - needs: prepare_vars - uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt.yml@main + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_integration_test.yml@pre-release/v4-beta with: - command: > + target: ${{ inputs.environment }} + command: | dbt test --selector 'integration_tests' - environment: ${{ inputs.environment }} - warehouse: ${{ needs.prepare_vars.outputs.warehouse }} secrets: inherit - - notify-failure: - needs: [called_workflow_template] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_abi_refresh.yml b/.github/workflows/dbt_run_abi_refresh.yml deleted file mode 100644 index be1dbd21..00000000 --- a/.github/workflows/dbt_run_abi_refresh.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: dbt_run_abi_refresh -run-name: dbt_run_abi_refresh - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: Update ABI models - run: | - dbt run -m "optimism_models,tag:abis" - - - name: Kick off decoded logs history, if there are new ABIs from users - run: | - dbt run-operation run_decoded_logs_history - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_adhoc.yml b/.github/workflows/dbt_run_adhoc.yml index b4e2a4b1..30a34811 100644 --- a/.github/workflows/dbt_run_adhoc.yml +++ b/.github/workflows/dbt_run_adhoc.yml @@ -1,13 +1,13 @@ name: dbt_run_adhoc -run-name: dbt_run_adhoc +run-name: ${{ inputs.dbt_command }} on: workflow_dispatch: branches: - "main" inputs: - environment: - type: choice + target: + type: choice description: DBT Run Environment required: true options: @@ -15,9 +15,9 @@ on: - prod default: dev warehouse: - type: choice + type: choice description: Snowflake warehouse - required: true + required: true options: - DBT - DBT_CLOUD @@ -26,49 +26,18 @@ on: default: DBT dbt_command: type: string - description: "DBT Run Command" + description: 'DBT Run Command' required: true - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ inputs.warehouse }}" - SCHEMA: "${{ vars.SCHEMA }}" - + concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_${{ inputs.environment }} - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - ${{ inputs.dbt_command }} - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + warehouse: ${{ inputs.warehouse }} + target: ${{ inputs.target }} + command_name: Run DBT Command + command: ${{ inputs.dbt_command }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_dev_refresh.yml b/.github/workflows/dbt_run_dev_refresh.yml index 3203a410..938995c3 100644 --- a/.github/workflows/dbt_run_dev_refresh.yml +++ b/.github/workflows/dbt_run_dev_refresh.yml @@ -3,80 +3,13 @@ run-name: dbt_run_dev_refresh on: workflow_dispatch: - schedule: - # Runs "at 13:36 UTC Monday" (see https://crontab.guru) - - cron: "36 13 * * 1" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" + branches: + - "main" concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs_refresh: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run-operation run_sp_create_prod_clone - - notify-failure: - needs: [run_dbt_jobs_refresh] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - run_dbt_jobs_udfs: - runs-on: ubuntu-latest - needs: run_dbt_jobs_refresh - environment: - name: workflow_dev - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run Recreate UDFs - run: | - dbt run-operation fsc_utils.create_evm_streamline_udfs --vars '{"UPDATE_UDFS_AND_SPS":True}' -t dev - dbt run -s livequery_models.deploy.core._live --vars '{"UPDATE_UDFS_AND_SPS":True}' -t dev - - notify-failure2: - needs: [run_dbt_jobs_udfs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_dev_refresh.yml@pre-release/v4-beta + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_full_observability.yml b/.github/workflows/dbt_run_full_observability.yml index 8c40ff6e..ebfc1547 100644 --- a/.github/workflows/dbt_run_full_observability.yml +++ b/.github/workflows/dbt_run_full_observability.yml @@ -3,50 +3,21 @@ run-name: dbt_run_full_observability on: workflow_dispatch: - schedule: - # Runs “At 06:00 on day-of-month 1.” (see https://crontab.guru) - - cron: "0 6 1 * *" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - + branches: + - "main" + concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod_2xl + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + warehouse: DBT_EMERGENCY + command_name: Run Observability Models + command: | + dbt run --threads 2 --vars '{"MAIN_OBSERV_FULL_TEST_ENABLED":True}' -m "fsc_evm,tag:observability" + secrets: inherit + - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run --threads 2 --vars '{"OBSERV_FULL_TEST":True}' -m "optimism_models,tag:observability" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_heal_models.yml b/.github/workflows/dbt_run_heal_models.yml index a279cc3f..6eaf50fe 100644 --- a/.github/workflows/dbt_run_heal_models.yml +++ b/.github/workflows/dbt_run_heal_models.yml @@ -3,50 +3,17 @@ run-name: dbt_run_heal_models on: workflow_dispatch: - schedule: - # Runs at 04:00 on Wednesday (see https://crontab.guru) - - cron: "0 4 * * 3" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - + branches: + - "main" + concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "optimism_models,tag:heal" --vars '{"HEAL_MODEL":True}' - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Heal Models + command: | + dbt run -m "$PROJECT_NAME,tag:heal" --vars '{"HEAL_MODEL":True}' + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_operation_reorg.yml b/.github/workflows/dbt_run_operation_reorg.yml deleted file mode 100644 index f805673d..00000000 --- a/.github/workflows/dbt_run_operation_reorg.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: dbt_run_operation_reorg -run-name: dbt_run_operation_reorg - -on: - workflow_dispatch: - schedule: - # Runs at minute 50 every Monday (see https://crontab.guru) - - cron: "50 0 * * 1" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: List reorg models - id: list_models - run: | - reorg_model_list=$(dbt list --select "optimism_models,tag:reorg" --resource-type model --output name | grep '__' | awk -F'.' '{print $NF}' | tr '\n' ',' | sed 's/,$//') - echo "model_list=$reorg_model_list" >> $GITHUB_OUTPUT - - - name: Execute block_reorg macro - run: | - dbt run-operation fsc_utils.block_reorg --args "{reorg_model_list: '${{ steps.list_models.outputs.model_list }}', hours: '169'}" && awk '/SQL status/ {print; next} /DELETE FROM/{getline; print} /\/\* {/ {print}' logs/dbt.log - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_overflowed_traces.yml b/.github/workflows/dbt_run_overflowed_traces.yml deleted file mode 100644 index 6fbaf746..00000000 --- a/.github/workflows/dbt_run_overflowed_traces.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: dbt_run_overflowed_traces -run-name: dbt_run_overflowed_traces - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "optimism_models,tag:overflowed_traces" --vars '{"OVERFLOWED_TRACES":True}' - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_scheduled_abis.yml b/.github/workflows/dbt_run_scheduled_abis.yml new file mode 100644 index 00000000..2eb85813 --- /dev/null +++ b/.github/workflows/dbt_run_scheduled_abis.yml @@ -0,0 +1,22 @@ +name: dbt_run_scheduled_abis +run-name: dbt_run_scheduled_abis + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run ABI Models + command: | + dbt run -m "fsc_evm,tag:silver,tag:abis" "fsc_evm,tag:gold,tag:abis" + command_name_2: Kick off decoded logs history, if there are new user submitted ABIs + command_2: | + dbt run-operation fsc_evm.run_decoded_logs_history + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled_curated.yml b/.github/workflows/dbt_run_scheduled_curated.yml index 2d3bfc18..61d9d16b 100644 --- a/.github/workflows/dbt_run_scheduled_curated.yml +++ b/.github/workflows/dbt_run_scheduled_curated.yml @@ -6,46 +6,14 @@ on: branches: - "main" -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "optimism_models,tag:curated" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Curated Models + command: | + dbt run -m "$PROJECT_NAME,tag:curated" "fsc_evm,tag:curated" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled_decoder.yml b/.github/workflows/dbt_run_scheduled_decoder.yml new file mode 100644 index 00000000..a0b7a2b7 --- /dev/null +++ b/.github/workflows/dbt_run_scheduled_decoder.yml @@ -0,0 +1,19 @@ +name: dbt_run_scheduled_decoder +run-name: dbt_run_scheduled_decoder + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Decoder Models + command: | + dbt run -m "fsc_evm,tag:bronze,tag:decoded_logs" "fsc_evm,tag:silver,tag:decoded_logs" "fsc_evm,tag:gold,tag:decoded_logs" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled_main.yml b/.github/workflows/dbt_run_scheduled_main.yml new file mode 100644 index 00000000..23c70bef --- /dev/null +++ b/.github/workflows/dbt_run_scheduled_main.yml @@ -0,0 +1,19 @@ +name: dbt_run_scheduled_main +run-name: dbt_run_scheduled_main + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Main Models + command: | + dbt run -m "fsc_evm,tag:bronze,tag:core" "fsc_evm,tag:silver,tag:core" "fsc_evm,tag:gold,tag:core" "fsc_evm,tag:silver,tag:prices" "fsc_evm,tag:gold,tag:prices" "fsc_evm,tag:silver,tag:labels" "fsc_evm,tag:gold,tag:labels" "fsc_evm,tag:gold,tag:nft" "fsc_evm,tag:streamline,tag:decoded_logs,tag:realtime" "fsc_evm,tag:streamline,tag:decoded_logs,tag:complete" "fsc_evm,tag:streamline,tag:abis,tag:realtime" "fsc_evm,tag:streamline,tag:abis,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True}' + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled_non_realtime.yml b/.github/workflows/dbt_run_scheduled_non_realtime.yml deleted file mode 100644 index 9e829d0d..00000000 --- a/.github/workflows/dbt_run_scheduled_non_realtime.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: dbt_run_scheduled_non_realtime -run-name: dbt_run_scheduled_non_realtime - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "optimism_models,tag:non_realtime" "optimism_models,tag:streamline_decoded_logs_complete" "optimism_models,tag:streamline_decoded_logs_realtime" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_scheduled_scores.yml b/.github/workflows/dbt_run_scheduled_scores.yml new file mode 100644 index 00000000..5c2f0f9e --- /dev/null +++ b/.github/workflows/dbt_run_scheduled_scores.yml @@ -0,0 +1,20 @@ + +name: dbt_run_scheduled_scores +run-name: dbt_run_scheduled_scores + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Scores Models + command: | + dbt run -m "fsc_evm,tag:scores" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_chainhead.yml b/.github/workflows/dbt_run_streamline_chainhead.yml index bfe0d7ed..efa0176c 100644 --- a/.github/workflows/dbt_run_streamline_chainhead.yml +++ b/.github/workflows/dbt_run_streamline_chainhead.yml @@ -6,50 +6,15 @@ on: branches: - "main" -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "optimism_models,tag:streamline_core_complete" "optimism_models,tag:streamline_core_realtime" "optimism_models,tag:streamline_core_complete_receipts" "optimism_models,tag:streamline_core_realtime_receipts" "optimism_models,tag:streamline_core_complete_confirm_blocks" "optimism_models,tag:streamline_core_realtime_confirm_blocks" - - - name: Run Chainhead Tests - run: | - dbt test -m "optimism_models,tag:chainhead" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Chainhead Models + command: | + dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "fsc_evm,tag:chainhead" "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts_by_hash" + dbt test -m "fsc_evm,tag:chainhead" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_decoded_logs_history.yml b/.github/workflows/dbt_run_streamline_decoded_logs_history.yml deleted file mode 100644 index 1ac30cf1..00000000 --- a/.github/workflows/dbt_run_streamline_decoded_logs_history.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: dbt_run_streamline_decoded_logs_history -run-name: dbt_run_streamline_decoded_logs_history - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: Update complete table - run: | - dbt run -m "optimism_models,tag:streamline_decoded_logs_complete" - - - name: Decode historical logs - run: | - dbt run-operation decoded_logs_history --vars '{"STREAMLINE_INVOKE_STREAMS":True}' - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_streamline_decoder.yml b/.github/workflows/dbt_run_streamline_decoder.yml deleted file mode 100644 index 04df26a3..00000000 --- a/.github/workflows/dbt_run_streamline_decoder.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: dbt_run_streamline_decoder -run-name: dbt_run_streamline_decoder - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "optimism_models,tag:decoded_logs" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_run_streamline_decoder_history.yml b/.github/workflows/dbt_run_streamline_decoder_history.yml new file mode 100644 index 00000000..b736c9c0 --- /dev/null +++ b/.github/workflows/dbt_run_streamline_decoder_history.yml @@ -0,0 +1,22 @@ +name: dbt_run_streamline_decoder_history +run-name: dbt_run_streamline_decoder_history + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Decoder Complete + command: | + dbt run -m "fsc_evm,tag:streamline,tag:decoded_logs,tag:complete" + command_name_2: Run Streamline Decoder History + command_2: | + dbt run-operation fsc_evm.decoded_logs_history --vars '{"STREAMLINE_INVOKE_STREAMS":True}' + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_history.yml b/.github/workflows/dbt_run_streamline_history.yml new file mode 100644 index 00000000..08dfbc65 --- /dev/null +++ b/.github/workflows/dbt_run_streamline_history.yml @@ -0,0 +1,19 @@ +name: dbt_run_streamline_history +run-name: dbt_run_streamline_history + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run History Models + command: | + dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:history" --exclude "fsc_evm,tag:receipts_by_hash" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_history_adhoc.yml b/.github/workflows/dbt_run_streamline_history_adhoc.yml deleted file mode 100644 index c641015e..00000000 --- a/.github/workflows/dbt_run_streamline_history_adhoc.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: dbt_run_streamline_history_adhoc -run-name: dbt_run_streamline_history_adhoc - -on: - workflow_dispatch: - branches: - - "main" - inputs: - environment: - type: choice - description: DBT Run Environment - required: true - options: - - dev - - prod - - prod_backfill - default: dev - warehouse: - type: choice - description: Snowflake warehouse - required: true - options: - - DBT - - DBT_CLOUD - - DBT_EMERGENCY - default: DBT - dbt_command: - type: choice - description: "DBT Run Command" - required: true - options: - - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "optimism_models,tag:streamline_core_complete" "optimism_models,tag:streamline_core_history" "optimism_models,tag:streamline_core_complete_receipts" "optimism_models,tag:streamline_core_history_receipts" "optimism_models,tag:streamline_core_complete_confirm_blocks" "optimism_models,tag:streamline_core_history_confirm_blocks" - - dbt run --threads 8 --vars '{"STREAMLINE_INVOKE_STREAMS":True,"WAIT":120}' -m "optimism_models,tag:streamline_decoded_logs_complete" "optimism_models,tag:streamline_decoded_logs_history" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ inputs.warehouse }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_${{ inputs.environment }} - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - ${{ inputs.dbt_command }} - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/dbt_test_daily.yml b/.github/workflows/dbt_test_daily.yml index bfd87f86..eaa96352 100644 --- a/.github/workflows/dbt_test_daily.yml +++ b/.github/workflows/dbt_test_daily.yml @@ -1,52 +1,23 @@ -name: dbt_test_daily +name: dbt_test_daily run-name: dbt_test_daily on: workflow_dispatch: - schedule: - # Runs "at 9:00 UTC" (see https://crontab.guru) - - cron: "0 9 * * *" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - + branches: + - "main" + concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_test - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt test --exclude "optimism_models,tag:full_test" "optimism_models,tag:recent_test" "optimism_models,tag:gha_tasks" livequery_models livequery_base - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + target: test + command_name: Build Daily Testing Views + command: | + dbt run -m "fsc_evm,tag:daily_test" + command_name_2: Run Daily Tests (all tests excluding full, recent and misc. others) + command_2: | + dbt test --exclude "fsc_evm,tag:full_test" "fsc_evm,tag:recent_test" "fsc_evm,tag:gha_tasks" livequery_models + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_test_intraday.yml b/.github/workflows/dbt_test_intraday.yml index ca1f4a95..4823fcd9 100644 --- a/.github/workflows/dbt_test_intraday.yml +++ b/.github/workflows/dbt_test_intraday.yml @@ -5,48 +5,17 @@ on: workflow_dispatch: branches: - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - + concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_test - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run -m "optimism_models,tag:observability" - dbt test -m "optimism_models,tag:recent_test" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + target: test + command_name: Run Observability & Recent Tests + command: | + dbt run -m "fsc_evm,tag:observability" + dbt test -m "fsc_evm,tag:recent_test" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_test_monthly.yml b/.github/workflows/dbt_test_monthly.yml index 984f0aae..cf47c459 100644 --- a/.github/workflows/dbt_test_monthly.yml +++ b/.github/workflows/dbt_test_monthly.yml @@ -3,50 +3,21 @@ run-name: dbt_test_monthly on: workflow_dispatch: - schedule: - # Runs “At 8pm on 28th of month.” (see https://crontab.guru) - - cron: "0 20 28 * *" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - + branches: + - "main" + concurrency: group: ${{ github.workflow }} jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_test - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt test -m "optimism_models,tag:full_test" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + warehouse: DBT_EMERGENCY + command_name: Build Full Testing Views + command: | + dbt run -m "fsc_evm,tag:full_test" + command_name_2: Run Full Tests + command_2: | + dbt test -m "fsc_evm,tag:full_test" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/slack_notify.yml b/.github/workflows/slack_notify.yml deleted file mode 100644 index 2dc6d146..00000000 --- a/.github/workflows/slack_notify.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Slack Notification -on: - workflow_call: - secrets: - SLACK_WEBHOOK_URL: - required: true - -jobs: - notify: - runs-on: ubuntu-latest - environment: workflow_prod - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Install dependencies - run: pip install requests - - - name: Send Slack notification - run: python python/slack_alert.py - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/Makefile b/Makefile index 2a695b89..92ccf34c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,109 @@ -SHELL := /bin/bash +DBT_TARGET ?= dev +RECEIPTS_BY_HASH_ENABLED ?= false -dbt-console: - docker-compose run dbt_console +cleanup_time: + @set -e; \ + rm -f package-lock.yml && dbt clean && dbt deps -.PHONY: dbt-console \ No newline at end of file +deploy_gha_workflows_table: + @set -e; \ + echo "Collecting workflow names..." ; \ + WORKFLOW_VALUES="" ; \ + for file in $$(find .github/workflows -name "*.yml" -type f); do \ + filename=$$(basename "$$file" .yml) ; \ + if [ -z "$$WORKFLOW_VALUES" ]; then \ + WORKFLOW_VALUES="('$$filename')" ; \ + else \ + WORKFLOW_VALUES="$$WORKFLOW_VALUES,('$$filename')" ; \ + fi ; \ + done ; \ + echo "Found workflows: $$WORKFLOW_VALUES" ; \ + dbt run-operation create_workflow_table --args "{\"workflow_values\": \"$$WORKFLOW_VALUES\"}" -t $(DBT_TARGET) + +deploy_gha_tasks: + @set -e; \ + make deploy_gha_workflows_table DBT_TARGET=$(DBT_TARGET); \ + dbt run -s livequery_models.deploy.marketplace.github --vars '{"UPDATE_UDFS_AND_SPS":True}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:gha_tasks" --full-refresh -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.create_gha_tasks --vars '{"RESUME_GHA_TASKS":True}' -t $(DBT_TARGET) + +deploy_new_gha_tasks: + @set -e; \ + make deploy_gha_workflows_table DBT_TARGET=$(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:gha_tasks" --full-refresh -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.create_gha_tasks --vars '{"RESUME_GHA_TASKS":True}' -t $(DBT_TARGET) + +deploy_livequery: + @set -e; \ + dbt run-operation fsc_evm.drop_livequery_schemas --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run -m livequery_models.deploy.core --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.livequery_grants --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET) + +deploy_chain_phase_1: + @set -e; \ + dbt run -m livequery_models.deploy.core --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.livequery_grants --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.create_evm_streamline_udfs --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.call_sample_rpc_node -t $(DBT_TARGET); \ + if [ "$(DBT_TARGET)" != "prod" ]; then \ + if [ "$(RECEIPTS_BY_HASH_ENABLED)" = "true" ]; then \ + dbt run -m "fsc_evm,tag:phase_1" --exclude "fsc_evm,tag:receipts" --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true, "MAIN_SL_NEW_BUILD_ENABLED": true, "GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET); \ + dbt test -m "fsc_evm,tag:chainhead"; \ + dbt run -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts" "fsc_evm,tag:confirm_blocks" --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "STREAMLINE_INVOKE_STREAMS":True, "MAIN_SL_TESTING_LIMIT": 500}' -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_1" --exclude "fsc_evm,tag:receipts_by_hash" --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true, "MAIN_SL_NEW_BUILD_ENABLED": true, "GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET); \ + dbt test -m "fsc_evm,tag:chainhead"; \ + dbt run -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts_by_hash" "fsc_evm,tag:confirm_blocks" --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "STREAMLINE_INVOKE_STREAMS":True, "MAIN_SL_TESTING_LIMIT": 500}' -t $(DBT_TARGET); \ + fi; \ + else \ + if [ "$(RECEIPTS_BY_HASH_ENABLED)" = "true" ]; then \ + dbt run -m "fsc_evm,tag:phase_1" --exclude "fsc_evm,tag:receipts" --full-refresh --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET); \ + dbt test -m "fsc_evm,tag:chainhead"; \ + dbt run -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts" "fsc_evm,tag:confirm_blocks" --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "STREAMLINE_INVOKE_STREAMS":True}' -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_1" --exclude "fsc_evm,tag:receipts_by_hash" --full-refresh --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET); \ + dbt test -m "fsc_evm,tag:chainhead"; \ + dbt run -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts_by_hash" "fsc_evm,tag:confirm_blocks" --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "STREAMLINE_INVOKE_STREAMS":True}' -t $(DBT_TARGET); \ + fi; \ + fi; \ + echo "# wait ~10 minutes"; \ + echo "# run deploy_chain_phase_2" + +deploy_chain_phase_2: + @set -e; \ + if [ "$(DBT_TARGET)" != "prod" ]; then \ + dbt run -m "fsc_evm,tag:phase_2" --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true, "GLOBAL_STREAMLINE_FR_ENABLED": true, "GLOBAL_BRONZE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true, "GLOBAL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:streamline,tag:abis,tag:realtime" "fsc_evm,tag:streamline,tag:abis,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True, "DECODER_SL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_2" --full-refresh --vars '{"GLOBAL_STREAMLINE_FR_ENABLED": true, "GLOBAL_BRONZE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true, "GLOBAL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:streamline,tag:abis,tag:realtime" "fsc_evm,tag:streamline,tag:abis,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True, "DECODER_SL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + fi; \ + echo "# wait ~10 minutes"; \ + echo "# run deploy_chain_phase_3" + +deploy_chain_phase_3: + @set -e; \ + if [ "$(DBT_TARGET)" != "prod" ]; then \ + dbt run -m "fsc_evm,tag:phase_2" --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:phase_3" --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true, "GLOBAL_STREAMLINE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true, "GLOBAL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:silver,tag:abis" "fsc_evm,tag:streamline,tag:decoded_logs,tag:realtime" "fsc_evm,tag:streamline,tag:decoded_logs,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True, "DECODER_SL_TESTING_LIMIT": 500}' -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_2" -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:phase_3" --full-refresh --vars '{"GLOBAL_STREAMLINE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true, "GLOBAL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:silver,tag:abis" "fsc_evm,tag:streamline,tag:decoded_logs,tag:realtime" "fsc_evm,tag:streamline,tag:decoded_logs,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -t $(DBT_TARGET); \ + fi; \ + echo "# wait ~10 minutes"; \ + echo "# run deploy_chain_phase_4" + +deploy_chain_phase_4: + @set -e; \ + if [ "$(DBT_TARGET)" != "prod" ]; then \ + dbt run -m "fsc_evm,tag:phase_3" --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:phase_4" --full-refresh -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_3" -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:phase_4" --full-refresh -t $(DBT_TARGET); \ + make deploy_gha_tasks DBT_TARGET=$(DBT_TARGET); \ + fi; \ + +.PHONY: cleanup_time deploy_gha_workflows_table deploy_gha_tasks deploy_new_gha_tasks deploy_livequery deploy_chain_phase_1 deploy_chain_phase_2 deploy_chain_phase_3 deploy_chain_phase_4 \ No newline at end of file diff --git a/data/github_actions__workflows.csv b/data/github_actions__workflows.csv deleted file mode 100644 index fe3655be..00000000 --- a/data/github_actions__workflows.csv +++ /dev/null @@ -1,8 +0,0 @@ -workflow_name,workflow_schedule -dbt_run_scheduled_non_realtime,"32 * * * *" -dbt_run_streamline_chainhead,"20,50 * * * *" -dbt_run_streamline_decoder,"40 * * * *" -dbt_run_scheduled_curated,"10 */6 * * *" -dbt_test_intraday,"8 */4 * * *" -dbt_run_streamline_decoded_logs_history,"5 20 * * 6" -dbt_run_abi_refresh,"41 23 * * *" \ No newline at end of file diff --git a/data/observability__exclusion_list.csv b/data/observability__exclusion_list.csv new file mode 100644 index 00000000..ebe12f99 --- /dev/null +++ b/data/observability__exclusion_list.csv @@ -0,0 +1,11 @@ +block_number +985 +19022 +45036 +123322 +123542 +1133328 +1135391 +1144468 +1244152 +1272994 \ No newline at end of file diff --git a/dbt_project.yml b/dbt_project.yml index 8f7d86c1..cf91c514 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -17,6 +17,8 @@ test-paths: ["tests"] seed-paths: ["data"] macro-paths: ["macros"] snapshot-paths: ["snapshots"] +docs-paths: + ["dbt_packages/fsc_evm/doc_descriptions", "models/doc_descriptions", "models"] target-path: "target" # directory which will store compiled SQL files clean-targets: # directories to be removed by `dbt clean` @@ -32,7 +34,7 @@ on-run-start: - "{{ create_udfs() }}" on-run-end: - - '{{ apply_meta_as_tags(results) }}' + - "{{ apply_meta_as_tags(results) }}" dispatch: - macro_namespace: dbt @@ -42,18 +44,66 @@ dispatch: - dbt query-comment: - comment: '{{ dbt_snowflake_query_tags.get_query_comment(node) }}' + comment: "{{ dbt_snowflake_query_tags.get_query_comment(node) }}" append: true # Snowflake removes prefixed comments. # Configuring models # Full documentation: https://docs.getdbt.com/docs/configuring-models models: - +copy_grants: true - +persist_docs: - relation: true - columns: true - +on_schema_change: "append_new_columns" + optimism_models: # replace with the name of the chain + +copy_grants: true + +persist_docs: + relation: true + columns: true + +on_schema_change: "append_new_columns" + livequery_models: + +materialized: ephemeral + fsc_evm: + +enabled: false # disable fsc_evm package by default + +copy_grants: true + +persist_docs: + relation: true + columns: true + +on_schema_change: "append_new_columns" + main_package: + +enabled: false # disable top level package by default, enabled subpackages as needed + admin: + +enabled: true + core: + +enabled: true # enable subpackages, as needed + bronze: + +enabled: false + token_reads: + +enabled: true + github_actions: + +enabled: true + labels: + +enabled: true + observability: + +enabled: true + prices: + +enabled: true + utils: + +enabled: true + decoder_package: + +enabled: false + abis: + +enabled: true + decoded_logs: + +enabled: false + gold: + +enabled: true + silver: + +enabled: true + streamline: + +enabled: true + curated_package: + +enabled: false + stats: + +enabled: true + scores_package: + +enabled: false # In this example config, we tell dbt to build all models in the example/ directory # as tables. These settings can be overridden in the individual model files @@ -61,25 +111,22 @@ models: vars: "dbt_date:time_zone": GMT + STREAMLINE_INVOKE_STREAMS: False UPDATE_UDFS_AND_SPS: False UPDATE_SNOWFLAKE_TAGS: True - STREAMLINE_INVOKE_STREAMS: False - STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES: False - WAIT: 0 - OBSERV_FULL_TEST: False - OVERFLOWED_TRACES: False HEAL_MODEL: False HEAL_MODELS: [] - START_GHA_TASKS: False + STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES: False -#### STREAMLINE 2.0 BEGIN #### + #### STREAMLINE 2.0 BEGIN #### API_INTEGRATION: '{{ var("config")[target.name]["API_INTEGRATION"] if var("config")[target.name] else var("config")["dev"]["API_INTEGRATION"] }}' EXTERNAL_FUNCTION_URI: '{{ var("config")[target.name]["EXTERNAL_FUNCTION_URI"] if var("config")[target.name] else var("config")["dev"]["EXTERNAL_FUNCTION_URI"] }}' ROLES: | ["INTERNAL_DEV"] + config: - # The keys correspond to dbt profiles and are case sensitive + # The keys correspond to dbt profiles and are case sensitive dev: API_INTEGRATION: AWS_OPTIMISM_API_STG_V2 EXTERNAL_FUNCTION_URI: 0h08ox8fa4.execute-api.us-east-1.amazonaws.com/stg/ @@ -94,62 +141,4 @@ vars: - AWS_LAMBDA_OPTIMISM_API - INTERNAL_DEV - DBT_CLOUD_OPTIMISM - #### STREAMLINE 2.0 END #### - -#### FSC_EVM BEGIN #### -# Visit https://github.com/FlipsideCrypto/fsc-evm/wiki for more information on required and optional variables - - ### GLOBAL VARIABLES BEGIN ### - ## REQUIRED - GLOBAL_PROD_DB_NAME: 'optimism' - GLOBAL_NODE_SECRET_PATH: 'Vault/prod/optimism/quicknode/mainnet' - GLOBAL_NODE_URL: '{service}/{Authentication}' - GLOBAL_BLOCKS_PER_HOUR: 1800 - GLOBAL_USES_STREAMLINE_V1: True - GLOBAL_USES_SINGLE_FLIGHT_METHOD: True - - ### GLOBAL VARIABLES END ### - - ### MAIN_PACKAGE VARIABLES BEGIN ### - - ### CORE ### - ## REQUIRED - - ## OPTIONAL - # GOLD_FULL_REFRESH: True - # SILVER_FULL_REFRESH: True - # BRONZE_FULL_REFRESH: True - - # BLOCKS_COMPLETE_FULL_REFRESH: True - # CONFIRM_BLOCKS_COMPLETE_FULL_REFRESH: True - # TRACES_COMPLETE_FULL_REFRESH: True - # RECEIPTS_COMPLETE_FULL_REFRESH: True - # TRANSACTIONS_COMPLETE_FULL_REFRESH: True - - # BLOCKS_TRANSACTIONS_REALTIME_TESTING_LIMIT: 3 - # BLOCKS_TRANSACTIONS_HISTORY_TESTING_LIMIT: 3 - # TRACES_REALTIME_TESTING_LIMIT: 3 - # TRACES_HISTORY_TESTING_LIMIT: 3 - # ARBTRACE_BLOCK_HISTORY_TESTING_LIMIT: 3 - # RECEIPTS_REALTIME_TESTING_LIMIT: 3 - # RECEIPTS_HISTORY_TESTING_LIMIT: 3 - # CONFIRM_BLOCKS_REALTIME_TESTING_LIMIT: 3 - # CONFIRM_BLOCKS_HISTORY_TESTING_LIMIT: 3 - - # ### MAIN_PACKAGE VARIABLES END ### - - # ### DECODER_PACKAGE VARIABLES BEGIN ### - - # ## REQUIRED - - # ## OPTIONAL - - # DECODED_LOGS_COMPLETE_FULL_REFRESH: True - - # DECODED_LOGS_REALTIME_TESTING_LIMIT: 3 - # DECODED_LOGS_HISTORY_SQL_LIMIT: 1 #limit per monthly range - - ### DECODER_PACKAGE VARIABLES END ### - -#### FSC_EVM END #### \ No newline at end of file diff --git a/macros/create_udfs.sql b/macros/create_udfs.sql index 6693da3b..b2436087 100644 --- a/macros/create_udfs.sql +++ b/macros/create_udfs.sql @@ -1,18 +1,9 @@ {% macro create_udfs() %} - {% if var("UPDATE_UDFS_AND_SPS") %} + {% if var("UPDATE_UDFS_AND_SPS", false) %} {% set sql %} CREATE schema if NOT EXISTS silver; - - {{ create_udtf_get_base_table( - schema = "streamline" - ) }} - {{ create_udf_get_chainhead() }} - {{ create_udf_bulk_json_rpc() }} - {{ create_udf_bulk_decode_logs() }} - {{ create_udf_bulk_get_traces() }} - {% endset %} {% do run_query(sql) %} {{- fsc_utils.create_udfs() -}} {% endif %} -{% endmacro %} +{% endmacro %} \ No newline at end of file diff --git a/macros/dbt/incremental_predicates.sql b/macros/dbt/incremental_predicates.sql deleted file mode 100644 index ba1bb2e2..00000000 --- a/macros/dbt/incremental_predicates.sql +++ /dev/null @@ -1,22 +0,0 @@ -{% macro standard_predicate( - input_column = 'block_number' - ) -%} - {%- set database_name = target.database -%} - {%- set schema_name = generate_schema_name( - node = model - ) -%} - {%- set table_name = generate_alias_name( - node = model - ) -%} - {%- set tmp_table_name = table_name ~ '__dbt_tmp' -%} - {%- set full_table_name = database_name ~ '.' ~ schema_name ~ '.' ~ table_name -%} - {%- set full_tmp_table_name = database_name ~ '.' ~ schema_name ~ '.' ~ tmp_table_name -%} - {{ full_table_name }}.{{ input_column }} >= ( - SELECT - MIN( - {{ input_column }} - ) - FROM - {{ full_tmp_table_name }} - ) -{%- endmacro %} diff --git a/macros/decoder/decoded_logs_history.sql b/macros/decoder/decoded_logs_history.sql deleted file mode 100644 index 4fe2282d..00000000 --- a/macros/decoder/decoded_logs_history.sql +++ /dev/null @@ -1,124 +0,0 @@ -{% macro decoded_logs_history(backfill_mode=false) %} - - {%- set params = { - "sql_limit": var("DECODED_LOGS_HISTORY_SQL_LIMIT", 8000000), - "producer_batch_size": var("DECODED_LOGS_HISTORY_PRODUCER_BATCH_SIZE", 400000), - "worker_batch_size": var("DECODED_LOGS_HISTORY_WORKER_BATCH_SIZE", 100000) - } -%} - - {% set wait_time = var("DECODED_LOGS_HISTORY_WAIT_TIME", 60) %} - {% set find_months_query %} - SELECT - DISTINCT date_trunc('month', block_timestamp)::date as month - FROM {{ ref('core__fact_blocks') }} - ORDER BY month ASC - {% endset %} - {% set results = run_query(find_months_query) %} - - {% if execute %} - {% set months = results.columns[0].values() %} - - {% for month in months %} - {% set view_name = 'decoded_logs_history_' ~ month.strftime('%Y_%m') %} - - {% set create_view_query %} - create or replace view streamline.{{view_name}} as ( - WITH target_blocks AS ( - SELECT - block_number - FROM {{ ref('core__fact_blocks') }} - WHERE date_trunc('month', block_timestamp) = '{{month}}'::timestamp - ), - new_abis AS ( - SELECT - abi, - parent_contract_address, - event_signature, - start_block, - end_block - FROM {{ ref('silver__complete_event_abis') }} - {% if not backfill_mode %} - WHERE inserted_timestamp > dateadd('day', -30, sysdate()) - {% endif %} - ), - existing_logs_to_exclude AS ( - SELECT _log_id - FROM {{ ref('streamline__decoded_logs_complete') }} l - INNER JOIN target_blocks b using (block_number) - ), - candidate_logs AS ( - SELECT - l.block_number, - l.tx_hash, - l.event_index, - l.contract_address, - l.topics, - l.data, - concat(l.tx_hash::string, '-', l.event_index::string) as _log_id - FROM target_blocks b - INNER JOIN {{ ref('core__fact_event_logs') }} l using (block_number) - WHERE l.tx_status = 'SUCCESS' and date_trunc('month', l.block_timestamp) = '{{month}}'::timestamp - ) - SELECT - l.block_number, - l._log_id, - A.abi, - OBJECT_CONSTRUCT( - 'topics', l.topics, - 'data', l.data, - 'address', l.contract_address - ) AS data - FROM candidate_logs l - INNER JOIN new_abis A - ON A.parent_contract_address = l.contract_address - AND A.event_signature = l.topics[0]::STRING - AND l.block_number BETWEEN A.start_block AND A.end_block - WHERE NOT EXISTS ( - SELECT 1 - FROM existing_logs_to_exclude e - WHERE e._log_id = l._log_id - ) - LIMIT {{ params.sql_limit }} - ) - {% endset %} - {# Create the view #} - {% do run_query(create_view_query) %} - {{ log("Created view for month " ~ month.strftime('%Y-%m'), info=True) }} - {% if var("STREAMLINE_INVOKE_STREAMS", false) %} - {# Check if rows exist first #} - {% set check_rows_query %} - SELECT EXISTS(SELECT 1 FROM streamline.{{view_name}} LIMIT 1) - {% endset %} - - {% set results = run_query(check_rows_query) %} - {% set has_rows = results.columns[0].values()[0] %} - - {% if has_rows %} - {# Invoke streamline, if rows exist to decode #} - {% set decode_query %} - SELECT - streamline.udf_bulk_decode_logs_v2( - PARSE_JSON( - $${ "external_table": "decoded_logs", - "producer_batch_size": {{ params.producer_batch_size }}, - "sql_limit": {{ params.sql_limit }}, - "sql_source": "{{view_name}}", - "worker_batch_size": {{ params.worker_batch_size }} }$$ - ) - ); - {% endset %} - - {% do run_query(decode_query) %} - {{ log("Triggered decoding for month " ~ month.strftime('%Y-%m'), info=True) }} - {# Call wait since we actually did some decoding #} - {% do run_query("call system$wait(" ~ wait_time ~ ")") %} - {{ log("Completed wait after decoding for month " ~ month.strftime('%Y-%m'), info=True) }} - {% else %} - {{ log("No rows to decode for month " ~ month.strftime('%Y-%m'), info=True) }} - {% endif %} - {% endif %} - - {% endfor %} - {% endif %} - -{% endmacro %} \ No newline at end of file diff --git a/macros/decoder/run_decoded_logs_history.sql b/macros/decoder/run_decoded_logs_history.sql deleted file mode 100644 index 3954afb0..00000000 --- a/macros/decoder/run_decoded_logs_history.sql +++ /dev/null @@ -1,29 +0,0 @@ -{% macro run_decoded_logs_history() %} - -{% set blockchain = var('GLOBAL_PROD_DB_NAME','').lower() %} - -{% set check_for_new_user_abis_query %} - select 1 - from {{ ref('silver__user_verified_abis') }} - where _inserted_timestamp::date = sysdate()::date - and dayname(sysdate()) <> 'Sat' -{% endset %} -{% set results = run_query(check_for_new_user_abis_query) %} -{% if execute %} - {% set new_user_abis = results.columns[0].values()[0] %} - - {% if new_user_abis %} - {% set invoke_workflow_query %} - SELECT - github_actions.workflow_dispatches( - 'FlipsideCrypto', - '{{ blockchain }}' || '-models', - 'dbt_run_streamline_decoded_logs_history.yml', - NULL - ) - {% endset %} - - {% do run_query(invoke_workflow_query) %} - {% endif %} -{% endif %} -{% endmacro %} \ No newline at end of file diff --git a/macros/fsc_evm_temp/decoder_package/streamline_external_table_queries_decoder.sql b/macros/fsc_evm_temp/decoder_package/streamline_external_table_queries_decoder.sql deleted file mode 100644 index 318a3daa..00000000 --- a/macros/fsc_evm_temp/decoder_package/streamline_external_table_queries_decoder.sql +++ /dev/null @@ -1,101 +0,0 @@ -{% macro streamline_external_table_query_decoder( - source_name, - source_version - ) %} - - {% if source_version != '' %} - {% set source_version = '_' ~ source_version.lower() %} - {% endif %} - - WITH meta AS ( - SELECT - job_created_time AS _inserted_timestamp, - file_name, - CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 6), '_', 1) AS INTEGER) AS _partition_by_block_number, - TO_DATE( - concat_ws('-', SPLIT_PART(file_name, '/', 3), SPLIT_PART(file_name, '/', 4), SPLIT_PART(file_name, '/', 5)) - ) AS _partition_by_created_date - FROM - TABLE( - information_schema.external_table_file_registration_history( - start_time => DATEADD('day', -3, CURRENT_TIMESTAMP()), - table_name => '{{ source( "bronze_streamline", source_name ~ source_version) }}') - ) A - ) - SELECT - block_number, - id :: STRING AS id, - DATA, - metadata, - b.file_name, - _inserted_timestamp, - s._partition_by_block_number AS _partition_by_block_number, - s._partition_by_created_date AS _partition_by_created_date - FROM - {{ source( - "bronze_streamline", - source_name ~ source_version - ) }} - s - JOIN meta b - ON b.file_name = metadata$filename - AND b._partition_by_block_number = s._partition_by_block_number - AND b._partition_by_created_date = s._partition_by_created_date - WHERE - b._partition_by_block_number = s._partition_by_block_number - AND b._partition_by_created_date = s._partition_by_created_date - AND s._partition_by_created_date >= DATEADD('day', -2, CURRENT_TIMESTAMP()) - AND DATA :error IS NULL - AND DATA IS NOT NULL -{% endmacro %} - - -{% macro streamline_external_table_query_decoder_fr( - source_name, - source_version - ) %} - - {% if source_version != '' %} - {% set source_version = '_' ~ source_version.lower() %} - {% endif %} - - WITH meta AS ( - SELECT - registered_on AS _inserted_timestamp, - file_name, - CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 6), '_', 1) AS INTEGER) AS _partition_by_block_number, - TO_DATE( - concat_ws('-', SPLIT_PART(file_name, '/', 3), SPLIT_PART(file_name, '/', 4), SPLIT_PART(file_name, '/', 5)) - ) AS _partition_by_created_date - FROM - TABLE( - information_schema.external_table_files( - table_name => '{{ source( "bronze_streamline", source_name ~ source_version) }}' - ) - ) A - ) -SELECT - block_number, - id :: STRING AS id, - DATA, - metadata, - b.file_name, - _inserted_timestamp, - s._partition_by_block_number AS _partition_by_block_number, - s._partition_by_created_date AS _partition_by_created_date -FROM - {{ source( - "bronze_streamline", - source_name ~ source_version - ) }} - s - JOIN meta b - ON b.file_name = metadata$filename - AND b._partition_by_block_number = s._partition_by_block_number - AND b._partition_by_created_date = s._partition_by_created_date -WHERE - b._partition_by_block_number = s._partition_by_block_number - AND b._partition_by_created_date = s._partition_by_created_date - AND DATA :error IS NULL - AND DATA IS NOT NULL -{% endmacro %} diff --git a/macros/fsc_evm_temp/main_package/bronze/streamline_external_table_queries.sql b/macros/fsc_evm_temp/main_package/bronze/streamline_external_table_queries.sql deleted file mode 100644 index c6f7919d..00000000 --- a/macros/fsc_evm_temp/main_package/bronze/streamline_external_table_queries.sql +++ /dev/null @@ -1,141 +0,0 @@ -{% macro streamline_external_table_query( - source_name, - source_version, - partition_function, - balances, - block_number, - uses_receipts_by_hash - ) %} - - {% if source_version != '' %} - {% set source_version = '_' ~ source_version.lower() %} - {% endif %} - - WITH meta AS ( - SELECT - job_created_time AS _inserted_timestamp, - file_name, - {{ partition_function }} AS partition_key - FROM - TABLE( - information_schema.external_table_file_registration_history( - start_time => DATEADD('day', -3, CURRENT_TIMESTAMP()), - table_name => '{{ source( "bronze_streamline", source_name ~ source_version) }}') - ) A - ) - SELECT - s.*, - b.file_name, - b._inserted_timestamp - - {% if balances %}, - r.block_timestamp :: TIMESTAMP AS block_timestamp - {% endif %} - - {% if block_number %}, - COALESCE( - s.value :"BLOCK_NUMBER" :: STRING, - s.metadata :request :"data" :id :: STRING, - PARSE_JSON( - s.metadata :request :"data" - ) :id :: STRING - ) :: INT AS block_number - {% endif %} - {% if uses_receipts_by_hash %}, - s.value :"TX_HASH" :: STRING AS tx_hash - {% endif %} - FROM - {{ source( - "bronze_streamline", - source_name ~ source_version - ) }} - s - JOIN meta b - ON b.file_name = metadata$filename - AND b.partition_key = s.partition_key - - {% if balances %} - JOIN {{ ref('_block_ranges') }} - r - ON r.block_number = COALESCE( - s.value :"BLOCK_NUMBER" :: INT, - s.value :"block_number" :: INT - ) - {% endif %} - WHERE - b.partition_key = s.partition_key - AND DATA :error IS NULL - AND DATA IS NOT NULL -{% endmacro %} - -{% macro streamline_external_table_query_fr( - source_name, - source_version, - partition_function, - partition_join_key, - balances, - block_number, - uses_receipts_by_hash - ) %} - - {% if source_version != '' %} - {% set source_version = '_' ~ source_version.lower() %} - {% endif %} - - WITH meta AS ( - SELECT - registered_on AS _inserted_timestamp, - file_name, - {{ partition_function }} AS partition_key - FROM - TABLE( - information_schema.external_table_files( - table_name => '{{ source( "bronze_streamline", source_name ~ source_version) }}' - ) - ) A - ) -SELECT - s.*, - b.file_name, - b._inserted_timestamp - - {% if balances %}, - r.block_timestamp :: TIMESTAMP AS block_timestamp -{% endif %} - -{% if block_number %}, - COALESCE( - s.value :"BLOCK_NUMBER" :: STRING, - s.value :"block_number" :: STRING, - s.metadata :request :"data" :id :: STRING, - PARSE_JSON( - s.metadata :request :"data" - ) :id :: STRING - ) :: INT AS block_number -{% endif %} -{% if uses_receipts_by_hash %}, - s.value :"TX_HASH" :: STRING AS tx_hash -{% endif %} -FROM - {{ source( - "bronze_streamline", - source_name ~ source_version - ) }} - s - JOIN meta b - ON b.file_name = metadata$filename - AND b.partition_key = s.{{ partition_join_key }} - - {% if balances %} - JOIN {{ ref('_block_ranges') }} - r - ON r.block_number = COALESCE( - s.value :"BLOCK_NUMBER" :: INT, - s.value :"block_number" :: INT - ) - {% endif %} -WHERE - b.partition_key = s.{{ partition_join_key }} - AND DATA :error IS NULL - AND DATA IS NOT NULL -{% endmacro %} diff --git a/macros/fsc_evm_temp/main_package/logging/bronze.sql b/macros/fsc_evm_temp/main_package/logging/bronze.sql deleted file mode 100644 index b367deb5..00000000 --- a/macros/fsc_evm_temp/main_package/logging/bronze.sql +++ /dev/null @@ -1,36 +0,0 @@ -{% macro log_bronze_details(source_name, source_version, model_type, partition_function, partition_join_key, block_number, uses_receipts_by_hash) %} - -{% if source_version != '' %} - {% set source_version = '_' ~ source_version.lower() %} -{% endif %} -{% if model_type != '' %} - {% set model_type = '_' ~ model_type %} -{% endif %} - -{%- if flags.WHICH == 'compile' and execute -%} - - {{ log("=== Current Variable Settings ===", info=True) }} - {{ log(source_name ~ model_type ~ '_PARTITION_FUNCTION: ' ~ partition_function, info=True) }} - {{ log(source_name ~ model_type ~ '_PARTITION_JOIN_KEY: ' ~ partition_join_key, info=True) }} - {{ log(source_name ~ model_type ~ '_BLOCK_NUMBER: ' ~ block_number, info=True) }} - {% if uses_receipts_by_hash %} - {{ log("USES_RECEIPTS_BY_HASH: " ~ uses_receipts_by_hash, info=True) }} - {% endif %} - - {{ log("", info=True) }} - {{ log("=== Source Details ===", info=True) }} - {{ log("Source: " ~ source('bronze_streamline', source_name.lower() ~ source_version.lower()), info=True) }} - {{ log("", info=True) }} - - {% set config_log = '\n' %} - {% set config_log = config_log ~ '\n=== DBT Model Config ===\n'%} - {% set config_log = config_log ~ '\n{{ config (\n' %} - {% set config_log = config_log ~ ' materialized = "' ~ config.get('materialized') ~ '",\n' %} - {% set config_log = config_log ~ ' tags = ' ~ config.get('tags') | tojson ~ '\n' %} - {% set config_log = config_log ~ ') }}\n' %} - {{ log(config_log, info=True) }} - {{ log("", info=True) }} - -{%- endif -%} - -{% endmacro %} \ No newline at end of file diff --git a/macros/fsc_evm_temp/main_package/logging/complete.sql b/macros/fsc_evm_temp/main_package/logging/complete.sql deleted file mode 100644 index 3637b41e..00000000 --- a/macros/fsc_evm_temp/main_package/logging/complete.sql +++ /dev/null @@ -1,29 +0,0 @@ -{% macro log_complete_details(post_hook, full_refresh_type, uses_receipts_by_hash) %} - -{%- if flags.WHICH == 'compile' and execute -%} - - {% if uses_receipts_by_hash %} - - {{ log("=== Current Variable Settings ===", info=True) }} - {{ log("USES_RECEIPTS_BY_HASH: " ~ uses_receipts_by_hash, info=True) }} - - {% endif %} - - {% set config_log = '\n' %} - {% set config_log = config_log ~ '\n=== DBT Model Config ===\n'%} - {% set config_log = config_log ~ '\n{{ config (\n' %} - {% set config_log = config_log ~ ' materialized = "' ~ config.get('materialized') ~ '",\n' %} - {% set config_log = config_log ~ ' unique_key = "' ~ config.get('unique_key') ~ '",\n' %} - {% set config_log = config_log ~ ' cluster_by = "' ~ config.get('cluster_by') ~ '",\n' %} - {% set config_log = config_log ~ ' merge_update_columns = ' ~ config.get('merge_update_columns') | tojson ~ ',\n' %} - {% set config_log = config_log ~ ' post_hook = "' ~ post_hook ~ '",\n' %} - {% set config_log = config_log ~ ' incremental_predicates = ' ~ config.get('incremental_predicates') | tojson ~ ',\n' %} - {% set config_log = config_log ~ ' full_refresh = ' ~ full_refresh_type ~ ',\n' %} - {% set config_log = config_log ~ ' tags = ' ~ config.get('tags') | tojson ~ '\n' %} - {% set config_log = config_log ~ ') }}\n' %} - {{ log(config_log, info=True) }} - {{ log("", info=True) }} - -{%- endif -%} - -{% endmacro %} \ No newline at end of file diff --git a/macros/fsc_evm_temp/main_package/logging/logging.sql b/macros/fsc_evm_temp/main_package/logging/logging.sql deleted file mode 100644 index f3686852..00000000 --- a/macros/fsc_evm_temp/main_package/logging/logging.sql +++ /dev/null @@ -1,36 +0,0 @@ -{% macro log_model_details(vars=false, params=false) %} - -{%- if execute -%} -/* -DBT Model Config: -{{ model.config | tojson(indent=2) }} -*/ - -{% if vars is not false %} - -{% if var('LOG_MODEL_DETAILS', false) %} -{{ log( vars | tojson(indent=2), info=True) }} -{% endif %} -/* -Variables: -{{ vars | tojson(indent=2) }} -*/ -{% endif %} - -{% if params is not false %} - -{% if var('LOG_MODEL_DETAILS', false) %} -{{ log( params | tojson(indent=2), info=True) }} -{% endif %} -/* -Parameters: -{{ params | tojson(indent=2) }} -*/ -{% endif %} - -/* -Raw Code: -{{ model.raw_code }} -*/ -{%- endif -%} -{% endmacro %} \ No newline at end of file diff --git a/macros/fsc_evm_temp/main_package/logging/requests.sql b/macros/fsc_evm_temp/main_package/logging/requests.sql deleted file mode 100644 index 85cbbda1..00000000 --- a/macros/fsc_evm_temp/main_package/logging/requests.sql +++ /dev/null @@ -1,55 +0,0 @@ -{% macro log_streamline_details(model_name, model_type, node_url, model_quantum_state, sql_limit, testing_limit, order_by_clause, new_build, streamline_params, uses_receipts_by_hash, method, method_params, min_block=0) %} - -{%- if flags.WHICH == 'compile' and execute -%} - - {{ log("=== Current Variable Settings ===", info=True) }} - {{ log("START_UP_BLOCK: " ~ min_block, info=True) }} - {{ log("", info=True) }} - - {{ log("=== API Details ===", info=True) }} - - {{ log("NODE_URL: " ~ node_url, info=True) }} - {{ log("NODE_SECRET_PATH: " ~ var('GLOBAL_NODE_SECRET_PATH'), info=True) }} - {{ log("", info=True) }} - - {{ log("=== Current Variable Settings ===", info=True) }} - - {{ log((model_name ~ '_' ~ model_type ~ '_model_quantum_state').upper() ~ ': ' ~ model_quantum_state, info=True) }} - {{ log((model_name ~ '_' ~ model_type ~ '_sql_limit').upper() ~ ': ' ~ sql_limit, info=True) }} - {{ log((model_name ~ '_' ~ model_type ~ '_testing_limit').upper() ~ ': ' ~ testing_limit, info=True) }} - {{ log((model_name ~ '_' ~ model_type ~ '_order_by_clause').upper() ~ ': ' ~ order_by_clause, info=True) }} - {{ log((model_name ~ '_' ~ model_type ~ '_new_build').upper() ~ ': ' ~ new_build, info=True) }} - {{ log('USES_RECEIPTS_BY_HASH' ~ ': ' ~ uses_receipts_by_hash, info=True) }} - {{ log("", info=True) }} - - {{ log("=== RPC Details ===", info=True) }} - - {{ log(model_name ~ ": {", info=True) }} - {{ log(" method: '" ~ method ~ "',", info=True) }} - {{ log(" method_params: " ~ method_params, info=True) }} - {{ log("}", info=True) }} - {{ log("", info=True) }} - - {% set params_str = streamline_params | tojson %} - {% set params_formatted = params_str | replace('{', '{\n ') | replace('}', '\n }') | replace(', ', ',\n ') %} - - {# Clean up the method_params formatting #} - {% set params_formatted = params_formatted | replace('"method_params": "', '"method_params": "') | replace('\\n', ' ') | replace('\\u0027', "'") %} - - {% set config_log = '\n' %} - {% set config_log = config_log ~ '\n=== DBT Model Config ===\n'%} - {% set config_log = config_log ~ '\n{{ config (\n' %} - {% set config_log = config_log ~ ' materialized = "' ~ config.get('materialized') ~ '",\n' %} - {% set config_log = config_log ~ ' post_hook = fsc_utils.if_data_call_function_v2(\n' %} - {% set config_log = config_log ~ ' func = "streamline.udf_bulk_rest_api_v2",\n' %} - {% set config_log = config_log ~ ' target = "' ~ this.schema ~ '.' ~ this.identifier ~ '",\n' %} - {% set config_log = config_log ~ ' params = ' ~ params_formatted ~ '\n' %} - {% set config_log = config_log ~ ' ),\n' %} - {% set config_log = config_log ~ ' tags = ' ~ config.get('tags') | tojson ~ '\n' %} - {% set config_log = config_log ~ ') }}\n' %} - {{ log(config_log, info=True) }} - {{ log("", info=True) }} - -{%- endif -%} - -{% endmacro %} \ No newline at end of file diff --git a/macros/fsc_evm_temp/main_package/streamline/set_default_variables.sql b/macros/fsc_evm_temp/main_package/streamline/set_default_variables.sql deleted file mode 100644 index 598c3b95..00000000 --- a/macros/fsc_evm_temp/main_package/streamline/set_default_variables.sql +++ /dev/null @@ -1,47 +0,0 @@ -{% macro set_default_variables_streamline(model_name, model_type) %} - -{%- set node_url = var('GLOBAL_NODE_URL', '{Service}/{Authentication}') -%} -{%- set node_secret_path = var('GLOBAL_NODE_SECRET_PATH', '') -%} -{%- set model_quantum_state = var((model_name ~ '_' ~ model_type ~ '_quantum_state').upper(), 'streamline') -%} -{%- set testing_limit = var((model_name ~ '_' ~ model_type ~ '_testing_limit').upper(), none) -%} -{%- set new_build = var((model_name ~ '_' ~ model_type ~ '_new_build').upper(), false) -%} -{%- set default_order = 'ORDER BY partition_key DESC, block_number DESC' if model_type.lower() == 'realtime' - else 'ORDER BY partition_key ASC, block_number ASC' -%} -{%- set order_by_clause = var((model_name ~ '_' ~ model_type ~ '_order_by_clause').upper(), default_order) -%} -{%- set uses_receipts_by_hash = var('GLOBAL_USES_RECEIPTS_BY_HASH', false) -%} - -{%- set variables = { - 'node_url': node_url, - 'node_secret_path': node_secret_path, - 'model_quantum_state': model_quantum_state, - 'testing_limit': testing_limit, - 'new_build': new_build, - 'order_by_clause': order_by_clause, - 'uses_receipts_by_hash': uses_receipts_by_hash -} -%} - -{{ return(variables) }} - -{% endmacro %} - -{% macro set_default_variables_bronze(source_name, model_type) %} - -{%- set partition_function = var(source_name ~ model_type ~ '_PARTITION_FUNCTION', - "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 4), '_', 1) AS INTEGER)") --%} -{%- set partition_join_key = var(source_name ~ model_type ~ '_PARTITION_JOIN_KEY', 'partition_key') -%} -{%- set block_number = var(source_name ~ model_type ~ '_BLOCK_NUMBER', true) -%} -{%- set balances = var(source_name ~ model_type ~ '_BALANCES', false) -%} -{%- set uses_receipts_by_hash = var('GLOBAL_USES_RECEIPTS_BY_HASH', false) -%} - -{%- set variables = { - 'partition_function': partition_function, - 'partition_join_key': partition_join_key, - 'block_number': block_number, - 'balances': balances, - 'uses_receipts_by_hash': uses_receipts_by_hash -} -%} - -{{ return(variables) }} - -{% endmacro %} \ No newline at end of file diff --git a/macros/fsc_evm_temp/main_package/streamline/set_streamline_parameters.sql b/macros/fsc_evm_temp/main_package/streamline/set_streamline_parameters.sql deleted file mode 100644 index 9c7262f4..00000000 --- a/macros/fsc_evm_temp/main_package/streamline/set_streamline_parameters.sql +++ /dev/null @@ -1,57 +0,0 @@ -{% macro set_streamline_parameters(model_name, model_type, multiplier=1) %} - -{%- set rpc_config_details = { - "blocks_transactions": { - "method": 'eth_getBlockByNumber', - "method_params": 'ARRAY_CONSTRUCT(utils.udf_int_to_hex(block_number), TRUE)', - "exploded_key": ['result', 'result.transactions'] - }, - "receipts_by_hash": { - "method": 'eth_getTransactionReceipt', - "method_params": 'ARRAY_CONSTRUCT(tx_hash)' - }, - "receipts": { - "method": 'eth_getBlockReceipts', - "method_params": 'ARRAY_CONSTRUCT(utils.udf_int_to_hex(block_number))', - "exploded_key": ['result'], - "lambdas": 2 - - }, - "traces": { - "method": 'debug_traceBlockByNumber', - "method_params": "ARRAY_CONSTRUCT(utils.udf_int_to_hex(block_number), OBJECT_CONSTRUCT('tracer', 'callTracer', 'timeout', '120s'))", - "exploded_key": ['result'], - "lambdas": 2 - }, - "confirm_blocks": { - "method": 'eth_getBlockByNumber', - "method_params": 'ARRAY_CONSTRUCT(utils.udf_int_to_hex(block_number), FALSE)' - } -} -%} - -{%- set rpc_config = rpc_config_details[model_name.lower()] -%} - -{%- set params = { - "external_table": var((model_name ~ '_' ~ model_type ~ '_external_table').upper(), model_name.lower()), - "sql_limit": var((model_name ~ '_' ~ model_type ~ '_sql_limit').upper(), 2 * var('GLOBAL_BLOCKS_PER_HOUR',0) * multiplier), - "producer_batch_size": var((model_name ~ '_' ~ model_type ~ '_producer_batch_size').upper(), 2 * var('GLOBAL_BLOCKS_PER_HOUR',0) * multiplier), - "worker_batch_size": var( - (model_name ~ '_' ~ model_type ~ '_worker_batch_size').upper(), - (2 * var('GLOBAL_BLOCKS_PER_HOUR',0) * multiplier) // (rpc_config.get('lambdas', 1)) - ), - "sql_source": (model_name ~ '_' ~ model_type).lower(), - "method": rpc_config['method'], - "method_params": rpc_config['method_params'] -} -%} - -{%- if rpc_config.get('exploded_key') is not none -%} - {%- do params.update({"exploded_key": tojson(rpc_config['exploded_key'])}) -%} -{%- endif -%} - -{%- if rpc_config.get('lambdas') is not none -%} - {%- do params.update({"lambdas": rpc_config['lambdas']}) -%} -{%- endif -%} - -{{ return(params) }} - -{% endmacro %} \ No newline at end of file diff --git a/macros/streamline/api_integrations.sql b/macros/streamline/api_integrations.sql deleted file mode 100644 index fc32563f..00000000 --- a/macros/streamline/api_integrations.sql +++ /dev/null @@ -1,25 +0,0 @@ -{% macro create_aws_optimism_api() %} - {{ log("Creating integration for target:" ~ target) }} - {% if target.name == "prod" %} - {% set sql %} - CREATE api integration IF NOT EXISTS aws_optimism_api_prod api_provider = aws_api_gateway api_aws_role_arn = 'arn:aws:iam::490041342817:role/snowflake-api-optimism' api_allowed_prefixes = ( - 'https://s7qxto6wkd.execute-api.us-east-1.amazonaws.com/prod/' - ) enabled = TRUE; - {% endset %} - {% do run_query(sql) %} - {% elif target.name == "dev" %} - {% set sql %} - CREATE api integration IF NOT EXISTS aws_optimism_api_dev api_provider = aws_api_gateway api_aws_role_arn = 'arn:aws:iam::490041342817:role/snowflake-api-optimism' api_allowed_prefixes = ( - 'https://ngiz4ozok1.execute-api.us-east-1.amazonaws.com/dev/' - ) enabled = TRUE; - {% endset %} - {% do run_query(sql) %} - {% elif target.name == "sbx" %} - {% set sql %} - CREATE api integration IF NOT EXISTS aws_optimism_api_sbx_shah api_provider = aws_api_gateway api_aws_role_arn = 'arn:aws:iam::579011195466:role/snowflake-api-optimism' api_allowed_prefixes = ( - 'https://3ifufl19z4.execute-api.us-east-1.amazonaws.com/sbx/' - ) enabled = TRUE; - {% endset %} - {% do run_query(sql) %} - {% endif %} -{% endmacro %} diff --git a/macros/streamline/get_base_table_udft.sql b/macros/streamline/get_base_table_udft.sql deleted file mode 100644 index 9dbe2fff..00000000 --- a/macros/streamline/get_base_table_udft.sql +++ /dev/null @@ -1,23 +0,0 @@ -{% macro create_udtf_get_base_table(schema) %} -create or replace function {{ schema }}.udtf_get_base_table(max_height integer) -returns table (height number) -as -$$ - with base as ( - select - row_number() over ( - order by - seq4() - ) as id - from - table(generator(rowcount => 1000000000)) - ) -select - id as height -from - base -where - id <= max_height -$$ -; -{% endmacro %} \ No newline at end of file diff --git a/macros/streamline/streamline_udfs.sql b/macros/streamline/streamline_udfs.sql deleted file mode 100644 index 447a72d9..00000000 --- a/macros/streamline/streamline_udfs.sql +++ /dev/null @@ -1,42 +0,0 @@ -{% macro create_udf_get_chainhead() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_get_chainhead() returns variant api_integration = - {% if target.name == "prod" %} - aws_optimism_api AS 'https://s7qxto6wkd.execute-api.us-east-1.amazonaws.com/prod/get_chainhead' - {% else %} - aws_optimism_api_dev AS 'https://ngiz4ozok1.execute-api.us-east-1.amazonaws.com/dev/get_chainhead' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_bulk_json_rpc() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_bulk_json_rpc( - json variant - ) returns text api_integration = {% if target.name == "prod" %} - aws_optimism_api AS 'https://s7qxto6wkd.execute-api.us-east-1.amazonaws.com/prod/udf_bulk_json_rpc' - {% else %} - aws_optimism_api_dev AS 'https://ngiz4ozok1.execute-api.us-east-1.amazonaws.com/dev/udf_bulk_json_rpc' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_bulk_decode_logs() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_bulk_decode_logs( - json OBJECT - ) returns ARRAY api_integration = {% if target.name == "prod" %} - aws_optimism_api AS 'https://s7qxto6wkd.execute-api.us-east-1.amazonaws.com/prod/bulk_decode_logs' - {% else %} - aws_optimism_api_dev AS'https://ngiz4ozok1.execute-api.us-east-1.amazonaws.com/dev/bulk_decode_logs' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_bulk_get_traces() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_bulk_get_traces( - json variant - ) returns text api_integration = {% if target.name == "prod" %} - aws_optimism_api AS 'https://s7qxto6wkd.execute-api.us-east-1.amazonaws.com/prod/udf_bulk_get_traces' - {% else %} - aws_optimism_api_dev AS 'https://ngiz4ozok1.execute-api.us-east-1.amazonaws.com/dev/udf_bulk_get_traces' - {%- endif %}; -{% endmacro %} \ No newline at end of file diff --git a/macros/tests/missing_decoding.sql b/macros/tests/missing_decoding.sql deleted file mode 100644 index 826638a1..00000000 --- a/macros/tests/missing_decoding.sql +++ /dev/null @@ -1,26 +0,0 @@ -{% test missing_decoded_logs(model) %} -SELECT - l.block_number, - CONCAT( - l.tx_hash, - '-', - l.event_index - ) AS _log_id -FROM - {{ ref('core__fact_event_logs') }} - l - LEFT JOIN {{ model }} - d - ON l.block_number = d.block_number - AND CONCAT( - l.tx_hash, - '-', - l.event_index - ) = d._log_id -WHERE - l.contract_address = LOWER('0x4200000000000000000000000000000000000006') -- WETH - AND l.topics [0] :: STRING = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' -- Transfer - AND l.block_timestamp BETWEEN DATEADD('hour', -48, SYSDATE()) - AND DATEADD('hour', -6, SYSDATE()) - AND d._log_id IS NULL -{% endtest %} diff --git a/macros/tests/missing_txs.sql b/macros/tests/missing_txs.sql deleted file mode 100644 index 373ffd4b..00000000 --- a/macros/tests/missing_txs.sql +++ /dev/null @@ -1,124 +0,0 @@ -{% macro missing_txs( - model - ) %} - WITH txs_base AS ( - SELECT - block_number AS base_block_number, - tx_hash AS base_tx_hash - FROM - {{ ref('test_silver__transactions_full') }} - ), - model_name AS ( - SELECT - block_number AS model_block_number, - tx_hash AS model_tx_hash - FROM - {{ model }} - ) -SELECT - base_block_number, - base_tx_hash, - model_block_number, - model_tx_hash -FROM - txs_base - LEFT JOIN model_name - ON base_block_number = model_block_number - AND base_tx_hash = model_tx_hash -WHERE - ( - model_tx_hash IS NULL - OR model_block_number IS NULL - ) - AND - base_block_number NOT IN ( - SELECT - block_number - FROM - {{ ref('silver_observability__excluded_receipt_blocks') }} -) -{% endmacro %} - -{% macro recent_missing_txs( - model - ) %} - WITH txs_base AS ( - SELECT - block_number AS base_block_number, - tx_hash AS base_tx_hash - FROM - {{ ref('test_silver__transactions_recent') }} - ), - model_name AS ( - SELECT - block_number AS model_block_number, - tx_hash AS model_tx_hash - FROM - {{ model }} - ) -SELECT - base_block_number, - base_tx_hash, - model_block_number, - model_tx_hash -FROM - txs_base - LEFT JOIN model_name - ON base_block_number = model_block_number - AND base_tx_hash = model_tx_hash -WHERE - (model_tx_hash IS NULL - OR model_block_number IS NULL) - AND - base_block_number NOT IN ( - SELECT - block_number - FROM - {{ ref('silver_observability__excluded_receipt_blocks') }} -) -{% endmacro %} - -{% macro missing_confirmed_txs( - model1, - model2 - ) %} - WITH txs_base AS ( - SELECT - block_number AS base_block_number, - block_hash AS base_block_hash, - tx_hash AS base_tx_hash - FROM - {{ model1 }} - ), - model_name AS ( - SELECT - block_number AS model_block_number, - block_hash AS model_block_hash, - tx_hash AS model_tx_hash - FROM - {{ model2 }} - ) -SELECT - DISTINCT base_block_number AS block_number -FROM - txs_base - LEFT JOIN model_name - ON base_block_number = model_block_number - AND base_tx_hash = model_tx_hash - AND base_block_hash = model_block_hash -WHERE - model_tx_hash IS NULL - AND model_block_number <= ( - SELECT - MAX(base_block_number) - FROM - txs_base - ) - AND - base_block_number NOT IN ( - SELECT - block_number - FROM - {{ ref('silver_observability__excluded_receipt_blocks') }} -) -{% endmacro %} diff --git a/macros/utils.sql b/macros/utils.sql deleted file mode 100644 index 14de2a46..00000000 --- a/macros/utils.sql +++ /dev/null @@ -1,78 +0,0 @@ -{% macro if_data_call_function( - func, - target - ) %} - {% if var( - "STREAMLINE_INVOKE_STREAMS" - ) %} - {% if execute %} - {{ log( - "Running macro `if_data_call_function`: Calling udf " ~ func ~ " on " ~ target, - True - ) }} - {% endif %} - SELECT - {{ func }} - WHERE - EXISTS( - SELECT - 1 - FROM - {{ target }} - LIMIT - 1 - ) - {% else %} - {% if execute %} - {{ log( - "Running macro `if_data_call_function`: NOOP", - False - ) }} - {% endif %} - SELECT - NULL - {% endif %} -{% endmacro %} - -{% macro if_data_call_wait() %} - {% if var( - "STREAMLINE_INVOKE_STREAMS" - ) %} - {% set query %} - SELECT - 1 - WHERE - EXISTS( - SELECT - 1 - FROM - {{ model.schema ~ "." ~ model.alias }} - LIMIT - 1 - ) {% endset %} - {% if execute %} - {% set results = run_query( - query - ) %} - {% if results %} - {{ log( - "Waiting...", - info = True - ) }} - - {% set wait_query %} - SELECT - system$wait( - {{ var( - "WAIT", - 600 - ) }} - ) {% endset %} - {% do run_query(wait_query) %} - {% else %} - SELECT - NULL; - {% endif %} - {% endif %} - {% endif %} -{% endmacro %} \ No newline at end of file diff --git a/models/bronze/api_udf/_retry_abis.sql b/models/bronze/api_udf/_retry_abis.sql deleted file mode 100644 index 9c93b50e..00000000 --- a/models/bronze/api_udf/_retry_abis.sql +++ /dev/null @@ -1,88 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH retry AS ( - - SELECT - contract_address, - GREATEST( - latest_call_block, - latest_event_block - ) AS block_number, - total_interaction_count - FROM - {{ ref("silver__relevant_contracts") }} - r - LEFT JOIN {{ source( - 'optimism_silver', - 'verified_abis' - ) }} - v USING (contract_address) - WHERE - r.total_interaction_count >= 250 -- high interaction count - AND GREATEST( - max_inserted_timestamp_logs, - max_inserted_timestamp_traces - ) >= CURRENT_DATE - INTERVAL '30 days' -- recent activity - AND v.contract_address IS NULL -- no verified abi - AND r.contract_address NOT IN ( - SELECT - contract_address - FROM - {{ source( - 'optimism_bronze_api', - 'contract_abis' - ) }} - WHERE - _inserted_timestamp >= CURRENT_DATE - INTERVAL '30 days' -- this won't let us retry the same contract within 30 days - AND abi_data :data :result :: STRING <> 'Max rate limit reached' - ) - - ORDER BY - total_interaction_count DESC - LIMIT - 25 -), FINAL AS ( - SELECT - proxy_address AS contract_address, - start_block AS block_number - FROM - {{ ref("silver__proxies") }} - p - JOIN retry r USING (contract_address) - LEFT JOIN {{ source( - 'optimism_silver', - 'verified_abis' - ) }} - v - ON v.contract_address = p.proxy_address - WHERE - v.contract_address IS NULL - AND p.contract_address NOT IN ( - SELECT - contract_address - FROM - {{ source( - 'optimism_bronze_api', - 'contract_abis' - ) }} - WHERE - _inserted_timestamp >= CURRENT_DATE - INTERVAL '30 days' -- this won't let us retry the same contract within 30 days - AND abi_data :data :result :: STRING <> 'Max rate limit reached' - ) - UNION ALL - SELECT - contract_address, - block_number - FROM - retry -) -SELECT - * -FROM - FINAL qualify ROW_NUMBER() over ( - PARTITION BY contract_address - ORDER BY - block_number DESC - ) = 1 diff --git a/models/bronze/api_udf/bronze_api__contract_abis.sql b/models/bronze/api_udf/bronze_api__contract_abis.sql deleted file mode 100644 index b7fd2132..00000000 --- a/models/bronze/api_udf/bronze_api__contract_abis.sql +++ /dev/null @@ -1,79 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = "contract_address", - full_refresh = false, - tags = ['curated'] -) }} - -WITH base AS ( - - SELECT - contract_address - FROM - {{ ref('silver__relevant_contracts') }} - WHERE - total_interaction_count >= 100 - -{% if is_incremental() %} -and contract_address not in ( -SELECT - contract_address -FROM - {{ this }} - WHERE - abi_data :data :result :: STRING <> 'Max rate limit reached' -) -{% endif %} -order by total_interaction_count desc -LIMIT - 400 -), all_contracts AS ( - SELECT - contract_address - FROM - base - UNION - SELECT - contract_address - FROM - {{ ref('_retry_abis') }} -), -row_nos AS ( - SELECT - contract_address, - ROW_NUMBER() over ( - ORDER BY - contract_address - ) AS row_no - FROM - all_contracts -), -batched AS ({% for item in range(501) %} -SELECT - rn.contract_address, - live.udf_api( - 'GET', - CONCAT('https://api-optimistic.etherscan.io/api?module=contract&action=getabi&address=', rn.contract_address, '&apikey={key}'), - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', 'livequery' - ), - NULL, - 'Vault/prod/block_explorers/optimism_scan' - ) AS abi_data, - SYSDATE() AS _inserted_timestamp -FROM - row_nos rn -WHERE - row_no = {{ item }} - - {% if not loop.last %} - UNION ALL - {% endif %} -{% endfor %}) -SELECT - contract_address, - abi_data, - _inserted_timestamp -FROM - batched diff --git a/models/bronze/api_udf/bronze_api__contract_abis.yml b/models/bronze/api_udf/bronze_api__contract_abis.yml deleted file mode 100644 index 9216204b..00000000 --- a/models/bronze/api_udf/bronze_api__contract_abis.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: 2 -models: - - name: bronze_api__contract_abis - - columns: - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - VARCHAR - - dbt_expectations.expect_column_values_to_match_regex: - regex: "^(0x)[0-9a-fA-F]{40}$" \ No newline at end of file diff --git a/models/bronze/api_udf/bronze_api__token_reads.sql b/models/bronze/api_udf/bronze_api__token_reads.sql deleted file mode 100644 index 4275d0aa..00000000 --- a/models/bronze/api_udf/bronze_api__token_reads.sql +++ /dev/null @@ -1,130 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = "contract_address", - full_refresh = false, - tags = ['non_realtime'] -) }} - -WITH base AS ( - - SELECT - contract_address, - latest_event_block AS latest_block - FROM - {{ ref('silver__relevant_contracts') }} - WHERE - total_event_count >= 25 - -{% if is_incremental() %} -AND contract_address NOT IN ( - SELECT - contract_address - FROM - {{ this }} -) -{% endif %} -ORDER BY - total_event_count DESC -LIMIT - 500 -), function_sigs AS ( - SELECT - '0x313ce567' AS function_sig, - 'decimals' AS function_name - UNION - SELECT - '0x06fdde03', - 'name' - UNION - SELECT - '0x95d89b41', - 'symbol' -), -all_reads AS ( - SELECT - * - FROM - base - JOIN function_sigs - ON 1 = 1 -), -ready_reads AS ( - SELECT - contract_address, - latest_block, - function_sig, - RPAD( - function_sig, - 64, - '0' - ) AS input, - utils.udf_json_rpc_call( - 'eth_call', - [{'to': contract_address, 'from': null, 'data': input}, utils.udf_int_to_hex(latest_block)], - concat_ws( - '-', - contract_address, - input, - latest_block - ) - ) AS rpc_request - FROM - all_reads -), -batch_reads AS ( - SELECT - ARRAY_AGG(rpc_request) AS batch_rpc_request - FROM - ready_reads -), -node_call AS ( - SELECT - *, - live.udf_api( - 'POST', - CONCAT( - '{service}', - '/', - '{Authentication}' - ),{}, - batch_rpc_request, - 'Vault/prod/optimism/quicknode/mainnet' - ) AS response - FROM - batch_reads - WHERE - EXISTS ( - SELECT - 1 - FROM - ready_reads - LIMIT - 1 - ) -), flat_responses AS ( - SELECT - VALUE :id :: STRING AS call_id, - VALUE :result :: STRING AS read_result - FROM - node_call, - LATERAL FLATTEN ( - input => response :data - ) -) -SELECT - SPLIT_PART( - call_id, - '-', - 1 - ) AS contract_address, - SPLIT_PART( - call_id, - '-', - 3 - ) AS block_number, - LEFT(SPLIT_PART(call_id, '-', 2), 10) AS function_sig, - NULL AS function_input, - read_result, - SYSDATE() :: TIMESTAMP AS _inserted_timestamp -FROM - flat_responses diff --git a/models/bronze/api_udf/bronze_api__token_reads.yml b/models/bronze/api_udf/bronze_api__token_reads.yml deleted file mode 100644 index 10ac0f3b..00000000 --- a/models/bronze/api_udf/bronze_api__token_reads.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: 2 -models: - - name: bronze_api__token_reads - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - CONTRACT_ADDRESS - - FUNCTION_SIG - columns: - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 3 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ \ No newline at end of file diff --git a/models/bronze/ethereum/bronze__state_hashes.sql b/models/bronze/bronze__state_hashes.sql similarity index 94% rename from models/bronze/ethereum/bronze__state_hashes.sql rename to models/bronze/bronze__state_hashes.sql index e4170770..bf2e3ee7 100644 --- a/models/bronze/ethereum/bronze__state_hashes.sql +++ b/models/bronze/bronze__state_hashes.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "state_block_number", - tags = ['ethereum','non_realtime'] + tags = ['bronze','ethereum'] ) }} SELECT @@ -40,4 +40,4 @@ WHERE FROM {{ this }} ) -{% endif %} +{% endif %} \ No newline at end of file diff --git a/models/bronze/ethereum/bronze__submission_hashes.sql b/models/bronze/bronze__submission_hashes.sql similarity index 94% rename from models/bronze/ethereum/bronze__submission_hashes.sql rename to models/bronze/bronze__submission_hashes.sql index acd42a56..130956be 100644 --- a/models/bronze/ethereum/bronze__submission_hashes.sql +++ b/models/bronze/bronze__submission_hashes.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "l1_submission_block_number", - tags = ['ethereum','non_realtime'] + tags = ['bronze','ethereum'] ) }} SELECT @@ -38,4 +38,4 @@ WHERE FROM {{ this }} ) -{% endif %} +{% endif %} \ No newline at end of file diff --git a/models/bronze/labels/bronze__labels.sql b/models/bronze/labels/bronze__labels.sql deleted file mode 100644 index fa3b9326..00000000 --- a/models/bronze/labels/bronze__labels.sql +++ /dev/null @@ -1,25 +0,0 @@ -{{ config( - materialized = 'view' -) }} - -SELECT - system_created_at, - insert_date, - blockchain, - address, - creator, - label_type, - label_subtype, - address_name, - project_name, - _is_deleted, - modified_timestamp, - labels_combined_id -FROM - {{ source( - 'silver_crosschain', - 'labels_combined' - ) }} -WHERE - blockchain = 'optimism' - AND address LIKE '0x%' diff --git a/models/bronze/overflow/bronze__overflowed_traces.sql b/models/bronze/overflow/bronze__overflowed_traces.sql deleted file mode 100644 index d10f9817..00000000 --- a/models/bronze/overflow/bronze__overflowed_traces.sql +++ /dev/null @@ -1,80 +0,0 @@ -{{ config ( - materialized = "view", - tags = ['overflowed_traces'] -) }} - -{% for item in range( - 1, - 11 - ) %} - - SELECT - o.file_name, - f.block_number, - f.index_vals, - f.path, - f.key, - f.value_ - FROM - ( - SELECT - file_name, - file_url, - index_cols, - [overflowed_block, overflowed_tx] AS index_vals - FROM - ( - SELECT - block_number, - POSITION, - file_name, - file_url, - index_cols, - VALUE [0] AS overflowed_block, - VALUE [1] AS overflowed_tx, - block_number = overflowed_block - AND POSITION = overflowed_tx AS missing - FROM - ( - SELECT - block_number, - POSITION, - file_name, - file_url, - index_cols, - utils.udf_detect_overflowed_responses( - file_url, - index_cols - ) AS index_vals - FROM - {{ ref("bronze__potential_overflowed_traces") }} - WHERE - row_no = {{ item }} - ), - LATERAL FLATTEN ( - input => index_vals - ) - ) - WHERE - missing = TRUE - ) o, - TABLE( - utils.udtf_flatten_overflowed_responses( - o.file_url, - o.index_cols, - [o.index_vals] - ) - ) f - WHERE - NOT IS_OBJECT( - f.value_ - ) - AND NOT IS_ARRAY( - f.value_ - ) - AND NOT IS_NULL_VALUE( - f.value_ - ) {% if not loop.last %} - UNION ALL - {% endif %} - {% endfor %} diff --git a/models/bronze/overflow/bronze__potential_overflowed_traces.sql b/models/bronze/overflow/bronze__potential_overflowed_traces.sql deleted file mode 100644 index f6822c61..00000000 --- a/models/bronze/overflow/bronze__potential_overflowed_traces.sql +++ /dev/null @@ -1,80 +0,0 @@ -{{ config ( - materialized = "view", - tags = ['overflowed_traces'] -) }} - -WITH impacted_blocks AS ( - - SELECT - blocks_impacted_array - FROM - {{ ref("silver_observability__traces_completeness") }} - ORDER BY - test_timestamp DESC - LIMIT - 1 -), all_missing AS ( - SELECT - DISTINCT VALUE :: INT AS block_number - FROM - impacted_blocks, - LATERAL FLATTEN ( - input => blocks_impacted_array - ) -), -all_txs AS ( - SELECT - block_number, - POSITION AS tx_position, - tx_hash - FROM - {{ ref("silver__transactions") }} - JOIN all_missing USING (block_number) -), -missing_txs AS ( - SELECT - DISTINCT txs.block_number, - txs.tx_position, - file_name - FROM - all_txs txs - LEFT JOIN {{ source( - "optimism_gold", - "fact_traces" - ) }} - tr2 USING ( - block_number, - tx_position - ) - JOIN {{ ref("streamline__traces_complete") }} USING (block_number) - LEFT JOIN {{ source( - 'optimism_silver', - 'overflowed_traces' - ) }} - ot USING ( - block_number, - tx_position - ) - WHERE - tr2.block_number IS NULL - AND ot.block_number IS NULL -) -SELECT - block_number, - tx_position AS POSITION, - file_name, - build_scoped_file_url( - @streamline.bronze.OPTIMISM_SERVERLESS_PROD, - file_name - ) AS file_url, - ['block_number', 'array_index'] AS index_cols, - ROW_NUMBER() over ( - ORDER BY - block_number ASC, - POSITION ASC - ) AS row_no -FROM - missing_txs -ORDER BY - block_number ASC, - POSITION ASC diff --git a/models/bronze/prices/bronze__complete_native_asset_metadata.sql b/models/bronze/prices/bronze__complete_native_asset_metadata.sql deleted file mode 100644 index 39001f39..00000000 --- a/models/bronze/prices/bronze__complete_native_asset_metadata.sql +++ /dev/null @@ -1,26 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - asset_id, - symbol, - NAME, - decimals, - blockchain, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_native_asset_metadata_id, - _invocation_id -FROM - {{ source( - 'silver_crosschain', - 'complete_native_asset_metadata' - ) }} -WHERE - blockchain = 'ethereum' - AND symbol = 'ETH' diff --git a/models/bronze/prices/bronze__complete_native_prices.sql b/models/bronze/prices/bronze__complete_native_prices.sql deleted file mode 100644 index 84539f0f..00000000 --- a/models/bronze/prices/bronze__complete_native_prices.sql +++ /dev/null @@ -1,29 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - HOUR, - asset_id, - symbol, - NAME, - decimals, - price, - blockchain, - is_imputed, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_native_prices_id, - _invocation_id -FROM - {{ source( - 'silver_crosschain', - 'complete_native_prices' - ) }} -WHERE - blockchain = 'ethereum' - AND symbol = 'ETH' diff --git a/models/bronze/prices/bronze__complete_provider_asset_metadata.sql b/models/bronze/prices/bronze__complete_provider_asset_metadata.sql deleted file mode 100644 index 27b9df19..00000000 --- a/models/bronze/prices/bronze__complete_provider_asset_metadata.sql +++ /dev/null @@ -1,29 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - asset_id, - token_address, - NAME, - symbol, - platform, - platform_id, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_provider_asset_metadata_id, - _invocation_id -FROM - {{ source( - 'silver_crosschain', - 'complete_provider_asset_metadata' - ) }} -WHERE - platform IN ( - 'Optimism', - 'optimistic-ethereum' - ) --- platforms specific to Optimism \ No newline at end of file diff --git a/models/bronze/prices/bronze__complete_provider_prices.sql b/models/bronze/prices/bronze__complete_provider_prices.sql deleted file mode 100644 index 7d856361..00000000 --- a/models/bronze/prices/bronze__complete_provider_prices.sql +++ /dev/null @@ -1,24 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - asset_id, - recorded_hour, - OPEN, - high, - low, - CLOSE, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_provider_prices_id, - _invocation_id -FROM - {{ source( - 'silver_crosschain', - 'complete_provider_prices' - ) }} --- prices for all ids \ No newline at end of file diff --git a/models/bronze/prices/bronze__complete_token_asset_metadata.sql b/models/bronze/prices/bronze__complete_token_asset_metadata.sql deleted file mode 100644 index 89e20092..00000000 --- a/models/bronze/prices/bronze__complete_token_asset_metadata.sql +++ /dev/null @@ -1,28 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - token_address, - asset_id, - symbol, - NAME, - decimals, - blockchain, - blockchain_name, - blockchain_id, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_token_asset_metadata_id, - _invocation_id -FROM - {{ source( - 'silver_crosschain', - 'complete_token_asset_metadata' - ) }} -WHERE - blockchain = 'optimism' \ No newline at end of file diff --git a/models/bronze/prices/bronze__complete_token_prices.sql b/models/bronze/prices/bronze__complete_token_prices.sql deleted file mode 100644 index 468cd166..00000000 --- a/models/bronze/prices/bronze__complete_token_prices.sql +++ /dev/null @@ -1,31 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - HOUR, - token_address, - asset_id, - symbol, - NAME, - decimals, - price, - blockchain, - blockchain_name, - blockchain_id, - is_imputed, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_token_prices_id, - _invocation_id -FROM - {{ source( - 'silver_crosschain', - 'complete_token_prices' - ) }} -WHERE - blockchain = 'optimism' diff --git a/models/doc_descriptions/L1_fields/batch_size.md b/models/doc_descriptions/L1_fields/batch_size.md deleted file mode 100644 index 209b9b6d..00000000 --- a/models/doc_descriptions/L1_fields/batch_size.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_batch_size %} - -Total Optimism Txs included within batch. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/l1_batch_root.md b/models/doc_descriptions/L1_fields/l1_batch_root.md deleted file mode 100644 index bb0b2672..00000000 --- a/models/doc_descriptions/L1_fields/l1_batch_root.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_batch_root %} - -Root of batch, either for sumbission or state. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/l1_block_number.md b/models/doc_descriptions/L1_fields/l1_block_number.md deleted file mode 100644 index 67196f33..00000000 --- a/models/doc_descriptions/L1_fields/l1_block_number.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_l1_block_no %} - -The Ethereum block number that contained the batch. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/l1_block_timestamp.md b/models/doc_descriptions/L1_fields/l1_block_timestamp.md deleted file mode 100644 index 38ea604e..00000000 --- a/models/doc_descriptions/L1_fields/l1_block_timestamp.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_l1_block_time %} - -The timestamp of the Ethereum block that contained this batch. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/l1_fee_scalar.md b/models/doc_descriptions/L1_fields/l1_fee_scalar.md deleted file mode 100644 index c6ae7c83..00000000 --- a/models/doc_descriptions/L1_fields/l1_fee_scalar.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_l1_fee_scalar %} - -This value covers the change in L1 gas price between the time the transaction is submitted and when it is published. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/l1_gas_price.md b/models/doc_descriptions/L1_fields/l1_gas_price.md deleted file mode 100644 index 5e4f60e5..00000000 --- a/models/doc_descriptions/L1_fields/l1_gas_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_l1_gas_price %} - -The gas price for L1 transactions when the transaction was processed. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/l1_gas_used.md b/models/doc_descriptions/L1_fields/l1_gas_used.md deleted file mode 100644 index c0a00c8a..00000000 --- a/models/doc_descriptions/L1_fields/l1_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_l1_gas_used %} - -The gas used on L1 to publish the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/l1_state_root_batch_index.md b/models/doc_descriptions/L1_fields/l1_state_root_batch_index.md deleted file mode 100644 index 083bcde8..00000000 --- a/models/doc_descriptions/L1_fields/l1_state_root_batch_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_l1_state_batch %} - -The batch index of when this block was included in the Ethereum state root. This column will be deprecated 8/7 and will be consolidated into a array column consisting of all L1 submission details. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/l1_state_root_tx_hash.md b/models/doc_descriptions/L1_fields/l1_state_root_tx_hash.md deleted file mode 100644 index a5f8912a..00000000 --- a/models/doc_descriptions/L1_fields/l1_state_root_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_l1_state_tx_hash %} - -The L1 tx hash of when this block was included in the Ethereum state root. This column will be deprecated 8/7 and will be consolidated into a array column consisting of all L1 submission details. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/l1_submission_batch_index.md b/models/doc_descriptions/L1_fields/l1_submission_batch_index.md deleted file mode 100644 index 65bb8a6e..00000000 --- a/models/doc_descriptions/L1_fields/l1_submission_batch_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_l1_sub_batch %} - -The batch index of when this block was submitted to L1. This column will be deprecated 8/7 and will be consolidated into a array column consisting of all L1 submission details. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/l1_submission_tx_hash.md b/models/doc_descriptions/L1_fields/l1_submission_tx_hash.md deleted file mode 100644 index b33d8c46..00000000 --- a/models/doc_descriptions/L1_fields/l1_submission_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_l1_sub_tx_hash %} - -The L1 tx hash of when this block was submitted to L1. This column will be deprecated 8/7 and will be consolidated into a array column consisting of all L1 submission details. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/op_max_block.md b/models/doc_descriptions/L1_fields/op_max_block.md deleted file mode 100644 index 6b9eeeb3..00000000 --- a/models/doc_descriptions/L1_fields/op_max_block.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_max_block %} - -The max block on Optimism this batch relates to. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/op_min_block.md b/models/doc_descriptions/L1_fields/op_min_block.md deleted file mode 100644 index 52f36cc9..00000000 --- a/models/doc_descriptions/L1_fields/op_min_block.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_min_block %} - -The min block on Optimism this batch relates to. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/prev_total_elements.md b/models/doc_descriptions/L1_fields/prev_total_elements.md deleted file mode 100644 index 4a3db668..00000000 --- a/models/doc_descriptions/L1_fields/prev_total_elements.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_prev_total_elements %} - -Confirmed blocks prior to this batch. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_block_header_json.md b/models/doc_descriptions/blocks/opt_block_header_json.md deleted file mode 100644 index ac56f653..00000000 --- a/models/doc_descriptions/blocks/opt_block_header_json.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_block_header_json %} - -This JSON column contains the block header details. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_blockchain.md b/models/doc_descriptions/blocks/opt_blockchain.md deleted file mode 100644 index 70f203da..00000000 --- a/models/doc_descriptions/blocks/opt_blockchain.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_blockchain %} - -The blockchain on which transactions are being confirmed. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_blocks_hash.md b/models/doc_descriptions/blocks/opt_blocks_hash.md deleted file mode 100644 index 2df3c913..00000000 --- a/models/doc_descriptions/blocks/opt_blocks_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_blocks_hash %} - -The hash of the block header for a given block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_blocks_nonce.md b/models/doc_descriptions/blocks/opt_blocks_nonce.md deleted file mode 100644 index 87f7e162..00000000 --- a/models/doc_descriptions/blocks/opt_blocks_nonce.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_blocks_nonce %} - -Block nonce is a value used during mining to demonstrate proof of work for a given block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_blocks_table_doc.md b/models/doc_descriptions/blocks/opt_blocks_table_doc.md deleted file mode 100644 index e37988e5..00000000 --- a/models/doc_descriptions/blocks/opt_blocks_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_blocks_table_doc %} - -This table contains block level data for the Optimism Blockchain. This table can be used to analyze trends at a block level, for example gas fees vs. total transactions over time. For more information on EVM transactions, please see [Etherscan Resources](https://etherscan.io/directory/Learning_Resources/Ethereum) or [The Ethereum Organization](https://ethereum.org/en/developers/docs/blocks/) - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_difficulty.md b/models/doc_descriptions/blocks/opt_difficulty.md deleted file mode 100644 index 542addd5..00000000 --- a/models/doc_descriptions/blocks/opt_difficulty.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_difficulty %} - -The effort required to mine the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_extra_data.md b/models/doc_descriptions/blocks/opt_extra_data.md deleted file mode 100644 index 2a553f47..00000000 --- a/models/doc_descriptions/blocks/opt_extra_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_extra_data %} - -Any data included by the validator for a given block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_gas_limit.md b/models/doc_descriptions/blocks/opt_gas_limit.md deleted file mode 100644 index 9e959835..00000000 --- a/models/doc_descriptions/blocks/opt_gas_limit.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_gas_limit %} - -Total gas limit provided by all transactions in the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_gas_used.md b/models/doc_descriptions/blocks/opt_gas_used.md deleted file mode 100644 index 4f0bac9a..00000000 --- a/models/doc_descriptions/blocks/opt_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_gas_used %} - -Total gas used in the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_miner.md b/models/doc_descriptions/blocks/opt_miner.md deleted file mode 100644 index bf85a3c2..00000000 --- a/models/doc_descriptions/blocks/opt_miner.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_miner %} - -Miner who successfully added a given block to the blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_network.md b/models/doc_descriptions/blocks/opt_network.md deleted file mode 100644 index f02ab485..00000000 --- a/models/doc_descriptions/blocks/opt_network.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_network %} - -The network on the blockchain used by a transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_parent_hash.md b/models/doc_descriptions/blocks/opt_parent_hash.md deleted file mode 100644 index 999d39a5..00000000 --- a/models/doc_descriptions/blocks/opt_parent_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_parent_hash %} - -The hash of the block from which a given block is generated. Also known as the parent block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_receipts_root.md b/models/doc_descriptions/blocks/opt_receipts_root.md deleted file mode 100644 index 4e5937cb..00000000 --- a/models/doc_descriptions/blocks/opt_receipts_root.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_receipts_root %} - -The root of the state trie. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_sha3_uncles.md b/models/doc_descriptions/blocks/opt_sha3_uncles.md deleted file mode 100644 index d58cde23..00000000 --- a/models/doc_descriptions/blocks/opt_sha3_uncles.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_sha3_uncles %} - -The mechanism which Ethereum Javascript RLP encodes an empty string. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_size.md b/models/doc_descriptions/blocks/opt_size.md deleted file mode 100644 index 334d0bab..00000000 --- a/models/doc_descriptions/blocks/opt_size.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_size %} - -Block size, which is determined by a given block's gas limit. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_total_difficulty.md b/models/doc_descriptions/blocks/opt_total_difficulty.md deleted file mode 100644 index 9be72159..00000000 --- a/models/doc_descriptions/blocks/opt_total_difficulty.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_total_difficulty %} - -Total difficulty of the chain at a given block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_tx_count.md b/models/doc_descriptions/blocks/opt_tx_count.md deleted file mode 100644 index 5be143dd..00000000 --- a/models/doc_descriptions/blocks/opt_tx_count.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_count %} - -Total number of transactions within a block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/opt_uncle_blocks.md b/models/doc_descriptions/blocks/opt_uncle_blocks.md deleted file mode 100644 index 2a1f08ec..00000000 --- a/models/doc_descriptions/blocks/opt_uncle_blocks.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_uncle_blocks %} - -Uncle blocks occur when two blocks are mined and broadcasted at the same time, with the same block number. The block validated across the most nodes will be added to the primary chain, and the other one becomes an uncle block. Miners do receive rewards for uncle blocks. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/bridge/evm_bridge_activity.md b/models/doc_descriptions/bridge/evm_bridge_activity.md deleted file mode 100644 index 8a9a96d5..00000000 --- a/models/doc_descriptions/bridge/evm_bridge_activity.md +++ /dev/null @@ -1,83 +0,0 @@ -{% docs evm_bridge_table_doc %} - -A convenience table that aggregates bridge activity from event_logs, traces and transfers, including bridge deposits and transfers sent from the following protocols: ACROSS, AXELAR, CELER, CBRIDGE, DLN, DEBRIDGE, EYWA, HOP, MESON, MULTICHAIN, STARGATE, SYMBIOSIS, SYNAPSE, WORMHOLE along with other helpful columns, including an amount USD where available. Note, this table only includes records for the protocols listed above with live, onchain bridge activity and may not represent the complete bridging picture. - -{% enddocs %} - -{% docs evm_bridge_platform %} - -The platform or protocol from which the bridge transaction or event originates. - -{% enddocs %} - -{% docs evm_bridge_origin_from %} - -The from address where the transaction originated from. This may be an EOA or contract address, however in most cases this is the user that initiated the bridge deposit or transfer. - -{% enddocs %} - -{% docs evm_bridge_sender %} - -The address that initiated the bridge deposit or transfer. This address is the sender of the tokens/assets being bridged to the destination chain. This may be an EOA or contract address. - -{% enddocs %} - -{% docs evm_bridge_receiver %} - -The designated address set to receive the deposit or transfer. This may be an EOA or contract address. - -{% enddocs %} - -{% docs evm_bridge_destination_chain_receiver %} - -The designated address set to receive the bridged tokens on the target chain after the completion of the bridge transaction. For non-evm chains, the hex address is decoded/encoded to match the data format of the destination chain, where possible. This may be an EOA or contract address. - -{% enddocs %} - -{% docs evm_bridge_destination_chain %} - -The name of the blockchain network to which the assets are being bridged. It could be any EVM compatible chain or other blockchain networks that the bridging protocol supports. - -{% enddocs %} - -{% docs evm_bridge_destination_chain_id %} - -The numeric identifier associated with the destination blockchain network. This is specific to the chain and helps in uniquely identifying it. - -{% enddocs %} - -{% docs evm_bridge_address %} - -The address of the contract responsible for handling the bridge deposit or transfer. This contract mediates the transfer and ensures that assets are sent and received appropriately. - -{% enddocs %} - -{% docs evm_bridge_token_address %} - -The address associated with the token that is being bridged. It provides a unique identifier for the token within its origin blockchain. - -{% enddocs %} - -{% docs evm_bridge_token_symbol %} - -The symbol representing the token being bridged. This provides a shorthand representation of the token. - -{% enddocs %} - -{% docs evm_bridge_amount_unadj %} - -The raw, non-decimal adjusted amount of tokens involved in the bridge transaction. - -{% enddocs %} - -{% docs evm_bridge_amount %} - -The decimal adjusted amount of tokens involved in the bridge transaction, where available. - -{% enddocs %} - -{% docs evm_bridge_amount_usd %} - -The value of the bridged tokens in USD at the time of the bridge transaction, where available. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/complete_lending/complete_lending_column_docs.md b/models/doc_descriptions/complete_lending/complete_lending_column_docs.md deleted file mode 100644 index 47abca4f..00000000 --- a/models/doc_descriptions/complete_lending/complete_lending_column_docs.md +++ /dev/null @@ -1,381 +0,0 @@ -{% docs complete_lending_borrow_rate_mode %} - -The rate mode the user is swapping from. Stable: 1, Variable: 2. Borrowers can switch between the stable and variable rate at any time. Stable rates act as a fixed rate in the short-term, but can be re-balanced in the long-term in response to changes in market conditions. The variable rate is the rate based on the offer and demand. The stable rate, as its name indicates, will remain pretty stable and its the best option to plan how much interest you will have to pay. The variable rate will change over time and could be the optimal rate depending on market conditions. - -{% enddocs %} - -{% docs complete_lending_borrow_rate_stable %} - -The stable interest rate for borrowing assets. - -{% enddocs %} - -{% docs complete_lending_borrow_rate_variable %} - -The variable interest rate for borrowing assets. - -{% enddocs %} - -{% docs complete_lending_collateral_complete_lending_token %} - -The interest bearing token that's burned when a liquidation occurs. - -{% enddocs %} - -{% docs complete_lending_collateral_asset %} - -The asset provided as collateral, which can be liquidated. - -{% enddocs %} - -{% docs complete_lending_data_provider %} - -The protocol data provider contract address. - -{% enddocs %} - -{% docs complete_lending_debt_complete_lending_token %} - -The interest bearing token representing the debt. - -{% enddocs %} - -{% docs complete_lending_debt_asset %} - -The debt asset, which the user borrowed. - -{% enddocs %} - -{% docs complete_lending_debt_to_cover_amount %} - -The amount of debt the user must cover. - -{% enddocs %} - -{% docs complete_lending_debt_to_cover_amount_usd %} - -The amount of debt the user must cover, valued in USD. - -{% enddocs %} - -{% docs complete_lending_depositor_address %} - -The depositor's address. - -{% enddocs %} - -{% docs complete_lending_end_voting_period %} - -The block number in which the voting period ends. - -{% enddocs %} - -{% docs complete_lending_flashloan_amount %} - -The amount of assets flash loaned. - -{% enddocs %} - -{% docs complete_lending_flashloan_amount_usd %} - -The value of the flash loan amount, in USD. - -{% enddocs %} - -{% docs complete_lending_governance_contract %} - -The governance contract address. - -{% enddocs %} - -{% docs complete_lending_initiator_address %} - -The address that initiated the flash loan. - -{% enddocs %} - -{% docs complete_lending_issued_tokens %} - -The amount of tokens that the user is depositing. - -{% enddocs %} - -{% docs complete_lending_lending_pool_contract %} - -The address of the lending pool. - -{% enddocs %} - -{% docs complete_lending_liquidated_amount %} - -The amount of asset liquidated. - -{% enddocs %} - -{% docs complete_lending_liquidated_amount_usd %} - -The value of the liquidated asset, in USD. - -{% enddocs %} - -{% docs complete_lending_liquidator %} - -The address that initiated the liquidation call. - -{% enddocs %} - -{% docs complete_lending_market %} - -The asset contract for the applicable market. - -{% enddocs %} - -{% docs complete_lending_payer %} - -The address that initiated the repayment. - -{% enddocs %} - -{% docs complete_lending_premium_amount %} - -The flash loan fee, changeable via the normal governance process, decimal adjusted. - -{% enddocs %} - -{% docs complete_lending_premium_amount_usd %} - -The flash loan fee, valued in USD. - -{% enddocs %} - -{% docs complete_lending_proposal_id %} - -The unique ID representing a proposal. - -{% enddocs %} - -{% docs complete_lending_proposal_tx %} - -The transaction confirming a proposal submission. - -{% enddocs %} - -{% docs complete_lending_proposer %} - -The user's address that submitted the proposal. - -{% enddocs %} - -{% docs complete_lending_repayed_tokens %} - -The amount of tokens repaid. - -{% enddocs %} - -{% docs complete_lending_repayed_usd %} - -The value of repaid tokens, in USD. - -{% enddocs %} - -{% docs complete_lending_stable_debt_token_address %} - -Debt tokens are interest-accruing tokens that are minted and burned on borrow and repay, representing a debt to the protocol with a stable interest rate. - -{% enddocs %} - -{% docs complete_lending_start_voting_period %} - -The block number in which the voting period begins. - -{% enddocs %} - -{% docs complete_lending_status %} - -The proposal's status. - -{% enddocs %} - -{% docs complete_lending_supplied_usd %} - -The value of the asset in USD that the user is depositing. - -{% enddocs %} - -{% docs complete_lending_supply_rate %} - -The interest rate for supplying assets to the protocol. - -{% enddocs %} - -{% docs complete_lending_support %} - -A value indicating their vote (For: true, Against: false). - -{% enddocs %} - -{% docs complete_lending_target_address %} - -The address receiving the flash loan. - -{% enddocs %} - -{% docs complete_lending_targets %} - -List of the targeted addresses by proposal transactions. - -{% enddocs %} - -{% docs complete_lending_token %} - -The interest bearing token contract. - -{% enddocs %} - -{% docs complete_lending_total_liquidity_token %} - -The total supply of liquidity tokens. - -{% enddocs %} - -{% docs complete_lending_total_liquidity_usd %} - -The total value of liquidity tokens, in USD. - -{% enddocs %} - -{% docs complete_lending_total_stable_debt_token %} - -The total supply of debt tokens, representing a debt to the protocol with a stable interest rate. - -{% enddocs %} - -{% docs complete_lending_total_stable_debt_usd %} - -The total USD value of debt tokens, representing a debt to the protocol with a stable interest rate. -{% enddocs %} - -{% docs complete_lending_total_variable_debt_token %} - -The total supply of debt tokens, representing a debt to the protocol with a variable interest rate. - -{% enddocs %} - -{% docs complete_lending_total_variable_debt_usd %} - -The total USD value of debt tokens, representing a debt to the protocol with a variable interest rate. -{% enddocs %} - -{% docs complete_lending_utilization_rate %} - -The percentage of assets loaned out. - -{% enddocs %} - -{% docs complete_lending_variable_debt_token_address %} - -Debt tokens are interest-accruing tokens that are minted and burned on borrow and repay, representing a debt to the protocol with a variable interest rate. - -{% enddocs %} - -{% docs complete_lending_version %} - -The contract version. Example: Aave AMM, Aave v1, Aave v2 - -{% enddocs %} - -{% docs complete_lending_withdrawn_tokens %} - -The amount of tokens withdrawn. - -{% enddocs %} - -{% docs complete_lending_withdrawn_usd %} - -The value of withdrawn tokens, in USD. - -{% enddocs %} - -{% docs complete_lending_platform %} - -The specific protocol where lending event occurred. - -{% enddocs %} - -{% docs complete_lending_protocol_token %} - -The protocol's specific lending asset token, ie cWBTC or aETHUni. - -{% enddocs %} - -{% docs complete_lending_borrower %} - -Address that initiated the borrow event. - -{% enddocs %} - -{% docs complete_lending_amount %} - -The decimal adjusted amount of tokens involved in the lending transaction, where available. - -{% enddocs %} - -{% docs complete_lending_amount_usd %} - -The value of the tokens in USD at the time of the lending transaction, where available. - -{% enddocs %} - -{% docs complete_lending_token_address %} - -The address of the token associated with the lending action. - -{% enddocs %} - -{% docs complete_lending_token_symbol %} - -The symbol of the token associated with the lending action. - -{% enddocs %} - -{% docs complete_lending_depositor %} - -Address that initiated a deposit event. - -{% enddocs %} - -{% docs complete_lending_amount_unadj %} - -The non-decimal adjusted amount of tokens involved in the lending transaction. - -{% enddocs %} - -{% docs complete_lending_premium_amount_unadj %} - -The flash loan fee, changeable via the normal governance process, non-decimal adjusted. - -{% enddocs %} - -{% docs complete_lending_flashloan_amount_unadj %} - -The amount of assets flash loaned, non-decimal adjusted. - -{% enddocs %} - -{% docs complete_lending_flashloan_token %} - -The flashloaned token address. - -{% enddocs %} - -{% docs complete_lending_flashloan_token_symbol %} - -The flashloaned token symbol - -{% enddocs %} - -{% docs borrower %} - -Its the address of the user who is Borrowing or repaying the loan, depending on the action. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/complete_lending/complete_lending_table_docs.md b/models/doc_descriptions/complete_lending/complete_lending_table_docs.md deleted file mode 100644 index 9f8b28b8..00000000 --- a/models/doc_descriptions/complete_lending/complete_lending_table_docs.md +++ /dev/null @@ -1,36 +0,0 @@ -{% docs complete_lending_borrows_table_doc %} - -This table contains transactions where users borrowed assets across AAVE, EXACTLY, GRANARY, SONNE, and TAROT protocols. In order to borrow assets, a user must first deposit their preferred asset and amount as collateral. - - -{% enddocs %} - -{% docs complete_lending_deposits_table_doc %} - -This table contains deposit transactions across AAVE, EXACTLY, GRANARY, SONNE, and TAROT protocols. A user deposits their preferred asset and amount. After depositing, users earn passive income based on the market borrowing demand. Additionally, depositing allows users to borrow by using their deposited assets as a collateral. Any interest earned by depositing funds helps offset the interest rate accumulated by borrowing. - -{% enddocs %} - -{% docs complete_lending_flashloans_table_doc %} - -This table contains flash loan transactions across AAVE and GRANARY protocols. Flash loans are a feature designed for developers, due to the technical knowledge required to execute one. Flash Loans allow you to borrow any available amount of assets without providing any collateral, as long as the liquidity is returned to the protocol within one block transaction. - -{% enddocs %} - -{% docs complete_lending_liquidations_table_doc %} - -This table contains transactions in which a borrower's collateral asset is liquidated across AAVE, EXACTLY, GRANARY, SONNE, and TAROT protocols. Liquidations occur when a borrower's health factor goes below 1 due to their collateral value not properly covering their loan/debt value. This might happen when the collateral decreases in value or the borrowed debt increases in value against each other. This collateral vs loan value ratio is shown in the health factor. In a liquidation, up to 50% of a borrower's debt is repaid and that value + liquidation fee is taken from the collateral available, so after a liquidation the amount liquidated from one's debt is repaid. - -{% enddocs %} - -{% docs complete_lending_repayments_table_doc %} - -This table contains transactions in which a borrower repays their loan (debt) across the AAVE, EXACTLY, GRANARY, SONNE, and TAROT protocols. Loans are repaid in the same asset borrowed, plus accrued interest. Borrowers can pay back their loan based on the USD price as they can borrow any of the available stable coins (USDC, DAI, USDT, etc.). - -{% enddocs %} - -{% docs complete_lending_withdraws_table_doc %} - -This table contains transactions in which a user withdraws liquidity across the AAVE, EXACTLY, GRANARY, SONNE, and TAROT protocols. Users need to make sure there is enough liquidity (not borrowed) in order to withdraw, if this is not the case, users need to wait for more liquidity from depositors or borrowers repaying. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/op_contracts_contract_address.md b/models/doc_descriptions/contracts/op_contracts_contract_address.md deleted file mode 100644 index 00af9aa5..00000000 --- a/models/doc_descriptions/contracts/op_contracts_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_contracts_contract_address %} - -The unique Optimism address of the deployed contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/op_contracts_symbol.md b/models/doc_descriptions/contracts/op_contracts_symbol.md deleted file mode 100644 index 33620db1..00000000 --- a/models/doc_descriptions/contracts/op_contracts_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_contracts_symbol %} - -The symbol used to represent this contract. Please note this is not necessarily unique. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/contracts/op_contracts_table_doc.md b/models/doc_descriptions/contracts/op_contracts_table_doc.md deleted file mode 100644 index 721046b5..00000000 --- a/models/doc_descriptions/contracts/op_contracts_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_contracts_table_doc %} - -This table contains contract details for contracts deployed on the Optimism blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/delegations/delegation_delegation_type.md b/models/doc_descriptions/delegations/delegation_delegation_type.md deleted file mode 100644 index df6416af..00000000 --- a/models/doc_descriptions/delegations/delegation_delegation_type.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs delegation_delegation_type %} - -The type of delegation event that is happening in the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/delegations/delegation_delegator.md b/models/doc_descriptions/delegations/delegation_delegator.md deleted file mode 100644 index cafd86eb..00000000 --- a/models/doc_descriptions/delegations/delegation_delegator.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs delegation_delegator %} - -The address that is delegating OP tokens. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/delegations/delegation_from_delegate.md b/models/doc_descriptions/delegations/delegation_from_delegate.md deleted file mode 100644 index 6a6b2292..00000000 --- a/models/doc_descriptions/delegations/delegation_from_delegate.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs delegation_from_delegate %} - -The address of the delegate that the delegator is delegating OP tokens from. This address can be a proxy address or a smart contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/delegations/delegation_to_delegate.md b/models/doc_descriptions/delegations/delegation_to_delegate.md deleted file mode 100644 index 087fce60..00000000 --- a/models/doc_descriptions/delegations/delegation_to_delegate.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs delegation_to_delegate %} - -The address of the delegate that the delegator is delegating OP tokens to. This address can be a proxy address or a smart contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/delegations/opt_delegations_table_doc.md b/models/doc_descriptions/delegations/opt_delegations_table_doc.md deleted file mode 100644 index 59408168..00000000 --- a/models/doc_descriptions/delegations/opt_delegations_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_delegations_table_doc %} - -Contains all delegation transactions of OP token voting power to delegators or community members who have volunteered to play an active role in Token House governance. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_creation_block.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_creation_block.md deleted file mode 100644 index 96d5c47d..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_creation_block.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_creation_block %} - -The block number of when this pool was created. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_creation_time.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_creation_time.md deleted file mode 100644 index 31935bf4..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_creation_time.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_creation_time %} - -The block timestamp of when this pool was created. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_creation_tx.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_creation_tx.md deleted file mode 100644 index fec40c0d..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_creation_tx.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_creation_tx %} - -The transaction where this contract was created. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_factory_address.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_factory_address.md deleted file mode 100644 index db5ad7d6..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_factory_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_factory_address %} - -The address that created or deployed this pool, where available. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_decimals.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_decimals.md deleted file mode 100644 index 09fc3516..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_decimals.md +++ /dev/null @@ -1,15 +0,0 @@ -{% docs eth_dex_lp_decimals %} - -The # of decimals for the token included in the liquidity pool, as a JSON object, where available. - -Query example to access the key:value pairing within the object: -SELECT - DISTINCT pool_address AS unique_pools, - tokens :token0 :: STRING AS token0, - symbols: token0 :: STRING AS token0_symbol, - decimals: token0 :: STRING AS token0_decimal -FROM optimism.defi.dim_dex_liquidity_pools -WHERE token0_decimal = 6 -; - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_symbols.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_symbols.md deleted file mode 100644 index 6e99e68f..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_symbols.md +++ /dev/null @@ -1,15 +0,0 @@ -{% docs eth_dex_lp_symbols %} - -The symbol for the token included in the liquidity pool, as a JSON object, where available. - -Query example to access the key:value pairing within the object: -SELECT - DISTINCT pool_address AS unique_pools, - tokens :token0 :: STRING AS token0, - symbols: token0 :: STRING AS token0_symbol, - decimals: token0 :: STRING AS token0_decimal -FROM optimism.defi.dim_dex_liquidity_pools -WHERE token0_symbol = 'WETH' -; - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_table_doc.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_table_doc.md deleted file mode 100644 index 62a3a88d..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_lp_table_doc %} - -This table contains details on decentralized exchange (DEX) liquidity pools (LP) on the Optimism blockchain, including the tokens, symbols and decimals within each pool alongside the following protocols: BEETHOVENX, CURVE, DODO, FRAXSWAP, KYBERSWAP, SUSHISWAP, UNISWAP, VELODROME. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_tokens.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_tokens.md deleted file mode 100644 index ef20f50b..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_lp_tokens.md +++ /dev/null @@ -1,15 +0,0 @@ -{% docs eth_dex_lp_tokens %} - -The address for the token included in the liquidity pool, as a JSON object. - -Query example to access the key:value pairing within the object: -SELECT - DISTINCT pool_address AS unique_pools, - tokens :token0 :: STRING AS token0, - symbols: token0 :: STRING AS token0_symbol, - decimals: token0 :: STRING AS token0_decimal -FROM optimism.defi.dim_dex_liquidity_pools -WHERE token0 = '0x4200000000000000000000000000000000000006' -; - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_platform.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_platform.md deleted file mode 100644 index f6411070..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_platform.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_platform %} - -The protocol or platform that the liquidity pool belongs to or swap occurred on. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_pool_address.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_pool_address.md deleted file mode 100644 index 1d4192d4..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_pool_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_pool_address %} - -The contract address for the liquidity pool. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_pool_name.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_pool_name.md deleted file mode 100644 index 2fc289a4..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_pool_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_pool_name %} - -The name of the liquidity pool, where available. In some cases, the pool name is a concatenation of symbols or token addresses. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_in.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_in.md deleted file mode 100644 index 8b1cf24a..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_in.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_amount_in %} - -The amount of tokens put into the swap. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_in_unadj.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_in_unadj.md deleted file mode 100644 index 0f82b78d..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_in_unadj.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_amount_in_unadj %} - -The non-decimal adjusted amount of tokens put into the swap. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_in_usd.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_in_usd.md deleted file mode 100644 index bfa46fd0..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_in_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_amount_in_usd %} - -The value of the swapped tokens in USD at the time of the transaction, where available. If there is a variance of 75% or greater in USD swap values or one side of the swap's USD value is NULL, then both amount_in_usd and amount_out_usd will be set to NULL. This avoids falsely overstating USD swap volumes for low-liquidity token pairings or incorrectly reported prices. To get USD values in these scenarios anyway, please re-join the `price.ez_prices_hourly` table. Note, this logic does not apply for the chain's Native asset. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_out.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_out.md deleted file mode 100644 index 34aab5ee..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_out.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_amount_out %} - -The amount of tokens taken out of or received from the swap. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_out_unadj.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_out_unadj.md deleted file mode 100644 index 0b225578..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_out_unadj.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_amount_out_unadj %} - -The non-decimal adjusted amount of tokens taken out of or received from the swap. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_out_usd.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_out_usd.md deleted file mode 100644 index 3b528371..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_amount_out_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_amount_out_usd %} - -The value of the swapped tokens in USD at the time of the transaction, where available. If there is a variance of 75% or greater in USD swap values or one side of the swap's USD value is NULL, then both amount_in_usd and amount_out_usd will be set to NULL. This avoids falsely overstating USD swap volumes for low-liquidity token pairings or incorrectly reported prices. To get USD values in these scenarios anyway, please re-join the `price.ez_prices_hourly` table. Note, this logic does not apply for the chain's Native asset. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_sender.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_sender.md deleted file mode 100644 index 03a3abfc..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_sender.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_sender %} - -The Router is the Sender in the swap function. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_symbol_in.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_symbol_in.md deleted file mode 100644 index 0f931bcf..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_symbol_in.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_symbol_in %} - -The symbol of the token sent for swap. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_symbol_out.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_symbol_out.md deleted file mode 100644 index d440b24b..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_symbol_out.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_symbol_out %} - -The symbol of the token being swapped to. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_token_In.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_token_In.md deleted file mode 100644 index a55bca2b..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_token_In.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_token_in %} - -The address of the token sent for swap. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_token_out.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_token_out.md deleted file mode 100644 index 4695dc90..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_token_out.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_token_out %} - -The address of the token being swapped to. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_tx_to.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_tx_to.md deleted file mode 100644 index 89e354cd..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_swaps_tx_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_swaps_tx_to %} - -The tx_to is the address who receives the swapped token. This corresponds to the "to" field in the swap function. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_token0.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_token0.md deleted file mode 100644 index 76758f81..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_token0.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_token0 %} - -Token 0 is the first token in the pair, and will show up first within the event logs for relevant transactions. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_token1.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_token1.md deleted file mode 100644 index 40ec8c4e..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_token1.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_token1 %} - -Token 1 is the second token in the pair, and will show up second within the event logs for relevant transactions. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_tokens.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_tokens.md deleted file mode 100644 index 11dd78f3..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_dex_tokens.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs eth_dex_tokens %} - -This field contains the tokens within the liquidity pool as a JSON objects. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/eth_ez_dex_swaps_table_doc.md b/models/doc_descriptions/dex - (imported from layer 1)/eth_ez_dex_swaps_table_doc.md deleted file mode 100644 index 0eeafd68..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/eth_ez_dex_swaps_table_doc.md +++ /dev/null @@ -1,6 +0,0 @@ -{% docs eth_ez_dex_swaps_table_doc %} - -This table currently contains swap events from the ```fact_event_logs``` table for SUSHI, UNISWAP, CURVE, SYNTHETIX, VELODROME, HASHFLOW, WOOFI, FRAX, KYBERSWAP and DODO along with other helpful columns including an amount USD where possible. Other dexes coming soon! -Note: A rule has been put in place to null out the amount_USD if that number is too divergent between amount_in_USD and amount_out_usd. This can happen for swaps of less liquid tokens during very high fluctuation of price. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/opt_sushi__ez_swaps.md b/models/doc_descriptions/dex - (imported from layer 1)/opt_sushi__ez_swaps.md deleted file mode 100644 index 45f6cf91..00000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/opt_sushi__ez_swaps.md +++ /dev/null @@ -1,6 +0,0 @@ -{% docs opt_sushi__ez_swaps %} - -This table currently contains swap events from the ```logs``` table for SushiSwap on optimism, along with other helpful columns including an amount USD where possible. -Note: A rule has been put in place to null out the amount_USD if that number is too divergent between amount_in_USD and amount_out_usd. This can happen for swaps of less liquid tokens during very high fluctuation of price. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_event_index.md b/models/doc_descriptions/event_logs/opt_event_index.md deleted file mode 100644 index ded6948b..00000000 --- a/models/doc_descriptions/event_logs/opt_event_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_event_index %} - -Event number within a transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_event_inputs.md b/models/doc_descriptions/event_logs/opt_event_inputs.md deleted file mode 100644 index edeedeca..00000000 --- a/models/doc_descriptions/event_logs/opt_event_inputs.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_event_inputs %} - -The decoded event inputs for a given event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_event_name.md b/models/doc_descriptions/event_logs/opt_event_name.md deleted file mode 100644 index 117f9b9d..00000000 --- a/models/doc_descriptions/event_logs/opt_event_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_event_name %} - -The decoded event name for a given event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_event_removed.md b/models/doc_descriptions/event_logs/opt_event_removed.md deleted file mode 100644 index bbad21e6..00000000 --- a/models/doc_descriptions/event_logs/opt_event_removed.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_event_removed %} - -Whether the event has been removed from the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_event_sig.md b/models/doc_descriptions/event_logs/opt_event_sig.md deleted file mode 100644 index 095baaf7..00000000 --- a/models/doc_descriptions/event_logs/opt_event_sig.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_origin_sig %} - -The function signature of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_log_id_events.md b/models/doc_descriptions/event_logs/opt_log_id_events.md deleted file mode 100644 index 087a2789..00000000 --- a/models/doc_descriptions/event_logs/opt_log_id_events.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_log_id_events %} - -This is the primary key for this table. This is a concatenation of the transaction hash and the event index at which the event occurred. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_logs_contract_address.md b/models/doc_descriptions/event_logs/opt_logs_contract_address.md deleted file mode 100644 index 6537b002..00000000 --- a/models/doc_descriptions/event_logs/opt_logs_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_logs_contract_address %} - -The address interacted with for a given event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_logs_contract_name.md b/models/doc_descriptions/event_logs/opt_logs_contract_name.md deleted file mode 100644 index b69318bf..00000000 --- a/models/doc_descriptions/event_logs/opt_logs_contract_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_logs_contract_name %} - -The name of the contract or token, where possible. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_logs_data.md b/models/doc_descriptions/event_logs/opt_logs_data.md deleted file mode 100644 index f96caa56..00000000 --- a/models/doc_descriptions/event_logs/opt_logs_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_logs_data %} - -The un-decoded event data. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_logs_table_doc.md b/models/doc_descriptions/event_logs/opt_logs_table_doc.md deleted file mode 100644 index f97e2f06..00000000 --- a/models/doc_descriptions/event_logs/opt_logs_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_logs_table_doc %} - -This table contains flattened event logs from transactions on the Optimism Blockchain. Transactions may have multiple events, which are denoted by the event index for a transaction hash. Therefore, this table is unique on the combination of transaction hash and event index. Please see `fact_decoded_event_logs` or `ez_decoded_event_logs` for the decoded event logs. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_logs_tx_hash.md b/models/doc_descriptions/event_logs/opt_logs_tx_hash.md deleted file mode 100644 index 3d7e8df1..00000000 --- a/models/doc_descriptions/event_logs/opt_logs_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_logs_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. This field will not be unique in this table, as a given transaction can include multiple events. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_origin_from.md b/models/doc_descriptions/event_logs/opt_origin_from.md deleted file mode 100644 index 93c5e5b3..00000000 --- a/models/doc_descriptions/event_logs/opt_origin_from.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_origin_from %} - -The from address of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_origin_to.md b/models/doc_descriptions/event_logs/opt_origin_to.md deleted file mode 100644 index d5c2e056..00000000 --- a/models/doc_descriptions/event_logs/opt_origin_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_origin_to %} - -The to address of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/opt_topics.md b/models/doc_descriptions/event_logs/opt_topics.md deleted file mode 100644 index 9289ce51..00000000 --- a/models/doc_descriptions/event_logs/opt_topics.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_topics %} - -The un-decoded event input topics. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/L1_submission_fields.md b/models/doc_descriptions/fsc_evm/L1_submission_fields.md deleted file mode 100644 index 8dc0f399..00000000 --- a/models/doc_descriptions/fsc_evm/L1_submission_fields.md +++ /dev/null @@ -1,95 +0,0 @@ -{% docs evm_batch_size %} - -Total transactions included within the batch on the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_max_block %} - -The max block on the OP stack L2 chain this batch relates to. - -{% enddocs %} - -{% docs evm_min_block %} - -The min block on the OP stack L2 chain this batch relates to. - -{% enddocs %} - -{% docs evm_batch_root %} - -Root of the batch, either for submission or state on the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_block_no %} - -The Ethereum block number that contained the batch from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_block_time %} - -The timestamp of the Ethereum block that contained this batch from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_fee %} - -The L1 portion of fees paid. - -{% enddocs %} - -{% docs evm_l1_fee_scalar %} - -This value covers the change in L1 gas price between the time the transaction is submitted and when it is published from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_gas_price %} - -The gas price for L1 transactions when the transaction was processed from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_gas_used %} - -The gas used on L1 to publish the transaction from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_state_batch %} - -The batch index of when this block was included in the Ethereum state root. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_state_tx_hash %} - -The L1 tx hash of when this block was included in the Ethereum state root. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_sub_batch %} - -The batch index of when this block was submitted to L1. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_sub_tx_hash %} - -The L1 tx hash of when this block was submitted to L1. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_prev_total_elements %} - -Confirmed blocks prior to this batch on the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_fee_precise %} - -The precise amount of the L1 fee. This is returned as a string to avoid precision loss. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/blocks.md b/models/doc_descriptions/fsc_evm/blocks.md deleted file mode 100644 index 896609b5..00000000 --- a/models/doc_descriptions/fsc_evm/blocks.md +++ /dev/null @@ -1,158 +0,0 @@ -{% docs evm_blocks_table_doc %} - -This table contains block level data for this EVM blockchain. This table can be used to analyze trends at a block level, for example gas fees vs. total transactions over time. For more information, please see [Etherscan Resources](https://etherscan.io/directory/Learning_Resources/Ethereum) or [The Ethereum Organization](https://ethereum.org/en/developers/docs/blocks/) - -{% enddocs %} - - -{% docs evm_block_header_json %} - -This JSON column contains the block header details. - -{% enddocs %} - - -{% docs evm_blockchain %} - -The blockchain on which transactions are being confirmed. - -{% enddocs %} - - -{% docs evm_blocks_hash %} - -The hash of the block header for a given block. - -{% enddocs %} - - -{% docs evm_blocks_nonce %} - -Block nonce is a value used during mining to demonstrate proof of work for a given block. - -{% enddocs %} - - -{% docs evm_difficulty %} - -The effort required to mine the block. - -{% enddocs %} - - -{% docs evm_extra_data %} - -Any data included by the miner for a given block. - -{% enddocs %} - - -{% docs evm_gas_limit %} - -Total gas limit provided by all transactions in the block. - -{% enddocs %} - - -{% docs evm_gas_used %} - -Total gas used in the block. - -{% enddocs %} - -{% docs evm_network %} - -The network on the blockchain used by a transaction. - -{% enddocs %} - - -{% docs evm_parent_hash %} - -The hash of the block from which a given block is generated. Also known as the parent block. - -{% enddocs %} - - -{% docs evm_receipts_root %} - -The root of the state trie. - -{% enddocs %} - - -{% docs evm_sha3_uncles %} - -The mechanism which Ethereum Javascript RLP encodes an empty string. - -{% enddocs %} - - -{% docs evm_size %} - -Block size, which is determined by a given block's gas limit. - -{% enddocs %} - - -{% docs evm_total_difficulty %} - -Total difficulty of the chain at a given block. - -{% enddocs %} - - -{% docs evm_tx_count %} - -Total number of transactions within a block. - -{% enddocs %} - - -{% docs evm_uncle_blocks %} - -Uncle blocks occur when two blocks are mined and broadcasted at the same time, with the same block number. The block validated across the most nodes will be added to the primary chain, and the other one becomes an uncle block. Miners do receive rewards for uncle blocks. - -{% enddocs %} - -{% docs evm_miner %} - -The address of the beneficiary to whom the mining rewards were given - -{% enddocs %} - -{% docs evm_state_root %} - -The root of the final state trie of the block - -{% enddocs %} - -{% docs evm_transactions_root %} - -The root of the transaction trie of the block - -{% enddocs %} - -{% docs evm_logs_bloom %} - -The bloom filter for the logs of the block. - -{% enddocs %} - -{% docs evm_mix_hash %} - -A string of a 256-bit hash encoded as a hexadecimal - -{% enddocs %} - -{% docs evm_base_fee_per_gas %} - -A string of the base fee encoded in hexadecimal format. Please note that this response field will not be included in a block requested before the EIP-1559 upgrade - -{% enddocs %} - -{% docs evm_withdrawals_root %} - -The root of the withdrawals trie. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/complete_general.md b/models/doc_descriptions/fsc_evm/complete_general.md deleted file mode 100644 index b859d122..00000000 --- a/models/doc_descriptions/fsc_evm/complete_general.md +++ /dev/null @@ -1,65 +0,0 @@ -{% docs evm_block_number %} - -Also known as block height. The block number, which indicates the length of the blockchain, increases after the addition of each new block. - -{% enddocs %} - -{% docs evm_block_timestamp %} - -The date and time at which the block was produced. - -{% enddocs %} - -{% docs evm_from_address %} - -The sending address of this transaction. - -{% enddocs %} - -{% docs evm_ingested_at %} - -Internal column. - -{% enddocs %} - -{% docs evm_to_address %} - -The receiving address of this transaction. This can be a contract address. - -{% enddocs %} - -{% docs evm_pk %} - -The unique identifier for each row in the table. - -{% enddocs %} - -{% docs evm_inserted_timestamp %} - -The UTC timestamp at which the row was inserted into the table. - -{% enddocs %} - -{% docs evm_modified_timestamp %} - -The UTC timestamp at which the row was last modified. - -{% enddocs %} - -{% docs evm_precise_amount_unadjusted %} - -The precise, unadjusted amount of the transaction. This is returned as a string to avoid precision loss. - -{% enddocs %} - -{% docs evm_precise_amount_adjusted %} - -The precise, adjusted amount of the transaction. This is returned as a string to avoid precision loss. - -{% enddocs %} - -{% docs evm_value_hex %} - -The value of the transaction in hexadecimal format. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/event_logs.md b/models/doc_descriptions/fsc_evm/event_logs.md deleted file mode 100644 index 52c8e0cc..00000000 --- a/models/doc_descriptions/fsc_evm/event_logs.md +++ /dev/null @@ -1,95 +0,0 @@ -{% docs evm_logs_table_doc %} - -This table contains flattened event logs from transactions on this EVM blockchain. Transactions may have multiple events, which are denoted by the event index for a transaction hash. Therefore, this table is unique on the combination of transaction hash and event index. Please see `fact_decoded_event_logs` or `ez_decoded_event_logs` for the decoded event logs. - -{% enddocs %} - - -{% docs evm_event_index %} - -Event number within a transaction. - -{% enddocs %} - - -{% docs evm_event_inputs %} - -The decoded event inputs for a given event. - -{% enddocs %} - -{% docs evm_event_removed %} - -Whether the event has been removed from the transaction. - -{% enddocs %} - - -{% docs evm_log_id_events %} - -This is the primary key for this table. This is a concatenation of the transaction hash and the event index at which the event occurred. This field can be used within other event based tables such as ```fact_transfers``` & ```ez_token_transfers```. - -{% enddocs %} - - -{% docs evm_logs_contract_address %} - -The address interacted with for a given event. - -{% enddocs %} - - -{% docs evm_logs_contract_name %} - -The name of the contract or token, where possible. - -{% enddocs %} - - -{% docs evm_logs_data %} - -The un-decoded event data. - -{% enddocs %} - - -{% docs evm_logs_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. This field will not be unique in this table, as a given transaction can include multiple events. - -{% enddocs %} - - -{% docs evm_topics %} - -The un-decoded event input topics. - -{% enddocs %} - - -{% docs evm_topic_0 %} - -The first topic of the event, which is a unique identifier for the event. - -{% enddocs %} - - -{% docs evm_topic_1 %} - -The second topic of the event, if applicable. - -{% enddocs %} - - -{% docs evm_topic_2 %} - -The third topic of the event, if applicable. - -{% enddocs %} - - -{% docs evm_topic_3 %} - -The fourth topic of the event, if applicable. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/evm_deprecations.md b/models/doc_descriptions/fsc_evm/evm_deprecations.md deleted file mode 100644 index c1fe565e..00000000 --- a/models/doc_descriptions/fsc_evm/evm_deprecations.md +++ /dev/null @@ -1,246 +0,0 @@ -{% docs evm_column_deprecation_notice %} - -This column is being deprecated for standardization purposes. Please update your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_hash %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `block_hash` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_block_hash %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - - -{% docs evm_column_deprecation_notice_position %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `tx_position` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_tx_status %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `tx_succeeded` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_chain_id %} - -This column is being removed for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_identifier %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `trace_address` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_trace_status %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `trace_succeeded` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_log_id %} - -This column is being removed for standardization purposes. Please remove or update your queries with `CONCAT(tx_hash, '_', event_index)` to reconstruct `_log_id` by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_inserted_timestamp %} - -This column is being removed for standardization purposes. Please update your queries to use the `modified_timestamp` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_blockchain %} - -This column is being removed for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_block_header_json %} - -This column is being removed for standardization purposes and will be replaced with new columns associated with the keys extracted from this json. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_full_decoded_log %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `full_decoded_data` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_table_deprecation_notice %} - -This table is being deprecated for standardization purposes. Please update your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_table_deprecation_notice_fact_decoded_event_logs %} - -This table is being deprecated for standardization purposes. Please update your queries to use `ez_decoded_event_logs` instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_table_deprecation_notice_fact_decoded_traces %} - -This table is being deprecated for standardization purposes. Please update your queries to use `ez_decoded_traces` instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_table_deprecation_notice_fact_token_transfers %} - -This table is being deprecated for standardization purposes. Please update your queries to use `ez_token_transfers` instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_state_root_tx_hash %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_state_root_batch_index %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_submission_tx_hash %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_submission_batch_index %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_submission_details %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_data %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_deposit_nonce %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_deposit_receipt_version %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_token_price %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_has_price %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_has_decimal %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_nft_address %} - -This column is being removed for standardization purposes. Please update your queries to use the `contract_address` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_tokenid %} - -This column is being removed for standardization purposes. Please update your queries to use the `token_id` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_erc1155_value %} - -This column is being removed for standardization purposes. Please update your queries to use the `quantity` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_project_name %} - -This column is being removed for standardization purposes. Please update your queries to use the `name` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_loanid %} - -This column is being removed for standardization purposes. Please update your queries to use the `loan_id` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_tokenid_name %} - -This column is being removed for standardization purposes. Please update your queries to use the `token_id_name` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_tokenid_description %} - -This column is being removed for standardization purposes. Please update your queries to use the `token_id_description` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_tokenid_image_url %} - -This column is being removed for standardization purposes. Please update your queries to use the `token_id_image_url` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_nft_address_tokenid %} - -This column is being removed for standardization purposes. Please update your queries to use the `nft_address_token_id` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_nft_from_address %} - -This column is being removed for standardization purposes. Please update your queries to use the `from_address` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_nft_to_address %} - -This column is being removed for standardization purposes. Please update your queries to use the `to_address` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_mint_price_eth %} - -This column is being removed for standardization purposes. Please update your queries to use the `mint_price_native` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_event_type %} - -This column is being removed for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/nft.md b/models/doc_descriptions/fsc_evm/nft.md deleted file mode 100644 index f9c29fc0..00000000 --- a/models/doc_descriptions/fsc_evm/nft.md +++ /dev/null @@ -1,595 +0,0 @@ -{% docs evm_nft_events_table_doc %} - -This table contains NFT sales on this EVM blockchain. More NFT marketplaces will be added over time. - -{% enddocs %} - - -{% docs evm_ez_nft_sales_table_doc %} - -This table contains NFT sale events from various marketplaces. - -{% enddocs %} - - -{% docs evm_ez_nft_mint_table_doc %} - -This table contains NFT mint events, defined as NFT transfers from a burn address to an address, on this EVM blockchain. - -{% enddocs %} - -{% docs evm_ez_nft_transfer_table_doc %} - -This table contains NFT transfer events on this EVM blockchain. - -{% enddocs %} - -{% docs evm_lending_repayments_table_doc %} - -This table contains repayment events for loans backed by collateralized NFTs on this EVM blockchain. Events in this table can be a full repayment either by the borrower to get their collateral back or by a new lender to repay the borrower's previous loan. The latter is labeled as refinance where the same borrower takes on a new loan from a new lender and repays the past loan. The NFT collateral is still locked in this scenario. - -{% enddocs %} - -{% docs evm_nft_aggregator_name %} - -The name of the aggregator platform where the sale took place. If the sale did not take place via an aggregator platform, then the value will be null. - -{% enddocs %} - -{% docs evm_nft_amount %} - -The total amount, specified by the mint token address, used as payment to mint the specified number of NFTs corresponding to this token id. - -{% enddocs %} - -{% docs evm_nft_amount_usd %} - -The USD value of amount. - -{% enddocs %} - -{% docs evm_nft_block_no %} - -The block number at which the NFT event occurred. - -{% enddocs %} - -{% docs evm_nft_blocktime %} - -The block timestamp at which the NFT event occurred. - -{% enddocs %} - -{% docs evm_nft_buyer_address %} - -The address of the buyer of the NFT in the transaction. - -{% enddocs %} - -{% docs evm_nft_creator_fee %} - -The decimal adjusted amount of fees paid to the NFT collection as royalty payments for this NFT event in the transaction's currency. - -{% enddocs %} - -{% docs evm_nft_creator_fee_usd %} - -The amount of fees paid to the NFT collection as royalty payments for this NFT event in US dollars. - -{% enddocs %} - -{% docs evm_nft_currency_address %} - -The token contract address for this NFT event. This will be the native asset for native transactions. - -{% enddocs %} - -{% docs evm_nft_currency_symbol %} - -The token symbol for this NFT event. - -{% enddocs %} - -{% docs evm_nft_erc1155_value %} - -If the NFT is an ERC-1155 contract, this field may be one or greater, representing the number of tokens. If it is not an ERC-1155 token, this value will be null. - -{% enddocs %} - -{% docs evm_nft_event_index %} - -The event number within a transaction. - -{% enddocs %} - -{% docs evm_nft_event_type %} - -The type of NFT event in this transaction, either sale, bid_won, redeem, or mint. - -{% enddocs %} - -{% docs evm_nft_from_address %} - -The sending address of the NFT in the transaction. - -{% enddocs %} - -{% docs evm_nft_intra_event_index %} - -The order of events within a single event index. This is primarily used for ERC1155 NFT batch transfer events. - -{% enddocs %} - -{% docs evm_nft_metadata %} - -The token metadata for this NFT. This may be blank for many NFTs. We are working to expand this field. - -{% enddocs %} - -{% docs evm_nft_mint_count %} - -The number of NFTs minted in this event. - -{% enddocs %} - -{% docs evm_nft_mint_price %} - -The price paid in the native asset to mint the NFT(s). - -{% enddocs %} - -{% docs evm_nft_mint_price_usd %} - -The price paid in US dollars to mint the NFT(s). - -{% enddocs %} - -{% docs evm_nft_mints_symbol %} - -The symbol of the token supplied to mint the NFT, if applicable. This field may not handle all edge cases. - -{% enddocs %} - -{% docs evm_nft_mints_token_address %} - -The contract address of the token supplied to mint the NFT, if applicable. This field may not handle all edge cases. - -{% enddocs %} - -{% docs evm_nft_mints_token_price %} - -The decimal adjusted amount of tokens supplied within the same transaction to mint the NFT. This field may not handle all edge cases. - -{% enddocs %} - -{% docs evm_nft_mints_token_price_usd %} - -The amount of tokens supplied in US dollars within the same transaction to mint the NFT. This field may not handle all edge cases. - -{% enddocs %} - -{% docs evm_nft_nft_address %} - -The contract address of the NFT. - -{% enddocs %} - -{% docs evm_nft_origin_from %} - -The from address of this transaction. In most cases, this is the NFT buyer. However, for some more complex transactions, it may not be the NFT buyer. - -{% enddocs %} - -{% docs evm_nft_origin_sig %} - -The function signature of this transaction. - -{% enddocs %} - -{% docs evm_nft_origin_to %} - -The to address of this transaction. In most cases, this is the exchange contract. However, for some more complex NFT events, such as aggregate buys with tools, this may not be the exchange address. - -{% enddocs %} - -{% docs evm_nft_platform_address %} - -The address of the exchange used for the transaction. - -{% enddocs %} - -{% docs evm_nft_platform_exchange_version %} - -The version of the exchange contract used for the transaction. - -{% enddocs %} - -{% docs evm_nft_platform_fee %} - -The decimal adjusted amount of fees paid to the platform for this NFT event in the transaction's currency. There are cases where there are fees paid to multiple marketplaces. In those cases, the fee in the platform_fee column will only reflect the platform fee related to the platform exchange contract. - -{% enddocs %} - -{% docs evm_nft_platform_fee_usd %} - -The amount of fees paid to the platform for this NFT event in US dollars. There are cases where there are fees paid to multiple marketplaces. In those cases, the fee in the platform_fee column will only reflect the platform fee related to the platform exchange contract. - -{% enddocs %} - -{% docs evm_nft_platform_name %} - -The name of the exchange used for the trade. - -{% enddocs %} - -{% docs evm_nft_price %} - -The total price of the NFT, in the currency in which the transaction occurred and decimal adjusted where possible. Please note that the price of the NFT, after subtracting total fees, may not represent the net amount paid to the seller in all cases. You may refer to the platform fee description for more info. - -{% enddocs %} - -{% docs evm_nft_price_usd %} - -The total price of the NFT in US dollars. This will be 0 for tokens without a decimal adjustment or hourly price. Please note that the price of the NFT, after subtracting total fees, may not represent the net amount paid to the seller in all cases. You may refer to the platform fee description for more info. - -{% enddocs %} - -{% docs evm_nft_project_name %} - -The name of the NFT project. This field, along with metadata, will be filled in over time. - -{% enddocs %} - -{% docs evm_nft_seller_address %} - -The address of the seller of the NFT in the transaction. - -{% enddocs %} - -{% docs evm_nft_to_address %} - -The receiving address of the NFT in the transaction. - -{% enddocs %} - -{% docs evm_nft_tokenid %} - -The token ID for this NFT contract. - -{% enddocs %} - -{% docs evm_nft_total_fees %} - -The total amount of fees paid relating to the NFT purchase in the transaction currency. This includes royalty payments to creators and platform fees. Please note, this does not include the gas fee. - -{% enddocs %} - -{% docs evm_nft_total_fees_usd %} - -The total amount of fees paid relating to the NFT purchase in US dollars. This includes royalty payments to creators and platform fees. Please note, this does not include the gas fee. - -{% enddocs %} - -{% docs evm_nft_tx_fee %} - -The gas fee for this transaction in the native asset. - -{% enddocs %} - -{% docs evm_nft_tx_fee_usd %} - -The gas fee for this transaction in US dollars. - -{% enddocs %} - -{% docs evm_nft_tx_hash %} - -The transaction hash for the NFT event. This is not necessarily unique in this table as a transaction may contain multiple NFT events. - -{% enddocs %} - -{% docs evm_nft_lending_liquidations_table_doc %} - -This table contains liquidation events for loans backed by collateralized NFTs on this EVM blockchain. This typically means the lender of the loan closes the loan and receives the NFT collateral. - -{% enddocs %} - -{% docs evm_platform_address %} - -The contract address of the platform's lending contract. - -{% enddocs %} - -{% docs evm_platform_name %} - -The name of the platform. - -{% enddocs %} - -{% docs evm_platform_exchange_version %} - -The version of the platform's lending contract. - -{% enddocs %} - -{% docs evm_loanid %} - -The ID associated with the loan, often times tied to the borrower's address and collateral. This ID can be used as a unique identifier when tracking active loans. However, note that refinances can happen while still maintaining the same loanId. For some platforms, loanids of previously paid loans are reused hence they can't be reliably used as a unique identifier without appropriate timestamp filters. Instead, use the unique_loan_id column. - -{% enddocs %} - -{% docs evm_unique_loan_id %} - -The unique ID that can be used to represent a loan within the same platform. For the same loan, the value of this ID will remain the same across the loans taken, liquidations and repayment tables. For some platforms where the lender is issued a promissory note, the lender can send this note to any address, making the receiver the new lender. However, the unique_loan_id still remains the same although the final lender is different. The unique_loan_id changes only if the loanId and lender changes which would also indicate the previous loan has been fully paid off. - -{% enddocs %} - -{% docs evm_lender_address %} - -The address that gives out a loan to the borrower. When a loan is issued, a promissory note (an ERC721) is issued to the lender. The lender can transfer this note to any address which makes any receiving address the new lender. - -{% enddocs %} - -{% docs evm_borrower_address %} - -The address that receives the loan and has an NFT locked as collateral. - -{% enddocs %} - -{% docs evm_nft_address %} - -The address of the NFT used as collateral. - -{% enddocs %} - -{% docs evm_tokenid %} - -The tokenId of the NFT used as collateral. - -{% enddocs %} - -{% docs evm_loan_token_address %} - -The contract address of what the loan is denominated in. This could be either the native asset or other tokens. - -{% enddocs %} - -{% docs evm_loan_token_symbol %} - -The symbol of the loan token address. - -{% enddocs %} - -{% docs evm_principal_unadj %} - -The principal amount of the loan taken with unadjusted decimal places. - -{% enddocs %} - -{% docs evm_principal %} - -The principal amount of the loan taken with adjusted decimal places. - -{% enddocs %} - -{% docs evm_principal_usd %} - -The principal amount of the loan taken in USD terms. - -{% enddocs %} - -{% docs evm_interest_rate %} - -The non-annualized rate charged by the lender on the principal amount of the loan denominated in percentage (%). For fixed term loans, it is calculated by taking the difference between total debt and principal amount divided by principal amount. For perpetual term loans, interest rate is usually on an annual basis and total debt is calculated prorated. - -{% enddocs %} - -{% docs evm_apr %} - -The annualized interest rate denominated in percentage (%). - -{% enddocs %} - -{% docs evm_loan_term_type %} - -The type of loan terms, could be either a fixed loan or a perpetual loan. A fixed term loan has a fixed repayment date while a perpetual loan does not. - -{% enddocs %} - -{% docs evm_loan_start_timestamp %} - -The timestamp of when the loan offer is accepted. - -{% enddocs %} - -{% docs evm_loan_due_timestamp %} - -The timestamp of when the loan is due. For perpetual term loan, the value will be null. - -{% enddocs %} - -{% docs evm_loan_tenure %} - -The tenure of the loan denominated in seconds. For perpetual term loan, the value will be null. - -{% enddocs %} - -{% docs evm_lending_loans %} - -This table contains NFT lending events for loans backed by collateralized NFTs on this EVM blockchain. This could be depositing an NFT and taking out a loan or using the Buy Now Pay Later (BNPL) feature to take a loan out of the newly bought NFT. This NFT will remain locked until the loan is cleared. - -{% enddocs %} - -{% docs evm_nft_lending_event_type %} - -There are 2 types of loan creation events. It can either be a new loan or a refinance of an existing loan. Note that renegotiation events are categorized as refinance events in this table. Old loans are repaid and new loan ids are reissued so these would be new loan entries in this table. - -{% enddocs %} - -{% docs evm_debt_unadj %} - -The total debt of the loan (principal amount plus interests) with unadjusted decimal places. - -{% enddocs %} - -{% docs evm_debt %} - -The total debt of the loan (principal amount plus interests) with adjusted decimal places. - -{% enddocs %} - -{% docs evm_debt_usd %} - -The total debt of the loan (principal amount plus interests) in USD terms. - -{% enddocs %} - -{% docs evm_platform_fee_unadj %} - -The fee charged by the lending platform with unadjusted decimal places. - -{% enddocs %} - -{% docs evm_platform_fee %} - -The fee charged by the lending platform with adjusted decimal places. - -{% enddocs %} - -{% docs evm_platform_fee_usd %} - -The fee charged by the lending platform in USD terms. - -{% enddocs %} - -{% docs evm_mev_arbitrage %} - -This table contains the financial metrics from NFT arbitrage transactions including cost, revenue and profits. - -{% enddocs %} - -{% docs evm_mev_searcher %} - -The address of the MEV finder, taken from the origin address that initiated the transaction. - -{% enddocs %} - -{% docs evm_mev_contract %} - -The contract address that the MEV searcher uses to execute mev transactions, taken from the origin to address of the transaction. - -{% enddocs %} - -{% docs evm_cost_usd %} - -The total cost in USD to purchase the NFT(s) in the transaction. - -{% enddocs %} - -{% docs evm_revenue_usd %} - -The total revenue in USD from selling the NFT(s) and other related tokens in the transaction. - -{% enddocs %} - -{% docs evm_miner_tip_usd %} - -The total amount in USD sent to the block miner/builder as a tip to include the transaction in the block. - -{% enddocs %} - -{% docs evm_profit_usd %} - -The remainder in USD after subtracting cost, miner tip and transaction fee from revenue. - -{% enddocs %} - -{% docs evm_funding_source %} - -The source of the funds used to perform the arbitrage. Currently there are three sources. Existing funds indicate that the user uses funds that are already in their balance while flash loan and flash swaps indicate that the user took a flash loan in the transaction. - -{% enddocs %} - -{% docs evm_arbitrage_direction %} - -The direction in which the arbitrage is performed. There are two possibilities of origin and destination: pool and marketplace. Pool represents marketplaces where users swap from a pool whereas marketplace represents regular marketplaces that are not pool-based. - -{% enddocs %} - -{% docs evm_fact_mev_arbitrage_events %} - -This table contains information about the NFTs involved in arbitrage transactions, documenting events from both the buy and sell sides. - -{% enddocs %} - -{% docs evm_trade_side %} - -The side of the trade that this event represents. This can be either buy or sell. Buy would represent the events where NFTs are bought while sell would present the events where the bought NFTs are sold. Note that the number of events for buy and sell may not be the same for a given transaction. - -{% enddocs %} - -{% docs evm_dim_nft_collection_metadata %} - -This table contains the metadata for popular NFT collections on this EVM blockchain. - -{% enddocs %} - -{% docs evm_nft_blockchain %} - -Blockchain where the NFT metadata is retrieved from. - -{% enddocs %} - -{% docs evm_collection_name %} - -The name for this NFT collection. - -{% enddocs %} - -{% docs evm_tokenid_name %} - -The name for this specific tokenId. This may be the same for all tokenIds within the same collection. - -{% enddocs %} - -{% docs evm_traits %} - -The traits for this tokenId in a key-value pair format. - -{% enddocs %} - -{% docs evm_tokenid_description %} - -The description for this specific tokenId. This may be the same for all tokenIds within the same collection. - -{% enddocs %} - -{% docs evm_tokenid_image_url %} - -The url of the image for this tokenId. - -{% enddocs %} - -{% docs evm_nft_address_tokenid %} - -The concatenation of NFT address and tokenId. - -{% enddocs %} - -{% docs evm_nft_token_standard %} - -The standard of the token, either erc721 or erc1155. - -{% enddocs %} - -{% docs evm_nft_is_mint %} - -Whether the transaction is a mint. - -{% enddocs %} - -{% docs evm_nft_quantity %} - -The quantity of the NFTs minted in the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/traces.md b/models/doc_descriptions/fsc_evm/traces.md deleted file mode 100644 index c6b601e1..00000000 --- a/models/doc_descriptions/fsc_evm/traces.md +++ /dev/null @@ -1,136 +0,0 @@ -{% docs evm_traces_table_doc %} - -This table contains flattened trace data for internal contract calls. User-defined functions (UDFs) are available to decode hex encoded fields, including `utils.udf_hex_to_int()`. - -{% enddocs %} - - -{% docs evm_traces_block_no %} - -The block number of this transaction. - -{% enddocs %} - - -{% docs evm_traces_blocktime %} - -The block timestamp of this transaction. - -{% enddocs %} - - -{% docs evm_traces_call_data %} - -The raw JSON data for this trace. - -{% enddocs %} - - -{% docs evm_traces_value %} - -The amount of the native asset transferred in this trace. - -{% enddocs %} - - -{% docs evm_traces_from %} - -The sending address of this trace. This is not necessarily the from address of the transaction. - -{% enddocs %} - - -{% docs evm_traces_gas %} - -The gas supplied for this trace. - -{% enddocs %} - - -{% docs evm_traces_gas_used %} - -The gas used for this trace. - -{% enddocs %} - - -{% docs evm_traces_identifier %} - -This field represents the position and type of the trace within the transaction. - -{% enddocs %} - - -{% docs evm_trace_index %} - -The index of the trace within the transaction. - -{% enddocs %} - - -{% docs evm_traces_input %} - -The input data for this trace. - -{% enddocs %} - - -{% docs evm_traces_output %} - -The output data for this trace. - -{% enddocs %} - - -{% docs evm_sub_traces %} - -The amount of nested sub traces for this trace. - -{% enddocs %} - - -{% docs evm_traces_to %} - -The receiving address of this trace. This is not necessarily the to address of the transaction. - -{% enddocs %} - - -{% docs evm_traces_tx_hash %} - -The transaction hash for the trace. Please note, this is not necessarily unique in this table as transactions frequently have multiple traces. - -{% enddocs %} - - -{% docs evm_traces_type %} - -The type of internal transaction. Common trace types are `CALL`, `DELEGATECALL`, and `STATICCALL`. - -{% enddocs %} - -{% docs evm_trace_succeeded %} - -The boolean value representing if the trace succeeded. - -{% enddocs %} - -{% docs evm_trace_error_reason %} - -The reason for the trace failure, if any. - -{% enddocs %} - -{% docs evm_trace_address %} - -The trace address for this trace. - -{% enddocs %} - - -{% docs evm_revert_reason %} - -The reason for the revert, if available. - -{% enddocs %} - diff --git a/models/doc_descriptions/fsc_evm/transactions.md b/models/doc_descriptions/fsc_evm/transactions.md deleted file mode 100644 index ec61ce70..00000000 --- a/models/doc_descriptions/fsc_evm/transactions.md +++ /dev/null @@ -1,207 +0,0 @@ -{% docs evm_tx_table_doc %} - -This table contains transaction level data for this EVM blockchain. Each transaction will have a unique transaction hash, along with transaction fees and a value transferred in the native asset when applicable. Transactions may be native asset transfers or interactions with contract addresses. For more information, please see [The Ethereum Organization - Transactions](https://ethereum.org/en/developers/docs/transactions/) - -Below are the specific native tokens that correspond to each EVM chain: - -| Status | Description | -|------------|-------------| -| ETHEREUM | ETH | -| BINANCE | BNB | -| POLYGON | POL | -| AVALANCHE | AVAX | -| ARBITRUM | ETH | -| OPTIMISM | ETH | -| GNOSIS | xDAI | -| KAIA | KLAY | -| SEI | SEI | -| CORE | CORE | - -{% enddocs %} - - -{% docs evm_cumulative_gas_used %} - -The total amount of gas used when this transaction was executed in the block. - -{% enddocs %} - - -{% docs evm_tx_block_hash %} - -Block hash is a unique 66-character identifier that is generated when a block is produced. - -{% enddocs %} - - -{% docs evm_tx_fee %} - -Amount paid to validate the transaction in the native asset. - -{% enddocs %} - - -{% docs evm_tx_gas_limit %} - -Maximum amount of gas allocated for the transaction. - -{% enddocs %} - - -{% docs evm_tx_gas_price %} - -Cost per unit of gas in Gwei. - -{% enddocs %} - - -{% docs evm_tx_gas_used %} - -Gas used by the transaction. - -{% enddocs %} - - -{% docs evm_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. - -{% enddocs %} - - -{% docs evm_tx_input_data %} - -This column contains additional data for this transaction, and is commonly used as part of a contract interaction or as a message to the recipient. - -{% enddocs %} - - -{% docs evm_tx_json %} - -This JSON column contains the transaction details, including event logs. - -{% enddocs %} - - -{% docs evm_tx_nonce %} - -The number of transactions sent from a given address. - -{% enddocs %} - - -{% docs evm_tx_origin_sig %} - -The function signature of the call that triggered this transaction. - -{% enddocs %} - -{% docs evm_origin_sig %} - -The function signature of the contract call that triggered this transaction. - -{% enddocs %} - - -{% docs evm_tx_position %} - -The position of the transaction within the block. - -{% enddocs %} - - -{% docs evm_tx_status %} - -Status of the transaction. - -{% enddocs %} - - -{% docs evm_value %} - -The value transacted in the native asset. - -{% enddocs %} - - -{% docs evm_effective_gas_price %} - -The total base charge plus tip paid for each unit of gas, in Gwei. - -{% enddocs %} - -{% docs evm_max_fee_per_gas %} - -The maximum fee per gas of the transaction, in Gwei. - -{% enddocs %} - - -{% docs evm_max_priority_fee_per_gas %} - -The maximum priority fee per gas of the transaction, in Gwei. - -{% enddocs %} - - -{% docs evm_r %} - -The r value of the transaction signature. - -{% enddocs %} - - -{% docs evm_s %} - -The s value of the transaction signature. - -{% enddocs %} - - -{% docs evm_v %} - -The v value of the transaction signature. - -{% enddocs %} - -{% docs evm_tx_succeeded %} - -Whether the transaction was successful, returned as a boolean. - -{% enddocs %} - -{% docs evm_tx_fee_precise %} - -The precise amount of the transaction fee. This is returned as a string to avoid precision loss. - -{% enddocs %} - -{% docs evm_tx_type %} - -The type of transaction. - -{% enddocs %} - -{% docs evm_mint %} - -The minting event associated with the transaction - -{% enddocs %} - -{% docs evm_source_hash %} - -The hash of the source transaction that created this transaction - -{% enddocs %} - -{% docs evm_eth_value %} - -The eth value for the transaction - -{% enddocs %} - -{% docs evm_chain_id %} - -The unique identifier for the chain the transaction was executed on. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/transfers.md b/models/doc_descriptions/fsc_evm/transfers.md deleted file mode 100644 index 583947ad..00000000 --- a/models/doc_descriptions/fsc_evm/transfers.md +++ /dev/null @@ -1,167 +0,0 @@ -{% docs evm_transfers_table_doc %} - -This table contains all native asset transfers, including equivalent USD amounts. The origin addresses correspond to the to and from addresses from the `fact_transactions` table. The `identifier` and `tx_hash` columns relate this table back to `fact_traces`, which contains more details on the transfers. - -Below are the specific native tokens that correspond to each EVM chain: - -| Status | Description | -|------------|-------------| -| ETHEREUM | ETH | -| BINANCE | BNB | -| POLYGON | POL | -| AVALANCHE | AVAX | -| ARBITRUM | ETH | -| OPTIMISM | ETH | -| GNOSIS | xDAI | -| KAIA | KLAY | - -{% enddocs %} - - -{% docs evm_transfer_table_doc %} - -This table contains all events in the `fact_token_transfers` table, along with joined columns such as token price, symbol, and decimals where possible that allow for easier analysis of token transfer events. Please note native asset transfers are not included here. - -{% enddocs %} - - -{% docs evm_fact_token_transfers_table_doc %} - -This fact-based table contains emitted event logs for ERC-20 Token Transfers (e.g. `Transfer`: topic_0 = `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`). The contract address is the token transferred, and the raw amount field is the amount of tokens transferred. The values in this table are not decimal adjusted, instead please use `core.dim_contracts` or `core.ez_token_transfers` to reference decimals or decimal adjusted values. This table does not contain ERC-721 and ERC-1155 token transfers, instead please use `nft.ez_nft_transfers`. Additionally, this table does not contain transfers of the chain's native asset, instead please use `core.ez_native_transfers`. - -{% enddocs %} - - -{% docs evm_ez_token_transfers_table_doc %} - -This convenience table contains emitted event logs for ERC-20 Token Transfers (e.g. `Transfer`: topic_0 = `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`), including decimal adjusted values, USD values, and other helpful token metadata where available for each transfer event. The contract address is the token transferred, and the raw amount field is the amount of tokens transferred. Note, this table does not contain ERC-721 and ERC-1155 token transfers, instead please use `nft.ez_nft_transfers`. Additionally, this table does not contain transfers of the chain's native asset, instead please use `core.ez_native_transfers`. - -{% enddocs %} - - -{% docs evm_ez_native_transfers_table_doc %} - -This convenience table contains all transfers for the chain's native asset, sourced from internal traces (`core.fact_traces`), and includes decimal adjusted and USD values where available. The origin addresses correspond to the to and from addresses in the `core.fact_transactions` table. Note, this table does not contain ERC-721 and ERC-1155 token transfers, instead please use `nft.ez_nft_transfers`. - -{% enddocs %} - - -{% docs evm_amount %} - -Native asset value transferred, this is imported from the fsc-evm package. - -{% enddocs %} - - -{% docs evm_amount_usd %} - -Native asset value transferred, in USD. - -{% enddocs %} - - -{% docs evm_log_id_transfers %} - -This is the primary key for this table. This is a concatenation of the transaction hash and the event index at which the transfer event occurred. This field can be used to find more details on the event within the `fact_event_logs` table. - -{% enddocs %} - - -{% docs evm_origin_from %} - -The from address at the transaction level. - -{% enddocs %} - - -{% docs evm_origin_to %} - -The to address at the transaction level. - -{% enddocs %} - - -{% docs evm_transfer_amount %} - -The decimal transformed amount for this token. Tokens without a decimal adjustment will be nulled out here. - -{% enddocs %} - - -{% docs evm_transfer_amount_precise %} - -The decimal transformed amount for this token returned as a string to preserve precision. Tokens without a decimal adjustment will be nulled out here. - -{% enddocs %} - - -{% docs evm_transfer_amount_usd %} - -The amount in US dollars for this transfer at the time of the transfer. Tokens without a decimal adjustment or price will be nulled out here. - -{% enddocs %} - - -{% docs evm_transfer_contract_address %} - -Contract address of the token being transferred. - -{% enddocs %} - - -{% docs evm_transfer_from_address %} - -The sending address of this transfer. - -{% enddocs %} - - -{% docs evm_transfer_has_decimal %} - -Whether or not our contracts model contains the necessary decimal adjustment for this token. - -{% enddocs %} - - -{% docs evm_transfer_has_price %} - -Whether or not our prices model contains this hourly token price. - -{% enddocs %} - - -{% docs evm_transfer_raw_amount %} - -The amount of tokens transferred. This value is not decimal adjusted. - -{% enddocs %} - - -{% docs evm_transfer_raw_amount_precise %} - -The amount of tokens transferred returned as a string to preserve precision. This value is not decimal adjusted. - -{% enddocs %} - - -{% docs evm_transfer_to_address %} - -The receiving address of this transfer. This can be a contract address. - -{% enddocs %} - - -{% docs evm_transfer_token_price %} - -The price, if available, for this token at the transfer time. - -{% enddocs %} - - -{% docs evm_transfer_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. This will not be unique in this table as a transaction could include multiple transfer events. - -{% enddocs %} - - diff --git a/models/doc_descriptions/general/deprecation.md b/models/doc_descriptions/general/deprecation.md deleted file mode 100644 index 701b7f39..00000000 --- a/models/doc_descriptions/general/deprecation.md +++ /dev/null @@ -1,11 +0,0 @@ -{% docs internal_column %} - -Deprecated. This column is no longer used. Please remove from your query by Jan. 31 2024.' - -{% enddocs %} - -{% docs amount_deprecation %} - -This column is being deprecated for standardization purposes on Jan. 31 2024. Please use the equivalent column without the native asset prefix. For example, use `amount` instead of `eth_amount`. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/export_columns.md b/models/doc_descriptions/general/export_columns.md deleted file mode 100644 index 848af449..00000000 --- a/models/doc_descriptions/general/export_columns.md +++ /dev/null @@ -1,19 +0,0 @@ -{% docs pk %} - -The unique identifier for each row in the table. - -{% enddocs %} - -{% docs inserted_timestamp %} - -The utc timestamp at which the row was inserted into the table. - -{% enddocs %} - -{% docs modified_timestamp %} - -The utc timestamp at which the row was last modified. - -{% enddocs %} - - diff --git a/models/doc_descriptions/general/opt_block_number.md b/models/doc_descriptions/general/opt_block_number.md deleted file mode 100644 index aed83904..00000000 --- a/models/doc_descriptions/general/opt_block_number.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_block_number %} - -Also known as block height. The block number, which indicates the length of the blockchain, increases after the addition of each new block. - -{% enddocs %} diff --git a/models/doc_descriptions/general/opt_block_timestamp.md b/models/doc_descriptions/general/opt_block_timestamp.md deleted file mode 100644 index 7f5db569..00000000 --- a/models/doc_descriptions/general/opt_block_timestamp.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_block_timestamp %} - -The date and time at which the block was produced. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/opt_decimals.md b/models/doc_descriptions/general/opt_decimals.md deleted file mode 100644 index 68e110d8..00000000 --- a/models/doc_descriptions/general/opt_decimals.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_decimals %} - -The number of decimal places this contract needs adjusted where token values exist. For example, use the decimal field to correctly transform raw amounts in ```fact_token_transfers```. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/opt_from_address.md b/models/doc_descriptions/general/opt_from_address.md deleted file mode 100644 index f43bd057..00000000 --- a/models/doc_descriptions/general/opt_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_from_address %} - -The sending address of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/opt_ingested_at.md b/models/doc_descriptions/general/opt_ingested_at.md deleted file mode 100644 index 71020e9c..00000000 --- a/models/doc_descriptions/general/opt_ingested_at.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_ingested_at %} - -Internal column. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/opt_symbol.md b/models/doc_descriptions/general/opt_symbol.md deleted file mode 100644 index 0dadbb49..00000000 --- a/models/doc_descriptions/general/opt_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_symbol %} - -The symbol belonging to the address of the token - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/opt_to_address.md b/models/doc_descriptions/general/opt_to_address.md deleted file mode 100644 index 7c7ce28d..00000000 --- a/models/doc_descriptions/general/opt_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_to_address %} - -The receiving address of this transaction. This can be a contract address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/precise_amounts.md b/models/doc_descriptions/general/precise_amounts.md deleted file mode 100644 index 96a815cb..00000000 --- a/models/doc_descriptions/general/precise_amounts.md +++ /dev/null @@ -1,17 +0,0 @@ -{% docs precise_amount_unadjusted %} - -The precise, unadjusted amount of the transaction. This is returned as a string to avoid precision loss. - -{% enddocs %} - -{% docs precise_amount_adjusted %} - -The precise, adjusted amount of the transaction. This is returned as a string to avoid precision loss. - -{% enddocs %} - -{% docs tx_fee_precise %} - -The precise amount of the transaction fee. This is returned as a string to avoid precision loss. - -{% enddocs %} diff --git a/models/doc_descriptions/labels/op_label.md b/models/doc_descriptions/labels/op_label.md deleted file mode 100644 index c14d9499..00000000 --- a/models/doc_descriptions/labels/op_label.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_project_name %} - -The name of the project for this address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/op_label_address.md b/models/doc_descriptions/labels/op_label_address.md deleted file mode 100644 index b3334060..00000000 --- a/models/doc_descriptions/labels/op_label_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_label_address %} - -Address that the label is for. This is the field that should be used to join other tables with labels. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/op_label_address_name.md b/models/doc_descriptions/labels/op_label_address_name.md deleted file mode 100644 index e0c41d47..00000000 --- a/models/doc_descriptions/labels/op_label_address_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_label_address_name %} - -The most granular label for this address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/op_label_blockchain.md b/models/doc_descriptions/labels/op_label_blockchain.md deleted file mode 100644 index f3ddd69f..00000000 --- a/models/doc_descriptions/labels/op_label_blockchain.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_label_blockchain %} - -The name of the blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/op_label_creator.md b/models/doc_descriptions/labels/op_label_creator.md deleted file mode 100644 index ca3c306c..00000000 --- a/models/doc_descriptions/labels/op_label_creator.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_label_creator %} - -The name of the creator of the label. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/op_label_subtype.md b/models/doc_descriptions/labels/op_label_subtype.md deleted file mode 100644 index 5e1dcdc8..00000000 --- a/models/doc_descriptions/labels/op_label_subtype.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_label_subtype %} - -A sub-category nested within label type providing further detail. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/op_label_type.md b/models/doc_descriptions/labels/op_label_type.md deleted file mode 100644 index 332dd9cc..00000000 --- a/models/doc_descriptions/labels/op_label_type.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_label_type %} - -A high-level category describing the addresses main function or ownership. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/op_labels_table_doc.md b/models/doc_descriptions/labels/op_labels_table_doc.md deleted file mode 100644 index d3c08656..00000000 --- a/models/doc_descriptions/labels/op_labels_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_labels_table %} - -This table contains labels for addresses on the Optimism Blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/table_dim_labels.md b/models/doc_descriptions/labels/table_dim_labels.md deleted file mode 100644 index 10e72c4d..00000000 --- a/models/doc_descriptions/labels/table_dim_labels.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs table_dim_labels %} - -The labels table is a store of one-to-one address identifiers, or an address name. Labels are broken out into a "type" (such as cex, dex, dapp, games, etc.) and a "subtype" (ex: contract_deployer, hot_wallet, token_contract, etc.) in order to help classify each address name into similar groups. Our labels are sourced from many different places, but can primarily be grouped into two categories: automatic and manual. Automatic labels are continuously labeled based on certain criteria, such as a known contract deploying another contract, behavior based algorithms for finding deposit wallets, and consistent data pulls of custom protocol APIs. Manual labels are done periodically to find addresses that cannot be found programmatically such as finding new protocol addresses, centralized exchange hot wallets, or trending addresses. Labels can also be added by our community by using our add-a-label tool (https://science.flipsidecrypto.xyz/add-a-label/) or on-chain with near (https://near.social/lord1.near/widget/Form) and are reviewed by our labels team. A label can be removed by our labels team if it is found to be incorrect or no longer relevant; this generally will only happen for mislabeled deposit wallets. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_aggregator_name.md b/models/doc_descriptions/nft/nft_aggregator_name.md deleted file mode 100644 index 6a1b73a9..00000000 --- a/models/doc_descriptions/nft/nft_aggregator_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_aggregator_name%} - -The name of the aggregator platform where the sale took place. If the sale did not take place via an aggregator platform, then the value will be null. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_block_no.md b/models/doc_descriptions/nft/nft_block_no.md deleted file mode 100644 index 5f56a54f..00000000 --- a/models/doc_descriptions/nft/nft_block_no.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_block_no %} - -The block number at which the NFT event occurred. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_blocktime.md b/models/doc_descriptions/nft/nft_blocktime.md deleted file mode 100644 index 10802389..00000000 --- a/models/doc_descriptions/nft/nft_blocktime.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_blocktime %} - -The block timestamp at which the NFT event occurred. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_buyer_address.md b/models/doc_descriptions/nft/nft_buyer_address.md deleted file mode 100644 index eeb9c3d8..00000000 --- a/models/doc_descriptions/nft/nft_buyer_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_buyer_address %} - -The address of the buyer of the NFT in the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_creator_fee.md b/models/doc_descriptions/nft/nft_creator_fee.md deleted file mode 100644 index 27fa2f8d..00000000 --- a/models/doc_descriptions/nft/nft_creator_fee.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_creator_fee %} - -The decimal adjusted amount of fees paid to the NFT collection as royalty payments for this NFT event in the transaction's currency. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_creator_fee_usd.md b/models/doc_descriptions/nft/nft_creator_fee_usd.md deleted file mode 100644 index 22c9396a..00000000 --- a/models/doc_descriptions/nft/nft_creator_fee_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_creator_fee_usd %} - -The amount of fees paid to the NFT collection as royalty payments for this NFT event in US dollars. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_currency_address.md b/models/doc_descriptions/nft/nft_currency_address.md deleted file mode 100644 index 964184ce..00000000 --- a/models/doc_descriptions/nft/nft_currency_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_currency_address %} - -The token contract address for this NFT event. This will be `AVAX` for native AVAX transactions. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_currency_symbol.md b/models/doc_descriptions/nft/nft_currency_symbol.md deleted file mode 100644 index 3dd3c734..00000000 --- a/models/doc_descriptions/nft/nft_currency_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_currency_symbol %} - -The token symbol for this NFT event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_erc1155_value.md b/models/doc_descriptions/nft/nft_erc1155_value.md deleted file mode 100644 index 580ba064..00000000 --- a/models/doc_descriptions/nft/nft_erc1155_value.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_erc1155_value %} - -If the NFT is an ERC-1155 contract, this field may be one or greater, representing the number of tokens. If it is not an ERC-1155 token, this value will be null. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_event_index.md b/models/doc_descriptions/nft/nft_event_index.md deleted file mode 100644 index 0d5fc391..00000000 --- a/models/doc_descriptions/nft/nft_event_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_event_index %} - -Event number within a transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_event_type.md b/models/doc_descriptions/nft/nft_event_type.md deleted file mode 100644 index 82f5d8cf..00000000 --- a/models/doc_descriptions/nft/nft_event_type.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_event_type %} - -The type of NFT event in this transaction, either `sale`, `bid_won` or `redeem`. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_events_table_doc.md b/models/doc_descriptions/nft/nft_events_table_doc.md deleted file mode 100644 index 0a172fbf..00000000 --- a/models/doc_descriptions/nft/nft_events_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_events_table_doc %} - -This table contains NFT sales on the Optimism blockchain. More NFT marketplaces will be added over time. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_from_address.md b/models/doc_descriptions/nft/nft_from_address.md deleted file mode 100644 index a1d3c41d..00000000 --- a/models/doc_descriptions/nft/nft_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_from_address %} - -The sending address of the NFT in the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_intra_event_index.md b/models/doc_descriptions/nft/nft_intra_event_index.md deleted file mode 100644 index 4ce24fc7..00000000 --- a/models/doc_descriptions/nft/nft_intra_event_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_intra_event_index %} - -The order of events within a single event index. This is primarily used for ERC1155 NFT batch transfer events. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_metadata.md b/models/doc_descriptions/nft/nft_metadata.md deleted file mode 100644 index 3d016535..00000000 --- a/models/doc_descriptions/nft/nft_metadata.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_metadata %} - -The token metadata for this NFT. This may be blank for many NFTs. We are working to expand this field. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mint_count.md b/models/doc_descriptions/nft/nft_mint_count.md deleted file mode 100644 index a84c6bbf..00000000 --- a/models/doc_descriptions/nft/nft_mint_count.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mint_count %} - -The number of NFTs minted in this event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mint_doc.md b/models/doc_descriptions/nft/nft_mint_doc.md deleted file mode 100644 index 8d6c6efc..00000000 --- a/models/doc_descriptions/nft/nft_mint_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mint_doc %} - -This table contains NFT mint events, defined as an NFT transfers from a burn address to an address, on the Avalanche blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mint_price.md b/models/doc_descriptions/nft/nft_mint_price.md deleted file mode 100644 index 7b3633ef..00000000 --- a/models/doc_descriptions/nft/nft_mint_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mint_price %} - -The price paid in AVAX to mint the NFT(s). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mint_price_usd.md b/models/doc_descriptions/nft/nft_mint_price_usd.md deleted file mode 100644 index 7e8bf177..00000000 --- a/models/doc_descriptions/nft/nft_mint_price_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mint_price_usd %} - -The price paid in US dollars to mint the NFT(s). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mints_symbol.md b/models/doc_descriptions/nft/nft_mints_symbol.md deleted file mode 100644 index 688ae3d9..00000000 --- a/models/doc_descriptions/nft/nft_mints_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mints_symbol %} - -The symbol of the token supplied to mint the NFT, if applicable. This field may not handle all edge cases. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mints_token_address.md b/models/doc_descriptions/nft/nft_mints_token_address.md deleted file mode 100644 index 84d1946f..00000000 --- a/models/doc_descriptions/nft/nft_mints_token_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mints_token_address %} - -The contract address of the token supplied to mint the NFT, if applicable. This field may not handle all edge cases. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mints_token_price.md b/models/doc_descriptions/nft/nft_mints_token_price.md deleted file mode 100644 index 03942a45..00000000 --- a/models/doc_descriptions/nft/nft_mints_token_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mints_token_price %} - -The decimal adjusted amount of tokens supplied within the same transaction to mint the NFT. This field may not handle all edge cases. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mints_token_price_usd.md b/models/doc_descriptions/nft/nft_mints_token_price_usd.md deleted file mode 100644 index 9e500f79..00000000 --- a/models/doc_descriptions/nft/nft_mints_token_price_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mints_token_price_usd %} - -The amount of tokens supplied in US dollars within the same transaction to mint the NFT. This field may not handle all edge cases. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_nft_address.md b/models/doc_descriptions/nft/nft_nft_address.md deleted file mode 100644 index b064027d..00000000 --- a/models/doc_descriptions/nft/nft_nft_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_nft_address %} - -The contract address of the NFT. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_nft_from_address.md b/models/doc_descriptions/nft/nft_nft_from_address.md deleted file mode 100644 index b5e039f1..00000000 --- a/models/doc_descriptions/nft/nft_nft_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_nft_from_address %} - -The address of the nft sender for this event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_nft_to_address.md b/models/doc_descriptions/nft/nft_nft_to_address.md deleted file mode 100644 index 4d6e121c..00000000 --- a/models/doc_descriptions/nft/nft_nft_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_nft_to_address %} - -The address of the nft receiver for this event. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_origin_from.md b/models/doc_descriptions/nft/nft_origin_from.md deleted file mode 100644 index 252828b6..00000000 --- a/models/doc_descriptions/nft/nft_origin_from.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_origin_from %} - -The from address of this transaction. In most cases, this is the NFT buyer. However, for some more complex transactions, it may not be the NFT buyer. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_origin_sig.md b/models/doc_descriptions/nft/nft_origin_sig.md deleted file mode 100644 index 02b4ce68..00000000 --- a/models/doc_descriptions/nft/nft_origin_sig.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_origin_sig %} - -The function signature of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_origin_to.md b/models/doc_descriptions/nft/nft_origin_to.md deleted file mode 100644 index 316a2b67..00000000 --- a/models/doc_descriptions/nft/nft_origin_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_origin_to %} - -The to address of this transaction. In most cases, this is the exchange contract. However, for some more complex NFT events, such as aggregate buys with tools such as Gem and Genie, this may not be the exchange address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_platform_address.md b/models/doc_descriptions/nft/nft_platform_address.md deleted file mode 100644 index aa0f0595..00000000 --- a/models/doc_descriptions/nft/nft_platform_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_platform_address %} - -The address of the exchange used for the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_platform_exchange_version.md b/models/doc_descriptions/nft/nft_platform_exchange_version.md deleted file mode 100644 index 18be47c5..00000000 --- a/models/doc_descriptions/nft/nft_platform_exchange_version.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_platform_exchange_version %} - -The version of the exchange contract used for the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_platform_fee.md b/models/doc_descriptions/nft/nft_platform_fee.md deleted file mode 100644 index 6497c539..00000000 --- a/models/doc_descriptions/nft/nft_platform_fee.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_platform_fee %} - -The decimal adjusted amount of fees paid to the platform for this NFT event in the transaction's currency. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_platform_fee_usd.md b/models/doc_descriptions/nft/nft_platform_fee_usd.md deleted file mode 100644 index 552cbfd2..00000000 --- a/models/doc_descriptions/nft/nft_platform_fee_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_platform_fee_usd %} - -The amount of fees paid to the platform for this NFT event in US dollars. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_platform_name.md b/models/doc_descriptions/nft/nft_platform_name.md deleted file mode 100644 index 05c78e18..00000000 --- a/models/doc_descriptions/nft/nft_platform_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_platform_name %} - -The name of the exchange used for the trade. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_price.md b/models/doc_descriptions/nft/nft_price.md deleted file mode 100644 index 1dccd768..00000000 --- a/models/doc_descriptions/nft/nft_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_price %} - -The amount of the NFT event in the currency in which the transaction occurred, decimal adjusted where possible. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_price_usd.md b/models/doc_descriptions/nft/nft_price_usd.md deleted file mode 100644 index 2dc1df12..00000000 --- a/models/doc_descriptions/nft/nft_price_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_price_usd %} - -The amount of the NFT event in US dollars. This will be 0 for tokens without a decimal adjustment or hourly price. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_project_name.md b/models/doc_descriptions/nft/nft_project_name.md deleted file mode 100644 index 2ddcf233..00000000 --- a/models/doc_descriptions/nft/nft_project_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_project_name %} - -The name of the NFT project. This field, along with metadata, will be filled in over time. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_seller_address.md b/models/doc_descriptions/nft/nft_seller_address.md deleted file mode 100644 index 198294c7..00000000 --- a/models/doc_descriptions/nft/nft_seller_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_seller_address %} - -The address of the seller of the NFT in the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_to_address.md b/models/doc_descriptions/nft/nft_to_address.md deleted file mode 100644 index 547c3838..00000000 --- a/models/doc_descriptions/nft/nft_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_to_address %} - -The receiving address of the NFT in the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_tokenid.md b/models/doc_descriptions/nft/nft_tokenid.md deleted file mode 100644 index 6d2e48b6..00000000 --- a/models/doc_descriptions/nft/nft_tokenid.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_tokenid %} - -The token ID for this NFT contract. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_total_fees.md b/models/doc_descriptions/nft/nft_total_fees.md deleted file mode 100644 index 7ec60c98..00000000 --- a/models/doc_descriptions/nft/nft_total_fees.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_total_fees %} - -The total amount of fees paid relating to the NFT purchase in the transaction currency. This includes royalty payments to creators and platform fees. Please note, this does not include the gas fee. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_total_fees_usd.md b/models/doc_descriptions/nft/nft_total_fees_usd.md deleted file mode 100644 index e37b7198..00000000 --- a/models/doc_descriptions/nft/nft_total_fees_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_total_fees_usd %} - -The total amount of fees paid relating to the NFT purchase in US dollars. This includes royalty payments to creators and platform fees. Please note, this does not include the gas fee. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_transfer_doc.md b/models/doc_descriptions/nft/nft_transfer_doc.md deleted file mode 100644 index 7fd7dd04..00000000 --- a/models/doc_descriptions/nft/nft_transfer_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_transfer_doc %} - -This table contains NFT transfer events on the Optimism blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_tx_fee.md b/models/doc_descriptions/nft/nft_tx_fee.md deleted file mode 100644 index c5161cc4..00000000 --- a/models/doc_descriptions/nft/nft_tx_fee.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_tx_fee %} - -The gas fee for this transaction in ETH. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_tx_fee_usd.md b/models/doc_descriptions/nft/nft_tx_fee_usd.md deleted file mode 100644 index 24ea6625..00000000 --- a/models/doc_descriptions/nft/nft_tx_fee_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_tx_fee_usd %} - -The gas fee for this transaction in US dollars. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_tx_hash.md b/models/doc_descriptions/nft/nft_tx_hash.md deleted file mode 100644 index 10e77623..00000000 --- a/models/doc_descriptions/nft/nft_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_tx_hash %} - -The transaction hash for the NFT event. This is not necessarily unique in this table as a transaction may contain multiple NFT events. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/prices/prices.md b/models/doc_descriptions/prices/prices.md deleted file mode 100644 index 60d4e969..00000000 --- a/models/doc_descriptions/prices/prices.md +++ /dev/null @@ -1,143 +0,0 @@ -{% docs prices_dim_asset_metadata_table_doc %} - -A comprehensive dimensional table holding asset metadata and other relevant details pertaining to each id, from multiple providers. This data set includes raw, non-transformed data coming directly from the provider APIs and rows are not intended to be unique. As a result, there may be data quality issues persisting in the APIs that flow through to this dimensional model. If you are interested in using a curated data set instead, please utilize ez_asset_metadata. - -{% enddocs %} - -{% docs prices_ez_asset_metadata_table_doc %} - -A convenience table holding prioritized asset metadata and other relevant details pertaining to each token_address and native asset. This data set is highly curated and contains metadata for one unique asset per blockchain. - -{% enddocs %} - -{% docs prices_fact_prices_ohlc_hourly_table_doc %} - -A comprehensive fact table holding id and provider specific open, high, low, close hourly prices, from multiple providers. This data set includes raw, non-transformed data coming directly from the provider APIs and rows are not intended to be unique. As a result, there may be data quality issues persisting in the APIs that flow through to this fact based model. If you are interested in using a curated data set instead, please utilize ez_prices_hourly. - -{% enddocs %} - -{% docs prices_ez_prices_hourly_table_doc %} - -A convenience table for determining token prices by address and blockchain, and native asset prices by symbol and blockchain. This data set is highly curated and contains metadata for one price per hour per unique asset and blockchain. - -{% enddocs %} - -{% docs prices_provider %} - -The provider or source of the data. - -{% enddocs %} - -{% docs prices_asset_id %} - -The unique identifier representing the asset. - -{% enddocs %} - -{% docs prices_name %} - -The name of asset. - -{% enddocs %} - -{% docs prices_symbol %} - -The symbol of asset. - -{% enddocs %} - -{% docs prices_token_address %} - -The specific address representing the asset on a specific platform. This will be NULL if referring to a native asset. - -{% enddocs %} - -{% docs prices_token_address_evm %} - -The specific address representing the asset on a specific platform. This will be NULL if referring to a native asset. The case (upper / lower) may or may not be specified within the `dim_asset_metadata` table, as this column is raw and not transformed, coming directly from the provider APIs. However, in the `ez_` views, it will be lowercase by default for all EVMs. - -{% enddocs %} - -{% docs prices_blockchain %} - -The Blockchain, Network, or Platform for this asset. - -{% enddocs %} - -{% docs prices_blockchain_id %} - -The unique identifier of the Blockchain, Network, or Platform for this asset. - -{% enddocs %} - -{% docs prices_decimals %} - -The number of decimals for the asset. May be NULL. - -{% enddocs %} - -{% docs prices_is_native %} - -A flag indicating assets native to the respective blockchain. - -{% enddocs %} - -{% docs prices_is_deprecated %} - -A flag indicating if the asset is deprecated or no longer supported by the provider. - -{% enddocs %} - -{% docs prices_id_deprecation %} - -Deprecating soon! Please use the `asset_id` column instead. - -{% enddocs %} - -{% docs prices_decimals_deprecation %} - -Deprecating soon! Please use the decimals column in `ez_asset_metadata` or join in `dim_contracts` instead. - -{% enddocs %} - -{% docs prices_hour %} - -Hour that the price was recorded at. - -{% enddocs %} - -{% docs prices_price %} - -Closing price of the recorded hour in USD. - -{% enddocs %} - -{% docs prices_is_imputed %} - -A flag indicating if the price was imputed, or derived, from the last arriving record. This is generally used for tokens with low-liquidity or inconsistent reporting. - -{% enddocs %} - -{% docs prices_open %} - -Opening price of the recorded hour in USD. - -{% enddocs %} - -{% docs prices_high %} - -Highest price of the recorded hour in USD - -{% enddocs %} - -{% docs prices_low %} - -Lowest price of the recorded hour in USD - -{% enddocs %} - -{% docs prices_close %} - -Closing price of the recorded hour in USD - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/stats/evm_stats_core.md b/models/doc_descriptions/stats/evm_stats_core.md deleted file mode 100644 index e8a450a9..00000000 --- a/models/doc_descriptions/stats/evm_stats_core.md +++ /dev/null @@ -1,71 +0,0 @@ -{% docs evm_ez_core_metrics_hourly_table_doc %} - -A convenience table that aggregates block and transaction related metrics using various aggregate functions such as SUM, COUNT, MIN and MAX from the fact_transactions table, on an hourly basis. - -{% enddocs %} - -{% docs evm_block_timestamp_hour %} - -The hour of the timestamp of the block. - -{% enddocs %} - -{% docs evm_block_number_min %} - -The minimum block number in the hour. - -{% enddocs %} - -{% docs evm_block_number_max %} - -The maximum block number in the hour. - -{% enddocs %} - -{% docs evm_block_count %} - -The number of blocks in the hour. - -{% enddocs %} - -{% docs evm_transaction_count %} - -The number of transactions in the hour. - -{% enddocs %} - -{% docs evm_transaction_count_success %} - -The number of successful transactions in the hour. - -{% enddocs %} - -{% docs evm_transaction_count_failed %} - -The number of failed transactions in the hour. - -{% enddocs %} - -{% docs evm_unique_from_count %} - -The number of unique origin from addresses in the hour. - -{% enddocs %} - -{% docs evm_unique_to_count %} - -The number of unique origin to addresses in the hour. - -{% enddocs %} - -{% docs evm_total_fees_native %} - -The sum of all fees in the hour, in the native fee currency. Note, Snowflake's native SUM() function may limit decimal precision. To view precise transaction fee values, please use the `tx_fee_precise` column in `core.fact_transactions`. - -{% enddocs %} - -{% docs evm_total_fees_usd %} - -The sum of all fees in the hour, in USD, rounded to 2 decimal places. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_block_no.md b/models/doc_descriptions/traces/opt_traces_block_no.md deleted file mode 100644 index edc5e69e..00000000 --- a/models/doc_descriptions/traces/opt_traces_block_no.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_block_no %} - -The block number of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_blocktime.md b/models/doc_descriptions/traces/opt_traces_blocktime.md deleted file mode 100644 index 934570f6..00000000 --- a/models/doc_descriptions/traces/opt_traces_blocktime.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_blocktime %} - -The block timestamp of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_call_data.md b/models/doc_descriptions/traces/opt_traces_call_data.md deleted file mode 100644 index e33e25b2..00000000 --- a/models/doc_descriptions/traces/opt_traces_call_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_call_data %} - -The raw JSON data for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_from.md b/models/doc_descriptions/traces/opt_traces_from.md deleted file mode 100644 index 81ef372e..00000000 --- a/models/doc_descriptions/traces/opt_traces_from.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_from %} - -The sending address of this trace. This is not necessarily the from address of the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_gas.md b/models/doc_descriptions/traces/opt_traces_gas.md deleted file mode 100644 index 080281d3..00000000 --- a/models/doc_descriptions/traces/opt_traces_gas.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_gas %} - -The gas supplied for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_gas_used.md b/models/doc_descriptions/traces/opt_traces_gas_used.md deleted file mode 100644 index 1800001c..00000000 --- a/models/doc_descriptions/traces/opt_traces_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_gas_used %} - -The gas used for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_identifier.md b/models/doc_descriptions/traces/opt_traces_identifier.md deleted file mode 100644 index 04404bf8..00000000 --- a/models/doc_descriptions/traces/opt_traces_identifier.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_identifier %} - -This field represents the position and type of the trace within the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_index.md b/models/doc_descriptions/traces/opt_traces_index.md deleted file mode 100644 index 1f462629..00000000 --- a/models/doc_descriptions/traces/opt_traces_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_trace_index %} - -The index of the trace within the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_input.md b/models/doc_descriptions/traces/opt_traces_input.md deleted file mode 100644 index adaeaa93..00000000 --- a/models/doc_descriptions/traces/opt_traces_input.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_input %} - -The input data for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_output.md b/models/doc_descriptions/traces/opt_traces_output.md deleted file mode 100644 index 6cd8e2da..00000000 --- a/models/doc_descriptions/traces/opt_traces_output.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_output %} - -The output data for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_sub.md b/models/doc_descriptions/traces/opt_traces_sub.md deleted file mode 100644 index 3f28d02a..00000000 --- a/models/doc_descriptions/traces/opt_traces_sub.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_sub %} - -The amount of nested sub traces for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_table_doc.md b/models/doc_descriptions/traces/opt_traces_table_doc.md deleted file mode 100644 index 60bb8ae6..00000000 --- a/models/doc_descriptions/traces/opt_traces_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_table_doc %} - -This table contains flattened trace data for internal contract calls on the Optimism Blockchain. Hex encoded fields can be decoded to integers by using `ethereum.ethereum.public.udf_hex_to_int()`. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_to.md b/models/doc_descriptions/traces/opt_traces_to.md deleted file mode 100644 index 9fad2640..00000000 --- a/models/doc_descriptions/traces/opt_traces_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_to %} - -The receiving address of this trace. This is not necessarily the to address of the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_tx_hash.md b/models/doc_descriptions/traces/opt_traces_tx_hash.md deleted file mode 100644 index f954c903..00000000 --- a/models/doc_descriptions/traces/opt_traces_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_tx_hash %} - -The transaction hash for the trace. Please note, this is not necessarily unique in this table as transactions frequently have multiple traces. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_type.md b/models/doc_descriptions/traces/opt_traces_type.md deleted file mode 100644 index 6e958bbe..00000000 --- a/models/doc_descriptions/traces/opt_traces_type.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_type %} - -The type of internal transaction. Common trace types are `CALL`, `DELEGATECALL`, and `STATICCALL`. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/opt_traces_value.md b/models/doc_descriptions/traces/opt_traces_value.md deleted file mode 100644 index 327145ab..00000000 --- a/models/doc_descriptions/traces/opt_traces_value.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_traces_value %} - -The amount of ETH transferred in this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_cumulative_gas_used.md b/models/doc_descriptions/transactions/opt_cumulative_gas_used.md deleted file mode 100644 index 4fe84328..00000000 --- a/models/doc_descriptions/transactions/opt_cumulative_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_cumulative_gas_used %} - -The total amount of gas used when this transaction was executed in the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_block_hash.md b/models/doc_descriptions/transactions/opt_tx_block_hash.md deleted file mode 100644 index 4f59531c..00000000 --- a/models/doc_descriptions/transactions/opt_tx_block_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_block_hash %} - -Block hash is a unique 66-character identifier that is generate when a block is produced. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_fee.md b/models/doc_descriptions/transactions/opt_tx_fee.md deleted file mode 100644 index ec392f48..00000000 --- a/models/doc_descriptions/transactions/opt_tx_fee.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_fee %} - -Amount paid to validate the transaction in ETH. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_gas_limit.md b/models/doc_descriptions/transactions/opt_tx_gas_limit.md deleted file mode 100644 index a680b126..00000000 --- a/models/doc_descriptions/transactions/opt_tx_gas_limit.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_gas_limit %} - -Maximum amount of gas allocated for the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_gas_price.md b/models/doc_descriptions/transactions/opt_tx_gas_price.md deleted file mode 100644 index 0066037f..00000000 --- a/models/doc_descriptions/transactions/opt_tx_gas_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_gas_price %} - -Cost per unit of gas in Gwei. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_gas_used.md b/models/doc_descriptions/transactions/opt_tx_gas_used.md deleted file mode 100644 index a135a439..00000000 --- a/models/doc_descriptions/transactions/opt_tx_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_gas_used %} - -Gas used by transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_hash.md b/models/doc_descriptions/transactions/opt_tx_hash.md deleted file mode 100644 index fc15b451..00000000 --- a/models/doc_descriptions/transactions/opt_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_input_data.md b/models/doc_descriptions/transactions/opt_tx_input_data.md deleted file mode 100644 index 78b31a3c..00000000 --- a/models/doc_descriptions/transactions/opt_tx_input_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_input_data %} - -This column contains additional data for this transaction, and is commonly used as part of a contract interaction or as a message to the recipient. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_json.md b/models/doc_descriptions/transactions/opt_tx_json.md deleted file mode 100644 index c70da1b3..00000000 --- a/models/doc_descriptions/transactions/opt_tx_json.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_json %} - -This JSON column contains the transaction details, including event logs. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_nonce.md b/models/doc_descriptions/transactions/opt_tx_nonce.md deleted file mode 100644 index 547fd4ec..00000000 --- a/models/doc_descriptions/transactions/opt_tx_nonce.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_nonce %} - -The number of transactions sent from a given address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_origin_sig.md b/models/doc_descriptions/transactions/opt_tx_origin_sig.md deleted file mode 100644 index 55a16bcb..00000000 --- a/models/doc_descriptions/transactions/opt_tx_origin_sig.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_origin_sig %} - -The function signature of the contract call. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_position.md b/models/doc_descriptions/transactions/opt_tx_position.md deleted file mode 100644 index 11971d56..00000000 --- a/models/doc_descriptions/transactions/opt_tx_position.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_position %} - -The position of the transaction within the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_status.md b/models/doc_descriptions/transactions/opt_tx_status.md deleted file mode 100644 index 75d19dbd..00000000 --- a/models/doc_descriptions/transactions/opt_tx_status.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_status %} - -Status of the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_tx_table_doc.md b/models/doc_descriptions/transactions/opt_tx_table_doc.md deleted file mode 100644 index 4b14ba75..00000000 --- a/models/doc_descriptions/transactions/opt_tx_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_tx_table_doc %} - -This table contains transaction level data for the Optimism Blockchain. Each transaction will have a unique transaction hash, along with transactions fees and a ETH value transferred when applicable. Transactions may be native ETH transfers or interactions with contract addresses. For more information, please see [The Ethereum Organization - Transactions](https://ethereum.org/en/developers/docs/transactions/) - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/opt_value.md b/models/doc_descriptions/transactions/opt_value.md deleted file mode 100644 index 872d4a0e..00000000 --- a/models/doc_descriptions/transactions/opt_value.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_value %} - -The value transacted in ETH. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_eth_amount.md b/models/doc_descriptions/transfers/opt_eth_amount.md deleted file mode 100644 index 875c6008..00000000 --- a/models/doc_descriptions/transfers/opt_eth_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_eth_amount %} - -ETH value transferred. - -{% enddocs %} diff --git a/models/doc_descriptions/transfers/opt_eth_amount_usd.md b/models/doc_descriptions/transfers/opt_eth_amount_usd.md deleted file mode 100644 index adf29ba9..00000000 --- a/models/doc_descriptions/transfers/opt_eth_amount_usd.md +++ /dev/null @@ -1,6 +0,0 @@ - -{% docs opt_eth_amount_usd %} - -ETH value transferred, in USD. - -{% enddocs %} diff --git a/models/doc_descriptions/transfers/opt_ez_eth_transfers_table_doc.md b/models/doc_descriptions/transfers/opt_ez_eth_transfers_table_doc.md deleted file mode 100644 index 07956b43..00000000 --- a/models/doc_descriptions/transfers/opt_ez_eth_transfers_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_ez_eth_transfers_table_doc %} - -This table contains all native ETH transfers, including equivalent USD amounts. The origin addresses correspond to the to and from addresses from the `fact_transactions` table. The `identifier` and `tx_hash` columns relate this table back to `fact_traces`, which contains more details on the transfers. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_ez_transfer_table_doc.md b/models/doc_descriptions/transfers/opt_ez_transfer_table_doc.md deleted file mode 100644 index 6b5cab67..00000000 --- a/models/doc_descriptions/transfers/opt_ez_transfer_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_ez_transfers_table_doc %} - -This table will contain all events in the ```fact_token_transfers table```, along with joined columns such as token price, symbol, and decimals where possible that allow for easier analysis of token transfer events. Please note Native ETH transfers are not included here. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_log_id_transfers.md b/models/doc_descriptions/transfers/opt_log_id_transfers.md deleted file mode 100644 index b44d3801..00000000 --- a/models/doc_descriptions/transfers/opt_log_id_transfers.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_log_id_transfers %} - -This is the primary key for this table. This is a concatenation of the transaction hash and the event index at which the transfer event occurred. This field can be used to find more details on the event within the ```fact_event_logs``` table. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_origin_from.md b/models/doc_descriptions/transfers/opt_origin_from.md deleted file mode 100644 index 719677b7..00000000 --- a/models/doc_descriptions/transfers/opt_origin_from.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_eth_origin_from %} - -The from address at the transaction level. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_origin_to.md b/models/doc_descriptions/transfers/opt_origin_to.md deleted file mode 100644 index e35b0253..00000000 --- a/models/doc_descriptions/transfers/opt_origin_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_eth_origin_to %} - -The to address at the transaction level. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_transfer_amount.md b/models/doc_descriptions/transfers/opt_transfer_amount.md deleted file mode 100644 index 43dbff1b..00000000 --- a/models/doc_descriptions/transfers/opt_transfer_amount.md +++ /dev/null @@ -1,11 +0,0 @@ -{% docs opt_transfer_amount %} - -The decimal transformed amount for this token. Tokens without a decimal adjustment will be nulled out here. - -{% enddocs %} - -{% docs opt_transfer_amount_precise %} - -The decimal transformed amount for this token returned as a string to preserve precision. Tokens without a decimal adjustment will be nulled out here. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_transfer_amount_usd.md b/models/doc_descriptions/transfers/opt_transfer_amount_usd.md deleted file mode 100644 index 7da44774..00000000 --- a/models/doc_descriptions/transfers/opt_transfer_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_transfer_amount_usd %} - -The amount in US dollars for this transfer at the time of the transfer. Tokens without a decimal adjustment or price will be nulled out here. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_transfer_contract_address.md b/models/doc_descriptions/transfers/opt_transfer_contract_address.md deleted file mode 100644 index ae1ebe9c..00000000 --- a/models/doc_descriptions/transfers/opt_transfer_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_transfer_contract_address %} - -Contract address of the token being transferred. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_transfer_from_address.md b/models/doc_descriptions/transfers/opt_transfer_from_address.md deleted file mode 100644 index b23b3857..00000000 --- a/models/doc_descriptions/transfers/opt_transfer_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_transfer_from_address %} - -The sending address of this transfer. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_transfer_has_decimal.md b/models/doc_descriptions/transfers/opt_transfer_has_decimal.md deleted file mode 100644 index b04a9fa0..00000000 --- a/models/doc_descriptions/transfers/opt_transfer_has_decimal.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_transfer_has_decimal %} - -Whether or not our contracts model contains the necessary decimal adjustment for this token. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_transfer_has_price.md b/models/doc_descriptions/transfers/opt_transfer_has_price.md deleted file mode 100644 index 2f8cc168..00000000 --- a/models/doc_descriptions/transfers/opt_transfer_has_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_transfer_has_price %} - -Whether or not our prices model contains this hourly token price. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_transfer_raw_amount.md b/models/doc_descriptions/transfers/opt_transfer_raw_amount.md deleted file mode 100644 index d1087f1a..00000000 --- a/models/doc_descriptions/transfers/opt_transfer_raw_amount.md +++ /dev/null @@ -1,11 +0,0 @@ -{% docs opt_transfer_raw_amount %} - -The amount of tokens transferred. This value is not decimal adjusted. - -{% enddocs %} - -{% docs opt_transfer_raw_amount_precise %} - -The amount of tokens transferred returned as a string to preserve precision. This value is not decimal adjusted. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_transfer_to_address.md b/models/doc_descriptions/transfers/opt_transfer_to_address.md deleted file mode 100644 index 078310e2..00000000 --- a/models/doc_descriptions/transfers/opt_transfer_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_transfer_to_address %} - -The receiving address of this transfer. This can be a contract address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_transfer_token_price.md b/models/doc_descriptions/transfers/opt_transfer_token_price.md deleted file mode 100644 index cf64980b..00000000 --- a/models/doc_descriptions/transfers/opt_transfer_token_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_transfer_token_price %} - -The price, if available, for this token at the transfer time. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/opt_transfer_tx_hash.md b/models/doc_descriptions/transfers/opt_transfer_tx_hash.md deleted file mode 100644 index c9cf8c0e..00000000 --- a/models/doc_descriptions/transfers/opt_transfer_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs opt_transfer_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. This will not be unique in this table as a transaction could include multiple transfer events. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/velodrome/op_pool_address.md b/models/doc_descriptions/velodrome/op_pool_address.md deleted file mode 100644 index be2f9d37..00000000 --- a/models/doc_descriptions/velodrome/op_pool_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_pool_address %} - -The address of the Velodrome liquidity pool. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/velodrome/op_pool_name.md b/models/doc_descriptions/velodrome/op_pool_name.md deleted file mode 100644 index 3c077e38..00000000 --- a/models/doc_descriptions/velodrome/op_pool_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_pool_name %} - -The name of the Velodrome liquidity pool. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/velodrome/op_pool_type.md b/models/doc_descriptions/velodrome/op_pool_type.md deleted file mode 100644 index a56f753f..00000000 --- a/models/doc_descriptions/velodrome/op_pool_type.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_pool_type %} - -The type of liquidity pool, either stable or volatile. Stable pools are designed for assets which have little to no volatility. Volatile pools are designed for assets with high price volatility, and use a generic AMM formula. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/velodrome/op_token0_address.md b/models/doc_descriptions/velodrome/op_token0_address.md deleted file mode 100644 index 7082d3c1..00000000 --- a/models/doc_descriptions/velodrome/op_token0_address.md +++ /dev/null @@ -1,6 +0,0 @@ - -{% docs op_token0_address %} - -The address of token0 in the pool. - -{% enddocs %} diff --git a/models/doc_descriptions/velodrome/op_token0_symbol.md b/models/doc_descriptions/velodrome/op_token0_symbol.md deleted file mode 100644 index 7e752d63..00000000 --- a/models/doc_descriptions/velodrome/op_token0_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_token0_symbol %} - -The symbol of token0 in the pool. - -{% enddocs %} diff --git a/models/doc_descriptions/velodrome/op_token1_address.md b/models/doc_descriptions/velodrome/op_token1_address.md deleted file mode 100644 index 70befa3a..00000000 --- a/models/doc_descriptions/velodrome/op_token1_address.md +++ /dev/null @@ -1,6 +0,0 @@ - -{% docs op_token1_address %} - -The address of token1 in the pool. - -{% enddocs %} diff --git a/models/doc_descriptions/velodrome/op_token1_symbol.md b/models/doc_descriptions/velodrome/op_token1_symbol.md deleted file mode 100644 index 058851b0..00000000 --- a/models/doc_descriptions/velodrome/op_token1_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs op_token1_symbol %} - -The symbol of token1 in the pool. - -{% enddocs %} diff --git a/models/doc_descriptions/velodrome/velo_claimed_table_doc.md b/models/doc_descriptions/velodrome/velo_claimed_table_doc.md deleted file mode 100644 index ff92850c..00000000 --- a/models/doc_descriptions/velodrome/velo_claimed_table_doc.md +++ /dev/null @@ -1,9 +0,0 @@ -{% docs velo_claimed_table_doc %} - -This table contains details about claimed rewards on Velodrome. Rewards are paid to VELO lockers, LP token stakers, and veVELO voters. Please use the `reward_type` column to analyze the different types of claimed rewards. - -`venft_distribution` -> paid to VELO lockers -`lp_reward` -> paid to LP token stakers -`voter_rewards` -> paid to locked VELO votes - -{% enddocs %} diff --git a/models/github_actions/github_actions__current_task_status.sql b/models/github_actions/github_actions__current_task_status.sql deleted file mode 100644 index 577a2266..00000000 --- a/models/github_actions/github_actions__current_task_status.sql +++ /dev/null @@ -1,6 +0,0 @@ -{{ config( - materialized = 'view', - tags = ['gha_tasks'] -) }} - -{{ fsc_utils.gha_task_current_status_view() }} \ No newline at end of file diff --git a/models/github_actions/github_actions__current_task_status.yml b/models/github_actions/github_actions__current_task_status.yml deleted file mode 100644 index 7f9db965..00000000 --- a/models/github_actions/github_actions__current_task_status.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 2 -models: - - name: github_actions__current_task_status - columns: - - name: PIPELINE_ACTIVE - tests: - - dbt_expectations.expect_column_values_to_be_in_set: - value_set: - - TRUE - config: - severity: warn - - name: SUCCESSES - tests: - - dbt_expectations.expect_column_values_to_be_in_set: - value_set: - - 2 - config: - severity: warn \ No newline at end of file diff --git a/models/github_actions/github_actions__task_history.sql b/models/github_actions/github_actions__task_history.sql deleted file mode 100644 index 9c35ce78..00000000 --- a/models/github_actions/github_actions__task_history.sql +++ /dev/null @@ -1,5 +0,0 @@ -{{ config( - materialized = 'view' -) }} - -{{ fsc_utils.gha_task_history_view() }} \ No newline at end of file diff --git a/models/github_actions/github_actions__task_performance.sql b/models/github_actions/github_actions__task_performance.sql deleted file mode 100644 index 117ded55..00000000 --- a/models/github_actions/github_actions__task_performance.sql +++ /dev/null @@ -1,5 +0,0 @@ -{{ config( - materialized = 'view' -) }} - -{{ fsc_utils.gha_task_performance_view() }} \ No newline at end of file diff --git a/models/github_actions/github_actions__task_schedule.sql b/models/github_actions/github_actions__task_schedule.sql deleted file mode 100644 index ff95a44b..00000000 --- a/models/github_actions/github_actions__task_schedule.sql +++ /dev/null @@ -1,5 +0,0 @@ -{{ config( - materialized = 'view' -) }} - -{{ fsc_utils.gha_task_schedule_view() }} \ No newline at end of file diff --git a/models/github_actions/github_actions__tasks.sql b/models/github_actions/github_actions__tasks.sql deleted file mode 100644 index feab82a8..00000000 --- a/models/github_actions/github_actions__tasks.sql +++ /dev/null @@ -1,5 +0,0 @@ -{{ config( - materialized = 'view' -) }} - -{{ fsc_utils.gha_tasks_view() }} \ No newline at end of file diff --git a/models/gold/core/core__dim_contract_abis.sql b/models/gold/core/core__dim_contract_abis.sql deleted file mode 100644 index 00bc10d9..00000000 --- a/models/gold/core/core__dim_contract_abis.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - contract_address, - DATA AS abi, - abi_source, - bytecode, - abis_id AS dim_contract_abis_id, - inserted_timestamp, - modified_timestamp -FROM - {{ ref('silver__abis') }} diff --git a/models/gold/core/core__dim_contract_abis.yml b/models/gold/core/core__dim_contract_abis.yml deleted file mode 100644 index 02f28a04..00000000 --- a/models/gold/core/core__dim_contract_abis.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: 2 -models: - - name: core__dim_contract_abis - description: > - 'This table contains the contract ABIs that we have sourced from Optimistic-Etherscan, the community, or bytecode matched. This table is the source of ABIs used in the `core__ez_decoded_event_logs` and `core__fact_decoded_event_logs` tables. - We first try to source ABIs from Optimistic-Etherscan. If we cannot find an ABI on Optimistic-Etherscan, we will rely on user submissions. To add a contract to this table, please visit [here](https://science.flipsidecrypto.xyz/abi-requestor/). - If we are unable to locate an ABI for a contract from Optimistic-Etherscan or the community, we will try to find an ABI to use by matching the contract bytecode to a known contract bytecode we do have an ABI for.' - - columns: - - name: CONTRACT_ADDRESS - description: 'The address of the contract.' - - name: ABI - description: 'The JSON ABI for the contract.' - - name: ABI_SOURCE - description: 'The source of the ABI. This can be `Optimistic-Etherscan`, `user_submitted`, or `bytecode_matched`.' - - name: BYTECODE - description: 'The deployed bytecode of the contract.' - - diff --git a/models/gold/core/core__dim_contracts.sql b/models/gold/core/core__dim_contracts.sql deleted file mode 100644 index e32bb093..00000000 --- a/models/gold/core/core__dim_contracts.sql +++ /dev/null @@ -1,53 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - c0.created_contract_address AS address, - c1.token_symbol AS symbol, - c1.token_name AS NAME, - c1.token_decimals AS decimals, - c0.block_number AS created_block_number, - c0.block_timestamp AS created_block_timestamp, - c0.tx_hash AS created_tx_hash, - c0.creator_address AS creator_address, - COALESCE ( - c0.created_contracts_id, - {{ dbt_utils.generate_surrogate_key( - ['c0.created_contract_address'] - ) }} - ) AS dim_contracts_id, - GREATEST(COALESCE(c0.inserted_timestamp, '2000-01-01'), COALESCE(c1.inserted_timestamp, '2000-01-01')) AS inserted_timestamp, - GREATEST(COALESCE(c0.modified_timestamp, '2000-01-01'), COALESCE(c1.modified_timestamp, '2000-01-01')) AS modified_timestamp -FROM - {{ ref('silver__created_contracts') }} - c0 - LEFT JOIN {{ ref('silver__contracts') }} - c1 - ON LOWER( - c0.created_contract_address - ) = LOWER( - c1.contract_address - ) -UNION -SELECT - contract_address AS address, - token_symbol AS symbol, - token_name AS NAME, - token_decimals AS decimals, - 0 AS created_block_number, - '1970-01-01 00:00:00' :: TIMESTAMP AS created_block_timestamp, - 'GENESIS' AS created_tx_hash, - 'GENESIS' AS creator_address, - COALESCE ( - ovm1_contracts_id, - {{ dbt_utils.generate_surrogate_key( - ['contract_address'] - ) }} - ) AS dim_contracts_id, - GREATEST(COALESCE(inserted_timestamp, '2000-01-01'), COALESCE(inserted_timestamp, '2000-01-01')) AS inserted_timestamp, - GREATEST(COALESCE(modified_timestamp, '2000-01-01'), COALESCE(modified_timestamp, '2000-01-01')) AS modified_timestamp -FROM - {{ ref ('silver__ovm1_contracts') }} diff --git a/models/gold/core/core__dim_contracts.yml b/models/gold/core/core__dim_contracts.yml deleted file mode 100644 index 82dae5a5..00000000 --- a/models/gold/core/core__dim_contracts.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 2 -models: - - name: core__dim_contracts - description: This table contains all the contracts that are deployed on the Optimism blockchain along with their on-chain metadata. - - columns: - - name: ADDRESS - description: 'The address of the contract.' - - name: SYMBOL - description: 'The symbol of the contract.' - - name: NAME - description: 'The name of the contract.' - - name: DECIMALS - description: 'The number of decimals used to adjust amount for this contract.' - - name: CREATED_BLOCK_NUMBER - description: 'The block number when the contract was created' - - name: CREATED_BLOCK_TIMESTAMP - description: 'The block timestamp when the contract was created' - - name: CREATED_TX_HASH - description: 'The transaction hash when the contract was created' - - name: CREATOR_ADDRESS - description: 'The address of the creator of the contract' - - name: DIM_CONTRACTS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__dim_dates.sql b/models/gold/core/core__dim_dates.sql deleted file mode 100644 index 16b9928a..00000000 --- a/models/gold/core/core__dim_dates.sql +++ /dev/null @@ -1,10 +0,0 @@ -{{ config( - materialized = "table", - tags = ['non_realtime'], - persist_docs ={ "relation": true, - "columns": true } -) }} -{{ dbt_date.get_date_dimension( - '2017-01-01', - '2027-12-31' -) }} \ No newline at end of file diff --git a/models/gold/core/core__dim_labels.sql b/models/gold/core/core__dim_labels.sql deleted file mode 100644 index 21cefa2f..00000000 --- a/models/gold/core/core__dim_labels.sql +++ /dev/null @@ -1,19 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - blockchain, - creator, - address, - address_name, - label_type, - label_subtype, - project_name, - labels_combined_id AS dim_labels_id, - inserted_timestamp, - modified_timestamp -FROM - {{ ref('silver__labels') }} diff --git a/models/gold/core/core__dim_labels.yml b/models/gold/core/core__dim_labels.yml deleted file mode 100644 index b5cfaa65..00000000 --- a/models/gold/core/core__dim_labels.yml +++ /dev/null @@ -1,60 +0,0 @@ -version: 2 -models: - - name: core__dim_labels - description: '{{ doc("table_dim_labels") }}' - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - BLOCKCHAIN - - CREATOR - - ADDRESS - columns: - - name: BLOCKCHAIN - description: '{{ doc("op_label_blockchain") }}' - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_set: - value_set: ['optimism'] - - name: CREATOR - description: '{{ doc("op_label_creator") }}' - tests: - - not_null - - name: ADDRESS - description: '{{ doc("op_label_address") }}' - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: ADDRESS_NAME - description: '{{ doc("op_labels_table") }}' - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - name: LABEL_TYPE - description: '{{ doc("op_label_type") }}' - tests: - - not_null - - name: LABEL_SUBTYPE - description: '{{ doc("op_label_subtype") }}' - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - name: PROJECT_NAME - description: '{{ doc("op_project_name") }}' - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - name: DIM_LABELS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' diff --git a/models/gold/core/core__ez_decoded_event_logs.sql b/models/gold/core/core__ez_decoded_event_logs.sql deleted file mode 100644 index d5b365aa..00000000 --- a/models/gold/core/core__ez_decoded_event_logs.sql +++ /dev/null @@ -1,70 +0,0 @@ -{{ config ( - materialized = "incremental", - unique_key = "ez_decoded_event_logs_id", - incremental_strategy = 'delete+insert', - cluster_by = "block_timestamp::date", - incremental_predicates = [standard_predicate()], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(ez_decoded_event_logs_id, contract_name, contract_address)", - tags = ['decoded_logs'] -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - {# tx_position, #} -- new column - event_index, - contract_address, - topics, - topics [0] :: STRING AS topic_0, - --new column - topics [1] :: STRING AS topic_1, - --new column - topics [2] :: STRING AS topic_2, - --new column - topics [3] :: STRING AS topic_3, - --new column - DATA, - event_removed, - origin_from_address, - origin_to_address, - origin_function_signature, - CASE - WHEN tx_status = 'SUCCESS' THEN TRUE - ELSE FALSE - END AS tx_succeeded, - event_name, - decoded_data AS full_decoded_log, - decoded_flat AS decoded_log, - token_name AS contract_name, - COALESCE ( - decoded_logs_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS ez_decoded_event_logs_id, -{% if is_incremental() %} - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, -{% else %} - GREATEST(block_timestamp, dateadd('day', -10, SYSDATE())) AS inserted_timestamp, - GREATEST(block_timestamp, dateadd('day', -10, SYSDATE())) AS modified_timestamp, -{% endif %} - tx_status --deprecate -FROM - {{ ref('silver__decoded_logs') }} - l - LEFT JOIN {{ ref('silver__contracts') }} C USING (contract_address) -WHERE 1=1 - - {% if is_incremental() %} - AND l.modified_timestamp > ( - SELECT - COALESCE( - MAX(modified_timestamp), - '2000-01-01'::TIMESTAMP - ) - FROM - {{ this }} - ) - {% endif %} \ No newline at end of file diff --git a/models/gold/core/core__ez_decoded_event_logs.yml b/models/gold/core/core__ez_decoded_event_logs.yml deleted file mode 100644 index 8e798426..00000000 --- a/models/gold/core/core__ez_decoded_event_logs.yml +++ /dev/null @@ -1,75 +0,0 @@ -version: 2 -models: - - name: core__ez_decoded_event_logs - description: > - 'For information on how to submit a contract for decoding, as well as how ABIs are sourced, please visit [here](https://science.flipsidecrypto.xyz/abi-requestor/). - This model contains decoded event logs for contracts that we have an ABI for. Please note, this table does not include all event logs, only those that we have an ABI for. - The `decoded_log` column is the easiest place to query decoded data. It is a JSON object, where the keys are the names of the event parameters, and the values are the values of the event parameters. - You can select from this column using the following sample format, `decoded_log:from::string` or more generally, `decoded_log:::datatype`. See below for a full sample query. - The `full_decoded_logs` column contains the same information, as well as additional fields such as the datatype of the decoded data. You may need to laterally flatten this column to query the data. - - Sample query for USDC Transfer events: - - ```sql - select - tx_hash, - block_number, - contract_address, - decoded_log:from::string as from_address, - decoded_log:to::string as to_address, - decoded_log:value::integer as value - from ethereum.core.fact_decoded_event_logs - where contract_address = lower('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48') - and block_number between 16400000 and 16405000 - and event_name = 'Transfer' - limit 50```' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("opt_logs_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("opt_event_index") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("opt_logs_contract_address") }}' - - name: CONTRACT_NAME - description: 'The name of the contract, if the contract has a name() function.' - - name: EVENT_NAME - description: 'The name of the event, as defined in the contract ABI.' - - name: DECODED_LOG - description: 'The flattened decoded log, where the keys are the names of the event parameters, and the values are the values of the event parameters.' - - name: FULL_DECODED_LOG - description: 'The full decoded log, including the event name, the event parameters, and the data type of the event parameters.' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("opt_tx_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("opt_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("opt_origin_to") }}' - - name: TOPICS - description: '{{ doc("opt_topics") }}' - - name: TOPIC_0 - description: '{{ doc("evm_topic_0") }}' - - name: TOPIC_1 - description: '{{ doc("evm_topic_1") }}' - - name: TOPIC_2 - description: '{{ doc("evm_topic_2") }}' - - name: TOPIC_3 - description: '{{ doc("evm_topic_3") }}' - - name: DATA - description: '{{ doc("opt_logs_data") }}' - - name: EVENT_REMOVED - description: '{{ doc("opt_event_removed") }}' - - name: TX_STATUS - description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' - - name: TX_SUCCEEDED - description: '{{ doc("opt_tx_status") }}' - - name: EZ_DECODED_EVENT_LOGS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__ez_native_transfers.sql b/models/gold/core/core__ez_native_transfers.sql deleted file mode 100644 index a678413c..00000000 --- a/models/gold/core/core__ez_native_transfers.sql +++ /dev/null @@ -1,27 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - tx_hash, - block_number, - block_timestamp, - tx_position, - trace_index, - origin_from_address, - origin_to_address, - origin_function_signature, - from_address, - to_address, - amount, - amount_precise_raw, - amount_precise, - amount_usd, - native_transfers_id AS ez_native_transfers_id, - inserted_timestamp, - modified_timestamp, - identifier --deprecate -FROM - {{ ref('silver__native_transfers') }} \ No newline at end of file diff --git a/models/gold/core/core__ez_native_transfers.yml b/models/gold/core/core__ez_native_transfers.yml deleted file mode 100644 index 1a432c71..00000000 --- a/models/gold/core/core__ez_native_transfers.yml +++ /dev/null @@ -1,42 +0,0 @@ -version: 2 -models: - - name: core__ez_native_transfers - description: '{{ doc("evm_ez_native_transfers_table_doc") }}' - - columns: - - name: TX_HASH - description: '{{ doc("opt_transfer_tx_hash") }}' - - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' - - name: TX_POSITION - description: '{{ doc("opt_tx_position") }}' - - name: TRACE_INDEX - description: '{{ doc("opt_trace_index") }}' - - name: IDENTIFIER - description: '{{ doc("evm_column_deprecation_notice_identifier") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("opt_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("opt_origin_to") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("opt_origin_sig") }}' - - name: FROM_ADDRESS - description: '{{ doc("opt_transfer_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("opt_transfer_to_address") }}' - - name: AMOUNT - description: '{{ doc("opt_eth_amount") }}' - - name: AMOUNT_PRECISE_RAW - description: '{{ doc("precise_amount_unadjusted") }}' - - name: AMOUNT_PRECISE - description: '{{ doc("precise_amount_adjusted") }}' - - name: AMOUNT_USD - description: '{{ doc("opt_eth_amount_usd") }}' - - name: EZ_NATIVE_TRANSFERS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__ez_token_transfers.sql b/models/gold/core/core__ez_token_transfers.sql deleted file mode 100644 index 14fb45b0..00000000 --- a/models/gold/core/core__ez_token_transfers.sql +++ /dev/null @@ -1,45 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address, - from_address, - to_address, - raw_amount_precise, - raw_amount, - amount_precise, - amount, - amount_usd, - decimals, - symbol, - COALESCE ( - transfers_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS ez_token_transfers_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp, - token_price, --deprecate - has_decimal, --deprecate - has_price, --deprecate - _log_id, --deprecate - _inserted_timestamp --deprecate -FROM - {{ ref('silver__transfers') }} diff --git a/models/gold/core/core__ez_token_transfers.yml b/models/gold/core/core__ez_token_transfers.yml deleted file mode 100644 index a8109257..00000000 --- a/models/gold/core/core__ez_token_transfers.yml +++ /dev/null @@ -1,59 +0,0 @@ -version: 2 -models: - - name: core__ez_token_transfers - description: '{{ doc("evm_ez_token_transfers_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("opt_transfer_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("opt_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("opt_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("opt_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("opt_origin_to") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("opt_transfer_contract_address") }}' - - name: FROM_ADDRESS - description: '{{ doc("opt_transfer_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("opt_transfer_to_address") }}' - - name: RAW_AMOUNT_PRECISE - description: '{{ doc("opt_transfer_raw_amount_precise") }}' - - name: RAW_AMOUNT - description: '{{ doc("opt_transfer_raw_amount") }}' - - name: AMOUNT_PRECISE - description: '{{ doc("opt_transfer_amount_precise") }}' - - name: TOKEN_PRICE - description: '{{ doc("opt_transfer_token_price") }}' - - name: AMOUNT - description: '{{ doc("opt_transfer_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("opt_transfer_amount_usd") }}' - - name: DECIMALS - description: '{{ doc("opt_decimals") }}' - - name: SYMBOL - description: '{{ doc("opt_symbol") }}' - - name: TOKEN_PRICE - description: '{{ doc("evm_column_deprecation_notice_token_price") }}' - - name: HAS_PRICE - description: '{{ doc("evm_column_deprecation_notice_has_price") }}' - - name: HAS_DECIMAL - description: '{{ doc("evm_column_deprecation_notice_has_decimal") }}' - - name: _LOG_ID - description: '{{ doc("evm_column_deprecation_notice_log_id") }}' - - name: _INSERTED_TIMESTAMP - description: '{{ doc("evm_column_deprecation_notice_inserted_timestamp") }}' - - name: EZ_TOKEN_TRANSFERS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' - \ No newline at end of file diff --git a/models/gold/core/core__fact_blocks.sql b/models/gold/core/core__fact_blocks.sql deleted file mode 100644 index 8c3872ed..00000000 --- a/models/gold/core/core__fact_blocks.sql +++ /dev/null @@ -1,143 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - A.block_number AS block_number, - HASH AS block_hash, --new column - block_timestamp, - 'mainnet' AS network, - tx_count, - SIZE, - miner, --new column - extra_data, - parent_hash, - gas_used, - gas_limit, - difficulty, - total_difficulty, - sha3_uncles, - uncles AS uncle_blocks, - nonce, --new column - receipts_root, - state_root, --new column - transactions_root, --new column - logs_bloom, --new column - base_fee_per_gas, --new column - withdrawals_root, - COALESCE ( - blocks_id, - {{ dbt_utils.generate_surrogate_key( - ['a.block_number'] - ) }} - ) AS fact_blocks_id, - GREATEST( - COALESCE( - A.inserted_timestamp, - '2000-01-01' - ), - COALESCE( - b.inserted_timestamp, - '2000-01-01' - ), --remove - COALESCE( - C.inserted_timestamp, - '2000-01-01' - ), --remove - COALESCE( - d.inserted_timestamp, - '2000-01-01' - ) - ) AS inserted_timestamp, - GREATEST( - COALESCE( - A.modified_timestamp, - '2000-01-01' - ), - COALESCE( - b.modified_timestamp, - '2000-01-01' - ), --remove - COALESCE( - C.modified_timestamp, - '2000-01-01' - ), --remove - COALESCE( - d.modified_timestamp, - '2000-01-01' - ) - ) AS modified_timestamp, - 'optimism' AS blockchain, --deprecate - HASH, --deprecate - OBJECT_CONSTRUCT( - 'baseFeePerGas', - base_fee_per_gas, - 'difficulty', - difficulty, - 'extraData', - extra_data, - 'gasLimit', - gas_limit, - 'gasUsed', - gas_used, - 'hash', - HASH, - 'logsBloom', - logs_bloom, - 'miner', - miner, - 'nonce', - nonce, - 'number', - NUMBER, - 'parentHash', - parent_hash, - 'receiptsRoot', - receipts_root, - 'sha3Uncles', - sha3_uncles, - 'size', - SIZE, - 'stateRoot', - state_root, - 'timestamp', - block_timestamp, - 'totalDifficulty', - total_difficulty, - 'transactionsRoot', - transactions_root, - 'uncles', - uncles - ) AS block_header_json, --deprecate - state_tx_hash AS l1_state_root_tx_hash, --deprecate, may build separate table - state_batch_index AS l1_state_root_batch_index, --deprecate, may build separate table - l1_submission_tx_hash, --deprecate, may build separate table - l1_submission_batch_index, --deprecate, may build separate table - OBJECT_CONSTRUCT( - 'l1_bedrock_state_batch_index', - bedrock_state_batch_index, - 'l1_bedrock_state_batch_root', - bedrock_state_batch_root, - 'l1_state_root_batch_index', - state_batch_index, - 'l1_state_root_tx_hash', - state_tx_hash, - 'l1_submission_batch_index', - l1_submission_batch_index, - 'l1_submission_batch_root', - l1_submission_batch_root, - 'l1_submission_tx_hash', - l1_submission_tx_hash - ) AS l1_submission_details --deprecate, may build separate table -FROM - {{ ref('silver__blocks') }} A - LEFT JOIN {{ ref('silver__state_hashes') }} - b --remove - ON A.block_number = b.block_number - LEFT JOIN {{ ref('silver__submission_hashes') }} C --remove - ON A.block_number = C.block_number - LEFT JOIN {{ ref('silver__tx_count') }} - d - ON A.block_number = d.block_number diff --git a/models/gold/core/core__fact_blocks.yml b/models/gold/core/core__fact_blocks.yml deleted file mode 100644 index 7673ef30..00000000 --- a/models/gold/core/core__fact_blocks.yml +++ /dev/null @@ -1,72 +0,0 @@ -version: 2 -models: - - name: core__fact_blocks - description: '{{ doc("evm_blocks_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: NETWORK - description: '{{ doc("evm_network") }}' - - name: BLOCKCHAIN - description: '{{ doc("evm_column_deprecation_notice_blockchain") }}' - - name: TX_COUNT - description: '{{ doc("evm_tx_count") }}' - - name: DIFFICULTY - description: '{{ doc("evm_difficulty") }}' - - name: TOTAL_DIFFICULTY - description: '{{ doc("evm_total_difficulty") }}' - - name: EXTRA_DATA - description: '{{ doc("evm_extra_data") }}' - - name: GAS_LIMIT - description: '{{ doc("evm_gas_limit") }}' - - name: GAS_USED - description: '{{ doc("evm_gas_used") }}' - - name: BLOCK_HASH - description: '{{ doc("evm_blocks_hash") }}' - - name: HASH - description: '{{ doc("evm_column_deprecation_notice_hash") }}' - - name: PARENT_HASH - description: '{{ doc("evm_parent_hash") }}' - - name: RECEIPTS_ROOT - description: '{{ doc("evm_receipts_root") }}' - - name: SHA3_UNCLES - description: '{{ doc("evm_sha3_uncles") }}' - - name: SIZE - description: '{{ doc("evm_size") }}' - - name: MINER - description: '{{ doc("evm_miner") }}' - - name: NONCE - description: '{{ doc("evm_tx_nonce") }}' - - name: STATE_ROOT - description: '{{ doc("evm_state_root") }}' - - name: TRANSACTIONS_ROOT - description: '{{ doc("evm_transactions_root") }}' - - name: LOGS_BLOOM - description: '{{ doc("evm_logs_bloom") }}' - - name: UNCLE_BLOCKS - description: '{{ doc("evm_uncle_blocks") }}' - - name: BLOCK_HEADER_JSON - description: '{{ doc("evm_column_deprecation_notice_block_header_json") }}' - - name: L1_STATE_ROOT_TX_HASH - description: '{{ doc("evm_column_deprecation_notice_l1_state_root_tx_hash") }}' - - name: L1_STATE_ROOT_BATCH_INDEX - description: '{{ doc("evm_column_deprecation_notice_l1_state_root_batch_index") }}' - - name: L1_SUBMISSION_TX_HASH - description: '{{ doc("evm_column_deprecation_notice_l1_submission_tx_hash") }}' - - name: L1_SUBMISSION_BATCH_INDEX - description: '{{ doc("evm_column_deprecation_notice_l1_submission_batch_index") }}' - - name: L1_SUBMISSION_DETAILS - description: '{{ doc("evm_column_deprecation_notice_l1_submission_details") }}' - - name: FACT_BLOCKS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' - - name: WITHDRAWALS_ROOT - description: '{{ doc("evm_withdrawals_root") }}' - - name: BASE_FEE_PER_GAS - description: '{{ doc("evm_base_fee_per_gas") }}' diff --git a/models/gold/core/core__fact_decoded_event_logs.sql b/models/gold/core/core__fact_decoded_event_logs.sql deleted file mode 100644 index aab1f0cf..00000000 --- a/models/gold/core/core__fact_decoded_event_logs.sql +++ /dev/null @@ -1,31 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - contract_address, - event_name, - decoded_flat AS decoded_log, - decoded_data AS full_decoded_log, - COALESCE ( - decoded_logs_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS fact_decoded_event_logs_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__decoded_logs') }} diff --git a/models/gold/core/core__fact_decoded_event_logs.yml b/models/gold/core/core__fact_decoded_event_logs.yml deleted file mode 100644 index 1f94a474..00000000 --- a/models/gold/core/core__fact_decoded_event_logs.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 2 -models: - - name: core__fact_decoded_event_logs - description: '{{ doc("evm_table_deprecation_notice_fact_decoded_event_logs")}}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("opt_logs_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("opt_event_index") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("opt_logs_contract_address") }}' - - name: EVENT_NAME - description: 'The name of the event, as defined in the contract ABI.' - - name: DECODED_LOG - description: 'The flattened decoded log, where the keys are the names of the event parameters, and the values are the values of the event parameters.' - - name: FULL_DECODED_LOG - description: 'The full decoded log, including the event name, the event parameters, and the data type of the event parameters.' - - name: FACT_DECODED_EVENT_LOGS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_event_logs.sql b/models/gold/core/core__fact_event_logs.sql deleted file mode 100644 index 8c2c6457..00000000 --- a/models/gold/core/core__fact_event_logs.sql +++ /dev/null @@ -1,44 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - contract_address, - topics, - topics[0]::STRING AS topic_0, --new column - topics[1]::STRING AS topic_1, --new column - topics[2]::STRING AS topic_2, --new column - topics[3]::STRING AS topic_3, --new column - DATA, - event_removed, - origin_from_address, - origin_to_address, - origin_function_signature, - CASE - WHEN tx_status = 'SUCCESS' THEN TRUE - ELSE FALSE - END AS tx_succeeded, --new column - COALESCE ( - logs_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS fact_event_logs_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp, - tx_status, --deprecate - _log_id --deprecate -FROM - {{ ref('silver__logs') }} diff --git a/models/gold/core/core__fact_event_logs.yml b/models/gold/core/core__fact_event_logs.yml deleted file mode 100644 index cab8f3aa..00000000 --- a/models/gold/core/core__fact_event_logs.yml +++ /dev/null @@ -1,48 +0,0 @@ -version: 2 -models: - - name: core__fact_event_logs - description: '{{ doc("evm_logs_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("evm_logs_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("evm_event_index") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("evm_logs_contract_address") }}' - - name: TOPICS - description: '{{ doc("evm_topics") }}' - - name: TOPIC_0 - description: '{{ doc("evm_topic_0") }}' - - name: TOPIC_1 - description: '{{ doc("evm_topic_1") }}' - - name: TOPIC_2 - description: '{{ doc("evm_topic_2") }}' - - name: TOPIC_3 - description: '{{ doc("evm_topic_3") }}' - - name: DATA - description: '{{ doc("evm_logs_data") }}' - - name: EVENT_REMOVED - description: '{{ doc("evm_event_removed") }}' - - name: _LOG_ID - description: '{{ doc("evm_column_deprecation_notice_log_id") }}' - - name: TX_STATUS - description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' - - name: TX_SUCCEEDED - description: '{{ doc("evm_tx_succeeded") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("evm_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("evm_origin_to") }}' - - name: FACT_EVENT_LOGS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_l1_state_root_submissions.sql b/models/gold/core/core__fact_l1_state_root_submissions.sql deleted file mode 100644 index 83aa275c..00000000 --- a/models/gold/core/core__fact_l1_state_root_submissions.sql +++ /dev/null @@ -1,38 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - state_tx_hash AS l1_state_root_tx_hash, - state_block_number AS l1_block_number, - state_block_timestamp AS l1_block_timestamp, - COALESCE( - state_batch_index, - bedrock_state_batch_index - ) AS l1_state_root_batch_index, - COALESCE( - state_batch_root, - bedrock_state_batch_root - ) AS batch_root, - state_batch_size AS batch_size, - state_prev_total_elements AS prev_total_elements, - state_min_block AS op_min_block, - state_max_block AS op_max_block, - COALESCE( - state_hashes_id, - {{ dbt_utils.generate_surrogate_key( - ['state_block_number'] - ) }} - ) AS fact_l1_state_root_submissions_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('bronze__state_hashes') }} diff --git a/models/gold/core/core__fact_l1_state_root_submissions.yml b/models/gold/core/core__fact_l1_state_root_submissions.yml deleted file mode 100644 index 218338bb..00000000 --- a/models/gold/core/core__fact_l1_state_root_submissions.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 2 -models: - - name: core__fact_l1_state_root_submissions - description: 'Contains details on the state root batch submission to L1.' - - columns: - - name: L1_STATE_ROOT_TX_HASH - description: '{{ doc("op_l1_state_tx_hash") }}' - - name: L1_BLOCK_NUMBER - description: '{{ doc("op_l1_block_no") }}' - - name: L1_BLOCK_TIMESTAMP - description: '{{ doc("op_l1_block_time") }}' - - name: L1_STATE_ROOT_BATCH_INDEX - description: The batch index of when this block was included in the Ethereum state root. This index was reset with the June 2023 OP Bedrock upgrade. - - name: BATCH_ROOT - description: '{{ doc("op_batch_root") }}' - - name: BATCH_SIZE - description: '{{ doc("op_batch_size") }}' - - name: PREV_TOTAL_ELEMENTS - description: '{{ doc("op_prev_total_elements") }}' - - name: OP_MIN_BLOCK - description: '{{ doc("op_min_block") }}' - - name: OP_MAX_BLOCK - description: '{{ doc("op_max_block") }}' - - name: FACT_L1_STATE_ROOT_SUBMISSIONS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' diff --git a/models/gold/core/core__fact_l1_submissions.sql b/models/gold/core/core__fact_l1_submissions.sql deleted file mode 100644 index 187d6e7b..00000000 --- a/models/gold/core/core__fact_l1_submissions.sql +++ /dev/null @@ -1,32 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - l1_submission_tx_hash, - l1_submission_block_number AS l1_block_number, - l1_submission_block_timestamp AS l1_block_timestamp, - l1_submission_batch_index AS l1_submission_batch_index, - l1_submission_batch_root AS batch_root, - l1_submission_size AS batch_size, - l1_submission_prev_total_elements AS prev_total_elements, - sub_min_block AS op_min_block, - sub_max_block AS op_max_block, - COALESCE( - submission_hashes_id, - {{ dbt_utils.generate_surrogate_key( - ['l1_submission_block_number'] - ) }} - ) AS fact_l1_state_root_submissions_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('bronze__submission_hashes') }} diff --git a/models/gold/core/core__fact_l1_submissions.yml b/models/gold/core/core__fact_l1_submissions.yml deleted file mode 100644 index 13983781..00000000 --- a/models/gold/core/core__fact_l1_submissions.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 2 -models: - - name: core__fact_l1_submissions - description: 'Contains details on the batch submission to L1.' - - columns: - - name: L1_SUBMISSION_ROOT_TX_HASH - description: '{{ doc("op_l1_sub_tx_hash") }}' - - name: L1_BLOCK_NUMBER - description: '{{ doc("op_l1_block_no") }}' - - name: L1_BLOCK_TIMESTAMP - description: '{{ doc("op_l1_block_time") }}' - - name: L1_SUBMISSION_BATCH_INDEX - description: '{{ doc("op_l1_sub_batch") }}' - - name: BATCH_ROOT - description: '{{ doc("op_batch_root") }}' - - name: BATCH_SIZE - description: '{{ doc("op_batch_size") }}' - - name: PREV_TOTAL_ELEMENTS - description: '{{ doc("op_prev_total_elements") }}' - - name: OP_MIN_BLOCK - description: '{{ doc("op_min_block") }}' - - name: OP_MAX_BLOCK - description: '{{ doc("op_max_block") }}' - - name: FACT_L1_SUBMISSIONS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_token_transfers.sql b/models/gold/core/core__fact_token_transfers.sql deleted file mode 100644 index 8908c546..00000000 --- a/models/gold/core/core__fact_token_transfers.sql +++ /dev/null @@ -1,36 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address, - from_address, - to_address, - raw_amount, - raw_amount_precise, - _log_id, - COALESCE ( - transfers_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS fact_token_transfers_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp -FROM - {{ ref('silver__transfers') }} diff --git a/models/gold/core/core__fact_token_transfers.yml b/models/gold/core/core__fact_token_transfers.yml deleted file mode 100644 index f64a36de..00000000 --- a/models/gold/core/core__fact_token_transfers.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 2 -models: - - name: core__fact_token_transfers - description: '{{ doc("evm_table_deprecation_notice_fact_token_transfers")}}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("opt_transfer_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("opt_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("opt_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("opt_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("opt_origin_to") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("opt_transfer_contract_address") }}' - - name: FROM_ADDRESS - description: '{{ doc("opt_transfer_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("opt_transfer_to_address") }}' - - name: RAW_AMOUNT - description: '{{ doc("opt_transfer_raw_amount") }}' - - name: RAW_AMOUNT_PRECISE - description: '{{ doc("opt_transfer_raw_amount_precise") }}' - - name: _LOG_ID - description: '{{ doc("internal_column") }}' - - name: FACT_TOKEN_TRANSFERS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_traces.sql b/models/gold/core/core__fact_traces.sql deleted file mode 100644 index 797211a9..00000000 --- a/models/gold/core/core__fact_traces.sql +++ /dev/null @@ -1,526 +0,0 @@ -{{ config ( - materialized = "incremental", - incremental_strategy = 'delete+insert', - unique_key = "block_number", - incremental_predicates = [fsc_evm.standard_predicate()], - cluster_by = "block_timestamp::date", - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['core','non_realtime'], - full_refresh = false -) }} - -WITH silver_traces AS ( - - SELECT - block_number, - tx_position, - trace_address, - parent_trace_address, - trace_address_array, - trace_json, - traces_id, - 'regular' AS source - FROM - {{ ref('silver__traces') }} - WHERE - 1 = 1 - -{% if is_incremental() and not full_reload_mode %} -AND modified_timestamp > ( - SELECT - MAX(modified_timestamp) - FROM - {{ this }} -) {% elif is_incremental() and full_reload_mode %} -AND block_number BETWEEN ( - SELECT - MAX( - block_number - ) - FROM - {{ this }} -) -AND ( - SELECT - MAX( - block_number - ) + 10000000 - FROM - {{ this }} -) -{% else %} - AND block_number <= 30000000 -{% endif %} -UNION ALL -SELECT - block_number, - tx_position, - trace_address, - parent_trace_address, - trace_address_array, - trace_json, - traces_id, - 'overflow' AS source -FROM - {{ ref('silver__overflowed_traces') }} -WHERE - 1 = 1 - -{% if is_incremental() and not full_reload_mode %} -AND modified_timestamp > ( - SELECT - DATEADD('hour', -2, MAX(modified_timestamp)) - FROM - {{ this }}) {% elif is_incremental() and full_reload_mode %} - AND block_number BETWEEN ( - SELECT - MAX( - block_number - ) - FROM - {{ this }} - ) - AND ( - SELECT - MAX( - block_number - ) + 10000000 - FROM - {{ this }} - ) - {% else %} - AND block_number <= 30000000 - {% endif %} -), -sub_traces AS ( - SELECT - block_number, - tx_position, - parent_trace_address, - COUNT(*) AS sub_traces - FROM - silver_traces - GROUP BY - block_number, - tx_position, - parent_trace_address -), -trace_index_array AS ( - SELECT - block_number, - tx_position, - trace_address, - ARRAY_AGG(flat_value) AS number_array - FROM - ( - SELECT - block_number, - tx_position, - trace_address, - IFF( - VALUE :: STRING = 'ORIGIN', - -1, - VALUE :: INT - ) AS flat_value - FROM - silver_traces, - LATERAL FLATTEN ( - input => trace_address_array - ) - ) - GROUP BY - block_number, - tx_position, - trace_address -), -trace_index_sub_traces AS ( - SELECT - b.block_number, - b.tx_position, - b.trace_address, - IFNULL( - sub_traces, - 0 - ) AS sub_traces, - number_array, - ROW_NUMBER() over ( - PARTITION BY b.block_number, - b.tx_position - ORDER BY - number_array ASC - ) - 1 AS trace_index, - b.trace_json, - b.traces_id, - b.source - FROM - silver_traces b - LEFT JOIN sub_traces s - ON b.block_number = s.block_number - AND b.tx_position = s.tx_position - AND b.trace_address = s.parent_trace_address - JOIN trace_index_array n - ON b.block_number = n.block_number - AND b.tx_position = n.tx_position - AND b.trace_address = n.trace_address -), -errored_traces AS ( - SELECT - block_number, - tx_position, - trace_address, - trace_json - FROM - trace_index_sub_traces - WHERE - trace_json :error :: STRING IS NOT NULL -), -error_logic AS ( - SELECT - b0.block_number, - b0.tx_position, - b0.trace_address, - b0.trace_json :error :: STRING AS error, - b1.trace_json :error :: STRING AS any_error, - b2.trace_json :error :: STRING AS origin_error - FROM - trace_index_sub_traces b0 - LEFT JOIN errored_traces b1 - ON b0.block_number = b1.block_number - AND b0.tx_position = b1.tx_position - AND b0.trace_address RLIKE CONCAT( - '^', - b1.trace_address, - '(_[0-9]+)*$' - ) - LEFT JOIN errored_traces b2 - ON b0.block_number = b2.block_number - AND b0.tx_position = b2.tx_position - AND b2.trace_address = 'ORIGIN' -), -aggregated_errors AS ( - SELECT - block_number, - tx_position, - trace_address, - error, - IFF(MAX(any_error) IS NULL - AND error IS NULL - AND origin_error IS NULL, TRUE, FALSE) AS trace_succeeded - FROM - error_logic - GROUP BY - block_number, - tx_position, - trace_address, - error, - origin_error), - json_traces AS ( - SELECT - block_number, - tx_position, - trace_address, - sub_traces, - number_array, - trace_index, - trace_json AS DATA, - trace_succeeded, - trace_json :error :: STRING AS error_reason, - trace_json :revertReason :: STRING AS revert_reason, - trace_json :from :: STRING AS from_address, - trace_json :to :: STRING AS to_address, - IFNULL( - trace_json :value :: STRING, - '0x0' - ) AS value_hex, - IFNULL( - utils.udf_hex_to_int( - trace_json :value :: STRING - ), - '0' - ) AS value_precise_raw, - utils.udf_decimal_adjust( - value_precise_raw, - 18 - ) AS value_precise, - value_precise :: FLOAT AS VALUE, - utils.udf_hex_to_int( - trace_json :gas :: STRING - ) :: INT AS gas, - utils.udf_hex_to_int( - trace_json :gasUsed :: STRING - ) :: INT AS gas_used, - trace_json :input :: STRING AS input, - trace_json :output :: STRING AS output, - trace_json :type :: STRING AS TYPE, - concat_ws( - '_', - TYPE, - trace_address - ) AS identifier, - IFF( - trace_succeeded, - 'SUCCESS', - 'FAIL' - ) AS trace_status, - traces_id - FROM - trace_index_sub_traces - JOIN aggregated_errors USING ( - block_number, - tx_position, - trace_address - ) - ), - incremental_traces AS ( - SELECT - f.block_number, - t.tx_hash, - t.block_timestamp, - t.origin_function_signature, - t.from_address AS origin_from_address, - t.to_address AS origin_to_address, - t.tx_status, - f.tx_position, - f.trace_index, - f.from_address AS from_address, - f.to_address AS to_address, - f.value_hex, - f.value_precise_raw, - f.value_precise, - f.value, - f.gas, - f.gas_used, - f.input, - f.output, - f.type, - f.identifier, - f.sub_traces, - f.error_reason, - f.revert_reason, - f.trace_status, - f.data, - f.traces_id, - f.trace_succeeded, - f.trace_address, - IFF( - t.tx_status = 'SUCCESS', - TRUE, - FALSE - ) AS tx_succeeded - FROM - json_traces f - LEFT OUTER JOIN {{ ref('silver__transactions') }} - t - ON f.tx_position = t.position - AND f.block_number = t.block_number - -{% if is_incremental() and not full_reload_mode %} -AND t.modified_timestamp >= ( - SELECT - DATEADD('hour', -24, MAX(modified_timestamp)) - FROM - {{ this }}) - {% endif %} -) - -{% if is_incremental() %}, -overflow_blocks AS ( - SELECT - DISTINCT block_number - FROM - silver_traces - WHERE - source = 'overflow' -), -heal_missing_data AS ( - SELECT - t.block_number, - txs.tx_hash, - txs.block_timestamp, - txs.origin_function_signature, - txs.from_address AS origin_from_address, - txs.to_address AS origin_to_address, - txs.tx_status, - t.tx_position, - t.trace_index, - t.from_address, - t.to_address, - t.value_hex, - t.value_precise_raw, - t.value_precise, - t.value, - t.gas, - t.gas_used, - t.input, - t.output, - t.type, - t.identifier, - t.sub_traces, - t.error_reason, - t.revert_reason, - t.trace_status, - t.data, - t.fact_traces_id AS traces_id, - t.trace_succeeded, - t.trace_address, - IFF( - txs.tx_status = 'SUCCESS', - TRUE, - FALSE - ) AS tx_succeeded - FROM - {{ this }} - t - JOIN {{ ref('silver__transactions') }} - txs - ON t.tx_position = txs.position - AND t.block_number = txs.block_number - WHERE - t.tx_hash IS NULL - OR t.block_timestamp IS NULL - OR t.tx_status IS NULL -) -{% endif %}, -all_traces AS ( - SELECT - block_number, - tx_hash, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - tx_status, - tx_position, - trace_index, - from_address, - to_address, - value_hex, - value_precise_raw, - value_precise, - VALUE, - gas, - gas_used, - input, - output, - TYPE, - identifier, - sub_traces, - error_reason, - revert_reason, - trace_status, - DATA, - trace_succeeded, - trace_address, - tx_succeeded - FROM - incremental_traces - -{% if is_incremental() %} -UNION ALL -SELECT - block_number, - tx_hash, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - tx_status, - tx_position, - trace_index, - from_address, - to_address, - value_hex, - value_precise_raw, - value_precise, - VALUE, - gas, - gas_used, - input, - output, - TYPE, - identifier, - sub_traces, - error_reason, - revert_reason, - trace_status, - DATA, - trace_succeeded, - trace_address, - tx_succeeded -FROM - heal_missing_data -UNION ALL -SELECT - block_number, - tx_hash, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - tx_status, - tx_position, - trace_index, - from_address, - to_address, - value_hex, - value_precise_raw, - value_precise, - VALUE, - gas, - gas_used, - input, - output, - TYPE, - identifier, - sub_traces, - error_reason, - revert_reason, - trace_status, - DATA, - trace_succeeded, - trace_address, - tx_succeeded -FROM - {{ this }} - JOIN overflow_blocks USING (block_number) -{% endif %} -) -SELECT - block_number, - block_timestamp, - tx_hash, - tx_position, - trace_index, - from_address, - to_address, - input, - output, - TYPE, - trace_address, - sub_traces, - VALUE, - value_precise_raw, - value_precise, - value_hex, - gas, - gas_used, - origin_from_address, - origin_to_address, - origin_function_signature, - trace_succeeded, - error_reason, - revert_reason, - tx_succeeded, - identifier, --deprecate - DATA, --deprecate - tx_status, --deprecate - trace_status, --deprecate - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'trace_index'] - ) }} AS fact_traces_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp -FROM - all_traces qualify(ROW_NUMBER() over(PARTITION BY block_number, tx_position, trace_index -ORDER BY - modified_timestamp DESC, block_timestamp DESC nulls last)) = 1 diff --git a/models/gold/core/core__fact_traces.yml b/models/gold/core/core__fact_traces.yml deleted file mode 100644 index 0aaacb5b..00000000 --- a/models/gold/core/core__fact_traces.yml +++ /dev/null @@ -1,64 +0,0 @@ -version: 2 -models: - - name: core__fact_traces - description: '{{ doc("evm_traces_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_traces_block_no") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_traces_blocktime") }}' - - name: TX_HASH - description: '{{ doc("evm_traces_tx_hash") }}' - - name: TX_POSITION - description: '{{ doc("evm_tx_position") }}' - - name: FROM_ADDRESS - description: '{{ doc("evm_traces_from") }}' - - name: TO_ADDRESS - description: '{{ doc("evm_traces_to") }}' - - name: VALUE - description: '{{ doc("evm_traces_value") }}' - - name: VALUE_PRECISE_RAW - description: '{{ doc("evm_precise_amount_unadjusted") }}' - - name: VALUE_PRECISE - description: '{{ doc("evm_precise_amount_adjusted") }}' - - name: VALUE_HEX - description: '{{ doc("evm_value_hex") }}' - - name: GAS - description: '{{ doc("evm_traces_gas") }}' - - name: GAS_USED - description: '{{ doc("evm_traces_gas_used") }}' - - name: INPUT - description: '{{ doc("evm_traces_input") }}' - - name: OUTPUT - description: '{{ doc("evm_traces_output") }}' - - name: TYPE - description: '{{ doc("evm_traces_type") }}' - - name: IDENTIFIER - description: '{{ doc("evm_column_deprecation_notice_identifier") }}' - - name: TRACE_ADDRESS - description: '{{ doc("evm_trace_address") }}' - - name: DATA - description: '{{ doc("evm_column_deprecation_notice_data") }}' - - name: TX_STATUS - description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' - - name: TX_SUCCEEDED - description: '{{ doc("evm_tx_succeeded") }}' - - name: TRACE_SUCCEEDED - description: '{{ doc("evm_trace_succeeded") }}' - - name: SUB_TRACES - description: '{{ doc("evm_sub_traces") }}' - - name: TRACE_STATUS - description: '{{ doc("evm_column_deprecation_notice_trace_status") }}' - - name: ERROR_REASON - description: '{{ doc("evm_trace_error_reason") }}' - - name: REVERT_REASON - description: '{{ doc("evm_revert_reason") }}' - - name: TRACE_INDEX - description: The index of the trace within the transaction. - - name: FACT_TRACES_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/core/core__fact_transactions.sql b/models/gold/core/core__fact_transactions.sql deleted file mode 100644 index fe9c83f0..00000000 --- a/models/gold/core/core__fact_transactions.sql +++ /dev/null @@ -1,88 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - from_address, - to_address, - origin_function_signature, - VALUE, - value_precise_raw, - value_precise, - tx_fee, - tx_fee_precise, - CASE - WHEN tx_status = 'SUCCESS' THEN TRUE - ELSE FALSE - END AS tx_succeeded, --new column - tx_type, - nonce, - POSITION AS tx_position, --new column - input_data, - gas_price, - gas_used, - gas AS gas_limit, - cumulative_gas_used, - effective_gas_price, - max_fee_per_gas, - max_priority_fee_per_gas, - l1_gas_price, - l1_gas_used, - l1_fee_scalar, - l1_fee_precise, - l1_fee, - r, - s, - v, - COALESCE ( - transactions_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash'] - ) }} - ) AS fact_transactions_id, - GREATEST( - COALESCE(A.inserted_timestamp, '2000-01-01'), - COALESCE(b.inserted_timestamp, '2000-01-01'), --remove - COALESCE(C.inserted_timestamp, '2000-01-01') --remove - ) AS inserted_timestamp, - GREATEST( - COALESCE(A.modified_timestamp, '2000-01-01'), - COALESCE(b.modified_timestamp, '2000-01-01'), --remove - COALESCE(C.modified_timestamp, '2000-01-01') --remove - ) AS modified_timestamp, - block_hash, --deprecate - tx_status AS status, --deprecate - POSITION, --deprecate - l1_submission_batch_index, --deprecate, may build separate table - l1_submission_tx_hash, --deprecate, may build separate table - state_batch_index AS l1_state_root_batch_index, --deprecate, may build separate table - state_tx_hash AS l1_state_root_tx_hash, --deprecate, may build separate table - OBJECT_CONSTRUCT( - 'l1_bedrock_state_batch_index', - bedrock_state_batch_index, - 'l1_bedrock_state_batch_root', - bedrock_state_batch_root, - 'l1_state_root_batch_index', - state_batch_index, - 'l1_state_root_tx_hash', - state_tx_hash, - 'l1_submission_batch_index', - l1_submission_batch_index, - 'l1_submission_batch_root', - l1_submission_batch_root, - 'l1_submission_tx_hash', - l1_submission_tx_hash - ) AS l1_submission_details, --deprecate, may build separate table - deposit_nonce, --deprecate, may build separate table - deposit_receipt_version --deprecate, may build separate table -FROM - {{ ref('silver__transactions') }} A - LEFT JOIN {{ ref('silver__state_hashes') }} --remove - b USING (block_number) - LEFT JOIN {{ ref('silver__submission_hashes') }} --remove - C USING (block_number) diff --git a/models/gold/core/core__fact_transactions.yml b/models/gold/core/core__fact_transactions.yml deleted file mode 100644 index 32f50eae..00000000 --- a/models/gold/core/core__fact_transactions.yml +++ /dev/null @@ -1,94 +0,0 @@ -version: 2 -models: - - name: core__fact_transactions - description: '{{ doc("evm_tx_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("evm_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("evm_block_timestamp") }}' - - name: BLOCK_HASH - description: '{{ doc("evm_column_deprecation_notice_block_hash") }}' - - name: TX_HASH - description: '{{ doc("evm_tx_hash") }}' - - name: NONCE - description: '{{ doc("evm_tx_nonce") }}' - - name: POSITION - description: '{{ doc("evm_column_deprecation_notice_position") }}' - - name: TX_POSITION - description: '{{ doc("evm_tx_position") }}' - - name: FROM_ADDRESS - description: '{{ doc("evm_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("evm_to_address") }}' - - name: VALUE - description: '{{ doc("evm_value") }}' - - name: VALUE_PRECISE_RAW - description: '{{ doc("evm_precise_amount_unadjusted") }}' - - name: VALUE_PRECISE - description: '{{ doc("evm_precise_amount_adjusted") }}' - - name: TX_FEE - description: '{{ doc("evm_tx_fee") }}' - - name: TX_FEE_PRECISE - description: '{{ doc("evm_tx_fee_precise") }}' - - name: GAS_PRICE - description: '{{ doc("evm_tx_gas_price") }}' - - name: EFFECTIVE_GAS_PRICE - description: The total base charge plus tip paid for each unit of gas, in Gwei. - - name: GAS_LIMIT - description: '{{ doc("evm_tx_gas_limit") }}' - - name: GAS_USED - description: '{{ doc("evm_tx_gas_used") }}' - - name: L1_GAS_PRICE - description: '{{ doc("evm_l1_gas_price") }}' - - name: L1_GAS_USED - description: '{{ doc("evm_l1_gas_used") }}' - - name: L1_FEE_SCALAR - description: '{{ doc("evm_l1_fee_scalar") }}' - - name: L1_FEE - description: The L1 portion of fees paid. - - name: L1_FEE_PRECISE - description: '{{ doc("evm_l1_fee_precise") }}' - - name: L1_STATE_ROOT_TX_HASH - description: '{{ doc("evm_column_deprecation_notice_l1_state_root_tx_hash") }}' - - name: L1_STATE_ROOT_BATCH_INDEX - description: '{{ doc("evm_column_deprecation_notice_l1_state_root_batch_index") }}' - - name: L1_SUBMISSION_TX_HASH - description: '{{ doc("evm_column_deprecation_notice_l1_submission_tx_hash") }}' - - name: L1_SUBMISSION_BATCH_INDEX - description: '{{ doc("evm_column_deprecation_notice_l1_submission_batch_index") }}' - - name: L1_SUBMISSION_DETAILS - description: '{{ doc("evm_column_deprecation_notice_l1_submission_details") }}' - - name: CUMULATIVE_GAS_USED - description: '{{ doc("evm_cumulative_gas_used") }}' - - name: MAX_FEE_PER_GAS - description: The maximum fee per gas of the transaction, in Gwei. - - name: MAX_PRIORITY_FEE_PER_GAS - description: The maximum priority fee per gas of the transaction, in Gwei. - - name: STATUS - description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' - - name: TX_SUCCEEDED - description: '{{ doc("evm_tx_succeeded") }}' - - name: INPUT_DATA - description: '{{ doc("evm_tx_input_data") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_tx_origin_sig") }}' - - name: R - description: The r value of the transaction signature. - - name: S - description: The s value of the transaction signature. - - name: V - description: The v value of the transaction signature. - - name: TX_TYPE - description: The type of the transaction, 2 for EIP-1559 transactions and 0 for legacy transactions. - - name: FACT_TRANSACTIONS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' - - name: DEPOSIT_NONCE - description: '{{ doc("evm_column_deprecation_notice_deposit_nonce") }}' - - name: DEPOSIT_RECEIPT_VERSION - description: '{{ doc("evm_column_deprecation_notice_deposit_receipt_version") }}' \ No newline at end of file diff --git a/models/gold/core/tests/traces/test_gold__fact_traces_full.sql b/models/gold/core/tests/traces/test_gold__fact_traces_full.sql deleted file mode 100644 index 72dea5ba..00000000 --- a/models/gold/core/tests/traces/test_gold__fact_traces_full.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = "view", - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('core__fact_traces') }} -WHERE - block_number NOT IN ( - SELECT - block_number - FROM - {{ ref('silver_observability__excluded_receipt_blocks') }} - ) diff --git a/models/gold/core/tests/traces/test_gold__fact_traces_full.yml b/models/gold/core/tests/traces/test_gold__fact_traces_full.yml deleted file mode 100644 index 8957b6dc..00000000 --- a/models/gold/core/tests/traces/test_gold__fact_traces_full.yml +++ /dev/null @@ -1,121 +0,0 @@ -version: 2 -models: - - name: test_gold__fact_traces_full - description: "This is a view used to test all of the gold fact traces model." - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - TRACE_INDEX - - fsc_utils.sequence_gaps: - partition_by: - - TX_HASH - column_name: TRACE_INDEX - where: BLOCK_TIMESTAMP < CURRENT_DATE - 1 AND TX_HASH IS NOT NULL - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TX_POSITION - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRACE_INDEX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: FROM_ADDRESS - tests: - - not_null: - where: TYPE <> 'SELFDESTRUCT' - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - where: block_number NOT IN (87673, 985, 1177470, 500601, 1244152, 524915, 123322, 1238181, 898337, 1133328, 550275) - - name: TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - where: TO_ADDRESS IS NOT NULL - - name: INPUT - tests: - - not_null - - name: TYPE - tests: - - not_null - - name: TRACE_ADDRESS - tests: - - not_null - - name: SUB_TRACES - tests: - - not_null - - name: VALUE - tests: - - not_null - - name: VALUE_PRECISE_RAW - tests: - - not_null - - name: VALUE_PRECISE - tests: - - not_null - - name: VALUE_HEX - tests: - - not_null - - name: GAS - tests: - - not_null - - name: GAS_USED - tests: - - not_null - - name: ORIGIN_FROM_ADDRESS - tests: - - not_null - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null - - name: TRACE_SUCCEEDED - tests: - - not_null - - name: TX_SUCCEEDED - tests: - - not_null - - name: FACT_TRACES_ID - tests: - - not_null - - name: INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 diff --git a/models/gold/core/tests/traces/test_gold__fact_traces_recent.sql b/models/gold/core/tests/traces/test_gold__fact_traces_recent.sql deleted file mode 100644 index 4bed00ff..00000000 --- a/models/gold/core/tests/traces/test_gold__fact_traces_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = "view", - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('core__fact_traces') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref('_block_lookback') }} - ) diff --git a/models/gold/core/tests/traces/test_gold__fact_traces_recent.yml b/models/gold/core/tests/traces/test_gold__fact_traces_recent.yml deleted file mode 100644 index 4206f508..00000000 --- a/models/gold/core/tests/traces/test_gold__fact_traces_recent.yml +++ /dev/null @@ -1,120 +0,0 @@ -version: 2 -models: - - name: test_gold__fact_traces_recent - description: "This is a view used to test the last three days of fact traces." - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - TRACE_INDEX - - fsc_utils.sequence_gaps: - partition_by: - - TX_HASH - column_name: TRACE_INDEX - where: TX_HASH IS NOT NULL - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TX_POSITION - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRACE_INDEX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: FROM_ADDRESS - tests: - - not_null: - where: TYPE <> 'SELFDESTRUCT' - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - where: TO_ADDRESS IS NOT NULL - - name: INPUT - tests: - - not_null - - name: TYPE - tests: - - not_null - - name: TRACE_ADDRESS - tests: - - not_null - - name: SUB_TRACES - tests: - - not_null - - name: VALUE - tests: - - not_null - - name: VALUE_PRECISE_RAW - tests: - - not_null - - name: VALUE_PRECISE - tests: - - not_null - - name: VALUE_HEX - tests: - - not_null - - name: GAS - tests: - - not_null - - name: GAS_USED - tests: - - not_null - - name: ORIGIN_FROM_ADDRESS - tests: - - not_null - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null - - name: TRACE_SUCCEEDED - tests: - - not_null - - name: TX_SUCCEEDED - tests: - - not_null - - name: FACT_TRACES_ID - tests: - - not_null - - name: INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 diff --git a/models/gold/defi/defi__dim_dex_liquidity_pools.sql b/models/gold/defi/defi__dim_dex_liquidity_pools.sql index 942c1793..cf8d44b5 100644 --- a/models/gold/defi/defi__dim_dex_liquidity_pools.sql +++ b/models/gold/defi/defi__dim_dex_liquidity_pools.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'DEX, LIQUIDITY, POOLS, LP, SWAPS', } } - } + }, + tags = ['gold','defi','dex','curated'] ) }} SELECT diff --git a/models/gold/defi/defi__dim_dex_liquidity_pools.yml b/models/gold/defi/defi__dim_dex_liquidity_pools.yml index 27b773f8..27531cbd 100644 --- a/models/gold/defi/defi__dim_dex_liquidity_pools.yml +++ b/models/gold/defi/defi__dim_dex_liquidity_pools.yml @@ -1,32 +1,32 @@ version: 2 models: - name: defi__dim_dex_liquidity_pools - description: '{{ doc("eth_dex_lp_table_doc") }}' + description: '{{ doc("evm_dim_dex_lp_table_doc") }}' columns: - name: CREATION_BLOCK - description: '{{ doc("eth_dex_creation_block") }}' + description: '{{ doc("evm_dex_creation_block") }}' - name: CREATION_TIME - description: '{{ doc("eth_dex_creation_time") }}' + description: '{{ doc("evm_dex_creation_time") }}' - name: CREATION_TX - description: '{{ doc("eth_dex_creation_tx") }}' + description: '{{ doc("evm_dex_creation_tx") }}' - name: FACTORY_ADDRESS - description: '{{ doc("eth_dex_factory_address") }}' + description: '{{ doc("evm_dex_factory_address") }}' - name: PLATFORM - description: '{{ doc("eth_dex_platform") }}' + description: '{{ doc("evm_dex_platform") }}' - name: POOL_ADDRESS - description: '{{ doc("eth_dex_pool_address") }}' + description: '{{ doc("evm_dex_pool_address") }}' - name: POOL_NAME - description: '{{ doc("eth_dex_pool_name") }}' + description: '{{ doc("evm_dex_pool_name") }}' - name: TOKENS - description: '{{ doc("eth_dex_lp_tokens") }}' + description: '{{ doc("evm_dex_lp_tokens") }}' - name: SYMBOLS - description: '{{ doc("eth_dex_lp_symbols") }}' + description: '{{ doc("evm_dex_lp_symbols") }}' - name: DECIMALS - description: '{{ doc("eth_dex_lp_decimals") }}' + description: '{{ doc("evm_dex_lp_decimals") }}' - name: DIM_DEX_LIQUIDITY_POOLS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/defi__ez_bridge_activity.sql b/models/gold/defi/defi__ez_bridge_activity.sql index 6323f819..5630537b 100644 --- a/models/gold/defi/defi__ez_bridge_activity.sql +++ b/models/gold/defi/defi__ez_bridge_activity.sql @@ -7,7 +7,8 @@ 'table':{ 'PROTOCOL': 'ACROSS, AXELAR, CELER, CBRIDGE, DLN, DEBRIDGE, EYWA, HOP, MESON, MULTICHAIN, STARGATE, SYMBIOSIS, SYNAPSE, WORMHOLE, CCIP', 'PURPOSE': 'BRIDGE' - } } } + } } }, + tags = ['gold','defi','bridge','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/defi__ez_bridge_activity.yml b/models/gold/defi/defi__ez_bridge_activity.yml index ab4745de..cc7a2710 100644 --- a/models/gold/defi/defi__ez_bridge_activity.yml +++ b/models/gold/defi/defi__ez_bridge_activity.yml @@ -1,27 +1,27 @@ version: 2 models: - name: defi__ez_bridge_activity - description: '{{ doc("evm_bridge_table_doc") }}' + description: '{{ doc("evm_ez_bridge_activity_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("opt_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("opt_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("opt_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("opt_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS description: '{{ doc("evm_bridge_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("opt_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: PLATFORM description: '{{ doc("evm_bridge_platform") }}' - name: SENDER @@ -47,8 +47,8 @@ models: - name: AMOUNT_USD description: '{{ doc("evm_bridge_amount_usd") }}' - name: EZ_BRIDGE_ACTIVITY_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/defi__ez_dex_swaps.sql b/models/gold/defi/defi__ez_dex_swaps.sql index 2b76820a..96ac9206 100644 --- a/models/gold/defi/defi__ez_dex_swaps.sql +++ b/models/gold/defi/defi__ez_dex_swaps.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'DEX, SWAPS' } } - } + }, + tags = ['gold','defi','dex','curated','ez'] ) }} SELECT @@ -71,7 +72,6 @@ SELECT COALESCE( modified_timestamp, '2000-01-01' - ) AS modified_timestamp, - _log_id --deprecate + ) AS modified_timestamp FROM {{ ref('silver_dex__complete_dex_swaps') }} \ No newline at end of file diff --git a/models/gold/defi/defi__ez_dex_swaps.yml b/models/gold/defi/defi__ez_dex_swaps.yml index fb50e9d5..dd031195 100644 --- a/models/gold/defi/defi__ez_dex_swaps.yml +++ b/models/gold/defi/defi__ez_dex_swaps.yml @@ -1,58 +1,56 @@ version: 2 models: - name: defi__ez_dex_swaps - description: '{{ doc("eth_ez_dex_swaps_table_doc") }}' + description: '{{ doc("evm_ez_dex_swaps_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("opt_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("opt_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("opt_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: AMOUNT_IN - description: '{{ doc("eth_dex_swaps_amount_in") }}' + description: '{{ doc("evm_dex_swaps_amount_in") }}' - name: AMOUNT_OUT - description: '{{ doc("eth_dex_swaps_amount_out") }}' + description: '{{ doc("evm_dex_swaps_amount_out") }}' - name: AMOUNT_IN_USD - description: '{{ doc("eth_dex_swaps_amount_in_usd") }}' + description: '{{ doc("evm_dex_swaps_amount_in_usd") }}' - name: AMOUNT_OUT_USD - description: '{{ doc("eth_dex_swaps_amount_out_usd") }}' + description: '{{ doc("evm_dex_swaps_amount_out_usd") }}' - name: TOKEN_IN - description: '{{ doc("eth_dex_swaps_token_in") }}' + description: '{{ doc("evm_dex_swaps_token_in") }}' - name: TOKEN_OUT - description: '{{ doc("eth_dex_swaps_token_out") }}' + description: '{{ doc("evm_dex_swaps_token_out") }}' - name: SYMBOL_IN - description: '{{ doc("eth_dex_swaps_symbol_in") }}' + description: '{{ doc("evm_dex_swaps_symbol_in") }}' - name: SYMBOL_OUT - description: '{{ doc("eth_dex_swaps_symbol_out") }}' + description: '{{ doc("evm_dex_swaps_symbol_out") }}' - name: SENDER - description: '{{ doc("eth_dex_swaps_sender") }}' + description: '{{ doc("evm_dex_swaps_sender") }}' - name: TX_TO - description: '{{ doc("eth_dex_swaps_tx_to") }}' + description: '{{ doc("evm_dex_swaps_tx_to") }}' - name: PLATFORM - description: '{{ doc("eth_dex_platform") }}' + description: '{{ doc("evm_dex_platform") }}' - name: EVENT_INDEX - description: '{{ doc("opt_event_index") }}' - - name: _LOG_ID - description: '{{ doc("evm_column_deprecation_notice_log_id") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("opt_tx_origin_sig") }}' + description: '{{ doc("evm_tx_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("opt_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("opt_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: AMOUNT_IN_UNADJ - description: '{{ doc("eth_dex_swaps_amount_in_unadj") }}' + description: '{{ doc("evm_dex_swaps_amount_in_unadj") }}' - name: AMOUNT_OUT_UNADJ - description: '{{ doc("eth_dex_swaps_amount_out_unadj") }}' + description: '{{ doc("evm_dex_swaps_amount_out_unadj") }}' - name: EZ_DEX_SWAPS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_borrows.sql b/models/gold/defi/lending/defi__ez_lending_borrows.sql index 4859b75f..282d8789 100644 --- a/models/gold/defi/lending/defi__ez_lending_borrows.sql +++ b/models/gold/defi/lending/defi__ez_lending_borrows.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LENDING, BORROWS' } } - } + }, + tags = ['gold','defi','lending','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/lending/defi__ez_lending_borrows.yml b/models/gold/defi/lending/defi__ez_lending_borrows.yml index 091aceed..dea40466 100644 --- a/models/gold/defi/lending/defi__ez_lending_borrows.yml +++ b/models/gold/defi/lending/defi__ez_lending_borrows.yml @@ -1,46 +1,46 @@ version: 2 models: - name: defi__ez_lending_borrows - description: '{{ doc("complete_lending_borrows_table_doc") }}' + description: '{{ doc("evm_complete_lending_borrows_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("opt_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("opt_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("opt_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("opt_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("opt_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("opt_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: PLATFORM - description: '{{ doc("complete_lending_platform") }}' + description: '{{ doc("evm_complete_lending_platform") }}' - name: PROTOCOL_MARKET - description: '{{ doc("complete_lending_protocol_token") }}' + description: '{{ doc("evm_complete_lending_protocol_token") }}' - name: BORROWER - description: '{{ doc("complete_lending_borrower") }}' + description: '{{ doc("evm_complete_lending_borrower") }}' - name: TOKEN_ADDRESS - description: '{{ doc("complete_lending_token_address") }}' + description: '{{ doc("evm_complete_lending_token_address") }}' - name: TOKEN_SYMBOL - description: '{{ doc("opt_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: AMOUNT_UNADJ - description: '{{ doc("complete_lending_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_amount_unadj") }}' - name: AMOUNT - description: '{{ doc("complete_lending_amount") }}' + description: '{{ doc("evm_complete_lending_amount") }}' - name: AMOUNT_USD - description: '{{ doc("complete_lending_amount_usd") }}' + description: '{{ doc("evm_complete_lending_amount_usd") }}' - name: EZ_LENDING_BORROWS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_deposits.sql b/models/gold/defi/lending/defi__ez_lending_deposits.sql index 2dfa1df4..21b3b466 100644 --- a/models/gold/defi/lending/defi__ez_lending_deposits.sql +++ b/models/gold/defi/lending/defi__ez_lending_deposits.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LENDING, DEPOSITS' } } - } + }, + tags = ['gold','defi','lending','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/lending/defi__ez_lending_deposits.yml b/models/gold/defi/lending/defi__ez_lending_deposits.yml index e458b755..c0a10a43 100644 --- a/models/gold/defi/lending/defi__ez_lending_deposits.yml +++ b/models/gold/defi/lending/defi__ez_lending_deposits.yml @@ -1,46 +1,46 @@ version: 2 models: - name: defi__ez_lending_deposits - description: '{{ doc("complete_lending_deposits_table_doc") }}' + description: '{{ doc("evm_complete_lending_deposits_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("opt_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("opt_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("opt_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("opt_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("opt_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("opt_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: PLATFORM - description: '{{ doc("complete_lending_platform") }}' + description: '{{ doc("evm_complete_lending_platform") }}' - name: PROTOCOL_MARKET - description: '{{ doc("complete_lending_protocol_token") }}' + description: '{{ doc("evm_complete_lending_protocol_token") }}' - name: DEPOSITOR - description: '{{ doc("complete_lending_depositor") }}' + description: '{{ doc("evm_complete_lending_depositor") }}' - name: TOKEN_ADDRESS - description: '{{ doc("complete_lending_token_address") }}' + description: '{{ doc("evm_complete_lending_token_address") }}' - name: TOKEN_SYMBOL - description: '{{ doc("opt_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: AMOUNT_UNADJ - description: '{{ doc("complete_lending_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_amount_unadj") }}' - name: AMOUNT - description: '{{ doc("complete_lending_amount") }}' + description: '{{ doc("evm_complete_lending_amount") }}' - name: AMOUNT_USD - description: '{{ doc("complete_lending_amount_usd") }}' + description: '{{ doc("evm_complete_lending_amount_usd") }}' - name: EZ_LENDING_DEPOSITS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_flashloans.sql b/models/gold/defi/lending/defi__ez_lending_flashloans.sql index 658454a3..ffb156a0 100644 --- a/models/gold/defi/lending/defi__ez_lending_flashloans.sql +++ b/models/gold/defi/lending/defi__ez_lending_flashloans.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LENDING, FLASHLOANS' } } - } + }, + tags = ['gold','defi','lending','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/lending/defi__ez_lending_flashloans.yml b/models/gold/defi/lending/defi__ez_lending_flashloans.yml index b9f0be98..3e26134e 100644 --- a/models/gold/defi/lending/defi__ez_lending_flashloans.yml +++ b/models/gold/defi/lending/defi__ez_lending_flashloans.yml @@ -1,54 +1,54 @@ version: 2 models: - name: defi__ez_lending_flashloans - description: '{{ doc("complete_lending_flashloans_table_doc") }}' + description: '{{ doc("evm_complete_lending_flashloans_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("opt_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("opt_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("opt_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("opt_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("opt_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("opt_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: PLATFORM - description: '{{ doc("complete_lending_platform") }}' + description: '{{ doc("evm_complete_lending_platform") }}' - name: INITIATOR - description: '{{ doc("complete_lending_initiator_address") }}' + description: '{{ doc("evm_complete_lending_initiator_address") }}' - name: TARGET - description: '{{ doc("complete_lending_target_address") }}' + description: '{{ doc("evm_complete_lending_target_address") }}' - name: PROTOCOL_MARKET - description: '{{ doc("complete_lending_protocol_token") }}' + description: '{{ doc("evm_complete_lending_protocol_token") }}' - name: FLASHLOAN_TOKEN - description: '{{ doc("complete_lending_flashloan_token") }}' + description: '{{ doc("evm_complete_lending_flashloan_token") }}' - name: FLASHLOAN_TOKEN_SYMBOL - description: '{{ doc("opt_symbol") }}' + description: '{{ doc("evm_complete_lending_flashloan_token_symbol") }}' - name: FLASHLOAN_AMOUNT_UNADJ - description: '{{ doc("complete_lending_flashloan_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_flashloan_amount_unadj") }}' - name: FLASHLOAN_AMOUNT - description: '{{ doc("complete_lending_flashloan_amount") }}' + description: '{{ doc("evm_complete_lending_flashloan_amount") }}' - name: FLASHLOAN_AMOUNT_USD - description: '{{ doc("complete_lending_flashloan_amount_usd") }}' + description: '{{ doc("evm_complete_lending_flashloan_amount_usd") }}' - name: PREMIUM_AMOUNT_UNADJ - description: '{{ doc("complete_lending_premium_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_premium_amount_unadj") }}' - name: PREMIUM_AMOUNT - description: '{{ doc("complete_lending_premium_amount") }}' + description: '{{ doc("evm_complete_lending_premium_amount") }}' - name: PREMIUM_AMOUNT_USD - description: '{{ doc("complete_lending_premium_amount_usd") }}' + description: '{{ doc("evm_complete_lending_premium_amount_usd") }}' - name: EZ_LENDING_FLASHLOANS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_liquidations.sql b/models/gold/defi/lending/defi__ez_lending_liquidations.sql index ec472c3a..a1412a74 100644 --- a/models/gold/defi/lending/defi__ez_lending_liquidations.sql +++ b/models/gold/defi/lending/defi__ez_lending_liquidations.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LENDING, LIQUIDATIONS' } } - } + }, + tags = ['gold','defi','lending','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/lending/defi__ez_lending_liquidations.yml b/models/gold/defi/lending/defi__ez_lending_liquidations.yml index 7c8bb415..d8b189a3 100644 --- a/models/gold/defi/lending/defi__ez_lending_liquidations.yml +++ b/models/gold/defi/lending/defi__ez_lending_liquidations.yml @@ -1,52 +1,52 @@ version: 2 models: - name: defi__ez_lending_liquidations - description: '{{ doc("complete_lending_liquidations_table_doc") }}' + description: '{{ doc("evm_complete_lending_liquidations_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("opt_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("opt_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("opt_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("opt_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("opt_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("opt_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: PLATFORM - description: '{{ doc("complete_lending_platform") }}' + description: '{{ doc("evm_complete_lending_platform") }}' - name: LIQUIDATOR - description: '{{ doc("complete_lending_liquidator") }}' + description: '{{ doc("evm_complete_lending_liquidator") }}' - name: BORROWER - description: '{{ doc("complete_lending_borrower") }}' + description: '{{ doc("evm_complete_lending_borrower") }}' - name: PROTOCOL_MARKET - description: '{{ doc("complete_lending_protocol_token") }}' + description: '{{ doc("evm_complete_lending_protocol_token") }}' - name: COLLATERAL_TOKEN - description: '{{ doc("complete_lending_collateral_asset") }}' + description: '{{ doc("evm_complete_lending_collateral_asset") }}' - name: COLLATERAL_TOKEN_SYMBOL - description: '{{ doc("opt_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: AMOUNT_UNADJ - description: '{{ doc("complete_lending_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_amount_unadj") }}' - name: AMOUNT - description: '{{ doc("complete_lending_amount") }}' + description: '{{ doc("evm_complete_lending_amount") }}' - name: AMOUNT_USD - description: '{{ doc("complete_lending_amount_usd") }}' + description: '{{ doc("evm_complete_lending_amount_usd") }}' - name: DEBT_TOKEN - description: '{{ doc("complete_lending_debt_asset") }}' + description: '{{ doc("evm_complete_lending_debt_asset") }}' - name: DEBT_TOKEN_SYMBOL - description: '{{ doc("opt_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: EZ_LENDING_LIQUDATIONS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_repayments.sql b/models/gold/defi/lending/defi__ez_lending_repayments.sql index 8680f11a..77a0f61f 100644 --- a/models/gold/defi/lending/defi__ez_lending_repayments.sql +++ b/models/gold/defi/lending/defi__ez_lending_repayments.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LENDING, REPAYMENTS' } } - } + }, + tags = ['gold','defi','lending','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/lending/defi__ez_lending_repayments.yml b/models/gold/defi/lending/defi__ez_lending_repayments.yml index 17be1345..01c40dbf 100644 --- a/models/gold/defi/lending/defi__ez_lending_repayments.yml +++ b/models/gold/defi/lending/defi__ez_lending_repayments.yml @@ -1,48 +1,48 @@ version: 2 models: - name: defi__ez_lending_repayments - description: '{{ doc("complete_lending_repayments_table_doc") }}' + description: '{{ doc("evm_complete_lending_repayments_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("opt_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("opt_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("opt_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("opt_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("opt_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("opt_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: PLATFORM - description: '{{ doc("complete_lending_platform") }}' + description: '{{ doc("evm_complete_lending_platform") }}' - name: PAYER - description: '{{ doc("complete_lending_payer") }}' + description: '{{ doc("evm_complete_lending_payer") }}' - name: BORROWER - description: '{{ doc("complete_lending_borrower") }}' + description: '{{ doc("evm_complete_lending_borrower") }}' - name: PROTOCOL_MARKET - description: '{{ doc("complete_lending_protocol_token") }}' + description: '{{ doc("evm_complete_lending_protocol_token") }}' - name: TOKEN_ADDRESS - description: '{{ doc("complete_lending_token_address") }}' + description: '{{ doc("evm_complete_lending_token_address") }}' - name: TOKEN_SYMBOL - description: '{{ doc("complete_lending_token_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: AMOUNT_UNADJ - description: '{{ doc("complete_lending_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_amount_unadj") }}' - name: AMOUNT - description: '{{ doc("complete_lending_amount") }}' + description: '{{ doc("evm_complete_lending_amount") }}' - name: AMOUNT_USD - description: '{{ doc("complete_lending_amount_usd") }}' + description: '{{ doc("evm_complete_lending_amount_usd") }}' - name: EZ_LENDING_REPAYMENTS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_withdraws.sql b/models/gold/defi/lending/defi__ez_lending_withdraws.sql index 3fea8777..6d594815 100644 --- a/models/gold/defi/lending/defi__ez_lending_withdraws.sql +++ b/models/gold/defi/lending/defi__ez_lending_withdraws.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'LENDING, WITHDRAWS' } } - } + }, + tags = ['gold','defi','lending','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/lending/defi__ez_lending_withdraws.yml b/models/gold/defi/lending/defi__ez_lending_withdraws.yml index 887c5e51..1c088169 100644 --- a/models/gold/defi/lending/defi__ez_lending_withdraws.yml +++ b/models/gold/defi/lending/defi__ez_lending_withdraws.yml @@ -1,46 +1,46 @@ version: 2 models: - name: defi__ez_lending_withdraws - description: '{{ doc("complete_lending_withdraws_table_doc") }}' + description: '{{ doc("evm_complete_lending_withdraws_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("opt_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("opt_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("opt_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("opt_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("opt_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("opt_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: PLATFORM - description: '{{ doc("complete_lending_platform") }}' + description: '{{ doc("evm_complete_lending_platform") }}' - name: DEPOSITOR - description: '{{ doc("borrower") }}' + description: '{{ doc("evm_borrower") }}' - name: PROTOCOL_MARKET - description: '{{ doc("complete_lending_protocol_token") }}' + description: '{{ doc("evm_complete_lending_protocol_token") }}' - name: TOKEN_ADDRESS - description: '{{ doc("complete_lending_token_address") }}' + description: '{{ doc("evm_complete_lending_token_address") }}' - name: TOKEN_SYMBOL - description: '{{ doc("complete_lending_token_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: AMOUNT_UNADJ - description: '{{ doc("complete_lending_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_amount_unadj") }}' - name: AMOUNT - description: '{{ doc("complete_lending_amount") }}' + description: '{{ doc("evm_complete_lending_amount") }}' - name: AMOUNT_USD - description: '{{ doc("complete_lending_amount_usd") }}' + description: '{{ doc("evm_complete_lending_amount_usd") }}' - name: EZ_LENDING_WITHDRAWS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/governance/gov__fact_delegations.sql b/models/gold/governance/gov__fact_delegations.sql index 0b22cdbe..93f34e1d 100644 --- a/models/gold/governance/gov__fact_delegations.sql +++ b/models/gold/governance/gov__fact_delegations.sql @@ -1,7 +1,8 @@ {{ config( materialized = 'view', persist_docs ={ "relation": true, - "columns": true } + "columns": true }, + tags = ['gold','governance','curated'] ) }} SELECT diff --git a/models/gold/governance/gov__fact_delegations.yml b/models/gold/governance/gov__fact_delegations.yml index 6eb897b6..8b25f040 100644 --- a/models/gold/governance/gov__fact_delegations.yml +++ b/models/gold/governance/gov__fact_delegations.yml @@ -1,51 +1,31 @@ version: 2 models: - name: gov__fact_delegations - description: '{{ doc("opt_delegations_table_doc") }}' + description: '{{ doc("op_delegations_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' - tests: - - dbt_expectations.expect_column_to_exist + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' - tests: - - dbt_expectations.expect_column_to_exist + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("opt_tx_hash") }}' - tests: - - dbt_expectations.expect_column_to_exist + description: '{{ doc("evm_tx_hash") }}' - name: STATUS - description: '{{ doc("opt_tx_status") }}' - tests: - - dbt_expectations.expect_column_to_exist + description: '{{ doc("evm_tx_status") }}' - name: DELEGATOR description: '{{ doc("delegation_delegator") }}' - tests: - - dbt_expectations.expect_column_to_exist - name: TO_DELEGATE description: '{{ doc("delegation_to_delegate") }}' - tests: - - dbt_expectations.expect_column_to_exist - name: FROM_DELEGATE description: '{{ doc("delegation_from_delegate") }}' - tests: - - dbt_expectations.expect_column_to_exist - name: DELEGATION_TYPE description: '{{ doc("delegation_delegation_type") }}' - tests: - - dbt_expectations.expect_column_to_exist - name: RAW_NEW_BALANCE description: The new amount the user has delegated after the transaction - tests: - - dbt_expectations.expect_column_to_exist - name: RAW_PREVIOUS_BALANCE description: The amount of OP the user had delegated before the transaction. - tests: - - dbt_expectations.expect_column_to_exist - name: FACT_DELEGATIONS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/nft/nft__ez_nft_sales.sql b/models/gold/nft/nft__ez_nft_sales.sql index 5b396690..7af940ff 100644 --- a/models/gold/nft/nft__ez_nft_sales.sql +++ b/models/gold/nft/nft__ez_nft_sales.sql @@ -2,13 +2,8 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PURPOSE': 'NFT' - } - } - } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } }, + tags = ['gold','nft','curated','ez'] ) }} SELECT @@ -23,17 +18,11 @@ SELECT aggregator_name, seller_address, buyer_address, - nft_address AS contract_address, --new column - project_name AS NAME, --new column - tokenid AS token_id, --new column - COALESCE( - erc1155_value, - '1' - ) :: STRING AS quantity, --new column - CASE - WHEN erc1155_value IS NULL THEN 'erc721' - ELSE 'erc1155' - END AS token_standard, --new column + nft_address as contract_address, + project_name as name, + tokenId as token_id, + coalesce(erc1155_value, '1')::STRING AS quantity, + case when erc1155_value is null then 'erc721' else 'erc1155' end as token_standard, currency_symbol, currency_address, price, @@ -44,7 +33,7 @@ SELECT total_fees_usd, platform_fee_usd, creator_fee_usd, - tx_fee, + tx_fee, tx_fee_usd, origin_from_address, origin_to_address, @@ -62,10 +51,7 @@ SELECT COALESCE( modified_timestamp, '2000-01-01' - ) AS modified_timestamp, - tokenId, --deprecate - erc1155_value, --deprecate - project_name, --deprecate - nft_address --deprecate + ) AS modified_timestamp + FROM {{ ref('silver__complete_nft_sales') }} diff --git a/models/gold/nft/nft__ez_nft_sales.yml b/models/gold/nft/nft__ez_nft_sales.yml index c3d93c1b..a4003b15 100644 --- a/models/gold/nft/nft__ez_nft_sales.yml +++ b/models/gold/nft/nft__ez_nft_sales.yml @@ -5,74 +5,66 @@ models: columns: - name: BLOCK_NUMBER - description: '{{ doc("nft_block_no") }}' + description: '{{ doc("evm_nft_block_no") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("nft_blocktime") }}' + description: '{{ doc("evm_nft_blocktime") }}' - name: TX_HASH - description: '{{ doc("nft_tx_hash") }}' + description: '{{ doc("evm_nft_tx_hash") }}' - name: EVENT_INDEX - description: '{{ doc("nft_event_index") }}' + description: '{{ doc("evm_nft_event_index") }}' - name: EVENT_TYPE - description: '{{ doc("nft_event_type") }}' + description: '{{ doc("evm_nft_event_type") }}' - name: PLATFORM_ADDRESS - description: '{{ doc("nft_platform_address") }}' + description: '{{ doc("evm_nft_platform_address") }}' - name: PLATFORM_NAME - description: '{{ doc("nft_platform_name") }}' + description: '{{ doc("evm_nft_platform_name") }}' - name: PLATFORM_EXCHANGE_VERSION - description: '{{ doc("nft_platform_exchange_version") }}' + description: '{{ doc("evm_nft_platform_exchange_version") }}' - name: AGGREGATOR_NAME - description: '{{ doc("nft_aggregator_name") }}' + description: '{{ doc("evm_nft_aggregator_name") }}' - name: SELLER_ADDRESS - description: '{{ doc("nft_seller_address") }}' + description: '{{ doc("evm_nft_seller_address") }}' - name: BUYER_ADDRESS - description: '{{ doc("nft_buyer_address") }}' - - name: NFT_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_address") }}' + description: '{{ doc("evm_nft_buyer_address") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("nft_nft_address") }}' - - name: PROJECT_NAME - description: '{{ doc("evm_column_deprecation_notice_project_name") }}' + description: '{{ doc("evm_nft_address") }}' - name: NAME description: '{{ doc("evm_nft_project_name") }}' - - name: TOKENID - description: '{{ doc("evm_column_deprecation_notice_tokenid") }}' - name: TOKEN_ID - description: '{{ doc("nft_tokenid") }}' - - name: ERC1155_VALUE - description: '{{ doc("evm_column_deprecation_notice_erc1155_value") }}' + description: '{{ doc("evm_nft_tokenid") }}' - name: QUANTITY description: '{{ doc("evm_nft_quantity") }}' - name: TOKEN_STANDARD - description: '{{ doc("evm_nft_token_standard") }}' + description: '{{ doc("evm_token_standard") }}' - name: CURRENCY_SYMBOL - description: '{{ doc("nft_currency_symbol") }}' + description: '{{ doc("evm_nft_currency_symbol") }}' - name: CURRENCY_ADDRESS - description: '{{ doc("nft_currency_address") }}' + description: '{{ doc("evm_nft_currency_address") }}' - name: PRICE - description: '{{ doc("nft_price") }}' + description: '{{ doc("evm_nft_price") }}' - name: PRICE_USD - description: '{{ doc("nft_price_usd") }}' + description: '{{ doc("evm_nft_price_usd") }}' - name: TOTAL_FEES - description: '{{ doc("nft_total_fees") }}' + description: '{{ doc("evm_nft_total_fees") }}' - name: PLATFORM_FEE - description: '{{ doc("nft_platform_fee") }}' + description: '{{ doc("evm_nft_platform_fee") }}' - name: CREATOR_FEE - description: '{{ doc("nft_creator_fee") }}' + description: '{{ doc("evm_nft_creator_fee") }}' - name: TOTAL_FEES_USD - description: '{{ doc("nft_total_fees_usd") }}' + description: '{{ doc("evm_nft_total_fees_usd") }}' - name: PLATFORM_FEE_USD - description: '{{ doc("nft_platform_fee_usd") }}' + description: '{{ doc("evm_nft_platform_fee_usd") }}' - name: CREATOR_FEE_USD - description: '{{ doc("nft_creator_fee_usd") }}' + description: '{{ doc("evm_nft_creator_fee_usd") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("nft_origin_from") }}' + description: '{{ doc("evm_nft_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("nft_origin_to") }}' + description: '{{ doc("evm_nft_origin_to") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: EZ_NFT_SALES_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/nft/nft__ez_nft_transfers.sql b/models/gold/nft/nft__ez_nft_transfers.sql deleted file mode 100644 index 9615df08..00000000 --- a/models/gold/nft/nft__ez_nft_transfers.sql +++ /dev/null @@ -1,56 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } } -) }} - -SELECT - block_timestamp, - block_number, - tx_hash, - event_index, - intra_event_index, - token_transfer_type, - IFF( - from_address = '0x0000000000000000000000000000000000000000', - TRUE, - FALSE - ) AS is_mint, --new column - from_address, --new column - to_address, --new column - contract_address, --new column - tokenId AS token_id, --new column - COALESCE( - erc1155_value, - '1' - ) :: STRING AS quantity, --new column - CASE - WHEN token_transfer_type = 'erc721_Transfer' THEN 'erc721' - WHEN token_transfer_type = 'erc1155_TransferSingle' THEN 'erc1155' - WHEN token_transfer_type = 'erc1155_TransferBatch' THEN 'erc1155' - END AS token_standard, --new column - project_name AS NAME, --new column - COALESCE ( - nft_transfers_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash','event_index','intra_event_index'] - ) }} - ) AS ez_nft_transfers_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp, - event_type, -- deprecate - from_address AS nft_from_address, -- deprecate - to_address AS nft_to_address, -- deprecate - contract_address AS nft_address, --deprecate - tokenId, -- deprecate - erc1155_value, --deprecate - project_name --deprecate -FROM - {{ ref('silver__nft_transfers') }} diff --git a/models/gold/nft/nft__ez_nft_transfers.yml b/models/gold/nft/nft__ez_nft_transfers.yml deleted file mode 100644 index bb7d32d8..00000000 --- a/models/gold/nft/nft__ez_nft_transfers.yml +++ /dev/null @@ -1,50 +0,0 @@ -version: 2 -models: - - name: nft__ez_nft_transfers - description: '{{ doc("evm_ez_nft_transfer_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("nft_block_no") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("nft_blocktime") }}' - - name: TX_HASH - description: '{{ doc("nft_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("nft_event_index") }}' - - name: INTRA_EVENT_INDEX - description: '{{ doc("nft_intra_event_index") }}' - - name: EVENT_TYPE - description: '{{ doc("evm_column_deprecation_notice_event_type") }}' - - name: NFT_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_address") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("nft_nft_address") }}' - - name: NAME - description: '{{ doc("evm_nft_project_name") }}' - - name: PROJECT_NAME - description: '{{ doc("evm_column_deprecation_notice_project_name") }}' - - name: NFT_FROM_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_from_address") }}' - - name: FROM_ADDRESS - description: '{{ doc("evm_nft_from_address") }}' - - name: NFT_TO_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_to_address") }}' - - name: TO_ADDRESS - description: '{{ doc("evm_nft_to_address") }}' - - name: TOKENID - description: '{{ doc("evm_column_deprecation_notice_tokenid") }}' - - name: TOKEN_ID - description: '{{ doc("nft_tokenid") }}' - - name: ERC1155_VALUE - description: '{{ doc("evm_column_deprecation_notice_erc1155_value") }}' - - name: QUANTITY - description: '{{ doc("evm_nft_quantity") }}' - - name: TOKEN_STANDARD - description: '{{ doc("evm_nft_token_standard") }}' - - name: EZ_NFT_TRANSFERS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/price/price__dim_asset_metadata.sql b/models/gold/price/price__dim_asset_metadata.sql deleted file mode 100644 index 71bf27f0..00000000 --- a/models/gold/price/price__dim_asset_metadata.sql +++ /dev/null @@ -1,19 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - token_address, - asset_id, - symbol, - name, - platform AS blockchain, - platform_id AS blockchain_id, - provider, - inserted_timestamp, - modified_timestamp, - complete_provider_asset_metadata_id AS dim_asset_metadata_id -FROM - {{ ref('silver__complete_provider_asset_metadata') }} \ No newline at end of file diff --git a/models/gold/price/price__dim_asset_metadata.yml b/models/gold/price/price__dim_asset_metadata.yml deleted file mode 100644 index db7ec288..00000000 --- a/models/gold/price/price__dim_asset_metadata.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: 2 -models: - - name: price__dim_asset_metadata - description: '{{ doc("prices_dim_asset_metadata_table_doc") }}' - - columns: - - name: PROVIDER - description: '{{ doc("prices_provider")}}' - - name: ASSET_ID - description: '{{ doc("prices_asset_id") }}' - - name: NAME - description: '{{ doc("prices_name") }}' - - name: SYMBOL - description: '{{ doc("prices_symbol") }}' - - name: TOKEN_ADDRESS - description: '{{ doc("prices_token_address_evm") }}' - - name: BLOCKCHAIN - description: '{{ doc("prices_blockchain") }}' - - name: BLOCKCHAIN_ID - description: '{{ doc("prices_blockchain_id") }}' - - name: DIM_ASSET_METADATA_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/price/price__ez_asset_metadata.sql b/models/gold/price/price__ez_asset_metadata.sql deleted file mode 100644 index f8c8f8bd..00000000 --- a/models/gold/price/price__ez_asset_metadata.sql +++ /dev/null @@ -1,35 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - token_address, - asset_id, - symbol, - NAME, - decimals, - blockchain, - FALSE AS is_native, - is_deprecated, - inserted_timestamp, - modified_timestamp, - complete_token_asset_metadata_id AS ez_asset_metadata_id -FROM - {{ ref('silver__complete_token_asset_metadata') }} -UNION ALL -SELECT - NULL AS token_address, - asset_id, - symbol, - NAME, - decimals, - blockchain, - TRUE AS is_native, - is_deprecated, - inserted_timestamp, - modified_timestamp, - complete_native_asset_metadata_id AS ez_asset_metadata_id -FROM - {{ ref('silver__complete_native_asset_metadata') }} diff --git a/models/gold/price/price__ez_asset_metadata.yml b/models/gold/price/price__ez_asset_metadata.yml deleted file mode 100644 index 57088a9b..00000000 --- a/models/gold/price/price__ez_asset_metadata.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: 2 -models: - - name: price__ez_asset_metadata - description: '{{ doc("prices_ez_asset_metadata_table_doc") }}' - - columns: - - name: ASSET_ID - description: '{{ doc("prices_asset_id") }}' - - name: NAME - description: '{{ doc("prices_name") }}' - - name: SYMBOL - description: '{{ doc("prices_symbol") }}' - - name: TOKEN_ADDRESS - description: '{{ doc("prices_token_address_evm") }}' - - name: BLOCKCHAIN - description: '{{ doc("prices_blockchain") }}' - - name: DECIMALS - description: '{{ doc("prices_decimals") }}' - - name: IS_NATIVE - description: '{{ doc("prices_is_native") }}' - - name: IS_DEPRECATED - description: '{{ doc("prices_is_deprecated") }}' - - name: EZ_ASSET_METADATA_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' - \ No newline at end of file diff --git a/models/gold/price/price__ez_prices_hourly.sql b/models/gold/price/price__ez_prices_hourly.sql deleted file mode 100644 index dfda724e..00000000 --- a/models/gold/price/price__ez_prices_hourly.sql +++ /dev/null @@ -1,39 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - HOUR, - token_address, - symbol, - NAME, - decimals, - price, - blockchain, - FALSE AS is_native, - is_imputed, - is_deprecated, - inserted_timestamp, - modified_timestamp, - complete_token_prices_id AS ez_prices_hourly_id -FROM - {{ ref('silver__complete_token_prices') }} -UNION ALL -SELECT - HOUR, - NULL AS token_address, - symbol, - NAME, - decimals, - price, - blockchain, - TRUE AS is_native, - is_imputed, - is_deprecated, - inserted_timestamp, - modified_timestamp, - complete_native_prices_id AS ez_prices_hourly_id -FROM - {{ ref('silver__complete_native_prices') }} diff --git a/models/gold/price/price__ez_prices_hourly.yml b/models/gold/price/price__ez_prices_hourly.yml deleted file mode 100644 index 96cf4e5e..00000000 --- a/models/gold/price/price__ez_prices_hourly.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 2 -models: - - name: price__ez_prices_hourly - description: '{{ doc("prices_ez_prices_hourly_table_doc") }}' - - columns: - - name: HOUR - description: '{{ doc("prices_hour")}}' - - name: TOKEN_ADDRESS - description: '{{ doc("prices_token_address_evm") }}' - - name: SYMBOL - description: '{{ doc("prices_symbol") }}' - - name: BLOCKCHAIN - description: '{{ doc("prices_blockchain") }}' - - name: DECIMALS - description: '{{ doc("prices_decimals") }}' - - name: PRICE - description: '{{ doc("prices_price") }}' - - name: IS_NATIVE - description: '{{ doc("prices_is_native") }}' - - name: IS_IMPUTED - description: '{{ doc("prices_is_imputed") }}' - - name: IS_DEPRECATED - description: '{{ doc("prices_is_deprecated") }}' - - name: EZ_PRICES_HOURLY_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/price/price__fact_prices_ohlc_hourly.sql b/models/gold/price/price__fact_prices_ohlc_hourly.sql deleted file mode 100644 index 2be7d759..00000000 --- a/models/gold/price/price__fact_prices_ohlc_hourly.sql +++ /dev/null @@ -1,19 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - asset_id, - recorded_hour AS HOUR, - OPEN, - high, - low, - CLOSE, - provider, - inserted_timestamp, - modified_timestamp, - complete_provider_prices_id AS fact_prices_ohlc_hourly_id -FROM - {{ ref('silver__complete_provider_prices') }} diff --git a/models/gold/price/price__fact_prices_ohlc_hourly.yml b/models/gold/price/price__fact_prices_ohlc_hourly.yml deleted file mode 100644 index 29ff0457..00000000 --- a/models/gold/price/price__fact_prices_ohlc_hourly.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: 2 -models: - - name: price__fact_prices_ohlc_hourly - description: '{{ doc("prices_fact_prices_ohlc_hourly_table_doc") }}' - - columns: - - name: HOUR - description: '{{ doc("prices_hour")}}' - - name: ASSET_ID - description: '{{ doc("prices_asset_id") }}' - - name: OPEN - description: '{{ doc("prices_open") }}' - - name: HIGH - description: '{{ doc("prices_high") }}' - - name: LOW - description: '{{ doc("prices_low") }}' - - name: CLOSE - description: '{{ doc("prices_close") }}' - - name: FACT_PRICES_OHLC_HOURLY_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/stats/stats__ez_core_metrics_hourly.sql b/models/gold/stats/stats__ez_core_metrics_hourly.sql deleted file mode 100644 index 7a2e3016..00000000 --- a/models/gold/stats/stats__ez_core_metrics_hourly.sql +++ /dev/null @@ -1,38 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'STATS, METRICS, CORE, HOURLY', - } } } -) }} - -SELECT - block_timestamp_hour, - block_number_min, - block_number_max, - block_count, - transaction_count, - transaction_count_success, - transaction_count_failed, - unique_from_count, - unique_to_count, - total_fees AS total_fees_native, - ROUND( - total_fees * LAST_VALUE( - p.price ignore nulls - ) over ( - ORDER BY - block_timestamp_hour rows unbounded preceding - ), - 2 - ) AS total_fees_usd, - core_metrics_hourly_id AS ez_core_metrics_hourly_id, - s.inserted_timestamp AS inserted_timestamp, - s.modified_timestamp AS modified_timestamp -FROM - {{ ref('silver_stats__core_metrics_hourly') }} - s - LEFT JOIN {{ ref('silver__complete_token_prices') }} - p - ON s.block_timestamp_hour = p.hour - AND p.token_address = '0x4200000000000000000000000000000000000006' \ No newline at end of file diff --git a/models/gold/stats/stats__ez_core_metrics_hourly.yml b/models/gold/stats/stats__ez_core_metrics_hourly.yml deleted file mode 100644 index 8a61528c..00000000 --- a/models/gold/stats/stats__ez_core_metrics_hourly.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: 2 -models: - - name: stats__ez_core_metrics_hourly - description: '{{ doc("evm_ez_core_metrics_hourly_table_doc") }}' - - columns: - - name: BLOCK_TIMESTAMP_HOUR - description: '{{ doc("evm_block_timestamp_hour") }}' - - name: BLOCK_NUMBER_MIN - description: '{{ doc("evm_block_number_min") }}' - - name: BLOCK_NUMBER_MAX - description: '{{ doc("evm_block_number_max") }}' - - name: BLOCK_COUNT - description: '{{ doc("evm_block_count") }}' - - name: TRANSACTION_COUNT - description: '{{ doc("evm_transaction_count") }}' - - name: TRANSACTION_COUNT_SUCCESS - description: '{{ doc("evm_transaction_count_success") }}' - - name: TRANSACTION_COUNT_FAILED - description: '{{ doc("evm_transaction_count_failed") }}' - - name: UNIQUE_FROM_COUNT - description: '{{ doc("evm_unique_from_count") }}' - - name: UNIQUE_TO_COUNT - description: '{{ doc("evm_unique_to_count") }}' - - name: TOTAL_FEES_NATIVE - description: '{{ doc("evm_total_fees_native") }}' - - name: TOTAL_FEES_USD - description: '{{ doc("evm_total_fees_usd") }}' - - name: EZ_CORE_METRICS_HOURLY_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/doc_descriptions/general/__overview__.md b/models/overview.md similarity index 69% rename from models/doc_descriptions/general/__overview__.md rename to models/overview.md index 94886c11..a6b2f6fc 100644 --- a/models/doc_descriptions/general/__overview__.md +++ b/models/overview.md @@ -16,37 +16,34 @@ There is more information on how to use dbt docs in the last section of this doc **Click on the links below to jump to the documentation for each schema.** -### Core Tables (optimism.core) +### Core Tables -**Dimension Tables:** -- [dim_contracts](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__dim_contracts) -- [dim_labels](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__dim_labels) +**Dimensional Tables** +- [dim_contracts](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.core__dim_contracts) +- [dim_contract_abis](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.core__dim_contract_abis) +- [dim_labels](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.core__dim_labels) **Fact Tables:** -- [fact_blocks](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__fact_blocks) -- [fact_event_logs](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__fact_event_logs) -- [fact_decoded_event_logs](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__fact_decoded_event_logs) -- [fact_token_transfers](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__fact_token_transfers) -- [fact_traces](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__fact_traces) -- [fact_transactions](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__fact_transactions) -- [fact_l1_state_root_submissions](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__fact_l1_state_root_submissions) -- [fact_l1_submissions](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__fact_l1_submissions) +- [fact_blocks](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.core__fact_blocks) +- [fact_transactions](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.core__fact_transactions) +- [fact_event_logs](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.core__fact_event_logs) +- [fact_traces](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.core__fact_traces) **Convenience Tables:** -- [ez_native_transfers](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__ez_native_transfers) -- [ez_token_transfers](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__ez_token_transfers) -- [ez_decoded_event_logs](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.core__ez_decoded_event_logs) +- [ez_decoded_event_logs](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.core__ez_decoded_event_logs) +- [ez_native_transfers](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.core__ez_native_transfers) +- [ez_token_transfers](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.core__ez_token_transfers) ### Price Tables (optimism.price) -- [dim_asset_metadata](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.price__dim_asset_metadata) -- [fact_prices_ohlc_hourly](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.price__fact_prices_ohlc_hourly) -- [ez_asset_metadata](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.price__ez_asset_metadata) -- [ez_prices_hourly](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.price__ez_prices_hourly) +- [dim_asset_metadata](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.price__dim_asset_metadata) +- [fact_prices_ohlc_hourly](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.price__fact_prices_ohlc_hourly) +- [ez_asset_metadata](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.price__ez_asset_metadata) +- [ez_prices_hourly](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.price__ez_prices_hourly) ### DeFi Tables (optimism.defi) - [ez_bridge_activity](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.defi__ez_bridge_activity) -- [dim_dex_liquidity_pools](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.defi__dim_dex_liquidity_pools) - [ez_dex_swaps](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.defi__ez_dex_swaps) +- [dim_dex_liquidity_pools](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.defi__dim_dex_liquidity_pools) - [ez_lending_borrows](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.defi__ez_lending_borrows) - [ez_lending_deposits](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.defi__ez_lending_deposits) - [ez_lending_flashloans](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.defi__ez_lending_flashloans) @@ -54,16 +51,26 @@ There is more information on how to use dbt docs in the last section of this doc - [ez_lending_repayments](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.defi__ez_lending_repayments) - [ez_lending_withdraws](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.defi__ez_lending_withdraws) -### Stats Tables (optimism.stats) -- [ez_core_metrics_hourly](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.stats__ez_core_metrics_hourly) +### Flipside Partner Tables (optimism.partner_name) + +**Vertex Tables:** +- [dim_products](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.vertex__dim_products) +- [ez_clearing_house_events](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.vertex__ez_clearing_house_events) +- [ez_liquidations](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.vertex__ez_liquidations) +- [ez_perp_trades](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.vertex__ez_perp_trades) +- [ez_spot_trades](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.vertex__ez_spot_trades) +- [ez_account_stats](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.vertex__ez_account_stats) +- [ez_edge_trades](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.vertex__ez_edge_trades) +- [ez_market_depth_stats](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.vertex__ez_market_depth_stats) +- [ez_market_stats](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.vertex__ez_market_stats) +- [ez_money_markets](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.vertex__ez_money_markets) ### NFT Tables (optimism.nft) - +- [ez_nft_transfers](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.nft__ez_nft_transfers) - [ez_nft_sales](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.nft__ez_nft_sales) -- [ez_nft_transfers](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.nft__ez_nft_transfers) -### Governance Tables (optimism.gov) -- [fact_delegations](https://flipsidecrypto.github.io/optimism-models/#!/model/model.optimism_models.gov__fact_delegations) +### Stats Tables (optimism.stats) +- [ez_core_metrics_hourly](https://flipsidecrypto.github.io/optimism-models/#!/model/model.fsc_evm.stats__ez_core_metrics_hourly) ## **Helpful User-Defined Functions (UDFs)** @@ -83,6 +90,8 @@ The dimension tables are sourced from a variety of on-chain and off-chain source Convenience views (denoted ez_) are a combination of different fact and dimension tables. These views are built to make it easier to query the data. +NOTE: Optimism is currently operating in it's Testnet phase. Flipside will provide Mainnet data tables once Optimism Mainnet is deployed. + ## **Using dbt docs** ### Navigation @@ -90,7 +99,7 @@ You can use the ```Project``` and ```Database``` navigation tabs on the left sid ### Database Tab -This view shows relations (tables and views) grouped into database schemas. Note that ephemeral models are *not* shown in this interface, as they do not exist in the database. +This view shows relations (tables and views) grouped into database schemas. Note that ephemeral models are *not* shown in this interface, as they do not exist in the dataoptimism. ### Graph Exploration @@ -104,10 +113,11 @@ Note that you can also right-click on models to interactively filter and explore ### **More information** -- [Flipside](https://flipsidecrypto.xyz) +- [Flipside](https://flipsidecrypto.xyz/) +- [Velocity](https://app.flipsidecrypto.com/velocity?nav=Discover) - [Tutorials](https://docs.flipsidecrypto.com/our-data/tutorials) - [Github](https://github.com/FlipsideCrypto/optimism-models) -- [Data Studio](https://flipsidecrypto.xyz/edit) - [What is dbt?](https://docs.getdbt.com/docs/introduction) -{% enddocs %} + +{% enddocs %} \ No newline at end of file diff --git a/models/silver/_observability/silver_observability__blocks_completeness.sql b/models/silver/_observability/silver_observability__blocks_completeness.sql deleted file mode 100644 index c5c625e9..00000000 --- a/models/silver/_observability/silver_observability__blocks_completeness.sql +++ /dev/null @@ -1,161 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -blocks AS ( - SELECT - l.block_number, - block_timestamp, - LAG( - l.block_number, - 1 - ) over ( - ORDER BY - l.block_number ASC - ) AS prev_BLOCK_NUMBER - FROM - {{ ref("silver__blocks") }} - l - INNER JOIN block_range b - ON l.block_number = b.block_number - AND l.block_number >= ( - SELECT - MIN(block_number) - FROM - block_range - ) -), -block_gen AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - MIN(block_number) - FROM - blocks - ) - AND ( - SELECT - MAX(block_number) - FROM - blocks - ) -) -SELECT - 'blocks' AS test_name, - MIN( - b.block_number - ) AS min_block, - MAX( - b.block_number - ) AS max_block, - MIN( - b.block_timestamp - ) AS min_block_timestamp, - MAX( - b.block_timestamp - ) AS max_block_timestamp, - COUNT(1) AS blocks_tested, - COUNT( - CASE - WHEN C.block_number IS NOT NULL THEN A.block_number - END - ) AS blocks_impacted_count, - ARRAY_AGG( - CASE - WHEN C.block_number IS NOT NULL THEN A.block_number - END - ) within GROUP ( - ORDER BY - A.block_number - ) AS blocks_impacted_array, - CURRENT_TIMESTAMP AS test_timestamp -FROM - block_gen A - LEFT JOIN blocks b - ON A.block_number = b.block_number - LEFT JOIN blocks C - ON A.block_number > C.prev_block_number - AND A.block_number < C.block_number - AND C.block_number - C.prev_block_number <> 1 -WHERE - COALESCE( - b.block_number, - C.block_number - ) IS NOT NULL diff --git a/models/silver/_observability/silver_observability__excluded_receipt_blocks.sql b/models/silver/_observability/silver_observability__excluded_receipt_blocks.sql deleted file mode 100644 index 867fbbc1..00000000 --- a/models/silver/_observability/silver_observability__excluded_receipt_blocks.sql +++ /dev/null @@ -1,28 +0,0 @@ -{{ config( - materialized = 'view', - tags = ['observability'] -) }} - -SELECT - 19022 AS block_number, - '0x9ed8f713b2cc6439657db52dcd2fdb9cc944915428f3c6e2a7703e242b259cb9' AS tx_hash -UNION ALL -SELECT - 45036, - '0x9ed8f713b2cc6439657db52dcd2fdb9cc944915428f3c6e2a7703e242b259cb9' -UNION ALL -SELECT - 123542, - '0xc033250c5a45f9d104fc28640071a776d146d48403cf5e95ed0015c712e26cb6' -UNION ALL -SELECT - 1135391, - '0x86f8c77cfa2b439e9b4e92a10f6c17b99fce1220edf4001e4158b57f41c576e5' -UNION ALL -SELECT - 1144468, - '0x86f8c77cfa2b439e9b4e92a10f6c17b99fce1220edf4001e4158b57f41c576e5' -UNION ALL -SELECT - 1272994, - '0x3cc27e7cc8b7a9380b2b2f6c224ea5ef06ade62a6af564a9dd0bcca92131cd4e' \ No newline at end of file diff --git a/models/silver/_observability/silver_observability__logs_completeness.sql b/models/silver/_observability/silver_observability__logs_completeness.sql deleted file mode 100644 index bf88e6f1..00000000 --- a/models/silver/_observability/silver_observability__logs_completeness.sql +++ /dev/null @@ -1,119 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -broken_blocks AS ( - SELECT - DISTINCT block_number - FROM - {{ ref("silver__receipts") }} - r - LEFT JOIN {{ ref("silver__logs") }} - l USING ( - block_number, - tx_hash - ) - JOIN block_range USING (block_number) - WHERE - l.tx_hash IS NULL - AND ARRAY_SIZE( - r.logs - ) > 0 -), -impacted_blocks AS ( - SELECT - COUNT(1) AS blocks_impacted_count, - ARRAY_AGG(block_number) within GROUP ( - ORDER BY - block_number - ) AS blocks_impacted_array - FROM - broken_blocks -) -SELECT - 'event_logs' AS test_name, - min_block, - max_block, - min_block_timestamp, - max_block_timestamp, - blocks_tested, - blocks_impacted_count, - blocks_impacted_array, - CURRENT_TIMESTAMP() AS test_timestamp -FROM - summary_stats - JOIN impacted_blocks - ON 1 = 1 diff --git a/models/silver/_observability/silver_observability__receipts_completeness.sql b/models/silver/_observability/silver_observability__receipts_completeness.sql deleted file mode 100644 index ac7e5444..00000000 --- a/models/silver/_observability/silver_observability__receipts_completeness.sql +++ /dev/null @@ -1,124 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -broken_blocks AS ( - SELECT - DISTINCT block_number - FROM - {{ ref("silver__transactions") }} - t - LEFT JOIN {{ ref("silver__receipts") }} - r USING ( - block_number, - tx_hash, - block_hash - ) - JOIN block_range USING (block_number) - WHERE - r.tx_hash IS NULL -), -impacted_blocks AS ( - SELECT - COUNT(1) AS blocks_impacted_count, - ARRAY_AGG(block_number) within GROUP ( - ORDER BY - block_number - ) AS blocks_impacted_array - FROM - broken_blocks - WHERE - block_number NOT IN ( - SELECT - block_number - FROM - {{ ref('silver_observability__excluded_receipt_blocks') }} - ) -) -SELECT - 'receipts' AS test_name, - min_block, - max_block, - min_block_timestamp, - max_block_timestamp, - blocks_tested, - blocks_impacted_count, - blocks_impacted_array, - CURRENT_TIMESTAMP() AS test_timestamp -FROM - summary_stats - JOIN impacted_blocks - ON 1 = 1 diff --git a/models/silver/_observability/silver_observability__traces_completeness.sql b/models/silver/_observability/silver_observability__traces_completeness.sql deleted file mode 100644 index cf77745a..00000000 --- a/models/silver/_observability/silver_observability__traces_completeness.sql +++ /dev/null @@ -1,119 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -broken_blocks AS ( - SELECT - DISTINCT block_number - FROM - {{ ref("silver__transactions") }} - tx - LEFT JOIN {{ source( - "optimism_gold", - "fact_traces" - ) }} - tr USING ( - block_number, - tx_hash - ) - JOIN block_range USING (block_number) - WHERE - tr.tx_hash IS NULL -), -impacted_blocks AS ( - SELECT - COUNT(1) AS blocks_impacted_count, - ARRAY_AGG(block_number) within GROUP ( - ORDER BY - block_number - ) AS blocks_impacted_array - FROM - broken_blocks -) -SELECT - 'traces' AS test_name, - min_block, - max_block, - min_block_timestamp, - max_block_timestamp, - blocks_tested, - blocks_impacted_count, - blocks_impacted_array, - CURRENT_TIMESTAMP() AS test_timestamp -FROM - summary_stats - JOIN impacted_blocks - ON 1 = 1 diff --git a/models/silver/_observability/silver_observability__transactions_completeness.sql b/models/silver/_observability/silver_observability__transactions_completeness.sql deleted file mode 100644 index d755db3c..00000000 --- a/models/silver/_observability/silver_observability__transactions_completeness.sql +++ /dev/null @@ -1,117 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -broken_blocks AS ( - SELECT - DISTINCT block_number - FROM - {{ ref("silver__confirmed_blocks") }} - b - LEFT JOIN {{ ref("silver__transactions") }} - t USING ( - block_number, - tx_hash, - block_hash - ) - JOIN block_range USING (block_number) - WHERE - t.tx_hash IS NULL -), -impacted_blocks AS ( - SELECT - COUNT(1) AS blocks_impacted_count, - ARRAY_AGG(block_number) within GROUP ( - ORDER BY - block_number - ) AS blocks_impacted_array - FROM - broken_blocks -) -SELECT - 'transactions' AS test_name, - min_block, - max_block, - min_block_timestamp, - max_block_timestamp, - blocks_tested, - blocks_impacted_count, - blocks_impacted_array, - CURRENT_TIMESTAMP() AS test_timestamp -FROM - summary_stats - JOIN impacted_blocks - ON 1 = 1 diff --git a/models/silver/abis/silver__abis.sql b/models/silver/abis/silver__abis.sql deleted file mode 100644 index 96e7e82e..00000000 --- a/models/silver/abis/silver__abis.sql +++ /dev/null @@ -1,181 +0,0 @@ -{{ config ( - materialized = "incremental", - unique_key = "contract_address", - merge_exclude_columns = ["inserted_timestamp"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(contract_address,abi_hash,bytecode), SUBSTRING(contract_address,abi_hash,bytecode)", - tags = ['abis'] -) }} - -WITH override_abis AS ( - - SELECT - contract_address, - PARSE_JSON(DATA) AS abi, - TO_TIMESTAMP_LTZ(SYSDATE()) AS _inserted_timestamp, - 'flipside' AS abi_source, - 'flipside' AS discord_username, - SHA2(abi) AS abi_hash, - 1 AS priority - FROM - {{ ref('silver__override_abis') }} - WHERE - contract_address IS NOT NULL -), -verified_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - 2 AS priority - FROM - {{ ref('silver__verified_abis') }} - WHERE - abi_source = 'opscan' - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - FROM - {{ this }} - WHERE - abi_source = 'opscan' -) -{% endif %} -), -user_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - 2 AS priority - FROM - {{ ref('silver__verified_abis') }} - WHERE - abi_source = 'user' - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - FROM - {{ this }} - WHERE - abi_source = 'user' -) -{% endif %} -), -bytecode_abis AS ( - SELECT - contract_address, - abi, - abi_hash, - 'bytecode_matched' AS abi_source, - NULL AS discord_username, - _inserted_timestamp, - 3 AS priority - FROM - {{ ref('silver__bytecode_abis') }} - WHERE - 1 = 1 - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - FROM - {{ this }} - WHERE - abi_source = 'bytecode_matched' -) -{% endif %} -), -all_abis AS ( - SELECT - contract_address, - abi AS DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - priority - FROM - override_abis - UNION - SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - priority - FROM - verified_abis - UNION - SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - priority - FROM - user_abis - UNION - SELECT - contract_address, - abi AS DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - priority - FROM - bytecode_abis -), -priority_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash, - priority - FROM - all_abis qualify(ROW_NUMBER() over(PARTITION BY contract_address - ORDER BY - priority ASC)) = 1 -) -SELECT - p.contract_address, - p.data, - p._inserted_timestamp, - p.abi_source, - p.discord_username, - p.abi_hash, - created_contract_input AS bytecode, - {{ dbt_utils.generate_surrogate_key( - ['contract_address'] - ) }} AS abis_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - priority_abis p - LEFT JOIN {{ ref('silver__created_contracts') }} - ON p.contract_address = created_contract_address diff --git a/models/silver/abis/silver__abis.yml b/models/silver/abis/silver__abis.yml deleted file mode 100644 index ad57edf6..00000000 --- a/models/silver/abis/silver__abis.yml +++ /dev/null @@ -1,8 +0,0 @@ - -version: 2 -models: - - name: silver__abis - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - CONTRACT_ADDRESS \ No newline at end of file diff --git a/models/silver/abis/silver__bytecode_abis.sql b/models/silver/abis/silver__bytecode_abis.sql deleted file mode 100644 index 32c20b4a..00000000 --- a/models/silver/abis/silver__bytecode_abis.sql +++ /dev/null @@ -1,76 +0,0 @@ -{{ config ( - materialized = "incremental", - unique_key = "contract_address", - tags = ['abis'] -) }} - -WITH contracts_with_abis AS ( - -- Identifying contracts with verified ABIs - - SELECT - created_contract_address AS contract_address - FROM - {{ ref('silver__created_contracts') }} - JOIN {{ ref('silver__verified_abis') }} A - ON A.contract_address = created_contract_address -), -contracts_without_abis AS ( - -- Contracts that are missing ABIs - SELECT - created_contract_address AS contract_address, - created_contract_input AS bytecode - FROM - {{ ref('silver__created_contracts') }} - WHERE - created_contract_address NOT IN ( - SELECT - contract_address - FROM - contracts_with_abis - ) - -{% if is_incremental() %} -AND created_contract_address NOT IN ( - SELECT - contract_address - FROM - {{ this }} -) -{% endif %} -), -unique_bytecode_abis AS ( - -- Bytecodes from created_contracts with a unique ABI - SELECT - cc.created_contract_input AS bytecode, - va.data AS abi, - va.abi_hash - FROM - {{ ref('silver__created_contracts') }} - cc - JOIN {{ ref('silver__verified_abis') }} - va - ON cc.created_contract_address = va.contract_address - GROUP BY - cc.created_contract_input, - va.data, - va.abi_hash - HAVING - COUNT( - DISTINCT va.data - ) = 1 -- Ensuring there's only one ABI per bytecode -) -- Final matching -SELECT - contract_address, - abi, - abi_hash, - -{% if is_incremental() %} -SYSDATE() -{% else %} - TO_TIMESTAMP_NTZ('2000-01-01 00:00:00') -{% endif %} - -AS _inserted_timestamp -FROM - contracts_without_abis - JOIN unique_bytecode_abis USING (bytecode) diff --git a/models/silver/abis/silver__bytecode_abis.yml b/models/silver/abis/silver__bytecode_abis.yml deleted file mode 100644 index 704e39d1..00000000 --- a/models/silver/abis/silver__bytecode_abis.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: 2 -models: - - name: silver__bytecode_abis - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - CONTRACT_ADDRESS - - ABI_HASH \ No newline at end of file diff --git a/models/silver/abis/silver__complete_event_abis.sql b/models/silver/abis/silver__complete_event_abis.sql deleted file mode 100644 index 32914e3d..00000000 --- a/models/silver/abis/silver__complete_event_abis.sql +++ /dev/null @@ -1,216 +0,0 @@ -{{ config ( - materialized = 'incremental', - unique_key = ['parent_contract_address','event_signature','start_block'], - merge_exclude_columns = ["inserted_timestamp"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['abis'] -) }} - -WITH new_abis AS ( - - SELECT - DISTINCT contract_address - FROM - {{ ref('silver__flat_event_abis') }} - -{% if is_incremental() %} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '12 hours' - FROM - {{ this }} - ) -{% endif %} -), -proxies AS ( - SELECT - p0.created_block, - p0.proxy_created_block, - p0.contract_address, - p0.proxy_address, - p0.start_block, - p0._id, - p0._inserted_timestamp - FROM - {{ ref('silver__proxies') }} - p0 - JOIN new_abis na0 - ON p0.contract_address = na0.contract_address - UNION - SELECT - p1.created_block, - p1.proxy_created_block, - p1.contract_address, - p1.proxy_address, - p1.start_block, - p1._id, - p1._inserted_timestamp - FROM - {{ ref('silver__proxies') }} - p1 - JOIN new_abis na1 - ON p1.proxy_address = na1.contract_address -), -all_relevant_contracts AS ( - SELECT - DISTINCT contract_address - FROM - proxies - UNION - SELECT - DISTINCT proxy_address AS contract_address - FROM - proxies - UNION - SELECT - contract_address - FROM - new_abis -), -flat_abis AS ( - SELECT - contract_address, - event_name, - abi, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp - FROM - {{ ref('silver__flat_event_abis') }} - JOIN all_relevant_contracts USING (contract_address) -), -base AS ( - SELECT - ea.contract_address, - event_name, - abi, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - ea._inserted_timestamp, - pb._inserted_timestamp AS proxy_inserted_timestamp, - pb.start_block, - pb.proxy_created_block, - pb.contract_address AS base_contract_address, - 1 AS priority - FROM - flat_abis ea - JOIN proxies pb - ON ea.contract_address = pb.proxy_address - UNION ALL - SELECT - eab.contract_address, - event_name, - abi, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - eab._inserted_timestamp, - pbb._inserted_timestamp AS proxy_inserted_timestamp, - pbb.created_block AS start_block, - pbb.proxy_created_block, - pbb.contract_address AS base_contract_address, - 2 AS priority - FROM - flat_abis eab - JOIN ( - SELECT - DISTINCT contract_address, - created_block, - proxy_created_block, - _inserted_timestamp - FROM - proxies - ) pbb - ON eab.contract_address = pbb.contract_address - UNION ALL - SELECT - contract_address, - event_name, - abi, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp, - NULL AS proxy_inserted_timestamp, - 0 AS start_block, - NULL AS proxy_created_block, - contract_address AS base_contract_address, - 3 AS priority - FROM - flat_abis eac - WHERE - contract_address NOT IN ( - SELECT - DISTINCT contract_address - FROM - proxies - ) -), -new_records AS ( - SELECT - base_contract_address AS parent_contract_address, - event_name, - abi, - start_block, - proxy_created_block, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp, - proxy_inserted_timestamp - FROM - base qualify ROW_NUMBER() over ( - PARTITION BY parent_contract_address, - NAME, - event_type, - event_signature, - start_block - ORDER BY - priority ASC, - _inserted_timestamp DESC, - proxy_created_block DESC nulls last, - proxy_inserted_timestamp DESC nulls last - ) = 1 -) -SELECT - parent_contract_address, - event_name, - abi, - start_block, - proxy_created_block, - simple_event_name, - event_signature, - IFNULL(LEAD(start_block) over (PARTITION BY parent_contract_address, event_signature -ORDER BY - start_block) -1, 1e18) AS end_block, - _inserted_timestamp, - proxy_inserted_timestamp, - SYSDATE() AS _updated_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['parent_contract_address','event_signature','start_block'] - ) }} AS complete_event_abis_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - new_records qualify ROW_NUMBER() over ( - PARTITION BY parent_contract_address, - event_name, - event_signature, - start_block - ORDER BY - _inserted_timestamp DESC - ) = 1 \ No newline at end of file diff --git a/models/silver/abis/silver__complete_event_abis.yml b/models/silver/abis/silver__complete_event_abis.yml deleted file mode 100644 index 9004009f..00000000 --- a/models/silver/abis/silver__complete_event_abis.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: 2 -models: - - name: silver__complete_event_abis - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - PARENT_CONTRACT_ADDRESS - - EVENT_SIGNATURE - - START_BLOCK \ No newline at end of file diff --git a/models/silver/abis/silver__flat_event_abis.sql b/models/silver/abis/silver__flat_event_abis.sql deleted file mode 100644 index da102b90..00000000 --- a/models/silver/abis/silver__flat_event_abis.sql +++ /dev/null @@ -1,112 +0,0 @@ -{{ config ( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'contract_address', - cluster_by = '_inserted_timestamp::date', - tags = ['abis'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY (contract_address)" -) }} - -WITH abi_base AS ( - - SELECT - contract_address, - DATA, - _inserted_timestamp - FROM - {{ ref('silver__abis') }} - -{% if is_incremental() %} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '24 hours' - FROM - {{ this }} - ) -{% endif %} -), -flat_abi AS ( - SELECT - contract_address, - _inserted_timestamp, - DATA, - VALUE :inputs AS inputs, - VALUE :payable :: BOOLEAN AS payable, - VALUE :stateMutability :: STRING AS stateMutability, - VALUE :type :: STRING AS TYPE, - VALUE :anonymous :: BOOLEAN AS anonymous, - VALUE :name :: STRING AS NAME - FROM - abi_base, - LATERAL FLATTEN ( - input => DATA - ) - WHERE - TYPE = 'event' qualify ROW_NUMBER() over ( - PARTITION BY contract_address, - NAME, - inputs - ORDER BY - LENGTH(inputs) - ) = 1 -), -event_types AS ( - SELECT - contract_address, - _inserted_timestamp, - inputs, - anonymous, - NAME, - ARRAY_AGG( - VALUE :type :: STRING - ) AS event_type - FROM - flat_abi, - LATERAL FLATTEN ( - input => inputs - ) - GROUP BY - contract_address, - _inserted_timestamp, - inputs, - anonymous, - NAME -), -apply_udfs AS ( - SELECT - contract_address, - NAME AS event_name, - PARSE_JSON( - OBJECT_CONSTRUCT( - 'anonymous', - anonymous, - 'inputs', - inputs, - 'name', - NAME, - 'type', - 'event' - ) :: STRING - ) AS abi, - utils.udf_evm_text_signature(abi) AS simple_event_name, - utils.udf_keccak256(simple_event_name) AS event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp - FROM - event_types -) -SELECT - contract_address, - event_name, - abi, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp -FROM - apply_udfs diff --git a/models/silver/abis/silver__override_abis.sql b/models/silver/abis/silver__override_abis.sql deleted file mode 100644 index 88b8439d..00000000 --- a/models/silver/abis/silver__override_abis.sql +++ /dev/null @@ -1,8 +0,0 @@ -{{ config( - materialized = 'view', - tags = ['abis'] -) }} - -SELECT - NULL AS contract_address, - NULL AS DATA diff --git a/models/silver/abis/silver__proxies.sql b/models/silver/abis/silver__proxies.sql deleted file mode 100644 index a328b240..00000000 --- a/models/silver/abis/silver__proxies.sql +++ /dev/null @@ -1,104 +0,0 @@ -{{ config ( - materialized = 'incremental', - unique_key = ['contract_address','proxy_address'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['abis'] -) }} - -WITH base AS ( - - SELECT - from_address, - to_address, - MIN(block_number) AS start_block, - MAX(modified_timestamp) AS _inserted_timestamp - FROM - {{ ref('core__fact_traces') }} - WHERE - TYPE = 'DELEGATECALL' - AND trace_succeeded - AND tx_succeeded - AND from_address != to_address -- exclude self-calls - -{% if is_incremental() %} -AND modified_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '24 hours' - FROM - {{ this }} -) -{% endif %} -GROUP BY - from_address, - to_address -), -create_id AS ( - SELECT - from_address AS contract_address, - to_address AS proxy_address, - start_block, - CONCAT( - from_address, - '-', - to_address - ) AS _id, - _inserted_timestamp - FROM - base -), -heal AS ( - SELECT - contract_address, - proxy_address, - start_block, - _id, - _inserted_timestamp - FROM - create_id - -{% if is_incremental() %} -UNION ALL -SELECT - contract_address, - proxy_address, - start_block, - _id, - _inserted_timestamp -FROM - {{ this }} - JOIN create_id USING ( - contract_address, - proxy_address - ) -{% endif %} -), -FINAL AS ( - SELECT - contract_address, - proxy_address, - start_block, - _id, - _inserted_timestamp - FROM - heal qualify ROW_NUMBER() over ( - PARTITION BY contract_address, - proxy_address - ORDER BY - start_block ASC - ) = 1 -) -SELECT - f.contract_address, - f.proxy_address, - f.start_block, - f._id, - f._inserted_timestamp, - C.block_number AS created_block, - p.block_number AS proxy_created_block -FROM - FINAL f - JOIN {{ ref('silver__created_contracts') }} C - ON f.contract_address = C.created_contract_address - JOIN {{ ref('silver__created_contracts') }} - p - ON f.proxy_address = p.created_contract_address diff --git a/models/silver/abis/silver__proxies.yml b/models/silver/abis/silver__proxies.yml deleted file mode 100644 index da5fa8f0..00000000 --- a/models/silver/abis/silver__proxies.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -models: - - name: silver__proxies - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _ID \ No newline at end of file diff --git a/models/silver/abis/silver__user_verified_abis.sql b/models/silver/abis/silver__user_verified_abis.sql deleted file mode 100644 index f2c628ba..00000000 --- a/models/silver/abis/silver__user_verified_abis.sql +++ /dev/null @@ -1,550 +0,0 @@ -{{ config ( - materialized = "incremental", - unique_key = "id", - tags = ['abis'] -) }} - -WITH base AS ( - - SELECT - contract_address, - abi, - PARSE_JSON(abi) AS DATA, - SHA2(PARSE_JSON(abi)) AS abi_hash, - discord_username, - _inserted_timestamp - FROM - {{ source( - "crosschain_public", - "user_abis" - ) }} - WHERE - blockchain = 'optimism' - AND NOT duplicate_abi - -{% if is_incremental() %} -AND contract_address NOT IN ( - SELECT - contract_address - FROM - {{ this }} -) -AND _inserted_timestamp > ( - SELECT - COALESCE( - MAX( - _inserted_timestamp - ), - '1970-01-01' - ) - FROM - {{ this }} -) -{% endif %} -ORDER BY - _inserted_timestamp ASC -LIMIT - 10 -), flat_event_abi AS ( - SELECT - contract_address, - _inserted_timestamp, - DATA, - VALUE :inputs AS inputs, - VALUE :payable :: BOOLEAN AS payable, - VALUE :stateMutability :: STRING AS stateMutability, - VALUE :type :: STRING AS TYPE, - VALUE :anonymous :: BOOLEAN AS anonymous, - VALUE :name :: STRING AS NAME - FROM - base, - LATERAL FLATTEN ( - input => DATA - ) - WHERE - TYPE = 'event' qualify ROW_NUMBER() over ( - PARTITION BY contract_address, - NAME, - inputs - ORDER BY - LENGTH(inputs) - ) = 1 -), -event_types AS ( - SELECT - contract_address, - _inserted_timestamp, - inputs, - anonymous, - NAME, - ARRAY_AGG( - VALUE :type :: STRING - ) AS event_type - FROM - flat_event_abi, - LATERAL FLATTEN ( - input => inputs - ) - GROUP BY - contract_address, - _inserted_timestamp, - inputs, - anonymous, - NAME -), -apply_event_udfs AS ( - SELECT - contract_address, - NAME AS event_name, - PARSE_JSON( - OBJECT_CONSTRUCT( - 'anonymous', - anonymous, - 'inputs', - inputs, - 'name', - NAME, - 'type', - 'event' - ) :: STRING - ) AS abi, - utils.udf_evm_text_signature(abi) AS simple_event_name, - utils.udf_keccak256(simple_event_name) AS event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp - FROM - event_types -), -final_flat_event_abis AS ( - SELECT - contract_address, - event_name, - abi, - simple_event_name, - event_signature, - NAME, - inputs, - event_type, - _inserted_timestamp - FROM - apply_event_udfs -), -flat_function_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - VALUE :inputs AS inputs, - VALUE :outputs AS outputs, - VALUE :payable :: BOOLEAN AS payable, - VALUE :stateMutability :: STRING AS stateMutability, - VALUE :type :: STRING AS TYPE, - VALUE :name :: STRING AS NAME - FROM - base, - LATERAL FLATTEN ( - input => DATA - ) - WHERE - TYPE = 'function' -), -udf_function_abis AS ( - SELECT - *, - PARSE_JSON( - object_construct_keep_null( - 'inputs', - IFNULL( - inputs, - [] - ), - 'outputs', - IFNULL( - outputs, - [] - ), - 'name', - NAME, - 'type', - 'function' - ) :: STRING - ) AS abi, - utils.udf_evm_text_signature(abi) AS simple_function_name, - utils.udf_keccak256(simple_function_name) AS function_signature - FROM - flat_function_abis qualify ROW_NUMBER() over ( - PARTITION BY contract_address, - function_signature - ORDER BY - _inserted_timestamp DESC - ) = 1 -), -flat_inputs AS ( - SELECT - contract_address, - inputs, - NAME, - simple_function_name, - function_signature, - ARRAY_AGG( - VALUE :type :: STRING - ) AS inputs_type - FROM - udf_function_abis, - LATERAL FLATTEN ( - input => inputs - ) - GROUP BY - ALL -), -fill_missing_input_names AS ( - SELECT - contract_address, - NAME, - inputs_type, - simple_function_name, - function_signature, - VALUE :internalType :: STRING AS internalType, - VALUE :type :: STRING AS TYPE, - CASE - WHEN VALUE :name :: STRING = '' THEN CONCAT('input_', ROW_NUMBER() over (PARTITION BY contract_address, function_signature - ORDER BY - INDEX ASC) :: STRING) - ELSE VALUE :name :: STRING - END AS name_fixed, - inputs, - INDEX, - VALUE :components AS components - FROM - flat_inputs, - LATERAL FLATTEN ( - input => inputs - ) -), -final_flat_inputs AS ( - SELECT - contract_address, - NAME, - inputs_type, - simple_function_name, - function_signature, - ARRAY_AGG( - OBJECT_CONSTRUCT( - 'internalType', - internalType, - 'name', - name_fixed, - 'type', - TYPE, - 'components', - components - ) - ) within GROUP ( - ORDER BY - INDEX - ) AS inputs - FROM - fill_missing_input_names - GROUP BY - ALL -), -flat_outputs AS ( - SELECT - contract_address, - outputs, - simple_function_name, - function_signature, - NAME, - ARRAY_AGG( - VALUE :type :: STRING - ) AS outputs_type - FROM - udf_function_abis, - LATERAL FLATTEN ( - input => outputs - ) - GROUP BY - ALL -), -fill_missing_output_names AS ( - SELECT - contract_address, - NAME, - outputs_type, - simple_function_name, - function_signature, - VALUE :internalType :: STRING AS internalType, - VALUE :type :: STRING AS TYPE, - CASE - WHEN VALUE :name :: STRING = '' THEN CONCAT('output_', ROW_NUMBER() over (PARTITION BY contract_address, function_signature - ORDER BY - INDEX ASC) :: STRING) - ELSE VALUE :name :: STRING - END AS name_fixed, - outputs, - INDEX, - VALUE :components AS components - FROM - flat_outputs, - LATERAL FLATTEN ( - input => outputs - ) -), -final_flat_outputs AS ( - SELECT - contract_address, - NAME, - outputs_type, - simple_function_name, - function_signature, - ARRAY_AGG( - OBJECT_CONSTRUCT( - 'internalType', - internalType, - 'name', - name_fixed, - 'type', - TYPE, - 'components', - components - ) - ) within GROUP ( - ORDER BY - INDEX - ) AS outputs - FROM - fill_missing_output_names - GROUP BY - ALL -), -all_contracts AS ( - SELECT - A.contract_address, - A.name AS function_name, - i.inputs, - o.outputs, - i.inputs_type, - o.outputs_type, - A._inserted_timestamp, - A.function_signature, - A.simple_function_name - FROM - udf_function_abis A - LEFT JOIN final_flat_inputs i - ON A.contract_address = i.contract_address - AND A.function_signature = i.function_signature - LEFT JOIN final_flat_outputs o - ON A.contract_address = o.contract_address - AND A.function_signature = o.function_signature -), -apply_function_udfs AS ( - SELECT - contract_address, - function_name, - PARSE_JSON( - object_construct_keep_null( - 'inputs', - IFNULL( - inputs, - [] - ), - 'outputs', - IFNULL( - outputs, - [] - ), - 'name', - function_name, - 'type', - 'function' - ) :: STRING - ) AS abi, - simple_function_name, - function_signature, - inputs, - outputs, - inputs_type, - outputs_type, - _inserted_timestamp - FROM - all_contracts -), -final_function_abis AS ( - SELECT - contract_address, - function_name, - abi, - simple_function_name, - function_signature, - inputs, - outputs, - inputs_type, - outputs_type, - _inserted_timestamp - FROM - apply_function_udfs -), -new_abis AS ( - SELECT - DISTINCT contract_address - FROM - base -), -contracts AS ( - SELECT - contract_address - FROM - {{ ref('silver__proxies') }} - JOIN new_abis USING (contract_address) -), -proxies AS ( - SELECT - p.proxy_address, - p.contract_address - FROM - {{ ref('silver__proxies') }} - p - JOIN new_abis n - ON p.proxy_address = n.contract_address -), -final_groupings AS ( - SELECT - b.contract_address AS address, - C.contract_address, - proxy_address, - CASE - WHEN C.contract_address IS NOT NULL - AND proxy_address IS NOT NULL THEN 'contract' - WHEN C.contract_address IS NOT NULL THEN 'contract' - WHEN proxy_address IS NOT NULL THEN 'proxy' - WHEN C.contract_address IS NULL - AND proxy_address IS NULL THEN 'contract' - END AS TYPE, - p.contract_address AS proxy_parent, - CASE - WHEN TYPE = 'contract' THEN address - ELSE proxy_parent - END AS final_address - FROM - base b - LEFT JOIN ( - SELECT - DISTINCT contract_address - FROM - contracts - ) C - ON b.contract_address = C.contract_address - LEFT JOIN ( - SELECT - DISTINCT proxy_address, - contract_address - FROM - proxies - ) p - ON b.contract_address = proxy_address -), -identified_addresses AS ( - SELECT - DISTINCT address AS base_address, - final_address AS contract_address - FROM - final_groupings -), -function_mapping AS ( - SELECT - ia.base_address, - ia.contract_address, - LEFT( - function_signature, - 10 - ) AS function_sig - FROM - identified_addresses ia - JOIN final_function_abis ffa - ON ia.base_address = ffa.contract_address -), -valid_traces AS ( - SELECT - DISTINCT base_address - FROM - ( - SELECT - base_address - FROM - {{ ref('core__fact_traces') }} - JOIN function_mapping - ON function_sig = LEFT( - input, - 10 - ) - AND IFF( - TYPE = 'DELEGATECALL', - from_address, - to_address - ) = contract_address - WHERE - block_timestamp > DATEADD('month', -12, SYSDATE()) - LIMIT - 50000) - ), event_mapping AS ( - SELECT - ia.base_address, - ia.contract_address, - event_signature - FROM - identified_addresses ia - JOIN final_flat_event_abis fea - ON ia.base_address = fea.contract_address - ), - valid_logs AS ( - SELECT - DISTINCT base_address - FROM - ( - SELECT - base_address - FROM - {{ ref('core__fact_event_logs') }} - l - JOIN event_mapping ia - ON ia.contract_address = l.contract_address - AND event_signature = topics [0] :: STRING - WHERE - block_timestamp > DATEADD('month', -12, SYSDATE()) - LIMIT - 50000) - ), all_valid_addresses AS ( - SELECT - base_address - FROM - valid_traces - UNION - SELECT - base_address - FROM - valid_logs - ) - SELECT - contract_address, - abi, - discord_username, - _inserted_timestamp, - abi_hash, - CONCAT( - contract_address, - '-', - abi_hash - ) AS id - FROM - base - WHERE - contract_address IN ( - SELECT - base_address - FROM - all_valid_addresses - ) qualify(ROW_NUMBER() over(PARTITION BY contract_address - ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/abis/silver__user_verified_abis.yml b/models/silver/abis/silver__user_verified_abis.yml deleted file mode 100644 index 912a5c86..00000000 --- a/models/silver/abis/silver__user_verified_abis.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -models: - - name: silver__user_verified_abis - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - ID \ No newline at end of file diff --git a/models/silver/abis/silver__verified_abis.sql b/models/silver/abis/silver__verified_abis.sql deleted file mode 100644 index 898179e8..00000000 --- a/models/silver/abis/silver__verified_abis.sql +++ /dev/null @@ -1,108 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = "contract_address", - tags = ['abis'] -) }} - -WITH base AS ( - - SELECT - contract_address, - PARSE_JSON( - abi_data :data :result - ) AS DATA, - _inserted_timestamp - FROM - {{ ref('bronze_api__contract_abis') }} - WHERE - abi_data :data :message :: STRING = 'OK' - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - COALESCE( - MAX( - _inserted_timestamp - ), - '1970-01-01' - ) - FROM - {{ this }} -) -{% endif %} -), -opscan_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - 'opscan' AS abi_source - FROM - base -), -user_abis AS ( - SELECT - contract_address, - abi, - discord_username, - _inserted_timestamp, - 'user' AS abi_source, - abi_hash - FROM - {{ ref('silver__user_verified_abis') }} - -{% if is_incremental() %} -WHERE - _inserted_timestamp >= ( - SELECT - COALESCE( - MAX( - _inserted_timestamp - ), - '1970-01-01' - ) - FROM - {{ this }} - WHERE - abi_source = 'user' - ) - AND contract_address NOT IN ( - SELECT - contract_address - FROM - {{ this }} - ) -{% endif %} -), -all_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - NULL AS discord_username, - SHA2(DATA) AS abi_hash - FROM - opscan_abis - UNION - SELECT - contract_address, - PARSE_JSON(abi) AS DATA, - _inserted_timestamp, - 'user' AS abi_source, - discord_username, - abi_hash - FROM - user_abis -) -SELECT - contract_address, - DATA, - _inserted_timestamp, - abi_source, - discord_username, - abi_hash -FROM - all_abis qualify(ROW_NUMBER() over(PARTITION BY contract_address -ORDER BY - _INSERTED_TIMESTAMP DESC)) = 1 diff --git a/models/silver/abis/silver__verified_abis.yml b/models/silver/abis/silver__verified_abis.yml deleted file mode 100644 index 2f623e98..00000000 --- a/models/silver/abis/silver__verified_abis.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -models: - - name: silver__verified_abis - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - CONTRACT_ADDRESS \ No newline at end of file diff --git a/models/silver/core/silver__blocks.sql b/models/silver/core/silver__blocks.sql deleted file mode 100644 index f412a3b0..00000000 --- a/models/silver/core/silver__blocks.sql +++ /dev/null @@ -1,78 +0,0 @@ --- depends_on: {{ ref('bronze__blocks') }} -{{ config( - materialized = 'incremental', - unique_key = "block_number", - cluster_by = "block_timestamp::date", - tags = ['core','non_realtime'], - merge_exclude_columns = ["inserted_timestamp"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(hash,parent_hash,receipts_root,sha3_uncles,state_root,transactions_root,withdrawals_root)", - full_refresh = false -) }} - -SELECT - block_number, - utils.udf_hex_to_int( - DATA :baseFeePerGas :: STRING - ) :: INT AS base_fee_per_gas, - utils.udf_hex_to_int( - DATA :difficulty :: STRING - ) :: INT AS difficulty, - DATA :extraData :: STRING AS extra_data, - utils.udf_hex_to_int( - DATA :gasLimit :: STRING - ) :: INT AS gas_limit, - utils.udf_hex_to_int( - DATA :gasUsed :: STRING - ) :: INT AS gas_used, - DATA :hash :: STRING AS HASH, - DATA :logsBloom :: STRING AS logs_bloom, - DATA :miner :: STRING AS miner, - DATA :mixHash :: STRING AS mixHash, - utils.udf_hex_to_int( - DATA :nonce :: STRING - ) :: INT AS nonce, - utils.udf_hex_to_int( - DATA :number :: STRING - ) :: INT AS NUMBER, - DATA :parentHash :: STRING AS parent_hash, - DATA :receiptsRoot :: STRING AS receipts_root, - DATA :sha3Uncles :: STRING AS sha3_uncles, - utils.udf_hex_to_int( - DATA :size :: STRING - ) :: INT AS SIZE, - DATA :stateRoot :: STRING AS state_root, - utils.udf_hex_to_int( - DATA :timestamp :: STRING - ) :: TIMESTAMP AS block_timestamp, - utils.udf_hex_to_int( - DATA :totalDifficulty :: STRING - ) :: INT AS total_difficulty, - DATA :transactionsRoot :: STRING AS transactions_root, - DATA :uncles AS uncles, - DATA :withdrawals AS withdrawals, - DATA :withdrawalsRoot :: STRING AS withdrawals_root, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['block_number'] - ) }} AS blocks_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - -{% if is_incremental() %} -{{ ref('bronze__blocks') }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) -{% else %} - {{ ref('bronze__blocks_fr') }} -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY block_number -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/core/silver__confirmed_blocks.sql b/models/silver/core/silver__confirmed_blocks.sql deleted file mode 100644 index 727c5ca8..00000000 --- a/models/silver/core/silver__confirmed_blocks.sql +++ /dev/null @@ -1,51 +0,0 @@ --- depends_on: {{ ref('bronze__confirm_blocks') }} -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = "round(block_number,-3)", - full_refresh = false, - tags = ['non_realtime'] -) }} - -WITH base AS ( - - SELECT - block_number, - DATA :result :hash :: STRING AS block_hash, - DATA :result :transactions txs, - _inserted_timestamp - FROM - -{% if is_incremental() %} -{{ ref('bronze__confirm_blocks') }} -WHERE - _inserted_timestamp >= ( - SELECT - IFNULL( - MAX( - _inserted_timestamp - ), - '1970-01-01' :: TIMESTAMP - ) _inserted_timestamp - FROM - {{ this }} - ) -{% else %} - {{ ref('bronze__confirm_blocks_fr') }} -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY block_number -ORDER BY - _inserted_timestamp DESC)) = 1 -) -SELECT - block_number, - block_hash, - VALUE :: STRING AS tx_hash, - _inserted_timestamp -FROM - base, - LATERAL FLATTEN ( - input => txs - ) diff --git a/models/silver/core/silver__contracts.sql b/models/silver/core/silver__contracts.sql deleted file mode 100644 index 8db4170f..00000000 --- a/models/silver/core/silver__contracts.sql +++ /dev/null @@ -1,103 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'contract_address', - merge_exclude_columns = ["inserted_timestamp"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(contract_address, token_symbol, token_name), SUBSTRING(contract_address, token_symbol, token_name)", - tags = ['non_realtime'] -) }} - -WITH base_metadata AS ( - - SELECT - contract_address, - block_number, - function_sig AS function_signature, - read_result AS read_output, - _inserted_timestamp - FROM - {{ ref('bronze_api__token_reads') }} - WHERE - read_result IS NOT NULL - AND read_result <> '0x' - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - FROM - {{ this }} -) -{% endif %} -), -token_names AS ( - SELECT - contract_address, - block_number, - function_signature, - read_output, - utils.udf_hex_to_string(SUBSTR(read_output,(64 * 2 + 3), len(read_output))) AS token_name - FROM - base_metadata - WHERE - function_signature = '0x06fdde03' - AND token_name IS NOT NULL), - token_symbols AS ( - SELECT - contract_address, - block_number, - function_signature, - read_output, - utils.udf_hex_to_string(SUBSTR(read_output,(64 * 2 + 3), len(read_output))) AS token_symbol - FROM - base_metadata - WHERE - function_signature = '0x95d89b41' - AND token_symbol IS NOT NULL), - token_decimals AS ( - SELECT - contract_address, - utils.udf_hex_to_int( - read_output :: STRING - ) AS token_decimals, - LENGTH(token_decimals) AS dec_length - FROM - base_metadata - WHERE - function_signature = '0x313ce567' - AND read_output IS NOT NULL - AND read_output <> '0x' - ), - contracts AS ( - SELECT - contract_address, - MAX(_inserted_timestamp) AS _inserted_timestamp - FROM - base_metadata - GROUP BY - 1 - ) - SELECT - c1.contract_address AS contract_address, - token_name, - token_decimals :: INTEGER AS token_decimals, - token_symbol, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['c1.contract_address'] - ) }} AS contracts_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id - FROM - contracts c1 - LEFT JOIN token_names - ON c1.contract_address = token_names.contract_address - LEFT JOIN token_symbols - ON c1.contract_address = token_symbols.contract_address - LEFT JOIN token_decimals - ON c1.contract_address = token_decimals.contract_address - AND dec_length < 3 qualify(ROW_NUMBER() over(PARTITION BY c1.contract_address - ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/core/silver__contracts.yml b/models/silver/core/silver__contracts.yml deleted file mode 100644 index 8097422b..00000000 --- a/models/silver/core/silver__contracts.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 2 -models: - - name: silver__contracts - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - CONTRACT_ADDRESS - columns: - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ diff --git a/models/silver/core/silver__created_contracts.sql b/models/silver/core/silver__created_contracts.sql deleted file mode 100644 index f1818daf..00000000 --- a/models/silver/core/silver__created_contracts.sql +++ /dev/null @@ -1,44 +0,0 @@ -{{ config ( - materialized = "incremental", - unique_key = "created_contract_address", - merge_exclude_columns = ["inserted_timestamp"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(block_timestamp, tx_hash, created_contract_address, creator_address), SUBSTRING(created_contract_address, creator_address)", - tags = ['non_realtime'] -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - to_address AS created_contract_address, - from_address AS creator_address, - input AS created_contract_input, - modified_timestamp AS _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['to_address'] - ) }} AS created_contracts_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {{ ref('core__fact_traces') }} -WHERE - TYPE ILIKE 'create%' - AND to_address IS NOT NULL - AND input IS NOT NULL - AND input != '0x' - AND tx_succeeded - AND trace_succeeded - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '24 hours' - FROM - {{ this }} -) -{% endif %} - -qualify(ROW_NUMBER() over(PARTITION BY created_contract_address -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/core/silver__created_contracts.yml b/models/silver/core/silver__created_contracts.yml deleted file mode 100644 index ed609833..00000000 --- a/models/silver/core/silver__created_contracts.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: 2 -models: - - name: silver__created_contracts - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - created_contract_address - columns: - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ - \ No newline at end of file diff --git a/models/silver/core/silver__decoded_logs.sql b/models/silver/core/silver__decoded_logs.sql deleted file mode 100644 index 5b6c1462..00000000 --- a/models/silver/core/silver__decoded_logs.sql +++ /dev/null @@ -1,239 +0,0 @@ --- depends_on: {{ ref('bronze__decoded_logs') }} -{{ config ( - materialized = "incremental", - unique_key = ['block_number', 'event_index'], - cluster_by = "block_timestamp::date", - incremental_predicates = ["dynamic_range", "block_number"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - merge_exclude_columns = ["inserted_timestamp"], - full_refresh = false, - tags = ['decoded_logs','reorg'] -) }} - -WITH base_data AS ( - - SELECT - block_number :: INTEGER AS block_number, - SPLIT( - id, - '-' - ) [0] :: STRING AS tx_hash, - SPLIT( - id, - '-' - ) [1] :: INTEGER AS event_index, - DATA :name :: STRING AS event_name, - LOWER( - DATA :address :: STRING - ) :: STRING AS contract_address, - DATA AS decoded_data, - id :: STRING AS _log_id, - TO_TIMESTAMP_NTZ(_inserted_timestamp) AS _inserted_timestamp - FROM - -{% if is_incremental() %} -{{ ref('bronze__decoded_logs') }} -WHERE - TO_TIMESTAMP_NTZ(_inserted_timestamp) >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '2 hours' - FROM - {{ this }} - ) - AND DATA NOT ILIKE '%Event topic is not present in given ABI%' -{% else %} - {{ ref('bronze__decoded_logs_fr') }} -WHERE - _partition_by_block_number <= 105235063 --bedrock - AND DATA NOT ILIKE '%Event topic is not present in given ABI%' -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY block_number, event_index -ORDER BY - _inserted_timestamp DESC, _partition_by_created_date DESC)) = 1 -), -transformed_logs AS ( - SELECT - block_number, - tx_hash, - event_index, - contract_address, - event_name, - decoded_data, - _inserted_timestamp, - _log_id, - utils.udf_transform_logs(decoded_data) AS transformed - FROM - base_data -), -FINAL AS ( - SELECT - b.tx_hash, - b.block_number, - b.event_index, - b.event_name, - b.contract_address, - b.decoded_data, - transformed, - b._log_id, - b._inserted_timestamp, - OBJECT_AGG( - DISTINCT CASE - WHEN v.value :name = '' THEN CONCAT( - 'anonymous_', - v.index - ) - ELSE v.value :name - END, - v.value :value - ) AS decoded_flat - FROM - transformed_logs b, - LATERAL FLATTEN( - input => transformed :data - ) v - GROUP BY - b.tx_hash, - b.block_number, - b.event_index, - b.event_name, - b.contract_address, - b.decoded_data, - transformed, - b._log_id, - b._inserted_timestamp -), -new_records AS ( - SELECT - b.tx_hash, - b.block_number, - b.event_index, - b.event_name, - b.contract_address, - b.decoded_data, - b.transformed, - b._log_id, - b._inserted_timestamp, - b.decoded_flat, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - topics, - DATA, - event_removed :: STRING AS event_removed, - tx_status, - CASE - WHEN block_timestamp IS NULL THEN TRUE - ELSE FALSE - END AS is_pending - FROM - FINAL b - LEFT JOIN {{ ref('silver__logs') }} USING ( - block_number, - _log_id - ) -) - -{% if is_incremental() %}, -missing_data AS ( - SELECT - t.tx_hash, - t.block_number, - t.event_index, - t.event_name, - t.contract_address, - t.decoded_data, - t.transformed, - t._log_id, - GREATEST( - TO_TIMESTAMP_NTZ( - t._inserted_timestamp - ), - TO_TIMESTAMP_NTZ( - l._inserted_timestamp - ) - ) AS _inserted_timestamp, - t.decoded_flat, - l.block_timestamp, - l.origin_function_signature, - l.origin_from_address, - l.origin_to_address, - l.topics, - l.data, - l.event_removed :: STRING AS event_removed, - l.tx_status, - FALSE AS is_pending - FROM - {{ this }} - t - INNER JOIN {{ ref('silver__logs') }} - l USING ( - block_number, - _log_id - ) - WHERE - t.is_pending - AND l.block_timestamp IS NOT NULL -) -{% endif %} -SELECT - tx_hash, - block_number, - event_index, - event_name, - contract_address, - decoded_data, - transformed, - _log_id, - _inserted_timestamp, - decoded_flat, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - topics, - DATA, - event_removed, - tx_status, - is_pending, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} AS decoded_logs_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - new_records - -{% if is_incremental() %} -UNION -SELECT - tx_hash, - block_number, - event_index, - event_name, - contract_address, - decoded_data, - transformed, - _log_id, - _inserted_timestamp, - decoded_flat, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - topics, - DATA, - event_removed, - tx_status, - is_pending, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} AS decoded_logs_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - missing_data -{% endif %} diff --git a/models/silver/core/silver__logs.sql b/models/silver/core/silver__logs.sql deleted file mode 100644 index cea654a7..00000000 --- a/models/silver/core/silver__logs.sql +++ /dev/null @@ -1,195 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = "block_timestamp::date, _inserted_timestamp::date", - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['core','non_realtime'], - full_refresh = false -) }} - -WITH base AS ( - - SELECT - block_number, - tx_hash, - from_address AS origin_from_address, - to_address AS origin_to_address, - tx_status, - {# position AS tx_position, --new column #} - logs, - _inserted_timestamp - FROM - {{ ref('silver__receipts') }} - WHERE - ARRAY_SIZE(logs) > 0 - -{% if is_incremental() %} -AND _INSERTED_TIMESTAMP >= ( - SELECT - MAX(_INSERTED_TIMESTAMP) _INSERTED_TIMESTAMP - FROM - {{ this }} -) -{% endif %} -), -flat_logs AS ( - SELECT - block_number, - tx_hash, - origin_from_address, - origin_to_address, - tx_status, - {# tx_position, #} - VALUE :address :: STRING AS contract_address, - VALUE :blockHash :: STRING AS block_hash, - VALUE :data :: STRING AS DATA, - utils.udf_hex_to_int( - VALUE :logIndex :: STRING - ) :: INT AS event_index, - VALUE :removed :: BOOLEAN AS event_removed, - VALUE :topics AS topics, - _inserted_timestamp - FROM - base, - LATERAL FLATTEN( - input => logs - ) -), -new_records AS ( - SELECT - l.block_number, - txs.block_timestamp, - l.tx_hash, - l.origin_from_address, - l.origin_to_address, - txs.origin_function_signature, - l.tx_status, - {# l.tx_position, #} - l.contract_address, - l.block_hash, - l.data, - l.event_index, - l.event_removed, - l.topics, - l._inserted_timestamp, - CASE - WHEN txs.block_timestamp IS NULL - OR txs.origin_function_signature IS NULL THEN TRUE - ELSE FALSE - END AS is_pending, - CONCAT( - l.tx_hash :: STRING, - '-', - l.event_index :: STRING - ) AS _log_id - FROM - flat_logs l - LEFT OUTER JOIN {{ ref('silver__transactions') }} - txs - ON l.block_number = txs.block_number - AND l.tx_hash = txs.tx_hash - -{% if is_incremental() %} -AND txs._INSERTED_TIMESTAMP >= ( - SELECT - MAX(_inserted_timestamp) :: DATE - 1 - FROM - {{ this }} -) -{% endif %} -) - -{% if is_incremental() %}, -missing_data AS ( - SELECT - t.block_number, - txs.block_timestamp, - t.tx_hash, - t.origin_from_address, - t.origin_to_address, - txs.origin_function_signature, - t.tx_status, - {# t.tx_position, #} - t.contract_address, - t.block_hash, - t.data, - t.event_index, - t.event_removed, - t.topics, - GREATEST( - t._inserted_timestamp, - txs._inserted_timestamp - ) AS _inserted_timestamp, - _log_id, - FALSE AS is_pending - FROM - {{ this }} - t - INNER JOIN {{ ref('silver__transactions') }} - txs USING ( - block_number, - tx_hash - ) - WHERE - t.is_pending -) -{% endif %}, -FINAL AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - origin_from_address, - origin_to_address, - origin_function_signature, - tx_status, - {# tx_position, #} - contract_address, - block_hash, - DATA, - event_index, - event_removed, - topics, - _inserted_timestamp, - _log_id, - is_pending - FROM - new_records - -{% if is_incremental() %} -UNION -SELECT - block_number, - block_timestamp, - tx_hash, - origin_from_address, - origin_to_address, - origin_function_signature, - tx_status, - {# tx_position, #} - contract_address, - block_hash, - DATA, - event_index, - event_removed, - topics, - _inserted_timestamp, - _log_id, - is_pending -FROM - missing_data -{% endif %} -) -SELECT - *, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} AS logs_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - FINAL qualify(ROW_NUMBER() over (PARTITION BY block_number, event_index -ORDER BY - _inserted_timestamp DESC, is_pending ASC)) = 1 diff --git a/models/silver/core/silver__native_transfers.sql b/models/silver/core/silver__native_transfers.sql deleted file mode 100644 index 07bab7ce..00000000 --- a/models/silver/core/silver__native_transfers.sql +++ /dev/null @@ -1,119 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'block_number', - cluster_by = ['block_timestamp::DATE'], - tags = ['core','non_realtime','reorg'] -) }} - -WITH eth_base AS ( - - SELECT - tx_hash, - block_number, - block_timestamp, - identifier, --deprecate - from_address, - to_address, - value, - concat_ws( - '-', - block_number, - tx_position, - CONCAT( - type, - '_', - trace_address - ) - ) AS _call_id, - modified_timestamp AS _inserted_timestamp, - value_precise_raw, - value_precise, - tx_position, - trace_index - FROM - {{ ref('core__fact_traces') }} - WHERE - value > 0 - AND tx_succeeded - AND trace_succeeded - AND TYPE NOT IN ( - 'DELEGATECALL', - 'STATICCALL' - ) - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '72 hours' - FROM - {{ this }} -) -{% endif %} -), -tx_table AS ( - SELECT - block_number, - tx_hash, - from_address AS origin_from_address, - to_address AS origin_to_address, - origin_function_signature - FROM - {{ ref('core__fact_transactions') }} - WHERE - tx_hash IN ( - SELECT - DISTINCT tx_hash - FROM - eth_base - ) - -{% if is_incremental() %} -AND modified_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '72 hours' - FROM - {{ this }} -) -{% endif %} -) -SELECT - tx_hash, - block_number, - block_timestamp, - identifier, --deprecate - origin_from_address, - origin_to_address, - origin_function_signature, - from_address, - to_address, - value AS amount, - value_precise_raw AS amount_precise_raw, - value_precise AS amount_precise, - ROUND( - value * price, - 2 - ) AS amount_usd, - _call_id, - _inserted_timestamp, - tx_position, - trace_index, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'trace_index'] - ) }} AS native_transfers_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - eth_base A - LEFT JOIN {{ ref('silver__complete_token_prices') }} - p - ON DATE_TRUNC( - 'hour', - A.block_timestamp - ) = HOUR - AND p.token_address = '0x4200000000000000000000000000000000000006' - JOIN tx_table USING ( - tx_hash, - block_number - ) diff --git a/models/silver/core/silver__ovm1_contracts.sql b/models/silver/core/silver__ovm1_contracts.sql deleted file mode 100644 index 974565d4..00000000 --- a/models/silver/core/silver__ovm1_contracts.sql +++ /dev/null @@ -1,43 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'contract_address', - merge_exclude_columns = ["inserted_timestamp"], - tags = ['stale'] -) }} - -SELECT - contract_address, - token_name, - token_decimals, - token_symbol, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['contract_address'] - ) }} AS ovm1_contracts_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {{ ref('silver__contracts') }} - c1 -WHERE - NOT EXISTS ( - SELECT - 1 - FROM - {{ ref('silver__created_contracts') }} - c0 - WHERE - c1.contract_address = c0.created_contract_address - ) - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - FROM - {{ this }} -) -{% endif %} diff --git a/models/silver/core/silver__ovm1_contracts.yml b/models/silver/core/silver__ovm1_contracts.yml deleted file mode 100644 index 8ca8ab13..00000000 --- a/models/silver/core/silver__ovm1_contracts.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: 2 -models: - - name: silver__ovm1_contracts - description: This model identifies all contracts that have been deployed on Optimism's first instance, OVM1, that are not present in OVM2 traces. - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - CONTRACT_ADDRESS \ No newline at end of file diff --git a/models/silver/core/silver__receipts.sql b/models/silver/core/silver__receipts.sql deleted file mode 100644 index 80f73db0..00000000 --- a/models/silver/core/silver__receipts.sql +++ /dev/null @@ -1,130 +0,0 @@ --- depends_on: {{ ref('bronze__receipts') }} -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(block_hash, tx_hash, from_address, to_address)", - tags = ['core','non_realtime'], - full_refresh = false -) }} - -WITH base AS ( - - SELECT - block_number, - DATA, - _inserted_timestamp - FROM - -{% if is_incremental() %} -{{ ref('bronze__receipts') }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) - AND IS_OBJECT(DATA) -{% else %} - {{ ref('bronze__receipts_fr') }} -WHERE - IS_OBJECT(DATA) -{% endif %} -), -FINAL AS ( - SELECT - block_number, - DATA :blockHash :: STRING AS block_hash, - utils.udf_hex_to_int( - DATA :blockNumber :: STRING - ) :: INT AS blockNumber, - DATA :contractAddress :: STRING AS contractAddress, - utils.udf_hex_to_int( - DATA :cumulativeGasUsed :: STRING - ) :: INT AS cumulative_gas_used, - utils.udf_hex_to_int( - DATA :effectiveGasPrice :: STRING - ) :: INT / pow( - 10, - 9 - ) AS effective_gas_price, - DATA :from :: STRING AS from_address, - COALESCE( - utils.udf_hex_to_int( - DATA :gasUsed :: STRING - ) :: INT, - 0 - ) AS gas_used, - COALESCE( - utils.udf_hex_to_int( - DATA :l1Fee :: STRING - ) :: FLOAT, - 0 - ) AS l1_fee, - COALESCE( - ( - DATA :l1FeeScalar :: STRING - ) :: FLOAT, - 0 - ) AS l1_fee_scalar, - COALESCE( - utils.udf_hex_to_int( - DATA :l1GasUsed :: STRING - ) :: FLOAT, - 0 - ) AS l1_gas_used, - COALESCE( - utils.udf_hex_to_int( - DATA :l1GasPrice :: STRING - ) :: FLOAT, - 0 - ) AS l1_gas_price, - DATA :logs AS logs, - DATA :logsBloom :: STRING AS logs_bloom, - utils.udf_hex_to_int( - DATA :status :: STRING - ) :: INT AS status, - CASE - WHEN status = 1 THEN TRUE - ELSE FALSE - END AS tx_success, - CASE - WHEN status = 1 THEN 'SUCCESS' - ELSE 'FAIL' - END AS tx_status, - DATA :to :: STRING AS to_address1, - CASE - WHEN to_address1 = '' THEN NULL - ELSE to_address1 - END AS to_address, - DATA :transactionHash :: STRING AS tx_hash, - CASE - WHEN block_number <> blockNumber THEN NULL - ELSE utils.udf_hex_to_int( - DATA :transactionIndex :: STRING - ) :: INT - END AS POSITION, - utils.udf_hex_to_int( - DATA :type :: STRING - ) :: INT AS TYPE, - _inserted_timestamp, - utils.udf_hex_to_int( - DATA :depositNonce :: STRING - ) :: INT AS deposit_nonce, - utils.udf_hex_to_int( - DATA: depositReceiptVersion :: STRING - ) :: INT AS deposit_receipt_version - FROM - base -) -SELECT - * -FROM - FINAL -WHERE - tx_hash IS NOT NULL - AND POSITION IS NOT NULL qualify(ROW_NUMBER() over (PARTITION BY block_number, POSITION -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/core/silver__relevant_contracts.sql b/models/silver/core/silver__relevant_contracts.sql deleted file mode 100644 index 14ba6cfd..00000000 --- a/models/silver/core/silver__relevant_contracts.sql +++ /dev/null @@ -1,134 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = "contract_address", - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(contract_address)", - tags = ['non_realtime'] -) }} - -WITH emitted_events AS ( - - SELECT - contract_address, - COUNT(*) AS event_count, - MAX(modified_timestamp) AS max_inserted_timestamp_logs, - MAX(block_number) AS latest_event_block - FROM - {{ ref('core__fact_event_logs') }} - -{% if is_incremental() %} -WHERE - modified_timestamp > ( - SELECT - MAX(max_inserted_timestamp_logs) - FROM - {{ this }} - ) -{% endif %} -GROUP BY - contract_address -), -function_calls AS ( - SELECT - to_address AS contract_address, - COUNT(*) AS function_call_count, - MAX(modified_timestamp) AS max_inserted_timestamp_traces, - MAX(block_number) AS latest_call_block - FROM - {{ ref('core__fact_traces') }} - WHERE - tx_succeeded - AND trace_succeeded - AND to_address IS NOT NULL - AND input IS NOT NULL - AND input <> '0x' - -{% if is_incremental() %} -AND modified_timestamp > ( - SELECT - MAX(max_inserted_timestamp_traces) - FROM - {{ this }} -) -{% endif %} -GROUP BY - 1 -), -active_contracts AS ( - SELECT - contract_address - FROM - emitted_events - UNION - SELECT - contract_address - FROM - function_calls -), -previous_totals AS ( - -{% if is_incremental() %} -SELECT - contract_address, total_event_count, total_call_count, max_inserted_timestamp_logs, latest_event_block, max_inserted_timestamp_traces, latest_call_block -FROM - {{ this }} -{% else %} -SELECT - NULL AS contract_address, 0 AS total_event_count, 0 AS total_call_count, '1970-01-01 00:00:00' AS max_inserted_timestamp_logs, 0 AS latest_event_block, '1970-01-01 00:00:00' AS max_inserted_timestamp_traces, 0 AS latest_call_block -{% endif %}) -SELECT - C.contract_address, - COALESCE( - p.total_event_count, - 0 - ) + COALESCE( - e.event_count, - 0 - ) AS total_event_count, - COALESCE( - p.total_call_count, - 0 - ) + COALESCE( - f.function_call_count, - 0 - ) AS total_call_count, - COALESCE( - p.total_event_count, - 0 - ) + COALESCE( - e.event_count, - 0 - ) + COALESCE( - p.total_call_count, - 0 - ) + COALESCE( - f.function_call_count, - 0 - ) AS total_interaction_count, - COALESCE( - e.max_inserted_timestamp_logs, - p.max_inserted_timestamp_logs, - '1970-01-01 00:00:00' - ) AS max_inserted_timestamp_logs, - COALESCE( - f.max_inserted_timestamp_traces, - p.max_inserted_timestamp_traces, - '1970-01-01 00:00:00' - ) AS max_inserted_timestamp_traces, - COALESCE( - e.latest_event_block, - p.latest_event_block, - 0 - ) AS latest_event_block, - COALESCE( - f.latest_call_block, - p.latest_call_block, - 0 - ) AS latest_call_block -FROM - active_contracts C - LEFT JOIN emitted_events e - ON C.contract_address = e.contract_address - LEFT JOIN function_calls f - ON C.contract_address = f.contract_address - LEFT JOIN previous_totals p - ON C.contract_address = p.contract_address diff --git a/models/silver/core/silver__relevant_contracts.yml b/models/silver/core/silver__relevant_contracts.yml deleted file mode 100644 index 41b18880..00000000 --- a/models/silver/core/silver__relevant_contracts.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -models: - - name: silver__relevant_contracts - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - CONTRACT_ADDRESS \ No newline at end of file diff --git a/models/silver/core/silver__traces.sql b/models/silver/core/silver__traces.sql deleted file mode 100644 index 7a7b6db2..00000000 --- a/models/silver/core/silver__traces.sql +++ /dev/null @@ -1,151 +0,0 @@ --- depends_on: {{ ref('bronze__traces') }} -{{ config ( - materialized = "incremental", - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = ['modified_timestamp::DATE','partition_key'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['core','non_realtime'], - full_refresh = false -) }} - -WITH bronze_traces AS ( - - SELECT - block_number, - partition_key, - VALUE :array_index :: INT AS tx_position, - DATA :result AS full_traces, - _inserted_timestamp - FROM - -{% if is_incremental() and not full_reload_mode %} -{{ ref('bronze__traces') }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) - AND DATA :result IS NOT NULL {% elif is_incremental() and full_reload_mode %} - {{ ref('bronze__traces_fr') }} -WHERE - partition_key BETWEEN ( - SELECT - MAX(partition_key) - 100000 - FROM - {{ this }} - ) - AND ( - SELECT - MAX(partition_key) + 10000000 - FROM - {{ this }} - ) -{% else %} - {{ ref('bronze__traces_fr') }} -WHERE - partition_key <= 30000000 -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY block_number, tx_position -ORDER BY - _inserted_timestamp DESC)) = 1 -), -flatten_traces AS ( - SELECT - block_number, - tx_position, - partition_key, - IFF( - path IN ( - 'result', - 'result.value', - 'result.type', - 'result.to', - 'result.input', - 'result.gasUsed', - 'result.gas', - 'result.from', - 'result.output', - 'result.error', - 'result.revertReason', - 'result.time', - 'gasUsed', - 'gas', - 'type', - 'to', - 'from', - 'value', - 'input', - 'error', - 'output', - 'time', - 'revertReason' - ), - 'ORIGIN', - REGEXP_REPLACE(REGEXP_REPLACE(path, '[^0-9]+', '_'), '^_|_$', '') - ) AS trace_address, - _inserted_timestamp, - OBJECT_AGG( - key, - VALUE - ) AS trace_json, - CASE - WHEN trace_address = 'ORIGIN' THEN NULL - WHEN POSITION( - '_' IN trace_address - ) = 0 THEN 'ORIGIN' - ELSE REGEXP_REPLACE( - trace_address, - '_[0-9]+$', - '', - 1, - 1 - ) - END AS parent_trace_address, - SPLIT( - trace_address, - '_' - ) AS trace_address_array - FROM - bronze_traces txs, - TABLE( - FLATTEN( - input => PARSE_JSON( - txs.full_traces - ), - recursive => TRUE - ) - ) f - WHERE - f.index IS NULL - AND f.key != 'calls' - AND f.path != 'result' - GROUP BY - block_number, - tx_position, - partition_key, - trace_address, - _inserted_timestamp -) -SELECT - block_number, - tx_position, - trace_address, - parent_trace_address, - trace_address_array, - trace_json, - partition_key, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['block_number', 'tx_position', 'trace_address'] - ) }} AS traces_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - flatten_traces qualify(ROW_NUMBER() over(PARTITION BY traces_id -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/core/silver__transactions.sql b/models/silver/core/silver__transactions.sql deleted file mode 100644 index 0b670aa7..00000000 --- a/models/silver/core/silver__transactions.sql +++ /dev/null @@ -1,448 +0,0 @@ --- depends_on: {{ ref('bronze__transactions') }} -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = "block_timestamp::date, _inserted_timestamp::date", - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['core','non_realtime'] -) }} - -WITH base AS ( - - SELECT - block_number, - DATA, - _inserted_timestamp - FROM - -{% if is_incremental() %} -{{ ref('bronze__transactions') }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) - AND IS_OBJECT(DATA) -{% else %} - {{ ref('bronze__transactions_fr') }} -WHERE - IS_OBJECT(DATA) -{% endif %} -), -base_tx AS ( - SELECT - A.block_number AS block_number, - A.data :blockHash :: STRING AS block_hash, - TRY_TO_NUMBER( - utils.udf_hex_to_int( - A.data :blockNumber :: STRING - ) - ) AS blockNumber, - TRY_TO_NUMBER( - utils.udf_hex_to_int( - A.data :chainId :: STRING - ) - ) AS chain_id, - A.data :from :: STRING AS from_address, - TRY_TO_NUMBER( - utils.udf_hex_to_int( - A.data :gas :: STRING - ) - ) AS gas, - COALESCE( - TRY_TO_NUMBER( - utils.udf_hex_to_int( - A.data :gasPrice :: STRING - ) - ) / pow( - 10, - 9 - ), - 0 - ) AS gas_price, - A.data :hash :: STRING AS tx_hash, - A.data :input :: STRING AS input_data, - SUBSTR( - input_data, - 1, - 10 - ) AS origin_function_signature, - TRY_TO_NUMBER( - utils.udf_hex_to_int( - A.data :maxFeePerGas :: STRING - ) - ) / pow( - 10, - 9 - ) AS max_fee_per_gas, - TRY_TO_NUMBER( - utils.udf_hex_to_int( - A.data :maxPriorityFeePerGas :: STRING - ) - ) / pow( - 10, - 9 - ) AS max_priority_fee_per_gas, - TRY_TO_NUMBER( - utils.udf_hex_to_int( - A.data :nonce :: STRING - ) - ) AS nonce, - A.data :r :: STRING AS r, - A.data :s :: STRING AS s, - A.data :to :: STRING AS to_address1, - CASE - WHEN to_address1 = '' THEN NULL - ELSE to_address1 - END AS to_address, - TRY_TO_NUMBER( - utils.udf_hex_to_int( - A.data :transactionIndex :: STRING - ) - ) AS POSITION, - A.data :type :: STRING AS TYPE, - A.data :v :: STRING AS v, - utils.udf_hex_to_int( - A.data :value :: STRING - ) AS value_precise_raw, - utils.udf_decimal_adjust( - value_precise_raw, - 18 - ) AS value_precise, - value_precise :: FLOAT AS VALUE, - A._INSERTED_TIMESTAMP, - A.data - FROM - base A -), -new_records AS ( - SELECT - t.block_number, - t.block_hash, - t.chain_id, - t.from_address, - t.gas, - t.gas_price, - t.tx_hash, - t.input_data, - t.origin_function_signature, - t.max_fee_per_gas, - t.max_priority_fee_per_gas, - t.nonce, - t.r, - t.s, - t.to_address, - t.position, - t.type, - t.v, - t.value_precise_raw, - t.value_precise, - t.value, - block_timestamp, - CASE - WHEN block_timestamp IS NULL - OR tx_status IS NULL THEN TRUE - ELSE FALSE - END AS is_pending, - r.gas_used, - r.l1_fee, - r.l1_fee_scalar, - r.l1_gas_used, - r.l1_gas_price, - utils.udf_decimal_adjust( - ( - r.gas_used * utils.udf_hex_to_int( - t.data :gasPrice :: STRING - ) :: bigint - ) + FLOOR( - r.l1_gas_price * r.l1_gas_used * r.l1_fee_scalar - ) + IFF( - r.l1_fee_scalar = 0, - r.l1_fee, - 0 - ), - 18 - ) AS tx_fee_precise, - COALESCE( - tx_fee_precise :: FLOAT, - 0 - ) AS tx_fee, - tx_success, - tx_status, - cumulative_gas_used, - effective_gas_price, - r.type AS tx_type, - t._inserted_timestamp, - t.data, - r.deposit_nonce, - r.deposit_receipt_version - FROM - base_tx t - LEFT OUTER JOIN {{ ref('silver__blocks') }} - b - ON t.block_number = b.block_number - LEFT OUTER JOIN {{ ref('silver__receipts') }} - r - ON t.block_number = r.block_number - AND t.tx_hash = r.tx_hash - -{% if is_incremental() %} -AND r._INSERTED_TIMESTAMP >= ( - SELECT - MAX(_inserted_timestamp) :: DATE - 1 - FROM - {{ this }} -) -{% endif %} -) - -{% if is_incremental() %}, -missing_data AS ( - SELECT - t.block_number, - t.block_hash, - t.chain_id, - t.from_address, - t.gas, - t.gas_price, - t.tx_hash, - t.input_data, - t.origin_function_signature, - t.max_fee_per_gas, - t.max_priority_fee_per_gas, - t.nonce, - t.r, - t.s, - t.to_address, - t.position, - t.type, - t.v, - t.value_precise_raw, - t.value_precise, - t.value, - b.block_timestamp, - FALSE AS is_pending, - r.gas_used, - r.tx_success, - r.tx_status, - r.cumulative_gas_used, - r.effective_gas_price, - r.l1_fee, - r.l1_fee_scalar, - r.l1_gas_used, - r.l1_gas_price, - utils.udf_decimal_adjust( - ( - r.gas_used * utils.udf_hex_to_int( - t.data :gasPrice :: STRING - ) :: bigint - ) + FLOOR( - r.l1_gas_price * r.l1_gas_used * r.l1_fee_scalar - ) + IFF( - r.l1_fee_scalar = 0, - r.l1_fee, - 0 - ), - 18 - ) AS tx_fee_precise_heal, - COALESCE( - tx_fee_precise_heal :: FLOAT, - 0 - ) AS tx_fee, - r.type AS tx_type, - GREATEST( - t._inserted_timestamp, - b._inserted_timestamp, - r._inserted_timestamp - ) AS _inserted_timestamp, - t.data, - r.deposit_nonce, - r.deposit_receipt_version - FROM - {{ this }} - t - INNER JOIN {{ ref('silver__blocks') }} - b - ON t.block_number = b.block_number - INNER JOIN {{ ref('silver__receipts') }} - r - ON t.tx_hash = r.tx_hash - AND t.block_number = r.block_number - WHERE - t.is_pending -) -{% endif %}, -exclusions AS ( - SELECT - CONCAT( - block_number, - '-', - tx_hash - ) AS block_tx_id - FROM - {{ ref('silver_observability__excluded_receipt_blocks') }} -), -FINAL AS ( - SELECT - block_number, - block_hash, - chain_id, - from_address, - gas, - gas_price, - tx_hash, - input_data, - origin_function_signature, - max_fee_per_gas, - max_priority_fee_per_gas, - nonce, - r, - s, - to_address, - POSITION, - TYPE, - v, - value_precise_raw, - value_precise, - VALUE, - block_timestamp, - is_pending, - gas_used, - tx_success, - tx_status, - cumulative_gas_used, - effective_gas_price, - l1_fee, - l1_fee_scalar, - l1_gas_used, - l1_gas_price, - tx_fee, - tx_fee_precise, - tx_type, - _inserted_timestamp, - DATA, - deposit_nonce, - deposit_receipt_version - FROM - new_records - -{% if is_incremental() %} -UNION -SELECT - block_number, - block_hash, - chain_id, - from_address, - gas, - gas_price, - tx_hash, - input_data, - origin_function_signature, - max_fee_per_gas, - max_priority_fee_per_gas, - nonce, - r, - s, - to_address, - POSITION, - TYPE, - v, - value_precise_raw, - value_precise, - VALUE, - block_timestamp, - is_pending, - gas_used, - tx_success, - tx_status, - cumulative_gas_used, - effective_gas_price, - l1_fee, - l1_fee_scalar, - l1_gas_used, - l1_gas_price, - tx_fee, - tx_fee_precise_heal AS tx_fee_precise, - tx_type, - _inserted_timestamp, - DATA, - deposit_nonce, - deposit_receipt_version -FROM - missing_data -{% endif %} -) -SELECT - block_number, - block_hash, - chain_id, - from_address, - gas, - gas_price, - tx_hash, - input_data, - origin_function_signature, - max_fee_per_gas, - max_priority_fee_per_gas, - nonce, - r, - s, - to_address, - POSITION, - TYPE, - v, - VALUE, - value_precise_raw, - value_precise, - block_timestamp, - CASE - WHEN CONCAT( - block_number, - '-', - tx_hash - ) IN ( - SELECT - block_tx_id - FROM - exclusions - ) THEN FALSE - ELSE is_pending - END AS is_pending, - gas_used, - tx_success, - tx_status, - cumulative_gas_used, - effective_gas_price, - utils.udf_decimal_adjust( - l1_fee, - 18 - ) AS l1_fee_precise, - l1_fee_precise :: FLOAT AS l1_fee, - l1_fee_scalar, - l1_gas_used, - l1_gas_price / pow( - 10, - 9 - ) AS l1_gas_price, - tx_fee, - tx_fee_precise, - tx_type, - _inserted_timestamp, - DATA, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash'] - ) }} AS transactions_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id, - deposit_nonce, - deposit_receipt_version -FROM - FINAL -WHERE - block_hash IS NOT NULL qualify(ROW_NUMBER() over (PARTITION BY block_number, POSITION -ORDER BY - _inserted_timestamp DESC, is_pending ASC)) = 1 diff --git a/models/silver/core/silver__transfers.sql b/models/silver/core/silver__transfers.sql deleted file mode 100644 index d98f573c..00000000 --- a/models/silver/core/silver__transfers.sql +++ /dev/null @@ -1,292 +0,0 @@ --- depends_on: {{ ref('silver__complete_token_prices') }} -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = ['block_timestamp::DATE', '_inserted_timestamp::DATE'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_function_signature, origin_from_address, origin_to_address, contract_address, from_address, to_address, symbol), SUBSTRING(origin_function_signature, contract_address, from_address, to_address, symbol)", - tags = ['non_realtime','reorg','heal'] -) }} - -WITH logs AS ( - - SELECT - CONCAT( - tx_hash :: STRING, - '-', - event_index :: STRING - ) AS _log_id, - block_number, - tx_hash, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address :: STRING AS contract_address, - CONCAT('0x', SUBSTR(topics [1], 27, 40)) :: STRING AS from_address, - CONCAT('0x', SUBSTR(topics [2], 27, 40)) :: STRING AS to_address, - utils.udf_hex_to_int(SUBSTR(DATA, 3, 64)) AS raw_amount_precise, - raw_amount_precise :: FLOAT AS raw_amount, - event_index, - modified_timestamp AS _inserted_timestamp - FROM - {{ ref('core__fact_event_logs') }} - WHERE - topics [0] :: STRING = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' - AND tx_succeeded - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '{{ var("LOOKBACK", "4 hours") }}' - FROM - {{ this }} -) -{% endif %} -), -token_transfers AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - t.contract_address, - from_address, - to_address, - raw_amount_precise, - raw_amount, - IFF( - C.token_decimals IS NOT NULL, - utils.udf_decimal_adjust( - raw_amount_precise, - C.token_decimals - ), - NULL - ) AS amount_precise, - amount_precise :: FLOAT AS amount, - IFF( - C.token_decimals IS NOT NULL - AND price IS NOT NULL, - amount * price, - NULL - ) AS amount_usd, - C.token_decimals AS decimals, - C.token_symbol AS symbol, - price AS token_price, - CASE - WHEN C.token_decimals IS NULL THEN 'false' - ELSE 'true' - END AS has_decimal, - CASE - WHEN price IS NULL THEN 'false' - ELSE 'true' - END AS has_price, - _log_id, - _inserted_timestamp - FROM - logs t - LEFT JOIN {{ ref('price__ez_prices_hourly') }} - p - ON t.contract_address = p.token_address - AND DATE_TRUNC( - 'hour', - t.block_timestamp - ) = HOUR - LEFT JOIN {{ ref('silver__contracts') }} C USING (contract_address) - WHERE - raw_amount IS NOT NULL - AND to_address IS NOT NULL - AND from_address IS NOT NULL -) - -{% if is_incremental() and var( - 'HEAL_MODEL' -) %}, -heal_model AS ( - SELECT - t0.block_number, - t0.block_timestamp, - t0.tx_hash, - t0.event_index, - t0.origin_function_signature, - t0.origin_from_address, - t0.origin_to_address, - t0.contract_address, - t0.from_address, - t0.to_address, - t0.raw_amount_precise, - t0.raw_amount, - IFF( - C.token_decimals IS NOT NULL, - utils.udf_decimal_adjust( - t0.raw_amount_precise, - C.token_decimals - ), - NULL - ) AS amount_precise_heal, - amount_precise_heal :: FLOAT AS amount_heal, - IFF( - C.token_decimals IS NOT NULL - AND price IS NOT NULL, - amount_heal * p.price, - NULL - ) AS amount_usd, - C.token_decimals AS decimals, - C.token_symbol AS symbol, - p.price AS token_price, - CASE - WHEN C.token_decimals IS NULL THEN 'false' - ELSE 'true' - END AS has_decimal, - CASE - WHEN p.price IS NULL THEN 'false' - ELSE 'true' - END AS has_price, - t0._log_id, - t0._inserted_timestamp - FROM - {{ this }} - t0 - LEFT JOIN {{ ref('price__ez_prices_hourly') }} - p - ON t0.contract_address = p.token_address - AND DATE_TRUNC( - 'hour', - t0.block_timestamp - ) = HOUR - LEFT JOIN {{ ref('silver__contracts') }} C - ON C.contract_address = t0.contract_address - WHERE - t0.block_number IN ( - SELECT - DISTINCT t1.block_number AS block_number - FROM - {{ this }} - t1 - WHERE - t1.decimals IS NULL - AND _inserted_timestamp < ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '{{ var("LOOKBACK", "4 hours") }}' - FROM - {{ this }} - ) - AND EXISTS ( - SELECT - 1 - FROM - {{ ref('silver__contracts') }} C - WHERE - C._inserted_timestamp > DATEADD('DAY', -14, SYSDATE()) - AND C.token_decimals IS NOT NULL - AND C.contract_address = t1.contract_address) - ) - OR t0.block_number IN ( - SELECT - DISTINCT t2.block_number - FROM - {{ this }} - t2 - WHERE - t2.token_price IS NULL - AND _inserted_timestamp < ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '{{ var("LOOKBACK", "4 hours") }}' - FROM - {{ this }} - ) - AND EXISTS ( - SELECT - 1 - FROM - {{ ref('silver__complete_token_prices') }} - p - WHERE - p._inserted_timestamp > DATEADD('DAY', -14, SYSDATE()) - AND p.price IS NOT NULL - AND p.token_address = t2.contract_address - AND p.hour = DATE_TRUNC( - 'hour', - t2.block_timestamp - ) - ) - ) - ) - {% endif %} - SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address, - from_address, - to_address, - raw_amount_precise, - raw_amount, - amount_precise, - amount, - amount_usd, - decimals, - symbol, - token_price, - has_decimal, - has_price, - _log_id, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} AS transfers_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id - FROM - token_transfers - -{% if is_incremental() and var( - 'HEAL_MODEL' -) %} -UNION ALL -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address, - from_address, - to_address, - raw_amount_precise, - raw_amount, - amount_precise_heal AS amount_precise, - amount_heal AS amount, - amount_usd, - decimals, - symbol, - token_price, - has_decimal, - has_price, - _log_id, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} AS transfers_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - heal_model -{% endif %} diff --git a/models/silver/core/silver__tx_count.sql b/models/silver/core/silver__tx_count.sql deleted file mode 100644 index 02fa05d9..00000000 --- a/models/silver/core/silver__tx_count.sql +++ /dev/null @@ -1,38 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = "block_number", - merge_exclude_columns = ["inserted_timestamp"], - tags = ['non_realtime'] -) }} - -WITH base AS ( - - SELECT - block_number, - MIN(modified_timestamp) AS _inserted_timestamp, - COUNT(*) AS tx_count - FROM - {{ ref('core__fact_transactions') }} - -{% if is_incremental() %} -WHERE - modified_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) -{% endif %} -GROUP BY - block_number -) -SELECT - *, - {{ dbt_utils.generate_surrogate_key( - ['block_number'] - ) }} AS tx_count_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - base diff --git a/models/silver/core/tests/blocks/test_silver__blocks_full.sql b/models/silver/core/tests/blocks/test_silver__blocks_full.sql deleted file mode 100644 index 25dc03b2..00000000 --- a/models/silver/core/tests/blocks/test_silver__blocks_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__blocks') }} diff --git a/models/silver/core/tests/blocks/test_silver__blocks_full.yml b/models/silver/core/tests/blocks/test_silver__blocks_full.yml deleted file mode 100644 index f90d39ce..00000000 --- a/models/silver/core/tests/blocks/test_silver__blocks_full.yml +++ /dev/null @@ -1,95 +0,0 @@ -version: 2 -models: - - name: test_silver__blocks_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - BLOCK_NUMBER - - fsc_utils.sequence_gaps: - column_name: BLOCK_NUMBER - where: BLOCK_TIMESTAMP < CURRENT_DATE - 1 - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: DIFFICULTY - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TOTAL_DIFFICULTY - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EXTRA_DATA - tests: - - not_null - - name: GAS_LIMIT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: GAS_USED - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: PARENT_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: MINER - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: NONCE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: RECEIPTS_ROOT - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: SHA3_UNCLES - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: SIZE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - diff --git a/models/silver/core/tests/blocks/test_silver__blocks_recent.sql b/models/silver/core/tests/blocks/test_silver__blocks_recent.sql deleted file mode 100644 index 57bc0fae..00000000 --- a/models/silver/core/tests/blocks/test_silver__blocks_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__blocks') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) \ No newline at end of file diff --git a/models/silver/core/tests/blocks/test_silver__blocks_recent.yml b/models/silver/core/tests/blocks/test_silver__blocks_recent.yml deleted file mode 100644 index ceb767ff..00000000 --- a/models/silver/core/tests/blocks/test_silver__blocks_recent.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: 2 -models: - - name: test_silver__blocks_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - BLOCK_NUMBER - - fsc_utils.sequence_gaps: - column_name: BLOCK_NUMBER - config: - severity: error - error_if: ">10" - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 3 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - \ No newline at end of file diff --git a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.sql b/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.sql deleted file mode 100644 index 5ab7378f..00000000 --- a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__confirmed_blocks') }} -WHERE - block_number NOT IN ( - SELECT - block_number - FROM - {{ ref('silver_observability__excluded_receipt_blocks') }} - ) \ No newline at end of file diff --git a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.yml b/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.yml deleted file mode 100644 index 81a9db00..00000000 --- a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: 2 -models: - - name: test_silver__confirmed_blocks_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: BLOCK_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ \ No newline at end of file diff --git a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.sql b/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.sql deleted file mode 100644 index a88692b0..00000000 --- a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__confirmed_blocks') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.yml b/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.yml deleted file mode 100644 index 460ddf12..00000000 --- a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_recent.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: 2 -models: - - name: test_silver__confirmed_blocks_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: BLOCK_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 3 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ \ No newline at end of file diff --git a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.sql b/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.sql deleted file mode 100644 index 1dcc890e..00000000 --- a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__decoded_logs') }} diff --git a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.yml b/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.yml deleted file mode 100644 index 436c8e72..00000000 --- a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_full.yml +++ /dev/null @@ -1,52 +0,0 @@ -version: 2 -models: - - name: test_silver__decoded_logs_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - - dbt_utils.recency: - datepart: day - field: _INSERTED_TIMESTAMP - interval: 1 - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: EVENT_INDEX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - name: EVENT_NAME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - - - - - diff --git a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.sql b/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.sql deleted file mode 100644 index 9de40e75..00000000 --- a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__decoded_logs') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.yml b/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.yml deleted file mode 100644 index 08311948..00000000 --- a/models/silver/core/tests/decoded_logs/test_silver__decoded_logs_recent.yml +++ /dev/null @@ -1,57 +0,0 @@ -version: 2 -models: - - name: test_silver__decoded_logs_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - - dbt_utils.recency: - datepart: day - field: _INSERTED_TIMESTAMP - interval: 1 - - fsc_utils.recent_decoded_logs_match: - config: - severity: error - error_if: ">0" - - missing_decoded_logs - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: EVENT_INDEX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - name: EVENT_NAME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - - - - - diff --git a/models/silver/core/tests/event_logs/test_silver__logs_full.sql b/models/silver/core/tests/event_logs/test_silver__logs_full.sql deleted file mode 100644 index e1172988..00000000 --- a/models/silver/core/tests/event_logs/test_silver__logs_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__logs') }} diff --git a/models/silver/core/tests/event_logs/test_silver__logs_full.yml b/models/silver/core/tests/event_logs/test_silver__logs_full.yml deleted file mode 100644 index 4b5140c7..00000000 --- a/models/silver/core/tests/event_logs/test_silver__logs_full.yml +++ /dev/null @@ -1,77 +0,0 @@ -version: 2 -models: - - name: test_silver__logs_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - - TX_HASH - column_name: EVENT_INDEX - where: BLOCK_TIMESTAMP < CURRENT_DATE - 1 - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: BLOCK_TIMESTAMP - tests: - - not_null: - where: NOT IS_PENDING - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - fsc_utils.tx_block_count: - config: - severity: error - error_if: "!=0" - - name: EVENT_INDEX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TOPICS - tests: - - not_null - - name: DATA - tests: - - not_null - - name: EVENT_REMOVED - tests: - - not_null - - name: _LOG_ID - tests: - - not_null - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null: - where: NOT IS_PENDING - - name: ORIGIN_FROM_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: ORIGIN_TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ \ No newline at end of file diff --git a/models/silver/core/tests/event_logs/test_silver__logs_recent.sql b/models/silver/core/tests/event_logs/test_silver__logs_recent.sql deleted file mode 100644 index f6905594..00000000 --- a/models/silver/core/tests/event_logs/test_silver__logs_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__logs') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) \ No newline at end of file diff --git a/models/silver/core/tests/event_logs/test_silver__logs_recent.yml b/models/silver/core/tests/event_logs/test_silver__logs_recent.yml deleted file mode 100644 index 4a2b8a63..00000000 --- a/models/silver/core/tests/event_logs/test_silver__logs_recent.yml +++ /dev/null @@ -1,33 +0,0 @@ -version: 2 -models: - - name: test_silver__logs_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - - TX_HASH - column_name: EVENT_INDEX - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: BLOCK_TIMESTAMP - tests: - - not_null: - where: NOT IS_PENDING - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 3 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null diff --git a/models/silver/core/tests/receipts/test_silver__receipts_full.sql b/models/silver/core/tests/receipts/test_silver__receipts_full.sql deleted file mode 100644 index 56f39ae1..00000000 --- a/models/silver/core/tests/receipts/test_silver__receipts_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__receipts') }} diff --git a/models/silver/core/tests/receipts/test_silver__receipts_full.yml b/models/silver/core/tests/receipts/test_silver__receipts_full.yml deleted file mode 100644 index 9a186859..00000000 --- a/models/silver/core/tests/receipts/test_silver__receipts_full.yml +++ /dev/null @@ -1,82 +0,0 @@ -version: 2 -models: - - name: test_silver__receipts_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - column_name: POSITION - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: POSITION - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: FROM_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - where: TO_ADDRESS IS NOT NULL - - name: BLOCK_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: CUMULATIVE_GAS_USED - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EFFECTIVE_GAS_PRICE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: GAS_USED - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TX_STATUS - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_set: - value_set: ['SUCCESS', 'FAIL'] - - name: TYPE - tests: - - not_null - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - diff --git a/models/silver/core/tests/receipts/test_silver__receipts_recent.sql b/models/silver/core/tests/receipts/test_silver__receipts_recent.sql deleted file mode 100644 index 1928007b..00000000 --- a/models/silver/core/tests/receipts/test_silver__receipts_recent.sql +++ /dev/null @@ -1,17 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__receipts') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) - diff --git a/models/silver/core/tests/receipts/test_silver__receipts_recent.yml b/models/silver/core/tests/receipts/test_silver__receipts_recent.yml deleted file mode 100644 index 1e8cfa1c..00000000 --- a/models/silver/core/tests/receipts/test_silver__receipts_recent.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 2 -models: - - name: test_silver__receipts_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - column_name: POSITION - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 3 - - diff --git a/models/silver/core/tests/traces/test_silver__traces_full.sql b/models/silver/core/tests/traces/test_silver__traces_full.sql deleted file mode 100644 index 1643e5c4..00000000 --- a/models/silver/core/tests/traces/test_silver__traces_full.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__traces') }} -WHERE - block_number NOT IN ( - SELECT - block_number - FROM - {{ ref('silver_observability__excluded_receipt_blocks') }} - ) diff --git a/models/silver/core/tests/traces/test_silver__traces_full.yml b/models/silver/core/tests/traces/test_silver__traces_full.yml deleted file mode 100644 index f21a7e1d..00000000 --- a/models/silver/core/tests/traces/test_silver__traces_full.yml +++ /dev/null @@ -1,52 +0,0 @@ -version: 2 -models: - - name: test_silver__traces_full - description: "This is a view used to test all of the silver traces model." - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TRACES_ID - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - name: TX_POSITION - tests: - - not_null - - name: TRACE_ADDRESS - tests: - - not_null - - name: TRACE_JSON - tests: - - not_null - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ diff --git a/models/silver/core/tests/traces/test_silver__traces_recent.sql b/models/silver/core/tests/traces/test_silver__traces_recent.sql deleted file mode 100644 index 493b8f2c..00000000 --- a/models/silver/core/tests/traces/test_silver__traces_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__traces') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/traces/test_silver__traces_recent.yml b/models/silver/core/tests/traces/test_silver__traces_recent.yml deleted file mode 100644 index 10e6629d..00000000 --- a/models/silver/core/tests/traces/test_silver__traces_recent.yml +++ /dev/null @@ -1,52 +0,0 @@ -version: 2 -models: - - name: test_silver__traces_recent - description: "This is a view used to test the last three days of traces." - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TRACES_ID - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - name: TX_POSITION - tests: - - not_null - - name: TRACE_ADDRESS - tests: - - not_null - - name: TRACE_JSON - tests: - - not_null - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ diff --git a/models/silver/core/tests/transactions/test_silver__transactions_full.sql b/models/silver/core/tests/transactions/test_silver__transactions_full.sql deleted file mode 100644 index fc6950ad..00000000 --- a/models/silver/core/tests/transactions/test_silver__transactions_full.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__transactions') }} -WHERE - block_number NOT IN ( - SELECT - block_number - FROM - {{ ref('silver_observability__excluded_receipt_blocks') }} - ) \ No newline at end of file diff --git a/models/silver/core/tests/transactions/test_silver__transactions_full.yml b/models/silver/core/tests/transactions/test_silver__transactions_full.yml deleted file mode 100644 index fc88627e..00000000 --- a/models/silver/core/tests/transactions/test_silver__transactions_full.yml +++ /dev/null @@ -1,119 +0,0 @@ -version: 2 -models: - - name: test_silver__transactions_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - column_name: POSITION - where: BLOCK_TIMESTAMP < CURRENT_DATE - 1 - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: NONCE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: POSITION - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - name: FROM_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - where: TO_ADDRESS IS NOT NULL - - name: VALUE - tests: - - not_null - - name: BLOCK_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: GAS_PRICE - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: GAS - tests: - - not_null - - name: INPUT_DATA - tests: - - not_null - - name: TX_STATUS - tests: - - not_null: - where: NOT IS_PENDING - - dbt_expectations.expect_column_values_to_be_in_set: - value_set: ['SUCCESS', 'FAIL'] - where: NOT IS_PENDING - - name: GAS_USED - tests: - - not_null: - where: NOT IS_PENDING - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: CUMULATIVE_GAS_USED - tests: - - not_null: - where: NOT IS_PENDING - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TX_FEE - tests: - - not_null: - where: NOT IS_PENDING - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EFFECTIVE_GAS_PRICE - tests: - - not_null: - where: NOT IS_PENDING - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null - - diff --git a/models/silver/core/tests/transactions/test_silver__transactions_recent.sql b/models/silver/core/tests/transactions/test_silver__transactions_recent.sql deleted file mode 100644 index 73431ac9..00000000 --- a/models/silver/core/tests/transactions/test_silver__transactions_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__transactions') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/transactions/test_silver__transactions_recent.yml b/models/silver/core/tests/transactions/test_silver__transactions_recent.yml deleted file mode 100644 index 3539ac2d..00000000 --- a/models/silver/core/tests/transactions/test_silver__transactions_recent.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: 2 -models: - - name: test_silver__transactions_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - column_name: POSITION - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 3 - \ No newline at end of file diff --git a/models/silver/core/tests/transfers/test_silver__transfers_full.sql b/models/silver/core/tests/transfers/test_silver__transfers_full.sql deleted file mode 100644 index 487722dc..00000000 --- a/models/silver/core/tests/transfers/test_silver__transfers_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__transfers') }} diff --git a/models/silver/core/tests/transfers/test_silver__transfers_full.yml b/models/silver/core/tests/transfers/test_silver__transfers_full.yml deleted file mode 100644 index 3ec8a729..00000000 --- a/models/silver/core/tests/transfers/test_silver__transfers_full.yml +++ /dev/null @@ -1,70 +0,0 @@ -version: 2 -models: - - name: test_silver__transfers_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: FROM_ADDRESS - tests: - - not_null: - where: BLOCK_TIMESTAMP > '2021-08-01' - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: RAW_AMOUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: _LOG_ID - tests: - - not_null - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null - - name: ORIGIN_FROM_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: ORIGIN_TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - diff --git a/models/silver/core/tests/transfers/test_silver__transfers_recent.sql b/models/silver/core/tests/transfers/test_silver__transfers_recent.sql deleted file mode 100644 index e384cdaa..00000000 --- a/models/silver/core/tests/transfers/test_silver__transfers_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__transfers') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/transfers/test_silver__transfers_recent.yml b/models/silver/core/tests/transfers/test_silver__transfers_recent.yml deleted file mode 100644 index 373bd568..00000000 --- a/models/silver/core/tests/transfers/test_silver__transfers_recent.yml +++ /dev/null @@ -1,68 +0,0 @@ -version: 2 -models: - - name: test_silver__transfers_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - TIMESTAMP_LTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: FROM_ADDRESS - tests: - - not_null: - where: BLOCK_TIMESTAMP > '2021-08-01' - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: RAW_AMOUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: _LOG_ID - tests: - - not_null - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null - - name: ORIGIN_FROM_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: ORIGIN_TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ \ No newline at end of file diff --git a/models/silver/defi/bridge/across/silver_bridge__across_fundsdeposited.sql b/models/silver/defi/bridge/across/silver_bridge__across_fundsdeposited.sql index fd1b6398..530a53d4 100644 --- a/models/silver/defi/bridge/across/silver_bridge__across_fundsdeposited.sql +++ b/models/silver/defi/bridge/across/silver_bridge__across_fundsdeposited.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/across/silver_bridge__across_v3fundsdeposited.sql b/models/silver/defi/bridge/across/silver_bridge__across_v3fundsdeposited.sql index 2fae3eca..a5443368 100644 --- a/models/silver/defi/bridge/across/silver_bridge__across_v3fundsdeposited.sql +++ b/models/silver/defi/bridge/across/silver_bridge__across_v3fundsdeposited.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_tokens_sent.sql b/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_tokens_sent.sql index fd1132c9..522ae36a 100644 --- a/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_tokens_sent.sql +++ b/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_tokens_sent.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/axelar/silver_bridge__axelar_contractcallwithtoken.sql b/models/silver/defi/bridge/axelar/silver_bridge__axelar_contractcallwithtoken.sql index 4543930f..a7d9ee1b 100644 --- a/models/silver/defi/bridge/axelar/silver_bridge__axelar_contractcallwithtoken.sql +++ b/models/silver/defi/bridge/axelar/silver_bridge__axelar_contractcallwithtoken.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/ccip/silver_bridge__ccip_send_requested.sql b/models/silver/defi/bridge/ccip/silver_bridge__ccip_send_requested.sql index 53b06f65..5088002d 100644 --- a/models/silver/defi/bridge/ccip/silver_bridge__ccip_send_requested.sql +++ b/models/silver/defi/bridge/ccip/silver_bridge__ccip_send_requested.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH on_ramp_set AS ( diff --git a/models/silver/defi/bridge/celer/silver_bridge__celer_cbridge_send.sql b/models/silver/defi/bridge/celer/silver_bridge__celer_cbridge_send.sql index a3e23e6f..704abb1a 100644 --- a/models/silver/defi/bridge/celer/silver_bridge__celer_cbridge_send.sql +++ b/models/silver/defi/bridge/celer/silver_bridge__celer_cbridge_send.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/dln/silver_bridge__dln_debridge_createdorder.sql b/models/silver/defi/bridge/dln/silver_bridge__dln_debridge_createdorder.sql index aeb3a07e..3842012c 100644 --- a/models/silver/defi/bridge/dln/silver_bridge__dln_debridge_createdorder.sql +++ b/models/silver/defi/bridge/dln/silver_bridge__dln_debridge_createdorder.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/eywa/silver_bridge__eywa_requestsent.sql b/models/silver/defi/bridge/eywa/silver_bridge__eywa_requestsent.sql index 28cd5971..d1065408 100644 --- a/models/silver/defi/bridge/eywa/silver_bridge__eywa_requestsent.sql +++ b/models/silver/defi/bridge/eywa/silver_bridge__eywa_requestsent.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/hop/silver_bridge__hop_ammwrapper.sql b/models/silver/defi/bridge/hop/silver_bridge__hop_ammwrapper.sql index 769020f2..49371a79 100644 --- a/models/silver/defi/bridge/hop/silver_bridge__hop_ammwrapper.sql +++ b/models/silver/defi/bridge/hop/silver_bridge__hop_ammwrapper.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "block_number", - tags = ['curated'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_contracts AS ( diff --git a/models/silver/defi/bridge/hop/silver_bridge__hop_l2canonicaltoken.sql b/models/silver/defi/bridge/hop/silver_bridge__hop_l2canonicaltoken.sql index 5eddaa21..81ebe45b 100644 --- a/models/silver/defi/bridge/hop/silver_bridge__hop_l2canonicaltoken.sql +++ b/models/silver/defi/bridge/hop/silver_bridge__hop_l2canonicaltoken.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "block_number", - tags = ['curated'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_contracts AS ( diff --git a/models/silver/defi/bridge/hop/silver_bridge__hop_transfersent.sql b/models/silver/defi/bridge/hop/silver_bridge__hop_transfersent.sql index 14a3542f..91d7283d 100644 --- a/models/silver/defi/bridge/hop/silver_bridge__hop_transfersent.sql +++ b/models/silver/defi/bridge/hop/silver_bridge__hop_transfersent.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/meson/silver_bridge__meson_transfers.sql b/models/silver/defi/bridge/meson/silver_bridge__meson_transfers.sql index 6c5f7696..92db185c 100644 --- a/models/silver/defi/bridge/meson/silver_bridge__meson_transfers.sql +++ b/models/silver/defi/bridge/meson/silver_bridge__meson_transfers.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH token_transfers AS ( diff --git a/models/silver/defi/bridge/multichain/silver_bridge__multichain_v7_loganyswapout.sql b/models/silver/defi/bridge/multichain/silver_bridge__multichain_v7_loganyswapout.sql index 3582d43d..9881ad94 100644 --- a/models/silver/defi/bridge/multichain/silver_bridge__multichain_v7_loganyswapout.sql +++ b/models/silver/defi/bridge/multichain/silver_bridge__multichain_v7_loganyswapout.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql b/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql index 16bca883..3241af23 100644 --- a/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql +++ b/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform','version'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, bridge_address, sender, receiver, destination_chain_receiver, destination_chain_id, destination_chain, token_address, token_symbol), SUBSTRING(origin_function_signature, bridge_address, sender, receiver, destination_chain_receiver, destination_chain, token_address, token_symbol)", - tags = ['curated','reorg','heal'] + tags = ['silver_bridge','defi','bridge','curated','heal'] ) }} WITH across AS ( diff --git a/models/silver/defi/bridge/stargate/silver_bridge__stargate_createpool.sql b/models/silver/defi/bridge/stargate/silver_bridge__stargate_createpool.sql index e4fa4fe8..ec4d4b20 100644 --- a/models/silver/defi/bridge/stargate/silver_bridge__stargate_createpool.sql +++ b/models/silver/defi/bridge/stargate/silver_bridge__stargate_createpool.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "block_number", - tags = ['curated'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_contracts AS ( diff --git a/models/silver/defi/bridge/stargate/silver_bridge__stargate_swap.sql b/models/silver/defi/bridge/stargate/silver_bridge__stargate_swap.sql index 47657aad..f2152101 100644 --- a/models/silver/defi/bridge/stargate/silver_bridge__stargate_swap.sql +++ b/models/silver/defi/bridge/stargate/silver_bridge__stargate_swap.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/bridge/symbiosis/silver_bridge__symbiosis_synthesizerequest.sql b/models/silver/defi/bridge/symbiosis/silver_bridge__symbiosis_synthesizerequest.sql index 096d391a..98b1d060 100644 --- a/models/silver/defi/bridge/symbiosis/silver_bridge__symbiosis_synthesizerequest.sql +++ b/models/silver/defi/bridge/symbiosis/silver_bridge__symbiosis_synthesizerequest.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/synapse/silver_bridge__synapse_token_bridge.sql b/models/silver/defi/bridge/synapse/silver_bridge__synapse_token_bridge.sql index c4d1294e..b0c7ed0f 100644 --- a/models/silver/defi/bridge/synapse/silver_bridge__synapse_token_bridge.sql +++ b/models/silver/defi/bridge/synapse/silver_bridge__synapse_token_bridge.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/synapse/silver_bridge__synapse_tokenbridgeandswap.sql b/models/silver/defi/bridge/synapse/silver_bridge__synapse_tokenbridgeandswap.sql index 92ff6695..a3fb8325 100644 --- a/models/silver/defi/bridge/synapse/silver_bridge__synapse_tokenbridgeandswap.sql +++ b/models/silver/defi/bridge/synapse/silver_bridge__synapse_tokenbridgeandswap.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/wormhole/silver_bridge__wormhole_transfers.sql b/models/silver/defi/bridge/wormhole/silver_bridge__wormhole_transfers.sql index cf75cd51..927988a2 100644 --- a/models/silver/defi/bridge/wormhole/silver_bridge__wormhole_transfers.sql +++ b/models/silver/defi/bridge/wormhole/silver_bridge__wormhole_transfers.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH token_transfers AS ( @@ -107,7 +107,7 @@ base_near AS ( addr_encoded FROM {{ source( - 'silver_crosschain', + 'crosschain_silver', 'near_address_encoded' ) }} ) diff --git a/models/silver/defi/dex/beethovenx/silver_dex__beethovenx_pools.sql b/models/silver/defi/dex/beethovenx/silver_dex__beethovenx_pools.sql index e5e7c98e..d403b123 100644 --- a/models/silver/defi/dex/beethovenx/silver_dex__beethovenx_pools.sql +++ b/models/silver/defi/dex/beethovenx/silver_dex__beethovenx_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'pool_address', full_refresh = false, - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools_registered AS ( diff --git a/models/silver/defi/dex/beethovenx/silver_dex__beethovenx_swaps.sql b/models/silver/defi/dex/beethovenx/silver_dex__beethovenx_swaps.sql index 0ba50f7b..d2d06afd 100644 --- a/models/silver/defi/dex/beethovenx/silver_dex__beethovenx_swaps.sql +++ b/models/silver/defi/dex/beethovenx/silver_dex__beethovenx_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} diff --git a/models/silver/defi/dex/curve/silver_dex__curve_pools.sql b/models/silver/defi/dex/curve/silver_dex__curve_pools.sql index 7838b464..621f9481 100644 --- a/models/silver/defi/dex/curve/silver_dex__curve_pools.sql +++ b/models/silver/defi/dex/curve/silver_dex__curve_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'pool_address', full_refresh = false, - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH contract_deployments AS ( diff --git a/models/silver/defi/dex/curve/silver_dex__curve_swaps.sql b/models/silver/defi/dex/curve/silver_dex__curve_swaps.sql index 20760681..99cd80dd 100644 --- a/models/silver/defi/dex/curve/silver_dex__curve_swaps.sql +++ b/models/silver/defi/dex/curve/silver_dex__curve_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} diff --git a/models/silver/defi/dex/dodo/silver_dex__dodo_v2_pools.sql b/models/silver/defi/dex/dodo/silver_dex__dodo_v2_pools.sql index dcb31768..15df3c5c 100644 --- a/models/silver/defi/dex/dodo/silver_dex__dodo_v2_pools.sql +++ b/models/silver/defi/dex/dodo/silver_dex__dodo_v2_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_tr AS ( diff --git a/models/silver/defi/dex/dodo/silver_dex__dodo_v2_swaps.sql b/models/silver/defi/dex/dodo/silver_dex__dodo_v2_swaps.sql index 8692ec9b..c6c501d4 100644 --- a/models/silver/defi/dex/dodo/silver_dex__dodo_v2_swaps.sql +++ b/models/silver/defi/dex/dodo/silver_dex__dodo_v2_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} diff --git a/models/silver/defi/dex/frax/silver_dex__fraxswap_pools.sql b/models/silver/defi/dex/frax/silver_dex__fraxswap_pools.sql index 8889ac1c..39cf443f 100644 --- a/models/silver/defi/dex/frax/silver_dex__fraxswap_pools.sql +++ b/models/silver/defi/dex/frax/silver_dex__fraxswap_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/frax/silver_dex__fraxswap_swaps.sql b/models/silver/defi/dex/frax/silver_dex__fraxswap_swaps.sql index caa3c23d..2febbfb5 100644 --- a/models/silver/defi/dex/frax/silver_dex__fraxswap_swaps.sql +++ b/models/silver/defi/dex/frax/silver_dex__fraxswap_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} diff --git a/models/silver/defi/dex/hashflow/silver_dex__hashflow_pools.sql b/models/silver/defi/dex/hashflow/silver_dex__hashflow_pools.sql index ac81be2e..f64138ae 100644 --- a/models/silver/defi/dex/hashflow/silver_dex__hashflow_pools.sql +++ b/models/silver/defi/dex/hashflow/silver_dex__hashflow_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH contract_deployments AS ( diff --git a/models/silver/defi/dex/hashflow/silver_dex__hashflow_swaps.sql b/models/silver/defi/dex/hashflow/silver_dex__hashflow_swaps.sql index 1cfcb566..1be3c9fa 100644 --- a/models/silver/defi/dex/hashflow/silver_dex__hashflow_swaps.sql +++ b/models/silver/defi/dex/hashflow/silver_dex__hashflow_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} diff --git a/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_pools.sql b/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_pools.sql index d0deef4a..4b87e20b 100644 --- a/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_pools.sql +++ b/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH contract_deployments AS ( diff --git a/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_swaps.sql b/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_swaps.sql index cf158681..dad31176 100644 --- a/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_swaps.sql +++ b/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_pools.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_pools.sql index 0c34829e..da408a86 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_pools.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_swaps.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_swaps.sql index 75555475..91570bd6 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_swaps.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_pools.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_pools.sql index 89138032..cef9648d 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_pools.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_swaps.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_swaps.sql index f6bf44ca..91024ace 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_swaps.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} diff --git a/models/silver/defi/dex/silver_dex__complete_dex_liquidity_pools.sql b/models/silver/defi/dex/silver_dex__complete_dex_liquidity_pools.sql index 0859e8d9..aeb90fd2 100644 --- a/models/silver/defi/dex/silver_dex__complete_dex_liquidity_pools.sql +++ b/models/silver/defi/dex/silver_dex__complete_dex_liquidity_pools.sql @@ -4,7 +4,7 @@ unique_key = ['block_number','platform','version'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, contract_address, pool_address, pool_name, tokens, symbols), SUBSTRING(pool_address, pool_name, tokens, symbols)", - tags = ['curated','reorg','heal'] + tags = ['silver_dex','defi','dex','curated','heal'] ) }} WITH contracts AS ( diff --git a/models/silver/defi/dex/silver_dex__complete_dex_swaps.sql b/models/silver/defi/dex/silver_dex__complete_dex_swaps.sql index 270cadd6..9fc5c867 100644 --- a/models/silver/defi/dex/silver_dex__complete_dex_swaps.sql +++ b/models/silver/defi/dex/silver_dex__complete_dex_swaps.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform','version'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_function_signature, origin_from_address, origin_to_address, contract_address, pool_name, event_name, sender, tx_to, token_in, token_out, symbol_in, symbol_out), SUBSTRING(origin_function_signature, pool_name, event_name, sender, tx_to, token_in, token_out, symbol_in, symbol_out)", - tags = ['curated','reorg','heal'] + tags = ['silver_dex','defi','dex','curated','heal'] ) }} WITH univ3 AS ( diff --git a/models/silver/defi/dex/sushi/silver_dex__sushi_pools.sql b/models/silver/defi/dex/sushi/silver_dex__sushi_pools.sql index 8415df07..0cd8cee3 100644 --- a/models/silver/defi/dex/sushi/silver_dex__sushi_pools.sql +++ b/models/silver/defi/dex/sushi/silver_dex__sushi_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/sushi/silver_dex__sushi_swaps.sql b/models/silver/defi/dex/sushi/silver_dex__sushi_swaps.sql index 4a438047..3857a3ea 100644 --- a/models/silver/defi/dex/sushi/silver_dex__sushi_swaps.sql +++ b/models/silver/defi/dex/sushi/silver_dex__sushi_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} diff --git a/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.sql b/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.sql index 429797f8..1760a5ab 100644 --- a/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.sql +++ b/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH swaps_base AS ( diff --git a/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.yml b/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.yml index c1532cfc..2d778d59 100644 --- a/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.yml +++ b/models/silver/defi/dex/synthetix/silver_dex__synthetix_swaps.yml @@ -8,7 +8,7 @@ models: - _log_id columns: - name: BLOCK_NUMBER - description: '{{ doc("opt_block_number") }}' + description: '{{ doc("evm_block_number") }}' tests: - not_null - dbt_expectations.expect_column_values_to_be_in_type_list: @@ -16,7 +16,7 @@ models: - NUMBER - FLOAT - name: BLOCK_TIMESTAMP - description: '{{ doc("opt_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' tests: - not_null - dbt_expectations.expect_row_values_to_have_recent_data: @@ -27,7 +27,7 @@ models: - TIMESTAMP_NTZ - TIMESTAMP_LTZ - name: TX_HASH - description: '{{ doc("opt_tx_hash") }}' + description: '{{ doc("evm_tx_hash") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: @@ -65,7 +65,7 @@ models: - STRING - VARCHAR - name: CONTRACT_ADDRESS - description: '{{ doc("opt_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' tests: - not_null - dbt_expectations.expect_column_values_to_match_regex: diff --git a/models/silver/defi/dex/uniswap/silver_dex__univ2_pools.sql b/models/silver/defi/dex/uniswap/silver_dex__univ2_pools.sql index 50d5a1fd..2e28f74b 100644 --- a/models/silver/defi/dex/uniswap/silver_dex__univ2_pools.sql +++ b/models/silver/defi/dex/uniswap/silver_dex__univ2_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/uniswap/silver_dex__univ2_swaps.sql b/models/silver/defi/dex/uniswap/silver_dex__univ2_swaps.sql index 4846c434..63ef5cf5 100644 --- a/models/silver/defi/dex/uniswap/silver_dex__univ2_swaps.sql +++ b/models/silver/defi/dex/uniswap/silver_dex__univ2_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/uniswap/silver_dex__univ3_pools.sql b/models/silver/defi/dex/uniswap/silver_dex__univ3_pools.sql index d31dfb7f..ca165795 100644 --- a/models/silver/defi/dex/uniswap/silver_dex__univ3_pools.sql +++ b/models/silver/defi/dex/uniswap/silver_dex__univ3_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'pool_address', cluster_by = ['block_timestamp::DATE'], - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH created_pools AS ( diff --git a/models/silver/defi/dex/uniswap/silver_dex__univ3_swaps.sql b/models/silver/defi/dex/uniswap/silver_dex__univ3_swaps.sql index 93b988bb..4fa3a97c 100644 --- a/models/silver/defi/dex/uniswap/silver_dex__univ3_swaps.sql +++ b/models/silver/defi/dex/uniswap/silver_dex__univ3_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} diff --git a/models/silver/defi/dex/velodrome/silver_dex__velodrome_v1_pools.sql b/models/silver/defi/dex/velodrome/silver_dex__velodrome_v1_pools.sql index 6a8d64f7..6e259c39 100644 --- a/models/silver/defi/dex/velodrome/silver_dex__velodrome_v1_pools.sql +++ b/models/silver/defi/dex/velodrome/silver_dex__velodrome_v1_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'pool_address', cluster_by = ['block_timestamp::DATE'], - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/velodrome/silver_dex__velodrome_v1_swaps.sql b/models/silver/defi/dex/velodrome/silver_dex__velodrome_v1_swaps.sql index 4c68e840..864d9ae3 100644 --- a/models/silver/defi/dex/velodrome/silver_dex__velodrome_v1_swaps.sql +++ b/models/silver/defi/dex/velodrome/silver_dex__velodrome_v1_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/velodrome/silver_dex__velodrome_v2_pools.sql b/models/silver/defi/dex/velodrome/silver_dex__velodrome_v2_pools.sql index b746fd26..99ee8794 100644 --- a/models/silver/defi/dex/velodrome/silver_dex__velodrome_v2_pools.sql +++ b/models/silver/defi/dex/velodrome/silver_dex__velodrome_v2_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'pool_address', cluster_by = ['block_timestamp::DATE'], - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} SELECT diff --git a/models/silver/defi/dex/velodrome/silver_dex__velodrome_v2_swaps.sql b/models/silver/defi/dex/velodrome/silver_dex__velodrome_v2_swaps.sql index 99be0370..630baff4 100644 --- a/models/silver/defi/dex/velodrome/silver_dex__velodrome_v2_swaps.sql +++ b/models/silver/defi/dex/velodrome/silver_dex__velodrome_v2_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} diff --git a/models/silver/defi/dex/woofi/silver_dex__woofi_swaps.sql b/models/silver/defi/dex/woofi/silver_dex__woofi_swaps.sql index 1bb1cb0a..99d2542e 100644 --- a/models/silver/defi/dex/woofi/silver_dex__woofi_swaps.sql +++ b/models/silver/defi/dex/woofi/silver_dex__woofi_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH router_swaps_base AS ( diff --git a/models/silver/defi/lending/aave/silver__aave_borrows.sql b/models/silver/defi/lending/aave/silver__aave_borrows.sql index 69533417..52dd0d53 100644 --- a/models/silver/defi/lending/aave/silver__aave_borrows.sql +++ b/models/silver/defi/lending/aave/silver__aave_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH --borrows from Aave LendingPool contracts diff --git a/models/silver/defi/lending/aave/silver__aave_deposits.sql b/models/silver/defi/lending/aave/silver__aave_deposits.sql index fa3b8f32..ddb9c736 100644 --- a/models/silver/defi/lending/aave/silver__aave_deposits.sql +++ b/models/silver/defi/lending/aave/silver__aave_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH deposits AS( diff --git a/models/silver/defi/lending/aave/silver__aave_flashloans.sql b/models/silver/defi/lending/aave/silver__aave_flashloans.sql index edddbd76..b0c2726d 100644 --- a/models/silver/defi/lending/aave/silver__aave_flashloans.sql +++ b/models/silver/defi/lending/aave/silver__aave_flashloans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH flashloan AS ( diff --git a/models/silver/defi/lending/aave/silver__aave_liquidations.sql b/models/silver/defi/lending/aave/silver__aave_liquidations.sql index 02bfe6f1..b94502c0 100644 --- a/models/silver/defi/lending/aave/silver__aave_liquidations.sql +++ b/models/silver/defi/lending/aave/silver__aave_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH liquidation AS( diff --git a/models/silver/defi/lending/aave/silver__aave_repayments.sql b/models/silver/defi/lending/aave/silver__aave_repayments.sql index b7d966ad..1dd68931 100644 --- a/models/silver/defi/lending/aave/silver__aave_repayments.sql +++ b/models/silver/defi/lending/aave/silver__aave_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH repay AS( diff --git a/models/silver/defi/lending/aave/silver__aave_tokens.sql b/models/silver/defi/lending/aave/silver__aave_tokens.sql index c39a4c53..36e1b166 100644 --- a/models/silver/defi/lending/aave/silver__aave_tokens.sql +++ b/models/silver/defi/lending/aave/silver__aave_tokens.sql @@ -1,6 +1,6 @@ {{ config( materialized = 'incremental', - tags = ['curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH DECODE AS ( diff --git a/models/silver/defi/lending/aave/silver__aave_withdraws.sql b/models/silver/defi/lending/aave/silver__aave_withdraws.sql index 646791f4..86754dac 100644 --- a/models/silver/defi/lending/aave/silver__aave_withdraws.sql +++ b/models/silver/defi/lending/aave/silver__aave_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH withdraw AS( diff --git a/models/silver/defi/lending/complete_lending/silver__complete_lending_borrows.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_borrows.sql index 7b00431a..9f6bfcf5 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_borrows.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_borrows.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, token_address, token_symbol, borrower, protocol_market), SUBSTRING(origin_function_signature, event_name, token_address, token_symbol, borrower, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/complete_lending/silver__complete_lending_deposits.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_deposits.sql index 9bf714cc..fa01545a 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_deposits.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_deposits.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, token_address, token_symbol, depositor, protocol_market), SUBSTRING(origin_function_signature, event_name, token_address, token_symbol, depositor, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/complete_lending/silver__complete_lending_flashloans.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_flashloans.sql index 90a182dc..63f8b1ae 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_flashloans.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_flashloans.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, flashloan_token, flashloan_token_symbol, protocol_market), SUBSTRING(origin_function_signature, event_name, flashloan_token, flashloan_token_symbol, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/complete_lending/silver__complete_lending_liquidations.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_liquidations.sql index 2610fc4a..245da681 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_liquidations.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_liquidations.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, liquidator, borrower, collateral_token, collateral_token_symbol, debt_token, debt_token_symbol, protocol_market), SUBSTRING(origin_function_signature, event_name, liquidator, borrower, collateral_token, collateral_token_symbol, debt_token, debt_token_symbol, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/complete_lending/silver__complete_lending_repayments.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_repayments.sql index 10b723ec..b1c59405 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_repayments.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_repayments.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, token_address, token_symbol, payer, borrower, protocol_market), SUBSTRING(origin_function_signature, event_name, token_address, token_symbol, payer, borrower, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/complete_lending/silver__complete_lending_withdraws.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_withdraws.sql index 57677f55..f0783b8d 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_withdraws.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_withdraws.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, token_address, token_symbol, depositor, protocol_market), SUBSTRING(origin_function_signature, event_name, token_address, token_symbol, depositor, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/exactly/silver__exactly_asset_details.sql b/models/silver/defi/lending/exactly/silver__exactly_asset_details.sql index dfedb0ff..72b06e6c 100644 --- a/models/silver/defi/lending/exactly/silver__exactly_asset_details.sql +++ b/models/silver/defi/lending/exactly/silver__exactly_asset_details.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH log_pull AS ( diff --git a/models/silver/defi/lending/exactly/silver__exactly_borrows.sql b/models/silver/defi/lending/exactly/silver__exactly_borrows.sql index 62c3091c..2c49f1a3 100644 --- a/models/silver/defi/lending/exactly/silver__exactly_borrows.sql +++ b/models/silver/defi/lending/exactly/silver__exactly_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/exactly/silver__exactly_deposits.sql b/models/silver/defi/lending/exactly/silver__exactly_deposits.sql index 18f0c883..4b5e8db9 100644 --- a/models/silver/defi/lending/exactly/silver__exactly_deposits.sql +++ b/models/silver/defi/lending/exactly/silver__exactly_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/exactly/silver__exactly_liquidations.sql b/models/silver/defi/lending/exactly/silver__exactly_liquidations.sql index 13e7e93b..98fbcf39 100644 --- a/models/silver/defi/lending/exactly/silver__exactly_liquidations.sql +++ b/models/silver/defi/lending/exactly/silver__exactly_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name -- add the collateral liquidated here diff --git a/models/silver/defi/lending/exactly/silver__exactly_repayments.sql b/models/silver/defi/lending/exactly/silver__exactly_repayments.sql index d4b3f37e..0c4aac74 100644 --- a/models/silver/defi/lending/exactly/silver__exactly_repayments.sql +++ b/models/silver/defi/lending/exactly/silver__exactly_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/exactly/silver__exactly_withdraws.sql b/models/silver/defi/lending/exactly/silver__exactly_withdraws.sql index d4c6c00e..ac9c0e6d 100644 --- a/models/silver/defi/lending/exactly/silver__exactly_withdraws.sql +++ b/models/silver/defi/lending/exactly/silver__exactly_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/granary/silver__granary_borrows.sql b/models/silver/defi/lending/granary/silver__granary_borrows.sql index adb48b3a..556c0882 100644 --- a/models/silver/defi/lending/granary/silver__granary_borrows.sql +++ b/models/silver/defi/lending/granary/silver__granary_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH --borrows from granary LendingPool contracts diff --git a/models/silver/defi/lending/granary/silver__granary_deposits.sql b/models/silver/defi/lending/granary/silver__granary_deposits.sql index 34c874cb..0aec9695 100644 --- a/models/silver/defi/lending/granary/silver__granary_deposits.sql +++ b/models/silver/defi/lending/granary/silver__granary_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH deposits AS( diff --git a/models/silver/defi/lending/granary/silver__granary_flashloans.sql b/models/silver/defi/lending/granary/silver__granary_flashloans.sql index 29ad1503..e0de18dd 100644 --- a/models/silver/defi/lending/granary/silver__granary_flashloans.sql +++ b/models/silver/defi/lending/granary/silver__granary_flashloans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH flashloan AS ( diff --git a/models/silver/defi/lending/granary/silver__granary_liquidations.sql b/models/silver/defi/lending/granary/silver__granary_liquidations.sql index 55a06a39..da18769e 100644 --- a/models/silver/defi/lending/granary/silver__granary_liquidations.sql +++ b/models/silver/defi/lending/granary/silver__granary_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH liquidation AS( diff --git a/models/silver/defi/lending/granary/silver__granary_repayments.sql b/models/silver/defi/lending/granary/silver__granary_repayments.sql index fb9e9388..7d0a59ec 100644 --- a/models/silver/defi/lending/granary/silver__granary_repayments.sql +++ b/models/silver/defi/lending/granary/silver__granary_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH repay AS( diff --git a/models/silver/defi/lending/granary/silver__granary_tokens.sql b/models/silver/defi/lending/granary/silver__granary_tokens.sql index f83e581b..088a3d0f 100644 --- a/models/silver/defi/lending/granary/silver__granary_tokens.sql +++ b/models/silver/defi/lending/granary/silver__granary_tokens.sql @@ -1,6 +1,6 @@ {{ config( materialized = 'incremental', - tags = ['curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH DECODE AS ( diff --git a/models/silver/defi/lending/granary/silver__granary_withdraws.sql b/models/silver/defi/lending/granary/silver__granary_withdraws.sql index b73d2e25..5cd0b6a4 100644 --- a/models/silver/defi/lending/granary/silver__granary_withdraws.sql +++ b/models/silver/defi/lending/granary/silver__granary_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH withdraw AS( diff --git a/models/silver/defi/lending/sonne/silver__sonne_asset_details.sql b/models/silver/defi/lending/sonne/silver__sonne_asset_details.sql index 4239c27e..0c445c73 100644 --- a/models/silver/defi/lending/sonne/silver__sonne_asset_details.sql +++ b/models/silver/defi/lending/sonne/silver__sonne_asset_details.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH log_pull AS ( diff --git a/models/silver/defi/lending/sonne/silver__sonne_borrows.sql b/models/silver/defi/lending/sonne/silver__sonne_borrows.sql index 1cb6e71b..344482fe 100644 --- a/models/silver/defi/lending/sonne/silver__sonne_borrows.sql +++ b/models/silver/defi/lending/sonne/silver__sonne_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/sonne/silver__sonne_deposits.sql b/models/silver/defi/lending/sonne/silver__sonne_deposits.sql index c59aeb41..5f89041a 100644 --- a/models/silver/defi/lending/sonne/silver__sonne_deposits.sql +++ b/models/silver/defi/lending/sonne/silver__sonne_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/sonne/silver__sonne_liquidations.sql b/models/silver/defi/lending/sonne/silver__sonne_liquidations.sql index 0ad13d2d..e834d389 100644 --- a/models/silver/defi/lending/sonne/silver__sonne_liquidations.sql +++ b/models/silver/defi/lending/sonne/silver__sonne_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH asset_details AS ( diff --git a/models/silver/defi/lending/sonne/silver__sonne_repayments.sql b/models/silver/defi/lending/sonne/silver__sonne_repayments.sql index 9068cd95..9f55476e 100644 --- a/models/silver/defi/lending/sonne/silver__sonne_repayments.sql +++ b/models/silver/defi/lending/sonne/silver__sonne_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/sonne/silver__sonne_withdraws.sql b/models/silver/defi/lending/sonne/silver__sonne_withdraws.sql index 7142b445..2cf21bdc 100644 --- a/models/silver/defi/lending/sonne/silver__sonne_withdraws.sql +++ b/models/silver/defi/lending/sonne/silver__sonne_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} -- pull all token addresses and corresponding name WITH asset_details AS ( diff --git a/models/silver/defi/lending/tarot/silver__tarot_borrows.sql b/models/silver/defi/lending/tarot/silver__tarot_borrows.sql index 076d6d71..2ba2b5b7 100644 --- a/models/silver/defi/lending/tarot/silver__tarot_borrows.sql +++ b/models/silver/defi/lending/tarot/silver__tarot_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH asset_details AS ( diff --git a/models/silver/defi/lending/tarot/silver__tarot_deposits.sql b/models/silver/defi/lending/tarot/silver__tarot_deposits.sql index 6ccb60cf..33147402 100644 --- a/models/silver/defi/lending/tarot/silver__tarot_deposits.sql +++ b/models/silver/defi/lending/tarot/silver__tarot_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH asset_details AS ( diff --git a/models/silver/defi/lending/tarot/silver__tarot_liquidations.sql b/models/silver/defi/lending/tarot/silver__tarot_liquidations.sql index ea147492..e6637b0f 100644 --- a/models/silver/defi/lending/tarot/silver__tarot_liquidations.sql +++ b/models/silver/defi/lending/tarot/silver__tarot_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} with asset_details as ( diff --git a/models/silver/defi/lending/tarot/silver__tarot_liquidity_pools.sql b/models/silver/defi/lending/tarot/silver__tarot_liquidity_pools.sql index 0907c5f2..b4c6e536 100644 --- a/models/silver/defi/lending/tarot/silver__tarot_liquidity_pools.sql +++ b/models/silver/defi/lending/tarot/silver__tarot_liquidity_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH factory_pull AS ( diff --git a/models/silver/defi/lending/tarot/silver__tarot_repayments.sql b/models/silver/defi/lending/tarot/silver__tarot_repayments.sql index 67f2f481..be37e907 100644 --- a/models/silver/defi/lending/tarot/silver__tarot_repayments.sql +++ b/models/silver/defi/lending/tarot/silver__tarot_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH asset_details AS ( diff --git a/models/silver/defi/lending/tarot/silver__tarot_withdraws.sql b/models/silver/defi/lending/tarot/silver__tarot_withdraws.sql index 6f25c52b..10c05515 100644 --- a/models/silver/defi/lending/tarot/silver__tarot_withdraws.sql +++ b/models/silver/defi/lending/tarot/silver__tarot_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} with asset_details as ( diff --git a/models/silver/ethereum/silver__state_hashes.sql b/models/silver/ethereum/silver__state_hashes.sql index edb122fe..45bdb53e 100644 --- a/models/silver/ethereum/silver__state_hashes.sql +++ b/models/silver/ethereum/silver__state_hashes.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['state_block_timestamp::DATE'], - tags = ['ethereum','non_realtime'] + tags = ['silver','ethereum'] ) }} WITH base AS ( @@ -77,4 +77,4 @@ FROM ON block_number BETWEEN state_min_block AND state_max_block QUALIFY(ROW_NUMBER() over(PARTITION BY block_number ORDER BY - state_block_timestamp DESC)) = 1 + state_block_timestamp DESC)) = 1 \ No newline at end of file diff --git a/models/silver/ethereum/silver__submission_hashes.sql b/models/silver/ethereum/silver__submission_hashes.sql index 88b0b003..f4b4255f 100644 --- a/models/silver/ethereum/silver__submission_hashes.sql +++ b/models/silver/ethereum/silver__submission_hashes.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['l1_submission_block_timestamp::DATE'], - tags = ['ethereum','non_realtime'] + tags = ['silver','ethereum'] ) }} WITH base AS ( @@ -62,4 +62,4 @@ FROM blocks INNER JOIN base ON block_number BETWEEN sub_min_block - AND sub_max_block + AND sub_max_block \ No newline at end of file diff --git a/models/silver/governance/silver__delegations.sql b/models/silver/governance/silver__delegations.sql index f60d565a..9c87afe1 100644 --- a/models/silver/governance/silver__delegations.sql +++ b/models/silver/governance/silver__delegations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['non_realtime'] + tags = ['silver','governance', 'curated'] ) }} SELECT diff --git a/models/silver/labels/silver__labels.sql b/models/silver/labels/silver__labels.sql deleted file mode 100644 index ed350136..00000000 --- a/models/silver/labels/silver__labels.sql +++ /dev/null @@ -1,40 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = ['address', 'blockchain'], - incremental_strategy = 'merge', - merge_exclude_columns = ["inserted_timestamp"], - cluster_by = 'modified_timestamp::DATE', - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(address, label_type, label_subtype, address_name, project_name), SUBSTRING(address, label_type, label_subtype, address_name, project_name); DELETE FROM {{ this }} WHERE _is_deleted = TRUE;", - tags = ['non_realtime'] -) }} - -SELECT - system_created_at, - insert_date, - blockchain, - address, - creator, - label_type, - label_subtype, - address_name, - project_name, - _is_deleted, - labels_combined_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {{ ref('bronze__labels') }} -WHERE - 1 = 1 - -{% if is_incremental() %} -AND modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} -) -{% endif %} diff --git a/models/silver/nft/sales/silver__aggregator_list.sql b/models/silver/nft/sales/silver__aggregator_list.sql index e6c109f7..825a361c 100644 --- a/models/silver/nft/sales/silver__aggregator_list.sql +++ b/models/silver/nft/sales/silver__aggregator_list.sql @@ -2,7 +2,8 @@ materialized = 'incremental', unique_key = 'aggregator_identifier', merge_update_columns = ['aggregator_identifier', 'aggregator', 'aggregator_type'], - full_refresh = false + full_refresh = false, + tags = ['silver','nft','curated'] ) }} diff --git a/models/silver/nft/sales/silver__complete_nft_sales.sql b/models/silver/nft/sales/silver__complete_nft_sales.sql index 73fae264..a28e5041 100644 --- a/models/silver/nft/sales/silver__complete_nft_sales.sql +++ b/models/silver/nft/sales/silver__complete_nft_sales.sql @@ -4,7 +4,7 @@ unique_key = ['block_number','platform_exchange_version'], cluster_by = ['block_timestamp::DATE','platform_name'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_function_signature, origin_from_address, origin_to_address, event_type, platform_address, platform_exchange_version, seller_address, buyer_address, nft_address, project_name, currency_address, currency_symbol), SUBSTRING(origin_function_signature, event_type, platform_address, platform_exchange_version, seller_address, buyer_address, nft_address, project_name, currency_address, currency_symbol)", - tags = ['curated','reorg','heal'] + tags = ['silver','nft','curated', 'heal'] ) }} WITH nft_base_models AS ( diff --git a/models/silver/nft/sales/silver__element_sales.sql b/models/silver/nft/sales/silver__element_sales.sql index 5c1276b0..c19d5fcd 100644 --- a/models/silver/nft/sales/silver__element_sales.sql +++ b/models/silver/nft/sales/silver__element_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH settings AS ( diff --git a/models/silver/nft/sales/silver__quix_sales.sql b/models/silver/nft/sales/silver__quix_sales.sql index 215e415b..251197ac 100644 --- a/models/silver/nft/sales/silver__quix_sales.sql +++ b/models/silver/nft/sales/silver__quix_sales.sql @@ -190,24 +190,24 @@ eth_payment_raw AS ( tx_hash, from_address, to_address, - value, + VALUE, CASE - WHEN to_address = '0xec1557a67d4980c948cd473075293204f4d280fd' THEN value + WHEN to_address = '0xec1557a67d4980c948cd473075293204f4d280fd' THEN VALUE ELSE 0 END AS platform_fee_raw_, CASE WHEN ROW_NUMBER() over ( PARTITION BY tx_hash ORDER BY - value DESC + VALUE DESC ) = 1 - AND platform_fee_raw_ = 0 THEN value + AND platform_fee_raw_ = 0 THEN VALUE ELSE 0 END AS sale_amount_raw_, CASE WHEN sale_amount_raw_ = 0 AND platform_fee_raw_ = 0 - AND to_address != '0xec1557a67d4980c948cd473075293204f4d280fd' THEN value + AND to_address != '0xec1557a67d4980c948cd473075293204f4d280fd' THEN VALUE ELSE 0 END AS creator_fee_raw_ FROM @@ -232,7 +232,7 @@ eth_payment_raw AS ( TYPE, trace_address ) != 'CALL_ORIGIN' - AND value > 0 + AND VALUE > 0 AND from_address IN ( '0xe5c7b4865d7f2b08faadf3f6d392e6d6fa7b903c', -- v1 @@ -343,10 +343,10 @@ nft_transfers AS ( tx_hash, to_address AS buyer_address, contract_address AS nft_address, - tokenId, - erc1155_value + token_id AS tokenId, + quantity AS erc1155_value FROM - {{ ref('silver__nft_transfers') }} + {{ ref('nft__ez_nft_transfers') }} WHERE block_timestamp :: DATE >= '2021-12-01' AND tx_hash IN ( diff --git a/models/silver/nft/sales/silver__quix_seaport_sales.sql b/models/silver/nft/sales/silver__quix_seaport_sales.sql index 1c1518c8..63109940 100644 --- a/models/silver/nft/sales/silver__quix_seaport_sales.sql +++ b/models/silver/nft/sales/silver__quix_seaport_sales.sql @@ -1066,8 +1066,8 @@ nft_transfers AS ( to_address AS final_nft_to_address, event_index, contract_address, - tokenId, - erc1155_value, + token_id AS tokenId, + quantity AS erc1155_value, CONCAT( tx_hash, '-', @@ -1076,7 +1076,7 @@ nft_transfers AS ( tokenId ) AS nft_id FROM - {{ ref('silver__nft_transfers') }} + {{ ref('nft__ez_nft_transfers') }} WHERE block_timestamp :: DATE >= '2022-07-01' AND tx_hash IN ( @@ -1087,7 +1087,7 @@ nft_transfers AS ( ) {% if is_incremental() %} -AND _inserted_timestamp >= ( +AND inserted_timestamp >= ( SELECT MAX( _inserted_timestamp diff --git a/models/silver/nft/sales/silver__seaport_1_5_sales.sql b/models/silver/nft/sales/silver__seaport_1_5_sales.sql index 33120a54..40d007b9 100644 --- a/models/silver/nft/sales/silver__seaport_1_5_sales.sql +++ b/models/silver/nft/sales/silver__seaport_1_5_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH seaport_fees_wallet AS ( diff --git a/models/silver/nft/sales/silver__seaport_1_6_sales.sql b/models/silver/nft/sales/silver__seaport_1_6_sales.sql index c93f1406..563fd35a 100644 --- a/models/silver/nft/sales/silver__seaport_1_6_sales.sql +++ b/models/silver/nft/sales/silver__seaport_1_6_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH seaport_fees_wallet AS ( diff --git a/models/silver/nft/silver__nft_transfers.sql b/models/silver/nft/silver__nft_transfers.sql deleted file mode 100644 index 5e6ce8bf..00000000 --- a/models/silver/nft/silver__nft_transfers.sql +++ /dev/null @@ -1,446 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'block_number', - cluster_by = ['block_timestamp::DATE', '_inserted_timestamp::DATE'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, contract_address, project_name, from_address, to_address, event_type, token_transfer_type), SUBSTRING(contract_address, project_name, from_address, to_address, event_type, token_transfer_type)", - tags = ['curated','reorg', 'heal'] -) }} - -WITH base AS ( - - SELECT - CONCAT( - tx_hash :: STRING, - '-', - event_index :: STRING - ) AS _log_id, - block_number, - tx_hash, - block_timestamp, - event_index, - contract_address, - topics, - DATA, - regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}') AS segmented_data, - TO_TIMESTAMP_NTZ(modified_timestamp) AS _inserted_timestamp - FROM - {{ ref('core__fact_event_logs') }} - WHERE - tx_succeeded - AND ( - ( - topics [0] :: STRING = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' - AND DATA = '0x' - AND topics [3] IS NOT NULL - ) --erc721s - OR ( - topics [0] :: STRING = '0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62' - ) --erc1155s - OR ( - topics [0] :: STRING = '0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb' - ) --erc1155s TransferBatch event - ) - -{% if is_incremental() %} -AND TO_TIMESTAMP_NTZ(_inserted_timestamp) >= ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '24 hours' - FROM - {{ this }} -) -{% endif %} -), -erc721s AS ( - SELECT - _log_id, - block_number, - tx_hash, - block_timestamp, - contract_address, - CONCAT('0x', SUBSTR(topics [1] :: STRING, 27, 40)) AS from_address, - CONCAT('0x', SUBSTR(topics [2] :: STRING, 27, 40)) AS to_address, - utils.udf_hex_to_int( - topics [3] :: STRING - ) :: STRING AS token_id, - NULL AS erc1155_value, - _inserted_timestamp, - event_index - FROM - base - WHERE - topics [0] :: STRING = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' - AND DATA = '0x' - AND topics [3] IS NOT NULL -), -transfer_singles AS ( - SELECT - _log_id, - block_number, - tx_hash, - block_timestamp, - contract_address, - CONCAT('0x', SUBSTR(topics [1] :: STRING, 27, 40)) AS operator_address, - CONCAT('0x', SUBSTR(topics [2] :: STRING, 27, 40)) AS from_address, - CONCAT('0x', SUBSTR(topics [3] :: STRING, 27, 40)) AS to_address, - utils.udf_hex_to_int( - segmented_data [0] :: STRING - ) :: STRING AS token_id, - utils.udf_hex_to_int( - segmented_data [1] :: STRING - ) :: STRING AS erc1155_value, - _inserted_timestamp, - event_index - FROM - base - WHERE - topics [0] :: STRING = '0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62' - AND to_address IS NOT NULL -), -transfer_batch_raw AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - segmented_data, - CONCAT('0x', SUBSTR(topics [1] :: STRING, 27, 40)) AS operator_address, - CONCAT('0x', SUBSTR(topics [2] :: STRING, 27, 40)) AS from_address, - CONCAT('0x', SUBSTR(topics [3] :: STRING, 27, 40)) AS to_address, - contract_address, - utils.udf_hex_to_int( - segmented_data [2] :: STRING - ) AS tokenid_length, - tokenid_length AS quantity_length, - CONCAT( - tx_hash :: STRING, - '-', - event_index :: STRING - ) AS _log_id, - _inserted_timestamp - FROM - base - WHERE - topics [0] :: STRING = '0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb' - AND to_address IS NOT NULL -), -flattened AS ( - SELECT - block_number, - block_timestamp, - _log_id, - _inserted_timestamp, - tx_hash, - event_index, - operator_address, - from_address, - to_address, - contract_address, - INDEX, - VALUE, - tokenid_length, - quantity_length, - 2 + tokenid_length AS tokenid_indextag, - 4 + tokenid_length AS quantity_indextag_start, - 4 + tokenid_length + tokenid_length AS quantity_indextag_end, - CASE - WHEN INDEX BETWEEN 3 - AND ( - tokenid_indextag - ) THEN 'tokenid' - WHEN INDEX BETWEEN ( - quantity_indextag_start - ) - AND ( - quantity_indextag_end - ) THEN 'quantity' - ELSE NULL - END AS label - FROM - transfer_batch_raw, - LATERAL FLATTEN ( - input => segmented_data - ) -), -tokenid_list AS ( - SELECT - block_number, - block_timestamp, - _log_id, - _inserted_timestamp, - tx_hash, - event_index, - operator_address, - from_address, - to_address, - contract_address, - utils.udf_hex_to_int( - VALUE :: STRING - ) :: STRING AS tokenId, - ROW_NUMBER() over ( - PARTITION BY tx_hash, - event_index - ORDER BY - INDEX ASC - ) AS tokenid_order - FROM - flattened - WHERE - label = 'tokenid' -), -quantity_list AS ( - SELECT - tx_hash, - event_index, - utils.udf_hex_to_int( - VALUE :: STRING - ) :: STRING AS quantity, - ROW_NUMBER() over ( - PARTITION BY tx_hash, - event_index - ORDER BY - INDEX ASC - ) AS quantity_order - FROM - flattened - WHERE - label = 'quantity' -), -transfer_batch_final AS ( - SELECT - block_number, - block_timestamp, - _log_id, - _inserted_timestamp, - t.tx_hash, - t.event_index, - operator_address, - from_address, - to_address, - contract_address, - t.tokenId AS token_id, - q.quantity AS erc1155_value, - tokenid_order AS intra_event_index - FROM - tokenid_list t - INNER JOIN quantity_list q - ON t.tx_hash = q.tx_hash - AND t.event_index = q.event_index - AND t.tokenid_order = q.quantity_order -), -all_transfers AS ( - SELECT - block_number, - tx_hash, - block_timestamp, - contract_address, - from_address, - to_address, - token_id, - erc1155_value, - _inserted_timestamp, - event_index, - 1 AS intra_event_index, - 'erc721_Transfer' AS token_transfer_type, - CONCAT( - _log_id, - '-', - contract_address, - '-', - token_id - ) AS _log_id - FROM - erc721s - UNION ALL - SELECT - block_number, - tx_hash, - block_timestamp, - contract_address, - from_address, - to_address, - token_id, - erc1155_value, - _inserted_timestamp, - event_index, - 1 AS intra_event_index, - 'erc1155_TransferSingle' AS token_transfer_type, - CONCAT( - _log_id, - '-', - contract_address, - '-', - token_id - ) AS _log_id - FROM - transfer_singles - WHERE - erc1155_value != '0' - UNION ALL - SELECT - block_number, - tx_hash, - block_timestamp, - contract_address, - from_address, - to_address, - token_id, - erc1155_value, - _inserted_timestamp, - event_index, - intra_event_index, - 'erc1155_TransferBatch' AS token_transfer_type, - CONCAT( - _log_id, - '-', - contract_address, - '-', - token_id, - '-', - intra_event_index - ) AS _log_id - FROM - transfer_batch_final - WHERE - erc1155_value != '0' -), -transfer_base AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - intra_event_index, - contract_address, - C.token_name AS project_name, - from_address, - to_address, - A.token_id AS tokenId, - erc1155_value, - CASE - WHEN from_address = '0x0000000000000000000000000000000000000000' THEN 'mint' - ELSE 'other' - END AS event_type, - token_transfer_type, - A._log_id, - A._inserted_timestamp - FROM - all_transfers A - LEFT JOIN {{ ref('silver__contracts') }} C USING (contract_address) - WHERE - to_address IS NOT NULL -) - -{% if is_incremental() and var( - 'HEAL_MODEL' -) %}, -heal_model AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - intra_event_index, - contract_address, - C.token_name AS project_name, - from_address, - to_address, - tokenId, - erc1155_value, - event_type, - token_transfer_type, - _log_id, - t._inserted_timestamp - FROM - {{ this }} - t - LEFT JOIN {{ ref('silver__contracts') }} C USING (contract_address) - WHERE - t.block_number IN ( - SELECT - DISTINCT t1.block_number AS block_number - FROM - {{ this }} - t1 - WHERE - t1.project_name IS NULL - AND _inserted_timestamp < ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '{{ var("LOOKBACK", "4 hours") }}' - FROM - {{ this }} - ) - AND EXISTS ( - SELECT - 1 - FROM - {{ ref('silver__contracts') }} C - WHERE - C._inserted_timestamp > DATEADD('DAY', -14, SYSDATE()) - AND C.token_name IS NOT NULL - AND C.contract_address = t1.contract_address) - ) - ) - {% endif %} - SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - intra_event_index, - contract_address, - A.project_name, - from_address, - to_address, - tokenId, - erc1155_value, - event_type, - token_transfer_type, - _log_id, - A._inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash','event_index','intra_event_index'] - ) }} AS nft_transfers_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id - FROM - transfer_base A qualify ROW_NUMBER() over ( - PARTITION BY _log_id - ORDER BY - A._inserted_timestamp DESC - ) = 1 - -{% if is_incremental() and var( - 'HEAL_MODEL' -) %} -UNION ALL -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - intra_event_index, - contract_address, - project_name, - from_address, - to_address, - tokenId, - erc1155_value, - event_type, - token_transfer_type, - _log_id, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash','event_index','intra_event_index'] - ) }} AS nft_transfers_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - heal_model -{% endif %} diff --git a/models/silver/nft/silver__nft_transfers.yml b/models/silver/nft/silver__nft_transfers.yml deleted file mode 100644 index 6ba35b35..00000000 --- a/models/silver/nft/silver__nft_transfers.yml +++ /dev/null @@ -1,66 +0,0 @@ - -version: 2 -models: - - name: silver__nft_transfers - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: EVENT_INDEX - tests: - - not_null - - name: INTRA_EVENT_INDEX - tests: - - not_null - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: FROM_ADDRESS - tests: - - not_null: - where: BLOCK_TIMESTAMP > '2021-08-01' - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TOKENID - tests: - - not_null - - name: _LOG_ID - tests: - - not_null - - name: _INSERTED_TIMESTAMP - tests: - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ \ No newline at end of file diff --git a/models/silver/overflow/formatted_views/silver__overflowed_traces.sql b/models/silver/overflow/formatted_views/silver__overflowed_traces.sql deleted file mode 100644 index 948c8ce4..00000000 --- a/models/silver/overflow/formatted_views/silver__overflowed_traces.sql +++ /dev/null @@ -1,117 +0,0 @@ --- depends_on: {{ ref('bronze__overflowed_traces') }} -{% set warehouse = 'DBT_SNOWPARK' if var('OVERFLOWED_TRACES') else target.warehouse %} -{{ config ( - materialized = "incremental", - incremental_strategy = 'delete+insert', - unique_key = ['block_number','tx_position'], - cluster_by = ['modified_timestamp::DATE','partition_key'], - tags = ['overflowed_traces'], - full_refresh = false, - snowflake_warehouse = warehouse -) }} - -{% if is_incremental() %} -WITH bronze_overflowed_traces AS ( - - SELECT - block_number :: INT AS block_number, - ROUND( - block_number, - -3 - ) AS partition_key, - index_vals [1] :: INT AS tx_position, - IFF( - path IN ( - 'result', - 'result.value', - 'result.type', - 'result.to', - 'result.input', - 'result.gasUsed', - 'result.gas', - 'result.from', - 'result.output', - 'result.error', - 'result.revertReason', - 'result.time', - 'gasUsed', - 'gas', - 'type', - 'to', - 'from', - 'value', - 'input', - 'error', - 'output', - 'revertReason', - 'time' - ), - 'ORIGIN', - REGEXP_REPLACE(REGEXP_REPLACE(path, '[^0-9]+', '_'), '^_|_$', '') - ) AS trace_address, - SYSDATE() :: timestamp_ltz AS _inserted_timestamp, - OBJECT_AGG( - key, - value_ - ) AS trace_json, - CASE - WHEN trace_address = 'ORIGIN' THEN NULL - WHEN POSITION( - '_' IN trace_address - ) = 0 THEN 'ORIGIN' - ELSE REGEXP_REPLACE( - trace_address, - '_[0-9]+$', - '', - 1, - 1 - ) - END AS parent_trace_address, - SPLIT( - trace_address, - '_' - ) AS trace_address_array - FROM - {{ ref("bronze__overflowed_traces") }} - GROUP BY - block_number, - tx_position, - trace_address, - _inserted_timestamp -) -SELECT - block_number, - tx_position, - trace_address, - parent_trace_address, - trace_address_array, - trace_json, - partition_key, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['block_number', 'tx_position', 'trace_address'] - ) }} AS traces_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - bronze_overflowed_traces qualify(ROW_NUMBER() over(PARTITION BY traces_id -ORDER BY - _inserted_timestamp DESC)) = 1 -{% else %} -SELECT - NULL :: INT AS block_number, - NULL :: INT tx_position, - NULL :: text AS trace_address, - NULL :: text AS parent_trace_address, - NULL :: ARRAY AS trace_address_array, - NULL :: OBJECT AS trace_json, - NULL :: INT AS partition_key, - NULL :: timestamp_ltz AS _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['block_number', 'tx_position', 'trace_address'] - ) }} AS traces_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -{% endif %} diff --git a/models/silver/overflow/run_models/silver__run_overflowed_traces.sql b/models/silver/overflow/run_models/silver__run_overflowed_traces.sql deleted file mode 100644 index 1b5356ac..00000000 --- a/models/silver/overflow/run_models/silver__run_overflowed_traces.sql +++ /dev/null @@ -1,52 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - tags = ['observability'] -) }} - -WITH base AS ( - - SELECT - blocks_impacted_count - FROM - {{ ref('silver_observability__traces_completeness') }} - WHERE - test_timestamp > DATEADD('day', -5, CURRENT_TIMESTAMP()) - ORDER BY - test_timestamp DESC - LIMIT - 1), run_model AS ( - SELECT - blocks_impacted_count, - github_actions.workflow_dispatches( - 'FlipsideCrypto', - 'optimism-models', - 'dbt_run_overflowed_traces.yml', - NULL - ) AS run_overflow_models - FROM - base - WHERE - blocks_impacted_count > 0 - ) - SELECT - dummy, - COALESCE( - blocks_impacted_count, - 0 - ) AS blocks_impacted_count, - COALESCE( - run_overflow_models, - OBJECT_CONSTRUCT( - 'status', - 'skipped' - ) - ) AS run_overflow_models, - SYSDATE() AS test_timestamp - FROM - ( - SELECT - 1 AS dummy - ) - LEFT JOIN run_model - ON 1 = 1 diff --git a/models/silver/prices/silver__complete_native_asset_metadata.sql b/models/silver/prices/silver__complete_native_asset_metadata.sql deleted file mode 100644 index a81b6a6e..00000000 --- a/models/silver/prices/silver__complete_native_asset_metadata.sql +++ /dev/null @@ -1,38 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'complete_native_asset_metadata_id', - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_id, symbol, name),SUBSTRING(asset_id, symbol, name)", - tags = ['non_realtime'] -) }} - -SELECT - asset_id, - symbol, - NAME, - decimals, - blockchain, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_native_asset_metadata_id, - _invocation_id -FROM - {{ ref( - 'bronze__complete_native_asset_metadata' - ) }} - -{% if is_incremental() %} -WHERE - modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} - ) -{% endif %} diff --git a/models/silver/prices/silver__complete_native_asset_metadata.yml b/models/silver/prices/silver__complete_native_asset_metadata.yml deleted file mode 100644 index 1c1fdf1c..00000000 --- a/models/silver/prices/silver__complete_native_asset_metadata.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: 2 -models: - - name: silver__complete_native_asset_metadata - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - SYMBOL - - columns: - - name: PROVIDER - tests: - - not_null - - name: SYMBOL - tests: - - not_null - - name: BLOCKCHAIN - tests: - - not_null - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - name: COMPLETE_NATIVE_ASSET_METADATA_ID - tests: - - unique \ No newline at end of file diff --git a/models/silver/prices/silver__complete_native_prices.sql b/models/silver/prices/silver__complete_native_prices.sql deleted file mode 100644 index ec99925c..00000000 --- a/models/silver/prices/silver__complete_native_prices.sql +++ /dev/null @@ -1,42 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'complete_native_prices_id', - cluster_by = ['hour::DATE'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_id, symbol, name),SUBSTRING(asset_id, symbol, name)", - tags = ['non_realtime'] -) }} - -SELECT - HOUR, - asset_id, - symbol, - NAME, - decimals, - price, - blockchain, - is_imputed, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_native_prices_id, - _invocation_id -FROM - {{ ref( - 'bronze__complete_native_prices' - ) }} - -{% if is_incremental() %} -WHERE - modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} - ) -{% endif %} diff --git a/models/silver/prices/silver__complete_native_prices.yml b/models/silver/prices/silver__complete_native_prices.yml deleted file mode 100644 index bb724335..00000000 --- a/models/silver/prices/silver__complete_native_prices.yml +++ /dev/null @@ -1,37 +0,0 @@ -version: 2 -models: - - name: silver__complete_native_prices - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - HOUR - - SYMBOL - - columns: - - name: HOUR - tests: - - not_null - - name: SYMBOL - tests: - - not_null - - name: BLOCKCHAIN - tests: - - not_null - - name: PROVIDER - tests: - - not_null - - name: PRICE - tests: - - not_null - - name: IS_IMPUTED - tests: - - not_null - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - name: COMPLETE_NATIVE_PRICES_ID - tests: - - unique \ No newline at end of file diff --git a/models/silver/prices/silver__complete_provider_asset_metadata.sql b/models/silver/prices/silver__complete_provider_asset_metadata.sql deleted file mode 100644 index b981c9ca..00000000 --- a/models/silver/prices/silver__complete_provider_asset_metadata.sql +++ /dev/null @@ -1,38 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'complete_provider_asset_metadata_id', - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_id, token_address, symbol, name),SUBSTRING(asset_id, token_address, symbol, name)", - tags = ['non_realtime'] -) }} - -SELECT - asset_id, - token_address, - NAME, - symbol, - platform, - platform_id, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_provider_asset_metadata_id, - _invocation_id -FROM - {{ ref( - 'bronze__complete_provider_asset_metadata' - ) }} - -{% if is_incremental() %} -WHERE - modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} - ) -{% endif %} \ No newline at end of file diff --git a/models/silver/prices/silver__complete_provider_asset_metadata.yml b/models/silver/prices/silver__complete_provider_asset_metadata.yml deleted file mode 100644 index 8fa56fd8..00000000 --- a/models/silver/prices/silver__complete_provider_asset_metadata.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: 2 -models: - - name: silver__complete_provider_asset_metadata - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - ASSET_ID - - TOKEN_ADDRESS - - NAME - - SYMBOL - - PLATFORM - - PLATFORM_ID - - PROVIDER - columns: - - name: PROVIDER - tests: - - not_null - - name: ASSET_ID - tests: - - not_null - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - name: COMPLETE_PROVIDER_ASSET_METADATA_ID - tests: - - unique \ No newline at end of file diff --git a/models/silver/prices/silver__complete_provider_prices.sql b/models/silver/prices/silver__complete_provider_prices.sql deleted file mode 100644 index a8be434f..00000000 --- a/models/silver/prices/silver__complete_provider_prices.sql +++ /dev/null @@ -1,47 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'complete_provider_prices_id', - cluster_by = ['recorded_hour::DATE','provider'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_id),SUBSTRING(asset_id)", - tags = ['non_realtime'] -) }} - -SELECT - p.asset_id, - recorded_hour, - OPEN, - high, - low, - CLOSE, - p.provider, - p.source, - p._inserted_timestamp, - p.inserted_timestamp, - p.modified_timestamp, - p.complete_provider_prices_id, - p._invocation_id -FROM - {{ ref( - 'bronze__complete_provider_prices' - ) }} - p - INNER JOIN {{ ref('bronze__complete_provider_asset_metadata') }} - m - ON p.asset_id = m.asset_id - -{% if is_incremental() %} -WHERE - p.modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} - ) -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY p.asset_id, recorded_hour, p.provider -ORDER BY - p.modified_timestamp DESC)) = 1 diff --git a/models/silver/prices/silver__complete_provider_prices.yml b/models/silver/prices/silver__complete_provider_prices.yml deleted file mode 100644 index 8db23c7e..00000000 --- a/models/silver/prices/silver__complete_provider_prices.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: 2 -models: - - name: silver__complete_provider_prices - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - ASSET_ID - - RECORDED_HOUR - - PROVIDER - columns: - - name: PROVIDER - tests: - - not_null - - name: ASSET_ID - tests: - - not_null - - name: RECORDED_HOUR - tests: - - not_null - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - name: COMPLETE_PROVIDER_PRICES_ID - tests: - - unique \ No newline at end of file diff --git a/models/silver/prices/silver__complete_token_asset_metadata.sql b/models/silver/prices/silver__complete_token_asset_metadata.sql deleted file mode 100644 index f5339b80..00000000 --- a/models/silver/prices/silver__complete_token_asset_metadata.sql +++ /dev/null @@ -1,43 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'complete_token_asset_metadata_id', - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_id, token_address, symbol, name),SUBSTRING(asset_id, token_address, symbol, name)", - tags = ['non_realtime'] -) }} - -SELECT - LOWER( - A.token_address - ) AS token_address, - asset_id, - symbol, - NAME, - decimals, - blockchain, - blockchain_name, - blockchain_id, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_token_asset_metadata_id, - _invocation_id -FROM - {{ ref( - 'bronze__complete_token_asset_metadata' - ) }} A - -{% if is_incremental() %} -WHERE - modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} - ) -{% endif %} diff --git a/models/silver/prices/silver__complete_token_asset_metadata.yml b/models/silver/prices/silver__complete_token_asset_metadata.yml deleted file mode 100644 index 3eea590e..00000000 --- a/models/silver/prices/silver__complete_token_asset_metadata.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 2 -models: - - name: silver__complete_token_asset_metadata - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TOKEN_ADDRESS - - BLOCKCHAIN - - columns: - - name: PROVIDER - tests: - - not_null - - name: TOKEN_ADDRESS - tests: - - not_null - - name: BLOCKCHAIN - tests: - - not_null - - name: BLOCKCHAIN_ID - tests: - - not_null - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - name: COMPLETE_TOKEN_ASSET_METADATA_ID - tests: - - unique \ No newline at end of file diff --git a/models/silver/prices/silver__complete_token_prices.sql b/models/silver/prices/silver__complete_token_prices.sql deleted file mode 100644 index f8e64424..00000000 --- a/models/silver/prices/silver__complete_token_prices.sql +++ /dev/null @@ -1,48 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'complete_token_prices_id', - cluster_by = ['hour::DATE'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(asset_id, token_address, symbol, name),SUBSTRING(asset_id, token_address, symbol, name)", - tags = ['non_realtime'] -) }} - -SELECT - HOUR, - LOWER( - p.token_address - ) AS token_address, - asset_id, - symbol, - NAME, - decimals, - price, - blockchain, - blockchain_name, - blockchain_id, - is_imputed, - is_deprecated, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_token_prices_id, - _invocation_id -FROM - {{ ref( - 'bronze__complete_token_prices' - ) }} - p - -{% if is_incremental() %} -WHERE - modified_timestamp >= ( - SELECT - MAX( - modified_timestamp - ) - FROM - {{ this }} - ) -{% endif %} diff --git a/models/silver/prices/silver__complete_token_prices.yml b/models/silver/prices/silver__complete_token_prices.yml deleted file mode 100644 index d2ac57f5..00000000 --- a/models/silver/prices/silver__complete_token_prices.yml +++ /dev/null @@ -1,41 +0,0 @@ -version: 2 -models: - - name: silver__complete_token_prices - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - HOUR - - TOKEN_ADDRESS - - BLOCKCHAIN - - columns: - - name: HOUR - tests: - - not_null - - name: TOKEN_ADDRESS - tests: - - not_null - - name: BLOCKCHAIN - tests: - - not_null - - name: BLOCKCHAIN_ID - tests: - - not_null - - name: PROVIDER - tests: - - not_null - - name: PRICE - tests: - - not_null - - name: IS_IMPUTED - tests: - - not_null - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - name: COMPLETE_TOKEN_PRICES_ID - tests: - - unique \ No newline at end of file diff --git a/models/silver/protocols/olas/metadata/silver_olas__getservice_reads.sql b/models/silver/protocols/olas/metadata/silver_olas__getservice_reads.sql index 0cfa3d2d..8ec84dab 100644 --- a/models/silver/protocols/olas/metadata/silver_olas__getservice_reads.sql +++ b/models/silver/protocols/olas/metadata/silver_olas__getservice_reads.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'getservice_reads_id', full_refresh = false, - tags = ['curated'] + tags = ['silver_olas','curated','olas'] ) }} WITH service_contracts AS ( diff --git a/models/silver/protocols/olas/metadata/silver_olas__registry_metadata.sql b/models/silver/protocols/olas/metadata/silver_olas__registry_metadata.sql index 843fce62..29219d39 100644 --- a/models/silver/protocols/olas/metadata/silver_olas__registry_metadata.sql +++ b/models/silver/protocols/olas/metadata/silver_olas__registry_metadata.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'registry_metadata_id', full_refresh = false, - tags = ['curated'] + tags = ['silver_olas','curated','olas'] ) }} WITH new_records AS ( diff --git a/models/silver/protocols/olas/metadata/silver_olas__registry_metadata_complete.sql b/models/silver/protocols/olas/metadata/silver_olas__registry_metadata_complete.sql index c1030bc7..b88b0b8f 100644 --- a/models/silver/protocols/olas/metadata/silver_olas__registry_metadata_complete.sql +++ b/models/silver/protocols/olas/metadata/silver_olas__registry_metadata_complete.sql @@ -1,5 +1,6 @@ {{ config( - materialized = 'view' + materialized = 'view', + tags = ['silver_olas','curated','olas'] ) }} SELECT diff --git a/models/silver/protocols/olas/metadata/silver_olas__registry_reads.sql b/models/silver/protocols/olas/metadata/silver_olas__registry_reads.sql index 09205166..6ded31fe 100644 --- a/models/silver/protocols/olas/metadata/silver_olas__registry_reads.sql +++ b/models/silver/protocols/olas/metadata/silver_olas__registry_reads.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'registry_reads_id', full_refresh = false, - tags = ['curated'] + tags = ['silver_olas','curated','olas'] ) }} WITH service_contracts AS ( diff --git a/models/silver/protocols/olas/silver_olas__create_service_multisigs.sql b/models/silver/protocols/olas/silver_olas__create_service_multisigs.sql index db76c3e7..4ece5afe 100644 --- a/models/silver/protocols/olas/silver_olas__create_service_multisigs.sql +++ b/models/silver/protocols/olas/silver_olas__create_service_multisigs.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_olas','curated','olas'] ) }} SELECT diff --git a/models/silver/protocols/olas/silver_olas__service_event_logs.sql b/models/silver/protocols/olas/silver_olas__service_event_logs.sql index 19954200..9a3b65a5 100644 --- a/models/silver/protocols/olas/silver_olas__service_event_logs.sql +++ b/models/silver/protocols/olas/silver_olas__service_event_logs.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_olas','curated','olas'] ) }} WITH service_multisigs AS ( diff --git a/models/silver/protocols/olas/silver_olas__service_registrations.sql b/models/silver/protocols/olas/silver_olas__service_registrations.sql index df3770a4..6cc7221e 100644 --- a/models/silver/protocols/olas/silver_olas__service_registrations.sql +++ b/models/silver/protocols/olas/silver_olas__service_registrations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg','heal'] + tags = ['silver_olas','curated','olas','heal'] ) }} WITH registry_evt AS ( diff --git a/models/silver/stats/silver_stats__core_metrics_hourly.sql b/models/silver/stats/silver_stats__core_metrics_hourly.sql deleted file mode 100644 index b08810d3..00000000 --- a/models/silver/stats/silver_stats__core_metrics_hourly.sql +++ /dev/null @@ -1,80 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_timestamp_hour", - cluster_by = ['block_timestamp_hour::DATE'], - tags = ['curated'] -) }} -/* run incremental timestamp value first then use it as a static value */ -{% if execute %} - -{% if is_incremental() %} -{% set query %} - -SELECT - MIN(DATE_TRUNC('hour', block_timestamp)) block_timestamp_hour -FROM - {{ ref('core__fact_transactions') }} -WHERE - modified_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - FROM - {{ this }} - ) {% endset %} - {% set min_block_timestamp_hour = run_query(query).columns [0].values() [0] %} -{% endif %} -{% endif %} -SELECT - DATE_TRUNC( - 'hour', - block_timestamp - ) AS block_timestamp_hour, - MIN(block_number) AS block_number_min, - MAX(block_number) AS block_number_max, - COUNT( - DISTINCT block_number - ) AS block_count, - COUNT( - DISTINCT tx_hash - ) AS transaction_count, - COUNT( - DISTINCT CASE - WHEN tx_succeeded THEN tx_hash - END - ) AS transaction_count_success, - COUNT( - DISTINCT CASE - WHEN NOT tx_succeeded THEN tx_hash - END - ) AS transaction_count_failed, - COUNT( - DISTINCT from_address - ) AS unique_from_count, - COUNT( - DISTINCT to_address - ) AS unique_to_count, - SUM(tx_fee_precise) AS total_fees, - MAX(modified_timestamp) AS _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['block_timestamp_hour'] - ) }} AS core_metrics_hourly_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {{ ref('core__fact_transactions') }} -WHERE - block_timestamp_hour < DATE_TRUNC( - 'hour', - CURRENT_TIMESTAMP - ) - -{% if is_incremental() %} -AND DATE_TRUNC( - 'hour', - block_timestamp -) >= '{{ min_block_timestamp_hour }}' -{% endif %} -GROUP BY - 1 diff --git a/models/silver/stats/silver_stats__core_metrics_hourly.yml b/models/silver/stats/silver_stats__core_metrics_hourly.yml deleted file mode 100644 index df231f39..00000000 --- a/models/silver/stats/silver_stats__core_metrics_hourly.yml +++ /dev/null @@ -1,84 +0,0 @@ -version: 2 -models: - - name: silver_stats__core_metrics_hourly - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - BLOCK_TIMESTAMP_HOUR - columns: - - name: BLOCK_TIMESTAMP_HOUR - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: BLOCK_NUMBER_MIN - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_NUMBER_MAX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_COUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRANSACTION_COUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRANSACTION_COUNT_SUCCESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRANSACTION_COUNT_FAILED - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: UNIQUE_FROM_COUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: UNIQUE_TO_COUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TOTAL_FEES - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - DECIMAL - - FLOAT - - NUMBER - - name: _INSERTED_TIMESTAMP - tests: - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 diff --git a/models/silver/utilities/silver__number_sequence.sql b/models/silver/utilities/silver__number_sequence.sql deleted file mode 100644 index 8c3502e3..00000000 --- a/models/silver/utilities/silver__number_sequence.sql +++ /dev/null @@ -1,13 +0,0 @@ -{{ config( - materialized = 'table', - cluster_by = 'round(_id,-3)', - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION" -) }} - -SELECT - ROW_NUMBER() over ( - ORDER BY - SEQ4() - ) - 1 :: INT AS _id -FROM - TABLE(GENERATOR(rowcount => 500000001)) diff --git a/models/sources.yml b/models/sources.yml index edc635c7..c7b6e3eb 100644 --- a/models/sources.yml +++ b/models/sources.yml @@ -1,44 +1,10 @@ version: 2 sources: - - name: prod - database: chainwalkers - schema: prod - tables: - - name: optimism_blocks - - name: optimism_txs - - name: crosschain - database: "{{ 'crosschain' if target.database == 'OPTIMISM' else 'crosschain_dev' }}" - schema: core - tables: - - name: dim_labels - - name: ethereum_silver - database: ethereum - schema: silver - tables: - - name: optimism_state_hashes - - name: optimism_submission_hashes - - name: silver_crosschain - database: "{{ 'crosschain' if target.database == 'OPTIMISM' else 'crosschain_dev' }}" - schema: silver - tables: - - name: near_address_encoded - - name: labels_combined - - name: complete_token_asset_metadata - - name: complete_token_prices - - name: complete_provider_asset_metadata - - name: complete_provider_prices - - name: complete_native_asset_metadata - - name: complete_native_prices - - name: crosschain_public - database: crosschain - schema: bronze_public - tables: - - name: user_abis - name: bronze_streamline database: streamline schema: | - {{ var('GLOBAL_PROD_DB_NAME') ~ ('_dev' if var("STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES", False) else '') }} + {{ target.database.upper() | replace('_DEV', '') ~ '_DEV' if var("STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES", False) else target.database.upper() | replace('_DEV', '') }} tables: - name: receipts - name: blocks @@ -52,19 +18,38 @@ sources: - name: traces_v2 - name: confirm_blocks_v2 - name: decoded_logs_v2 - - name: optimism_silver - database: optimism + - name: contract_abis + - name: crosschain_silver + database: >- + {{ 'CROSSCHAIN_DEV' if '_DEV' in target.database.upper() else 'CROSSCHAIN' }} schema: silver tables: - - name: verified_abis - - name: overflowed_traces - - name: optimism_bronze_api - database: optimism - schema: bronze_api + - name: near_address_encoded + - name: labels_combined + - name: complete_provider_asset_metadata + - name: complete_native_asset_metadata + - name: complete_native_prices + - name: complete_provider_prices + - name: complete_token_asset_metadata + - name: complete_token_prices + - name: ethereum_silver + database: ethereum + schema: silver tables: - - name: contract_abis + - name: optimism_state_hashes + - name: optimism_submission_hashes + - name: crosschain_public + database: crosschain + schema: bronze_public + tables: + - name: user_abis + - name: complete_streamline + database: "{{ target.database }}" + schema: streamline + tables: + - name: complete_contract_abis - name: github_actions - database: optimism + database: "{{ target.database }}" schema: github_actions tables: - name: workflows @@ -73,8 +58,22 @@ sources: schema: defillama tables: - name: dim_chains - - name: optimism_gold - database: "{{ 'optimism' if target.database == 'OPTIMISM' else 'optimism_dev' }}" - schema: core + - name: abis_silver + database: "{{ target.database }}" + schema: silver tables: - - name: fact_traces + - name: verified_abis + - name: complete_event_abis + - name: fsc_evm_admin + database: >- + {{ 'FSC_EVM_DEV' if '_DEV' in target.database.upper() else 'FSC_EVM' }} + schema: admin + tables: + - name: _master_keys + - name: rpc_node_logs + - name: logs_temp + database: "{{ target.database }}" + schema: silver + tables: + - name: logs + - name: decoded_logs \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__blocks.sql b/models/streamline/bronze/core/bronze__blocks.sql index aa987cf1..b5611e02 100644 --- a/models/streamline/bronze/core/bronze__blocks.sql +++ b/models/streamline/bronze/core/bronze__blocks.sql @@ -1,39 +1,14 @@ -{# Set variables #} -{% set source_name = 'BLOCKS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) or var('GLOBAL_USES_BLOCKS_TRANSACTIONS_PATH', false) else '' %} -{% set model_type = '' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query( + source_name = 'blocks', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__blocks_fr.sql b/models/streamline/bronze/core/bronze__blocks_fr.sql index 33ad98f4..470f3e99 100644 --- a/models/streamline/bronze/core/bronze__blocks_fr.sql +++ b/models/streamline/bronze/core/bronze__blocks_fr.sql @@ -1,6 +1,9 @@ +{# Log configuration details #} +{{ fsc_evm.log_model_details() }} + {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} SELECT @@ -13,7 +16,6 @@ SELECT _inserted_timestamp FROM {{ ref('bronze__blocks_fr_v2') }} -{% if var('GLOBAL_USES_STREAMLINE_V1', false) %} UNION ALL SELECT _partition_by_block_id AS partition_key, @@ -24,18 +26,4 @@ SELECT file_name, _inserted_timestamp FROM - {{ ref('bronze__blocks_fr_v1') }} -{% endif %} -{% if var('GLOBAL_USES_BLOCKS_TRANSACTIONS_PATH', false) %} -UNION ALL -SELECT - partition_key, - block_number, - VALUE, - DATA, - metadata, - file_name, - _inserted_timestamp -FROM - {{ ref('bronze__blocks_fr_v2_1') }} -{% endif %} \ No newline at end of file + {{ ref('bronze__blocks_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__blocks_fr_v1.sql b/models/streamline/bronze/core/bronze__blocks_fr_v1.sql index b45639a6..6b0b0bc5 100644 --- a/models/streamline/bronze/core/bronze__blocks_fr_v1.sql +++ b/models/streamline/bronze/core/bronze__blocks_fr_v1.sql @@ -1,40 +1,16 @@ -{# Set variables #} -{% set source_name = 'BLOCKS' %} -{% set source_version = '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" %} -{% set partition_join_key = '_partition_by_block_id' %} -{% set balances = default_vars['balances'] %} -{% set block_number = false %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core_streamline_v1'] + tags = ['bronze','core','streamline_v1','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'blocks', + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", + partition_join_key = "_partition_by_block_id", + block_number = false ) }} diff --git a/models/streamline/bronze/core/bronze__blocks_fr_v2.sql b/models/streamline/bronze/core/bronze__blocks_fr_v2.sql index 91576bd6..32dcd1d4 100644 --- a/models/streamline/bronze/core/bronze__blocks_fr_v2.sql +++ b/models/streamline/bronze/core/bronze__blocks_fr_v2.sql @@ -1,40 +1,14 @@ -{# Set variables #} -{% set source_name = 'BLOCKS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'blocks', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__confirm_blocks.sql b/models/streamline/bronze/core/bronze__confirm_blocks.sql index 031fdb2c..2927de05 100644 --- a/models/streamline/bronze/core/bronze__confirm_blocks.sql +++ b/models/streamline/bronze/core/bronze__confirm_blocks.sql @@ -1,39 +1,14 @@ -{# Set variables #} -{% set source_name = 'CONFIRM_BLOCKS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = '' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','confirm_blocks','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query( + source_name = 'confirm_blocks', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__confirm_blocks_fr.sql b/models/streamline/bronze/core/bronze__confirm_blocks_fr.sql index ebf8ac69..5b4a5e83 100644 --- a/models/streamline/bronze/core/bronze__confirm_blocks_fr.sql +++ b/models/streamline/bronze/core/bronze__confirm_blocks_fr.sql @@ -1,6 +1,9 @@ +{# Log configuration details #} +{{ fsc_evm.log_model_details() }} + {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','confirm_blocks','phase_1'] ) }} SELECT @@ -13,7 +16,6 @@ SELECT _inserted_timestamp FROM {{ ref('bronze__confirm_blocks_fr_v2') }} -{% if var('GLOBAL_USES_STREAMLINE_V1', false) %} UNION ALL SELECT _partition_by_block_id AS partition_key, @@ -24,5 +26,4 @@ SELECT file_name, _inserted_timestamp FROM - {{ ref('bronze__confirm_blocks_fr_v1') }} -{% endif %} \ No newline at end of file + {{ ref('bronze__confirm_blocks_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__confirm_blocks_fr_v1.sql b/models/streamline/bronze/core/bronze__confirm_blocks_fr_v1.sql index a4402e53..b65db0d9 100644 --- a/models/streamline/bronze/core/bronze__confirm_blocks_fr_v1.sql +++ b/models/streamline/bronze/core/bronze__confirm_blocks_fr_v1.sql @@ -1,40 +1,17 @@ -{# Set variables #} -{% set source_name = 'CONFIRM_BLOCKS' %} -{% set source_version = '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" %} -{% set partition_join_key = '_partition_by_block_id' %} -{% set balances = default_vars['balances'] %} -{% set block_number = false %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core_streamline_v1'] + tags = ['bronze','core','streamline_v1','confirm_blocks','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'confirm_blocks', + source_version = '', + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", + partition_join_key = "_partition_by_block_id", + block_number = false ) }} diff --git a/models/streamline/bronze/core/bronze__confirm_blocks_fr_v2.sql b/models/streamline/bronze/core/bronze__confirm_blocks_fr_v2.sql index d03c45b9..f14b4582 100644 --- a/models/streamline/bronze/core/bronze__confirm_blocks_fr_v2.sql +++ b/models/streamline/bronze/core/bronze__confirm_blocks_fr_v2.sql @@ -1,40 +1,14 @@ -{# Set variables #} -{% set source_name = 'CONFIRM_BLOCKS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','confirm_blocks','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'confirm_blocks', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__receipts.sql b/models/streamline/bronze/core/bronze__receipts.sql index 21d84b90..4e167d2a 100644 --- a/models/streamline/bronze/core/bronze__receipts.sql +++ b/models/streamline/bronze/core/bronze__receipts.sql @@ -1,39 +1,14 @@ -{# Set variables #} -{% set source_name = 'RECEIPTS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = '' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_receipts'] + tags = ['bronze','core','receipts','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query( + source_name = 'receipts', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__receipts_by_hash.sql b/models/streamline/bronze/core/bronze__receipts_by_hash.sql new file mode 100644 index 00000000..e69de29b diff --git a/models/streamline/bronze/core/bronze__receipts_by_hash_fr.sql b/models/streamline/bronze/core/bronze__receipts_by_hash_fr.sql new file mode 100644 index 00000000..e69de29b diff --git a/models/streamline/bronze/core/bronze__receipts_fr.sql b/models/streamline/bronze/core/bronze__receipts_fr.sql index 3b861c06..9b46789c 100644 --- a/models/streamline/bronze/core/bronze__receipts_fr.sql +++ b/models/streamline/bronze/core/bronze__receipts_fr.sql @@ -1,6 +1,9 @@ +{# Log configuration details #} +{{ fsc_evm.log_model_details() }} + {{ config ( materialized = 'view', - tags = ['bronze_receipts'] + tags = ['bronze','core','receipts','phase_1'] ) }} SELECT @@ -14,25 +17,18 @@ SELECT _inserted_timestamp FROM {{ ref('bronze__receipts_fr_v2') }} - - {% if var('GLOBAL_USES_STREAMLINE_V1',false) %} - UNION ALL - SELECT - _partition_by_block_id AS partition_key, - block_number, - COALESCE( - VALUE :"array_index" :: INT, - TRY_TO_NUMBER( - utils.udf_hex_to_int( - VALUE :"data" :"transactionIndex" :: STRING - ) - ) - ) AS array_index, - VALUE, - DATA, - metadata, - file_name, - _inserted_timestamp - FROM - {{ ref('bronze__receipts_fr_v1') }} - {% endif %} +UNION ALL +SELECT + _partition_by_block_id AS partition_key, + block_number, + COALESCE( + VALUE :array_index :: INT, + TRY_TO_NUMBER(utils.udf_hex_to_int(VALUE :data :"transactionIndex" :: STRING)) + ) AS array_index, + VALUE, + DATA, + metadata, + file_name, + _inserted_timestamp +FROM + {{ ref('bronze__receipts_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__receipts_fr_v1.sql b/models/streamline/bronze/core/bronze__receipts_fr_v1.sql index 6c4956e2..edba56df 100644 --- a/models/streamline/bronze/core/bronze__receipts_fr_v1.sql +++ b/models/streamline/bronze/core/bronze__receipts_fr_v1.sql @@ -1,40 +1,17 @@ -{# Set variables #} -{% set source_name = 'RECEIPTS' %} -{% set source_version = '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" %} -{% set partition_join_key = '_partition_by_block_id' %} -{% set balances = default_vars['balances'] %} -{% set block_number = false %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core_streamline_v1','bronze_receipts'] -) }} + tags = ['bronze','core','streamline_v1','receipts','phase_1'] +) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} \ No newline at end of file +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'receipts', + source_version = '', + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", + partition_join_key = "_partition_by_block_id", + block_number = false +) }} diff --git a/models/streamline/bronze/core/bronze__receipts_fr_v2.sql b/models/streamline/bronze/core/bronze__receipts_fr_v2.sql index 90e0a071..cf74f3cc 100644 --- a/models/streamline/bronze/core/bronze__receipts_fr_v2.sql +++ b/models/streamline/bronze/core/bronze__receipts_fr_v2.sql @@ -1,40 +1,14 @@ -{# Set variables #} -{% set source_name = 'RECEIPTS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_receipts'] + tags = ['bronze','core','receipts','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'receipts', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__traces.sql b/models/streamline/bronze/core/bronze__traces.sql index f8661762..98031337 100644 --- a/models/streamline/bronze/core/bronze__traces.sql +++ b/models/streamline/bronze/core/bronze__traces.sql @@ -1,39 +1,14 @@ -{# Set variables #} -{% set source_name = 'TRACES' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = '' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query( + source_name = 'traces', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__traces_fr.sql b/models/streamline/bronze/core/bronze__traces_fr.sql index b150c368..74b915f0 100644 --- a/models/streamline/bronze/core/bronze__traces_fr.sql +++ b/models/streamline/bronze/core/bronze__traces_fr.sql @@ -1,6 +1,9 @@ +{# Log configuration details #} +{{ fsc_evm.log_model_details() }} + {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} SELECT @@ -14,7 +17,6 @@ SELECT _inserted_timestamp FROM {{ ref('bronze__traces_fr_v2') }} -{% if var('GLOBAL_USES_STREAMLINE_V1', false) %} UNION ALL SELECT _partition_by_block_id AS partition_key, @@ -26,5 +28,4 @@ SELECT file_name, _inserted_timestamp FROM - {{ ref('bronze__traces_fr_v1') }} -{% endif %} \ No newline at end of file + {{ ref('bronze__traces_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__traces_fr_v1.sql b/models/streamline/bronze/core/bronze__traces_fr_v1.sql index 3905c1b8..6456d291 100644 --- a/models/streamline/bronze/core/bronze__traces_fr_v1.sql +++ b/models/streamline/bronze/core/bronze__traces_fr_v1.sql @@ -1,40 +1,16 @@ -{# Set variables #} -{% set source_name = 'DEBUG_TRACEBLOCKBYNUMBER' if var('GLOBAL_USES_SINGLE_FLIGHT_METHOD',false) else 'TRACES' %} -{% set source_version = '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" %} -{% set partition_join_key = '_partition_by_block_id' %} -{% set balances = default_vars['balances'] %} -{% set block_number = false %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core_streamline_v1'] + tags = ['bronze','core','streamline_v1','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'debug_traceblockbynumber', + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", + partition_join_key = "_partition_by_block_id", + block_number = false ) }} diff --git a/models/streamline/bronze/core/bronze__traces_fr_v2.sql b/models/streamline/bronze/core/bronze__traces_fr_v2.sql index 04158254..facbd5d2 100644 --- a/models/streamline/bronze/core/bronze__traces_fr_v2.sql +++ b/models/streamline/bronze/core/bronze__traces_fr_v2.sql @@ -1,40 +1,14 @@ -{# Set variables #} -{% set source_name = 'TRACES' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'traces', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__transactions.sql b/models/streamline/bronze/core/bronze__transactions.sql index 8b6ba90c..df93172f 100644 --- a/models/streamline/bronze/core/bronze__transactions.sql +++ b/models/streamline/bronze/core/bronze__transactions.sql @@ -1,39 +1,14 @@ -{# Set variables #} -{% set source_name = 'TRANSACTIONS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) or var('GLOBAL_USES_BLOCKS_TRANSACTIONS_PATH', false) else '' %} -{% set model_type = '' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query( + source_name = 'transactions', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__transactions_fr.sql b/models/streamline/bronze/core/bronze__transactions_fr.sql index 2721f1d7..ccb3e1bb 100644 --- a/models/streamline/bronze/core/bronze__transactions_fr.sql +++ b/models/streamline/bronze/core/bronze__transactions_fr.sql @@ -1,6 +1,9 @@ +{# Log configuration details #} +{{ fsc_evm.log_model_details() }} + {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} SELECT @@ -13,7 +16,6 @@ SELECT _inserted_timestamp FROM {{ ref('bronze__transactions_fr_v2') }} -{% if var('GLOBAL_USES_STREAMLINE_V1', false) %} UNION ALL SELECT _partition_by_block_id AS partition_key, @@ -24,18 +26,4 @@ SELECT file_name, _inserted_timestamp FROM - {{ ref('bronze__transactions_fr_v1') }} -{% endif %} -{% if var('GLOBAL_USES_BLOCKS_TRANSACTIONS_PATH', false) %} -UNION ALL -SELECT - partition_key, - block_number, - VALUE, - DATA, - metadata, - file_name, - _inserted_timestamp -FROM - {{ ref('bronze__transactions_fr_v2_1') }} -{% endif %} \ No newline at end of file + {{ ref('bronze__transactions_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__transactions_fr_v1.sql b/models/streamline/bronze/core/bronze__transactions_fr_v1.sql index 41179ac7..54e50ad3 100644 --- a/models/streamline/bronze/core/bronze__transactions_fr_v1.sql +++ b/models/streamline/bronze/core/bronze__transactions_fr_v1.sql @@ -1,40 +1,16 @@ -{# Set variables #} -{% set source_name = 'TRANSACTIONS' %} -{% set source_version = '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" %} -{% set partition_join_key = '_partition_by_block_id' %} -{% set balances = default_vars['balances'] %} -{% set block_number = false %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core_streamline_v1'] + tags = ['bronze','core','streamline_v1','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'transactions', + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", + partition_join_key = "_partition_by_block_id", + block_number = false ) }} diff --git a/models/streamline/bronze/core/bronze__transactions_fr_v2.sql b/models/streamline/bronze/core/bronze__transactions_fr_v2.sql index 7907074d..25da349d 100644 --- a/models/streamline/bronze/core/bronze__transactions_fr_v2.sql +++ b/models/streamline/bronze/core/bronze__transactions_fr_v2.sql @@ -1,40 +1,14 @@ -{# Set variables #} -{% set source_name = 'TRANSACTIONS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - -{% set partition_function = default_vars['partition_function'] %} -{% set partition_join_key = default_vars['partition_join_key'] %} -{% set balances = default_vars['balances'] %} -{% set block_number = default_vars['block_number'] %} -{% set uses_receipts_by_hash = default_vars['uses_receipts_by_hash'] %} - {# Log configuration details #} -{{ log_bronze_details( - source_name = source_name, - source_version = source_version, - model_type = model_type, - partition_function = partition_function, - partition_join_key = partition_join_key, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_core'] + tags = ['bronze','core','phase_1'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_fr( - source_name = source_name.lower(), - source_version = source_version.lower(), - partition_function = partition_function, - partition_join_key = partition_join_key, - balances = balances, - block_number = block_number, - uses_receipts_by_hash = uses_receipts_by_hash +{{ fsc_evm.streamline_external_table_query_fr( + source_name = 'transactions', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/decoder/bronze__decoded_logs.sql b/models/streamline/bronze/decoder/bronze__decoded_logs.sql index 8a339c61..1d5264a4 100644 --- a/models/streamline/bronze/decoder/bronze__decoded_logs.sql +++ b/models/streamline/bronze/decoder/bronze__decoded_logs.sql @@ -1,23 +1,14 @@ -{# Set variables #} -{% set source_name = 'DECODED_LOGS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = '' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - {# Log configuration details #} -{{ log_model_details( - vars = default_vars -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_decoded_logs'] + tags = ['bronze','decoded_logs','phase_2'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_decoder( - source_name = source_name.lower(), - source_version = source_version.lower() +{{ fsc_evm.streamline_external_table_query_decoder( + source_name = 'decoded_logs', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/decoder/bronze__decoded_logs_fr.sql b/models/streamline/bronze/decoder/bronze__decoded_logs_fr.sql index bbe59557..03e1cfb5 100644 --- a/models/streamline/bronze/decoder/bronze__decoded_logs_fr.sql +++ b/models/streamline/bronze/decoder/bronze__decoded_logs_fr.sql @@ -1,20 +1,18 @@ {# Log configuration details #} -{{ log_model_details() }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_decoded_logs'] + tags = ['bronze','decoded_logs','phase_2'] ) }} SELECT * FROM {{ ref('bronze__decoded_logs_fr_v2') }} -{% if var('GLOBAL_USES_STREAMLINE_V1', false) %} UNION ALL SELECT * FROM - {{ ref('bronze__decoded_logs_fr_v1') }} -{% endif %} + {{ ref('bronze__decoded_logs_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/decoder/bronze__decoded_logs_fr_v1.sql b/models/streamline/bronze/decoder/bronze__decoded_logs_fr_v1.sql index 8c122fa9..20e47dd2 100644 --- a/models/streamline/bronze/decoder/bronze__decoded_logs_fr_v1.sql +++ b/models/streamline/bronze/decoder/bronze__decoded_logs_fr_v1.sql @@ -1,23 +1,13 @@ -{# Set variables #} -{% set source_name = 'DECODED_LOGS' %} -{% set source_version = '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - {# Log configuration details #} -{{ log_model_details( - vars = default_vars -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_decoded_logs_streamline_v1'] + tags = ['bronze','decoded_logs','streamline_v1','phase_2'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_decoder_fr( - source_name = source_name.lower(), - source_version = source_version.lower() +{{ fsc_evm.streamline_external_table_query_decoder_fr( + source_name = 'decoded_logs' ) }} \ No newline at end of file diff --git a/models/streamline/bronze/decoder/bronze__decoded_logs_fr_v2.sql b/models/streamline/bronze/decoder/bronze__decoded_logs_fr_v2.sql index 2bd430a1..c849a83a 100644 --- a/models/streamline/bronze/decoder/bronze__decoded_logs_fr_v2.sql +++ b/models/streamline/bronze/decoder/bronze__decoded_logs_fr_v2.sql @@ -1,23 +1,14 @@ -{# Set variables #} -{% set source_name = 'DECODED_LOGS' %} -{% set source_version = 'V2' if var('GLOBAL_USES_STREAMLINE_V1', false) else '' %} -{% set model_type = 'FR' %} - -{%- set default_vars = set_default_variables_bronze(source_name, model_type) -%} - {# Log configuration details #} -{{ log_model_details( - vars = default_vars -) }} +{{ fsc_evm.log_model_details() }} {# Set up dbt configuration #} {{ config ( materialized = 'view', - tags = ['bronze_decoded_logs'] + tags = ['bronze','decoded_logs','phase_2'] ) }} {# Main query starts here #} -{{ streamline_external_table_query_decoder_fr( - source_name = source_name.lower(), - source_version = source_version.lower() +{{ fsc_evm.streamline_external_table_query_decoder_fr( + source_name = 'decoded_logs', + source_version = 'v2' ) }} \ No newline at end of file diff --git a/models/streamline/silver/_24_hour_lookback.sql b/models/streamline/silver/_24_hour_lookback.sql deleted file mode 100644 index e9d060f8..00000000 --- a/models/streamline/silver/_24_hour_lookback.sql +++ /dev/null @@ -1,26 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH max_time AS ( - - SELECT - MAX(block_timestamp) AS max_timestamp - FROM - {{ ref("silver__blocks") }} -) -SELECT - MIN(block_number) AS block_number -FROM - {{ ref("silver__blocks") }} - JOIN max_time - ON block_timestamp BETWEEN DATEADD( - 'hour', - -25, - max_timestamp - ) - AND DATEADD( - 'hour', - -24, - max_timestamp - ) diff --git a/models/streamline/silver/_block_lookback.sql b/models/streamline/silver/_block_lookback.sql deleted file mode 100644 index f37bcf61..00000000 --- a/models/streamline/silver/_block_lookback.sql +++ /dev/null @@ -1,11 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -SELECT - MIN(block_number) AS block_number -FROM - {{ ref("silver__blocks") }} -WHERE - block_timestamp >= DATEADD('hour', -72, TRUNCATE(SYSDATE(), 'HOUR')) - AND block_timestamp < DATEADD('hour', -71, TRUNCATE(SYSDATE(), 'HOUR')) diff --git a/models/streamline/silver/_max_block_by_date.sql b/models/streamline/silver/_max_block_by_date.sql deleted file mode 100644 index a56cf82d..00000000 --- a/models/streamline/silver/_max_block_by_date.sql +++ /dev/null @@ -1,27 +0,0 @@ -{{ config ( - materialized = "ephemeral", - unique_key = "block_number", -) }} - -WITH base AS ( - - SELECT - block_timestamp :: DATE AS block_date, - MAX(block_number) block_number - FROM - {{ ref("silver__blocks") }} - GROUP BY - block_timestamp :: DATE -) -SELECT - block_date, - block_number -FROM - base -WHERE - block_date <> ( - SELECT - MAX(block_date) - FROM - base - ) \ No newline at end of file diff --git a/models/streamline/silver/_max_block_by_hour.sql b/models/streamline/silver/_max_block_by_hour.sql deleted file mode 100644 index 80e3d972..00000000 --- a/models/streamline/silver/_max_block_by_hour.sql +++ /dev/null @@ -1,37 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH base AS ( - - SELECT - DATE_TRUNC( - 'hour', - block_timestamp - ) AS block_hour, - MAX(block_number) block_number - FROM - {{ ref("silver__blocks") }} - WHERE - block_timestamp > DATEADD( - 'day', - -5, - CURRENT_DATE - ) - GROUP BY - 1 -) -SELECT - block_hour, - block_number -FROM - base -WHERE - block_hour <> ( - SELECT - MAX( - block_hour - ) - FROM - base - ) diff --git a/models/streamline/silver/core/complete/streamline__blocks_complete.sql b/models/streamline/silver/core/complete/streamline__blocks_complete.sql deleted file mode 100644 index 4c8977d8..00000000 --- a/models/streamline/silver/core/complete/streamline__blocks_complete.sql +++ /dev/null @@ -1,50 +0,0 @@ -{# Set variables #} -{%- set source_name = 'BLOCKS' -%} -{%- set model_type = 'COMPLETE' -%} - -{%- set full_refresh_type = var((source_name ~ '_complete_full_refresh').upper(), false) -%} - -{% set post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(block_number)" %} - -{# Log configuration details #} -{{ log_complete_details( - post_hook = post_hook, - full_refresh_type = full_refresh_type -) }} - -{# Set up dbt configuration #} --- depends_on: {{ ref('bronze__' ~ source_name.lower()) }} - -{{ config ( - materialized = "incremental", - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = post_hook, - full_refresh = full_refresh_type, - tags = ['streamline_core_complete'] -) }} - -{# Main query starts here #} -SELECT - block_number, - file_name, - {{ dbt_utils.generate_surrogate_key(['block_number']) }} AS complete_{{ source_name.lower() }}_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - _inserted_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {% if is_incremental() %} - {{ ref('bronze__' ~ source_name.lower()) }} - WHERE - _inserted_timestamp >= ( - SELECT - COALESCE(MAX(_inserted_timestamp), '1970-01-01'::TIMESTAMP) AS _inserted_timestamp - FROM - {{ this }} - ) - {% else %} - {{ ref('bronze__' ~ source_name.lower() ~ '_fr') }} - {% endif %} - -QUALIFY (ROW_NUMBER() OVER (PARTITION BY block_number ORDER BY _inserted_timestamp DESC)) = 1 diff --git a/models/streamline/silver/core/complete/streamline__confirm_blocks_complete.sql b/models/streamline/silver/core/complete/streamline__confirm_blocks_complete.sql deleted file mode 100644 index fe73ef27..00000000 --- a/models/streamline/silver/core/complete/streamline__confirm_blocks_complete.sql +++ /dev/null @@ -1,50 +0,0 @@ -{# Set variables #} -{%- set source_name = 'CONFIRM_BLOCKS' -%} -{%- set model_type = 'COMPLETE' -%} - -{%- set full_refresh_type = var((source_name ~ '_complete_full_refresh').upper(), false) -%} - -{% set post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(block_number)" %} - -{# Log configuration details #} -{{ log_complete_details( - post_hook = post_hook, - full_refresh_type = full_refresh_type -) }} - -{# Set up dbt configuration #} --- depends_on: {{ ref('bronze__' ~ source_name.lower()) }} - -{{ config ( - materialized = "incremental", - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = post_hook, - full_refresh = full_refresh_type, - tags = ['streamline_core_complete_confirm_blocks'] -) }} - -{# Main query starts here #} -SELECT - block_number, - file_name, - {{ dbt_utils.generate_surrogate_key(['block_number']) }} AS complete_{{ source_name.lower() }}_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - _inserted_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {% if is_incremental() %} - {{ ref('bronze__' ~ source_name.lower()) }} - WHERE - _inserted_timestamp >= ( - SELECT - COALESCE(MAX(_inserted_timestamp), '1970-01-01'::TIMESTAMP) AS _inserted_timestamp - FROM - {{ this }} - ) - {% else %} - {{ ref('bronze__' ~ source_name.lower() ~ '_fr') }} - {% endif %} - -QUALIFY (ROW_NUMBER() OVER (PARTITION BY block_number ORDER BY _inserted_timestamp DESC)) = 1 diff --git a/models/streamline/silver/core/complete/streamline__receipts_complete.sql b/models/streamline/silver/core/complete/streamline__receipts_complete.sql deleted file mode 100644 index b77138da..00000000 --- a/models/streamline/silver/core/complete/streamline__receipts_complete.sql +++ /dev/null @@ -1,50 +0,0 @@ -{# Set variables #} -{%- set source_name = 'RECEIPTS' -%} -{%- set model_type = 'COMPLETE' -%} - -{%- set full_refresh_type = var((source_name ~ '_complete_full_refresh').upper(), false) -%} - -{% set post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(block_number)" %} - -{# Log configuration details #} -{{ log_complete_details( - post_hook = post_hook, - full_refresh_type = full_refresh_type -) }} - -{# Set up dbt configuration #} --- depends_on: {{ ref('bronze__' ~ source_name.lower()) }} - -{{ config ( - materialized = "incremental", - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = post_hook, - full_refresh = full_refresh_type, - tags = ['streamline_core_complete_receipts'] -) }} - -{# Main query starts here #} -SELECT - block_number, - file_name, - {{ dbt_utils.generate_surrogate_key(['block_number']) }} AS complete_{{ source_name.lower() }}_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - _inserted_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {% if is_incremental() %} - {{ ref('bronze__' ~ source_name.lower()) }} - WHERE - _inserted_timestamp >= ( - SELECT - COALESCE(MAX(_inserted_timestamp), '1970-01-01'::TIMESTAMP) AS _inserted_timestamp - FROM - {{ this }} - ) - {% else %} - {{ ref('bronze__' ~ source_name.lower() ~ '_fr') }} - {% endif %} - -QUALIFY (ROW_NUMBER() OVER (PARTITION BY block_number ORDER BY _inserted_timestamp DESC)) = 1 diff --git a/models/streamline/silver/core/complete/streamline__traces_complete.sql b/models/streamline/silver/core/complete/streamline__traces_complete.sql deleted file mode 100644 index e7158769..00000000 --- a/models/streamline/silver/core/complete/streamline__traces_complete.sql +++ /dev/null @@ -1,50 +0,0 @@ -{# Set variables #} -{%- set source_name = 'TRACES' -%} -{%- set model_type = 'COMPLETE' -%} - -{%- set full_refresh_type = var((source_name ~ '_complete_full_refresh').upper(), false) -%} - -{% set post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(block_number)" %} - -{# Log configuration details #} -{{ log_complete_details( - post_hook = post_hook, - full_refresh_type = full_refresh_type -) }} - -{# Set up dbt configuration #} --- depends_on: {{ ref('bronze__' ~ source_name.lower()) }} - -{{ config ( - materialized = "incremental", - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = post_hook, - full_refresh = full_refresh_type, - tags = ['streamline_core_complete'] -) }} - -{# Main query starts here #} -SELECT - block_number, - file_name, - {{ dbt_utils.generate_surrogate_key(['block_number']) }} AS complete_{{ source_name.lower() }}_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - _inserted_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {% if is_incremental() %} - {{ ref('bronze__' ~ source_name.lower()) }} - WHERE - _inserted_timestamp >= ( - SELECT - COALESCE(MAX(_inserted_timestamp), '1970-01-01'::TIMESTAMP) AS _inserted_timestamp - FROM - {{ this }} - ) - {% else %} - {{ ref('bronze__' ~ source_name.lower() ~ '_fr') }} - {% endif %} - -QUALIFY (ROW_NUMBER() OVER (PARTITION BY block_number ORDER BY _inserted_timestamp DESC)) = 1 \ No newline at end of file diff --git a/models/streamline/silver/core/complete/streamline__transactions_complete.sql b/models/streamline/silver/core/complete/streamline__transactions_complete.sql deleted file mode 100644 index 06ec7f76..00000000 --- a/models/streamline/silver/core/complete/streamline__transactions_complete.sql +++ /dev/null @@ -1,50 +0,0 @@ -{# Set variables #} -{%- set source_name = 'TRANSACTIONS' -%} -{%- set model_type = 'COMPLETE' -%} - -{%- set full_refresh_type = var((source_name ~ '_complete_full_refresh').upper(), false) -%} - -{% set post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(block_number)"%} - -{# Log configuration details #} -{{ log_complete_details( - post_hook = post_hook, - full_refresh_type = full_refresh_type -) }} - -{# Set up dbt configuration #} --- depends_on: {{ ref('bronze__' ~ source_name.lower()) }} - -{{ config ( - materialized = "incremental", - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = post_hook, - full_refresh = full_refresh_type, - tags = ['streamline_core_complete'] -) }} - -{# Main query starts here #} -SELECT - block_number, - file_name, - {{ dbt_utils.generate_surrogate_key(['block_number']) }} AS complete_{{ source_name.lower() }}_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - _inserted_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {% if is_incremental() %} - {{ ref('bronze__' ~ source_name.lower()) }} - WHERE - _inserted_timestamp >= ( - SELECT - COALESCE(MAX(_inserted_timestamp), '1970-01-01'::TIMESTAMP) AS _inserted_timestamp - FROM - {{ this }} - ) - {% else %} - {{ ref('bronze__' ~ source_name.lower() ~ '_fr') }} - {% endif %} - -QUALIFY (ROW_NUMBER() OVER (PARTITION BY block_number ORDER BY _inserted_timestamp DESC)) = 1 \ No newline at end of file diff --git a/models/streamline/silver/core/history/streamline__blocks_transactions_history.sql b/models/streamline/silver/core/history/streamline__blocks_transactions_history.sql deleted file mode 100644 index baed1d72..00000000 --- a/models/streamline/silver/core/history/streamline__blocks_transactions_history.sql +++ /dev/null @@ -1,112 +0,0 @@ -{# Set variables #} -{%- set model_name = 'BLOCKS_TRANSACTIONS' -%} -{%- set model_type = 'HISTORY' -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} - -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_history'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} - - EXCEPT - - SELECT block_number - FROM {{ ref("streamline__blocks_complete") }} b - INNER JOIN {{ ref("streamline__transactions_complete") }} t USING(block_number) - WHERE 1=1 - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} -), -ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/history/streamline__confirm_blocks_history.sql b/models/streamline/silver/core/history/streamline__confirm_blocks_history.sql deleted file mode 100644 index d715b311..00000000 --- a/models/streamline/silver/core/history/streamline__confirm_blocks_history.sql +++ /dev/null @@ -1,133 +0,0 @@ -{# Set variables #} -{%- set model_name = 'CONFIRM_BLOCKS' -%} -{%- set model_type = 'HISTORY' -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_history_confirm_blocks'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Delay blocks #} -look_back AS ( - SELECT - block_number - FROM - {{ ref("_max_block_by_hour") }} - qualify ROW_NUMBER() over ( - ORDER BY - block_number DESC - ) = 6 - ), - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - AND block_number <= (SELECT block_number FROM look_back) - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} - - EXCEPT - - {# Exclude blocks that have already been processed #} - SELECT block_number - FROM {{ ref('streamline__' ~ model_name.lower() ~ '_complete') }} - WHERE 1=1 - AND block_number IS NOT NULL - AND block_number <= (SELECT block_number FROM look_back) - AND _inserted_timestamp >= DATEADD( - 'day', - -4, - SYSDATE() - ) - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} -) - -{# Prepare the final list of blocks to process #} -,ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/history/streamline__receipts_history.sql b/models/streamline/silver/core/history/streamline__receipts_history.sql deleted file mode 100644 index 4cd5823e..00000000 --- a/models/streamline/silver/core/history/streamline__receipts_history.sql +++ /dev/null @@ -1,113 +0,0 @@ -{# Set variables #} -{%- set model_name = 'RECEIPTS' -%} -{%- set model_type = 'HISTORY' -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_history_receipts'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} - - EXCEPT - - {# Exclude blocks that have already been processed #} - SELECT block_number - FROM {{ ref('streamline__' ~ model_name.lower() ~ '_complete') }} - WHERE 1=1 - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} -) - -{# Prepare the final list of blocks to process #} -,ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/history/streamline__traces_history.sql b/models/streamline/silver/core/history/streamline__traces_history.sql deleted file mode 100644 index 0cf5cc27..00000000 --- a/models/streamline/silver/core/history/streamline__traces_history.sql +++ /dev/null @@ -1,113 +0,0 @@ -{# Set variables #} -{%- set model_name = 'TRACES' -%} -{%- set model_type = 'HISTORY' -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_history'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} - - EXCEPT - - {# Exclude blocks that have already been processed #} - SELECT block_number - FROM {{ ref('streamline__' ~ model_name.lower() ~ '_complete') }} - WHERE 1=1 - {% if not new_build %} - AND block_number <= (SELECT block_number FROM last_3_days) - {% endif %} -) - -{# Prepare the final list of blocks to process #} -,ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/realtime/streamline__blocks_transactions_realtime.sql b/models/streamline/silver/core/realtime/streamline__blocks_transactions_realtime.sql deleted file mode 100644 index 0bd0a93f..00000000 --- a/models/streamline/silver/core/realtime/streamline__blocks_transactions_realtime.sql +++ /dev/null @@ -1,126 +0,0 @@ -{# Set variables #} -{%- set model_name = 'BLOCKS_TRANSACTIONS' -%} -{%- set model_type = 'REALTIME' -%} -{%- set min_block = var('GLOBAL_START_UP_BLOCK', none) -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method, - min_block=min_block -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_realtime'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} - - {% if min_block is not none %} - AND block_number >= {{ min_block }} - {% endif %} - - EXCEPT - - SELECT block_number - FROM {{ ref("streamline__blocks_complete") }} b - INNER JOIN {{ ref("streamline__transactions_complete") }} t USING(block_number) - WHERE 1=1 - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} -), -ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if not new_build %} - UNION - SELECT block_number - FROM {{ ref("_unconfirmed_blocks") }} - UNION - SELECT block_number - FROM {{ ref("_missing_txs") }} - {% endif %} - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/realtime/streamline__confirm_blocks_realtime.sql b/models/streamline/silver/core/realtime/streamline__confirm_blocks_realtime.sql deleted file mode 100644 index 6135a3fc..00000000 --- a/models/streamline/silver/core/realtime/streamline__confirm_blocks_realtime.sql +++ /dev/null @@ -1,138 +0,0 @@ -{# Set variables #} -{%- set model_name = 'CONFIRM_BLOCKS' -%} -{%- set model_type = 'REALTIME' -%} -{%- set min_block = var('GLOBAL_START_UP_BLOCK', none) -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method, - min_block=min_block -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_realtime_confirm_blocks'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Delay blocks #} -look_back AS ( - SELECT - block_number - FROM - {{ ref("_max_block_by_hour") }} - qualify ROW_NUMBER() over ( - ORDER BY - block_number DESC - ) = 6 - ), - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - AND block_number <= (SELECT block_number FROM look_back) - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} - {% if min_block is not none %} - AND block_number >= {{ min_block }} - {% endif %} - - EXCEPT - - {# Exclude blocks that have already been processed #} - SELECT block_number - FROM {{ ref('streamline__' ~ model_name.lower() ~ '_complete') }} - WHERE 1=1 - AND block_number IS NOT NULL - AND block_number <= (SELECT block_number FROM look_back) - AND _inserted_timestamp >= DATEADD( - 'day', - -4, - SYSDATE() - ) - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} -) - -{# Prepare the final list of blocks to process #} -,ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/realtime/streamline__receipts_realtime.sql b/models/streamline/silver/core/realtime/streamline__receipts_realtime.sql deleted file mode 100644 index 6ec5c850..00000000 --- a/models/streamline/silver/core/realtime/streamline__receipts_realtime.sql +++ /dev/null @@ -1,130 +0,0 @@ -{# Set variables #} -{%- set model_name = 'RECEIPTS' -%} -{%- set model_type = 'REALTIME' -%} -{%- set min_block = var('GLOBAL_START_UP_BLOCK', none) -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method, - min_block=min_block -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_realtime_receipts'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} - {% if min_block is not none %} - AND block_number >= {{ min_block }} - {% endif %} - - EXCEPT - - {# Exclude blocks that have already been processed #} - SELECT block_number - FROM {{ ref('streamline__' ~ model_name.lower() ~ '_complete') }} - WHERE 1=1 - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} -) - -{# Prepare the final list of blocks to process #} -,ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if not new_build %} - UNION - SELECT block_number - FROM {{ ref("_unconfirmed_blocks") }} - UNION - SELECT block_number - FROM {{ ref("_missing_txs") }} - UNION - SELECT block_number - FROM {{ ref("_missing_receipts") }} - {% endif %} - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/realtime/streamline__traces_realtime.sql b/models/streamline/silver/core/realtime/streamline__traces_realtime.sql deleted file mode 100644 index 34f7f984..00000000 --- a/models/streamline/silver/core/realtime/streamline__traces_realtime.sql +++ /dev/null @@ -1,127 +0,0 @@ -{# Set variables #} -{%- set model_name = 'TRACES' -%} -{%- set model_type = 'REALTIME' -%} -{%- set min_block = var('GLOBAL_START_UP_BLOCK', none) -%} - -{%- set default_vars = set_default_variables_streamline(model_name, model_type) -%} - -{# Set up parameters for the streamline process. These will come from the vars set in dbt_project.yml #} -{%- set streamline_params = set_streamline_parameters( - model_name=model_name, - model_type=model_type -) -%} - -{%- set node_url = default_vars['node_url'] -%} -{%- set node_secret_path = default_vars['node_secret_path'] -%} -{%- set model_quantum_state = default_vars['model_quantum_state'] -%} -{%- set sql_limit = streamline_params['sql_limit'] -%} -{%- set testing_limit = default_vars['testing_limit'] -%} -{%- set order_by_clause = default_vars['order_by_clause'] -%} -{%- set new_build = default_vars['new_build'] -%} -{%- set method_params = streamline_params['method_params'] -%} -{%- set method = streamline_params['method'] -%} - -{# Log configuration details #} -{{ log_streamline_details( - model_name=model_name, - model_type=model_type, - node_url=node_url, - model_quantum_state=model_quantum_state, - sql_limit=sql_limit, - testing_limit=testing_limit, - order_by_clause=order_by_clause, - new_build=new_build, - streamline_params=streamline_params, - method_params=method_params, - method=method, - min_block=min_block -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_rest_api_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = streamline_params - ), - tags = ['streamline_core_realtime'] -) }} - -{# Main query starts here #} -WITH -{% if not new_build %} - last_3_days AS ( - SELECT block_number - FROM {{ ref("_block_lookback") }} - ), -{% endif %} - -{# Identify blocks that need processing #} -to_do AS ( - SELECT block_number - FROM {{ ref("streamline__blocks") }} - WHERE - block_number IS NOT NULL - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} - {% if min_block is not none %} - AND block_number >= {{ min_block }} - {% endif %} - - EXCEPT - - {# Exclude blocks that have already been processed #} - SELECT block_number - FROM {{ ref('streamline__' ~ model_name.lower() ~ '_complete') }} - WHERE 1=1 - {% if not new_build %} - AND block_number >= (SELECT block_number FROM last_3_days) - {% endif %} -) - -{# Prepare the final list of blocks to process #} -,ready_blocks AS ( - SELECT block_number - FROM to_do - - {% if not new_build %} - UNION - SELECT block_number - FROM {{ ref("_unconfirmed_blocks") }} - UNION - SELECT block_number - FROM {{ ref("_missing_traces") }} - {% endif %} - - {% if testing_limit is not none %} - LIMIT {{ testing_limit }} - {% endif %} -) - -{# Generate API requests for each block #} -SELECT - block_number, - ROUND(block_number, -3) AS partition_key, - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', block_number, - 'jsonrpc', '2.0', - 'method', '{{ method }}', - 'params', {{ method_params }} - ), - '{{ node_secret_path }}' - ) AS request -FROM - ready_blocks - -{{ order_by_clause }} - -LIMIT {{ sql_limit }} \ No newline at end of file diff --git a/models/streamline/silver/core/retry/_missing_receipts.sql b/models/streamline/silver/core/retry/_missing_receipts.sql deleted file mode 100644 index fb055b60..00000000 --- a/models/streamline/silver/core/retry/_missing_receipts.sql +++ /dev/null @@ -1,34 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH lookback AS ( - - SELECT - block_number - FROM - {{ ref("_block_lookback") }} -) -SELECT - DISTINCT t.block_number AS block_number -FROM - {{ ref("silver__transactions") }} - t - LEFT JOIN {{ ref("silver__receipts") }} - r USING ( - block_number, - block_hash, - tx_hash - ) -WHERE - r.tx_hash IS NULL - AND t.block_number >= ( - SELECT - block_number - FROM - lookback - ) - AND t.block_timestamp >= DATEADD('hour', -84, SYSDATE()) - AND ( - r._inserted_timestamp >= DATEADD('hour', -84, SYSDATE()) - OR r._inserted_timestamp IS NULL) diff --git a/models/streamline/silver/core/retry/_missing_traces.sql b/models/streamline/silver/core/retry/_missing_traces.sql deleted file mode 100644 index 346f556c..00000000 --- a/models/streamline/silver/core/retry/_missing_traces.sql +++ /dev/null @@ -1,17 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -SELECT - DISTINCT tx.block_number -FROM - {{ ref("test_silver__transactions_recent") }} - tx - LEFT JOIN {{ ref("test_gold__fact_traces_recent") }} - tr USING ( - block_number, - tx_hash - ) -WHERE - tr.tx_hash IS NULL - AND tx.block_timestamp > DATEADD('day', -5, SYSDATE()) diff --git a/models/streamline/silver/core/retry/_missing_txs.sql b/models/streamline/silver/core/retry/_missing_txs.sql deleted file mode 100644 index 7718e970..00000000 --- a/models/streamline/silver/core/retry/_missing_txs.sql +++ /dev/null @@ -1,40 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH lookback AS ( - - SELECT - block_number - FROM - {{ ref("_block_lookback") }} -), -transactions AS ( - SELECT - block_number, - POSITION, - LAG( - POSITION, - 1 - ) over ( - PARTITION BY block_number - ORDER BY - POSITION ASC - ) AS prev_POSITION - FROM - {{ ref("silver__transactions") }} - WHERE - block_timestamp >= DATEADD('hour', -84, SYSDATE()) - AND block_number >= ( - SELECT - block_number - FROM - lookback - ) -) -SELECT - DISTINCT block_number AS block_number -FROM - transactions -WHERE - POSITION - prev_POSITION <> 1 diff --git a/models/streamline/silver/core/retry/_unconfirmed_blocks.sql b/models/streamline/silver/core/retry/_unconfirmed_blocks.sql deleted file mode 100644 index 8e2507cd..00000000 --- a/models/streamline/silver/core/retry/_unconfirmed_blocks.sql +++ /dev/null @@ -1,34 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH lookback AS ( - - SELECT - block_number - FROM - {{ ref("_block_lookback") }} -) -SELECT - DISTINCT cb.block_number AS block_number -FROM - {{ ref("silver__confirmed_blocks") }} - cb - LEFT JOIN {{ ref("silver__transactions") }} - txs USING ( - block_number, - block_hash, - tx_hash - ) -WHERE - txs.tx_hash IS NULL - AND cb.block_number >= ( - SELECT - block_number - FROM - lookback - ) - AND cb._inserted_timestamp >= DATEADD('hour', -84, SYSDATE()) - AND ( - txs._inserted_timestamp >= DATEADD('hour', -84, SYSDATE()) - OR txs._inserted_timestamp IS NULL) diff --git a/models/streamline/silver/core/streamline__blocks.sql b/models/streamline/silver/core/streamline__blocks.sql deleted file mode 100644 index 9e56c764..00000000 --- a/models/streamline/silver/core/streamline__blocks.sql +++ /dev/null @@ -1,36 +0,0 @@ -{%- if flags.WHICH == 'compile' and execute -%} - - {% set config_log = '\n' %} - {% set config_log = config_log ~ '\n=== DBT Model Config ===\n'%} - {% set config_log = config_log ~ '\n{{ config (\n' %} - {% set config_log = config_log ~ ' materialized = "' ~ config.get('materialized') ~ '",\n' %} - {% set config_log = config_log ~ ' tags = ' ~ config.get('tags') | tojson ~ '\n' %} - {% set config_log = config_log ~ ') }}\n' %} - {{ log(config_log, info=True) }} - {{ log("", info=True) }} -{%- endif -%} - -{{ config ( - materialized = "view", - tags = ['streamline_core_complete'] -) }} - -SELECT - _id, - ( - ({{ var('GLOBAL_BLOCKS_PER_HOUR',0) }} / 60) * {{ var('GLOBAL_CHAINHEAD_DELAY',3) }} - ) :: INT AS block_number_delay, --minute-based block delay - (_id - block_number_delay) :: INT AS block_number, - utils.udf_int_to_hex(block_number) AS block_number_hex -FROM - {{ ref('silver__number_sequence') }} -WHERE - _id <= ( - SELECT - COALESCE( - block_number, - 0 - ) - FROM - {{ ref("streamline__get_chainhead") }} - ) \ No newline at end of file diff --git a/models/streamline/silver/core/streamline__get_chainhead.sql b/models/streamline/silver/core/streamline__get_chainhead.sql deleted file mode 100644 index 9e98ae7b..00000000 --- a/models/streamline/silver/core/streamline__get_chainhead.sql +++ /dev/null @@ -1,54 +0,0 @@ -{%- set model_quantum_state = var('CHAINHEAD_QUANTUM_STATE', 'livequery') -%} - -{%- set node_url = var('GLOBAL_NODE_URL', '{Service}/{Authentication}') -%} - -{%- if flags.WHICH == 'compile' and execute -%} - - {{ log("=== Current Variable Settings ===", info=True) }} - {{ log("CHAINHEAD_QUANTUM_STATE: " ~ model_quantum_state, info=True) }} - {{ log("", info=True) }} - - {{ log("=== API Details ===", info=True) }} - {{ log("NODE_URL: " ~ node_url, info=True) }} - {{ log("NODE_SECRET_PATH: " ~ var('GLOBAL_NODE_SECRET_PATH'), info=True) }} - {{ log("", info=True) }} - - {% set config_log = '\n' %} - {% set config_log = config_log ~ '\n=== DBT Model Config ===\n'%} - {% set config_log = config_log ~ '\n{{ config (\n' %} - {% set config_log = config_log ~ ' materialized = "' ~ config.get('materialized') ~ '",\n' %} - {% set config_log = config_log ~ ' tags = ' ~ config.get('tags') | tojson ~ '\n' %} - {% set config_log = config_log ~ ') }}\n' %} - {{ log(config_log, info=True) }} - {{ log("", info=True) }} - -{%- endif -%} - -{{ config ( - materialized = 'table', - tags = ['streamline_core_complete','chainhead'] -) }} - -SELECT - live.udf_api( - 'POST', - '{{ node_url }}', - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', '{{ model_quantum_state }}' - ), - OBJECT_CONSTRUCT( - 'id', - 0, - 'jsonrpc', - '2.0', - 'method', - 'eth_blockNumber', - 'params', - [] - ), - '{{ var('GLOBAL_NODE_SECRET_PATH') }}' - ) AS resp, - utils.udf_hex_to_int( - resp :data :result :: STRING - ) AS block_number \ No newline at end of file diff --git a/models/streamline/silver/core/streamline__get_chainhead.yml b/models/streamline/silver/core/streamline__get_chainhead.yml deleted file mode 100644 index e318e4db..00000000 --- a/models/streamline/silver/core/streamline__get_chainhead.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: 2 -models: - - name: streamline__get_chainhead - description: "This model is used to get the chainhead from the blockchain." - - columns: - - name: BLOCK_NUMBER - tests: - - not_null \ No newline at end of file diff --git a/models/streamline/silver/decoded_logs/complete/streamline__decoded_logs_complete.sql b/models/streamline/silver/decoded_logs/complete/streamline__decoded_logs_complete.sql deleted file mode 100644 index 3e805898..00000000 --- a/models/streamline/silver/decoded_logs/complete/streamline__decoded_logs_complete.sql +++ /dev/null @@ -1,50 +0,0 @@ -{# Set variables #} -{%- set source_name = 'DECODED_LOGS' -%} -{%- set model_type = 'COMPLETE' -%} - -{%- set full_refresh_type = var((source_name ~ '_complete_full_refresh').upper(), false) -%} - -{% set post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(_log_id)" %} - -{# Log configuration details #} -{{ log_model_details() }} - -{# Set up dbt configuration #} --- depends_on: {{ ref('bronze__' ~ source_name.lower()) }} - -{{ config ( - materialized = "incremental", - unique_key = "_log_id", - cluster_by = "ROUND(block_number, -3)", - incremental_predicates = ["dynamic_range", "block_number"], - merge_update_columns = ["_log_id"], - post_hook = post_hook, - full_refresh = full_refresh_type, - tags = ['streamline_decoded_logs_complete'] -) }} - -{# Main query starts here #} -SELECT - block_number, - file_name, - id AS _log_id, - {{ dbt_utils.generate_surrogate_key(['id']) }} AS complete_{{ source_name.lower() }}_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - _inserted_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {% if is_incremental() %} - {{ ref('bronze__' ~ source_name.lower()) }} - WHERE - _inserted_timestamp >= ( - SELECT - COALESCE(MAX(_inserted_timestamp), '1970-01-01'::TIMESTAMP) AS _inserted_timestamp - FROM - {{ this }} - ) - {% else %} - {{ ref('bronze__' ~ source_name.lower() ~ '_fr') }} - {% endif %} - -QUALIFY (ROW_NUMBER() OVER (PARTITION BY id ORDER BY _inserted_timestamp DESC)) = 1 diff --git a/models/streamline/silver/decoded_logs/realtime/streamline__decoded_logs_realtime.sql b/models/streamline/silver/decoded_logs/realtime/streamline__decoded_logs_realtime.sql deleted file mode 100644 index a0ff21b9..00000000 --- a/models/streamline/silver/decoded_logs/realtime/streamline__decoded_logs_realtime.sql +++ /dev/null @@ -1,110 +0,0 @@ -{%- set testing_limit = var('DECODED_LOGS_REALTIME_TESTING_LIMIT', none) -%} - -{%- set streamline_params = { - "external_table": var("DECODED_LOGS_REALTIME_EXTERNAL_TABLE", "decoded_logs"), - "sql_limit": var("DECODED_LOGS_REALTIME_SQL_LIMIT", 10000000), - "producer_batch_size": var("DECODED_LOGS_REALTIME_PRODUCER_BATCH_SIZE", 400000), - "worker_batch_size": var("DECODED_LOGS_REALTIME_WORKER_BATCH_SIZE", 200000), - "sql_source": "decoded_logs_realtime" -} -%} - -{# Log configuration details #} -{{ log_model_details( - params = streamline_params -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = [fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_decode_logs_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = { - "external_table": streamline_params['external_table'], - "sql_limit": streamline_params['sql_limit'], - "producer_batch_size": streamline_params['producer_batch_size'], - "worker_batch_size": streamline_params['worker_batch_size'], - "sql_source": streamline_params['sql_source'] - } - ), - fsc_utils.if_data_call_wait()], - tags = ['streamline_decoded_logs_realtime'] -) }} - -WITH target_blocks AS ( - SELECT - block_number - FROM - {{ ref('core__fact_blocks') }} - WHERE - block_number >= ( - SELECT - block_number - FROM - {{ ref('_24_hour_lookback') }} - ) -), -existing_logs_to_exclude AS ( - SELECT - _log_id - FROM - {{ ref('streamline__decoded_logs_complete') }} - l - INNER JOIN target_blocks b USING (block_number) - WHERE - l.inserted_timestamp :: DATE >= DATEADD('day', -2, SYSDATE()) -), -candidate_logs AS ( - SELECT - l.block_number, - l.tx_hash, - l.event_index, - l.contract_address, - l.topics, - l.data, - CONCAT( - l.tx_hash :: STRING, - '-', - l.event_index :: STRING - ) AS _log_id - FROM - target_blocks b - INNER JOIN {{ ref('core__fact_event_logs') }} - l USING (block_number) - WHERE - l.tx_succeeded - AND l.inserted_timestamp :: DATE >= DATEADD('day', -2, SYSDATE()) -) -SELECT - l.block_number, - l._log_id, - A.abi, - OBJECT_CONSTRUCT( - 'topics', - l.topics, - 'data', - l.data, - 'address', - l.contract_address - ) AS DATA -FROM - candidate_logs l - INNER JOIN {{ ref('silver__complete_event_abis') }} A - ON A.parent_contract_address = l.contract_address - AND A.event_signature = l.topics [0] :: STRING - AND l.block_number BETWEEN A.start_block - AND A.end_block -WHERE - NOT EXISTS ( - SELECT - 1 - FROM - existing_logs_to_exclude e - WHERE - e._log_id = l._log_id - ) - -{% if testing_limit is not none %} - LIMIT - {{ testing_limit }} -{% endif %} \ No newline at end of file diff --git a/packages.yml b/packages.yml index 1bc16cf4..a16475aa 100644 --- a/packages.yml +++ b/packages.yml @@ -1,13 +1,3 @@ packages: - - package: calogica/dbt_expectations - version: 0.8.2 - - package: dbt-labs/dbt_external_tables - version: 0.8.2 - - package: dbt-labs/dbt_utils - version: 1.0.0 - - git: https://github.com/FlipsideCrypto/fsc-utils.git - revision: v1.33.1 - - package: get-select/dbt_snowflake_query_tags - version: [">=2.0.0", "<3.0.0"] - git: https://github.com/FlipsideCrypto/fsc-evm.git - revision: v1.5.0 + revision: v4.0.0-beta.53 diff --git a/python/slack_alert.py b/python/slack_alert.py deleted file mode 100644 index 11ad94ad..00000000 --- a/python/slack_alert.py +++ /dev/null @@ -1,74 +0,0 @@ -import requests -import os -import sys - -def create_message(): - """Creates a simple failure notification message with repo, workflow name, and URL""" - - # Get GitHub environment variables - repository = os.environ.get('GITHUB_REPOSITORY', 'Unknown repository') - repo_name = repository.split('/')[-1] if '/' in repository else repository - workflow_name = os.environ.get('GITHUB_WORKFLOW', 'Unknown workflow') - run_id = os.environ.get('GITHUB_RUN_ID', '') - server_url = os.environ.get('GITHUB_SERVER_URL', 'https://github.com') - - # Build the workflow URL - workflow_url = f"{server_url}/{repository}/actions/runs/{run_id}" - - message_body = { - "text": f"Failure in {repo_name}", - "attachments": [ - { - "color": "#f44336", # Red color for failures - "fields": [ - { - "title": "Repository", - "value": repository, - "short": True - }, - { - "title": "Workflow", - "value": workflow_name, - "short": True - } - ], - "actions": [ - { - "type": "button", - "text": "View Workflow Run", - "style": "primary", - "url": workflow_url - } - ], - "footer": "GitHub Actions" - } - ] - } - - return message_body - -def send_alert(webhook_url): - """Sends a failure notification to Slack""" - - message = create_message() - - try: - response = requests.post(webhook_url, json=message) - - if response.status_code == 200: - print("Successfully sent Slack notification") - else: - print(f"Failed to send Slack notification: {response.status_code} {response.text}") - sys.exit(1) - except Exception as e: - print(f"Error sending Slack notification: {str(e)}") - sys.exit(1) - -if __name__ == '__main__': - webhook_url = os.environ.get("SLACK_WEBHOOK_URL") - - if not webhook_url: - print("ERROR: SLACK_WEBHOOK_URL environment variable is required") - sys.exit(1) - - send_alert(webhook_url) \ No newline at end of file diff --git a/tests/optimism/test_gold__missing_traces.sql b/tests/optimism/test_gold__missing_traces.sql deleted file mode 100644 index 514d31cf..00000000 --- a/tests/optimism/test_gold__missing_traces.sql +++ /dev/null @@ -1,2 +0,0 @@ --- depends_on: {{ ref('test_silver__transactions_full') }} -{{ missing_txs(ref("test_gold__fact_traces_full")) }} diff --git a/tests/optimism/test_gold__recent_missing_traces.sql b/tests/optimism/test_gold__recent_missing_traces.sql deleted file mode 100644 index 9a571cae..00000000 --- a/tests/optimism/test_gold__recent_missing_traces.sql +++ /dev/null @@ -1,2 +0,0 @@ --- depends_on: {{ ref('test_silver__transactions_recent') }} -{{ recent_missing_txs(ref("test_gold__fact_traces_recent")) }} diff --git a/tests/optimism/test_silver__confirmed_blocks.sql b/tests/optimism/test_silver__confirmed_blocks.sql deleted file mode 100644 index 8cbac8b4..00000000 --- a/tests/optimism/test_silver__confirmed_blocks.sql +++ /dev/null @@ -1 +0,0 @@ -{{ missing_confirmed_txs(ref("test_silver__confirmed_blocks_full"), ref("test_silver__transactions_full")) }} diff --git a/tests/optimism/test_silver__missing_receipts.sql b/tests/optimism/test_silver__missing_receipts.sql deleted file mode 100644 index 8481599b..00000000 --- a/tests/optimism/test_silver__missing_receipts.sql +++ /dev/null @@ -1,2 +0,0 @@ --- depends_on: {{ ref('test_silver__transactions_full') }} -{{ missing_txs(ref("test_silver__receipts_full")) }} diff --git a/tests/optimism/test_silver__recent_confirmed_blocks.sql b/tests/optimism/test_silver__recent_confirmed_blocks.sql deleted file mode 100644 index 79cdd660..00000000 --- a/tests/optimism/test_silver__recent_confirmed_blocks.sql +++ /dev/null @@ -1 +0,0 @@ -{{ missing_confirmed_txs(ref("test_silver__confirmed_blocks_recent"), ref("test_silver__transactions_recent")) }} diff --git a/tests/optimism/test_silver__recent_missing_receipts.sql b/tests/optimism/test_silver__recent_missing_receipts.sql deleted file mode 100644 index f657fd34..00000000 --- a/tests/optimism/test_silver__recent_missing_receipts.sql +++ /dev/null @@ -1,2 +0,0 @@ --- depends_on: {{ ref('test_silver__transactions_recent') }} -{{ recent_missing_txs(ref("test_silver__receipts_recent")) }}