From c9d0177f47dd395658487f1de91957bd653460f4 Mon Sep 17 00:00:00 2001 From: drethereum <71602799+drethereum@users.noreply.github.com> Date: Tue, 22 Apr 2025 10:55:58 -0600 Subject: [PATCH] test/fsc-evm-v4-base (#266) * temp changes for v4 * docs, disabled models and dummy receipts by hash models * removed unused vars * workflows * sources * removed comment for successful compile * package * test project vars * revert * clean up * update dbt project, workflows etc. * update tags for new naming conventions * blank model for overflow * makefile * makefile updates * misc updates for abis * temp source and array index * add scores job * sources update * refs * package * updates * package * package --------- Co-authored-by: Austin --- .github/workflows/dbt_alter_all_gha_tasks.yml | 28 + .github/workflows/dbt_alter_gha_task.yml | 18 +- .../workflows/dbt_deploy_new_workflows.yml | 19 + .github/workflows/dbt_docs_update.yml | 66 +- .github/workflows/dbt_integration_test.yml | 25 +- .github/workflows/dbt_run_abi_refresh.yml | 51 -- .github/workflows/dbt_run_adhoc.yml | 54 +- .github/workflows/dbt_run_deployment.yml | 69 -- .github/workflows/dbt_run_dev_refresh.yml | 42 +- .../workflows/dbt_run_full_observability.yml | 46 +- .github/workflows/dbt_run_heal_models.yml | 46 +- .github/workflows/dbt_run_operation_reorg.yml | 54 -- .../workflows/dbt_run_overflowed_traces.yml | 44 -- .github/workflows/dbt_run_scheduled_abis.yml | 22 + .../workflows/dbt_run_scheduled_curated.yml | 41 +- .../workflows/dbt_run_scheduled_decoder.yml | 19 + .github/workflows/dbt_run_scheduled_main.yml | 22 + .../dbt_run_scheduled_non_realtime.yml | 46 -- .../workflows/dbt_run_scheduled_scores.yml | 20 + .../dbt_run_streamline_chainhead.yml | 48 +- ...bt_run_streamline_decoded_logs_history.yml | 49 -- .../workflows/dbt_run_streamline_decoder.yml | 46 -- .../dbt_run_streamline_decoder_history.yml | 22 + .../workflows/dbt_run_streamline_history.yml | 19 + .../dbt_run_streamline_history_adhoc.yml | 72 --- .github/workflows/dbt_test_daily.yml | 53 +- .github/workflows/dbt_test_intraday.yml | 55 +- .github/workflows/dbt_test_monthly.yml | 53 +- ....csv => github_actions__workflows_old.csv} | 0 dbt_project.yml | 105 ++-- macros/create_udfs.sql | 18 +- macros/dbt/incremental_predicates.sql | 22 - macros/decoder/decoded_logs_history.sql | 129 ---- macros/decoder/run_decoded_logs_history.sql | 31 - macros/fsc_evm_temp/_legacy/silver_traces.sql | 226 ------- ...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 | 21 - macros/streamline/get_base_table_udtf.sql | 24 - macros/streamline/streamline_udfs.sql | 67 -- macros/tests/missing_decoding.sql | 25 - macros/tests/missing_txs.sql | 104 ---- macros/tests/vertex_missing_products.sql | 47 -- macros/utils.sql | 78 --- makefile | 41 ++ models/bronze/api_udf/_retry_abis.sql | 87 --- .../api_udf/bronze_api__contract_abis.sql | 67 -- .../api_udf/bronze_api__contract_abis.yml | 23 - .../api_udf/bronze_api__token_reads.sql | 130 ---- .../api_udf/bronze_api__token_reads.yml | 19 - .../bronze/ethereum/bronze__state_hashes.sql | 2 +- 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 | 26 - .../bronze__complete_provider_prices.sql | 24 - .../bronze__complete_token_asset_metadata.sql | 28 - .../prices/bronze__complete_token_prices.sql | 31 - .../L1_fields/base_max_block.md | 5 - .../L1_fields/base_min_block.md | 5 - .../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/prev_total_elements.md | 5 - .../blocks/base_block_header_json.md | 5 - .../blocks/base_blockchain.md | 5 - .../blocks/base_blocks_hash.md | 5 - .../blocks/base_blocks_nonce.md | 5 - .../blocks/base_blocks_table_doc.md | 5 - .../blocks/base_difficulty.md | 5 - .../blocks/base_extra_data.md | 5 - .../doc_descriptions/blocks/base_gas_limit.md | 5 - .../doc_descriptions/blocks/base_gas_used.md | 5 - models/doc_descriptions/blocks/base_miner.md | 5 - .../doc_descriptions/blocks/base_network.md | 5 - .../blocks/base_parent_hash.md | 5 - .../blocks/base_receipts_root.md | 5 - .../blocks/base_sha3_uncles.md | 5 - models/doc_descriptions/blocks/base_size.md | 5 - .../blocks/base_total_difficulty.md | 5 - .../doc_descriptions/blocks/base_tx_count.md | 5 - .../blocks/base_uncle_blocks.md | 5 - .../bridge/evm_bridge_activity.md | 83 --- .../complete_lending_column_docs.md | 381 ------------ .../complete_lending_table_docs.md | 36 -- .../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 - .../event_logs/base_event_index.md | 5 - .../event_logs/base_event_inputs.md | 5 - .../event_logs/base_event_name.md | 5 - .../event_logs/base_event_removed.md | 5 - .../event_logs/base_event_sig.md | 5 - .../event_logs/base_log_id_events.md | 5 - .../event_logs/base_logs_contract_address.md | 5 - .../event_logs/base_logs_contract_name.md | 5 - .../event_logs/base_logs_data.md | 5 - .../event_logs/base_logs_table_doc.md | 5 - .../event_logs/base_logs_tx_hash.md | 5 - .../event_logs/base_origin_from.md | 5 - .../event_logs/base_origin_to.md | 5 - .../event_logs/base_topics.md | 5 - .../fsc_evm/L1_submission_fields.md | 89 --- models/doc_descriptions/fsc_evm/blocks.md | 143 ----- .../fsc_evm/complete_general.md | 65 -- models/doc_descriptions/fsc_evm/event_logs.md | 83 --- .../fsc_evm/evm_deprecations.md | 203 ------ models/doc_descriptions/fsc_evm/nft.md | 587 ------------------ models/doc_descriptions/fsc_evm/traces.md | 125 ---- .../doc_descriptions/fsc_evm/transactions.md | 188 ------ models/doc_descriptions/fsc_evm/transfers.md | 144 ----- .../doc_descriptions/general/__overview__.md | 124 ---- .../general/base_block_number.md | 5 - .../general/base_block_timestamp.md | 5 - .../doc_descriptions/general/base_decimals.md | 5 - .../general/base_from_address.md | 5 - .../general/base_ingested_at.md | 5 - .../doc_descriptions/general/base_symbol.md | 5 - .../general/base_to_address.md | 5 - .../doc_descriptions/general/deprecation.md | 11 - .../general/export_columns.md | 19 - .../general/precise_amounts.md | 17 - models/doc_descriptions/labels/base_label.md | 5 - .../labels/base_label_address.md | 5 - .../labels/base_label_address_name.md | 5 - .../labels/base_label_blockchain.md | 5 - .../labels/base_label_creator.md | 5 - .../labels/base_label_subtype.md | 5 - .../labels/base_label_type.md | 5 - .../labels/base_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/base_traces_block_no.md | 5 - .../traces/base_traces_blocktime.md | 5 - .../traces/base_traces_call_data.md | 5 - .../traces/base_traces_from.md | 5 - .../traces/base_traces_gas.md | 5 - .../traces/base_traces_gas_used.md | 5 - .../traces/base_traces_identifier.md | 5 - .../traces/base_traces_index.md | 5 - .../traces/base_traces_input.md | 5 - .../traces/base_traces_output.md | 5 - .../traces/base_traces_sub.md | 5 - .../traces/base_traces_table_doc.md | 5 - .../doc_descriptions/traces/base_traces_to.md | 5 - .../traces/base_traces_tx_hash.md | 5 - .../traces/base_traces_type.md | 5 - .../traces/base_traces_value.md | 5 - .../transactions/base_cumulative_gas_used.md | 5 - .../transactions/base_tx_block_hash.md | 5 - .../transactions/base_tx_fee.md | 5 - .../transactions/base_tx_gas_limit.md | 5 - .../transactions/base_tx_gas_price.md | 5 - .../transactions/base_tx_gas_used.md | 5 - .../transactions/base_tx_hash.md | 5 - .../transactions/base_tx_input_data.md | 5 - .../transactions/base_tx_json.md | 5 - .../transactions/base_tx_nonce.md | 5 - .../transactions/base_tx_origin_sig.md | 5 - .../transactions/base_tx_position.md | 5 - .../transactions/base_tx_status.md | 5 - .../transactions/base_tx_table_doc.md | 5 - .../transactions/base_value.md | 5 - .../transfers/base_eth_amount.md | 5 - .../transfers/base_eth_amount_usd.md | 6 - .../base_ez_eth_transfers_table_doc.md | 5 - .../transfers/base_ez_transfer_table_doc.md | 5 - .../transfers/base_log_id_transfers.md | 5 - .../transfers/base_origin_from.md | 5 - .../transfers/base_origin_to.md | 5 - .../transfers/base_transfer_amount.md | 11 - .../transfers/base_transfer_amount_usd.md | 5 - .../base_transfer_contract_address.md | 5 - .../transfers/base_transfer_from_address.md | 5 - .../transfers/base_transfer_has_decimal.md | 5 - .../transfers/base_transfer_has_price.md | 5 - .../transfers/base_transfer_raw_amount.md | 11 - .../transfers/base_transfer_to_address.md | 5 - .../transfers/base_transfer_token_price.md | 5 - .../transfers/base_transfer_tx_hash.md | 5 - .../vertex/vertex_column_docs.md | 543 ---------------- .../vertex/vertex_table_docs.md | 68 -- .../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 | 33 - models/gold/core/core__dim_contracts.yml | 28 - models/gold/core/core__dim_labels.sql | 19 - models/gold/core/core__dim_labels.yml | 59 -- .../gold/core/core__ez_decoded_event_logs.sql | 68 -- .../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 | 49 -- models/gold/core/core__ez_token_transfers.yml | 56 -- models/gold/core/core__fact_blocks.sql | 110 ---- models/gold/core/core__fact_blocks.yml | 62 -- .../core/core__fact_decoded_event_logs.sql | 31 - .../core/core__fact_decoded_event_logs.yml | 28 - models/gold/core/core__fact_event_logs.sql | 51 -- models/gold/core/core__fact_event_logs.yml | 48 -- .../gold/core/core__fact_token_transfers.sql | 36 -- .../gold/core/core__fact_token_transfers.yml | 38 -- models/gold/core/core__fact_traces.sql | 530 ---------------- models/gold/core/core__fact_traces.yml | 64 -- models/gold/core/core__fact_transactions.sql | 73 --- models/gold/core/core__fact_transactions.yml | 86 --- .../traces/test_gold__fact_traces_full.sql | 9 - .../traces/test_gold__fact_traces_full.yml | 120 ---- .../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 +- models/gold/nft/nft__ez_nft_sales.sql | 15 +- models/gold/nft/nft__ez_nft_sales.yml | 68 +- models/gold/nft/nft__ez_nft_transfers.sql | 54 -- 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 | 32 - .../price/price__fact_prices_ohlc_hourly.sql | 19 - .../price/price__fact_prices_ohlc_hourly.yml | 24 - .../protocols/vertex/vertex__dim_products.sql | 29 - .../protocols/vertex/vertex__dim_products.yml | 28 - .../vertex/vertex__ez_account_stats.sql | 57 -- .../vertex/vertex__ez_account_stats.yml | 60 -- .../vertex__ez_clearing_house_events.sql | 37 -- .../vertex__ez_clearing_house_events.yml | 46 -- .../vertex/vertex__ez_edge_trades.sql | 58 -- .../vertex/vertex__ez_edge_trades.yml | 88 --- .../vertex/vertex__ez_liquidations.sql | 41 -- .../vertex/vertex__ez_liquidations.yml | 54 -- .../vertex/vertex__ez_market_depth_stats.sql | 31 - .../vertex/vertex__ez_market_depth_stats.yml | 34 - .../vertex/vertex__ez_market_stats.sql | 45 -- .../vertex/vertex__ez_market_stats.yml | 58 -- .../vertex/vertex__ez_money_markets.sql | 27 - .../vertex/vertex__ez_money_markets.yml | 26 - .../vertex/vertex__ez_perp_trades.sql | 50 -- .../vertex/vertex__ez_perp_trades.yml | 72 --- .../stats/stats__ez_core_metrics_hourly.sql | 38 -- .../stats/stats__ez_core_metrics_hourly.yml | 34 - ...ver_observability__blocks_completeness.sql | 161 ----- ...ilver_observability__logs_completeness.sql | 120 ---- ...r_observability__receipts_completeness.sql | 118 ---- ...ver_observability__traces_completeness.sql | 120 ---- ...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 | 105 ---- 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 | 110 ---- models/silver/core/silver__contracts.yml | 24 - .../silver/core/silver__created_contracts.sql | 66 -- .../silver/core/silver__created_contracts.yml | 29 - models/silver/core/silver__decoded_logs.sql | 246 -------- models/silver/core/silver__logs.sql | 195 ------ .../silver/core/silver__native_transfers.sql | 93 --- 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 | 162 ----- models/silver/core/silver__transactions.sql | 426 ------------- 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 | 9 - .../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 | 16 - .../receipts/test_silver__receipts_recent.yml | 29 - .../tests/traces/test_silver__traces_full.sql | 9 - .../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 | 9 - .../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 | 67 -- .../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__cctp_depositforburn.sql | 2 +- .../silver_bridge__cctp_v2_depositforburn.sql | 2 +- .../silver_bridge__celer_cbridge_send.sql | 2 +- ...lver_bridge__dln_debridge_createdorder.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 +- ...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 | 8 +- .../aerodrome/silver_dex__aerodrome_pools.sql | 2 +- ...silver_dex__aerodrome_slipstream_pools.sql | 2 +- ...silver_dex__aerodrome_slipstream_swaps.sql | 2 +- .../aerodrome/silver_dex__aerodrome_swaps.sql | 2 +- .../alienbase/silver_dex__alienbase_pools.sql | 2 +- .../alienbase/silver_dex__alienbase_swaps.sql | 2 +- .../balancer/silver_dex__balancer_pools.sql | 2 +- .../balancer/silver_dex__balancer_swaps.sql | 2 +- .../silver_dex__baseswap_basex_pools.sql | 2 +- .../silver_dex__baseswap_basex_swaps.sql | 2 +- .../baseswap/silver_dex__baseswap_pools.sql | 2 +- .../baseswap/silver_dex__baseswap_swaps.sql | 2 +- .../dex/curve/silver_dex__curve_pools.sql | 2 +- .../dex/curve/silver_dex__curve_swaps.sql | 2 +- .../dackieswap/silver_dex__dackie_pools.sql | 2 +- .../dackieswap/silver_dex__dackie_swaps.sql | 2 +- .../dex/dexalot/silver_dex__dexalot_swaps.sql | 2 +- .../maverick/silver_dex__maverick_pools.sql | 2 +- .../maverick/silver_dex__maverick_swaps.sql | 2 +- .../silver_dex__maverick_v2_pools.sql | 2 +- .../silver_dex__maverick_v2_swaps.sql | 2 +- .../silver_dex__pancakeswap_v3_pools.sql | 2 +- .../silver_dex__pancakeswap_v3_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 +- .../swapbased/silver_dex__swapbased_pools.sql | 2 +- .../swapbased/silver_dex__swapbased_swaps.sql | 2 +- .../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 +- .../dex/voodoo/silver_dex__voodoo_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 +- .../compound/silver__comp_asset_details.sql | 3 +- .../lending/compound/silver__comp_borrows.sql | 2 +- .../compound/silver__comp_deposits.sql | 2 +- .../compound/silver__comp_liquidations.sql | 2 +- .../compound/silver__comp_repayments.sql | 2 +- .../compound/silver__comp_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 +- .../silver__moonwell_asset_details.sql | 2 +- .../moonwell/silver__moonwell_borrows.sql | 2 +- .../moonwell/silver__moonwell_deposits.sql | 2 +- .../silver__moonwell_liquidations.sql | 2 +- .../moonwell/silver__moonwell_repayments.sql | 2 +- .../moonwell/silver__moonwell_withdraws.sql | 2 +- .../lending/morpho/silver__morpho_borrows.sql | 2 +- .../morpho/silver__morpho_deposits.sql | 2 +- .../morpho/silver__morpho_flashloans.sql | 2 +- .../morpho/silver__morpho_liquidations.sql | 2 +- .../morpho/silver__morpho_repayments.sql | 2 +- .../morpho/silver__morpho_withdraws.sql | 2 +- .../seamless/silver__seamless_borrows.sql | 2 +- .../seamless/silver__seamless_deposits.sql | 2 +- .../seamless/silver__seamless_flashloans.sql | 2 +- .../silver__seamless_liquidations.sql | 2 +- .../seamless/silver__seamless_repayments.sql | 2 +- .../seamless/silver__seamless_tokens.sql | 2 +- .../seamless/silver__seamless_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 +- .../silver/ethereum/silver__state_hashes.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 | 4 +- .../nft/sales/silver__seaport_1_5_sales.sql | 4 +- .../nft/sales/silver__seaport_1_6_sales.sql | 4 +- .../silver/nft/sales/silver__zeroex_sales.sql | 4 +- models/silver/nft/silver__nft_transfers.sql | 2 +- .../silver__run_overflowed_traces.sql | 52 -- .../overflow/silver__overflowed_traces.sql | 119 ---- ...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 +- .../vertex/silver__vertex_account_stats.sql | 194 ------ .../vertex/silver__vertex_account_stats.yml | 112 ---- .../vertex/silver__vertex_collateral.sql | 133 ---- .../vertex/silver__vertex_collateral.yml | 104 ---- .../vertex/silver__vertex_dim_products.sql | 136 ---- .../vertex/silver__vertex_dim_products.yml | 42 -- .../vertex/silver__vertex_edge_trades.sql | 203 ------ .../vertex/silver__vertex_edge_trades.yml | 170 ----- .../vertex/silver__vertex_liquidations.sql | 190 ------ .../vertex/silver__vertex_liquidations.yml | 103 --- .../vertex/silver__vertex_market_depth.sql | 105 ---- .../vertex/silver__vertex_market_depth.yml | 69 -- .../vertex/silver__vertex_market_stats.sql | 191 ------ .../vertex/silver__vertex_market_stats.yml | 142 ----- .../vertex/silver__vertex_money_markets.sql | 55 -- .../vertex/silver__vertex_money_markets.yml | 44 -- .../protocols/vertex/silver__vertex_perps.sql | 245 -------- .../protocols/vertex/silver__vertex_perps.yml | 170 ----- .../protocols/vertex/silver__vertex_spot.sql | 249 -------- .../protocols/vertex/silver__vertex_spot.yml | 172 ----- .../silver_stats__core_metrics_hourly.sql | 80 --- .../silver_stats__core_metrics_hourly.yml | 84 --- .../utilities/silver__number_sequence.sql | 13 - models/sources.yml | 54 +- .../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 | 14 +- .../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 | 35 -- .../silver/core/retry/_missing_traces.sql | 21 - .../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 | 112 ---- package-lock.yml | 12 +- packages.yml | 12 +- tests/base/test_gold__missing_traces.sql | 2 - .../base/test_gold__recent_missing_traces.sql | 2 - tests/base/test_silver__confirmed_blocks.sql | 1 - tests/base/test_silver__missing_receipts.sql | 2 - .../test_silver__recent_confirmed_blocks.sql | 1 - .../test_silver__recent_missing_receipts.sql | 2 - 639 files changed, 914 insertions(+), 21759 deletions(-) create mode 100644 .github/workflows/dbt_alter_all_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_deployment.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 rename data/{github_actions__workflows.csv => github_actions__workflows_old.csv} (100%) 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/_legacy/silver_traces.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_udtf.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/tests/vertex_missing_products.sql delete mode 100644 macros/utils.sql create mode 100644 makefile 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 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/base_max_block.md delete mode 100644 models/doc_descriptions/L1_fields/base_min_block.md 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/prev_total_elements.md delete mode 100644 models/doc_descriptions/blocks/base_block_header_json.md delete mode 100644 models/doc_descriptions/blocks/base_blockchain.md delete mode 100644 models/doc_descriptions/blocks/base_blocks_hash.md delete mode 100644 models/doc_descriptions/blocks/base_blocks_nonce.md delete mode 100644 models/doc_descriptions/blocks/base_blocks_table_doc.md delete mode 100644 models/doc_descriptions/blocks/base_difficulty.md delete mode 100644 models/doc_descriptions/blocks/base_extra_data.md delete mode 100644 models/doc_descriptions/blocks/base_gas_limit.md delete mode 100644 models/doc_descriptions/blocks/base_gas_used.md delete mode 100644 models/doc_descriptions/blocks/base_miner.md delete mode 100644 models/doc_descriptions/blocks/base_network.md delete mode 100644 models/doc_descriptions/blocks/base_parent_hash.md delete mode 100644 models/doc_descriptions/blocks/base_receipts_root.md delete mode 100644 models/doc_descriptions/blocks/base_sha3_uncles.md delete mode 100644 models/doc_descriptions/blocks/base_size.md delete mode 100644 models/doc_descriptions/blocks/base_total_difficulty.md delete mode 100644 models/doc_descriptions/blocks/base_tx_count.md delete mode 100644 models/doc_descriptions/blocks/base_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/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/event_logs/base_event_index.md delete mode 100644 models/doc_descriptions/event_logs/base_event_inputs.md delete mode 100644 models/doc_descriptions/event_logs/base_event_name.md delete mode 100644 models/doc_descriptions/event_logs/base_event_removed.md delete mode 100644 models/doc_descriptions/event_logs/base_event_sig.md delete mode 100644 models/doc_descriptions/event_logs/base_log_id_events.md delete mode 100644 models/doc_descriptions/event_logs/base_logs_contract_address.md delete mode 100644 models/doc_descriptions/event_logs/base_logs_contract_name.md delete mode 100644 models/doc_descriptions/event_logs/base_logs_data.md delete mode 100644 models/doc_descriptions/event_logs/base_logs_table_doc.md delete mode 100644 models/doc_descriptions/event_logs/base_logs_tx_hash.md delete mode 100644 models/doc_descriptions/event_logs/base_origin_from.md delete mode 100644 models/doc_descriptions/event_logs/base_origin_to.md delete mode 100644 models/doc_descriptions/event_logs/base_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/__overview__.md delete mode 100644 models/doc_descriptions/general/base_block_number.md delete mode 100644 models/doc_descriptions/general/base_block_timestamp.md delete mode 100644 models/doc_descriptions/general/base_decimals.md delete mode 100644 models/doc_descriptions/general/base_from_address.md delete mode 100644 models/doc_descriptions/general/base_ingested_at.md delete mode 100644 models/doc_descriptions/general/base_symbol.md delete mode 100644 models/doc_descriptions/general/base_to_address.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/precise_amounts.md delete mode 100644 models/doc_descriptions/labels/base_label.md delete mode 100644 models/doc_descriptions/labels/base_label_address.md delete mode 100644 models/doc_descriptions/labels/base_label_address_name.md delete mode 100644 models/doc_descriptions/labels/base_label_blockchain.md delete mode 100644 models/doc_descriptions/labels/base_label_creator.md delete mode 100644 models/doc_descriptions/labels/base_label_subtype.md delete mode 100644 models/doc_descriptions/labels/base_label_type.md delete mode 100644 models/doc_descriptions/labels/base_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/base_traces_block_no.md delete mode 100644 models/doc_descriptions/traces/base_traces_blocktime.md delete mode 100644 models/doc_descriptions/traces/base_traces_call_data.md delete mode 100644 models/doc_descriptions/traces/base_traces_from.md delete mode 100644 models/doc_descriptions/traces/base_traces_gas.md delete mode 100644 models/doc_descriptions/traces/base_traces_gas_used.md delete mode 100644 models/doc_descriptions/traces/base_traces_identifier.md delete mode 100644 models/doc_descriptions/traces/base_traces_index.md delete mode 100644 models/doc_descriptions/traces/base_traces_input.md delete mode 100644 models/doc_descriptions/traces/base_traces_output.md delete mode 100644 models/doc_descriptions/traces/base_traces_sub.md delete mode 100644 models/doc_descriptions/traces/base_traces_table_doc.md delete mode 100644 models/doc_descriptions/traces/base_traces_to.md delete mode 100644 models/doc_descriptions/traces/base_traces_tx_hash.md delete mode 100644 models/doc_descriptions/traces/base_traces_type.md delete mode 100644 models/doc_descriptions/traces/base_traces_value.md delete mode 100644 models/doc_descriptions/transactions/base_cumulative_gas_used.md delete mode 100644 models/doc_descriptions/transactions/base_tx_block_hash.md delete mode 100644 models/doc_descriptions/transactions/base_tx_fee.md delete mode 100644 models/doc_descriptions/transactions/base_tx_gas_limit.md delete mode 100644 models/doc_descriptions/transactions/base_tx_gas_price.md delete mode 100644 models/doc_descriptions/transactions/base_tx_gas_used.md delete mode 100644 models/doc_descriptions/transactions/base_tx_hash.md delete mode 100644 models/doc_descriptions/transactions/base_tx_input_data.md delete mode 100644 models/doc_descriptions/transactions/base_tx_json.md delete mode 100644 models/doc_descriptions/transactions/base_tx_nonce.md delete mode 100644 models/doc_descriptions/transactions/base_tx_origin_sig.md delete mode 100644 models/doc_descriptions/transactions/base_tx_position.md delete mode 100644 models/doc_descriptions/transactions/base_tx_status.md delete mode 100644 models/doc_descriptions/transactions/base_tx_table_doc.md delete mode 100644 models/doc_descriptions/transactions/base_value.md delete mode 100644 models/doc_descriptions/transfers/base_eth_amount.md delete mode 100644 models/doc_descriptions/transfers/base_eth_amount_usd.md delete mode 100644 models/doc_descriptions/transfers/base_ez_eth_transfers_table_doc.md delete mode 100644 models/doc_descriptions/transfers/base_ez_transfer_table_doc.md delete mode 100644 models/doc_descriptions/transfers/base_log_id_transfers.md delete mode 100644 models/doc_descriptions/transfers/base_origin_from.md delete mode 100644 models/doc_descriptions/transfers/base_origin_to.md delete mode 100644 models/doc_descriptions/transfers/base_transfer_amount.md delete mode 100644 models/doc_descriptions/transfers/base_transfer_amount_usd.md delete mode 100644 models/doc_descriptions/transfers/base_transfer_contract_address.md delete mode 100644 models/doc_descriptions/transfers/base_transfer_from_address.md delete mode 100644 models/doc_descriptions/transfers/base_transfer_has_decimal.md delete mode 100644 models/doc_descriptions/transfers/base_transfer_has_price.md delete mode 100644 models/doc_descriptions/transfers/base_transfer_raw_amount.md delete mode 100644 models/doc_descriptions/transfers/base_transfer_to_address.md delete mode 100644 models/doc_descriptions/transfers/base_transfer_token_price.md delete mode 100644 models/doc_descriptions/transfers/base_transfer_tx_hash.md delete mode 100644 models/doc_descriptions/vertex/vertex_column_docs.md delete mode 100644 models/doc_descriptions/vertex/vertex_table_docs.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_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_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/protocols/vertex/vertex__dim_products.sql delete mode 100644 models/gold/protocols/vertex/vertex__dim_products.yml delete mode 100644 models/gold/protocols/vertex/vertex__ez_account_stats.sql delete mode 100644 models/gold/protocols/vertex/vertex__ez_account_stats.yml delete mode 100644 models/gold/protocols/vertex/vertex__ez_clearing_house_events.sql delete mode 100644 models/gold/protocols/vertex/vertex__ez_clearing_house_events.yml delete mode 100644 models/gold/protocols/vertex/vertex__ez_edge_trades.sql delete mode 100644 models/gold/protocols/vertex/vertex__ez_edge_trades.yml delete mode 100644 models/gold/protocols/vertex/vertex__ez_liquidations.sql delete mode 100644 models/gold/protocols/vertex/vertex__ez_liquidations.yml delete mode 100644 models/gold/protocols/vertex/vertex__ez_market_depth_stats.sql delete mode 100644 models/gold/protocols/vertex/vertex__ez_market_depth_stats.yml delete mode 100644 models/gold/protocols/vertex/vertex__ez_market_stats.sql delete mode 100644 models/gold/protocols/vertex/vertex__ez_market_stats.yml delete mode 100644 models/gold/protocols/vertex/vertex__ez_money_markets.sql delete mode 100644 models/gold/protocols/vertex/vertex__ez_money_markets.yml delete mode 100644 models/gold/protocols/vertex/vertex__ez_perp_trades.sql delete mode 100644 models/gold/protocols/vertex/vertex__ez_perp_trades.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 delete mode 100644 models/silver/_observability/silver_observability__blocks_completeness.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__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/overflow/run_models/silver__run_overflowed_traces.sql delete mode 100644 models/silver/overflow/silver__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/protocols/vertex/silver__vertex_account_stats.sql delete mode 100644 models/silver/protocols/vertex/silver__vertex_account_stats.yml delete mode 100644 models/silver/protocols/vertex/silver__vertex_collateral.sql delete mode 100644 models/silver/protocols/vertex/silver__vertex_collateral.yml delete mode 100644 models/silver/protocols/vertex/silver__vertex_dim_products.sql delete mode 100644 models/silver/protocols/vertex/silver__vertex_dim_products.yml delete mode 100644 models/silver/protocols/vertex/silver__vertex_edge_trades.sql delete mode 100644 models/silver/protocols/vertex/silver__vertex_edge_trades.yml delete mode 100644 models/silver/protocols/vertex/silver__vertex_liquidations.sql delete mode 100644 models/silver/protocols/vertex/silver__vertex_liquidations.yml delete mode 100644 models/silver/protocols/vertex/silver__vertex_market_depth.sql delete mode 100644 models/silver/protocols/vertex/silver__vertex_market_depth.yml delete mode 100644 models/silver/protocols/vertex/silver__vertex_market_stats.sql delete mode 100644 models/silver/protocols/vertex/silver__vertex_market_stats.yml delete mode 100644 models/silver/protocols/vertex/silver__vertex_money_markets.sql delete mode 100644 models/silver/protocols/vertex/silver__vertex_money_markets.yml delete mode 100644 models/silver/protocols/vertex/silver__vertex_perps.sql delete mode 100644 models/silver/protocols/vertex/silver__vertex_perps.yml delete mode 100644 models/silver/protocols/vertex/silver__vertex_spot.sql delete mode 100644 models/silver/protocols/vertex/silver__vertex_spot.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 tests/base/test_gold__missing_traces.sql delete mode 100644 tests/base/test_gold__recent_missing_traces.sql delete mode 100644 tests/base/test_silver__confirmed_blocks.sql delete mode 100644 tests/base/test_silver__missing_receipts.sql delete mode 100644 tests/base/test_silver__recent_confirmed_blocks.sql delete mode 100644 tests/base/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 0000000..a868731 --- /dev/null +++ b/.github/workflows/dbt_alter_all_gha_tasks.yml @@ -0,0 +1,28 @@ +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 index ab1c7e9..4f0500c 100644 --- a/.github/workflows/dbt_alter_gha_task.yml +++ b/.github/workflows/dbt_alter_gha_task.yml @@ -18,31 +18,17 @@ on: - 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 + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_alter_gha_task.yml@pre-release/v4-beta with: workflow_name: | ${{ inputs.workflow_name }} task_action: | ${{ inputs.task_action }} - environment: workflow_prod + 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 0000000..3ead6df --- /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_github_action 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 1cf5195..10ec0ba 100644 --- a/.github/workflows/dbt_docs_update.yml +++ b/.github/workflows/dbt_docs_update.yml @@ -5,70 +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 \ No newline at end of file + 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 8e8d3ac..d994154 100644 --- a/.github/workflows/dbt_integration_test.yml +++ b/.github/workflows/dbt_integration_test.yml @@ -3,32 +3,15 @@ run-name: ${{ github.event.inputs.branch }} on: workflow_dispatch: - inputs: - environment: - required: true - type: string + branches: + - "main" 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: > + command: | dbt test --selector 'integration_tests' - environment: ${{ inputs.environment }} - warehouse: ${{ needs.prepare_vars.outputs.warehouse }} secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_abi_refresh.yml b/.github/workflows/dbt_run_abi_refresh.yml deleted file mode 100644 index 4c1af74..0000000 --- a/.github/workflows/dbt_run_abi_refresh.yml +++ /dev/null @@ -1,51 +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 "base_models,tag:abis" - - - name: Kick off decoded logs history, if there are new ABIs from users - run: | - dbt run-operation run_decoded_logs_history \ No newline at end of file diff --git a/.github/workflows/dbt_run_adhoc.yml b/.github/workflows/dbt_run_adhoc.yml index 8427432..30a3481 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,42 +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 }} + 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_deployment.yml b/.github/workflows/dbt_run_deployment.yml deleted file mode 100644 index 19fa06b..0000000 --- a/.github/workflows/dbt_run_deployment.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: dbt_run_deployment -run-name: dbt_run_deployment - -on: - workflow_dispatch: - branches: - - "main" - inputs: - warehouse: - type: choice - description: Snowflake warehouse - required: true - options: - - DBT - - DBT_CLOUD - - DBT_EMERGENCY - default: DBT - dbt_command: - type: string - description: 'DBT Run Command' - required: true - -env: - 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: "${{ inputs.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - - - -jobs: - dbt: - 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: | - ${{ inputs.dbt_command }} - - name: Run datashare model - 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; - dbt run-operation run_query --args "{sql: call admin.datashare.sp_grant_share_permissions('${{ env.DATABASE }}')}" - - name: Store logs - uses: actions/upload-artifact@v3 - with: - name: dbt-logs - path: | - logs - target \ 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 041398a..938995c 100644 --- a/.github/workflows/dbt_run_dev_refresh.yml +++ b/.github/workflows/dbt_run_dev_refresh.yml @@ -3,45 +3,13 @@ run-name: dbt_run_dev_refresh on: workflow_dispatch: - schedule: - # Runs "at 2:10 UTC on Monday" (see https://crontab.guru) - - cron: '10 2 * * 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 - - 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 \ No newline at end of file + 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 0a2e081..379ffd0 100644 --- a/.github/workflows/dbt_run_full_observability.yml +++ b/.github/workflows/dbt_run_full_observability.yml @@ -3,48 +3,20 @@ 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 18 1 * *' + 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_2xl - - 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 "base_models,tag:observability" + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Observability Models + command: | + dbt run --threads 2 --vars '{"MAIN_OBSERV_FULL_TEST_ENABLED":True}' -m "fsc_evm,tag:observability" + secrets: inherit diff --git a/.github/workflows/dbt_run_heal_models.yml b/.github/workflows/dbt_run_heal_models.yml index 8cb7509..6eaf50f 100644 --- a/.github/workflows/dbt_run_heal_models.yml +++ b/.github/workflows/dbt_run_heal_models.yml @@ -3,45 +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' + 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 "base_models,tag:heal" --vars '{"HEAL_MODEL":True}' \ No newline at end of file + 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 02c6837..0000000 --- a/.github/workflows/dbt_run_operation_reorg.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: dbt_run_operation_reorg -run-name: dbt_run_operation_reorg - -on: - workflow_dispatch: - schedule: - # Runs at minute 45 every Sunday (see https://crontab.guru) - - cron: '45 0 * * 0' - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - - - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: List reorg models - id: list_models - run: | - reorg_model_list=$(dbt list --select "base_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 \ No newline at end of file diff --git a/.github/workflows/dbt_run_overflowed_traces.yml b/.github/workflows/dbt_run_overflowed_traces.yml deleted file mode 100644 index 66cd39f..0000000 --- a/.github/workflows/dbt_run_overflowed_traces.yml +++ /dev/null @@ -1,44 +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 "base_models,tag:overflowed_traces" --vars '{"OVERFLOWED_TRACES":True}' diff --git a/.github/workflows/dbt_run_scheduled_abis.yml b/.github/workflows/dbt_run_scheduled_abis.yml new file mode 100644 index 0000000..2eb8581 --- /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 4735b26..61d9d16 100644 --- a/.github/workflows/dbt_run_scheduled_curated.yml +++ b/.github/workflows/dbt_run_scheduled_curated.yml @@ -5,42 +5,15 @@ 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 "base_models,tag:curated" \ No newline at end of file + 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 0000000..a0b7a2b --- /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 0000000..71b7487 --- /dev/null +++ b/.github/workflows/dbt_run_scheduled_main.yml @@ -0,0 +1,22 @@ +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: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" + command_name_2: Run Streamline Models + command_2: | + dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "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" + 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 f3e47e9..0000000 --- a/.github/workflows/dbt_run_scheduled_non_realtime.yml +++ /dev/null @@ -1,46 +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 "base_models,tag:non_realtime" "base_models,tag:streamline_decoded_logs_complete" "base_models,tag:streamline_decoded_logs_realtime" \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled_scores.yml b/.github/workflows/dbt_run_scheduled_scores.yml new file mode 100644 index 0000000..5c2f0f9 --- /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 6d9da9a..c602cf4 100644 --- a/.github/workflows/dbt_run_streamline_chainhead.yml +++ b/.github/workflows/dbt_run_streamline_chainhead.yml @@ -6,45 +6,17 @@ 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 "base_models,tag:streamline_core_complete" "base_models,tag:streamline_core_realtime" "base_models,tag:streamline_core_complete_receipts" "base_models,tag:streamline_core_realtime_receipts" "base_models,tag:streamline_core_complete_confirm_blocks" "base_models,tag:streamline_core_realtime_confirm_blocks" - - - name: Run Chainhead Tests - run: | - dbt test -m "base_models,tag:chainhead" \ No newline at end of file + 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:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts_by_hash" + command_name_2: Run Chainhead Tests + command_2: | + 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 34ff672..0000000 --- a/.github/workflows/dbt_run_streamline_decoded_logs_history.yml +++ /dev/null @@ -1,49 +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 "base_models,tag:streamline_decoded_logs_complete" - - - name: Decode historical logs - run: | - dbt run-operation decoded_logs_history --vars '{"STREAMLINE_INVOKE_STREAMS":True}' \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_decoder.yml b/.github/workflows/dbt_run_streamline_decoder.yml deleted file mode 100644 index bae4dfd..0000000 --- a/.github/workflows/dbt_run_streamline_decoder.yml +++ /dev/null @@ -1,46 +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 "base_models,tag:decoded_logs" \ No newline at end of file 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 0000000..b736c9c --- /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 0000000..08dfbc6 --- /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 83407d2..0000000 --- a/.github/workflows/dbt_run_streamline_history_adhoc.yml +++ /dev/null @@ -1,72 +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 "base_models,tag:streamline_core_complete" "base_models,tag:streamline_core_history" "base_models,tag:streamline_core_complete_receipts" "base_models,tag:streamline_core_history_receipts" "base_models,tag:streamline_core_complete_confirm_blocks" "base_models,tag:streamline_core_history_confirm_blocks" - - dbt run --threads 8 --vars '{"STREAMLINE_INVOKE_STREAMS":True,"WAIT":120}' -m "base_models,tag:streamline_decoded_logs_complete" "base_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 }} \ No newline at end of file diff --git a/.github/workflows/dbt_test_daily.yml b/.github/workflows/dbt_test_daily.yml index 065a8a2..eaa9635 100644 --- a/.github/workflows/dbt_test_daily.yml +++ b/.github/workflows/dbt_test_daily.yml @@ -3,48 +3,21 @@ run-name: dbt_test_daily on: workflow_dispatch: - schedule: - # Runs "at 9:00 UTC" (see https://crontab.guru) - - cron: '0 9 * * *' + 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 test --exclude "base_models,tag:full_test" "base_models,tag:recent_test" "base_models,tag:base_goerli" "base_models,tag:gha_tasks" livequery_models - - - + 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 7f9c738..ad7568f 100644 --- a/.github/workflows/dbt_test_intraday.yml +++ b/.github/workflows/dbt_test_intraday.yml @@ -3,49 +3,22 @@ run-name: dbt_test_intraday on: workflow_dispatch: - schedule: - # Runs “At minute 5 past every 4th hour.” (see https://crontab.guru) - - cron: '5 */4 * * *' + 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 "base_models,tag:observability" - dbt test -m "base_models,tag:recent_test" - - - + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + target: test + command_name: Build Recent Testing Views + command: | + dbt run -m "fsc_evm,tag:recent_test" + command_name_2: Run Observability & Recent Tests + command_2: | + 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 e967d71..35db8f5 100644 --- a/.github/workflows/dbt_test_monthly.yml +++ b/.github/workflows/dbt_test_monthly.yml @@ -3,48 +3,21 @@ run-name: dbt_test_monthly on: workflow_dispatch: - schedule: - # Runs “At 7pm on the 28th of month.” (see https://crontab.guru) - - cron: '0 19 28 * *' + 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 test -m "base_models,tag:full_test" - - - + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + target: test + 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/data/github_actions__workflows.csv b/data/github_actions__workflows_old.csv similarity index 100% rename from data/github_actions__workflows.csv rename to data/github_actions__workflows_old.csv diff --git a/dbt_project.yml b/dbt_project.yml index 1d16ae5..e685f8b 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` @@ -49,11 +51,59 @@ query-comment: # 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" + base_models: # replace with the name of the chain + +copy_grants: true + +persist_docs: + relation: true + columns: true + +on_schema_change: "append_new_columns" + livequery_base: + +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: true # 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 @@ -62,19 +112,14 @@ models: vars: "dbt_date:time_zone": GMT STREAMLINE_INVOKE_STREAMS: False - STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES: False UPDATE_UDFS_AND_SPS: False UPDATE_SNOWFLAKE_TAGS: True - OBSERV_FULL_TEST: False OVERFLOWED_TRACES: False WAIT: 0 HEAL_MODEL: False HEAL_MODELS: [] START_GHA_TASKS: False - 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"] + STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES: False #### STREAMLINE 2.0 BEGIN #### @@ -100,40 +145,4 @@ vars: - INTERNAL_DEV - DBT_CLOUD_BASE -#### 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: 'base' - GLOBAL_NODE_SECRET_PATH: 'Vault/prod/base/quicknode/base_mainnet' - 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 - TRACES_REALTIME_SQL_LIMIT: 3600 - TRACES_REALTIME_PRODUCER_BATCH_SIZE: 900 - TRACES_REALTIME_WORKER_BATCH_SIZE: 450 - # GOLD_FULL_REFRESH: True - # SILVER_FULL_REFRESH: True - - ### MAIN_PACKAGE VARIABLES END ### - - ### DECODER_PACKAGE VARIABLES BEGIN ### - - ## REQUIRED - - ## OPTIONAL - ### DECODER_PACKAGE VARIABLES END ### - -#### FSC_EVM END #### \ No newline at end of file +#### STREAMLINE 2.0 END #### \ No newline at end of file diff --git a/macros/create_udfs.sql b/macros/create_udfs.sql index c91e37d..b243608 100644 --- a/macros/create_udfs.sql +++ b/macros/create_udfs.sql @@ -1,25 +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" - ) }} - {% endset %} {% do run_query(sql) %} - {% if target.database != "BASE_COMMUNITY_DEV" %} - {% set sql %} - {{ create_udf_get_chainhead() }} - {{ create_udf_bulk_json_rpc() }} - {{ create_udf_bulk_get_traces() }} - {{ create_udf_decode_array_string() }} - {{ create_udf_decode_array_object() }} - {{ create_udf_bulk_decode_logs() }} - - {% endset %} - {% do run_query(sql) %} - {% endif %} {{- fsc_utils.create_udfs() -}} {% endif %} {% 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 ba1bb2e..0000000 --- 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 d028310..0000000 --- a/macros/decoder/decoded_logs_history.sql +++ /dev/null @@ -1,129 +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 2a7f078..0000000 --- a/macros/decoder/run_decoded_logs_history.sql +++ /dev/null @@ -1,31 +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/_legacy/silver_traces.sql b/macros/fsc_evm_temp/_legacy/silver_traces.sql deleted file mode 100644 index 837d3de..0000000 --- a/macros/fsc_evm_temp/_legacy/silver_traces.sql +++ /dev/null @@ -1,226 +0,0 @@ -{% macro silver_traces_v1( - full_reload_start_block, - full_reload_blocks, - full_reload_mode = false, - TRACES_ARB_MODE = false, - TRACES_SEI_MODE = false, - TRACES_KAIA_MODE = false, - use_partition_key = false, - schema_name = 'bronze' - ) %} - WITH bronze_traces AS ( - SELECT - block_number, - {% if use_partition_key %} - partition_key, - {% else %} - _partition_by_block_id AS partition_key, - {% endif %} - - VALUE :array_index :: INT AS tx_position, - DATA :result AS full_traces, - {% if TRACES_SEI_MODE %} - DATA :txHash :: STRING AS tx_hash, - {% endif %} - _inserted_timestamp - FROM - -{% if is_incremental() and not full_reload_mode %} -{{ ref( - schema_name ~ '__traces' -) }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) - AND DATA :result IS NOT NULL {% if TRACES_ARB_MODE %} - AND block_number > 22207817 - {% endif %} - - {% elif is_incremental() and full_reload_mode %} - {{ ref( - schema_name ~ '__traces_fr' - ) }} -WHERE - {% if use_partition_key %} - partition_key BETWEEN ( - SELECT - MAX(partition_key) - 100000 - FROM - {{ this }} - ) - AND ( - SELECT - MAX(partition_key) + {{ full_reload_blocks }} - FROM - {{ this }} - ) - {% else %} - _partition_by_block_id BETWEEN ( - SELECT - MAX(_partition_by_block_id) - 100000 - FROM - {{ this }} - ) - AND ( - SELECT - MAX(_partition_by_block_id) + {{ full_reload_blocks }} - FROM - {{ this }} - ) - {% endif %} - - {% if TRACES_ARB_MODE %} - AND block_number > 22207817 - {% endif %} -{% else %} - {{ ref( - schema_name ~ '__traces_fr' - ) }} -WHERE - {% if use_partition_key %} - partition_key <= {{ full_reload_start_block }} - {% else %} - _partition_by_block_id <= {{ full_reload_start_block }} - {% endif %} - - {% if TRACES_ARB_MODE %} - AND block_number > 22207817 - {% endif %} -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY block_number, tx_position -ORDER BY - _inserted_timestamp DESC)) = 1 -), -flatten_traces AS ( - SELECT - block_number, - {% if TRACES_SEI_MODE %} - tx_hash, - {% else %} - tx_position, - {% endif %} - 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' - {% if TRACES_ARB_MODE %}, - 'afterEVMTransfers', - 'beforeEVMTransfers', - 'result.afterEVMTransfers', - 'result.beforeEVMTransfers' - {% endif %} - {% if TRACES_KAIA_MODE %}, - 'reverted', - 'result.reverted' - {% endif %} - ), - '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' - {% if TRACES_ARB_MODE %} - AND f.path NOT LIKE 'afterEVMTransfers[%' - AND f.path NOT LIKE 'beforeEVMTransfers[%' - {% endif %} - {% if TRACES_KAIA_MODE %} - and f.key not in ('message', 'contract') - {% endif %} - GROUP BY - block_number, - {% if TRACES_SEI_MODE %} - tx_hash, - {% else %} - tx_position, - {% endif %} - partition_key, - trace_address, - _inserted_timestamp -) -SELECT - block_number, - {% if TRACES_SEI_MODE %} - tx_hash, - {% else %} - tx_position, - {% endif %} - trace_address, - parent_trace_address, - trace_address_array, - trace_json, - partition_key, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['block_number'] + - (['tx_hash'] if TRACES_SEI_MODE else ['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 -{% 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 318a3da..0000000 --- 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 c6f7919..0000000 --- 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 b367deb..0000000 --- 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 3637b41..0000000 --- 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 f368685..0000000 --- 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 85cbbda..0000000 --- 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 598c3b9..0000000 --- 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 9c7262f..0000000 --- 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 3ff4458..0000000 --- a/macros/streamline/api_integrations.sql +++ /dev/null @@ -1,21 +0,0 @@ -{% macro create_aws_base_api() %} - {{ log( - "Creating integration for target:" ~ target - ) }} - - {% if target.name == "prod" %} - {% set sql %} - CREATE api integration IF NOT EXISTS aws_base_api api_provider = aws_api_gateway api_aws_role_arn = 'arn:aws:iam::490041342817:role/base-api-prod-rolesnowflakeudfsAF733095-FFKP94OAGPXW' api_allowed_prefixes = ( - 'https://u27qk1trpc.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_base_api_dev api_provider = aws_api_gateway api_aws_role_arn = 'arn:aws:iam::490041342817:role/base-api-dev-rolesnowflakeudfsAF733095-I354FW5312ZX' api_allowed_prefixes = ( - 'https://rijt3fsk7b.execute-api.us-east-1.amazonaws.com/dev/' - ) enabled = TRUE; -{% endset %} - {% do run_query(sql) %} - {% endif %} -{% endmacro %} diff --git a/macros/streamline/get_base_table_udtf.sql b/macros/streamline/get_base_table_udtf.sql deleted file mode 100644 index a488d14..0000000 --- a/macros/streamline/get_base_table_udtf.sql +++ /dev/null @@ -1,24 +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 => 100000000)) - ) -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 d2a2755..0000000 --- a/macros/streamline/streamline_udfs.sql +++ /dev/null @@ -1,67 +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_base_api AS 'https://u27qk1trpc.execute-api.us-east-1.amazonaws.com/prod/get_chainhead' - {% else %} - aws_base_api_dev AS 'https://rijt3fsk7b.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_base_api AS 'https://u27qk1trpc.execute-api.us-east-1.amazonaws.com/prod/udf_bulk_json_rpc' - {% else %} - aws_base_api_dev AS 'https://rijt3fsk7b.execute-api.us-east-1.amazonaws.com/dev/udf_bulk_json_rpc' - {%- 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_base_api AS 'https://u27qk1trpc.execute-api.us-east-1.amazonaws.com/prod/udf_bulk_get_traces' - {% else %} - aws_base_api_dev AS 'https://rijt3fsk7b.execute-api.us-east-1.amazonaws.com/dev/udf_bulk_get_traces' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_decode_array_string() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_decode( - abi ARRAY, - DATA STRING - ) returns ARRAY api_integration = {% if target.name == "prod" %} - aws_base_api AS 'https://u27qk1trpc.execute-api.us-east-1.amazonaws.com/prod/decode_function' - {% else %} - aws_base_api_dev AS 'https://rijt3fsk7b.execute-api.us-east-1.amazonaws.com/dev/decode_function' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_decode_array_object() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_decode( - abi ARRAY, - DATA OBJECT - ) returns ARRAY api_integration = {% if target.name == "prod" %} - aws_base_api AS 'https://u27qk1trpc.execute-api.us-east-1.amazonaws.com/prod/decode_log' - {% else %} - aws_base_api_dev AS 'https://rijt3fsk7b.execute-api.us-east-1.amazonaws.com/dev/decode_log' - {%- endif %}; -{% endmacro %} - - -{% macro create_udf_bulk_decode_logs() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_bulk_decode_logs( - json OBJECT - ) returns ARRAY api_integration = {% if target.name == "prod" %} - aws_base_api AS 'https://u27qk1trpc.execute-api.us-east-1.amazonaws.com/prod/bulk_decode_logs' - {% else %} - aws_base_api_dev AS'https://rijt3fsk7b.execute-api.us-east-1.amazonaws.com/dev/bulk_decode_logs' - {%- endif %}; -{% endmacro %} diff --git a/macros/tests/missing_decoding.sql b/macros/tests/missing_decoding.sql deleted file mode 100644 index 4a61add..0000000 --- a/macros/tests/missing_decoding.sql +++ /dev/null @@ -1,25 +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 a4d0b42..0000000 --- a/macros/tests/missing_txs.sql +++ /dev/null @@ -1,104 +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 - ) -{% 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_tx_hash <> '0x13b126388e78adc0fff1b40888b2cd87e6ec0d6c3c9838ee26119b81173bcf25' -{% 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 - ) -{% endmacro %} diff --git a/macros/tests/vertex_missing_products.sql b/macros/tests/vertex_missing_products.sql deleted file mode 100644 index 8047127..0000000 --- a/macros/tests/vertex_missing_products.sql +++ /dev/null @@ -1,47 +0,0 @@ -{% test vertex_missing_products( - model, - filter) %} - -with recent_records as ( - select * from {{model}} - where modified_timestamp >= SYSDATE() - INTERVAL '7 days' -), - -invalid_product_ids as ( - select distinct product_id - from {{ ref('silver__vertex_dim_products') }} - where product_id not in (select product_id from recent_records) - AND block_timestamp < sysdate() - INTERVAL '2 days' - {% if filter %} - AND {{ filter }} - {% endif %} -) - -select * -from invalid_product_ids - -{% endtest %} - -{% test vertex_product_level_recency( - model, - filter) %} - -with recent_records as ( - select distinct(product_id) from {{model}} - where block_timestamp >= SYSDATE() - INTERVAL '7 days' -), - -invalid_product_ids as ( - select * - from {{ ref('silver__vertex_dim_products') }} - where product_id not in (select product_id from recent_records) - AND block_timestamp < sysdate() - INTERVAL '2 days' - {% if filter %} - AND {{ filter }} - {% endif %} -) - -select * -from invalid_product_ids - -{% endtest %} \ No newline at end of file diff --git a/macros/utils.sql b/macros/utils.sql deleted file mode 100644 index 0b800b8..0000000 --- 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 %} diff --git a/makefile b/makefile new file mode 100644 index 0000000..69c29ae --- /dev/null +++ b/makefile @@ -0,0 +1,41 @@ +DBT_TARGET ?= dev + +cleanup_time: + rm -f package-lock.yml && dbt clean && dbt deps + +deploy_github_actions: + dbt run -s livequery_base.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 '{"START_GHA_TASKS":False}' -t $(DBT_TARGET) + +deploy_new_github_action: + dbt run-operation fsc_evm.drop_github_actions_schema -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 '{"START_GHA_TASKS":False}' -t $(DBT_TARGET) + +deploy_livequery: + dbt run-operation fsc_evm.drop_livequery_schemas --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET) + dbt run -m livequery_base.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: + dbt run -m livequery_base.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) + dbt run -m "fsc_evm,tag:phase_1" --full-refresh --vars '{"GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET) + # kick chainhead workflow + # wait ~10 minutes + # run deploy_chain_phase_2 + +deploy_chain_phase_2: + 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}' -t $(DBT_TARGET) + make deploy_github_actions -t $(DBT_TARGET) + # tasks set to SUSPEND by default + # kick alter_gha_task workflow to RESUME individual tasks, as needed + +deploy_chain_phase_3: + dbt run -m "fsc_evm,tag:phase_3" --full-refresh --vars '{"GLOBAL_BRONZE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true}' -t $(DBT_TARGET) + # kick alter_gha_task workflow to RESUME individual tasks, as needed + +.PHONY: deploy_github_actions cleanup_time deploy_new_github_action deploy_chain_phase_1 deploy_chain_phase_2 deploy_chain_phase_3 deploy_livequery \ 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 b9eb114..0000000 --- a/models/bronze/api_udf/_retry_abis.sql +++ /dev/null @@ -1,87 +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( - 'base_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( - 'base_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 - 5 -), 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( - 'base_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( - 'base_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 8ef7d86..0000000 --- a/models/bronze/api_udf/bronze_api__contract_abis.sql +++ /dev/null @@ -1,67 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = "contract_address", - full_refresh = false, - tags = ['non_realtime'] -) }} - -WITH base AS ( - - SELECT - contract_address - FROM - {{ ref('silver__relevant_contracts') }} - WHERE - total_interaction_count >= 10000 - -{% 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.basescan.org/api?module=contract&action=getabi&address=', rn.contract_address, '&apikey={key}'),{ 'User-Agent': 'FlipsideStreamline' },{}, 'Vault/prod/block_explorers/base_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 9216204..0000000 --- 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 2571cf6..0000000 --- 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 - 100 -), 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/base/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 10ac0f3..0000000 --- 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/ethereum/bronze__state_hashes.sql index dbf8f30..b00b503 100644 --- a/models/bronze/ethereum/bronze__state_hashes.sql +++ b/models/bronze/ethereum/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 diff --git a/models/bronze/labels/bronze__labels.sql b/models/bronze/labels/bronze__labels.sql deleted file mode 100644 index 774ed22..0000000 --- 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 = 'base' - 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 d10f981..0000000 --- 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 79c3100..0000000 --- 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( - 'base_gold', - 'fact_traces' - ) }} - tr2 USING ( - block_number, - tx_position - ) - JOIN {{ ref("streamline__traces_complete") }} USING (block_number) - LEFT JOIN {{ source( - 'base_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.BASE_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 39001f3..0000000 --- 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 84539f0..0000000 --- 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 e70cb53..0000000 --- a/models/bronze/prices/bronze__complete_provider_asset_metadata.sql +++ /dev/null @@ -1,26 +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 = 'Base' --- platforms specific to Base \ 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 7d85636..0000000 --- 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 f197918..0000000 --- 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 = 'base' \ 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 4858782..0000000 --- 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 = 'base' diff --git a/models/doc_descriptions/L1_fields/base_max_block.md b/models/doc_descriptions/L1_fields/base_max_block.md deleted file mode 100644 index 789d7df..0000000 --- a/models/doc_descriptions/L1_fields/base_max_block.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_max_block %} - -The max block on Base this batch relates to. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/L1_fields/base_min_block.md b/models/doc_descriptions/L1_fields/base_min_block.md deleted file mode 100644 index 4a7a2db..0000000 --- a/models/doc_descriptions/L1_fields/base_min_block.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_min_block %} - -The min block on Base this batch relates to. - -{% enddocs %} \ No newline at end of file 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 e4f1fb2..0000000 --- a/models/doc_descriptions/L1_fields/batch_size.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_batch_size %} - -Total Base 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 e6706e0..0000000 --- a/models/doc_descriptions/L1_fields/l1_batch_root.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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 32037af..0000000 --- a/models/doc_descriptions/L1_fields/l1_block_number.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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 76b5a69..0000000 --- a/models/doc_descriptions/L1_fields/l1_block_timestamp.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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 71e88a1..0000000 --- a/models/doc_descriptions/L1_fields/l1_fee_scalar.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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 bb66684..0000000 --- a/models/doc_descriptions/L1_fields/l1_gas_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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 8f00a30..0000000 --- a/models/doc_descriptions/L1_fields/l1_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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 f953d22..0000000 --- a/models/doc_descriptions/L1_fields/l1_state_root_batch_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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 8a58871..0000000 --- a/models/doc_descriptions/L1_fields/l1_state_root_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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 93e4697..0000000 --- a/models/doc_descriptions/L1_fields/l1_submission_batch_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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 41fd53e..0000000 --- a/models/doc_descriptions/L1_fields/l1_submission_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/prev_total_elements.md b/models/doc_descriptions/L1_fields/prev_total_elements.md deleted file mode 100644 index a48930f..0000000 --- a/models/doc_descriptions/L1_fields/prev_total_elements.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_prev_total_elements %} - -Confirmed blocks prior to this batch. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/base_block_header_json.md b/models/doc_descriptions/blocks/base_block_header_json.md deleted file mode 100644 index ab710e5..0000000 --- a/models/doc_descriptions/blocks/base_block_header_json.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_blockchain.md b/models/doc_descriptions/blocks/base_blockchain.md deleted file mode 100644 index 6ee077a..0000000 --- a/models/doc_descriptions/blocks/base_blockchain.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_blockchain %} - -The blockchain on which transactions are being confirmed. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/base_blocks_hash.md b/models/doc_descriptions/blocks/base_blocks_hash.md deleted file mode 100644 index 214321c..0000000 --- a/models/doc_descriptions/blocks/base_blocks_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_blocks_nonce.md b/models/doc_descriptions/blocks/base_blocks_nonce.md deleted file mode 100644 index f8d4a9b..0000000 --- a/models/doc_descriptions/blocks/base_blocks_nonce.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_blocks_table_doc.md b/models/doc_descriptions/blocks/base_blocks_table_doc.md deleted file mode 100644 index 8a21771..0000000 --- a/models/doc_descriptions/blocks/base_blocks_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_blocks_table_doc %} - -This table contains block level data for the Base 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/base_difficulty.md b/models/doc_descriptions/blocks/base_difficulty.md deleted file mode 100644 index 144e6f5..0000000 --- a/models/doc_descriptions/blocks/base_difficulty.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_difficulty %} - -The effort required to mine the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/base_extra_data.md b/models/doc_descriptions/blocks/base_extra_data.md deleted file mode 100644 index aa507c5..0000000 --- a/models/doc_descriptions/blocks/base_extra_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_gas_limit.md b/models/doc_descriptions/blocks/base_gas_limit.md deleted file mode 100644 index 4b6d763..0000000 --- a/models/doc_descriptions/blocks/base_gas_limit.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_gas_used.md b/models/doc_descriptions/blocks/base_gas_used.md deleted file mode 100644 index be34b92..0000000 --- a/models/doc_descriptions/blocks/base_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_gas_used %} - -Total gas used in the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/base_miner.md b/models/doc_descriptions/blocks/base_miner.md deleted file mode 100644 index 95e3cc8..0000000 --- a/models/doc_descriptions/blocks/base_miner.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_network.md b/models/doc_descriptions/blocks/base_network.md deleted file mode 100644 index ef05423..0000000 --- a/models/doc_descriptions/blocks/base_network.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_network %} - -The network on the blockchain used by a transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/base_parent_hash.md b/models/doc_descriptions/blocks/base_parent_hash.md deleted file mode 100644 index beb821f..0000000 --- a/models/doc_descriptions/blocks/base_parent_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_receipts_root.md b/models/doc_descriptions/blocks/base_receipts_root.md deleted file mode 100644 index fc69c1a..0000000 --- a/models/doc_descriptions/blocks/base_receipts_root.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_receipts_root %} - -The root of the state trie. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/base_sha3_uncles.md b/models/doc_descriptions/blocks/base_sha3_uncles.md deleted file mode 100644 index 3a1a39a..0000000 --- a/models/doc_descriptions/blocks/base_sha3_uncles.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_size.md b/models/doc_descriptions/blocks/base_size.md deleted file mode 100644 index 408d974..0000000 --- a/models/doc_descriptions/blocks/base_size.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_total_difficulty.md b/models/doc_descriptions/blocks/base_total_difficulty.md deleted file mode 100644 index 097da9e..0000000 --- a/models/doc_descriptions/blocks/base_total_difficulty.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_tx_count.md b/models/doc_descriptions/blocks/base_tx_count.md deleted file mode 100644 index 85722d7..0000000 --- a/models/doc_descriptions/blocks/base_tx_count.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_tx_count %} - -Total number of transactions within a block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/base_uncle_blocks.md b/models/doc_descriptions/blocks/base_uncle_blocks.md deleted file mode 100644 index 98af016..0000000 --- a/models/doc_descriptions/blocks/base_uncle_blocks.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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 4462b99..0000000 --- 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, HOP, MESON, 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 47abca4..0000000 --- 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 2a9edfd..0000000 --- a/models/doc_descriptions/complete_lending/complete_lending_table_docs.md +++ /dev/null @@ -1,36 +0,0 @@ -{% docs complete_lending_borrows_table_doc %} - -This table contains transactions where users borrowed assets across AAVE, COMPOUND, MOONWELL, MORPHO, SEAMLESS, SONNE, and GRANARY protocols. In order to borrow assets, a user must first deposit their preferred asset and amount as collateral. MORPHO required trace-level curation; as a result, certain columns exclusive to event logs, such as event index, will contain NULL values. - - -{% enddocs %} - -{% docs complete_lending_deposits_table_doc %} - -This table contains deposit transactions across AAVE, COMPOUND, MOONWELL, MORPHO, SEAMLESS, SONNE, and GRANARY protocols. A user deposits their preferred asset and amount. After depositing, users earn passive income based on the market borrowing demand. Additionally, depositing allows users to borrow by using their deposited assets as a collateral. Any interest earned by depositing funds helps offset the interest rate accumulated by borrowing. MORPHO required trace-level curation; as a result, certain columns exclusive to event logs, such as event index, will contain NULL values. - -{% enddocs %} - -{% docs complete_lending_flashloans_table_doc %} - -This table contains flash loan transactions across AAVE, MORPHO, SEAMLESS, 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, COMPOUND, MOONWELL, MORPHO, SEAMLESS, SONNE, and GRANARY protocols. Liquidations occur when a borrower's health factor goes below 1 due to their collateral value not properly covering their loan/debt value. This might happen when the collateral decreases in value or the borrowed debt increases in value against each other. This collateral vs loan value ratio is shown in the health factor. In a liquidation, up to 50% of a borrower's debt is repaid and that value + liquidation fee is taken from the collateral available, so after a liquidation the amount liquidated from one's debt is repaid. - -{% enddocs %} - -{% docs complete_lending_repayments_table_doc %} - -This table contains transactions in which a borrower repays their loan (debt) across the AAVE, COMPOUND, MOONWELL, MORPHO, SEAMLESS, SONNE, and GRANARY protocols. Loans are repaid in the same asset borrowed, plus accrued interest. Borrowers can pay back their loan based on the USD price as they can borrow any of the available stable coins (USDC, DAI, USDT, etc.). MORPHO required trace-level curation; as a result, certain columns exclusive to event logs, such as event index, will contain NULL values. - -{% enddocs %} - -{% docs complete_lending_withdraws_table_doc %} - -This table contains transactions in which a user withdraws liquidity across the AAVE, COMPOUND, MOONWELL, MORPHO, SEAMLESS, SONNE, and GRANARY protocols. Users need to make sure there is enough liquidity (not borrowed) in order to withdraw, if this is not the case, users need to wait for more liquidity from depositors or borrowers repaying. MORPHO required trace-level curation; as a result, certain columns exclusive to event logs, such as event index, will contain NULL values. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/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 96d5c47..0000000 --- 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 31935bf..0000000 --- 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 fec40c0..0000000 --- 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 db5ad7d..0000000 --- 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 d2664c2..0000000 --- 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 base.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 87f744c..0000000 --- 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 base.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 744757f..0000000 --- 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 base blockchain, including the tokens, symbols and decimals within each pool alongside the following protocols: SUSHI, UNISWAP, BALANCER, SWAPBASED, BASESWAP, DACKIE, WOOFI, AERODROME, CURVE, and MAVERICK. - -{% 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 d0678e3..0000000 --- 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 base.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 f641107..0000000 --- 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 1d4192d..0000000 --- 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 2fc289a..0000000 --- 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 8b1cf24..0000000 --- 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 0f82b78..0000000 --- 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 bfa46fd..0000000 --- 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 34aab5e..0000000 --- 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 0b22557..0000000 --- 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 3b52837..0000000 --- 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 03a3abf..0000000 --- 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 0f931bc..0000000 --- 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 d440b24..0000000 --- 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 a55bca2..0000000 --- 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 4695dc9..0000000 --- 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 89e354c..0000000 --- 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 76758f8..0000000 --- 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 40ec8c4..0000000 --- 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 11dd78f..0000000 --- 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 74f3406..0000000 --- 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, BALANCER, SWAPBASED, BASESWAP, DACKIE, WOOFI, AERODROME, CURVE, MAVERICK, and VOODOO. along with other helpful columns including an amount USD where possible. Other dexes coming soon! -Note: A rule has been put in place to null out the amount_USD if that number is too divergent between amount_in_USD and amount_out_usd. This can happen for swaps of less liquid tokens during very high fluctuation of price. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/base_event_index.md b/models/doc_descriptions/event_logs/base_event_index.md deleted file mode 100644 index 4ec95f8..0000000 --- a/models/doc_descriptions/event_logs/base_event_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_event_index %} - -Event number within a transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/base_event_inputs.md b/models/doc_descriptions/event_logs/base_event_inputs.md deleted file mode 100644 index 2fd3283..0000000 --- a/models/doc_descriptions/event_logs/base_event_inputs.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_event_name.md b/models/doc_descriptions/event_logs/base_event_name.md deleted file mode 100644 index 83786a6..0000000 --- a/models/doc_descriptions/event_logs/base_event_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_event_removed.md b/models/doc_descriptions/event_logs/base_event_removed.md deleted file mode 100644 index bc9bd30..0000000 --- a/models/doc_descriptions/event_logs/base_event_removed.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_event_sig.md b/models/doc_descriptions/event_logs/base_event_sig.md deleted file mode 100644 index b6972eb..0000000 --- a/models/doc_descriptions/event_logs/base_event_sig.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_origin_sig %} - -The function signature of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/base_log_id_events.md b/models/doc_descriptions/event_logs/base_log_id_events.md deleted file mode 100644 index 9c57b48..0000000 --- a/models/doc_descriptions/event_logs/base_log_id_events.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_logs_contract_address.md b/models/doc_descriptions/event_logs/base_logs_contract_address.md deleted file mode 100644 index c2643f4..0000000 --- a/models/doc_descriptions/event_logs/base_logs_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_logs_contract_name.md b/models/doc_descriptions/event_logs/base_logs_contract_name.md deleted file mode 100644 index 798e1ae..0000000 --- a/models/doc_descriptions/event_logs/base_logs_contract_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_logs_data.md b/models/doc_descriptions/event_logs/base_logs_data.md deleted file mode 100644 index 8777041..0000000 --- a/models/doc_descriptions/event_logs/base_logs_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_logs_data %} - -The un-decoded event data. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/base_logs_table_doc.md b/models/doc_descriptions/event_logs/base_logs_table_doc.md deleted file mode 100644 index c0f1d57..0000000 --- a/models/doc_descriptions/event_logs/base_logs_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_logs_table_doc %} - -This table contains flattened event logs from transactions on the Base 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. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/base_logs_tx_hash.md b/models/doc_descriptions/event_logs/base_logs_tx_hash.md deleted file mode 100644 index 3dfe3d6..0000000 --- a/models/doc_descriptions/event_logs/base_logs_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_origin_from.md b/models/doc_descriptions/event_logs/base_origin_from.md deleted file mode 100644 index 7c0db2b..0000000 --- a/models/doc_descriptions/event_logs/base_origin_from.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_origin_from %} - -The from address of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/base_origin_to.md b/models/doc_descriptions/event_logs/base_origin_to.md deleted file mode 100644 index 086b3fd..0000000 --- a/models/doc_descriptions/event_logs/base_origin_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_origin_to %} - -The to address of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/base_topics.md b/models/doc_descriptions/event_logs/base_topics.md deleted file mode 100644 index 0878f89..0000000 --- a/models/doc_descriptions/event_logs/base_topics.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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 8edb229..0000000 --- a/models/doc_descriptions/fsc_evm/L1_submission_fields.md +++ /dev/null @@ -1,89 +0,0 @@ -{% docs evm_batch_size %} - -Total transactions included within the batch on the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_max_block %} - -The max block on the OP stack L2 chain this batch relates to. - -{% enddocs %} - -{% docs evm_min_block %} - -The min block on the OP stack L2 chain this batch relates to. - -{% enddocs %} - -{% docs evm_batch_root %} - -Root of the batch, either for submission or state on the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_block_no %} - -The Ethereum block number that contained the batch from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_block_time %} - -The timestamp of the Ethereum block that contained this batch from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_fee %} - -The L1 portion of fees paid. - -{% enddocs %} - -{% docs evm_l1_fee_scalar %} - -This value covers the change in L1 gas price between the time the transaction is submitted and when it is published from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_gas_price %} - -The gas price for L1 transactions when the transaction was processed from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_gas_used %} - -The gas used on L1 to publish the transaction from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_state_batch %} - -The batch index of when this block was included in the Ethereum state root. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_state_tx_hash %} - -The L1 tx hash of when this block was included in the Ethereum state root. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_sub_batch %} - -The batch index of when this block was submitted to L1. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_l1_sub_tx_hash %} - -The L1 tx hash of when this block was submitted to L1. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain. - -{% enddocs %} - -{% docs evm_prev_total_elements %} - -Confirmed blocks prior to this batch on the OP stack L2 chain. - -{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/blocks.md b/models/doc_descriptions/fsc_evm/blocks.md deleted file mode 100644 index 2f2f846..0000000 --- a/models/doc_descriptions/fsc_evm/blocks.md +++ /dev/null @@ -1,143 +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 %} 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 77e2b35..0000000 --- a/models/doc_descriptions/fsc_evm/complete_general.md +++ /dev/null @@ -1,65 +0,0 @@ -{% docs evm_block_number %} - -Also known as block height. The block number, which indicates the length of the blockchain, increases after the addition of each new block. - -{% enddocs %} - -{% docs evm_block_timestamp %} - -The date and time at which the block was produced. - -{% enddocs %} - -{% docs evm_from_address %} - -The sending address of this transaction. - -{% enddocs %} - -{% docs evm_ingested_at %} - -Internal column. - -{% enddocs %} - -{% docs evm_to_address %} - -The receiving address of this transaction. This can be a contract address. - -{% enddocs %} - -{% docs evm_pk %} - -The unique identifier for each row in the table. - -{% enddocs %} - -{% docs evm_inserted_timestamp %} - -The UTC timestamp at which the row was inserted into the table. - -{% enddocs %} - -{% docs evm_modified_timestamp %} - -The UTC timestamp at which the row was last modified. - -{% enddocs %} - -{% docs evm_precise_amount_unadjusted %} - -The precise, unadjusted amount of the transaction. This is returned as a string to avoid precision loss. - -{% enddocs %} - -{% docs evm_precise_amount_adjusted %} - -The precise, adjusted amount of the transaction. This is returned as a string to avoid precision loss. - -{% enddocs %} - -{% docs evm_value_hex %} - -The value of the transaction in hexadecimal format. - -{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/event_logs.md b/models/doc_descriptions/fsc_evm/event_logs.md deleted file mode 100644 index 8880f5c..0000000 --- a/models/doc_descriptions/fsc_evm/event_logs.md +++ /dev/null @@ -1,83 +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 %} 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 331f1c2..0000000 --- a/models/doc_descriptions/fsc_evm/evm_deprecations.md +++ /dev/null @@ -1,203 +0,0 @@ -{% docs evm_column_deprecation_notice %} - -This column is being deprecated for standardization purposes. Please update your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_hash %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `block_hash` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_block_hash %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_position %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `tx_position` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_tx_status %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `tx_succeeded` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_chain_id %} - -This column is being removed for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_identifier %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `trace_address` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_trace_status %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `trace_succeeded` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_log_id %} - -This column is being removed for standardization purposes. Please remove or update your queries with `CONCAT(tx_hash, '_', event_index)` to reconstruct `_log_id` by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_inserted_timestamp %} - -This column is being removed for standardization purposes. Please update your queries to use the `modified_timestamp` column instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_blockchain %} - -This column is being removed for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_block_header_json %} - -This column is being removed for standardization purposes and will be replaced with new columns associated with the keys extracted from this json. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_table_deprecation_notice %} - -This table is being deprecated for standardization purposes. Please update your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_table_deprecation_notice_fact_decoded_event_logs %} - -This table is being deprecated for standardization purposes. Please update your queries to use `ez_decoded_event_logs` instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_table_deprecation_notice_fact_decoded_traces %} - -This table is being deprecated for standardization purposes. Please update your queries to use `ez_decoded_traces` instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_table_deprecation_notice_fact_token_transfers %} - -This table is being deprecated for standardization purposes. Please update your queries to use `ez_token_transfers` instead by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_state_root_tx_hash %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_state_root_batch_index %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_submission_tx_hash %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_submission_batch_index %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_l1_submission_details %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_data %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_deposit_nonce %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_deposit_receipt_version %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_token_price %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{% docs evm_column_deprecation_notice_has_decimal %} - -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_tokenid %} - -This column is being deprecated 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 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 deprecated for standardization purposes. Please update your queries to use the `contract_address` column instead by March 10, 2025. - -{% enddocs %} - -{%docs evm_column_deprecation_notice_project_name %} - -This column is being deprecated for standardization purposes. Please update your queries to use the `name` column instead by March 10, 2025. - -{% enddocs %} - -{%docs evm_column_deprecation_notice_event_type %} - -This column is being deprecated for standardization purposes. Please remove from your queries by March 10, 2025. - -{% enddocs %} - -{%docs evm_column_deprecation_notice_nft_from_address %} - -This column is being deprecated 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 deprecated for standardization purposes. Please update your queries to use the `to_address` column instead by March 10, 2025. - -{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/nft.md b/models/doc_descriptions/fsc_evm/nft.md deleted file mode 100644 index dba8714..0000000 --- a/models/doc_descriptions/fsc_evm/nft.md +++ /dev/null @@ -1,587 +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_quantity %} - -The number of NFTs transferred in this transaction. If it is an ERC1155, there can be multiple NFTs transferred in a single transaction. If it is an ERC721, this will be 1. - -{% enddocs %} - -{% docs evm_nft_token_standard %} - -The token standard of the NFT. - -{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/traces.md b/models/doc_descriptions/fsc_evm/traces.md deleted file mode 100644 index cebd31a..0000000 --- a/models/doc_descriptions/fsc_evm/traces.md +++ /dev/null @@ -1,125 +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_revert_reason %} - -The reason for the revert, if available. - -{% enddocs %} - -{% docs evm_trace_address %} - -The trace address for this trace. - -{% enddocs %} - -{% docs evm_trace_type %} - -The type of internal transaction. Common trace types are `CALL`, `DELEGATECALL`, and `STATICCALL`. - -{% enddocs %} diff --git a/models/doc_descriptions/fsc_evm/transactions.md b/models/doc_descriptions/fsc_evm/transactions.md deleted file mode 100644 index a5b74ea..0000000 --- a/models/doc_descriptions/fsc_evm/transactions.md +++ /dev/null @@ -1,188 +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 %} diff --git a/models/doc_descriptions/fsc_evm/transfers.md b/models/doc_descriptions/fsc_evm/transfers.md deleted file mode 100644 index eafaca3..0000000 --- a/models/doc_descriptions/fsc_evm/transfers.md +++ /dev/null @@ -1,144 +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/__overview__.md b/models/doc_descriptions/general/__overview__.md deleted file mode 100644 index 14b3b5e..0000000 --- a/models/doc_descriptions/general/__overview__.md +++ /dev/null @@ -1,124 +0,0 @@ -{% docs __overview__ %} - -# Welcome to the Flipside Crypto Base Models Documentation! - -## **What does this documentation cover?** -The documentation included here details the design of the Base tables and views available via [Flipside Crypto.](https://flipsidecrypto.xyz/) For more information on how these models are built, please see [the github repository.](https://github.com/FlipsideCrypto/base-models) - -## **How do I use these docs?** -The easiest way to navigate this documentation is to use the Quick Links below. These links will take you to the documentation for each table, which contains a description, a list of the columns, and other helpful information. - -If you are experienced with dbt docs, feel free to use the sidebar to navigate the documentation, as well as explore the relationships between tables and the logic building them. - -There is more information on how to use dbt docs in the last section of this document. - -## **Quick Links to Table Documentation** - -**Click on the links below to jump to the documentation for each schema.** - -### Core Tables - -**Dimensional Tables** -- [dim_contracts](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.core__dim_contracts) -- [dim_labels](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.core__dim_labels) - -**Fact Tables:** -- [fact_blocks](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.core__fact_blocks) -- [fact_transactions](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.core__fact_transactions) -- [fact_event_logs](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.core__fact_event_logs) -- [fact_traces](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.core__fact_traces) -- [fact_token_transfers](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.core__fact_token_transfers) -- [fact_decoded_event_logs](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.core__fact_decoded_event_logs) - -**Convenience Tables:** -- [ez_decoded_event_logs](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.core__ez_decoded_event_logs) -- [ez_native_transfers](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.core__ez_native_transfers) -- [ez_token_transfers](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.core__ez_token_transfers) - -### Price Tables (base.price) -- [dim_asset_metadata](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.price__dim_asset_metadata) -- [fact_prices_ohlc_hourly](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.price__fact_prices_ohlc_hourly) -- [ez_asset_metadata](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.price__ez_asset_metadata) -- [ez_prices_hourly](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.price__ez_prices_hourly) - -### DeFi Tables (base.defi) -- [ez_bridge_activity](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.defi__ez_bridge_activity) -- [ez_dex_swaps](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.defi__ez_dex_swaps) -- [dim_dex_liquidity_pools](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.defi__dim_dex_liquidity_pools) -- [ez_lending_borrows](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.defi__ez_lending_borrows) -- [ez_lending_deposits](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.defi__ez_lending_deposits) -- [ez_lending_flashloans](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.defi__ez_lending_flashloans) -- [ez_lending_liquidations](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.defi__ez_lending_liquidations) -- [ez_lending_repayments](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.defi__ez_lending_repayments) -- [ez_lending_withdraws](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.defi__ez_lending_withdraws) - -### Flipside Partner Tables (arbitrum.partner_name) - -**Vertex Tables:** -- [dim_products](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.vertex__dim_products) -- [ez_clearing_house_events](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.vertex__ez_clearing_house_events) -- [ez_liquidations](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.vertex__ez_liquidations) -- [ez_perp_trades](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.vertex__ez_perp_trades) -- [ez_spot_trades](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.vertex__ez_spot_trades) -- [ez_account_stats](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.vertex__ez_account_stats) -- [ez_edge_trades](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.vertex__ez_edge_trades) -- [ez_market_depth_stats](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.vertex__ez_market_depth_stats) -- [ez_market_stats](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.vertex__ez_market_stats) -- [ez_money_markets](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.vertex__ez_money_markets) - -### NFT Tables (base.nft) -- [ez_nft_transfers](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.nft__ez_nft_transfers) -- [ez_nft_sales](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.nft__ez_nft_sales) - -### Stats Tables (base.stats) -- [ez_core_metrics_hourly](https://flipsidecrypto.github.io/base-models/#!/model/model.base_models.stats__ez_core_metrics_hourly) - -## **Helpful User-Defined Functions (UDFs)** - -UDFs are custom functions built by the Flipside team that can be used in your queries to make your life easier. - -Please visit [LiveQuery Functions Overview](https://flipsidecrypto.github.io/livequery-models/#!/overview) for a full list of helpful UDFs. - -## **Data Model Overview** - -The Base models are built a few different ways, but the core fact tables are built using three layers of sql models: **bronze, silver, and gold (or core).** - -- Bronze: Data is loaded in from the source as a view -- Silver: All necessary parsing, filtering, de-duping, and other transformations are done here -- Gold (or core): Final views and tables that are available publicly - -The dimension tables are sourced from a variety of on-chain and off-chain sources. - -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: Base is currently operating in it's Testnet phase. Flipside will provide Mainnet data tables once Base Mainnet is deployed. - -## **Using dbt docs** -### Navigation - -You can use the ```Project``` and ```Database``` navigation tabs on the left side of the window to explore the models in the project. - -### 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. - -### Graph Exploration - -You can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models. - -On model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the Expand button at the top-right of this lineage pane, you'll be able to see all of the models that are used to build, or are built from, the model you're exploring. - -Once expanded, you'll be able to use the ```--models``` and ```--exclude``` model selection syntax to filter the models in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax). - -Note that you can also right-click on models to interactively filter and explore the graph. - - -### **More information** -- [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/base-models) -- [What is dbt?](https://docs.getdbt.com/docs/introduction) - - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/base_block_number.md b/models/doc_descriptions/general/base_block_number.md deleted file mode 100644 index 58a21af..0000000 --- a/models/doc_descriptions/general/base_block_number.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_block_timestamp.md b/models/doc_descriptions/general/base_block_timestamp.md deleted file mode 100644 index 142ca21..0000000 --- a/models/doc_descriptions/general/base_block_timestamp.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_decimals.md b/models/doc_descriptions/general/base_decimals.md deleted file mode 100644 index 41abd5d..0000000 --- a/models/doc_descriptions/general/base_decimals.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_from_address.md b/models/doc_descriptions/general/base_from_address.md deleted file mode 100644 index bd291d6..0000000 --- a/models/doc_descriptions/general/base_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_from_address %} - -The sending address of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/base_ingested_at.md b/models/doc_descriptions/general/base_ingested_at.md deleted file mode 100644 index c1c0671..0000000 --- a/models/doc_descriptions/general/base_ingested_at.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_ingested_at %} - -Internal column. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/base_symbol.md b/models/doc_descriptions/general/base_symbol.md deleted file mode 100644 index 4731365..0000000 --- a/models/doc_descriptions/general/base_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_symbol %} - -The symbol belonging to the address of the token - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/base_to_address.md b/models/doc_descriptions/general/base_to_address.md deleted file mode 100644 index 4366200..0000000 --- a/models/doc_descriptions/general/base_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/deprecation.md b/models/doc_descriptions/general/deprecation.md deleted file mode 100644 index 004e578..0000000 --- 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 848af44..0000000 --- a/models/doc_descriptions/general/export_columns.md +++ /dev/null @@ -1,19 +0,0 @@ -{% docs pk %} - -The unique identifier for each row in the table. - -{% enddocs %} - -{% docs inserted_timestamp %} - -The utc timestamp at which the row was inserted into the table. - -{% enddocs %} - -{% docs modified_timestamp %} - -The utc timestamp at which the row was last modified. - -{% enddocs %} - - diff --git a/models/doc_descriptions/general/precise_amounts.md b/models/doc_descriptions/general/precise_amounts.md deleted file mode 100644 index 96a815c..0000000 --- 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/base_label.md b/models/doc_descriptions/labels/base_label.md deleted file mode 100644 index 3d2de4f..0000000 --- a/models/doc_descriptions/labels/base_label.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_project_name %} - -The name of the project for this address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/base_label_address.md b/models/doc_descriptions/labels/base_label_address.md deleted file mode 100644 index b54b261..0000000 --- a/models/doc_descriptions/labels/base_label_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_label_address_name.md b/models/doc_descriptions/labels/base_label_address_name.md deleted file mode 100644 index fb589df..0000000 --- a/models/doc_descriptions/labels/base_label_address_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_label_address_name %} - -The most granular label for this address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/base_label_blockchain.md b/models/doc_descriptions/labels/base_label_blockchain.md deleted file mode 100644 index 642c9bf..0000000 --- a/models/doc_descriptions/labels/base_label_blockchain.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_label_blockchain %} - -The name of the blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/base_label_creator.md b/models/doc_descriptions/labels/base_label_creator.md deleted file mode 100644 index 721ba9f..0000000 --- a/models/doc_descriptions/labels/base_label_creator.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_label_creator %} - -The name of the creator of the label. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/base_label_subtype.md b/models/doc_descriptions/labels/base_label_subtype.md deleted file mode 100644 index 144bf75..0000000 --- a/models/doc_descriptions/labels/base_label_subtype.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_label_type.md b/models/doc_descriptions/labels/base_label_type.md deleted file mode 100644 index e7ef915..0000000 --- a/models/doc_descriptions/labels/base_label_type.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_labels_table_doc.md b/models/doc_descriptions/labels/base_labels_table_doc.md deleted file mode 100644 index f0b66b9..0000000 --- a/models/doc_descriptions/labels/base_labels_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_labels_table %} - -This table contains labels for addresses on the Base 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 10e72c4..0000000 --- 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 6a1b73a..0000000 --- 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 5f56a54..0000000 --- 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 1080238..0000000 --- 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 eeb9c3d..0000000 --- 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 27fa2f8..0000000 --- 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 22c9396..0000000 --- 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 a853435..0000000 --- a/models/doc_descriptions/nft/nft_currency_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_currency_address %} - -The token contract address for this NFT event. This will be `ETH` for native ETH transactions. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_currency_symbol.md b/models/doc_descriptions/nft/nft_currency_symbol.md deleted file mode 100644 index 3dd3c73..0000000 --- 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 580ba06..0000000 --- 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 0d5fc39..0000000 --- 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 82f5d8c..0000000 --- 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 475b31d..0000000 --- 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 Base 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 a1d3c41..0000000 --- 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 4ce24fc..0000000 --- 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 3d01653..0000000 --- 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 a84c6bb..0000000 --- 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 dd2bf06..0000000 --- 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 Base 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 f9a8c47..0000000 --- a/models/doc_descriptions/nft/nft_mint_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mint_price %} - -The price paid in ETH to mint the NFT(s). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mint_price_usd.md b/models/doc_descriptions/nft/nft_mint_price_usd.md deleted file mode 100644 index 7e8bf17..0000000 --- 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 688ae3d..0000000 --- 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 84d1946..0000000 --- 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 03942a4..0000000 --- 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 9e500f7..0000000 --- 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 b064027..0000000 --- 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 b5e039f..0000000 --- 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 4d6e121..0000000 --- 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 252828b..0000000 --- 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 02b4ce6..0000000 --- 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 316a2b6..0000000 --- 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 aa0f059..0000000 --- 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 18be47c..0000000 --- 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 6497c53..0000000 --- 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 552cbfd..0000000 --- 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 05c78e1..0000000 --- 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 1dccd76..0000000 --- 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 2dc1df1..0000000 --- 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 2ddcf23..0000000 --- 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 198294c..0000000 --- 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 547c383..0000000 --- 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 6d2e48b..0000000 --- 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 7ec60c9..0000000 --- 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 e37b719..0000000 --- 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 1706c40..0000000 --- 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 Base 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 c5161cc..0000000 --- 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 24ea662..0000000 --- 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 10e7762..0000000 --- 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 6c53cef..0000000 --- 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 the asset. - -{% enddocs %} - -{% docs prices_symbol %} - -The symbol of the 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 e8a450a..0000000 --- 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/base_traces_block_no.md b/models/doc_descriptions/traces/base_traces_block_no.md deleted file mode 100644 index 35b8712..0000000 --- a/models/doc_descriptions/traces/base_traces_block_no.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_traces_block_no %} - -The block number of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/base_traces_blocktime.md b/models/doc_descriptions/traces/base_traces_blocktime.md deleted file mode 100644 index b90df0a..0000000 --- a/models/doc_descriptions/traces/base_traces_blocktime.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_traces_blocktime %} - -The block timestamp of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/base_traces_call_data.md b/models/doc_descriptions/traces/base_traces_call_data.md deleted file mode 100644 index 491550f..0000000 --- a/models/doc_descriptions/traces/base_traces_call_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_traces_call_data %} - -The raw JSON data for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/base_traces_from.md b/models/doc_descriptions/traces/base_traces_from.md deleted file mode 100644 index 3f48bd9..0000000 --- a/models/doc_descriptions/traces/base_traces_from.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_traces_gas.md b/models/doc_descriptions/traces/base_traces_gas.md deleted file mode 100644 index 69cda46..0000000 --- a/models/doc_descriptions/traces/base_traces_gas.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_traces_gas %} - -The gas supplied for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/base_traces_gas_used.md b/models/doc_descriptions/traces/base_traces_gas_used.md deleted file mode 100644 index 3c5fc91..0000000 --- a/models/doc_descriptions/traces/base_traces_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_traces_gas_used %} - -The gas used for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/base_traces_identifier.md b/models/doc_descriptions/traces/base_traces_identifier.md deleted file mode 100644 index d2c8497..0000000 --- a/models/doc_descriptions/traces/base_traces_identifier.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_traces_index.md b/models/doc_descriptions/traces/base_traces_index.md deleted file mode 100644 index 4e5a90b..0000000 --- a/models/doc_descriptions/traces/base_traces_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_trace_index %} - -The index of the trace within the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/base_traces_input.md b/models/doc_descriptions/traces/base_traces_input.md deleted file mode 100644 index 51c0797..0000000 --- a/models/doc_descriptions/traces/base_traces_input.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_traces_input %} - -The input data for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/base_traces_output.md b/models/doc_descriptions/traces/base_traces_output.md deleted file mode 100644 index 8d84616..0000000 --- a/models/doc_descriptions/traces/base_traces_output.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_traces_output %} - -The output data for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/base_traces_sub.md b/models/doc_descriptions/traces/base_traces_sub.md deleted file mode 100644 index b1318f7..0000000 --- a/models/doc_descriptions/traces/base_traces_sub.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_traces_table_doc.md b/models/doc_descriptions/traces/base_traces_table_doc.md deleted file mode 100644 index 99300e2..0000000 --- a/models/doc_descriptions/traces/base_traces_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_traces_table_doc %} - -This table contains flattened trace data for internal contract calls on the Base Blockchain. Hex encoded fields can be decoded to integers by using `utils.udf_hex_to_int()`. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/base_traces_to.md b/models/doc_descriptions/traces/base_traces_to.md deleted file mode 100644 index 4567d69..0000000 --- a/models/doc_descriptions/traces/base_traces_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_traces_tx_hash.md b/models/doc_descriptions/traces/base_traces_tx_hash.md deleted file mode 100644 index 649b1ab..0000000 --- a/models/doc_descriptions/traces/base_traces_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_traces_type.md b/models/doc_descriptions/traces/base_traces_type.md deleted file mode 100644 index c439753..0000000 --- a/models/doc_descriptions/traces/base_traces_type.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_traces_value.md b/models/doc_descriptions/traces/base_traces_value.md deleted file mode 100644 index eed806c..0000000 --- a/models/doc_descriptions/traces/base_traces_value.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_traces_value %} - -The amount of ETH transferred in this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/base_cumulative_gas_used.md b/models/doc_descriptions/transactions/base_cumulative_gas_used.md deleted file mode 100644 index c719f99..0000000 --- a/models/doc_descriptions/transactions/base_cumulative_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_tx_block_hash.md b/models/doc_descriptions/transactions/base_tx_block_hash.md deleted file mode 100644 index a8bbea8..0000000 --- a/models/doc_descriptions/transactions/base_tx_block_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_tx_fee.md b/models/doc_descriptions/transactions/base_tx_fee.md deleted file mode 100644 index 88e1fe2..0000000 --- a/models/doc_descriptions/transactions/base_tx_fee.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_tx_fee %} - -Amount paid to validate the transaction in ETH. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/base_tx_gas_limit.md b/models/doc_descriptions/transactions/base_tx_gas_limit.md deleted file mode 100644 index d91e1cb..0000000 --- a/models/doc_descriptions/transactions/base_tx_gas_limit.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_tx_gas_price.md b/models/doc_descriptions/transactions/base_tx_gas_price.md deleted file mode 100644 index ad209b6..0000000 --- a/models/doc_descriptions/transactions/base_tx_gas_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_tx_gas_price %} - -Cost per unit of gas in Gwei. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/base_tx_gas_used.md b/models/doc_descriptions/transactions/base_tx_gas_used.md deleted file mode 100644 index cccfc0e..0000000 --- a/models/doc_descriptions/transactions/base_tx_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_tx_gas_used %} - -Gas used by transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/base_tx_hash.md b/models/doc_descriptions/transactions/base_tx_hash.md deleted file mode 100644 index b573293..0000000 --- a/models/doc_descriptions/transactions/base_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_tx_input_data.md b/models/doc_descriptions/transactions/base_tx_input_data.md deleted file mode 100644 index adfe82b..0000000 --- a/models/doc_descriptions/transactions/base_tx_input_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_tx_json.md b/models/doc_descriptions/transactions/base_tx_json.md deleted file mode 100644 index 6b00605..0000000 --- a/models/doc_descriptions/transactions/base_tx_json.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_tx_nonce.md b/models/doc_descriptions/transactions/base_tx_nonce.md deleted file mode 100644 index 4e3d7a5..0000000 --- a/models/doc_descriptions/transactions/base_tx_nonce.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_tx_origin_sig.md b/models/doc_descriptions/transactions/base_tx_origin_sig.md deleted file mode 100644 index a88c6e0..0000000 --- a/models/doc_descriptions/transactions/base_tx_origin_sig.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_tx_origin_sig %} - -The function signature of the contract call. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/base_tx_position.md b/models/doc_descriptions/transactions/base_tx_position.md deleted file mode 100644 index 1495749..0000000 --- a/models/doc_descriptions/transactions/base_tx_position.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_tx_position %} - -The position of the transaction within the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/base_tx_status.md b/models/doc_descriptions/transactions/base_tx_status.md deleted file mode 100644 index cd28733..0000000 --- a/models/doc_descriptions/transactions/base_tx_status.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_tx_status %} - -Status of the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/base_tx_table_doc.md b/models/doc_descriptions/transactions/base_tx_table_doc.md deleted file mode 100644 index 23a88cb..0000000 --- a/models/doc_descriptions/transactions/base_tx_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_tx_table_doc %} - -This table contains transaction level data for the Base 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/base_value.md b/models/doc_descriptions/transactions/base_value.md deleted file mode 100644 index c798b00..0000000 --- a/models/doc_descriptions/transactions/base_value.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_value %} - -The value transacted in ETH. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/base_eth_amount.md b/models/doc_descriptions/transfers/base_eth_amount.md deleted file mode 100644 index 2e2c55e..0000000 --- a/models/doc_descriptions/transfers/base_eth_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_eth_amount %} - -ETH value transferred. - -{% enddocs %} diff --git a/models/doc_descriptions/transfers/base_eth_amount_usd.md b/models/doc_descriptions/transfers/base_eth_amount_usd.md deleted file mode 100644 index c9e7f8c..0000000 --- a/models/doc_descriptions/transfers/base_eth_amount_usd.md +++ /dev/null @@ -1,6 +0,0 @@ - -{% docs base_eth_amount_usd %} - -ETH value transferred, in USD. - -{% enddocs %} diff --git a/models/doc_descriptions/transfers/base_ez_eth_transfers_table_doc.md b/models/doc_descriptions/transfers/base_ez_eth_transfers_table_doc.md deleted file mode 100644 index 90dceba..0000000 --- a/models/doc_descriptions/transfers/base_ez_eth_transfers_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_ez_transfer_table_doc.md b/models/doc_descriptions/transfers/base_ez_transfer_table_doc.md deleted file mode 100644 index 3f3862f..0000000 --- a/models/doc_descriptions/transfers/base_ez_transfer_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_log_id_transfers.md b/models/doc_descriptions/transfers/base_log_id_transfers.md deleted file mode 100644 index 4c2922c..0000000 --- a/models/doc_descriptions/transfers/base_log_id_transfers.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_origin_from.md b/models/doc_descriptions/transfers/base_origin_from.md deleted file mode 100644 index dad97a6..0000000 --- a/models/doc_descriptions/transfers/base_origin_from.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_eth_origin_from %} - -The from address at the transaction level. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/base_origin_to.md b/models/doc_descriptions/transfers/base_origin_to.md deleted file mode 100644 index 19fedaa..0000000 --- a/models/doc_descriptions/transfers/base_origin_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_eth_origin_to %} - -The to address at the transaction level. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/base_transfer_amount.md b/models/doc_descriptions/transfers/base_transfer_amount.md deleted file mode 100644 index 1ef114f..0000000 --- a/models/doc_descriptions/transfers/base_transfer_amount.md +++ /dev/null @@ -1,11 +0,0 @@ -{% docs base_transfer_amount %} - -The decimal transformed amount for this token. Tokens without a decimal adjustment will be nulled out here. - -{% enddocs %} - -{% docs base_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/base_transfer_amount_usd.md b/models/doc_descriptions/transfers/base_transfer_amount_usd.md deleted file mode 100644 index 6d76cdd..0000000 --- a/models/doc_descriptions/transfers/base_transfer_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_transfer_contract_address.md b/models/doc_descriptions/transfers/base_transfer_contract_address.md deleted file mode 100644 index 5db6b70..0000000 --- a/models/doc_descriptions/transfers/base_transfer_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_transfer_contract_address %} - -Contract address of the token being transferred. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/base_transfer_from_address.md b/models/doc_descriptions/transfers/base_transfer_from_address.md deleted file mode 100644 index 25f5192..0000000 --- a/models/doc_descriptions/transfers/base_transfer_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_transfer_from_address %} - -The sending address of this transfer. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/base_transfer_has_decimal.md b/models/doc_descriptions/transfers/base_transfer_has_decimal.md deleted file mode 100644 index 54574a6..0000000 --- a/models/doc_descriptions/transfers/base_transfer_has_decimal.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_transfer_has_price.md b/models/doc_descriptions/transfers/base_transfer_has_price.md deleted file mode 100644 index 9b8d9e4..0000000 --- a/models/doc_descriptions/transfers/base_transfer_has_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_transfer_raw_amount.md b/models/doc_descriptions/transfers/base_transfer_raw_amount.md deleted file mode 100644 index 1c8b302..0000000 --- a/models/doc_descriptions/transfers/base_transfer_raw_amount.md +++ /dev/null @@ -1,11 +0,0 @@ -{% docs base_transfer_raw_amount %} - -The amount of tokens transferred. This value is not decimal adjusted. - -{% enddocs %} - -{% docs base_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/base_transfer_to_address.md b/models/doc_descriptions/transfers/base_transfer_to_address.md deleted file mode 100644 index b9b954c..0000000 --- a/models/doc_descriptions/transfers/base_transfer_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_transfer_token_price.md b/models/doc_descriptions/transfers/base_transfer_token_price.md deleted file mode 100644 index f988a4d..0000000 --- a/models/doc_descriptions/transfers/base_transfer_token_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/base_transfer_tx_hash.md b/models/doc_descriptions/transfers/base_transfer_tx_hash.md deleted file mode 100644 index 3db0983..0000000 --- a/models/doc_descriptions/transfers/base_transfer_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs base_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/vertex/vertex_column_docs.md b/models/doc_descriptions/vertex/vertex_column_docs.md deleted file mode 100644 index 8923f3a..0000000 --- a/models/doc_descriptions/vertex/vertex_column_docs.md +++ /dev/null @@ -1,543 +0,0 @@ -{% docs vertex_symbol %} - -The specific Vertex product symbol, if it is a futures product it will have a -PERP suffix. - -{% enddocs %} - -{% docs vertex_digest %} - -The identifier for a specific trade, this can be split across two or more base deltas in order to fill the entire amount of the trade. - -{% enddocs %} - -{% docs vertex_trader %} - -The wallet address of the trader, there can be multiple subaccounts associated with a trader. - -{% enddocs %} - -{% docs vertex_subaccount %} - -Independent Vertex account of trader with its own margin, balance, positions, and trades. Any wallet can open an arbitrary number of these. Risk is not carried over from subaccount to subaccount. - -{% enddocs %} - -{% docs vertex_trade_type %} - -They type of trade taken, long/short for perps or buy/sell for spot. - -{% enddocs %} - -{% docs vertex_expiration %} - -Time after which the order should automatically be cancelled, as a timestamp in seconds after the unix epoch, converted to datetime. - -{% enddocs %} - -{% docs vertex_order_type %} - -Decode from raw expiration number to binary then converted back to int from the most significant two bits: -0 ⇒ Default order, where it will attempt to take from the book and then become a resting limit order if there is quantity remaining -1 ⇒ Immediate-or-cancel order, which is the same as a default order except it doesn’t become a resting limit order -2 ⇒ Fill-or-kill order, which is the same as an IOC order except either the entire order has to be filled or none of it. -3 ⇒ Post-only order, where the order is not allowed to take from the book. An error is returned if the order would cross the bid ask spread. - -{% enddocs %} - -{% docs vertex_market_reduce_flag %} - -A reduce-only is an order that will either close or reduce your position. The reduce-only flag can only be set on IOC or FOK order types. Send a reduce-only order by setting the 3rd most significant bit on the expiration field. - -{% enddocs %} - -{% docs vertex_nonce %} - -Number used to differentiate between the same order multiple times, and a user trying to place an order with the same parameters twice. Represented as a string. - -{% enddocs %} - -{% docs vertex_is_taker %} - -Boolean representing if the trader was the taker or maker. - -{% enddocs %} - -{% docs vertex_price_amount_unadj %} - -The price amount that the trade was executed at. - -{% enddocs %} - -{% docs vertex_price_amount %} - -The price amount that the trade was executed at, decimal adjusted. All amounts and prices are adjusted 18 decimals points regardless of underlying asset contract. - -{% enddocs %} - -{% docs vertex_amount_unadj %} - -The total size of the trade in units of the asset being traded. - -{% enddocs %} - -{% docs vertex_amount %} - -The total size of the trade in units of the asset being traded across one digest, decimal adjusted. All amounts and prices are adjusted 18 decimals points regardless of underlying asset contract. - -{% enddocs %} - -{% docs vertex_amount_usd %} - -The size of the trade in USD. Base Delta multiplied by the price amount. - -{% enddocs %} - -{% docs vertex_fee_amount_unadj %} - -The fees on the trade. - -{% enddocs %} - -{% docs vertex_fee_amount %} - -The fees on the trade, decimal adjusted. All amounts and prices are adjusted 18 decimals points regardless of underlying asset contract. - -{% enddocs %} - -{% docs vertex_base_delta_amount_unadj %} - -Represents the net change in the total quantity of orders at a particular price level, the sum of these across the same digest is equal to the amount. This is the first currency listed in the pair and acts as the reference point for the exchange rate, in this case the crypto asset trading against USDC. - -{% enddocs %} - -{% docs vertex_base_delta_amount %} - -Represents the net change in the total quantity of orders at a particular price level, decimal adjusted. All amounts and prices are adjusted 18 decimals points regardless of underlying asset contract. The sum of these across the same digest is equal to the amount. This is the first currency listed in the pair and acts as the reference point for the exchange rate, in this case the crypto asset trading against USDC. - -{% enddocs %} - -{% docs vertex_quote_delta_amount_unadj %} - -A positive value is an increase in spread and a negative value is a decrease in spread. Quote is currency used to express the value of the base currency. It's often the more well-known or stable currency in the pair. In this case, USDC. - -{% enddocs %} - -{% docs vertex_quote_delta_amount %} - -The net change in the best bid and best ask prices in the order book, decimal adjusted. All amounts and prices are adjusted 18 decimals points regardless of underlying asset contract. A positive value is an increase in spread and a negative value is a decrease in spread. Quote is currency used to express the value of the base currency. It's often the more well-known or stable currency in the pair. In this case, USDC. - -{% enddocs %} - -{% docs vertex_mode %} - -The type of liquidation, 0 being a LP position, 1 being a balance - ie a Borrow, and 2 being a perp position. - -Only available in Vertex V1, live until March 8th 2024. - -{% enddocs %} - -{% docs vertex_health_group %} - -The spot / perp product pair of health group i where health_groups[i][0] is the spot product_id and health_groups[i][1] is the perp product_id. Additionally, it is possible for a health group to only have either a spot or perp product, in which case, the product that doesn’t exist is set to 0. - -{% enddocs %} - -{% docs vertex_health_group_symbol %} - -The token symbol represented by the specific health group. For example WBTC and BTC-PERP is BTC. - -{% enddocs %} - -{% docs vertex_amount_quote_unadj %} - -To liquidate a position, there must be a payment (transfer) between the liquidator and the position holder. This done in the quote currency, USDC. Payments are signed as positive, meaning you received the USDC, or negative, meaning you paid. For perpetual liquidations, users should expect to see a (+) USDC payment. They will see a (-) USDC payment for borrowers since they need to pay the user for buying their borrow. - -{% enddocs %} - -{% docs vertex_amount_quote %} - -To liquidate a position, there must be a payment (transfer) between the liquidator and the position holder. This done in the quote currency, USDC. Payments are signed as positive, meaning you received the USDC, or negative, meaning you paid. For perpetual liquidations, users should expect to see a (+) USDC payment. They will see a (-) USDC payment for borrowers since they need to pay the user for buying their borrow. All amounts and prices are adjusted 18 decimals points regardless of underlying asset contract. - -{% enddocs %} - -{% docs vertex_insurance_cover_unadj %} - -USDC from the insurance fund pulled into the insolvent account and used to pay liquidators to take on the underwater positions. - -Only available in Vertex V1, live until March 8th 2024. - -{% enddocs %} - -{% docs vertex_insurance_cover %} - -USDC from the insurance fund pulled into the insolvent account and used to pay liquidators to take on the underwater positions, decimal adjusted. All amounts and prices are adjusted 18 decimals points regardless of underlying asset contract. - -Only available in Vertex V1, live until March 8th 2024. - -{% enddocs %} - -{% docs vertex_book_address %} - -The contract address associated with each product, this is where all fill orders are published to the chain. - -{% enddocs %} - -{% docs vertex_product_type %} - -The type of product, either spot or perpetual futures. - -{% enddocs %} - -{% docs vertex_product_id %} - -The unique id of each product. Evens are perp products and odds are spot products. - -{% enddocs %} - -{% docs vertex_ticker_id %} - -Identifier of a ticker with delimiter to separate base/target. - -{% enddocs %} - -{% docs vertex_name %} - -The name of the product - -{% enddocs %} - -{% docs vertex_version %} - -The version of Vertex with version 2 on or after March 8th 2024. - -{% enddocs %} - -{% docs vertex_token_address %} - -The underlying asset token address deposited or withdrawn from the clearinghouse contract. - -{% enddocs %} - -{% docs vertex_amount_usd_ch %} - -The size of deposit or withdraw in USD. - -{% enddocs %} - -{% docs vertex_product_id_liq %} - -The product to liquidate as well as the liquidation mode: -Perp Liquidation: Any valid perp product_id with is_encode_spread set to false. -Spot Liquidation: Any valid spot product_id with is_encode_spread set to false. -Spread Liquidation: If there are perp and spot positions in different directions, liquidate both at the same time. is_encode_spread must be set to true. - -If it is a spread liquidation this column will show the perp product_id, for both ids refer to the spread_product_ids array. - -Only available in V2 Vertex liquidations, which went live March 8th 2024. - -{% enddocs %} - -{% docs vertex_is_encode_spread %} - -Indicates whether product_id encodes both a spot and perp product_id for spread_liquidation. - -Only available in V2 Vertex liquidations, which went live March 8th 2024. - -{% enddocs %} - -{% docs vertex_decoded_spread_product_ids %} - -Array of product_ids that have been decoded from binary. Only available when is_encode_spread is true and the liquidation occurs on V2 Vertex, which went live March 8th 2024. - -{% enddocs %} - -{% docs vertex_first_trade_timestamp %} - -The block timestamp of this subaccounts first trade. - -{% enddocs %} - -{% docs vertex_last_trade_timestamp %} - -The block timestamp of this subaccounts most recent trade. - -{% enddocs %} - -{% docs vertex_account_age %} - -The age of the account in days. - -{% enddocs %} - -{% docs vertex_trade_count %} - -The total amount of trades executed by the account - -{% enddocs %} - -{% docs vertex_trade_count_rank %} - -The rank against all accounts based on trade count volume. - -{% enddocs %} - -{% docs vertex_trade_count_24h %} - -The total amount of trades made in the last 24 hours. - -{% enddocs %} - -{% docs vertex_trade_count_rank_24h %} - -The rank against all accounts based on trade count volume in the last 24 hours. - -{% enddocs %} - -{% docs vertex_perp_trade_count %} - -The total amount of perpetual trades executed by the account - -{% enddocs %} - -{% docs vertex_spot_trade_count %} - -The total amount of spot trades executed by the account - -{% enddocs %} - -{% docs vertex_long_count %} - -The total amount of buys/longs on the account. - -{% enddocs %} - -{% docs vertex_short_count %} - -The total amount of sell/shorts on the account. - -{% enddocs %} - -{% docs vertex_total_usd_volume %} - -The total USD denominated volume of the account. - -{% enddocs %} - -{% docs vertex_total_usd_volume_24h %} - -The total USD denominated volume of the account in the last 24 hours. - -{% enddocs %} - -{% docs vertex_total_usd_volume_rank_24h %} - -The rank against all accounts based on the total USD denominated volume of the account in the last 24 hours. - -{% enddocs %} - -{% docs vertex_total_usd_volume_rank %} - -The rank against all accounts based on total usd volume on the account. - -{% enddocs %} - -{% docs vertex_avg_usd_trade_size %} - -The average trade size in USD. - -{% enddocs %} - -{% docs vertex_total_fee_amount %} - -The total amount of trading fees paid by the account. - -{% enddocs %} - -{% docs vertex_total_base_delta_amount %} - -The total base delta amount of the account. - -{% enddocs %} - -{% docs vertex_total_quote_delta_amount %} - -The total quote delta amount of the account. - -{% enddocs %} - -{% docs vertex_total_liquidation_amount %} - -The total liquidation amount of the account. - -{% enddocs %} - -{% docs vertex_total_liquidation_count %} - -The total count of liquidation accounts on the account. - -{% enddocs %} - -{% docs vertex_orderbook_side %} - -Designates the bid or ask side of the orderbook price. - -{% enddocs %} - -{% docs vertex_orderbook_volume %} - -The quantity for each bid/ask order at the given price level. - -{% enddocs %} - -{% docs vertex_orderbook_price %} - -The price level for each bid/ask order. - -{% enddocs %} - -{% docs vertex_orderbook_round_price_0_01 %} - -The price level for each bid/ask order, rounded to nearest cent. - -{% enddocs %} - -{% docs vertex_orderbook_round_price_0_1 %} - -The price level for each bid/ask order, rounded to nearest ten cents. - -{% enddocs %} - -{% docs vertex_orderbook_round_price_1 %} - -The price level for each bid/ask order, rounded to nearest dollar. - -{% enddocs %} - -{% docs vertex_orderbook_round_price_10 %} - -The price level for each bid/ask order, rounded to nearest 10 dollars. - -{% enddocs %} - -{% docs vertex_orderbook_round_price_100 %} - -The price level for each bid/ask order, rounded to nearest 100 dollars. - -{% enddocs %} - -{% docs vertex_hour %} - -The hour in which the stats table data was pull and inserted into the table. - -{% enddocs %} - -{% docs vertex_distinct_sequencer_batches %} - -The amount of sequencer transactions that included this product in the last hour. - -{% enddocs %} - -{% docs vertex_trader_count %} - -The distinct traders in the last hour, based on a distinct count of wallet addresses. - -{% enddocs %} - -{% docs vertex_subaccount_count %} - -The distinct traders in the last hour, based on a distinct count of subaccount. - -{% enddocs %} - -{% docs vertex_total_trade_count %} - -The total number of trades on Vertex in the last hour. - -{% enddocs %} - -{% docs vertex_contract_price %} - -The price of the contract when the data was inserted into the table. - -{% enddocs %} - -{% docs vertex_base_volume_24h %} - -The 24 hour trading volume for the pair (unit in base). - -{% enddocs %} - -{% docs vertex_quote_volume_24h %} - -The 24 hour trading volume for the pair (unit in quote). - -{% enddocs %} - -{% docs vertex_funding_rate %} - -Current 24hr funding rate. Can compute hourly funding rate dividing by 24. - -A funding rate is a mechanism used to ensure that the price of a perp contract tracks the underlying asset's price as closely as possible. - -Positive funding rates reflect the perpetual trading at a premium to the underlying asset’s price. - -{% enddocs %} - -{% docs vertex_index_price %} - -Last calculated index price for underlying of contract. -{% enddocs %} - -{% docs vertex_last_price %} - -Last transacted price of base currency based on given quote currency. -{% enddocs %} - - -{% docs vertex_mark_price %} - -The calculated fair value of the contract, independent of the last traded price on the specific exchange. -{% enddocs %} - -{% docs vertex_next_funding_rate %} - -Timestamp of the next funding rate change, specific to hour the data was pulled from the API. -{% enddocs %} - -{% docs vertex_open_interest %} - -The open interest of the contract for the hour that the data was pulled. Open interest (OI) refers to the total number of outstanding derivative contracts (e.g., futures or options) that are currently held by market participants and have not yet been settled -{% enddocs %} - -{% docs vertex_open_interest_usd %} - -The open interest of the contract for the hour that the data was pulled, denominated in USD. Open interest (OI) refers to the total number of outstanding derivative contracts (e.g., futures or options) that are currently held by market participants and have not yet been settled -{% enddocs %} - -{% docs vertex_quote_currency %} - -Symbol of the target asset. -{% enddocs %} - -{% docs vertex_stake_action %} - -The staking action with the VRTX staking address -{% enddocs %} - -{% docs vertex_deposit_apr %} - -The recorded deposit APR for the money market product in that hour. - -{% enddocs %} - -{% docs vertex_borrow_apr %} - -The recorded borrow APR for the money market product in that hour. - -{% enddocs %} - -{% docs vertex_tvl %} - -The sum total value locked for the money market product in that hour. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/vertex/vertex_table_docs.md b/models/doc_descriptions/vertex/vertex_table_docs.md deleted file mode 100644 index 996716f..0000000 --- a/models/doc_descriptions/vertex/vertex_table_docs.md +++ /dev/null @@ -1,68 +0,0 @@ -{% docs vertex_dim_products %} - -All available Vertex products, these are automatically added as they are released on chain. - - -{% enddocs %} - -{% docs vertex_ez_liquidations %} - -All Vertex liquidations. Once an account’s maintenance margin reaches $0, the account is eligible for liquidation. Liquidation events happen one by one, with the riskiest positions being liquidated first. Liquidations are based on the oracle price. - - -{% enddocs %} - -{% docs vertex_ez_perp_trades %} - -Vertex perpetuals are derivative contracts on an underlying spot asset. On Vertex, all perpetual contracts trade against USDC. - -{% enddocs %} - -{% docs vertex_ez_spot_trades %} - -Vertex’s spot markets allow you to buy or sell listed crypto assets paired with USD-denominated stablecoins. - -{% enddocs %} - -{% docs vertex_ez_clearing_house_events %} - -Vertex’s on-chain clearinghouse operates as the hub combining perpetual and spot markets, collateral, and risk calculations into a single integrated system. The events in this table track when a wallet either deposits or withdraws from the clearinghouse contract. - -{% enddocs %} - -{% docs vertex_ez_account_stats %} - -Subaccount level table showing aggregated total activity across the Vertex exchange. - -{% enddocs %} - -{% docs vertex_ez_market_stats %} - -Orderbook level market stats based on a combination of on-chain data and data from Vertex's ticker V2 API which includes 24-hour pricing and volume information on each market pair available on Vertex. - -{% enddocs %} - -{% docs vertex_ez_market_depth %} - -Liquidity data taken from Vertex's Orderbook API, showing amount of liquidity at each price level. - -{% enddocs %} - -{% docs vertex_ez_staking %} - -All staking actions taken with the VRTX staking contract. - -{% enddocs %} - -{% docs vertex_ez_edge_trades %} - -All edge trades paired with the associated trader/subaccount. - -{% enddocs %} - -{% docs vertex_money_markets %} - -Vertex integrates a decentralized money market directly into its DEX, enabling borrowing and lending of crypto assets using overcollateralized lending rules. Interest rates are dynamically adjusted based on supply and demand, incentivizing liquidity provision and balancing borrowing costs. The money market operates on-chain (e.g., on Arbitrum) and is managed through Vertex’s risk engine and clearinghouse, offering users automated borrowing via portfolio margin and passive yield opportunities on idle assets. This table tracks the money market products available on Vertex on an hourly basis. - - -{% 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 577a226..0000000 --- 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 7f9db96..0000000 --- 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 9c35ce7..0000000 --- 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 117ded5..0000000 --- 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 ff95a44..0000000 --- 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 feab82a..0000000 --- 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 00bc10d..0000000 --- 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 701076e..0000000 --- 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 Basescan, 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 Basescan. If we cannot find an ABI on Basescan, 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 Basescan 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 `Basescan`, `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 8c65ce7..0000000 --- a/models/gold/core/core__dim_contracts.sql +++ /dev/null @@ -1,33 +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 - ) diff --git a/models/gold/core/core__dim_contracts.yml b/models/gold/core/core__dim_contracts.yml deleted file mode 100644 index dad18fc..0000000 --- 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 Base 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_labels.sql b/models/gold/core/core__dim_labels.sql deleted file mode 100644 index 21cefa2..0000000 --- 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 7d83c48..0000000 --- a/models/gold/core/core__dim_labels.yml +++ /dev/null @@ -1,59 +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("base_label_blockchain") }}' - tests: - - not_null - - name: CREATOR - description: '{{ doc("base_label_creator") }}' - tests: - - not_null - - name: ADDRESS - description: '{{ doc("base_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("base_labels_table") }}' - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - name: LABEL_TYPE - description: '{{ doc("base_label_type") }}' - tests: - - not_null - - name: LABEL_SUBTYPE - description: '{{ doc("base_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("base_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 af403eb..0000000 --- a/models/gold/core/core__ez_decoded_event_logs.sql +++ /dev/null @@ -1,68 +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) - -{% if is_incremental() %} -WHERE - l.modified_timestamp > ( - SELECT - COALESCE(MAX(modified_timestamp), '2000-01-01' :: TIMESTAMP) - FROM - {{ this }}) - {% endif %} 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 5fc9fda..0000000 --- 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("base_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("base_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("base_tx_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_origin_to") }}' - - name: TOPICS - description: '{{ doc("base_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("base_logs_data") }}' - - name: EVENT_REMOVED - description: '{{ doc("base_event_removed") }}' - - name: TX_STATUS - description: '{{ doc("evm_column_deprecation_notice") }}' - - name: TX_SUCCEEDED - description: '{{ doc("base_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") }}' 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 165eaab..0000000 --- a/models/gold/core/core__ez_native_transfers.sql +++ /dev/null @@ -1,27 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - tx_hash, - block_number, - block_timestamp, - tx_position, - trace_index, - origin_from_address, - origin_to_address, - origin_function_signature, - from_address, - to_address, - amount, - amount_precise_raw, - amount_precise, - amount_usd, - native_transfers_id AS ez_native_transfers_id, - inserted_timestamp, - modified_timestamp, - identifier -- deprecate -FROM - {{ ref('silver__native_transfers') }} diff --git a/models/gold/core/core__ez_native_transfers.yml b/models/gold/core/core__ez_native_transfers.yml deleted file mode 100644 index 7fbc593..0000000 --- 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("base_transfer_tx_hash") }}' - - name: BLOCK_NUMBER - description: '{{ doc("base_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' - - name: TX_POSITION - description: '{{ doc("base_tx_position") }}' - - name: TRACE_INDEX - description: '{{ doc("base_trace_index") }}' - - name: IDENTIFIER - description: '{{ doc("evm_column_deprecation_notice_identifier") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_origin_to") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("base_origin_sig") }}' - - name: FROM_ADDRESS - description: '{{ doc("base_transfer_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("base_transfer_to_address") }}' - - name: AMOUNT - description: '{{ doc("base_eth_amount") }}' - - name: AMOUNT_PRECISE_RAW - description: '{{ doc("precise_amount_unadjusted") }}' - - name: AMOUNT_PRECISE - description: '{{ doc("precise_amount_adjusted") }}' - - name: AMOUNT_USD - description: '{{ doc("base_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") }}' 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 5116bf5..0000000 --- a/models/gold/core/core__ez_token_transfers.sql +++ /dev/null @@ -1,49 +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 642a8e9..0000000 --- a/models/gold/core/core__ez_token_transfers.yml +++ /dev/null @@ -1,56 +0,0 @@ -version: 2 -models: - - name: core__ez_token_transfers - description: '{{ doc("evm_ez_token_transfers_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("base_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("base_transfer_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("base_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_eth_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_eth_origin_to") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("base_transfer_contract_address") }}' - - name: FROM_ADDRESS - description: '{{ doc("base_transfer_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("base_transfer_to_address") }}' - - name: RAW_AMOUNT_PRECISE - description: '{{ doc("base_transfer_raw_amount_precise") }}' - - name: RAW_AMOUNT - description: '{{ doc("base_transfer_raw_amount") }}' - - name: AMOUNT_PRECISE - description: '{{ doc("base_transfer_amount_precise") }}' - - name: AMOUNT - description: '{{ doc("base_transfer_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("base_transfer_amount_usd") }}' - - name: DECIMALS - description: '{{ doc("base_decimals") }}' - - name: SYMBOL - description: '{{ doc("base_symbol") }}' - - name: TOKEN_PRICE - description: '{{ doc("evm_column_deprecation_notice_token_price") }}' - - name: HAS_DECIMAL - description: '{{ doc("evm_column_deprecation_notice_has_decimal") }}' - - name: HAS_PRICE - description: '{{ doc("evm_column_deprecation_notice_has_price") }}' - - 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") }}' diff --git a/models/gold/core/core__fact_blocks.sql b/models/gold/core/core__fact_blocks.sql deleted file mode 100644 index 18970ca..0000000 --- a/models/gold/core/core__fact_blocks.sql +++ /dev/null @@ -1,110 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - A.block_number, - HASH AS block_hash, - --new column - block_timestamp, - 'mainnet' AS network, - tx_count, - SIZE, - miner, - --new - extra_data, - parent_hash, - gas_used, - gas_limit, - base_fee_per_gas, - -- new - 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 - 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( - d.inserted_timestamp, - '2000-01-01' - ) - ) AS inserted_timestamp, - GREATEST( - COALESCE( - A.modified_timestamp, - '2000-01-01' - ), - COALESCE( - d.modified_timestamp, - '2000-01-01' - ) - ) AS modified_timestamp, - 'base' 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 -FROM - {{ ref('silver__blocks') }} A - LEFT JOIN {{ ref('silver__tx_count') }} - d USING (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 4d004db..0000000 --- a/models/gold/core/core__fact_blocks.yml +++ /dev/null @@ -1,62 +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: MINER - description: '{{ doc("evm_miner") }}' - - name: NONCE - description: '{{ doc("evm_blocks_nonce") }}' - - 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: BASE_FEE_PER_GAS - description: '{{ doc("evm_base_fee_per_gas") }}' - - 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: UNCLE_BLOCKS - description: '{{ doc("evm_uncle_blocks") }}' - - name: STATE_ROOT - description: '{{ doc("evm_state_root") }}' - - name: TRANSACTIONS_ROOT - description: '{{ doc("evm_transactions_root") }}' - - name: LOGS_BLOOM - description: '{{ doc("evm_logs_bloom") }}' - - name: BLOCK_HEADER_JSON - description: '{{ doc("evm_column_deprecation_notice_block_header_json") }}' - - name: FACT_BLOCKS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' - - name: WITHDRAWALS_ROOT - description: A hash of the withdrawals that occurred in this block. 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 aab1f0c..0000000 --- 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 e25a5d9..0000000 --- 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("base_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("base_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") }}' 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 d7d6e95..0000000 --- a/models/gold/core/core__fact_event_logs.sql +++ /dev/null @@ -1,51 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -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, - -- 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 45fc35b..0000000 --- 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("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' 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 8908c54..0000000 --- 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 e48abda..0000000 --- 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("base_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("base_transfer_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("base_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_origin_to") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("base_transfer_contract_address") }}' - - name: FROM_ADDRESS - description: '{{ doc("base_transfer_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("base_transfer_to_address") }}' - - name: RAW_AMOUNT - description: '{{ doc("base_transfer_raw_amount") }}' - - name: RAW_AMOUNT_PRECISE - description: '{{ doc("base_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") }}' diff --git a/models/gold/core/core__fact_traces.sql b/models/gold/core/core__fact_traces.sql deleted file mode 100644 index 3453549..0000000 --- a/models/gold/core/core__fact_traces.sql +++ /dev/null @@ -1,530 +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 - ) + 1000000 - FROM - {{ this }} -) -{% else %} - AND block_number <= 3000000 -{% 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 - ) + 1000000 - FROM - {{ this }} - ) - {% else %} - AND block_number <= 3000000 - {% endif %} -), -sub_traces AS ( - SELECT - block_number, - tx_position, - parent_trace_address, - COUNT(*) AS sub_traces - FROM - silver_traces - GROUP BY - block_number, - tx_position, - parent_trace_address -), -trace_index_array AS ( - SELECT - block_number, - tx_position, - trace_address, - ARRAY_AGG(flat_value) AS number_array - FROM - ( - SELECT - block_number, - tx_position, - trace_address, - IFF( - VALUE :: STRING = 'ORIGIN', - -1, - VALUE :: INT - ) AS flat_value - FROM - silver_traces, - LATERAL FLATTEN ( - input => trace_address_array - ) - ) - GROUP BY - block_number, - tx_position, - trace_address -), -trace_index_sub_traces AS ( - SELECT - b.block_number, - b.tx_position, - b.trace_address, - IFNULL( - sub_traces, - 0 - ) AS sub_traces, - number_array, - ROW_NUMBER() over ( - PARTITION BY b.block_number, - b.tx_position - ORDER BY - number_array ASC - ) - 1 AS trace_index, - b.trace_json, - b.traces_id, - b.source - FROM - silver_traces b - LEFT JOIN sub_traces s - ON b.block_number = s.block_number - AND b.tx_position = s.tx_position - AND b.trace_address = s.parent_trace_address - JOIN trace_index_array n - ON b.block_number = n.block_number - AND b.tx_position = n.tx_position - AND b.trace_address = n.trace_address -), -errored_traces AS ( - SELECT - block_number, - tx_position, - trace_address, - trace_json - FROM - trace_index_sub_traces - WHERE - trace_json :error :: STRING IS NOT NULL -), -error_logic AS ( - SELECT - b0.block_number, - b0.tx_position, - b0.trace_address, - b0.trace_json :error :: STRING AS error, - b1.trace_json :error :: STRING AS any_error, - b2.trace_json :error :: STRING AS origin_error - FROM - trace_index_sub_traces b0 - LEFT JOIN errored_traces b1 - ON b0.block_number = b1.block_number - AND b0.tx_position = b1.tx_position - AND b0.trace_address RLIKE CONCAT( - '^', - b1.trace_address, - '(_[0-9]+)*$' - ) - LEFT JOIN errored_traces b2 - ON b0.block_number = b2.block_number - AND b0.tx_position = b2.tx_position - AND b2.trace_address = 'ORIGIN' -), -aggregated_errors AS ( - SELECT - block_number, - tx_position, - trace_address, - error, - IFF(MAX(any_error) IS NULL - AND error IS NULL - AND origin_error IS NULL, TRUE, FALSE) AS trace_succeeded - FROM - error_logic - GROUP BY - block_number, - tx_position, - trace_address, - error, - origin_error), - json_traces AS ( - SELECT - block_number, - tx_position, - trace_address, - sub_traces, - number_array, - trace_index, - trace_json AS DATA, - trace_succeeded, - trace_json :error :: STRING AS error_reason, - trace_json :revertReason :: STRING AS revert_reason, - trace_json :from :: STRING AS from_address, - trace_json :to :: STRING AS to_address, - IFNULL( - trace_json :value :: STRING, - '0x0' - ) AS value_hex, - IFNULL( - utils.udf_hex_to_int( - trace_json :value :: STRING - ), - '0' - ) AS value_precise_raw, - utils.udf_decimal_adjust( - value_precise_raw, - 18 - ) AS value_precise, - value_precise :: FLOAT AS VALUE, - utils.udf_hex_to_int( - trace_json :gas :: STRING - ) :: INT AS gas, - utils.udf_hex_to_int( - trace_json :gasUsed :: STRING - ) :: INT AS gas_used, - trace_json :input :: STRING AS input, - trace_json :output :: STRING AS output, - trace_json :type :: STRING AS TYPE, - concat_ws( - '_', - TYPE, - trace_address - ) AS identifier, - IFF( - trace_succeeded, - 'SUCCESS', - 'FAIL' - ) AS trace_status, - traces_id - FROM - trace_index_sub_traces - JOIN aggregated_errors USING ( - block_number, - tx_position, - trace_address - ) - ), - incremental_traces AS ( - SELECT - f.block_number, - t.tx_hash, - t.block_timestamp, - t.origin_function_signature, - t.from_address AS origin_from_address, - t.to_address AS origin_to_address, - t.tx_status, - f.tx_position, - f.trace_index, - f.from_address AS from_address, - f.to_address AS to_address, - f.value_hex, - f.value_precise_raw, - f.value_precise, - f.value, - f.gas, - f.gas_used, - f.input, - f.output, - f.type, - f.identifier, - f.sub_traces, - f.error_reason, - f.revert_reason, - f.trace_status, - f.data, - f.traces_id, - f.trace_succeeded, - f.trace_address, - IFF( - t.tx_status = 'SUCCESS', - TRUE, - FALSE - ) AS tx_succeeded - FROM - json_traces f - LEFT OUTER JOIN {{ ref('silver__transactions') }} - t - ON f.tx_position = t.position - AND f.block_number = t.block_number - -{% if is_incremental() and not full_reload_mode %} -AND t.modified_timestamp >= ( - SELECT - DATEADD('hour', -24, MAX(modified_timestamp)) - FROM - {{ this }}) - {% endif %} -) - -{% if is_incremental() %}, -overflow_blocks AS ( - SELECT - DISTINCT block_number - FROM - silver_traces - WHERE - source = 'overflow' -), -heal_missing_data AS ( - SELECT - t.block_number, - txs.tx_hash, - txs.block_timestamp, - txs.origin_function_signature, - txs.from_address AS origin_from_address, - txs.to_address AS origin_to_address, - txs.tx_status, - t.tx_position, - t.trace_index, - t.from_address, - t.to_address, - t.value_hex, - t.value_precise_raw, - t.value_precise, - t.value, - t.gas, - t.gas_used, - t.input, - t.output, - t.type, - t.identifier, - t.sub_traces, - t.error_reason, - t.revert_reason, - t.trace_status, - t.data, - t.fact_traces_id AS traces_id, - t.trace_succeeded, - t.trace_address, - IFF( - txs.tx_status = 'SUCCESS', - TRUE, - FALSE - ) AS tx_succeeded - FROM - {{ this }} - t - JOIN {{ ref('silver__transactions') }} - txs - ON t.tx_position = txs.position - AND t.block_number = txs.block_number - WHERE - t.tx_hash IS NULL - OR t.block_timestamp IS NULL - OR t.tx_status IS NULL -) -{% endif %}, -all_traces AS ( - SELECT - block_number, - tx_hash, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - tx_status, - tx_position, - trace_index, - from_address, - to_address, - value_hex, - value_precise_raw, - value_precise, - VALUE, - gas, - gas_used, - input, - output, - TYPE, - identifier, - sub_traces, - error_reason, - revert_reason, - trace_status, - DATA, - trace_succeeded, - trace_address, - tx_succeeded - FROM - incremental_traces - -{% if is_incremental() %} -UNION ALL -SELECT - block_number, - tx_hash, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - tx_status, - tx_position, - trace_index, - from_address, - to_address, - value_hex, - value_precise_raw, - value_precise, - VALUE, - gas, - gas_used, - input, - output, - TYPE, - identifier, - sub_traces, - error_reason, - revert_reason, - trace_status, - DATA, - trace_succeeded, - trace_address, - tx_succeeded -FROM - heal_missing_data -UNION ALL -SELECT - block_number, - tx_hash, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - tx_status, - tx_position, - trace_index, - from_address, - to_address, - value_hex, - value_precise_raw, - value_precise, - VALUE, - gas, - gas_used, - input, - output, - TYPE, - identifier, - sub_traces, - error_reason, - revert_reason, - trace_status, - DATA, - trace_succeeded, - trace_address, - tx_succeeded -FROM - {{ this }} - JOIN overflow_blocks USING (block_number) -{% endif %} -) -SELECT - block_number, - block_timestamp, - tx_hash, - tx_position, - trace_index, - from_address, - to_address, - input, - output, - TYPE, - trace_address, - sub_traces, - VALUE, - value_precise_raw, - value_precise, - value_hex, - gas, - gas_used, - origin_from_address, - origin_to_address, - origin_function_signature, - trace_succeeded, - error_reason, - revert_reason, - tx_succeeded, - identifier, - -- deprecate - DATA, - --deprecate - tx_status, - -- deprecate - trace_status, - -- deprecate - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'trace_index'] - ) }} AS fact_traces_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp -FROM - all_traces qualify(ROW_NUMBER() over(PARTITION BY block_number, tx_position, trace_index -ORDER BY - modified_timestamp DESC, block_timestamp DESC nulls last)) = 1 diff --git a/models/gold/core/core__fact_traces.yml b/models/gold/core/core__fact_traces.yml deleted file mode 100644 index 0e05c85..0000000 --- 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 f36799d..0000000 --- a/models/gold/core/core__fact_transactions.sql +++ /dev/null @@ -1,73 +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, - tx_type, - -- new - nonce, - POSITION AS tx_position, - -- new - 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')) AS inserted_timestamp, - GREATEST(COALESCE(A.modified_timestamp, '2000-01-01'), COALESCE(b.modified_timestamp, '2000-01-01')) AS modified_timestamp, - block_hash, - --deprecate - tx_status AS status, - --deprecate - POSITION, - --deprecate - OBJECT_CONSTRUCT( - 'l1_state_batch_index', - state_batch_index, - 'l1_state_batch_root', - state_batch_root, - 'l1_state_root_tx_hash', - state_tx_hash - ) AS l1_submission_details, - --deprecate - deposit_nonce, - --deprecate - deposit_receipt_version --deprecate -FROM - {{ ref('silver__transactions') }} A - LEFT JOIN {{ ref('silver__state_hashes') }} - b 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 f9f25b9..0000000 --- a/models/gold/core/core__fact_transactions.yml +++ /dev/null @@ -1,86 +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("precise_amount_unadjusted") }}' - - name: VALUE_PRECISE - description: '{{ doc("precise_amount_adjusted") }}' - - name: TX_FEE - description: '{{ doc("evm_tx_fee") }}' - - name: TX_FEE_PRECISE - description: '{{ doc("tx_fee_precise") }}' - - name: GAS_PRICE - description: '{{ doc("evm_tx_gas_price") }}' - - name: GAS_USED - description: '{{ doc("evm_tx_gas_used") }}' - - name: GAS_LIMIT - description: '{{ doc("evm_tx_gas_limit") }}' - - name: CUMULATIVE_GAS_USED - description: '{{ doc("evm_cumulative_gas_used") }}' - - name: EFFECTIVE_GAS_PRICE - description: '{{ doc("evm_effective_gas_price") }}' - - 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: 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_PRECISE - description: '{{ doc("evm_tx_fee_precise") }}' - - name: L1_FEE - description: The L1 portion of fees paid. - - name: L1_SUBMISSION_DETAILS - description: '{{ doc("evm_column_deprecation_notice_l1_submission_details") }}' - - name: DEPOSIT_NONCE - description: '{{ doc("evm_column_deprecation_notice_deposit_nonce") }}' - - name: DEPOSIT_RECEIPT_VERSION - description: '{{ doc("evm_column_deprecation_notice_deposit_receipt_version") }}' - - 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: TX_TYPE - description: The type of the transaction, 2 for EIP-1559 transactions and 0 for legacy transactions. - - name: r - description: The r value of the transaction signature. - - name: s - description: The s value of the transaction signature. - - name: v - description: The v value of the transaction signature. - - name: FACT_TRANSACTIONS_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/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 ced1fba..0000000 --- a/models/gold/core/tests/traces/test_gold__fact_traces_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = "view", - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('core__fact_traces') }} diff --git a/models/gold/core/tests/traces/test_gold__fact_traces_full.yml b/models/gold/core/tests/traces/test_gold__fact_traces_full.yml deleted file mode 100644 index 6677117..0000000 --- a/models/gold/core/tests/traces/test_gold__fact_traces_full.yml +++ /dev/null @@ -1,120 +0,0 @@ -version: 2 -models: - - name: test_gold__fact_traces_full - description: "This is a view used to test all of the gold fact traces model." - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - TRACE_INDEX - - fsc_utils.sequence_gaps: - partition_by: - - TX_HASH - column_name: TRACE_INDEX - where: BLOCK_TIMESTAMP < CURRENT_DATE - 1 AND TX_HASH IS NOT NULL - - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TX_POSITION - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRACE_INDEX - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: FROM_ADDRESS - tests: - - not_null: - where: TYPE <> 'SELFDESTRUCT' - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - where: TO_ADDRESS IS NOT NULL - - name: INPUT - tests: - - not_null - - name: TYPE - tests: - - not_null - - name: TRACE_ADDRESS - tests: - - not_null - - name: SUB_TRACES - tests: - - not_null - - name: VALUE - tests: - - not_null - - name: VALUE_PRECISE_RAW - tests: - - not_null - - name: VALUE_PRECISE - tests: - - not_null - - name: VALUE_HEX - tests: - - not_null - - name: GAS - tests: - - not_null - - name: GAS_USED - tests: - - not_null - - name: ORIGIN_FROM_ADDRESS - tests: - - not_null - - name: ORIGIN_FUNCTION_SIGNATURE - tests: - - not_null - - name: TRACE_SUCCEEDED - tests: - - not_null - - name: TX_SUCCEEDED - tests: - - not_null - - name: FACT_TRACES_ID - tests: - - not_null - - name: INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 - - name: MODIFIED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 2 diff --git a/models/gold/core/tests/traces/test_gold__fact_traces_recent.sql b/models/gold/core/tests/traces/test_gold__fact_traces_recent.sql deleted file mode 100644 index 4bed00f..0000000 --- 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 4206f50..0000000 --- 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 a98b9f0..0687c1b 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 99262fe..76e1d7b 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 efa58bb..fd34502 100644 --- a/models/gold/defi/defi__ez_bridge_activity.sql +++ b/models/gold/defi/defi__ez_bridge_activity.sql @@ -3,7 +3,8 @@ persist_docs ={ "relation": true, "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'ACROSS, AXELAR, CELER, CBRIDGE, DLN, DEBRIDGE, HOP, MESON, STARGATE, SYMBIOSIS, SYNAPSE, WORMHOLE, CCTP, CCIP', - 'PURPOSE': 'BRIDGE' } } } + 'PURPOSE': 'BRIDGE' } } }, + tags = ['gold','defi','bridge','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/defi__ez_bridge_activity.yml b/models/gold/defi/defi__ez_bridge_activity.yml index a6a7cf5..04c112a 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("base_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("base_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS description: '{{ doc("evm_bridge_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_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 854566e..dc3fd86 100644 --- a/models/gold/defi/defi__ez_dex_swaps.sql +++ b/models/gold/defi/defi__ez_dex_swaps.sql @@ -4,7 +4,8 @@ "columns": true }, meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'SUSHI, UNISWAP, BALANCER, SWAPBASED, BASESWAP, MAVERICK, DACKIE, WOOFI, AERODROME, CURVE, VOODOO, PANCAKESWAP, RAMSES, DEXALOT', 'PURPOSE': 'DEX, SWAPS', - } } } + } } }, + tags = ['gold','defi','dex','curated','ez'] ) }} SELECT @@ -66,7 +67,6 @@ SELECT COALESCE( modified_timestamp, '2000-01-01' - ) AS modified_timestamp, - _log_id --deprecate + ) AS modified_timestamp FROM {{ ref('silver_dex__complete_dex_swaps') }} diff --git a/models/gold/defi/defi__ez_dex_swaps.yml b/models/gold/defi/defi__ez_dex_swaps.yml index a2ae518..68491b3 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("base_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("base_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("base_event_index") }}' - - name: _LOG_ID - description: '{{ doc("evm_column_deprecation_notice_log_id") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("base_tx_origin_sig") }}' + description: '{{ doc("evm_tx_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_origin_to") }}' + description: '{{ doc("evm_origin_to") }}' - name: AMOUNT_IN_UNADJ - description: '{{ doc("eth_dex_swaps_amount_in_unadj") }}' + description: '{{ doc("evm_dex_swaps_amount_in_unadj") }}' - name: AMOUNT_OUT_UNADJ - description: '{{ doc("eth_dex_swaps_amount_out_unadj") }}' + description: '{{ doc("evm_dex_swaps_amount_out_unadj") }}' - name: EZ_DEX_SWAPS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/defi/lending/defi__ez_lending_borrows.sql b/models/gold/defi/lending/defi__ez_lending_borrows.sql index db3f6f9..86d6178 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 2c79bb1..5d82933 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("base_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("base_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_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("base_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 268cf84..b2fb185 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 d1c3cfc..a691e36 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("base_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("base_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_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("base_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 b753b39..eae3736 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 66d51f2..bec1030 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("base_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("base_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_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("base_symbol") }}' + description: '{{ doc("evm_complete_lending_token_symbol") }}' - name: FLASHLOAN_AMOUNT_UNADJ - description: '{{ doc("complete_lending_flashloan_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_flashloan_amount_unadj") }}' - name: FLASHLOAN_AMOUNT - description: '{{ doc("complete_lending_flashloan_amount") }}' + description: '{{ doc("evm_complete_lending_flashloan_amount") }}' - name: FLASHLOAN_AMOUNT_USD - description: '{{ doc("complete_lending_flashloan_amount_usd") }}' + description: '{{ doc("evm_complete_lending_flashloan_amount_usd") }}' - name: PREMIUM_AMOUNT_UNADJ - description: '{{ doc("complete_lending_premium_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_premium_amount_unadj") }}' - name: PREMIUM_AMOUNT - description: '{{ doc("complete_lending_premium_amount") }}' + description: '{{ doc("evm_complete_lending_premium_amount") }}' - name: PREMIUM_AMOUNT_USD - description: '{{ doc("complete_lending_premium_amount_usd") }}' + description: '{{ doc("evm_complete_lending_premium_amount_usd") }}' - name: EZ_LENDING_FLASHLOANS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_liquidations.sql b/models/gold/defi/lending/defi__ez_lending_liquidations.sql index e939a19..0df648c 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 a41591e..c79f3f7 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("base_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("base_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_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("base_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("base_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 aff08e5..2dd6256 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 ad7168c..c8fe047 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("base_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("base_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_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 ab123a5..40a4147 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 d9fdc59..f355199 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("base_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("base_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_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/nft/nft__ez_nft_sales.sql b/models/gold/nft/nft__ez_nft_sales.sql index fb5b7e4..7af940f 100644 --- a/models/gold/nft/nft__ez_nft_sales.sql +++ b/models/gold/nft/nft__ez_nft_sales.sql @@ -2,7 +2,8 @@ materialized = 'view', persist_docs ={ "relation": true, "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } } + meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } }, + tags = ['gold','nft','curated','ez'] ) }} SELECT @@ -17,9 +18,9 @@ SELECT aggregator_name, seller_address, buyer_address, - nft_address as contract_address, -- new - project_name as name, -- new - tokenId as token_id, -- new + 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, @@ -50,11 +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 da86f0e..a6825e1 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") }}' + description: '{{ doc("evm_modified_timestamp") }}' diff --git a/models/gold/nft/nft__ez_nft_transfers.sql b/models/gold/nft/nft__ez_nft_transfers.sql deleted file mode 100644 index 0ebea7f..0000000 --- a/models/gold/nft/nft__ez_nft_transfers.sql +++ /dev/null @@ -1,54 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'NFT' } } } -) }} - -SELECT - block_timestamp, - block_number, - tx_hash, - {#tx_position, -- new #} - event_index, - intra_event_index, - token_transfer_type, - iff(from_address = '0x0000000000000000000000000000000000000000', TRUE, FALSE) as is_mint, -- new - from_address, -- new - to_address, -- new - contract_address, -- new - tokenId as token_id, -- new - coalesce(erc1155_value, '1')::STRING AS quantity, - 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, - project_name as name, -- new - {#origin_function_signature, -- new - origin_from_address, -- new - origin_to_address -- new - #} - 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 6cb7849..0000000 --- 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("nft_nft_from_address") }}' - - name: NFT_TO_ADDRESS - description: '{{ doc("evm_column_deprecation_notice_nft_to_address") }}' - - name: TO_ADDRESS - description: '{{ doc("nft_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") }}' 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 71bf27f..0000000 --- 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 db7ec28..0000000 --- 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 f8c8f8b..0000000 --- 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 57088a9..0000000 --- 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 dfda724..0000000 --- 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 3426800..0000000 --- a/models/gold/price/price__ez_prices_hourly.yml +++ /dev/null @@ -1,32 +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: NAME - description: '{{ doc("prices_name") }}' - - 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 2be7d75..0000000 --- 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 29ff045..0000000 --- a/models/gold/price/price__fact_prices_ohlc_hourly.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: 2 -models: - - name: price__fact_prices_ohlc_hourly - description: '{{ doc("prices_fact_prices_ohlc_hourly_table_doc") }}' - - columns: - - name: HOUR - description: '{{ doc("prices_hour")}}' - - name: ASSET_ID - description: '{{ doc("prices_asset_id") }}' - - name: OPEN - description: '{{ doc("prices_open") }}' - - name: HIGH - description: '{{ doc("prices_high") }}' - - name: LOW - description: '{{ doc("prices_low") }}' - - name: CLOSE - description: '{{ doc("prices_close") }}' - - name: FACT_PRICES_OHLC_HOURLY_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__dim_products.sql b/models/gold/protocols/vertex/vertex__dim_products.sql deleted file mode 100644 index e384b27..0000000 --- a/models/gold/protocols/vertex/vertex__dim_products.sql +++ /dev/null @@ -1,29 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'VERTEX', - 'PURPOSE': 'CLOB, DEX, PRODUCTS' - } - } - } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - product_id, - product_type, - ticker_id, - symbol, - name, - vertex_products_id AS dim_products_id, - inserted_timestamp, - modified_timestamp -FROM - {{ ref('silver__vertex_dim_products') }} -ORDER BY product_id \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__dim_products.yml b/models/gold/protocols/vertex/vertex__dim_products.yml deleted file mode 100644 index 05790f9..0000000 --- a/models/gold/protocols/vertex/vertex__dim_products.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 2 -models: - - name: vertex__dim_products - description: '{{ doc("vertex_dim_products") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("base_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' - - name: PRODUCT_ID - description: '{{ doc("vertex_product_id") }}' - - name: PRODUCT_TYPE - description: '{{ doc("vertex_product_type") }}' - - name: TICKER_ID - description: '{{ doc("vertex_ticker_id") }}' - - name: SYMBOL - description: '{{ doc("vertex_symbol") }}' - - name: NAME - description: '{{ doc("vertex_name") }}' - - name: DIM_PRODUCTS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_account_stats.sql b/models/gold/protocols/vertex/vertex__ez_account_stats.sql deleted file mode 100644 index d1cefd3..0000000 --- a/models/gold/protocols/vertex/vertex__ez_account_stats.sql +++ /dev/null @@ -1,57 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta ={ - 'database_tags':{ - 'table':{ - 'PROTOCOL': 'VERTEX', - 'PURPOSE': 'CLOB, DEX, STATS' - } - } - } -) }} - -SELECT - subaccount, - trader, - first_trade_timestamp, - last_trade_timestamp, - account_age, - trade_count, - DENSE_RANK() over ( - ORDER BY - trade_count DESC - ) AS trade_count_rank, - trade_count_24h, - DENSE_RANK() over ( - ORDER BY - trade_count_24h DESC - ) AS trade_count_rank_24h, - perp_trade_count, - spot_trade_count, - long_count, - short_count, - total_usd_volume, - DENSE_RANK() over ( - ORDER BY - total_usd_volume DESC - ) AS total_usd_volume_rank, - total_usd_volume_24h, - DENSE_RANK() over ( - ORDER BY - total_usd_volume_24h DESC - ) AS total_usd_volume_rank_24h, - avg_usd_trade_size, - total_fee_amount, - total_base_delta_amount, - total_quote_delta_amount, - total_liquidation_amount, - total_liquidation_amount_quote, - total_liquidation_count, - vertex_account_id as ez_account_stats_id, - inserted_timestamp, - modified_timestamp -FROM - {{ ref('silver__vertex_account_stats') }} -ORDER BY total_usd_volume_rank DESC diff --git a/models/gold/protocols/vertex/vertex__ez_account_stats.yml b/models/gold/protocols/vertex/vertex__ez_account_stats.yml deleted file mode 100644 index 30f71cf..0000000 --- a/models/gold/protocols/vertex/vertex__ez_account_stats.yml +++ /dev/null @@ -1,60 +0,0 @@ -version: 2 -models: - - name: vertex__ez_account_stats - description: '{{ doc("vertex_ez_account_stats") }}' - - columns: - - name: SUBACCOUNT - description: '{{ doc("vertex_subaccount") }}' - - name: TRADER - description: '{{ doc("vertex_trader") }}' - - name: FIRST_TRADE_TIMESTAMP - description: '{{ doc("vertex_first_trade_timestamp") }}' - - name: LAST_TRADE_TIMESTAMP - description: '{{ doc("vertex_last_trade_timestamp") }}' - - name: ACCOUNT_AGE - description: '{{ doc("vertex_account_age") }}' - - name: TRADE_COUNT - description: '{{ doc("vertex_trade_count") }}' - - name: TRADE_COUNT_RANK - description: '{{ doc("vertex_trade_count_rank") }}' - - name: TRADE_COUNT_24H - description: '{{ doc("vertex_trade_count_24h") }}' - - name: TRADE_COUNT_RANK_24H - description: '{{ doc("vertex_trade_count_rank_24h") }}' - - name: PERP_TRADE_COUNT - description: '{{ doc("vertex_perp_trade_count") }}' - - name: SPOT_TRADE_COUNT - description: '{{ doc("vertex_spot_trade_count") }}' - - name: LONG_COUNT - description: '{{ doc("vertex_long_count") }}' - - name: SHORT_COUNT - description: '{{ doc("vertex_short_count") }}' - - name: TOTAL_USD_VOLUME - description: '{{ doc("vertex_total_usd_volume") }}' - - name: TOTAL_USD_VOLUME_RANK - description: '{{ doc("vertex_total_usd_volume_rank") }}' - - name: TOTAL_USD_VOLUME_24H - description: '{{ doc("vertex_total_usd_volume_24h") }}' - - name: TOTAL_USD_VOLUME_RANK_24H - description: '{{ doc("vertex_total_usd_volume_rank_24h") }}' - - name: AVG_USD_TRADE_SIZE - description: '{{ doc("vertex_avg_usd_trade_size") }}' - - name: TOTAL_FEE_AMOUNT - description: '{{ doc("vertex_total_fee_amount") }}' - - name: TOTAL_BASE_DELTA_AMOUNT - description: '{{ doc("vertex_total_base_delta_amount") }}' - - name: TOTAL_QUOTE_DELTA_AMOUNT - description: '{{ doc("vertex_total_quote_delta_amount") }}' - - name: TOTAL_LIQUIDATION_AMOUNT - description: '{{ doc("vertex_total_liquidation_amount") }}' - - name: TOTAL_LIQUIDATION_AMOUNT_QUOTE - description: '{{ doc("vertex_amount_quote_unadj") }}' - - name: TOTAL_LIQUIDATION_COUNT - description: '{{ doc("vertex_total_liquidation_count") }}' - - name: EZ_ACCOUNT_STATS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_clearing_house_events.sql b/models/gold/protocols/vertex/vertex__ez_clearing_house_events.sql deleted file mode 100644 index a384190..0000000 --- a/models/gold/protocols/vertex/vertex__ez_clearing_house_events.sql +++ /dev/null @@ -1,37 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'VERTEX', - 'PURPOSE': 'CLOB, DEX, CLEARINGHOUSE' - } - } - } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - modification_type, - symbol, - trader, - subaccount, - token_address, - amount_unadj, - amount, - amount_usd, - vertex_collateral_id AS ez_clearing_house_events_id, - inserted_timestamp, - modified_timestamp -FROM - {{ ref('silver__vertex_collateral') }} \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_clearing_house_events.yml b/models/gold/protocols/vertex/vertex__ez_clearing_house_events.yml deleted file mode 100644 index 01f1e66..0000000 --- a/models/gold/protocols/vertex/vertex__ez_clearing_house_events.yml +++ /dev/null @@ -1,46 +0,0 @@ -version: 2 -models: - - name: vertex__ez_clearing_house_events - description: '{{ doc("vertex_ez_clearing_house_events") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("base_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' - - name: EVENT_NAME - description: '{{ doc("base_event_name") }}' - - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_origin_to") }}' - - name: SYMBOL - description: '{{ doc("vertex_symbol") }}' - - name: DIGEST - description: '{{ doc("vertex_digest") }}' - - name: TRADER - description: '{{ doc("vertex_trader") }}' - - name: SUBACCOUNT - description: '{{ doc("vertex_subaccount") }}' - - name: TOKEN_ADDRESS - description: '{{ doc("vertex_token_address") }}' - - name: AMOUNT_UNADJ - description: '{{ doc("vertex_amount_unadj") }}' - - name: AMOUNT - description: '{{ doc("vertex_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("vertex_amount_usd_ch") }}' - - name: EZ_CLEARING_HOUSE_EVENTS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_edge_trades.sql b/models/gold/protocols/vertex/vertex__ez_edge_trades.sql deleted file mode 100644 index 5bece0e..0000000 --- a/models/gold/protocols/vertex/vertex__ez_edge_trades.sql +++ /dev/null @@ -1,58 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'VERTEX', - 'PURPOSE': 'CLOB, DEX' - } - } - } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - edge_event_index, - user_event_index, - edge_digest, - user_digest, - trader, - subaccount, - symbol, - edge_order_type, - user_order_type, - edge_trade_type, - user_trade_type, - edge_is_taker, - user_is_taker, - edge_price_amount_unadj, - user_price_amount_unadj, - edge_price_amount, - user_price_amount, - edge_amount_unadj, - user_amount_unadj, - edge_amount, - user_amount, - edge_amount_usd, - user_amount_usd, - edge_fee_amount_unadj, - user_fee_amount_unadj, - edge_fee_amount, - user_fee_amount, - edge_base_delta_amount_unadj, - user_base_delta_amount_unadj, - edge_base_delta_amount, - user_base_delta_amount, - edge_quote_delta_amount_unadj, - user_quote_delta_amount_unadj, - edge_quote_delta_amount, - user_quote_delta_amount, - vertex_edge_trade_id as ez_edge_trades_id, - inserted_timestamp, - modified_timestamp, -FROM - {{ ref('silver__vertex_edge_trades') }} \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_edge_trades.yml b/models/gold/protocols/vertex/vertex__ez_edge_trades.yml deleted file mode 100644 index cdb30a9..0000000 --- a/models/gold/protocols/vertex/vertex__ez_edge_trades.yml +++ /dev/null @@ -1,88 +0,0 @@ -version: 2 -models: - - name: vertex__ez_edge_trades - description: '{{ doc("vertex_ez_edge_trades") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("base_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' - - name: EDGE_EVENT_INDEX - description: '{{ doc("base_event_index") }}' - - name: USER_EVENT_INDEX - description: '{{ doc("base_event_index") }}' - - name: EDGE_DIGEST - description: '{{ doc("vertex_digest") }}' - - name: USER_DIGEST - description: '{{ doc("vertex_digest") }}' - - name: TRADER - description: '{{ doc("vertex_trader") }}' - - name: SUBACCOUNT - description: '{{ doc("vertex_subaccount") }}' - - name: SYMBOL - description: '{{ doc("vertex_symbol") }}' - - name: EDGE_ORDER_TYPE - description: '{{ doc("vertex_order_type") }}' - - name: USER_ORDER_TYPE - description: '{{ doc("vertex_order_type") }}' - - name: EDGE_TRADE_TYPE - description: '{{ doc("vertex_trade_type") }}' - - name: USER_TRADE_TYPE - description: '{{ doc("vertex_trade_type") }}' - - name: EDGE_IS_TAKER - description: '{{ doc("vertex_is_taker") }}' - - name: USER_IS_TAKER - description: '{{ doc("vertex_is_taker") }}' - - name: EDGE_PRICE_AMOUNT_UNADJ - description: '{{ doc("vertex_price_amount_unadj") }}' - - name: USER_PRICE_AMOUNT_UNADJ - description: '{{ doc("vertex_price_amount_unadj") }}' - - name: EDGE_PRICE_AMOUNT - description: '{{ doc("vertex_price_amount") }}' - - name: USER_PRICE_AMOUNT - description: '{{ doc("vertex_price_amount") }}' - - name: EDGE_AMOUNT_UNADJ - description: '{{ doc("vertex_amount_unadj") }}' - - name: USER_AMOUNT_UNADJ - description: '{{ doc("vertex_amount_unadj") }}' - - name: EDGE_AMOUNT - description: '{{ doc("vertex_amount") }}' - - name: USER_AMOUNT - description: '{{ doc("vertex_amount") }}' - - name: EDGE_AMOUNT_USD - description: '{{ doc("vertex_amount_usd") }}' - - name: USER_AMOUNT_USD - description: '{{ doc("vertex_amount_usd") }}' - - name: EDGE_FEE_AMOUNT_UNADJ - description: '{{ doc("vertex_fee_amount_unadj") }}' - - name: USER_FEE_AMOUNT_UNADJ - description: '{{ doc("vertex_fee_amount_unadj") }}' - - name: EDGE_FEE_AMOUNT - description: '{{ doc("vertex_fee_amount") }}' - - name: USER_FEE_AMOUNT - description: '{{ doc("vertex_fee_amount") }}' - - name: EDGE_BASE_DELTA_AMOUNT_UNADJ - description: '{{ doc("vertex_base_delta_amount_unadj") }}' - - name: USER_BASE_DELTA_AMOUNT_UNADJ - description: '{{ doc("vertex_base_delta_amount_unadj") }}' - - name: EDGE_BASE_DELTA_AMOUNT - description: '{{ doc("vertex_base_delta_amount") }}' - - name: USER_BASE_DELTA_AMOUNT - description: '{{ doc("vertex_base_delta_amount") }}' - - name: EDGE_QUOTE_DELTA_AMOUNT_UNADJ - description: '{{ doc("vertex_quote_delta_amount_unadj") }}' - - name: USER_QUOTE_DELTA_AMOUNT_UNADJ - description: '{{ doc("vertex_quote_delta_amount_unadj") }}' - - name: EDGE_QUOTE_DELTA_AMOUNT - description: '{{ doc("vertex_quote_delta_amount") }}' - - name: USER_QUOTE_DELTA_AMOUNT - description: '{{ doc("vertex_quote_delta_amount") }}' - - name: EZ_EDGE_TRADES_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_liquidations.sql b/models/gold/protocols/vertex/vertex__ez_liquidations.sql deleted file mode 100644 index 9dff8fa..0000000 --- a/models/gold/protocols/vertex/vertex__ez_liquidations.sql +++ /dev/null @@ -1,41 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'VERTEX', - 'PURPOSE': 'CLOB, DEX, LIQUIDATION' - } - } - } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - digest, - trader, - subaccount, - product_id, - health_group, - health_group_symbol, - amount_unadj, - amount, - amount_quote_unadj, - amount_quote, - is_encoded_spread, - spread_product_ids, - vertex_liquidation_id AS ez_liquidations_id, - inserted_timestamp, - modified_timestamp -FROM - {{ ref('silver__vertex_liquidations') }} \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_liquidations.yml b/models/gold/protocols/vertex/vertex__ez_liquidations.yml deleted file mode 100644 index addfc40..0000000 --- a/models/gold/protocols/vertex/vertex__ez_liquidations.yml +++ /dev/null @@ -1,54 +0,0 @@ -version: 2 -models: - - name: vertex__ez_liquidations - description: '{{ doc("vertex_ez_liquidations") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("base_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' - - name: EVENT_NAME - description: '{{ doc("base_event_name") }}' - - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_origin_to") }}' - - name: DIGEST - description: '{{ doc("vertex_digest") }}' - - name: TRADER - description: '{{ doc("vertex_trader") }}' - - name: SUBACCOUNT - description: '{{ doc("vertex_subaccount") }}' - - name: PRODUCT_ID - description: '{{ doc("vertex_product_id_liq") }}' - - name: HEALTH_GROUP - description: '{{ doc("vertex_health_group") }}' - - name: HEALTH_GROUP_SYMBOL - description: '{{ doc("vertex_health_group_symbol") }}' - - name: AMOUNT_UNADJ - description: '{{ doc("vertex_amount_unadj") }}' - - name: AMOUNT - description: '{{ doc("vertex_amount") }}' - - name: AMOUNT_QUOTE_UNADJ - description: '{{ doc("vertex_amount_quote_unadj") }}' - - name: AMOUNT_QUOTE - description: '{{ doc("vertex_amount_quote") }}' - - name: IS_ENCODE_SPREAD - description: '{{ doc("vertex_is_encode_spread") }}' - - name: SPREAD_PRODUCT_IDS - description: '{{ doc("vertex_decoded_spread_product_ids") }}' - - name: EZ_LIQUIDATIONS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_market_depth_stats.sql b/models/gold/protocols/vertex/vertex__ez_market_depth_stats.sql deleted file mode 100644 index 3a9bbe2..0000000 --- a/models/gold/protocols/vertex/vertex__ez_market_depth_stats.sql +++ /dev/null @@ -1,31 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'VERTEX', - 'PURPOSE': 'CLOB, DEX, STATS' - } - } - } -) }} - -SELECT - hour, - ticker_id, - product_id, - orderbook_side, - volume, - price, - round_price_0_01, - round_price_0_1, - round_price_1, - round_price_10, - round_price_100, - vertex_market_depth_id as ez_market_depth_stats_id, - inserted_timestamp, - modified_timestamp -FROM - {{ ref('silver__vertex_market_depth') }} \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_market_depth_stats.yml b/models/gold/protocols/vertex/vertex__ez_market_depth_stats.yml deleted file mode 100644 index 2e80b69..0000000 --- a/models/gold/protocols/vertex/vertex__ez_market_depth_stats.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: 2 -models: - - name: vertex__ez_market_depth_stats - description: '{{ doc("vertex_ez_market_depth") }}' - - columns: - - name: HOUR - description: '{{ doc("vertex_hour") }}' - - name: TICKER_ID - description: '{{ doc("vertex_ticker_id") }}' - - name: PRODUCT_ID - description: '{{ doc("vertex_product_id") }}' - - name: ORDERBOOK_SIDE - description: '{{ doc("vertex_orderbook_side") }}' - - name: VOLUME - description: '{{ doc("vertex_orderbook_volume") }}' - - name: PRICE - description: '{{ doc("vertex_orderbook_price") }}' - - name: ROUND_PRICE_0_01 - description: '{{ doc("vertex_orderbook_round_price_0_01") }}' - - name: ROUND_PRICE_0_1 - description: '{{ doc("vertex_orderbook_round_price_0_1") }}' - - name: ROUND_PRICE_1 - description: '{{ doc("vertex_orderbook_round_price_1") }}' - - name: ROUND_PRICE_10 - description: '{{ doc("vertex_orderbook_round_price_10") }}' - - name: ROUND_PRICE_100 - description: '{{ doc("vertex_orderbook_round_price_100") }}' - - name: EZ_MARKET_DEPTH_STATS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_market_stats.sql b/models/gold/protocols/vertex/vertex__ez_market_stats.sql deleted file mode 100644 index 7e6a958..0000000 --- a/models/gold/protocols/vertex/vertex__ez_market_stats.sql +++ /dev/null @@ -1,45 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'VERTEX', - 'PURPOSE': 'CLOB, DEX, STATS' - } - } - } -) }} - -SELECT - hour, - ticker_id, - product_id, - symbol, - distinct_sequencer_batches, - distinct_trader_count, - distinct_subaccount_count, - trade_count, - amount_usd, - fee_amount, - base_delta_amount, - quote_delta_amount, - base_volume_24h, - quote_volume_24h, - funding_rate, - index_price, - last_price, - mark_price, - next_funding_rate_timestamp, - open_interest, - open_interest_usd, - price_change_percent_24h, - product_type, - quote_currency, - quote_volume, - vertex_market_stats_id as ez_market_stats_id, - _inserted_timestamp as inserted_timestamp, - modified_timestamp -FROM - {{ ref('silver__vertex_market_stats') }} \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_market_stats.yml b/models/gold/protocols/vertex/vertex__ez_market_stats.yml deleted file mode 100644 index 13ef638..0000000 --- a/models/gold/protocols/vertex/vertex__ez_market_stats.yml +++ /dev/null @@ -1,58 +0,0 @@ -version: 2 -models: - - name: vertex__ez_market_stats - description: '{{ doc("vertex_ez_market_stats") }}' - - columns: - - name: HOUR - description: '{{ doc("vertex_hour") }}' - - name: TICKER_ID - description: '{{ doc("vertex_ticker_id") }}' - - name: PRODUCT_ID - description: '{{ doc("vertex_product_id") }}' - - name: SYMBOL - description: '{{ doc("vertex_symbol") }}' - - name: DISTINCT_SEQUENCER_BATCHES - description: '{{ doc("vertex_distinct_sequencer_batches") }}' - - name: DISTINCT_TRADER_COUNT - description: '{{ doc("vertex_trader_count") }}' - - name: DISTINCT_SUBACCOUNT_COUNT - description: '{{ doc("vertex_subaccount_count") }}' - - name: TRADE_COUNT - description: '{{ doc("vertex_total_trade_count") }}' - - name: AMOUNT_USD - description: '{{ doc("vertex_amount_usd") }}' - - name: FEE_AMOUNT - description: '{{ doc("vertex_fee_amount") }}' - - name: BASE_DELTA_AMOUNT - description: '{{ doc("vertex_base_delta_amount") }}' - - name: QUOTE_DELTA_AMOUNT - description: '{{ doc("vertex_quote_delta_amount") }}' - - name: BASE_VOLUME_24H - description: '{{ doc("vertex_base_volume_24h") }}' - - name: QUOTE_VOLUME_24H - description: '{{ doc("vertex_quote_volume_24h") }}' - - name: FUNDING_RATE - description: '{{ doc("vertex_funding_rate") }}' - - name: INDEX_PRICE - description: '{{ doc("vertex_index_price") }}' - - name: LAST_PRICE - description: '{{ doc("vertex_last_price") }}' - - name: MARK_PRICE - description: '{{ doc("vertex_mark_price") }}' - - name: NEXT_FUNDING_RATE_TIMESTAMP - description: '{{ doc("vertex_next_funding_rate") }}' - - name: OPEN_INTEREST - description: '{{ doc("vertex_open_interest") }}' - - name: OPEN_INTEREST_USD - description: '{{ doc("vertex_open_interest_usd") }}' - - name: PRODUCT_TYPE - description: '{{ doc("vertex_product_type") }}' - - name: QUOTE_CURRENCY - description: '{{ doc("vertex_quote_currency") }}' - - name: EZ_MARKET_STATS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_money_markets.sql b/models/gold/protocols/vertex/vertex__ez_money_markets.sql deleted file mode 100644 index f4115fb..0000000 --- a/models/gold/protocols/vertex/vertex__ez_money_markets.sql +++ /dev/null @@ -1,27 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'VERTEX', - 'PURPOSE': 'CLOB, DEX, STATS' - } - } - } -) }} - -SELECT - hour, - ticker_id, - symbol, - product_id, - deposit_apr, - borrow_apr, - tvl, - vertex_money_markets_id as ez_money_markets_id, - inserted_timestamp, - modified_timestamp -FROM - {{ ref('silver__vertex_money_markets') }} \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_money_markets.yml b/models/gold/protocols/vertex/vertex__ez_money_markets.yml deleted file mode 100644 index d9e14e3..0000000 --- a/models/gold/protocols/vertex/vertex__ez_money_markets.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: 2 -models: - - name: vertex__ez_money_markets - description: '{{ doc("vertex_money_markets") }}' - - columns: - - name: HOUR - description: '{{ doc("vertex_hour") }}' - - name: TICKER_ID - description: '{{ doc("vertex_ticker_id") }}' - - name: SYMBOL - description: '{{ doc("vertex_symbol") }}' - - name: PRODUCT_ID - description: '{{ doc("vertex_product_id") }}' - - name: DEPOSIT_APR - description: '{{ doc("vertex_deposit_apr") }}' - - name: BORROW_APR - description: '{{ doc("vertex_borrow_apr") }}' - - name: TVL - description: '{{ doc("vertex_tvl") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' - - name: VERTEX_MONEY_MARKETS_ID - description: '{{ doc("pk") }}' \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_perp_trades.sql b/models/gold/protocols/vertex/vertex__ez_perp_trades.sql deleted file mode 100644 index 815bcb7..0000000 --- a/models/gold/protocols/vertex/vertex__ez_perp_trades.sql +++ /dev/null @@ -1,50 +0,0 @@ - {{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true }, - meta={ - 'database_tags':{ - 'table': { - 'PROTOCOL': 'VERTEX', - 'PURPOSE': 'CLOB, DEX, PERPS' - } - } - } -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - symbol, - digest, - trader, - subaccount, - trade_type, - order_type, - market_reduce_flag, - expiration, - nonce, - is_taker, - price_amount_unadj, - price_amount, - amount_unadj, - amount, - amount_usd, - fee_amount_unadj, - fee_amount, - base_delta_amount_unadj, - base_delta_amount, - quote_delta_amount_unadj, - quote_delta_amount, - vertex_perps_id AS ez_perp_trades_id, - inserted_timestamp, - modified_timestamp -FROM - {{ ref('silver__vertex_perps') }} \ No newline at end of file diff --git a/models/gold/protocols/vertex/vertex__ez_perp_trades.yml b/models/gold/protocols/vertex/vertex__ez_perp_trades.yml deleted file mode 100644 index 590022e..0000000 --- a/models/gold/protocols/vertex/vertex__ez_perp_trades.yml +++ /dev/null @@ -1,72 +0,0 @@ -version: 2 -models: - - name: vertex__ez_perp_trades - description: '{{ doc("vertex_ez_perp_trades") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("base_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("base_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("base_logs_tx_hash") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("base_logs_contract_address") }}' - - name: EVENT_NAME - description: '{{ doc("base_event_name") }}' - - name: EVENT_INDEX - description: '{{ doc("base_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("base_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("base_origin_to") }}' - - name: SYMBOL - description: '{{ doc("vertex_symbol") }}' - - name: DIGEST - description: '{{ doc("vertex_digest") }}' - - name: TRADER - description: '{{ doc("vertex_trader") }}' - - name: SUBACCOUNT - description: '{{ doc("vertex_subaccount") }}' - - name: TRADE_TYPE - description: '{{ doc("vertex_trade_type") }}' - - name: ORDER_TYPE - description: '{{ doc("vertex_order_type") }}' - - name: MARKET_REDUCE_FLAG - description: '{{ doc("vertex_market_reduce_flag") }}' - - name: EXPIRATION - description: '{{ doc("vertex_expiration") }}' - - name: NONCE - description: '{{ doc("vertex_nonce") }}' - - name: IS_TAKER - description: '{{ doc("vertex_is_taker") }}' - - name: PRICE_AMOUNT_UNADJ - description: '{{ doc("vertex_price_amount_unadj") }}' - - name: PRICE_AMOUNT - description: '{{ doc("vertex_price_amount") }}' - - name: AMOUNT_UNADJ - description: '{{ doc("vertex_amount_unadj") }}' - - name: AMOUNT - description: '{{ doc("vertex_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("vertex_amount_usd") }}' - - name: FEE_AMOUNT_UNADJ - description: '{{ doc("vertex_fee_amount_unadj") }}' - - name: FEE_AMOUNT - description: '{{ doc("vertex_fee_amount") }}' - - name: BASE_DELTA_AMOUNT_UNADJ - description: '{{ doc("vertex_base_delta_amount_unadj") }}' - - name: BASE_DELTA_AMOUNT - description: '{{ doc("vertex_base_delta_amount") }}' - - name: QUOTE_DELTA_AMOUNT_UNADJ - description: '{{ doc("vertex_quote_delta_amount_unadj") }}' - - name: QUOTE_DELTA_AMOUNT - description: '{{ doc("vertex_quote_delta_amount") }}' - - name: EZ_PERP_TRADES_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 13a9f1c..0000000 --- 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' 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 8a61528..0000000 --- a/models/gold/stats/stats__ez_core_metrics_hourly.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: 2 -models: - - name: stats__ez_core_metrics_hourly - description: '{{ doc("evm_ez_core_metrics_hourly_table_doc") }}' - - columns: - - name: BLOCK_TIMESTAMP_HOUR - description: '{{ doc("evm_block_timestamp_hour") }}' - - name: BLOCK_NUMBER_MIN - description: '{{ doc("evm_block_number_min") }}' - - name: BLOCK_NUMBER_MAX - description: '{{ doc("evm_block_number_max") }}' - - name: BLOCK_COUNT - description: '{{ doc("evm_block_count") }}' - - name: TRANSACTION_COUNT - description: '{{ doc("evm_transaction_count") }}' - - name: TRANSACTION_COUNT_SUCCESS - description: '{{ doc("evm_transaction_count_success") }}' - - name: TRANSACTION_COUNT_FAILED - description: '{{ doc("evm_transaction_count_failed") }}' - - name: UNIQUE_FROM_COUNT - description: '{{ doc("evm_unique_from_count") }}' - - name: UNIQUE_TO_COUNT - description: '{{ doc("evm_unique_to_count") }}' - - name: TOTAL_FEES_NATIVE - description: '{{ doc("evm_total_fees_native") }}' - - name: TOTAL_FEES_USD - description: '{{ doc("evm_total_fees_usd") }}' - - name: EZ_CORE_METRICS_HOURLY_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/silver/_observability/silver_observability__blocks_completeness.sql b/models/silver/_observability/silver_observability__blocks_completeness.sql deleted file mode 100644 index c5c625e..0000000 --- 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__logs_completeness.sql b/models/silver/_observability/silver_observability__logs_completeness.sql deleted file mode 100644 index 452478d..0000000 --- a/models/silver/_observability/silver_observability__logs_completeness.sql +++ /dev/null @@ -1,120 +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 - ) - HAVING block_number NOT IN (23411110, 23635928,23635927) - ) - ) {% 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 638e073..0000000 --- a/models/silver/_observability/silver_observability__receipts_completeness.sql +++ /dev/null @@ -1,118 +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 - ) - HAVING block_number NOT IN (23411110, 23635928,23635927) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -broken_blocks AS ( - SELECT - DISTINCT block_number - FROM - {{ ref("silver__transactions") }} - t - LEFT JOIN {{ ref("silver__receipts") }} - r USING ( - block_number, - tx_hash, - block_hash - ) - JOIN block_range USING (block_number) - WHERE - r.tx_hash IS NULL -), -impacted_blocks AS ( - SELECT - COUNT(1) AS blocks_impacted_count, - ARRAY_AGG(block_number) within GROUP ( - ORDER BY - block_number - ) AS blocks_impacted_array - FROM - broken_blocks -) -SELECT - 'receipts' AS test_name, - min_block, - max_block, - min_block_timestamp, - max_block_timestamp, - blocks_tested, - blocks_impacted_count, - blocks_impacted_array, - CURRENT_TIMESTAMP() AS test_timestamp -FROM - summary_stats - JOIN impacted_blocks - ON 1 = 1 diff --git a/models/silver/_observability/silver_observability__traces_completeness.sql b/models/silver/_observability/silver_observability__traces_completeness.sql deleted file mode 100644 index d88686f..0000000 --- a/models/silver/_observability/silver_observability__traces_completeness.sql +++ /dev/null @@ -1,120 +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 - ) - HAVING block_number <> 23411110 - ) - ) {% 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( - "base_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 d755db3..0000000 --- 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 5d0d4a2..0000000 --- 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 = 'basescan' - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - FROM - {{ this }} - WHERE - abi_source = 'basescan' -) -{% 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 ad57edf..0000000 --- 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 32c20b4..0000000 --- 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 704e39d..0000000 --- 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 67e1697..0000000 --- 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 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 9004009..0000000 --- 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 da102b9..0000000 --- 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 88b8439..0000000 --- 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 a328b24..0000000 --- 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 da5fa8f..0000000 --- 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 4de20b9..0000000 --- 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 = 'base' - 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 912a5c8..0000000 --- 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 89ba461..0000000 --- a/models/silver/abis/silver__verified_abis.sql +++ /dev/null @@ -1,105 +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 - MAX( - _inserted_timestamp - ) - FROM - {{ this }} -) -{% endif %} -), -basescan_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - 'basescan' 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 - basescan_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 2f623e9..0000000 --- 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 f412a3b..0000000 --- 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 727c5ca..0000000 --- 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 257599f..0000000 --- a/models/silver/core/silver__contracts.sql +++ /dev/null @@ -1,110 +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, - CASE - WHEN read_output IS NOT NULL THEN utils.udf_hex_to_int( - read_output :: STRING - ) - ELSE NULL - END 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 :: STRING AS contract_address, - token_name, - TRY_TO_NUMBER(token_decimals) 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 754523d..0000000 --- a/models/silver/core/silver__contracts.yml +++ /dev/null @@ -1,24 +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 diff --git a/models/silver/core/silver__created_contracts.sql b/models/silver/core/silver__created_contracts.sql deleted file mode 100644 index 23b956e..0000000 --- a/models/silver/core/silver__created_contracts.sql +++ /dev/null @@ -1,66 +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 -UNION ALL -SELECT - 0 AS block_number, - '1970-01-01 00:00:00' AS block_timestamp, - 'GENESIS' AS tx_hash, - contract_address AS created_contract_address, - 'GENESIS' AS creator_address, - NULL AS created_contract_input, - SYSDATE() AS _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['contract_address'] - ) }} AS created_contracts_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {{ ref('silver__genesis_contracts_backfill') }} - -{% if is_incremental() %} -WHERE - 1 = 2 -{% endif %} diff --git a/models/silver/core/silver__created_contracts.yml b/models/silver/core/silver__created_contracts.yml deleted file mode 100644 index ed60983..0000000 --- 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 025c6a3..0000000 --- a/models/silver/core/silver__decoded_logs.sql +++ /dev/null @@ -1,246 +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 - 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 %}, -complete_data AS ( - 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 %} -) -SELECT - * -FROM - complete_data 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__logs.sql b/models/silver/core/silver__logs.sql deleted file mode 100644 index 781a667..0000000 --- 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 - 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, - {#position as tx_position,#} -- new - 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.contract_address, - {#l.tx_position,#} -- new - 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,#} -- new - 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,#} -- new - 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,#} -- new - 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 17672d4..0000000 --- a/models/silver/core/silver__native_transfers.sql +++ /dev/null @@ -1,93 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'block_number', - cluster_by = ['block_timestamp::DATE'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - tags = ['core','non_realtime','reorg'] -) }} - -WITH eth_base AS ( - - SELECT - tx_hash, - block_number, - block_timestamp, - identifier, - from_address, - to_address, - VALUE AS eth_value, - concat_ws( - '-', - block_number, - tx_position, - CONCAT( - TYPE, - '_', - trace_address - ) - ) AS _call_id, - modified_timestamp AS _inserted_timestamp, - value_precise_raw AS eth_value_precise_raw, - value_precise AS eth_value_precise, - tx_position, - trace_index, - origin_from_address, - origin_to_address, - origin_function_signature - 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 %} -) -SELECT - tx_hash, - block_number, - block_timestamp, - identifier, - origin_from_address, - origin_to_address, - origin_function_signature, - from_address, - to_address, - eth_value AS amount, - eth_value_precise_raw AS amount_precise_raw, - eth_value_precise AS amount_precise, - ROUND( - eth_value * price, - 2 - ) AS amount_usd, - _call_id, - A._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' diff --git a/models/silver/core/silver__receipts.sql b/models/silver/core/silver__receipts.sql deleted file mode 100644 index 80f73db..0000000 --- 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 14ba6cf..0000000 --- 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 41b1888..0000000 --- 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 1d54d03..0000000 --- a/models/silver/core/silver__traces.sql +++ /dev/null @@ -1,162 +0,0 @@ --- depends_on: {{ ref('bronze__traces') }} -{{ config ( - materialized = "incremental", - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = ['modified_timestamp::DATE','partition_key'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - full_refresh = false, - tags = ['core','non_realtime'] -) }} -{# {{ silver_traces_v1( -full_reload_start_block = 2300000, -full_reload_blocks = 1000000, -use_partition_key = TRUE -) }} -#} -WITH bronze_traces AS ( - - SELECT - block_number, - partition_key, - VALUE :array_index :: INT AS tx_position, - DATA :result AS full_traces, - _inserted_timestamp - FROM - -{% if is_incremental() and not full_reload_mode %} -{{ ref( - 'bronze__traces' -) }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) - AND DATA :result IS NOT NULL {% elif is_incremental() and full_reload_mode %} - {{ ref( - 'bronze__traces_fr' - ) }} -WHERE - partition_key BETWEEN ( - SELECT - MAX(partition_key) - 100000 - FROM - {{ this }} - ) - AND ( - SELECT - MAX(partition_key) + 1000000 - FROM - {{ this }} - ) -{% else %} - {{ ref( - 'bronze__traces_fr' - ) }} -WHERE - partition_key <= 2300000 -{% 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 53840e4..0000000 --- a/models/silver/core/silver__transactions.sql +++ /dev/null @@ -1,426 +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 AS 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 %}, -FINAL AS ( - SELECT - block_number, - block_hash, - chain_id, - from_address, - gas, - gas_price, - tx_hash, - input_data, - origin_function_signature, - max_fee_per_gas, - max_priority_fee_per_gas, - nonce, - r, - s, - to_address, - POSITION, - TYPE, - v, - VALUE, - value_precise_raw, - value_precise, - block_timestamp, - is_pending, - gas_used, - tx_success, - tx_status, - cumulative_gas_used, - effective_gas_price, - 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, - value_precise_raw, - value_precise, - 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, - 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 d98f573..0000000 --- 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 28d347c..0000000 --- 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('silver__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 25dc03b..0000000 --- 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 f90d39c..0000000 --- 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 45a66a2..0000000 --- a/models/silver/core/tests/blocks/test_silver__blocks_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__blocks') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/blocks/test_silver__blocks_recent.yml b/models/silver/core/tests/blocks/test_silver__blocks_recent.yml deleted file mode 100644 index ceb767f..0000000 --- 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 6d93a21..0000000 --- a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__confirmed_blocks') }} diff --git a/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.yml b/models/silver/core/tests/confirmed_blocks/test_silver__confirmed_blocks_full.yml deleted file mode 100644 index 81a9db0..0000000 --- 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 d7655c7..0000000 --- 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 460ddf1..0000000 --- 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 1dcc890..0000000 --- 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 436c8e7..0000000 --- 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 224f4dc..0000000 --- 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 0831194..0000000 --- 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 e117298..0000000 --- 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 4b5140c..0000000 --- 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 879aa9b..0000000 --- a/models/silver/core/tests/event_logs/test_silver__logs_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__logs') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/event_logs/test_silver__logs_recent.yml b/models/silver/core/tests/event_logs/test_silver__logs_recent.yml deleted file mode 100644 index 4a2b8a6..0000000 --- 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 56f39ae..0000000 --- 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 9a18685..0000000 --- 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 97bd45a..0000000 --- a/models/silver/core/tests/receipts/test_silver__receipts_recent.sql +++ /dev/null @@ -1,16 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__receipts') }} -WHERE - block_number > ( - SELECT - block_number - FROM - {{ ref("_block_lookback") }} - ) diff --git a/models/silver/core/tests/receipts/test_silver__receipts_recent.yml b/models/silver/core/tests/receipts/test_silver__receipts_recent.yml deleted file mode 100644 index e25bd4e..0000000 --- a/models/silver/core/tests/receipts/test_silver__receipts_recent.yml +++ /dev/null @@ -1,29 +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 - where: BLOCK_NUMBER <> 23635928 - 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 be52e71..0000000 --- a/models/silver/core/tests/traces/test_silver__traces_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__traces') }} diff --git a/models/silver/core/tests/traces/test_silver__traces_full.yml b/models/silver/core/tests/traces/test_silver__traces_full.yml deleted file mode 100644 index f21a7e1..0000000 --- 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 493b8f2..0000000 --- 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 10e6629..0000000 --- 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 df58d17..0000000 --- a/models/silver/core/tests/transactions/test_silver__transactions_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('silver__transactions') }} diff --git a/models/silver/core/tests/transactions/test_silver__transactions_full.yml b/models/silver/core/tests/transactions/test_silver__transactions_full.yml deleted file mode 100644 index fc88627..0000000 --- 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 9e695af..0000000 --- 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") }} - ) \ No newline at end of file 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 3539ac2..0000000 --- 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 487722d..0000000 --- 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 fe05c44..0000000 --- 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 e384cda..0000000 --- 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 99d65d1..0000000 --- a/models/silver/core/tests/transfers/test_silver__transfers_recent.yml +++ /dev/null @@ -1,67 +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 - - 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 d98e014..c245c69 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 9b1537f..3d69e86 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 a56b4d7..e1da475 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 7cfa54c..c2aed6c 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/cctp/silver_bridge__cctp_depositforburn.sql b/models/silver/defi/bridge/cctp/silver_bridge__cctp_depositforburn.sql index 42d9499..860e193 100644 --- a/models/silver/defi/bridge/cctp/silver_bridge__cctp_depositforburn.sql +++ b/models/silver/defi/bridge/cctp/silver_bridge__cctp_depositforburn.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/cctp/silver_bridge__cctp_v2_depositforburn.sql b/models/silver/defi/bridge/cctp/silver_bridge__cctp_v2_depositforburn.sql index 81fe8fa..5ce4178 100644 --- a/models/silver/defi/bridge/cctp/silver_bridge__cctp_v2_depositforburn.sql +++ b/models/silver/defi/bridge/cctp/silver_bridge__cctp_v2_depositforburn.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/celer/silver_bridge__celer_cbridge_send.sql b/models/silver/defi/bridge/celer/silver_bridge__celer_cbridge_send.sql index 239ee71..bacc661 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 1b8b695..d49380f 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/hop/silver_bridge__hop_ammwrapper.sql b/models/silver/defi/bridge/hop/silver_bridge__hop_ammwrapper.sql index ba2016c..38e9e4e 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 6220f3b..ffb669a 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 806ba40..cf00922 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 dd9cc79..847bdac 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/silver_bridge__complete_bridge_activity.sql b/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql index 35b1abe..514d527 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 1c0cc82..4de3321 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 b83c5e1..fcfb0c9 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 db17524..d68020b 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 2c8118d..fed586d 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 cd4b2a7..75830ce 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 63b14de..e9a7794 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 ( @@ -58,7 +58,7 @@ WITH token_transfers AS ( FROM {{ ref('core__ez_token_transfers') }} tr - INNER JOIN {{ ref('silver__transactions') }} + INNER JOIN {{ ref('core__fact_transactions') }} tx ON tr.block_number = tx.block_number AND tr.tx_hash = tx.tx_hash @@ -125,7 +125,7 @@ native_transfers AS ( FROM {{ ref('core__ez_native_transfers') }} et - INNER JOIN {{ ref('silver__transactions') }} + INNER JOIN {{ ref('core__fact_transactions') }} tx ON et.block_number = tx.block_number AND et.tx_hash = tx.tx_hash @@ -197,7 +197,7 @@ base_near AS ( addr_encoded FROM {{ source( - 'silver_crosschain', + 'crosschain_silver', 'near_address_encoded' ) }} ) diff --git a/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_pools.sql b/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_pools.sql index 1fb5ade..0c04e00 100644 --- a/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_pools.sql +++ b/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_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 created_pools AS( diff --git a/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_slipstream_pools.sql b/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_slipstream_pools.sql index b2710b7..d1ecd98 100644 --- a/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_slipstream_pools.sql +++ b/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_slipstream_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/aerodrome/silver_dex__aerodrome_slipstream_swaps.sql b/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_slipstream_swaps.sql index 02e10de..5e938cf 100644 --- a/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_slipstream_swaps.sql +++ b/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_slipstream_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 base_swaps AS ( diff --git a/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_swaps.sql b/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_swaps.sql index e204226..b55cbb5 100644 --- a/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_swaps.sql +++ b/models/silver/defi/dex/aerodrome/silver_dex__aerodrome_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/alienbase/silver_dex__alienbase_pools.sql b/models/silver/defi/dex/alienbase/silver_dex__alienbase_pools.sql index 776004c..db10a19 100644 --- a/models/silver/defi/dex/alienbase/silver_dex__alienbase_pools.sql +++ b/models/silver/defi/dex/alienbase/silver_dex__alienbase_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/alienbase/silver_dex__alienbase_swaps.sql b/models/silver/defi/dex/alienbase/silver_dex__alienbase_swaps.sql index e7a4ed8..cfef281 100644 --- a/models/silver/defi/dex/alienbase/silver_dex__alienbase_swaps.sql +++ b/models/silver/defi/dex/alienbase/silver_dex__alienbase_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/balancer/silver_dex__balancer_pools.sql b/models/silver/defi/dex/balancer/silver_dex__balancer_pools.sql index 93fef7d..fb9ec7d 100644 --- a/models/silver/defi/dex/balancer/silver_dex__balancer_pools.sql +++ b/models/silver/defi/dex/balancer/silver_dex__balancer_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools_registered AS ( diff --git a/models/silver/defi/dex/balancer/silver_dex__balancer_swaps.sql b/models/silver/defi/dex/balancer/silver_dex__balancer_swaps.sql index c894091..16ad4f7 100644 --- a/models/silver/defi/dex/balancer/silver_dex__balancer_swaps.sql +++ b/models/silver/defi/dex/balancer/silver_dex__balancer_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_name AS ( diff --git a/models/silver/defi/dex/baseswap/silver_dex__baseswap_basex_pools.sql b/models/silver/defi/dex/baseswap/silver_dex__baseswap_basex_pools.sql index c8d2e93..165ad6d 100644 --- a/models/silver/defi/dex/baseswap/silver_dex__baseswap_basex_pools.sql +++ b/models/silver/defi/dex/baseswap/silver_dex__baseswap_basex_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 created_pools AS ( diff --git a/models/silver/defi/dex/baseswap/silver_dex__baseswap_basex_swaps.sql b/models/silver/defi/dex/baseswap/silver_dex__baseswap_basex_swaps.sql index 12d9857..771b25a 100644 --- a/models/silver/defi/dex/baseswap/silver_dex__baseswap_basex_swaps.sql +++ b/models/silver/defi/dex/baseswap/silver_dex__baseswap_basex_swaps.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'block_number', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/baseswap/silver_dex__baseswap_pools.sql b/models/silver/defi/dex/baseswap/silver_dex__baseswap_pools.sql index ad0a0d6..c11bebc 100644 --- a/models/silver/defi/dex/baseswap/silver_dex__baseswap_pools.sql +++ b/models/silver/defi/dex/baseswap/silver_dex__baseswap_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/baseswap/silver_dex__baseswap_swaps.sql b/models/silver/defi/dex/baseswap/silver_dex__baseswap_swaps.sql index fb4fb26..f05b1d0 100644 --- a/models/silver/defi/dex/baseswap/silver_dex__baseswap_swaps.sql +++ b/models/silver/defi/dex/baseswap/silver_dex__baseswap_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/curve/silver_dex__curve_pools.sql b/models/silver/defi/dex/curve/silver_dex__curve_pools.sql index 71c9024..386bb8e 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 2d1d956..8f3bf1b 100644 --- a/models/silver/defi/dex/curve/silver_dex__curve_swaps.sql +++ b/models/silver/defi/dex/curve/silver_dex__curve_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_meta AS ( diff --git a/models/silver/defi/dex/dackieswap/silver_dex__dackie_pools.sql b/models/silver/defi/dex/dackieswap/silver_dex__dackie_pools.sql index 5c04cc5..1652f87 100644 --- a/models/silver/defi/dex/dackieswap/silver_dex__dackie_pools.sql +++ b/models/silver/defi/dex/dackieswap/silver_dex__dackie_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/dackieswap/silver_dex__dackie_swaps.sql b/models/silver/defi/dex/dackieswap/silver_dex__dackie_swaps.sql index beef6b6..0ab2b63 100644 --- a/models/silver/defi/dex/dackieswap/silver_dex__dackie_swaps.sql +++ b/models/silver/defi/dex/dackieswap/silver_dex__dackie_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 base_swaps AS ( diff --git a/models/silver/defi/dex/dexalot/silver_dex__dexalot_swaps.sql b/models/silver/defi/dex/dexalot/silver_dex__dexalot_swaps.sql index 7a956c5..eca0829 100644 --- a/models/silver/defi/dex/dexalot/silver_dex__dexalot_swaps.sql +++ b/models/silver/defi/dex/dexalot/silver_dex__dexalot_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 base_swaps AS ( diff --git a/models/silver/defi/dex/maverick/silver_dex__maverick_pools.sql b/models/silver/defi/dex/maverick/silver_dex__maverick_pools.sql index b57b210..43aaf48 100644 --- a/models/silver/defi/dex/maverick/silver_dex__maverick_pools.sql +++ b/models/silver/defi/dex/maverick/silver_dex__maverick_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/maverick/silver_dex__maverick_swaps.sql b/models/silver/defi/dex/maverick/silver_dex__maverick_swaps.sql index ae4aa8e..efd01cf 100644 --- a/models/silver/defi/dex/maverick/silver_dex__maverick_swaps.sql +++ b/models/silver/defi/dex/maverick/silver_dex__maverick_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/maverick/silver_dex__maverick_v2_pools.sql b/models/silver/defi/dex/maverick/silver_dex__maverick_v2_pools.sql index 8d8df19..f8452e9 100644 --- a/models/silver/defi/dex/maverick/silver_dex__maverick_v2_pools.sql +++ b/models/silver/defi/dex/maverick/silver_dex__maverick_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 created_pools AS ( diff --git a/models/silver/defi/dex/maverick/silver_dex__maverick_v2_swaps.sql b/models/silver/defi/dex/maverick/silver_dex__maverick_v2_swaps.sql index bf3883e..0015f79 100644 --- a/models/silver/defi/dex/maverick/silver_dex__maverick_v2_swaps.sql +++ b/models/silver/defi/dex/maverick/silver_dex__maverick_v2_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/pancakeswap/silver_dex__pancakeswap_v3_pools.sql b/models/silver/defi/dex/pancakeswap/silver_dex__pancakeswap_v3_pools.sql index 192b7ca..aff95d9 100644 --- a/models/silver/defi/dex/pancakeswap/silver_dex__pancakeswap_v3_pools.sql +++ b/models/silver/defi/dex/pancakeswap/silver_dex__pancakeswap_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 created_pools AS ( diff --git a/models/silver/defi/dex/pancakeswap/silver_dex__pancakeswap_v3_swaps.sql b/models/silver/defi/dex/pancakeswap/silver_dex__pancakeswap_v3_swaps.sql index 54c4eaa..8f3b736 100644 --- a/models/silver/defi/dex/pancakeswap/silver_dex__pancakeswap_v3_swaps.sql +++ b/models/silver/defi/dex/pancakeswap/silver_dex__pancakeswap_v3_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/silver_dex__complete_dex_liquidity_pools.sql b/models/silver/defi/dex/silver_dex__complete_dex_liquidity_pools.sql index d4969d1..b8a4f6f 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 e9a8b8c..cc7c6a2 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 univ2 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 5269295..1e8536e 100644 --- a/models/silver/defi/dex/sushi/silver_dex__sushi_pools.sql +++ b/models/silver/defi/dex/sushi/silver_dex__sushi_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/sushi/silver_dex__sushi_swaps.sql b/models/silver/defi/dex/sushi/silver_dex__sushi_swaps.sql index 1b66a3e..be0f282 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'] ) }} WITH base_swaps AS ( diff --git a/models/silver/defi/dex/swapbased/silver_dex__swapbased_pools.sql b/models/silver/defi/dex/swapbased/silver_dex__swapbased_pools.sql index 3eba048..a1e85a8 100644 --- a/models/silver/defi/dex/swapbased/silver_dex__swapbased_pools.sql +++ b/models/silver/defi/dex/swapbased/silver_dex__swapbased_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/swapbased/silver_dex__swapbased_swaps.sql b/models/silver/defi/dex/swapbased/silver_dex__swapbased_swaps.sql index 3f612fb..35c216e 100644 --- a/models/silver/defi/dex/swapbased/silver_dex__swapbased_swaps.sql +++ b/models/silver/defi/dex/swapbased/silver_dex__swapbased_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__univ2_pools.sql b/models/silver/defi/dex/uniswap/silver_dex__univ2_pools.sql index 66fd915..e53206c 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 4846c43..63ef5cf 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 34dc477..f4e2fe8 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 cf03f9f..6942d7a 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'] ) }} WITH base_swaps AS ( diff --git a/models/silver/defi/dex/voodoo/silver_dex__voodoo_swaps.sql b/models/silver/defi/dex/voodoo/silver_dex__voodoo_swaps.sql index 79a6798..4a9100a 100644 --- a/models/silver/defi/dex/voodoo/silver_dex__voodoo_swaps.sql +++ b/models/silver/defi/dex/voodoo/silver_dex__voodoo_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/woofi/silver_dex__woofi_swaps.sql b/models/silver/defi/dex/woofi/silver_dex__woofi_swaps.sql index ead7f5f..575d61f 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 efb7c3c..462eb5e 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 8943d0a..66c6fbd 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 bf67e34..77c7a6b 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 929427f..e229c61 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 b2bbd7b..452ddcf 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 e95f782..bd2160f 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 dff28e3..e20f860 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 dc1830d..5ecbc73 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 d52cf57..028a694 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 d5468aa..6dcac69 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 d5a4eb7..ff62c66 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 ca40bcc..5973492 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 bade662..df1e979 100644 --- a/models/silver/defi/lending/complete_lending/silver__complete_lending_withdraws.sql +++ b/models/silver/defi/lending/complete_lending/silver__complete_lending_withdraws.sql @@ -5,7 +5,7 @@ unique_key = ['block_number','platform'], cluster_by = ['block_timestamp::DATE','platform'], post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, origin_from_address, origin_to_address, origin_function_signature, contract_address, event_name, token_address, token_symbol, depositor, protocol_market), SUBSTRING(origin_function_signature, event_name, token_address, token_symbol, depositor, protocol_market)", - tags = ['reorg','curated','heal'] + tags = ['silver','defi','lending','curated','heal'] ) }} WITH aave AS ( diff --git a/models/silver/defi/lending/compound/silver__comp_asset_details.sql b/models/silver/defi/lending/compound/silver__comp_asset_details.sql index ed63132..8a5977c 100644 --- a/models/silver/defi/lending/compound/silver__comp_asset_details.sql +++ b/models/silver/defi/lending/compound/silver__comp_asset_details.sql @@ -1,5 +1,6 @@ {{ config( - materialized = 'view' + materialized = 'view', + tags = ['silver','defi','lending','curated'] ) }} SELECT diff --git a/models/silver/defi/lending/compound/silver__comp_borrows.sql b/models/silver/defi/lending/compound/silver__comp_borrows.sql index f6277cb..3acce39 100644 --- a/models/silver/defi/lending/compound/silver__comp_borrows.sql +++ b/models/silver/defi/lending/compound/silver__comp_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH comp_assets AS ( diff --git a/models/silver/defi/lending/compound/silver__comp_deposits.sql b/models/silver/defi/lending/compound/silver__comp_deposits.sql index 25f0a72..48a4a15 100644 --- a/models/silver/defi/lending/compound/silver__comp_deposits.sql +++ b/models/silver/defi/lending/compound/silver__comp_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH comp_assets AS ( diff --git a/models/silver/defi/lending/compound/silver__comp_liquidations.sql b/models/silver/defi/lending/compound/silver__comp_liquidations.sql index 2bbbc1b..700b0af 100644 --- a/models/silver/defi/lending/compound/silver__comp_liquidations.sql +++ b/models/silver/defi/lending/compound/silver__comp_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH comp_assets AS ( diff --git a/models/silver/defi/lending/compound/silver__comp_repayments.sql b/models/silver/defi/lending/compound/silver__comp_repayments.sql index 6d1269d..2ac4506 100644 --- a/models/silver/defi/lending/compound/silver__comp_repayments.sql +++ b/models/silver/defi/lending/compound/silver__comp_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH comp_assets AS ( diff --git a/models/silver/defi/lending/compound/silver__comp_withdraws.sql b/models/silver/defi/lending/compound/silver__comp_withdraws.sql index 89f5392..b0ee4a0 100644 --- a/models/silver/defi/lending/compound/silver__comp_withdraws.sql +++ b/models/silver/defi/lending/compound/silver__comp_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 comp_assets AS ( diff --git a/models/silver/defi/lending/granary/silver__granary_borrows.sql b/models/silver/defi/lending/granary/silver__granary_borrows.sql index 5bcb96f..ec7f5fe 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 0e21baf..51725a0 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 atoken_meta AS ( diff --git a/models/silver/defi/lending/granary/silver__granary_flashloans.sql b/models/silver/defi/lending/granary/silver__granary_flashloans.sql index ea53e68..324007d 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 atoken_meta AS ( diff --git a/models/silver/defi/lending/granary/silver__granary_liquidations.sql b/models/silver/defi/lending/granary/silver__granary_liquidations.sql index c71c59b..0010621 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 atoken_meta AS ( diff --git a/models/silver/defi/lending/granary/silver__granary_repayments.sql b/models/silver/defi/lending/granary/silver__granary_repayments.sql index 0156022..2eb5946 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 atoken_meta AS ( diff --git a/models/silver/defi/lending/granary/silver__granary_tokens.sql b/models/silver/defi/lending/granary/silver__granary_tokens.sql index e0c3de1..b5f9edd 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 08e83bc..a337c1a 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 atoken_meta AS ( diff --git a/models/silver/defi/lending/moonwell/silver__moonwell_asset_details.sql b/models/silver/defi/lending/moonwell/silver__moonwell_asset_details.sql index 4084fd8..889c594 100644 --- a/models/silver/defi/lending/moonwell/silver__moonwell_asset_details.sql +++ b/models/silver/defi/lending/moonwell/silver__moonwell_asset_details.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH contracts AS ( diff --git a/models/silver/defi/lending/moonwell/silver__moonwell_borrows.sql b/models/silver/defi/lending/moonwell/silver__moonwell_borrows.sql index 0380960..76fc75e 100644 --- a/models/silver/defi/lending/moonwell/silver__moonwell_borrows.sql +++ b/models/silver/defi/lending/moonwell/silver__moonwell_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/moonwell/silver__moonwell_deposits.sql b/models/silver/defi/lending/moonwell/silver__moonwell_deposits.sql index 1e8aee8..865ae22 100644 --- a/models/silver/defi/lending/moonwell/silver__moonwell_deposits.sql +++ b/models/silver/defi/lending/moonwell/silver__moonwell_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/moonwell/silver__moonwell_liquidations.sql b/models/silver/defi/lending/moonwell/silver__moonwell_liquidations.sql index 6a6d1ca..115862a 100644 --- a/models/silver/defi/lending/moonwell/silver__moonwell_liquidations.sql +++ b/models/silver/defi/lending/moonwell/silver__moonwell_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/moonwell/silver__moonwell_repayments.sql b/models/silver/defi/lending/moonwell/silver__moonwell_repayments.sql index c907fc7..d547df4 100644 --- a/models/silver/defi/lending/moonwell/silver__moonwell_repayments.sql +++ b/models/silver/defi/lending/moonwell/silver__moonwell_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/moonwell/silver__moonwell_withdraws.sql b/models/silver/defi/lending/moonwell/silver__moonwell_withdraws.sql index c29ccf4..bb5b38a 100644 --- a/models/silver/defi/lending/moonwell/silver__moonwell_withdraws.sql +++ b/models/silver/defi/lending/moonwell/silver__moonwell_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/morpho/silver__morpho_borrows.sql b/models/silver/defi/lending/morpho/silver__morpho_borrows.sql index ff2df96..fde8aaf 100644 --- a/models/silver/defi/lending/morpho/silver__morpho_borrows.sql +++ b/models/silver/defi/lending/morpho/silver__morpho_borrows.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH traces AS ( diff --git a/models/silver/defi/lending/morpho/silver__morpho_deposits.sql b/models/silver/defi/lending/morpho/silver__morpho_deposits.sql index 7e2ccef..4e6f725 100644 --- a/models/silver/defi/lending/morpho/silver__morpho_deposits.sql +++ b/models/silver/defi/lending/morpho/silver__morpho_deposits.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH traces AS ( diff --git a/models/silver/defi/lending/morpho/silver__morpho_flashloans.sql b/models/silver/defi/lending/morpho/silver__morpho_flashloans.sql index 30e6f52..9346df7 100644 --- a/models/silver/defi/lending/morpho/silver__morpho_flashloans.sql +++ b/models/silver/defi/lending/morpho/silver__morpho_flashloans.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH flashloan AS( diff --git a/models/silver/defi/lending/morpho/silver__morpho_liquidations.sql b/models/silver/defi/lending/morpho/silver__morpho_liquidations.sql index d06e6ec..b9b24e4 100644 --- a/models/silver/defi/lending/morpho/silver__morpho_liquidations.sql +++ b/models/silver/defi/lending/morpho/silver__morpho_liquidations.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH traces AS ( diff --git a/models/silver/defi/lending/morpho/silver__morpho_repayments.sql b/models/silver/defi/lending/morpho/silver__morpho_repayments.sql index 077271b..58d9ca0 100644 --- a/models/silver/defi/lending/morpho/silver__morpho_repayments.sql +++ b/models/silver/defi/lending/morpho/silver__morpho_repayments.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH traces AS ( diff --git a/models/silver/defi/lending/morpho/silver__morpho_withdraws.sql b/models/silver/defi/lending/morpho/silver__morpho_withdraws.sql index 409319e..66bcb1e 100644 --- a/models/silver/defi/lending/morpho/silver__morpho_withdraws.sql +++ b/models/silver/defi/lending/morpho/silver__morpho_withdraws.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['reorg','curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH traces AS ( diff --git a/models/silver/defi/lending/seamless/silver__seamless_borrows.sql b/models/silver/defi/lending/seamless/silver__seamless_borrows.sql index 1679ddb..5919599 100644 --- a/models/silver/defi/lending/seamless/silver__seamless_borrows.sql +++ b/models/silver/defi/lending/seamless/silver__seamless_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 seamless LendingPool contracts diff --git a/models/silver/defi/lending/seamless/silver__seamless_deposits.sql b/models/silver/defi/lending/seamless/silver__seamless_deposits.sql index 699adca..8c3746d 100644 --- a/models/silver/defi/lending/seamless/silver__seamless_deposits.sql +++ b/models/silver/defi/lending/seamless/silver__seamless_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 atoken_meta AS ( diff --git a/models/silver/defi/lending/seamless/silver__seamless_flashloans.sql b/models/silver/defi/lending/seamless/silver__seamless_flashloans.sql index 889bea8..712f97d 100644 --- a/models/silver/defi/lending/seamless/silver__seamless_flashloans.sql +++ b/models/silver/defi/lending/seamless/silver__seamless_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 atoken_meta AS ( diff --git a/models/silver/defi/lending/seamless/silver__seamless_liquidations.sql b/models/silver/defi/lending/seamless/silver__seamless_liquidations.sql index 5d61344..64ed717 100644 --- a/models/silver/defi/lending/seamless/silver__seamless_liquidations.sql +++ b/models/silver/defi/lending/seamless/silver__seamless_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 atoken_meta AS ( diff --git a/models/silver/defi/lending/seamless/silver__seamless_repayments.sql b/models/silver/defi/lending/seamless/silver__seamless_repayments.sql index a722713..f26d116 100644 --- a/models/silver/defi/lending/seamless/silver__seamless_repayments.sql +++ b/models/silver/defi/lending/seamless/silver__seamless_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 atoken_meta AS ( diff --git a/models/silver/defi/lending/seamless/silver__seamless_tokens.sql b/models/silver/defi/lending/seamless/silver__seamless_tokens.sql index 671305e..a77aa19 100644 --- a/models/silver/defi/lending/seamless/silver__seamless_tokens.sql +++ b/models/silver/defi/lending/seamless/silver__seamless_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/seamless/silver__seamless_withdraws.sql b/models/silver/defi/lending/seamless/silver__seamless_withdraws.sql index 0206886..146fdda 100644 --- a/models/silver/defi/lending/seamless/silver__seamless_withdraws.sql +++ b/models/silver/defi/lending/seamless/silver__seamless_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 atoken_meta 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 4f69fa0..ed9a00a 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 contracts AS ( diff --git a/models/silver/defi/lending/sonne/silver__sonne_borrows.sql b/models/silver/defi/lending/sonne/silver__sonne_borrows.sql index b2d8f3d..a582ce0 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 a2d383c..e19f0cc 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 c58de4d..7c3fb83 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'] ) }} -- pull all token addresses and corresponding name -- add the collateral liquidated here diff --git a/models/silver/defi/lending/sonne/silver__sonne_repayments.sql b/models/silver/defi/lending/sonne/silver__sonne_repayments.sql index 607bb74..895b1ef 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 969222e..54a7727 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/ethereum/silver__state_hashes.sql b/models/silver/ethereum/silver__state_hashes.sql index 771885c..d6049f3 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 ( diff --git a/models/silver/labels/silver__labels.sql b/models/silver/labels/silver__labels.sql deleted file mode 100644 index ed35013..0000000 --- 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 2b2b80b..bdf379c 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 d71f9be..10dc670 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(origin_function_signature, event_type, platform_address, platform_exchange_version, seller_address, buyer_address, nft_address, project_name, currency_address, currency_symbol), SUBSTRING(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)", - 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 cdbf764..63fbac7 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 ( @@ -201,7 +201,7 @@ tx_data AS ( tx_fee, input_data FROM - {{ ref('silver__transactions') }} + {{ ref('core__fact_transactions') }} WHERE block_timestamp :: DATE >= ( SELECT 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 f733b31..3cb2c40 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 ( @@ -1870,7 +1870,7 @@ tx_data AS ( tx_fee, input_data FROM - {{ ref('silver__transactions') }} + {{ ref('core__fact_transactions') }} WHERE block_timestamp :: DATE >= '2023-07-01' AND tx_hash IN ( 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 ad9da68..bbb9af2 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 ( @@ -1868,7 +1868,7 @@ tx_data AS ( tx_fee, input_data FROM - {{ ref('silver__transactions') }} + {{ ref('core__fact_transactions') }} WHERE block_timestamp :: DATE >= '2024-03-15' AND tx_hash IN ( diff --git a/models/silver/nft/sales/silver__zeroex_sales.sql b/models/silver/nft/sales/silver__zeroex_sales.sql index f19af67..209a7ad 100644 --- a/models/silver/nft/sales/silver__zeroex_sales.sql +++ b/models/silver/nft/sales/silver__zeroex_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH raw_logs AS ( @@ -315,7 +315,7 @@ tx_data AS ( tx_fee, input_data FROM - {{ ref('silver__transactions') }} + {{ ref('core__fact_transactions') }} WHERE block_timestamp :: DATE >= '2023-08-01' AND tx_hash IN ( diff --git a/models/silver/nft/silver__nft_transfers.sql b/models/silver/nft/silver__nft_transfers.sql index fb5ffe9..d78fd65 100644 --- a/models/silver/nft/silver__nft_transfers.sql +++ b/models/silver/nft/silver__nft_transfers.sql @@ -4,7 +4,7 @@ unique_key = "block_number", cluster_by = ['block_timestamp::DATE', '_inserted_timestamp::DATE'], 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'] + tags = ['silver','nft','curated', 'heal'] ) }} WITH base AS ( 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 deb7552..0000000 --- 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', - 'base-models', - 'dbt_run_overflowed_traces2.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/overflow/silver__overflowed_traces.sql b/models/silver/overflow/silver__overflowed_traces.sql deleted file mode 100644 index e1378a0..0000000 --- a/models/silver/overflow/silver__overflowed_traces.sql +++ /dev/null @@ -1,119 +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', - 'gasUsed', - 'gas', - 'type', - 'to', - 'from', - 'value', - 'input', - 'error', - 'output', - 'revertReason', - 'txHash', - 'time', - 'result.txHash', - 'result.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/prices/silver__complete_native_asset_metadata.sql b/models/silver/prices/silver__complete_native_asset_metadata.sql deleted file mode 100644 index a81b6a6..0000000 --- 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 1c1fdf1..0000000 --- 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 ec99925..0000000 --- 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 bb72433..0000000 --- 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 b981c9c..0000000 --- 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 8fa56fd..0000000 --- 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 a8be434..0000000 --- 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 8db23c7..0000000 --- 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 f5339b8..0000000 --- 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 3eea590..0000000 --- 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 f8e6442..0000000 --- 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 d2ac57f..0000000 --- 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 6cb6a16..97bd5a2 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 843fce6..29219d3 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 f6c5ff9..131e3bd 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 2c0df30..c30acee 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 146fb2e..387df6c 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 24c2751..3292ab1 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 74f285e..2c9e5ab 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'] ) }} WITH registry_evt AS ( diff --git a/models/silver/protocols/vertex/silver__vertex_account_stats.sql b/models/silver/protocols/vertex/silver__vertex_account_stats.sql deleted file mode 100644 index 6234287..0000000 --- a/models/silver/protocols/vertex/silver__vertex_account_stats.sql +++ /dev/null @@ -1,194 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'subaccount', - tags = 'curated' -) }} - -WITH - -{% if is_incremental() %} -new_subaccount_actions AS ( - - SELECT - DISTINCT(subaccount) - FROM - {{ ref('silver__vertex_perps') }} - WHERE - _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '12 hours' - FROM - {{ this }} - ) - UNION - SELECT - DISTINCT(subaccount) - FROM - {{ ref('silver__vertex_liquidations') }} - WHERE - _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '12 hours' - FROM - {{ this }} - ) - UNION - SELECT - DISTINCT(subaccount) - FROM - {{this}} - WHERE - total_usd_volume_24h > 0 -), -{% endif %} - -trades_union AS ( - SELECT - subaccount, - trader, - digest, - 'perp' AS product_type, - trade_type, - block_timestamp, - amount, - amount_usd, - fee_amount, - base_delta_amount, - quote_delta_amount, - _inserted_timestamp - FROM - {{ ref('silver__vertex_perps') }} - -{% if is_incremental() %} -WHERE - subaccount IN ( - SELECT - subaccount - FROM - new_subaccount_actions - ) -{% endif %} -), -liquidations AS ( - SELECT - trader, - subaccount, - SUM(amount) AS total_liquidation_amount, - SUM(amount_quote) AS total_liquidation_amount_quote, - COUNT(*) AS liquidation_count - FROM - {{ ref('silver__vertex_liquidations') }} - -{% if is_incremental() %} -WHERE - subaccount IN ( - SELECT - subaccount - FROM - new_subaccount_actions - ) -{% endif %} -GROUP BY - 1, - 2 -), -FINAL AS ( - SELECT - t.subaccount, - t.trader, - MIN( - t.block_timestamp - ) AS first_trade_timestamp, - MAX( - t.block_timestamp - ) AS last_trade_timestamp, - DATEDIFF( - 'day', - first_trade_timestamp, - last_trade_timestamp - ) AS account_age, - COUNT(DISTINCT(digest)) AS trade_count, - COUNT(DISTINCT(CASE - WHEN t.block_timestamp >= SYSDATE() - INTERVAL '24 HOURS' - THEN digest - END)) AS trade_count_24h, - SUM( - CASE - WHEN product_type = 'perp' THEN + 1 - ELSE 0 - END - ) AS perp_trade_count, - SUM( - CASE - WHEN product_type = 'spot' THEN + 1 - ELSE 0 - END - ) AS spot_trade_count, - SUM( - CASE - WHEN trade_type = 'buy/long' THEN + 1 - ELSE 0 - END - ) AS long_count, - SUM( - CASE - WHEN trade_type = 'sell/short' THEN + 1 - ELSE 0 - END - ) AS short_count, - SUM(amount_usd) AS total_usd_volume, - SUM( - CASE - WHEN t.block_timestamp >= SYSDATE() - INTERVAL '24 HOURS' THEN amount_usd - ELSE 0 - END - ) AS total_usd_volume_24h, - AVG(amount_usd) AS avg_usd_trade_size, - SUM(fee_amount) AS total_fee_amount, - SUM(base_delta_amount) AS total_base_delta_amount, - SUM(quote_delta_amount) AS total_quote_delta_amount, - MAX( - l.total_liquidation_amount - ) AS total_liquidation_amount, - MAX( - l.total_liquidation_amount_quote - ) AS total_liquidation_amount_quote, - MAX(liquidation_count) AS total_liquidation_count, - MAX( - t._inserted_timestamp - ) AS _inserted_timestamp - FROM - trades_union t - LEFT JOIN liquidations l - ON t.subaccount = l.subaccount - GROUP BY - 1, - 2 -) -SELECT - f.*, - {{ dbt_utils.generate_surrogate_key( - ['f.subaccount'] - ) }} AS vertex_account_id, - COALESCE( - {% if is_incremental() %} - a.inserted_timestamp, - {% endif %} - SYSDATE(), - NULL - ) AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - FINAL f -{% if is_incremental() %} -LEFT JOIN - {{this}} a -ON - a.subaccount = f.subaccount -{% endif %} \ No newline at end of file diff --git a/models/silver/protocols/vertex/silver__vertex_account_stats.yml b/models/silver/protocols/vertex/silver__vertex_account_stats.yml deleted file mode 100644 index 937589e..0000000 --- a/models/silver/protocols/vertex/silver__vertex_account_stats.yml +++ /dev/null @@ -1,112 +0,0 @@ -version: 2 -models: - - name: silver__vertex_account_stats - columns: - - name: SUBACCOUNT - tests: - - not_null - - name: TRADER - tests: - - not_null - - name: FIRST_TRADE_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: LAST_TRADE_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - name: ACCOUNT_AGE - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRADE_COUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: PERP_TRADES - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: SPOT_TRADES - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: LONG_COUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: SHORT_COUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TOTAL_USD_VOLUME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TOTAL_FEE_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TOTAL_BASE_DELTA_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TOTAL_QUOTE_DELTA_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TOTAL_LIQUIDATION_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TOTAL_LIQUIDATION_AMOUNT_QUOTE - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TOTAL_LIQUIDATION_AMOUNT_COUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: MODIFIED_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 diff --git a/models/silver/protocols/vertex/silver__vertex_collateral.sql b/models/silver/protocols/vertex/silver__vertex_collateral.sql deleted file mode 100644 index c6a6495..0000000 --- a/models/silver/protocols/vertex/silver__vertex_collateral.sql +++ /dev/null @@ -1,133 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = '_log_id', - cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] -) }} - -WITH logs_pull AS ( - - SELECT - block_number, - block_timestamp, - tx_hash, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address, - 'ModifyCollateral' AS event_name, - event_index, - regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}') AS segmented_data, - LEFT( - topics [1] :: STRING, - 42 - ) AS trader, - topics [1] :: STRING AS subaccount, - utils.udf_hex_to_int( - 's2c', - segmented_data [0] :: STRING - ) :: INT AS amount, - utils.udf_hex_to_int( - segmented_data [1] :: STRING - ) :: INT AS product_id, - _log_id, - _inserted_timestamp - FROM - {{ ref('silver__logs') }} - WHERE - topics [0] :: STRING = '0xfe53084a731040f869d38b1dcd00fbbdbc14e10d7d739160559d77f5bc80cf05' - AND contract_address = lower('0xE46Cb729F92D287F6459bDA6899434E22eCC48AE') --clearing house - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '36 hours' - FROM - {{ this }} -) -{% endif %} -), -product_id_join AS ( - SELECT - l.block_number, - l.block_timestamp, - l.tx_hash, - l.contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - CASE - WHEN amount < 0 THEN 'withdraw' - WHEN amount > 0 THEN 'deposit' - WHEN amount = 0 THEN 'no-change' - END AS modification_type, - trader, - subaccount, - l.product_id, - p.symbol, - CASE - WHEN p.symbol = 'USDC' THEN '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913' - WHEN p.symbol = 'BENJI' THEN '0xbc45647ea894030a4e9801ec03479739fa2485f0' - WHEN p.symbol = 'WETH' THEN '0x4300000000000000000000000000000000000006' - WHEN p.symbol = 'ETH' THEN '0x4300000000000000000000000000000000000006' - WHEN p.symbol = 'TRUMPWIN' THEN '0xe215d028551d1721c6b61675aec501b1224bd0a1' - WHEN p.symbol = 'HARRISWIN' THEN '0xfbac82a384178ca5dd6df72965d0e65b1b8a028f' - END AS token_address, - amount, - l._log_id, - l._inserted_timestamp - FROM - logs_pull l - LEFT JOIN {{ ref('silver__vertex_dim_products') }} - p - ON l.product_id = p.product_id -), -FINAL AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - A.contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - modification_type, - trader, - subaccount, - product_id, - A.symbol, - A.token_address, - amount AS amount_unadj, - amount / pow(10, 18) AS amount, - (amount / pow(10, 18) * p.price) :: FLOAT AS amount_usd, - A._log_id, - A._inserted_timestamp - FROM - product_id_join A - LEFT JOIN {{ ref('price__ez_prices_hourly') }} - p - ON A.token_address = p.token_address - AND DATE_TRUNC( - 'hour', - block_timestamp - ) = p.hour - LEFT JOIN {{ ref('silver__contracts') }} C - ON A.token_address = C.contract_address -) -SELECT - *, - {{ dbt_utils.generate_surrogate_key(['tx_hash','event_index']) }} AS vertex_collateral_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - FINAL qualify ROW_NUMBER() over( - PARTITION BY _log_id - ORDER BY - _inserted_timestamp DESC - ) = 1 diff --git a/models/silver/protocols/vertex/silver__vertex_collateral.yml b/models/silver/protocols/vertex/silver__vertex_collateral.yml deleted file mode 100644 index 7145c7b..0000000 --- a/models/silver/protocols/vertex/silver__vertex_collateral.yml +++ /dev/null @@ -1,104 +0,0 @@ -version: 2 -models: - - name: silver__vertex_collateral - 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: 3 - - 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: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: EVENT_NAME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - name: EVENT_INDEX - 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]+ - - not_null - - name: MODIFICATION_TYPE - tests: - - not_null - - name: TRADER - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: SUBACCOUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: PRODUCT_ID - tests: - - not_null - - name: SYMBOL - tests: - - not_null - - name: TOKEN_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: AMOUNT_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: AMOUNT_USD - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: _LOG_ID - tests: - - not_null - - diff --git a/models/silver/protocols/vertex/silver__vertex_dim_products.sql b/models/silver/protocols/vertex/silver__vertex_dim_products.sql deleted file mode 100644 index 9716e4b..0000000 --- a/models/silver/protocols/vertex/silver__vertex_dim_products.sql +++ /dev/null @@ -1,136 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'product_id', - cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] -) }} - -WITH logs_pull AS ( - - SELECT - topics, - contract_address, - DATA, - tx_hash, - block_number, - block_timestamp, - _inserted_timestamp, - _log_id - FROM - {{ ref('silver__logs') }} - WHERE - topics [0] :: STRING = '0x3286b0394bf1350245290b7226c92ed186bd716f28938e62dbb895298f018172' - AND - block_timestamp::DATE >= '2024-07-01' --LAUNCH MONTH -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '12 hours' - FROM - {{ this }} -) -AND _inserted_timestamp >= SYSDATE() - INTERVAL '7 day' -{% endif %} -), -new_prod AS ( - SELECT - regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}') AS segmented_data, - utils.udf_hex_to_int( - 's2c', - segmented_data [0] :: STRING - ) :: STRING AS product_id, - tx_hash, - block_number, - block_timestamp, - _inserted_timestamp, - _log_id - FROM - logs_pull - WHERE - topics [0] :: STRING = '0x3286b0394bf1350245290b7226c92ed186bd716f28938e62dbb895298f018172' -), -api_pull AS ( - SELECT - PARSE_JSON( - live.udf_api( - 'https://gateway.base-prod.vertexprotocol.com/api/v2/assets' - ) - ) :data AS response -), -api_lateral_flatten AS ( - SELECT - r.value - FROM - api_pull, - LATERAL FLATTEN (response) AS r -), -product_metadata AS ( - SELECT - VALUE :product_id AS product_id, - VALUE :ticker_id AS ticker_id, - VALUE :symbol AS symbol, - VALUE :name AS NAME, - VALUE :market_type AS market_type, - VALUE :taker_fee AS taker_fee, - VALUE :maker_fee AS maker_fee - FROM - api_lateral_flatten -), -FINAL AS ( - SELECT - l.block_number, - l.block_timestamp, - l.tx_hash, - l.product_id, - CASE - WHEN l.product_id % 2 = 0 THEN 'perp' - ELSE 'spot' - END AS product_type, - CASE - WHEN l.product_id = 0 THEN 'USDC' - ELSE p.ticker_id :: STRING - END AS ticker_id, - p.symbol :: STRING AS symbol, - p.name :: STRING AS NAME, - CASE - WHEN l.product_id = 0 THEN NULL - ELSE FLOOR((l.product_id - 1) / 2) - END AS health_group, - CASE - WHEN SPLIT( - p.symbol, - '-' - ) [0] = 'WBTC' THEN 'BTC' - WHEN SPLIT( - p.symbol, - '-' - ) [0] = 'WETH' THEN 'ETH' - ELSE SPLIT( - p.symbol, - '-' - ) [0] - END AS health_group_symbol, - p.taker_fee, - p.maker_fee, - _inserted_timestamp, - _log_id - FROM - new_prod l - LEFT JOIN product_metadata p - ON l.product_id = p.product_id -) -SELECT - *, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash','product_id'] - ) }} AS vertex_products_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - FINAL qualify(ROW_NUMBER() over(PARTITION BY product_id -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/protocols/vertex/silver__vertex_dim_products.yml b/models/silver/protocols/vertex/silver__vertex_dim_products.yml deleted file mode 100644 index 112912f..0000000 --- a/models/silver/protocols/vertex/silver__vertex_dim_products.yml +++ /dev/null @@ -1,42 +0,0 @@ -version: 2 -models: - - name: silver__vertex_dim_products - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - PRODUCT_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_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: PRODUCT_TYPE - tests: - - not_null - - name: TICKER_ID - tests: - - not_null - - name: SYMBOL - tests: - - not_null - - name: NAME - tests: - - not_null - - name: _LOG_ID - tests: - - not_null \ No newline at end of file diff --git a/models/silver/protocols/vertex/silver__vertex_edge_trades.sql b/models/silver/protocols/vertex/silver__vertex_edge_trades.sql deleted file mode 100644 index 6e192ac..0000000 --- a/models/silver/protocols/vertex/silver__vertex_edge_trades.sql +++ /dev/null @@ -1,203 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = '_log_id', - cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] -) }} - -WITH perp_trades AS ( - - SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - symbol, - product_id, - digest, - trader, - subaccount, - trade_type, - expiration_raw, - exp_binary, - order_type_raw, - order_type, - market_reduce_flag, - expiration, - nonce, - is_taker, - price_amount_unadj, - price_amount, - amount_unadj, - amount, - amount_usd, - fee_amount_unadj, - fee_amount, - base_delta_amount_unadj, - base_delta_amount, - quote_delta_amount_unadj, - quote_delta_amount, - _log_id, - _inserted_timestamp, - vertex_perps_id, - inserted_timestamp, - modified_timestamp, - _invocation_id - FROM - {{ ref('silver__vertex_perps') }} - p - -{% if is_incremental() %} -WHERE - _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '12 hours' - FROM - {{ this }} -) -{% endif %} -), -edge_trades AS ( - SELECT - event_index - 1 AS trader_event_before, - event_index + 1 AS trader_event_after,* - FROM - perp_trades - WHERE - trader = '0x0000000000000000000000000000000000000000' -), -FINAL AS ( - SELECT - e.block_number, - e.block_timestamp, - e.tx_hash, - e.event_index AS edge_event_index, - e.trader_event_before AS user_event_index, - e.digest AS edge_digest, - p.digest AS user_digest, - p.trader, - p.subaccount, - p.symbol, - e.order_type AS edge_order_type, - p.order_type AS user_order_type, - e.is_taker AS edge_is_taker, - p.is_taker AS user_is_taker, - e.trade_type AS edge_trade_type, - p.trade_type AS user_trade_type, - e.price_amount_unadj AS edge_price_amount_unadj, - p.price_amount_unadj AS user_price_amount_unadj, - e.price_amount AS edge_price_amount, - p.price_amount AS user_price_amount, - e.amount_unadj AS edge_amount_unadj, - p.amount_unadj AS user_amount_unadj, - e.amount AS edge_amount, - p.amount AS user_amount, - e.amount_usd AS edge_amount_usd, - p.amount_usd AS user_amount_usd, - e.fee_amount_unadj AS edge_fee_amount_unadj, - p.fee_amount_unadj AS user_fee_amount_unadj, - e.fee_amount AS edge_fee_amount, - p.fee_amount AS user_fee_amount, - e.base_delta_amount_unadj AS edge_base_delta_amount_unadj, - p.base_delta_amount_unadj AS user_base_delta_amount_unadj, - e.base_delta_amount AS edge_base_delta_amount, - p.base_delta_amount AS user_base_delta_amount, - e.quote_delta_amount_unadj AS edge_quote_delta_amount_unadj, - p.quote_delta_amount_unadj AS user_quote_delta_amount_unadj, - e.quote_delta_amount AS edge_quote_delta_amount, - p.quote_delta_amount AS user_quote_delta_amount, - e._log_id, - e._inserted_timestamp - FROM - edge_trades e - LEFT JOIN ( - SELECT - * - FROM - perp_trades - WHERE - trader <> '0x0000000000000000000000000000000000000000' - ) p - ON e.tx_hash = p.tx_hash - AND e.trader_event_before = p.event_index - AND e.product_id = p.product_id - WHERE - user_digest IS NOT NULL - UNION ALL - SELECT - e.block_number, - e.block_timestamp, - e.tx_hash, - e.event_index AS edge_event_index, - e.trader_event_after AS user_event_index, - e.digest AS edge_digest, - p.digest AS user_digest, - p.trader, - p.subaccount, - p.symbol, - e.order_type AS edge_order_type, - p.order_type AS user_order_type, - e.is_taker AS edge_is_taker, - p.is_taker AS user_is_taker, - e.trade_type AS edge_trade_type, - p.trade_type AS user_trade_type, - e.price_amount_unadj AS edge_price_amount_unadj, - p.price_amount_unadj AS user_price_amount_unadj, - e.price_amount AS edge_price_amount, - p.price_amount AS user_price_amount, - e.amount_unadj AS edge_amount_unadj, - p.amount_unadj AS user_amount_unadj, - e.amount AS edge_amount, - p.amount AS user_amount, - e.amount_usd AS edge_amount_usd, - p.amount_usd AS user_amount_usd, - e.fee_amount_unadj AS edge_fee_amount_unadj, - p.fee_amount_unadj AS user_fee_amount_unadj, - e.fee_amount AS edge_fee_amount, - p.fee_amount AS user_fee_amount, - e.base_delta_amount_unadj AS edge_base_delta_amount_unadj, - p.base_delta_amount_unadj AS user_base_delta_amount_unadj, - e.base_delta_amount AS edge_base_delta_amount, - p.base_delta_amount AS user_base_delta_amount, - e.quote_delta_amount_unadj AS edge_quote_delta_amount_unadj, - p.quote_delta_amount_unadj AS user_quote_delta_amount_unadj, - e.quote_delta_amount AS edge_quote_delta_amount, - p.quote_delta_amount AS user_quote_delta_amount, - e._log_id, - e._inserted_timestamp - FROM - edge_trades e - LEFT JOIN ( - SELECT - * - FROM - perp_trades - WHERE - trader <> '0x0000000000000000000000000000000000000000' - ) p - ON e.tx_hash = p.tx_hash - AND e.trader_event_after = p.event_index - AND e.product_id = p.product_id - WHERE - user_digest IS NOT NULL -) -SELECT - *, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash','edge_event_index'] - ) }} AS vertex_edge_trade_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - FINAL qualify(ROW_NUMBER() over(PARTITION BY _log_id -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/protocols/vertex/silver__vertex_edge_trades.yml b/models/silver/protocols/vertex/silver__vertex_edge_trades.yml deleted file mode 100644 index 0adb590..0000000 --- a/models/silver/protocols/vertex/silver__vertex_edge_trades.yml +++ /dev/null @@ -1,170 +0,0 @@ -version: 2 -models: - - name: silver__vertex_edge_trades - 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: 14 - - 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: EDGE_EVENT_INDEX - tests: - - not_null - - name: USER_EVENT_INDEX - tests: - - not_null - - name: TRADER - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: SYMBOL - tests: - - not_null - - name: EDGE_ORDER_TYPE - tests: - - not_null - - name: USER_ORDER_TYPE - tests: - - not_null - - name: EDGE_IS_TAKER - tests: - - not_null - - name: USER_IS_TAKER - tests: - - not_null - - name: EDGE_TRADE_TYPE - tests: - - not_null - - name: USER_TRADE_TYPE - tests: - - not_null - - name: EDGE_PRICE_AMOUNT_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: USER_PRICE_AMOUNT_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EDGE_PRICE_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: USER_PRICE_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EDGE_AMOUNT_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: USER_AMOUNT_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EDGE_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: USER_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EDGE_AMOUNT_USD - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: USER_AMOUNT_USD - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EDGE_QUOTE_DELTA_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: USER_QUOTE_DELTA_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EDGE_QUOTE_DELTA - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: USER_QUOTE_DELTA - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EDGE_BASE_DELTA_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: USER_BASE_DELTA_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: EDGE_BASE_DELTA - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: USER_BASE_DELTA - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT \ No newline at end of file diff --git a/models/silver/protocols/vertex/silver__vertex_liquidations.sql b/models/silver/protocols/vertex/silver__vertex_liquidations.sql deleted file mode 100644 index 56f8437..0000000 --- a/models/silver/protocols/vertex/silver__vertex_liquidations.sql +++ /dev/null @@ -1,190 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = '_log_id', - cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] -) }} - -WITH health_groups AS ( - - SELECT - product_id, - health_group, - health_group_symbol - FROM - {{ ref('silver__vertex_dim_products') }} - GROUP BY - ALL -), -logs AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - origin_from_address, - origin_to_address, - origin_function_signature, - tx_status, - contract_address, - block_hash, - data, - event_index, - event_removed, - topics, - _inserted_timestamp, - _log_id, - is_pending, - logs_id, - inserted_timestamp, - modified_timestamp, - _invocation_id - FROM - {{ ref('silver__logs') }} - WHERE - topics [0] :: STRING = '0x494f937f5cc892f798248aa831acfb4ad7c4bf35edd8498c5fb431ce1e38b035' - AND contract_address = LOWER('0xE46Cb729F92D287F6459bDA6899434E22eCC48AE') - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '12 hours' - FROM - {{ this }} -) -AND _inserted_timestamp >= SYSDATE() - INTERVAL '7 day' -{% endif %} -), -logs_pull_v2 AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address, - 'Liquidation' AS event_name, - event_index, - regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}') AS segmented_data, - utils.udf_hex_to_int( - segmented_data [0] :: STRING - ) :: INT AS product_id, - topics [1] :: STRING AS digest, - LEFT( - topics [2] :: STRING, - 42 - ) AS trader, - topics [2] :: STRING AS subaccount, - utils.udf_hex_to_int( - 's2c', - segmented_data [2] :: STRING - ) :: INT AS amount, - utils.udf_hex_to_int( - 's2c', - segmented_data [3] :: STRING - ) :: INT AS amount_quote, - utils.udf_hex_to_int( - segmented_data [1] :: STRING - ) AS is_encoded_spread, - _log_id, - _inserted_timestamp - FROM - logs - WHERE - topics [0] :: STRING = '0x494f937f5cc892f798248aa831acfb4ad7c4bf35edd8498c5fb431ce1e38b035' - AND contract_address = LOWER('0xE46Cb729F92D287F6459bDA6899434E22eCC48AE') -), -v2_vertex_decode AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - origin_function_signature, - origin_from_address, - origin_to_address, - contract_address, - event_name, - event_index, - is_encoded_spread, - digest, - trader, - subaccount, - amount, - amount_quote, - CASE - WHEN is_encoded_spread = 1 THEN utils.udf_int_to_binary(product_id) - ELSE NULL - END AS bin_product_ids, - CASE - WHEN is_encoded_spread = 1 THEN ARRAY_CONSTRUCT( - utils.udf_binary_to_int(SUBSTR(bin_product_ids, -16)), - utils.udf_binary_to_int( - SUBSTR( - bin_product_ids, - 1, - GREATEST(len(bin_product_ids) - 16, 1)) - ) - ) - ELSE NULL - END AS decoded_spread_product_ids, - CASE - WHEN is_encoded_spread = 1 THEN decoded_spread_product_ids [0] :: STRING - ELSE product_id - END AS product_id, - _log_id, - _inserted_timestamp - FROM - logs_pull_v2 - ), -FINAL AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - digest, - trader, - subaccount, - l.product_id, - p.health_group, - p.health_group_symbol, - amount AS amount_unadj, - amount / pow( - 10, - 18 - ) AS amount, - amount_quote AS amount_quote_unadj, - amount_quote / pow( - 10, - 18 - ) AS amount_quote, - CASE - WHEN is_encoded_spread = 1 THEN TRUE - ELSE FALSE - END AS is_encoded_spread, - decoded_spread_product_ids AS spread_product_ids, - _log_id, - _inserted_timestamp - FROM - v2_vertex_decode l - LEFT JOIN health_groups p - ON l.product_id = p.product_id -) - SELECT - *, - {{ dbt_utils.generate_surrogate_key(['tx_hash','event_index']) }} AS vertex_liquidation_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id - FROM - FINAL qualify ROW_NUMBER() over( - PARTITION BY _log_id - ORDER BY - _inserted_timestamp DESC - ) = 1 diff --git a/models/silver/protocols/vertex/silver__vertex_liquidations.yml b/models/silver/protocols/vertex/silver__vertex_liquidations.yml deleted file mode 100644 index 9d9a878..0000000 --- a/models/silver/protocols/vertex/silver__vertex_liquidations.yml +++ /dev/null @@ -1,103 +0,0 @@ -version: 2 -models: - - name: silver__vertex_liquidations - 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_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: 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: EVENT_NAME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - not_null - - name: DIGEST - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TRADER - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: SUBACCOUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: PRODUCT_ID - tests: - - not_null - - name: HEALTH_GROUP - tests: - - not_null - - name: AMOUNT_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: AMOUNT_QUOTE_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: AMOUNT_QUOTE - tests: - - 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/protocols/vertex/silver__vertex_market_depth.sql b/models/silver/protocols/vertex/silver__vertex_market_depth.sql deleted file mode 100644 index 9987017..0000000 --- a/models/silver/protocols/vertex/silver__vertex_market_depth.sql +++ /dev/null @@ -1,105 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'merge', - full_refresh = false, - unique_key = ['product_id','hour','price'], - cluster_by = ['hour::DATE'], - tags = 'curated' -) }} - -WITH market_depth AS ({% for item in range(55) %} - - SELECT - t.ticker_id, t.product_id, DATE_TRUNC('hour', TRY_TO_TIMESTAMP(t.timestamp)) AS HOUR, 'asks' AS orderbook_side, A.value [0] :: FLOAT AS price, A.value [1] :: FLOAT AS volume, SYSDATE() AS _inserted_timestamp - FROM - ( - SELECT - response :ticker_id AS ticker_id, response :timestamp :: STRING AS TIMESTAMP, response :asks AS asks, response :bids AS bids, product_id - FROM - ( - SELECT - PARSE_JSON(live.udf_api(CONCAT('https://gateway.base-prod.vertexprotocol.com/v2/orderbook?ticker_id=', ticker_id, '&depth=1000000'))) :data AS response, product_id - FROM - ( - SELECT - ROW_NUMBER() over ( - ORDER BY - product_id) AS row_num, product_id, ticker_id - FROM - {{ ref('silver__vertex_dim_products') }} - WHERE - product_id > 0 - ORDER BY - product_id) - WHERE - row_num = {{ item + 1 }})) t, LATERAL FLATTEN(input => t.asks) A - UNION ALL - SELECT - t.ticker_id, t.product_id, DATE_TRUNC('hour', TRY_TO_TIMESTAMP(t.timestamp)) AS HOUR, 'bids' AS orderbook_side, A.value [0] :: FLOAT AS price, A.value [1] :: FLOAT AS volume, SYSDATE() AS _inserted_timestamp - FROM - ( - SELECT - response :ticker_id AS ticker_id, response :timestamp :: STRING AS TIMESTAMP, response :asks AS asks, response :bids AS bids, product_id - FROM - ( - SELECT - PARSE_JSON(live.udf_api(CONCAT('https://gateway.base-prod.vertexprotocol.com/v2/orderbook?ticker_id=', ticker_id, '&depth=1000000'))) :data AS response, product_id - FROM - ( - SELECT - ROW_NUMBER() over ( - ORDER BY - product_id) AS row_num, product_id, ticker_id - FROM - {{ ref('silver__vertex_dim_products') }} - WHERE - product_id > 0 - ORDER BY - product_id) - WHERE - row_num = {{ item + 1 }})) t, LATERAL FLATTEN(input => t.bids) A {% if not loop.last %} - UNION ALL - {% endif %} - {% endfor %}), - FINAL AS ( - SELECT - ticker_id :: STRING AS ticker_id, - product_id, - HOUR, - orderbook_side, - price, - ROUND( - price, - 2 - ) AS round_price_0_01, - ROUND( - price, - 1 - ) AS round_price_0_1, - ROUND( - price, - 0 - ) AS round_price_1, - ROUND( - price, - -1 - ) AS round_price_10, - ROUND( - price, - -2 - ) AS round_price_100, - volume, - _inserted_timestamp - FROM - market_depth - ) -SELECT - *, - {{ dbt_utils.generate_surrogate_key( - ['product_id','hour','price'] - ) }} AS vertex_market_depth_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - FINAL diff --git a/models/silver/protocols/vertex/silver__vertex_market_depth.yml b/models/silver/protocols/vertex/silver__vertex_market_depth.yml deleted file mode 100644 index 815e0fc..0000000 --- a/models/silver/protocols/vertex/silver__vertex_market_depth.yml +++ /dev/null @@ -1,69 +0,0 @@ -version: 2 -models: - - name: silver__vertex_market_depth - tests: - - vertex_missing_products: - filter: product_id <> 0 AND (product_type = 'perp' and taker_fee is NULL) - columns: - - name: TICKER_ID - tests: - - not_null - - name: PRODUCT_ID - tests: - - not_null - - name: HOUR - 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: ORDERBOOK_SIDE - tests: - - not_null - - name: PRICE - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: ROUND_PRICE_0_01 - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: ROUND_PRICE_0_1 - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: ROUND_PRICE_1 - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: ROUND_PRICE_10 - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: ROUND_PRICE_100 - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: VOLUME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - diff --git a/models/silver/protocols/vertex/silver__vertex_market_stats.sql b/models/silver/protocols/vertex/silver__vertex_market_stats.sql deleted file mode 100644 index e60b0e4..0000000 --- a/models/silver/protocols/vertex/silver__vertex_market_stats.sql +++ /dev/null @@ -1,191 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'merge', - unique_key = ['ticker_id','hour'], - cluster_by = ['HOUR::DATE'], - tags = 'curated' -) }} - -WITH api_pull AS ( - - SELECT - PARSE_JSON( - live.udf_api( - 'https://archive.base-prod.vertexprotocol.com/v2/contracts' - ) - ) :data AS response -), -market_stats AS ( - SELECT - DATE_TRUNC('hour', SYSDATE()) AS HOUR, - f.value :base_currency :: STRING AS base_currency, - f.value :base_volume :: FLOAT AS base_volume, - f.value :contract_price :: FLOAT AS contract_price, - f.value :contract_price_currency :: STRING AS contract_price_currency, - f.value :funding_rate :: FLOAT AS funding_rate, - f.value :index_price :: FLOAT AS index_price, - f.value :last_price :: FLOAT AS last_price, - f.value :mark_price :: FLOAT AS mark_price, - TRY_TO_TIMESTAMP( - f.value :next_funding_rate_timestamp :: STRING - ) AS next_funding_rate_timestamp, - f.value :open_interest :: FLOAT AS open_interest, - f.value :open_interest_usd :: FLOAT AS open_interest_usd, - f.value :price_change_percent_24h :: FLOAT AS price_change_percent_24h, - f.value :product_type :: STRING AS product_type, - f.value :quote_currency :: STRING AS quote_currency, - f.value :quote_volume :: FLOAT AS quote_volume, - f.key AS ticker_id, - SYSDATE() AS inserted_timestamp - FROM - api_pull A, - LATERAL FLATTEN( - input => response - ) AS f -), -trade_snapshot AS ( - SELECT - DATE_TRUNC( - 'hour', - block_timestamp - ) AS HOUR, - CONCAT( - symbol, - '_USDC' - ) AS ticker_id, - symbol, - product_id, - COUNT(DISTINCT(tx_hash)) AS distinct_sequencer_batches, - COUNT(DISTINCT(trader)) AS distinct_trader_count, - COUNT(DISTINCT(subaccount)) AS distinct_subaccount_count, - COUNT(DISTINCT(digest)) AS trade_count, - SUM(amount_usd) AS amount_usd, - SUM(fee_amount) AS fee_amount, - SUM(base_delta_amount) AS base_delta_amount, - SUM(quote_delta_amount) AS quote_delta_amount, - MAX(_inserted_timestamp) AS _inserted_timestamp - FROM - {{ ref('silver__vertex_perps') }} - p - WHERE - block_timestamp > '2024-10-01 00:00:00.000' --start of api pulls - GROUP BY - 1, - 2, - 3, - 4 -), -products AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - product_id, - product_type, - ticker_id, - symbol, - name, - health_group, - health_group_symbol, - taker_fee, - maker_fee, - _inserted_timestamp, - _log_id, - vertex_products_id, - inserted_timestamp, - modified_timestamp, - _invocation_id - FROM - {{ ref('silver__vertex_dim_products') }} -), -FINAL AS ( - SELECT - s.hour, - s.ticker_id, - p.symbol, - p.product_id, - t.distinct_sequencer_batches, - t.distinct_trader_count, - t.distinct_subaccount_count, - t.trade_count, - t.amount_usd, - t.fee_amount, - t.base_delta_amount, - t.quote_delta_amount, - s.base_volume AS base_volume_24h, - s.quote_volume AS quote_volume_24h, - s.contract_price, - s.contract_price_currency, - s.funding_rate, - s.index_price, - s.last_price, - s.mark_price, - s.next_funding_rate_timestamp, - s.open_interest, - s.open_interest_usd, - s.price_change_percent_24h, - s.product_type, - s.quote_currency, - s.quote_volume, - t._inserted_timestamp, - FROM - market_stats s - LEFT JOIN trade_snapshot t - ON t.ticker_id = s.ticker_id - AND s.hour = t.hour - LEFT JOIN products p - ON s.ticker_id = p.ticker_id - -{% if is_incremental() %} -UNION ALL -SELECT - s.hour, - s.ticker_id, - p.symbol, - p.product_id, - t.distinct_sequencer_batches, - t.distinct_trader_count, - t.distinct_subaccount_count, - t.trade_count, - t.amount_usd, - t.fee_amount, - t.base_delta_amount, - t.quote_delta_amount, - s.base_volume_24h, - s.quote_volume_24h, - s.contract_price, - s.contract_price_currency, - s.funding_rate, - s.index_price, - s.last_price, - s.mark_price, - s.next_funding_rate_timestamp, - s.open_interest, - s.open_interest_usd, - s.price_change_percent_24h, - s.product_type, - s.quote_currency, - s.quote_volume, - t._inserted_timestamp -FROM - {{ this }} - s - LEFT JOIN trade_snapshot t - ON t.ticker_id = s.ticker_id - AND s.hour = t.hour - LEFT JOIN products p - ON s.ticker_id = p.ticker_id -{% endif %} -) -SELECT - *, - SYSDATE() AS modified_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['ticker_id','hour'] - ) }} AS vertex_market_stats_id, - '{{ invocation_id }}' AS _invocation_id -FROM - FINAL -WHERE FUNDING_RATE <> 0 qualify(ROW_NUMBER() over(PARTITION BY ticker_id, HOUR -ORDER BY - _inserted_timestamp DESC NULLS LAST)) = 1 diff --git a/models/silver/protocols/vertex/silver__vertex_market_stats.yml b/models/silver/protocols/vertex/silver__vertex_market_stats.yml deleted file mode 100644 index 39fb229..0000000 --- a/models/silver/protocols/vertex/silver__vertex_market_stats.yml +++ /dev/null @@ -1,142 +0,0 @@ -version: 2 -models: - - name: silver__vertex_market_stats - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - HOUR - - TICKER_ID - - vertex_missing_products: - filter: product_type = 'perp' AND product_id <> 0 - columns: - - name: HOUR - 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: TICKER_ID - tests: - - not_null - - name: SYMBOL - - not_null - - name: PRODUCT_ID - - not_null - - name: DISTINCT_SEQUENCE - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: DISTINCT_TRADER_COUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: DISTINCT_SUBACCOUNT_COUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TRADE_COUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: AMOUNT_USD - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: FEE_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BASE_DELTA_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: QUOTE_DELTA_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BASE_VOLUME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: CONTRACT_PRICE - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: CONTRACT_PRICE_CURRENCY - tests: - - not_null - - name: FUNDING_RATE - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: INDEX_PRICE - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: LAST_PRICE - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: MARK_PRICE - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: NEXT_FUNDING_RATE_TIMESTAMP - tests: - - not_null - - name: OPEN_INTEREST - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: OPEN_INTEREST_USD - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: PRODUCT_TYPE - tests: - - not_null - - name: QUOTE_CURRENCY - tests: - - not_null - - name: QUOTE_VOLUME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT \ No newline at end of file diff --git a/models/silver/protocols/vertex/silver__vertex_money_markets.sql b/models/silver/protocols/vertex/silver__vertex_money_markets.sql deleted file mode 100644 index 3b3e3e5..0000000 --- a/models/silver/protocols/vertex/silver__vertex_money_markets.sql +++ /dev/null @@ -1,55 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'merge', - unique_key = ['ticker_id','hour'], - cluster_by = ['HOUR::DATE'], - tags = 'curated' -) }} - -WITH apr AS ( - - SELECT - PARSE_JSON( - live.udf_api( - 'https://gateway.base-prod.vertexprotocol.com/v2/apr' - ) - ) :data AS response -), -flattened AS ( - SELECT - DATE_TRUNC('hour', SYSDATE()) AS HOUR, - CONCAT( - f.value :symbol :: STRING, - '_USDC' - ) AS ticker_id, - f.value :symbol :: STRING AS symbol, - f.value :product_id :: STRING AS product_id, - f.value :deposit_apr :: FLOAT AS deposit_apr, - f.value :borrow_apr :: FLOAT AS borrow_apr, - f.value :tvl :: FLOAT AS tvl - FROM - apr A, - LATERAL FLATTEN( - input => response - ) AS f -) -SELECT - HOUR, - ticker_id, - symbol, - product_id, - deposit_apr, - borrow_apr, - tvl, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['ticker_id','hour'] - ) }} AS vertex_money_markets_id, - '{{ invocation_id }}' AS _invocation_id -FROM - flattened -WHERE - product_id NOT IN ('123', '127') qualify(ROW_NUMBER() over(PARTITION BY ticker_id, HOUR -ORDER BY - inserted_timestamp DESC)) = 1 diff --git a/models/silver/protocols/vertex/silver__vertex_money_markets.yml b/models/silver/protocols/vertex/silver__vertex_money_markets.yml deleted file mode 100644 index b975668..0000000 --- a/models/silver/protocols/vertex/silver__vertex_money_markets.yml +++ /dev/null @@ -1,44 +0,0 @@ -version: 2 -models: - - name: silver__vertex_money_markets - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - HOUR - - TICKER_ID - columns: - - name: HOUR - 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: TICKER_ID - tests: - - not_null - - name: SYMBOL - - not_null - - name: PRODUCT_ID - - not_null - - name: DEPOSIT_APR - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BORROW_APR - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: TVL - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT \ No newline at end of file diff --git a/models/silver/protocols/vertex/silver__vertex_perps.sql b/models/silver/protocols/vertex/silver__vertex_perps.sql deleted file mode 100644 index bc572a6..0000000 --- a/models/silver/protocols/vertex/silver__vertex_perps.sql +++ /dev/null @@ -1,245 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = '_log_id', - cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] -) }} - -WITH vertex_products AS ( - - SELECT - block_number, - block_timestamp, - tx_hash, - product_id :: STRING AS product_id, - product_type, - ticker_id, - symbol, - NAME - FROM - {{ ref('silver__vertex_dim_products') }} - WHERE - product_type = 'perp' -), -logs AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - origin_from_address, - origin_to_address, - origin_function_signature, - tx_status, - contract_address, - block_hash, - data, - event_index, - event_removed, - topics, - _inserted_timestamp, - _log_id, - is_pending, - logs_id, - inserted_timestamp, - modified_timestamp, - _invocation_id - FROM - {{ ref('silver__logs') }} - WHERE - topics [0] :: STRING = '0x7c57459d6f4f0fb2fc5b1e298c8c0eb238422944964aa1e249eaa78747f0cca9' - AND contract_address = LOWER('0xd0899a1235771733e89b674633981e422aa45B1A') - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '12 hours' - FROM - {{ this }} -) -AND _inserted_timestamp >= SYSDATE() - INTERVAL '7 day' -{% endif %} -), -order_fill_decode_v2 AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - 'FillOrder' AS event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}') AS segmented_data, - utils.udf_hex_to_int( - topics [1] :: STRING - ) :: STRING AS product_id, - topics [2] :: STRING AS digest, - --unique hash of the order - LEFT( - topics [3] :: STRING, - 42 - ) AS trader, - topics [3] :: STRING AS subaccount, - utils.udf_hex_to_int( - segmented_data [0] :: STRING - ) :: INT AS pricex18, - utils.udf_hex_to_int( - 's2c', - segmented_data [1] :: STRING - ) :: INT AS amount, - utils.udf_hex_to_int( - segmented_data [2] :: STRING - ) AS expiration, - utils.udf_hex_to_int( - segmented_data [3] :: STRING - ) :: INT AS nonce, - utils.udf_hex_to_int( - 's2c', - segmented_data [4] :: STRING - ) :: INT AS isTaker, - utils.udf_hex_to_int( - 's2c', - segmented_data [5] :: STRING - ) :: INT AS feeAmount, - utils.udf_hex_to_int( - 's2c', - segmented_data [6] :: STRING - ) :: INT AS baseDelta, - utils.udf_hex_to_int( - 's2c', - segmented_data [7] :: STRING - ) :: INT AS quoteDelta, - l._log_id, - l._inserted_timestamp - FROM - logs l -), -order_fill_format AS ( - SELECT - l.block_number, - l.block_timestamp, - l.tx_hash, - l.contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - s.symbol, - l.product_id, - digest, - trader, - subaccount, - expiration AS expiration_raw, - utils.udf_int_to_binary(TRY_TO_NUMBER(expiration)) AS exp_binary, - utils.udf_binary_to_int(SUBSTR(exp_binary, -2)) AS order_type, - utils.udf_binary_to_int(SUBSTR(exp_binary, -3, 1)) AS market_reduce_flag, - CASE - WHEN len(expiration) < 11 THEN TRY_TO_TIMESTAMP(utils.udf_binary_to_int(exp_binary) :: STRING) - ELSE TRY_TO_TIMESTAMP( - utils.udf_binary_to_int(SUBSTR(exp_binary, 24)) :: STRING - ) - END AS expiration, - nonce, - isTaker, - feeAmount AS fee_amount_unadj, - feeAmount / pow( - 10, - 18 - ) AS fee_amount, - pricex18 AS price_amount_unadj, - pricex18 / pow( - 10, - 18 - ) AS price_amount, - amount AS amount_unadj, - amount / pow( - 10, - 18 - ) AS amount, - baseDelta AS base_delta_unadj, - baseDelta / pow( - 10, - 18 - ) AS base_delta, - quoteDelta AS quote_delta_unadj, - quoteDelta / pow( - 10, - 18 - ) AS quote_delta, - _log_id, - _inserted_timestamp - FROM - order_fill_decode_v2 l - INNER JOIN vertex_products s - ON s.product_id = l.product_id -), -FINAL AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - symbol, - product_id, - digest, - trader, - subaccount, - CASE - WHEN amount < 0 THEN 'sell/short' - WHEN amount > 0 THEN 'buy/long' - END AS trade_type, - expiration_raw, - exp_binary, - order_type AS order_type_raw, - CASE - WHEN order_type = 0 THEN 'default' - WHEN order_type = 1 THEN 'immediate-or-cancel' - WHEN order_type = 2 THEN 'fill-or-kill' - WHEN order_type = 3 THEN 'post-only' - END AS order_type, - market_reduce_flag, - expiration, - nonce, - CASE - WHEN isTaker = 1 THEN TRUE - WHEN isTaker = 0 THEN FALSE - END AS is_taker, - price_amount_unadj, - price_amount, - amount_unadj, - amount, - CASE - WHEN quote_delta < 0 THEN quote_delta * -1 - ELSE quote_delta - END AS amount_usd, - fee_amount_unadj, - fee_amount, - base_delta_unadj AS base_delta_amount_unadj, - base_delta AS base_delta_amount, - quote_delta_unadj AS quote_delta_amount_unadj, - quote_delta AS quote_delta_amount, - _log_id, - _inserted_timestamp - FROM - order_fill_format -) -SELECT - *, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash','event_index'] - ) }} AS vertex_perps_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - FINAL qualify(ROW_NUMBER() over(PARTITION BY _log_id -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/protocols/vertex/silver__vertex_perps.yml b/models/silver/protocols/vertex/silver__vertex_perps.yml deleted file mode 100644 index eaf6536..0000000 --- a/models/silver/protocols/vertex/silver__vertex_perps.yml +++ /dev/null @@ -1,170 +0,0 @@ -version: 2 -models: - - name: silver__vertex_perps - 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: 14 - - 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: 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: EVENT_NAME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - not_null - - name: SYMBOL - tests: - - not_null - - name: DIGEST - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TRADER - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: SUBACCOUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TRADE_TYPE - tests: - - not_null - - name: EXPIRATION_RAW - tests: - - not_null - - name: EXPIRATION - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - not_null - - name: NONCE - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: PRICE_AMOUNT_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: PRICE_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: AMOUNT_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: AMOUNT_USD - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: FEE_AMOUNT_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: FEE_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BASE_DELTA_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BASE_DELTA - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: QUOTE_DELTA_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: QUOTE_DELTA - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: PLATFORM - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - 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/protocols/vertex/silver__vertex_spot.sql b/models/silver/protocols/vertex/silver__vertex_spot.sql deleted file mode 100644 index 3a5e1ea..0000000 --- a/models/silver/protocols/vertex/silver__vertex_spot.sql +++ /dev/null @@ -1,249 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = '_log_id', - cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'], - enabled = false -) }} - -WITH vertex_products AS ( - - SELECT - block_number, - block_timestamp, - tx_hash, - product_id :: STRING AS product_id, - product_type, - ticker_id, - symbol, - NAME - FROM - {{ ref('silver__vertex_dim_products') }} - WHERE - product_type = 'spot' -), -logs AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - origin_from_address, - origin_to_address, - origin_function_signature, - tx_status, - contract_address, - block_hash, - data, - event_index, - event_removed, - topics, - _inserted_timestamp, - _log_id, - is_pending, - logs_id, - inserted_timestamp, - modified_timestamp, - _invocation_id - FROM - {{ ref('silver__logs') }} - WHERE - topics [0] :: STRING = '0x7c57459d6f4f0fb2fc5b1e298c8c0eb238422944964aa1e249eaa78747f0cca9' - AND contract_address = LOWER('0xd0899a1235771733e89b674633981e422aa45B1A') - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '12 hours' - FROM - {{ this }} -) -AND _inserted_timestamp >= SYSDATE() - INTERVAL '7 day' -{% endif %} -), -order_fill_decode_v2 AS ( - SELECT - l.block_number, - l.block_timestamp, - l.tx_hash, - l.contract_address, - 'FillOrder' AS event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}') AS segmented_data, - utils.udf_hex_to_int( - topics [1] :: STRING - ) AS product_id, - s.symbol, - topics [2] :: STRING AS digest, - --unique hash of the order - LEFT( - topics [3] :: STRING, - 42 - ) AS trader, - topics [3] :: STRING AS subaccount, - utils.udf_hex_to_int( - segmented_data [0] :: STRING - ) :: INT AS pricex18, - utils.udf_hex_to_int( - 's2c', - segmented_data [1] :: STRING - ) :: INT AS amount, - utils.udf_hex_to_int( - segmented_data [2] :: STRING - ) AS expiration, - utils.udf_hex_to_int( - segmented_data [3] :: STRING - ) :: INT AS nonce, - utils.udf_hex_to_int( - 's2c', - segmented_data [4] :: STRING - ) :: INT AS isTaker, - utils.udf_hex_to_int( - 's2c', - segmented_data [5] :: STRING - ) :: INT AS feeAmount, - utils.udf_hex_to_int( - 's2c', - segmented_data [6] :: STRING - ) :: INT AS baseDelta, - utils.udf_hex_to_int( - 's2c', - segmented_data [7] :: STRING - ) :: INT AS quoteDelta, - l._log_id, - l._inserted_timestamp - FROM - logs l - INNER JOIN vertex_products s - ON s.product_id = utils.udf_hex_to_int( - topics [1] :: STRING - ) -), -order_fill_format AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - symbol, - product_id, - digest, - trader, - subaccount, - expiration AS expiration_raw, - UTILS.UDF_INT_TO_BINARY(TRY_TO_NUMBER(expiration)) AS exp_binary, - utils.udf_binary_to_int(SUBSTR(exp_binary, -2)) AS order_type, - utils.udf_binary_to_int(SUBSTR(exp_binary, -3, 1)) AS market_reduce_flag, - CASE - WHEN len(expiration) < 11 THEN TRY_TO_TIMESTAMP(utils.udf_binary_to_int(exp_binary) :: STRING) - ELSE TRY_TO_TIMESTAMP( - utils.udf_binary_to_int(SUBSTR(exp_binary, 24)) :: STRING - ) - END AS expiration, - nonce, - isTaker, - feeAmount AS fee_amount_unadj, - feeAmount / pow( - 10, - 18 - ) AS fee_amount, - pricex18 AS price_amount_unadj, - pricex18 / pow( - 10, - 18 - ) AS price_amount, - amount AS amount_unadj, - amount / pow( - 10, - 18 - ) AS amount, - baseDelta AS base_delta_unadj, - baseDelta / pow( - 10, - 18 - ) AS base_delta, - quoteDelta AS quote_delta_unadj, - quoteDelta / pow( - 10, - 18 - ) AS quote_delta, - _log_id, - _inserted_timestamp - FROM - order_fill_decode_v2 -), -FINAL AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - contract_address, - event_name, - event_index, - origin_function_signature, - origin_from_address, - origin_to_address, - symbol, - product_id, - digest, - trader, - subaccount, - CASE - WHEN amount < 0 THEN 'sell/short' - WHEN amount > 0 THEN 'buy/long' - END AS trade_type, - expiration_raw, - exp_binary, - order_type AS order_type_raw, - CASE - WHEN order_type = 0 THEN 'default' - WHEN order_type = 1 THEN 'immediate-or-cancel' - WHEN order_type = 2 THEN 'fill-or-kill' - WHEN order_type = 3 THEN 'post-only' - END AS order_type, - market_reduce_flag, - expiration, - nonce, - CASE - WHEN isTaker = 1 THEN TRUE - WHEN isTaker = 0 THEN FALSE - END AS is_taker, - price_amount_unadj, - price_amount, - amount_unadj, - amount, - CASE - WHEN quote_delta < 0 THEN quote_delta * -1 - ELSE quote_delta - END AS amount_usd, - fee_amount_unadj, - fee_amount, - base_delta_unadj AS base_delta_amount_unadj, - base_delta AS base_delta_amount, - quote_delta_unadj AS quote_delta_amount_unadj, - quote_delta AS quote_delta_amount, - _log_id, - _inserted_timestamp - FROM - order_fill_format -) -SELECT - *, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash','event_index'] - ) }} AS vertex_spot_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - FINAL qualify(ROW_NUMBER() over(PARTITION BY _log_id -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/protocols/vertex/silver__vertex_spot.yml b/models/silver/protocols/vertex/silver__vertex_spot.yml deleted file mode 100644 index 178af99..0000000 --- a/models/silver/protocols/vertex/silver__vertex_spot.yml +++ /dev/null @@ -1,172 +0,0 @@ -version: 2 -models: - - name: silver__vertex_spot - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - - vertex_product_level_recency: - filter: product_type = 'spot' AND product_id <> 0 - 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: 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: EVENT_NAME - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - not_null - - name: SYMBOL - tests: - - not_null - - name: DIGEST - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TRADER - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: SUBACCOUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TRADE_TYPE - tests: - - not_null - - name: EXPIRATION_RAW - tests: - - not_null - - name: EXPIRATION - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_LTZ - - TIMESTAMP_NTZ - - not_null - - name: NONCE - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: PRICE_AMOUNT_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: PRICE_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: AMOUNT_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: AMOUNT_USD - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: FEE_AMOUNT_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: FEE_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BASE_DELTA_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BASE_DELTA - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: QUOTE_DELTA_UNADJ - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: QUOTE_DELTA - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: PLATFORM - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - 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/stats/silver_stats__core_metrics_hourly.sql b/models/silver/stats/silver_stats__core_metrics_hourly.sql deleted file mode 100644 index 1d1c438..0000000 --- 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('silver__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_status = 'SUCCESS' THEN tx_hash - END - ) AS transaction_count_success, - COUNT( - DISTINCT CASE - WHEN tx_status != 'SUCCESS' 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('silver__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 df231f3..0000000 --- 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 6d79dd5..0000000 --- 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 => 100000000)) diff --git a/models/sources.yml b/models/sources.yml index 997e13c..c4f1bdc 100644 --- a/models/sources.yml +++ b/models/sources.yml @@ -4,7 +4,7 @@ sources: - 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 @@ -18,23 +18,20 @@ sources: - name: traces_v2 - name: confirm_blocks_v2 - name: decoded_logs_v2 - - name: crosschain - database: "{{ 'crosschain' if target.database == 'BASE' else 'crosschain_dev' }}" - schema: core - tables: - - name: dim_labels - - name: silver_crosschain - database: "{{ 'crosschain' if target.database == 'BASE' else 'crosschain_dev' }}" + - name: contract_abis + - name: crosschain_silver + database: >- + {{ 'CROSSCHAIN_DEV' if '_DEV' in target.database.upper() else 'CROSSCHAIN' }} 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: complete_provider_prices + - name: complete_token_asset_metadata + - name: complete_token_prices - name: ethereum_silver database: ethereum schema: silver @@ -45,18 +42,13 @@ sources: schema: bronze_public tables: - name: user_abis - - name: streamline_crosschain - database: streamline - schema: crosschain + - name: complete_streamline + database: "{{ target.database }}" + schema: streamline tables: - - name: node_mapping - - name: base_bronze_api - database: base - schema: bronze_api - tables: - - name: contract_abis + - name: complete_contract_abis - name: github_actions - database: base + database: "{{ target.database }}" schema: github_actions tables: - name: workflows @@ -65,14 +57,20 @@ sources: schema: defillama tables: - name: dim_chains - - name: base_silver - database: "{{ 'base' if target.database == 'BASE' else 'base_dev' }}" + - name: abis_silver + database: "{{ target.database }}" schema: silver tables: - - name: overflowed_traces - name: verified_abis - - name: base_gold - database: "{{ 'base' if target.database == 'BASE' else 'base_dev' }}" - schema: core + - name: fsc_evm_admin + database: >- + {{ 'FSC_EVM_DEV' if '_DEV' in target.database.upper() else 'FSC_EVM' }} + schema: admin tables: - - name: fact_traces + - name: _master_keys + - name: rpc_node_logs + - name: logs_temp + database: "{{ target.database }}" + schema: silver + tables: + - name: logs diff --git a/models/streamline/bronze/core/bronze__blocks.sql b/models/streamline/bronze/core/bronze__blocks.sql index aa987cf..b5611e0 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 33ad98f..470f3e9 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 b45639a..6b0b0bc 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 91576bd..32dcd1d 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 031fdb2..2927de0 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 ebf8ac6..5b4a5e8 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 a4402e5..b65db0d 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 d03c45b..f14b458 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 21d84b9..4e167d2 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 0000000..e69de29 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 0000000..e69de29 diff --git a/models/streamline/bronze/core/bronze__receipts_fr.sql b/models/streamline/bronze/core/bronze__receipts_fr.sql index a575663..9b46789 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,17 +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, - VALUE :"array_index" :: INT AS array_index, + 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 %} \ No newline at end of file + {{ 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 6c4956e..edba56d 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 90e0a07..cf74f3c 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 f866176..9803133 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 b150c36..74b915f 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 3905c1b..6456d29 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 0415825..facbd5d 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 8b6ba90..df93172 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 2721f1d..ccb3e1b 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 41179ac..54e50ad 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 7907074..25da349 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 8a339c6..1d5264a 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 bbe5955..03e1cfb 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 8c122fa..20e47dd 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 2bd430a..c849a83 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 e9d060f..0000000 --- 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 f37bcf6..0000000 --- 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 a56cf82..0000000 --- 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 80e3d97..0000000 --- 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 4c8977d..0000000 --- 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 fe73ef2..0000000 --- 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 b77138d..0000000 --- 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 e715876..0000000 --- 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 06ec7f7..0000000 --- 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 baed1d7..0000000 --- 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 d715b31..0000000 --- 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 4cd5823..0000000 --- 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 0cf5cc2..0000000 --- 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 0bd0a93..0000000 --- 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 6135a3f..0000000 --- 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 6ec5c85..0000000 --- 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 34f7f98..0000000 --- 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 1d97cea..0000000 --- a/models/streamline/silver/core/retry/_missing_receipts.sql +++ /dev/null @@ -1,35 +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) - AND t.tx_hash <> '0x13b126388e78adc0fff1b40888b2cd87e6ec0d6c3c9838ee26119b81173bcf25' 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 34f3aa2..0000000 --- a/models/streamline/silver/core/retry/_missing_traces.sql +++ /dev/null @@ -1,21 +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.from_address <> '0x0000000000000000000000000000000000000000' - AND tx.to_address <> '0x0000000000000000000000000000000000000000' - ) - 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 7718e97..0000000 --- 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 8e2507c..0000000 --- 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 9e56c76..0000000 --- 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 9e98ae7..0000000 --- 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 e318e4d..0000000 --- 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 3e80589..0000000 --- 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 30f92ac..0000000 --- a/models/streamline/silver/decoded_logs/realtime/streamline__decoded_logs_realtime.sql +++ /dev/null @@ -1,112 +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 %} diff --git a/package-lock.yml b/package-lock.yml index 17f414c..571feea 100644 --- a/package-lock.yml +++ b/package-lock.yml @@ -1,4 +1,6 @@ packages: +- git: https://github.com/FlipsideCrypto/fsc-evm.git + revision: 6ead82cc9f3a7d4ebe47d7065aeee35f9da1bbc6 - package: calogica/dbt_expectations version: 0.8.2 - package: dbt-labs/dbt_external_tables @@ -6,13 +8,11 @@ packages: - package: dbt-labs/dbt_utils version: 1.0.0 - git: https://github.com/FlipsideCrypto/fsc-utils.git - revision: c3ab97e8e06d31e8c6f63819714e0a2d45c45e82 + revision: 5f6015eb8501e2b238cd455f494203385de38107 - package: get-select/dbt_snowflake_query_tags version: 2.5.0 -- git: https://github.com/FlipsideCrypto/fsc-evm.git - revision: 9326ce6c0b1a8fb7dbd9eb8c3f22a32628ff7883 - package: calogica/dbt_date version: 0.7.2 -- git: https://github.com/FlipsideCrypto/livequery-models.git - revision: b024188be4e9c6bc00ed77797ebdc92d351d620e -sha1_hash: 3e35123963ace2a6b66566dd520d1cdd3e3e3d07 +- git: https://github.com/FlipsideCrypto/livequery-base.git + revision: 884d6171cd6c97275ce387432b0e3e60972c7e9a +sha1_hash: 85903dee15830361420ee1c2cd74e2117534855c diff --git a/packages.yml b/packages.yml index 6e99336..d50fb14 100644 --- a/packages.yml +++ b/packages.yml @@ -1,13 +1,3 @@ packages: - - package: calogica/dbt_expectations - version: 0.8.2 - - package: dbt-labs/dbt_external_tables - version: 0.8.2 - - package: dbt-labs/dbt_utils - version: 1.0.0 - - git: https://github.com/FlipsideCrypto/fsc-utils.git - revision: v1.31.0 - - package: get-select/dbt_snowflake_query_tags - version: [">=2.0.0", "<3.0.0"] - git: https://github.com/FlipsideCrypto/fsc-evm.git - revision: v1.3.0 \ No newline at end of file + revision: v4.0.0-beta.12 \ No newline at end of file diff --git a/tests/base/test_gold__missing_traces.sql b/tests/base/test_gold__missing_traces.sql deleted file mode 100644 index 514d31c..0000000 --- a/tests/base/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/base/test_gold__recent_missing_traces.sql b/tests/base/test_gold__recent_missing_traces.sql deleted file mode 100644 index 9a571ca..0000000 --- a/tests/base/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/base/test_silver__confirmed_blocks.sql b/tests/base/test_silver__confirmed_blocks.sql deleted file mode 100644 index 8cbac8b..0000000 --- a/tests/base/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/base/test_silver__missing_receipts.sql b/tests/base/test_silver__missing_receipts.sql deleted file mode 100644 index 8481599..0000000 --- a/tests/base/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/base/test_silver__recent_confirmed_blocks.sql b/tests/base/test_silver__recent_confirmed_blocks.sql deleted file mode 100644 index 79cdd66..0000000 --- a/tests/base/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/base/test_silver__recent_missing_receipts.sql b/tests/base/test_silver__recent_missing_receipts.sql deleted file mode 100644 index f657fd3..0000000 --- a/tests/base/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")) }}