From 3c4ba758129b3a580ed7763a35a1f2def3df1d6c Mon Sep 17 00:00:00 2001 From: drethereum <71602799+drethereum@users.noreply.github.com> Date: Tue, 13 May 2025 09:43:30 -0600 Subject: [PATCH] AN-5993/avax-migration (#326) * initial set up * macros and workflows * wh * defi and nft tags * sl * docs * docs * package * package * v63 * exclude curated * remove * v64 --- .github/workflows/dbt_alter_all_gha_tasks.yml | 27 + .github/workflows/dbt_alter_gha_task.yml | 48 -- .github/workflows/dbt_alter_gha_tasks.yml | 32 + .../workflows/dbt_deploy_new_workflows.yml | 19 + .github/workflows/dbt_docs_update.yml | 73 +-- .github/workflows/dbt_integration_test.yml | 30 +- .github/workflows/dbt_run_abi_refresh.yml | 58 -- .github/workflows/dbt_run_adhoc.yml | 53 +- .github/workflows/dbt_run_deployment.yml | 69 -- .github/workflows/dbt_run_dev_refresh.yml | 79 +-- .../workflows/dbt_run_full_observability.yml | 55 +- .github/workflows/dbt_run_heal_models.yml | 53 +- .github/workflows/dbt_run_operation_reorg.yml | 61 -- .github/workflows/dbt_run_scheduled_abis.yml | 22 + .../workflows/dbt_run_scheduled_curated.yml | 48 +- .../workflows/dbt_run_scheduled_decoder.yml | 19 + .github/workflows/dbt_run_scheduled_main.yml | 19 + .../dbt_run_scheduled_non_realtime.yml | 53 -- .../workflows/dbt_run_scheduled_scores.yml | 20 + .../dbt_run_streamline_chainhead.yml | 53 +- ...bt_run_streamline_decoded_logs_history.yml | 56 -- .../workflows/dbt_run_streamline_decoder.yml | 53 -- .../dbt_run_streamline_decoder_history.yml | 22 + .../dbt_run_streamline_dexalot_chainhead.yml | 2 + .../dbt_run_streamline_dexalot_history.yml | 1 - ...bt_run_streamline_dexalot_non_realtime.yml | 2 + .../workflows/dbt_run_streamline_history.yml | 19 + .../dbt_run_streamline_history_adhoc.yml | 79 --- .github/workflows/dbt_test_daily.yml | 60 +- .github/workflows/dbt_test_intraday.yml | 51 +- .github/workflows/dbt_test_monthly.yml | 57 +- .github/workflows/slack_notify.yml | 27 - .gitignore | 2 +- Makefile | 111 +++- data/github_actions__workflows.csv | 10 - dbt_project.yml | 111 ++-- macros/create_udfs.sql | 14 +- macros/dbt/incremental_predicates.sql | 22 - macros/decoder/decoded_logs_history.sql | 124 ---- macros/decoder/run_decoded_logs_history.sql | 29 - 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/lookback.sql | 12 - macros/streamline/api_integrations.sql | 11 - macros/streamline/get_base_table_udft.sql | 24 - macros/streamline/streamline_udfs.sql | 66 -- macros/tests/missing_decoding.sql | 25 - macros/tests/missing_txs.sql | 254 -------- macros/utils.sql | 78 --- .../general => }/__overview__.md | 69 +- models/bronze/api_udf/_retry_abis.sql | 87 --- .../api_udf/bronze_api__contract_abis.sql | 80 --- .../api_udf/bronze_api__contract_abis.yml | 22 - .../api_udf/bronze_api__token_reads.sql | 129 ---- .../api_udf/bronze_api__token_reads.yml | 18 - models/bronze/labels/bronze__labels.sql | 25 - ...bronze__complete_native_asset_metadata.sql | 26 - .../prices/bronze__complete_native_prices.sql | 29 - ...onze__complete_provider_asset_metadata.sql | 28 - .../bronze__complete_provider_prices.sql | 24 - .../bronze__complete_token_asset_metadata.sql | 28 - .../prices/bronze__complete_token_prices.sql | 31 - .../bronze_dexalot__streamline_traces.sql | 2 +- models/dexalot/gold/dexalot__fact_blocks.sql | 12 +- models/dexalot/gold/dexalot__fact_blocks.yml | 6 - .../dexalot/gold/dexalot__fact_event_logs.sql | 3 +- .../dexalot/gold/dexalot__fact_event_logs.yml | 4 - models/dexalot/gold/dexalot__fact_traces.yml | 10 +- .../gold/dexalot__fact_transactions.sql | 3 +- .../gold/dexalot__fact_transactions.yml | 16 +- .../streamline/streamline__dexalot_blocks.sql | 5 +- .../Borrowing/Borrow_symbol.md | 4 - models/doc_descriptions/Borrowing/action.md | 9 - models/doc_descriptions/Borrowing/amount.md | 9 - .../doc_descriptions/Borrowing/amount_usd.md | 8 - models/doc_descriptions/Borrowing/asset.md | 5 - .../Borrowing/collateral_address.md | 5 - .../Borrowing/collateral_symbol.md | 5 - models/doc_descriptions/Lending/Depositor.md | 5 - .../Lending/Lending_asset_address.md | 4 - .../Lending/Lending_pool_address.md | 5 - .../Lending/Lending_symbol.md | 5 - models/doc_descriptions/Lending/action.md | 7 - models/doc_descriptions/Lending/amount.md | 5 - models/doc_descriptions/Lending/amount_usd.md | 5 - models/doc_descriptions/Lending/asset.md | 5 - .../Lending/borrower_is_a_contract.md | 5 - .../Lending/lender_is_a_contract.md | 5 - .../doc_descriptions/Lending/lending_pool.md | 5 - .../Lending/origin_from_address.md | 5 - .../Lending/origin_to_address.md | 5 - .../blocks/avax_block_header_json.md | 5 - .../blocks/avax_blockchain.md | 5 - .../blocks/avax_blocks_hash.md | 5 - .../blocks/avax_blocks_nonce.md | 5 - .../blocks/avax_blocks_table_doc.md | 5 - .../blocks/avax_difficulty.md | 5 - .../blocks/avax_extra_data.md | 5 - .../doc_descriptions/blocks/avax_gas_limit.md | 5 - .../doc_descriptions/blocks/avax_gas_used.md | 5 - models/doc_descriptions/blocks/avax_miner.md | 5 - .../doc_descriptions/blocks/avax_network.md | 5 - .../blocks/avax_parent_hash.md | 5 - .../blocks/avax_receipts_root.md | 5 - .../blocks/avax_sha3_uncles.md | 5 - models/doc_descriptions/blocks/avax_size.md | 5 - .../blocks/avax_total_difficulty.md | 5 - .../doc_descriptions/blocks/avax_tx_count.md | 5 - .../blocks/avax_uncle_blocks.md | 5 - .../bridge/evm_bridge_activity.md | 83 --- .../complete_lending_column_docs.md | 381 ------------ .../complete_lending_table_docs.md | 36 -- .../avax_ez_dex_swaps_table_doc.md | 6 - .../avax_sushi__ez_swaps.md | 5 - .../eth_dex_creation_block.md | 5 - .../eth_dex_creation_time.md | 5 - .../eth_dex_creation_tx.md | 5 - .../eth_dex_factory_address.md | 5 - .../eth_dex_lp_decimals.md | 15 - .../eth_dex_lp_symbols.md | 15 - .../eth_dex_lp_table_doc.md | 5 - .../eth_dex_lp_tokens.md | 15 - .../eth_dex_platform.md | 5 - .../eth_dex_pool_address.md | 5 - .../eth_dex_pool_name.md | 5 - .../eth_dex_swaps_amount_in.md | 5 - .../eth_dex_swaps_amount_in_unadj.md | 5 - .../eth_dex_swaps_amount_in_usd.md | 5 - .../eth_dex_swaps_amount_out.md | 5 - .../eth_dex_swaps_amount_out_unadj.md | 5 - .../eth_dex_swaps_amount_out_usd.md | 5 - .../eth_dex_swaps_sender.md | 5 - .../eth_dex_swaps_symbol_in.md | 5 - .../eth_dex_swaps_symbol_out.md | 5 - .../eth_dex_swaps_token_In.md | 5 - .../eth_dex_swaps_token_out.md | 5 - .../eth_dex_swaps_tx_to.md | 5 - .../eth_dex_token0.md | 5 - .../eth_dex_token1.md | 5 - .../eth_dex_tokens.md | 5 - .../dexalot/core/dexalot_blocks.md | 126 ---- .../dexalot/core/dexalot_event_logs.md | 96 --- .../dexalot/core/dexalot_traces.md | 142 ----- .../dexalot/core/dexalot_transactions.md | 105 ---- .../dexalot/general/dexalot_block_number.md | 5 - .../general/dexalot_block_timestamp.md | 5 - .../dexalot/general/dexalot_decimals.md | 5 - .../dexalot/general/dexalot_from_address.md | 5 - .../dexalot/general/dexalot_ingested_at.md | 5 - .../dexalot/general/dexalot_symbol.md | 5 - .../dexalot/general/dexalot_to_address.md | 5 - .../event_logs/avax_event_index.md | 5 - .../event_logs/avax_event_inputs.md | 5 - .../event_logs/avax_event_name.md | 5 - .../event_logs/avax_event_removed.md | 5 - .../event_logs/avax_event_sig.md | 5 - .../event_logs/avax_log_id_events.md | 5 - .../event_logs/avax_logs_contract_address.md | 5 - .../event_logs/avax_logs_contract_name.md | 5 - .../event_logs/avax_logs_data.md | 5 - .../event_logs/avax_logs_table_doc.md | 5 - .../event_logs/avax_logs_tx_hash.md | 5 - .../event_logs/avax_origin_from.md | 5 - .../event_logs/avax_origin_to.md | 5 - .../event_logs/avax_topics.md | 5 - 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 ----- .../general/avax_block_number.md | 5 - .../general/avax_block_timestamp.md | 5 - .../doc_descriptions/general/avax_decimals.md | 5 - .../general/avax_from_address.md | 5 - .../general/avax_ingested_at.md | 5 - .../doc_descriptions/general/avax_symbol.md | 5 - .../general/avax_to_address.md | 5 - .../doc_descriptions/general/deprecation.md | 11 - .../general/export_columns.md | 19 - .../general/precise_amounts.md | 17 - models/doc_descriptions/labels/avax_label.md | 5 - .../labels/avax_label_address.md | 5 - .../labels/avax_label_address_name.md | 5 - .../labels/avax_label_blockchain.md | 5 - .../labels/avax_label_creator.md | 5 - .../labels/avax_label_subtype.md | 5 - .../labels/avax_label_type.md | 5 - .../labels/avax_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/avax_traces_block_no.md | 5 - .../traces/avax_traces_blocktime.md | 5 - .../traces/avax_traces_call_data.md | 5 - .../traces/avax_traces_from.md | 5 - .../traces/avax_traces_gas.md | 5 - .../traces/avax_traces_gas_used.md | 5 - .../traces/avax_traces_identifier.md | 5 - .../traces/avax_traces_index.md | 5 - .../traces/avax_traces_input.md | 5 - .../traces/avax_traces_output.md | 5 - .../traces/avax_traces_sub.md | 5 - .../traces/avax_traces_table_doc.md | 5 - .../doc_descriptions/traces/avax_traces_to.md | 5 - .../traces/avax_traces_tx_hash.md | 5 - .../traces/avax_traces_type.md | 5 - .../traces/avax_traces_value.md | 5 - .../transactions/avax_cumulative_gas_used.md | 5 - .../transactions/avax_tx_block_hash.md | 5 - .../transactions/avax_tx_fee.md | 5 - .../transactions/avax_tx_gas_limit.md | 5 - .../transactions/avax_tx_gas_price.md | 5 - .../transactions/avax_tx_gas_used.md | 5 - .../transactions/avax_tx_hash.md | 5 - .../transactions/avax_tx_input_data.md | 5 - .../transactions/avax_tx_json.md | 5 - .../transactions/avax_tx_nonce.md | 5 - .../transactions/avax_tx_origin_sig.md | 5 - .../transactions/avax_tx_position.md | 5 - .../transactions/avax_tx_status.md | 5 - .../transactions/avax_tx_table_doc.md | 5 - .../transactions/avax_value.md | 5 - .../transfers/avax_eth_amount.md | 5 - .../transfers/avax_eth_amount_usd.md | 6 - .../avax_ez_eth_transfers_table_doc.md | 5 - .../transfers/avax_ez_transfer_table_doc.md | 5 - .../transfers/avax_log_id_transfers.md | 5 - .../transfers/avax_origin_to.md | 5 - .../transfers/avax_transfer_amount.md | 11 - .../transfers/avax_transfer_amount_usd.md | 5 - .../avax_transfer_contract_address.md | 5 - .../transfers/avax_transfer_from_address.md | 5 - .../transfers/avax_transfer_has_decimal.md | 5 - .../transfers/avax_transfer_has_price.md | 5 - .../transfers/avax_transfer_raw_amount.md | 11 - .../transfers/avax_transfer_to_address.md | 5 - .../transfers/avax_transfer_token_price.md | 5 - .../transfers/avax_transfer_tx_hash.md | 5 - .../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 | 61 -- .../gold/core/core__ez_decoded_event_logs.sql | 70 --- .../gold/core/core__ez_decoded_event_logs.yml | 73 --- .../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 | 58 -- models/gold/core/core__fact_blocks.sql | 100 --- 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 | 490 --------------- models/gold/core/core__fact_traces.yml | 64 -- models/gold/core/core__fact_transactions.sql | 57 -- models/gold/core/core__fact_transactions.yml | 68 -- .../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 | 7 +- models/gold/defi/defi__ez_dex_swaps.yml | 48 +- .../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 | 31 +- models/gold/nft/nft__ez_nft_sales.yml | 62 +- models/gold/nft/nft__ez_nft_transfers.sql | 59 -- models/gold/nft/nft__ez_nft_transfers.yml | 50 -- .../gold/price/price__dim_asset_metadata.sql | 19 - .../gold/price/price__dim_asset_metadata.yml | 26 - .../gold/price/price__ez_asset_metadata.sql | 35 -- .../gold/price/price__ez_asset_metadata.yml | 29 - models/gold/price/price__ez_prices_hourly.sql | 39 -- models/gold/price/price__ez_prices_hourly.yml | 30 - .../price/price__fact_prices_ohlc_hourly.sql | 19 - .../price/price__fact_prices_ohlc_hourly.yml | 24 - .../stats/stats__ez_core_metrics_hourly.sql | 38 -- .../stats/stats__ez_core_metrics_hourly.yml | 34 - .../test_gold__ez_avax_transfers_full.sql | 9 - .../test_gold__ez_avax_transfers_full.yml | 60 -- .../test_gold__ez_avax_transfers_recent.sql | 27 - .../test_gold__ez_avax_transfers_recent.yml | 60 -- ...ver_observability__blocks_completeness.sql | 161 ----- ...ilver_observability__logs_completeness.sql | 119 ---- ...r_observability__receipts_completeness.sql | 117 ---- ...ver_observability__traces_completeness.sql | 116 ---- ...servability__transactions_completeness.sql | 117 ---- models/silver/abis/silver__abis.sql | 184 ------ models/silver/abis/silver__abis.yml | 8 - models/silver/abis/silver__bytecode_abis.sql | 76 --- models/silver/abis/silver__bytecode_abis.yml | 8 - .../abis/silver__complete_event_abis.sql | 216 ------- .../abis/silver__complete_event_abis.yml | 9 - .../silver/abis/silver__flat_event_abis.sql | 112 ---- models/silver/abis/silver__override_abis.sql | 8 - models/silver/abis/silver__proxies.sql | 104 ---- models/silver/abis/silver__proxies.yml | 7 - .../abis/silver__user_verified_abis.sql | 550 ---------------- .../abis/silver__user_verified_abis.yml | 7 - models/silver/abis/silver__verified_abis.sql | 108 ---- models/silver/abis/silver__verified_abis.yml | 7 - models/silver/core/silver__blocks.sql | 75 --- .../silver/core/silver__confirmed_blocks.sql | 50 -- models/silver/core/silver__contracts.sql | 108 ---- models/silver/core/silver__contracts.yml | 24 - .../silver/core/silver__created_contracts.sql | 44 -- .../silver/core/silver__created_contracts.yml | 29 - models/silver/core/silver__decoded_logs.sql | 239 ------- models/silver/core/silver__logs.sql | 195 ------ .../silver/core/silver__native_transfers.sql | 88 --- models/silver/core/silver__receipts.sql | 92 --- .../core/silver__relevant_contracts.sql | 134 ---- .../core/silver__relevant_contracts.yml | 7 - models/silver/core/silver__traces.sql | 15 - models/silver/core/silver__transactions.sql | 322 ---------- models/silver/core/silver__transfers.sql | 292 --------- models/silver/core/silver__tx_count.sql | 40 -- .../tests/blocks/test_silver__blocks_full.sql | 9 - .../tests/blocks/test_silver__blocks_full.yml | 94 --- .../blocks/test_silver__blocks_recent.sql | 16 - .../blocks/test_silver__blocks_recent.yml | 26 - .../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 | 76 --- .../event_logs/test_silver__logs_recent.sql | 16 - .../event_logs/test_silver__logs_recent.yml | 32 - .../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 | 28 - .../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 | 118 ---- .../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 | 69 -- .../test_silver__transfers_recent.sql | 16 - .../test_silver__transfers_recent.yml | 67 -- .../silver_bridge__allbridge_sent.sql | 2 +- .../silver_bridge__allbridge_tokens_sent.sql | 2 +- ...r_bridge__axelar_contractcallwithtoken.sql | 2 +- .../silver_bridge__ccip_send_requested.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 +- .../eywa/silver_bridge__eywa_requestsent.sql | 2 +- .../meson/silver_bridge__meson_transfers.sql | 2 +- ...er_bridge__multichain_v7_loganyswapout.sql | 2 +- ...ilver_bridge__complete_bridge_activity.sql | 2 +- .../silver_bridge__stargate_createpool.sql | 2 +- .../stargate/silver_bridge__stargate_swap.sql | 2 +- ...er_bridge__symbiosis_synthesizerequest.sql | 2 +- .../silver_bridge__synapse_token_bridge.sql | 2 +- ...ver_bridge__synapse_tokenbridgeandswap.sql | 2 +- .../silver_bridge__wormhole_transfers.sql | 2 +- .../balancer/silver_dex__balancer_pools.sql | 2 +- .../balancer/silver_dex__balancer_swaps.sql | 2 +- .../dex/curve/silver_dex__curve_pools.sql | 2 +- .../dex/curve/silver_dex__curve_swaps.sql | 2 +- .../fraxswap/silver_dex__fraxswap_pools.sql | 2 +- .../fraxswap/silver_dex__fraxswap_swaps.sql | 2 +- .../defi/dex/gmx/silver_dex__gmx_swaps.sql | 2 +- .../hashflow/silver_dex__hashflow_pools.sql | 2 +- .../hashflow/silver_dex__hashflow_swaps.sql | 2 +- .../silver_dex__hashflow_v3_pools.sql | 2 +- .../silver_dex__hashflow_v3_swaps.sql | 2 +- ...silver_dex__kyberswap_v1_dynamic_pools.sql | 2 +- ...silver_dex__kyberswap_v1_dynamic_swaps.sql | 2 +- .../silver_dex__kyberswap_v1_static_pools.sql | 2 +- .../silver_dex__kyberswap_v1_static_swaps.sql | 2 +- ...silver_dex__kyberswap_v2_elastic_pools.sql | 2 +- ...silver_dex__kyberswap_v2_elastic_swaps.sql | 2 +- .../pangolin/silver_dex__pangolin_pools.sql | 2 +- .../pangolin/silver_dex__pangolin_swaps.sql | 2 +- .../pharaoh/silver_dex__pharaoh_v1_pools.sql | 2 +- .../pharaoh/silver_dex__pharaoh_v1_swaps.sql | 2 +- .../pharaoh/silver_dex__pharaoh_v2_pools.sql | 2 +- .../pharaoh/silver_dex__pharaoh_v2_swaps.sql | 2 +- .../platypus/silver_dex__platypus_pools.sql | 2 +- .../platypus/silver_dex__platypus_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 +- .../silver_dex__trader_joe_v1_pools.sql | 2 +- .../silver_dex__trader_joe_v1_swaps.sql | 2 +- .../silver_dex__trader_joe_v2_1_swaps.sql | 2 +- .../silver_dex__trader_joe_v2_pools.sql | 2 +- .../silver_dex__trader_joe_v2_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/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 +- .../benqi/silver__benqi_asset_details.sql | 2 +- .../lending/benqi/silver__benqi_borrows.sql | 2 +- .../lending/benqi/silver__benqi_deposits.sql | 2 +- .../benqi/silver__benqi_liquidations.sql | 2 +- .../benqi/silver__benqi_repayments.sql | 2 +- .../lending/benqi/silver__benqi_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 +- .../silver__trader_joe_asset_details.sql | 2 +- .../trader_joe/silver__trader_joe_borrows.sql | 2 +- .../silver__trader_joe_deposits.sql | 2 +- .../silver__trader_joe_liquidations.sql | 2 +- .../silver__trader_joe_repayments.sql | 2 +- .../silver__trader_joe_withdraws.sql | 2 +- models/silver/labels/silver__labels.sql | 40 -- .../nft/sales/silver__aggregator_list.sql | 3 +- .../nft/sales/silver__complete_nft_sales.sql | 2 +- .../nft/sales/silver__element_sales.sql | 2 +- .../nft/sales/silver__joepegs_sales.sql | 2 +- .../silver/nft/sales/silver__salvor_sales.sql | 2 +- .../nft/sales/silver__seaport_1_5_sales.sql | 2 +- .../nft/sales/silver__seaport_1_6_sales.sql | 2 +- models/silver/nft/silver__nft_transfers.sql | 436 ------------- models/silver/nft/silver__nft_transfers.yml | 66 -- ...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_stats__core_metrics_hourly.sql | 80 --- .../silver_stats__core_metrics_hourly.yml | 84 --- .../utilities/silver__number_sequence.sql | 13 - models/sources.yml | 81 +-- .../streamline/bronze/core/bronze__blocks.sql | 35 +- .../bronze/core/bronze__blocks_fr.sql | 22 +- .../bronze/core/bronze__blocks_fr_v1.sql | 38 +- .../bronze/core/bronze__blocks_fr_v2.sql | 36 +- .../bronze/core/bronze__confirm_blocks.sql | 35 +- .../bronze/core/bronze__confirm_blocks_fr.sql | 9 +- .../core/bronze__confirm_blocks_fr_v1.sql | 39 +- .../core/bronze__confirm_blocks_fr_v2.sql | 36 +- .../bronze/core/bronze__receipts.sql | 35 +- .../bronze/core/bronze__receipts_by_hash.sql | 0 .../core/bronze__receipts_by_hash_fr.sql | 0 .../bronze/core/bronze__receipts_fr.sql | 42 +- .../bronze/core/bronze__receipts_fr_v1.sql | 43 +- .../bronze/core/bronze__receipts_fr_v2.sql | 36 +- .../streamline/bronze/core/bronze__traces.sql | 35 +- .../bronze/core/bronze__traces_fr.sql | 9 +- .../bronze/core/bronze__traces_fr_v1.sql | 38 +- .../bronze/core/bronze__traces_fr_v2.sql | 36 +- .../bronze/core/bronze__transactions.sql | 35 +- .../bronze/core/bronze__transactions_fr.sql | 22 +- .../core/bronze__transactions_fr_v1.sql | 38 +- .../core/bronze__transactions_fr_v2.sql | 36 +- .../bronze/decoder/bronze__decoded_logs.sql | 19 +- .../decoder/bronze__decoded_logs_fr.sql | 8 +- .../decoder/bronze__decoded_logs_fr_v1.sql | 18 +- .../decoder/bronze__decoded_logs_fr_v2.sql | 19 +- .../streamline/silver/_24_hour_lookback.sql | 26 - models/streamline/silver/_block_lookback.sql | 11 - .../streamline/silver/_max_block_by_date.sql | 27 - .../streamline/silver/_max_block_by_hour.sql | 37 -- .../complete/streamline__blocks_complete.sql | 50 -- .../streamline__confirm_blocks_complete.sql | 50 -- .../streamline__receipts_complete.sql | 50 -- .../complete/streamline__traces_complete.sql | 50 -- .../streamline__transactions_complete.sql | 50 -- ...treamline__blocks_transactions_history.sql | 112 ---- .../streamline__confirm_blocks_history.sql | 133 ---- .../history/streamline__receipts_history.sql | 113 ---- .../history/streamline__traces_history.sql | 113 ---- ...reamline__blocks_transactions_realtime.sql | 126 ---- .../streamline__confirm_blocks_realtime.sql | 138 ---- .../streamline__receipts_realtime.sql | 130 ---- .../realtime/streamline__traces_realtime.sql | 127 ---- .../silver/core/retry/_missing_receipts.sql | 34 - .../silver/core/retry/_missing_traces.sql | 17 - .../silver/core/retry/_missing_txs.sql | 40 -- .../silver/core/retry/_unconfirmed_blocks.sql | 34 - .../silver/core/streamline__blocks.sql | 36 -- .../silver/core/streamline__get_chainhead.sql | 54 -- .../silver/core/streamline__get_chainhead.yml | 9 - .../streamline__decoded_logs_complete.sql | 50 -- .../streamline__decoded_logs_realtime.sql | 110 ---- package-lock.yml | 18 - packages.yml | 12 +- python/slack_alert.py | 74 --- tests/avax/test_gold__missing_traces.sql | 2 - .../avax/test_gold__recent_missing_traces.sql | 2 - tests/avax/test_silver__confirmed_blocks.sql | 1 - tests/avax/test_silver__missing_receipts.sql | 2 - .../test_silver__recent_confirmed_blocks.sql | 1 - .../test_silver__recent_missing_receipts.sql | 2 - 600 files changed, 1040 insertions(+), 18147 deletions(-) create mode 100644 .github/workflows/dbt_alter_all_gha_tasks.yml delete mode 100644 .github/workflows/dbt_alter_gha_task.yml create mode 100644 .github/workflows/dbt_alter_gha_tasks.yml create mode 100644 .github/workflows/dbt_deploy_new_workflows.yml delete mode 100644 .github/workflows/dbt_run_abi_refresh.yml delete mode 100644 .github/workflows/dbt_run_deployment.yml delete mode 100644 .github/workflows/dbt_run_operation_reorg.yml create mode 100644 .github/workflows/dbt_run_scheduled_abis.yml create mode 100644 .github/workflows/dbt_run_scheduled_decoder.yml create mode 100644 .github/workflows/dbt_run_scheduled_main.yml delete mode 100644 .github/workflows/dbt_run_scheduled_non_realtime.yml create mode 100644 .github/workflows/dbt_run_scheduled_scores.yml delete mode 100644 .github/workflows/dbt_run_streamline_decoded_logs_history.yml delete mode 100644 .github/workflows/dbt_run_streamline_decoder.yml create mode 100644 .github/workflows/dbt_run_streamline_decoder_history.yml create mode 100644 .github/workflows/dbt_run_streamline_history.yml delete mode 100644 .github/workflows/dbt_run_streamline_history_adhoc.yml delete mode 100644 .github/workflows/slack_notify.yml delete mode 100644 data/github_actions__workflows.csv 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/lookback.sql delete mode 100644 macros/streamline/api_integrations.sql delete mode 100644 macros/streamline/get_base_table_udft.sql delete mode 100644 macros/streamline/streamline_udfs.sql delete mode 100644 macros/tests/missing_decoding.sql delete mode 100644 macros/tests/missing_txs.sql delete mode 100644 macros/utils.sql rename models/{doc_descriptions/general => }/__overview__.md (68%) 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/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/Borrowing/Borrow_symbol.md delete mode 100644 models/doc_descriptions/Borrowing/action.md delete mode 100644 models/doc_descriptions/Borrowing/amount.md delete mode 100644 models/doc_descriptions/Borrowing/amount_usd.md delete mode 100644 models/doc_descriptions/Borrowing/asset.md delete mode 100644 models/doc_descriptions/Borrowing/collateral_address.md delete mode 100644 models/doc_descriptions/Borrowing/collateral_symbol.md delete mode 100644 models/doc_descriptions/Lending/Depositor.md delete mode 100644 models/doc_descriptions/Lending/Lending_asset_address.md delete mode 100644 models/doc_descriptions/Lending/Lending_pool_address.md delete mode 100644 models/doc_descriptions/Lending/Lending_symbol.md delete mode 100644 models/doc_descriptions/Lending/action.md delete mode 100644 models/doc_descriptions/Lending/amount.md delete mode 100644 models/doc_descriptions/Lending/amount_usd.md delete mode 100644 models/doc_descriptions/Lending/asset.md delete mode 100644 models/doc_descriptions/Lending/borrower_is_a_contract.md delete mode 100644 models/doc_descriptions/Lending/lender_is_a_contract.md delete mode 100644 models/doc_descriptions/Lending/lending_pool.md delete mode 100644 models/doc_descriptions/Lending/origin_from_address.md delete mode 100644 models/doc_descriptions/Lending/origin_to_address.md delete mode 100644 models/doc_descriptions/blocks/avax_block_header_json.md delete mode 100644 models/doc_descriptions/blocks/avax_blockchain.md delete mode 100644 models/doc_descriptions/blocks/avax_blocks_hash.md delete mode 100644 models/doc_descriptions/blocks/avax_blocks_nonce.md delete mode 100644 models/doc_descriptions/blocks/avax_blocks_table_doc.md delete mode 100644 models/doc_descriptions/blocks/avax_difficulty.md delete mode 100644 models/doc_descriptions/blocks/avax_extra_data.md delete mode 100644 models/doc_descriptions/blocks/avax_gas_limit.md delete mode 100644 models/doc_descriptions/blocks/avax_gas_used.md delete mode 100644 models/doc_descriptions/blocks/avax_miner.md delete mode 100644 models/doc_descriptions/blocks/avax_network.md delete mode 100644 models/doc_descriptions/blocks/avax_parent_hash.md delete mode 100644 models/doc_descriptions/blocks/avax_receipts_root.md delete mode 100644 models/doc_descriptions/blocks/avax_sha3_uncles.md delete mode 100644 models/doc_descriptions/blocks/avax_size.md delete mode 100644 models/doc_descriptions/blocks/avax_total_difficulty.md delete mode 100644 models/doc_descriptions/blocks/avax_tx_count.md delete mode 100644 models/doc_descriptions/blocks/avax_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)/avax_ez_dex_swaps_table_doc.md delete mode 100644 models/doc_descriptions/dex - (imported from layer 1)/avax_sushi__ez_swaps.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/dexalot/core/dexalot_blocks.md delete mode 100644 models/doc_descriptions/dexalot/core/dexalot_event_logs.md delete mode 100644 models/doc_descriptions/dexalot/core/dexalot_traces.md delete mode 100644 models/doc_descriptions/dexalot/core/dexalot_transactions.md delete mode 100644 models/doc_descriptions/dexalot/general/dexalot_block_number.md delete mode 100644 models/doc_descriptions/dexalot/general/dexalot_block_timestamp.md delete mode 100644 models/doc_descriptions/dexalot/general/dexalot_decimals.md delete mode 100644 models/doc_descriptions/dexalot/general/dexalot_from_address.md delete mode 100644 models/doc_descriptions/dexalot/general/dexalot_ingested_at.md delete mode 100644 models/doc_descriptions/dexalot/general/dexalot_symbol.md delete mode 100644 models/doc_descriptions/dexalot/general/dexalot_to_address.md delete mode 100644 models/doc_descriptions/event_logs/avax_event_index.md delete mode 100644 models/doc_descriptions/event_logs/avax_event_inputs.md delete mode 100644 models/doc_descriptions/event_logs/avax_event_name.md delete mode 100644 models/doc_descriptions/event_logs/avax_event_removed.md delete mode 100644 models/doc_descriptions/event_logs/avax_event_sig.md delete mode 100644 models/doc_descriptions/event_logs/avax_log_id_events.md delete mode 100644 models/doc_descriptions/event_logs/avax_logs_contract_address.md delete mode 100644 models/doc_descriptions/event_logs/avax_logs_contract_name.md delete mode 100644 models/doc_descriptions/event_logs/avax_logs_data.md delete mode 100644 models/doc_descriptions/event_logs/avax_logs_table_doc.md delete mode 100644 models/doc_descriptions/event_logs/avax_logs_tx_hash.md delete mode 100644 models/doc_descriptions/event_logs/avax_origin_from.md delete mode 100644 models/doc_descriptions/event_logs/avax_origin_to.md delete mode 100644 models/doc_descriptions/event_logs/avax_topics.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/avax_block_number.md delete mode 100644 models/doc_descriptions/general/avax_block_timestamp.md delete mode 100644 models/doc_descriptions/general/avax_decimals.md delete mode 100644 models/doc_descriptions/general/avax_from_address.md delete mode 100644 models/doc_descriptions/general/avax_ingested_at.md delete mode 100644 models/doc_descriptions/general/avax_symbol.md delete mode 100644 models/doc_descriptions/general/avax_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/avax_label.md delete mode 100644 models/doc_descriptions/labels/avax_label_address.md delete mode 100644 models/doc_descriptions/labels/avax_label_address_name.md delete mode 100644 models/doc_descriptions/labels/avax_label_blockchain.md delete mode 100644 models/doc_descriptions/labels/avax_label_creator.md delete mode 100644 models/doc_descriptions/labels/avax_label_subtype.md delete mode 100644 models/doc_descriptions/labels/avax_label_type.md delete mode 100644 models/doc_descriptions/labels/avax_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/avax_traces_block_no.md delete mode 100644 models/doc_descriptions/traces/avax_traces_blocktime.md delete mode 100644 models/doc_descriptions/traces/avax_traces_call_data.md delete mode 100644 models/doc_descriptions/traces/avax_traces_from.md delete mode 100644 models/doc_descriptions/traces/avax_traces_gas.md delete mode 100644 models/doc_descriptions/traces/avax_traces_gas_used.md delete mode 100644 models/doc_descriptions/traces/avax_traces_identifier.md delete mode 100644 models/doc_descriptions/traces/avax_traces_index.md delete mode 100644 models/doc_descriptions/traces/avax_traces_input.md delete mode 100644 models/doc_descriptions/traces/avax_traces_output.md delete mode 100644 models/doc_descriptions/traces/avax_traces_sub.md delete mode 100644 models/doc_descriptions/traces/avax_traces_table_doc.md delete mode 100644 models/doc_descriptions/traces/avax_traces_to.md delete mode 100644 models/doc_descriptions/traces/avax_traces_tx_hash.md delete mode 100644 models/doc_descriptions/traces/avax_traces_type.md delete mode 100644 models/doc_descriptions/traces/avax_traces_value.md delete mode 100644 models/doc_descriptions/transactions/avax_cumulative_gas_used.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_block_hash.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_fee.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_gas_limit.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_gas_price.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_gas_used.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_hash.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_input_data.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_json.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_nonce.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_origin_sig.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_position.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_status.md delete mode 100644 models/doc_descriptions/transactions/avax_tx_table_doc.md delete mode 100644 models/doc_descriptions/transactions/avax_value.md delete mode 100644 models/doc_descriptions/transfers/avax_eth_amount.md delete mode 100644 models/doc_descriptions/transfers/avax_eth_amount_usd.md delete mode 100644 models/doc_descriptions/transfers/avax_ez_eth_transfers_table_doc.md delete mode 100644 models/doc_descriptions/transfers/avax_ez_transfer_table_doc.md delete mode 100644 models/doc_descriptions/transfers/avax_log_id_transfers.md delete mode 100644 models/doc_descriptions/transfers/avax_origin_to.md delete mode 100644 models/doc_descriptions/transfers/avax_transfer_amount.md delete mode 100644 models/doc_descriptions/transfers/avax_transfer_amount_usd.md delete mode 100644 models/doc_descriptions/transfers/avax_transfer_contract_address.md delete mode 100644 models/doc_descriptions/transfers/avax_transfer_from_address.md delete mode 100644 models/doc_descriptions/transfers/avax_transfer_has_decimal.md delete mode 100644 models/doc_descriptions/transfers/avax_transfer_has_price.md delete mode 100644 models/doc_descriptions/transfers/avax_transfer_raw_amount.md delete mode 100644 models/doc_descriptions/transfers/avax_transfer_to_address.md delete mode 100644 models/doc_descriptions/transfers/avax_transfer_token_price.md delete mode 100644 models/doc_descriptions/transfers/avax_transfer_tx_hash.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/stats/stats__ez_core_metrics_hourly.sql delete mode 100644 models/gold/stats/stats__ez_core_metrics_hourly.yml delete mode 100644 models/gold/tests/test_gold__ez_avax_transfers_full.sql delete mode 100644 models/gold/tests/test_gold__ez_avax_transfers_full.yml delete mode 100644 models/gold/tests/test_gold__ez_avax_transfers_recent.sql delete mode 100644 models/gold/tests/test_gold__ez_avax_transfers_recent.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/nft/silver__nft_transfers.sql delete mode 100644 models/silver/nft/silver__nft_transfers.yml delete mode 100644 models/silver/prices/silver__complete_native_asset_metadata.sql delete mode 100644 models/silver/prices/silver__complete_native_asset_metadata.yml delete mode 100644 models/silver/prices/silver__complete_native_prices.sql delete mode 100644 models/silver/prices/silver__complete_native_prices.yml delete mode 100644 models/silver/prices/silver__complete_provider_asset_metadata.sql delete mode 100644 models/silver/prices/silver__complete_provider_asset_metadata.yml delete mode 100644 models/silver/prices/silver__complete_provider_prices.sql delete mode 100644 models/silver/prices/silver__complete_provider_prices.yml delete mode 100644 models/silver/prices/silver__complete_token_asset_metadata.sql delete mode 100644 models/silver/prices/silver__complete_token_asset_metadata.yml delete mode 100644 models/silver/prices/silver__complete_token_prices.sql delete mode 100644 models/silver/prices/silver__complete_token_prices.yml delete mode 100644 models/silver/stats/silver_stats__core_metrics_hourly.sql delete mode 100644 models/silver/stats/silver_stats__core_metrics_hourly.yml delete mode 100644 models/silver/utilities/silver__number_sequence.sql create mode 100644 models/streamline/bronze/core/bronze__receipts_by_hash.sql create mode 100644 models/streamline/bronze/core/bronze__receipts_by_hash_fr.sql delete mode 100644 models/streamline/silver/_24_hour_lookback.sql delete mode 100644 models/streamline/silver/_block_lookback.sql delete mode 100644 models/streamline/silver/_max_block_by_date.sql delete mode 100644 models/streamline/silver/_max_block_by_hour.sql delete mode 100644 models/streamline/silver/core/complete/streamline__blocks_complete.sql delete mode 100644 models/streamline/silver/core/complete/streamline__confirm_blocks_complete.sql delete mode 100644 models/streamline/silver/core/complete/streamline__receipts_complete.sql delete mode 100644 models/streamline/silver/core/complete/streamline__traces_complete.sql delete mode 100644 models/streamline/silver/core/complete/streamline__transactions_complete.sql delete mode 100644 models/streamline/silver/core/history/streamline__blocks_transactions_history.sql delete mode 100644 models/streamline/silver/core/history/streamline__confirm_blocks_history.sql delete mode 100644 models/streamline/silver/core/history/streamline__receipts_history.sql delete mode 100644 models/streamline/silver/core/history/streamline__traces_history.sql delete mode 100644 models/streamline/silver/core/realtime/streamline__blocks_transactions_realtime.sql delete mode 100644 models/streamline/silver/core/realtime/streamline__confirm_blocks_realtime.sql delete mode 100644 models/streamline/silver/core/realtime/streamline__receipts_realtime.sql delete mode 100644 models/streamline/silver/core/realtime/streamline__traces_realtime.sql delete mode 100644 models/streamline/silver/core/retry/_missing_receipts.sql delete mode 100644 models/streamline/silver/core/retry/_missing_traces.sql delete mode 100644 models/streamline/silver/core/retry/_missing_txs.sql delete mode 100644 models/streamline/silver/core/retry/_unconfirmed_blocks.sql delete mode 100644 models/streamline/silver/core/streamline__blocks.sql delete mode 100644 models/streamline/silver/core/streamline__get_chainhead.sql delete mode 100644 models/streamline/silver/core/streamline__get_chainhead.yml delete mode 100644 models/streamline/silver/decoded_logs/complete/streamline__decoded_logs_complete.sql delete mode 100644 models/streamline/silver/decoded_logs/realtime/streamline__decoded_logs_realtime.sql delete mode 100644 package-lock.yml delete mode 100644 python/slack_alert.py delete mode 100644 tests/avax/test_gold__missing_traces.sql delete mode 100644 tests/avax/test_gold__recent_missing_traces.sql delete mode 100644 tests/avax/test_silver__confirmed_blocks.sql delete mode 100644 tests/avax/test_silver__missing_receipts.sql delete mode 100644 tests/avax/test_silver__recent_confirmed_blocks.sql delete mode 100644 tests/avax/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..086327d --- /dev/null +++ b/.github/workflows/dbt_alter_all_gha_tasks.yml @@ -0,0 +1,27 @@ +name: dbt_alter_all_gha_tasks +run-name: dbt_alter_all_gha_tasks + +on: + workflow_dispatch: + branches: + - "main" + inputs: + task_action: + type: choice + description: Action to perform on all tasks + required: true + options: + - RESUME + - SUSPEND + default: RESUME + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_alter_all_gha_tasks.yml@pre-release/v4-beta + with: + task_action: ${{ inputs.task_action }} + target: prod + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_alter_gha_task.yml b/.github/workflows/dbt_alter_gha_task.yml deleted file mode 100644 index ab1c7e9..0000000 --- a/.github/workflows/dbt_alter_gha_task.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: dbt_alter_gha_task -run-name: dbt_alter_gha_task - -on: - workflow_dispatch: - branches: - - "main" - inputs: - workflow_name: - type: string - description: Name of the workflow to perform the action on, no .yml extension - required: true - task_action: - type: choice - description: Action to perform - required: true - options: - - SUSPEND - - RESUME - default: SUSPEND - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - - - -jobs: - called_workflow_template: - uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_alter_gha_tasks.yml@AN-4374/upgrade-dbt-1.7 - with: - workflow_name: | - ${{ inputs.workflow_name }} - task_action: | - ${{ inputs.task_action }} - environment: workflow_prod - secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_alter_gha_tasks.yml b/.github/workflows/dbt_alter_gha_tasks.yml new file mode 100644 index 0000000..be92ee5 --- /dev/null +++ b/.github/workflows/dbt_alter_gha_tasks.yml @@ -0,0 +1,32 @@ +name: dbt_alter_gha_tasks +run-name: dbt_alter_gha_tasks + +on: + workflow_dispatch: + branches: + - "main" + inputs: + workflow_name: + type: string + description: Name of the workflow to perform the action on, no .yml extension + required: true + task_action: + type: choice + description: Action to perform + required: true + options: + - SUSPEND + - RESUME + default: SUSPEND + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_alter_gha_tasks.yml@pre-release/v4-beta + with: + workflow_name: ${{ inputs.workflow_name }} + task_action: ${{ inputs.task_action }} + target: prod + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_deploy_new_workflows.yml b/.github/workflows/dbt_deploy_new_workflows.yml new file mode 100644 index 0000000..a9a877d --- /dev/null +++ b/.github/workflows/dbt_deploy_new_workflows.yml @@ -0,0 +1,19 @@ +name: dbt_deploy_new_workflows +run-name: dbt_deploy_new_workflows + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Deploy New Github Actions + command: | + make deploy_new_gha_tasks DBT_TARGET=prod + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_docs_update.yml b/.github/workflows/dbt_docs_update.yml index b058bc0..10ec0ba 100644 --- a/.github/workflows/dbt_docs_update.yml +++ b/.github/workflows/dbt_docs_update.yml @@ -5,77 +5,10 @@ on: branches: - "main" -env: - USE_VARS: "${{ vars.USE_VARS }}" - DBT_PROFILES_DIR: "${{ vars.DBT_PROFILES_DIR }}" - DBT_VERSION: "${{ vars.DBT_VERSION }}" - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - concurrency: group: ${{ github.workflow }} - - jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: refresh ddl for datashare - run: | - cnt=$(dbt ls -m fsc_utils.datashare._datashare___create_gold | wc -l ); if [ $cnt -eq 1 ]; then dbt run -m fsc_utils.datashare._datashare___create_gold; fi; - - name: checkout docs branch - run: | - git checkout -B docs origin/main - - name: generate dbt docs - run: dbt docs generate -t prod - - - name: move files to docs directory - run: | - mkdir -p ./docs - cp target/{catalog.json,manifest.json,index.html} docs/ - - name: clean up target directory - run: dbt clean - - - name: check for changes - run: git status - - - name: stage changed files - run: git add . - - - name: commit changed files - run: | - git config user.email "abc@xyz" - git config user.name "github-actions" - git commit -am "Auto-update docs" - - name: push changes to docs - run: | - git push -f --set-upstream origin docs - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ 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 f46d574..e625bc6 100644 --- a/.github/workflows/dbt_integration_test.yml +++ b/.github/workflows/dbt_integration_test.yml @@ -3,38 +3,20 @@ run-name: ${{ github.event.inputs.branch }} on: workflow_dispatch: + branches: + - "main" inputs: environment: - required: true type: string + required: true concurrency: ${{ github.workflow }} jobs: - prepare_vars: - runs-on: ubuntu-latest - environment: - name: ${{ inputs.environment }} - outputs: - warehouse: ${{ steps.set_outputs.outputs.warehouse }} - steps: - - name: Set warehouse output - id: set_outputs - run: | - echo "warehouse=${{ vars.WAREHOUSE }}" >> $GITHUB_OUTPUT called_workflow_template: - needs: prepare_vars - uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt.yml@main + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template_integration_test.yml@pre-release/v4-beta with: - command: > + target: ${{ inputs.environment }} + command: | dbt test --selector 'integration_tests' - environment: ${{ inputs.environment }} - warehouse: ${{ needs.prepare_vars.outputs.warehouse }} secrets: inherit - - notify-failure: - needs: [called_workflow_template] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ 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 de656f3..0000000 --- a/.github/workflows/dbt_run_abi_refresh.yml +++ /dev/null @@ -1,58 +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 "avalanche_models,tag:abis" - - - name: Kick off decoded logs history, if there are new ABIs from users - run: | - dbt run-operation run_decoded_logs_history - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_run_adhoc.yml b/.github/workflows/dbt_run_adhoc.yml index 8111ed9..30a3481 100644 --- a/.github/workflows/dbt_run_adhoc.yml +++ b/.github/workflows/dbt_run_adhoc.yml @@ -1,12 +1,12 @@ name: dbt_run_adhoc -run-name: dbt_run_adhoc +run-name: ${{ inputs.dbt_command }} on: workflow_dispatch: branches: - "main" inputs: - environment: + target: type: choice description: DBT Run Environment required: true @@ -29,48 +29,15 @@ on: description: 'DBT Run Command' required: true -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ inputs.warehouse }}" - SCHEMA: "${{ vars.SCHEMA }}" - concurrency: group: ${{ github.workflow }} - - jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_${{ inputs.environment }} - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - ${{ inputs.dbt_command }} - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + 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 7775560..938995c 100644 --- a/.github/workflows/dbt_run_dev_refresh.yml +++ b/.github/workflows/dbt_run_dev_refresh.yml @@ -3,82 +3,13 @@ run-name: dbt_run_dev_refresh on: workflow_dispatch: - schedule: - # Runs "at 9:20 UTC on Monday" (see https://crontab.guru) - - cron: '20 9 * * 1' - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" + branches: + - "main" concurrency: group: ${{ github.workflow }} - - jobs: - run_dbt_jobs_refresh: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run Dev Refresh - run: | - dbt run-operation run_sp_create_prod_clone - - notify-failure: - needs: [run_dbt_jobs_refresh] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - - run_dbt_jobs_udfs: - runs-on: ubuntu-latest - needs: run_dbt_jobs_refresh - environment: - name: workflow_dev - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run Recreate UDFs - run: | - dbt run-operation fsc_utils.create_evm_streamline_udfs --vars '{"UPDATE_UDFS_AND_SPS":True}' -t dev - dbt run -s livequery_models.deploy.core._live --vars '{"UPDATE_UDFS_AND_SPS":True}' -t dev - - notify-failure2: - needs: [run_dbt_jobs_udfs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ 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 4359f7f..ebfc154 100644 --- a/.github/workflows/dbt_run_full_observability.yml +++ b/.github/workflows/dbt_run_full_observability.yml @@ -3,52 +3,21 @@ run-name: dbt_run_full_observability on: workflow_dispatch: - schedule: - # Runs “At 04:00 on day-of-month 1.” (see https://crontab.guru) - - cron: '0 4 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 "avalanche_models,tag:observability" + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + warehouse: DBT_EMERGENCY + command_name: Run Observability Models + command: | + dbt run --threads 2 --vars '{"MAIN_OBSERV_FULL_TEST_ENABLED":True}' -m "fsc_evm,tag:observability" + secrets: inherit - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + + diff --git a/.github/workflows/dbt_run_heal_models.yml b/.github/workflows/dbt_run_heal_models.yml index 882cab3..6eaf50f 100644 --- a/.github/workflows/dbt_run_heal_models.yml +++ b/.github/workflows/dbt_run_heal_models.yml @@ -3,52 +3,17 @@ run-name: dbt_run_heal_models on: workflow_dispatch: - schedule: - # Runs at 04:25 on Wednesday (see https://crontab.guru) - - cron: '25 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 "avalanche_models,tag:heal" --vars '{"HEAL_MODEL":True}' - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ 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 3cbb3d5..0000000 --- a/.github/workflows/dbt_run_operation_reorg.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: dbt_run_operation_reorg -run-name: dbt_run_operation_reorg - -on: - workflow_dispatch: - schedule: - # Runs at minute 30 on Monday at 00:00 UTC (see https://crontab.guru) - - cron: '30 0 * * 1' - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - - - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: List reorg models - id: list_models - run: | - reorg_model_list=$(dbt list --select "avalanche_models,tag:reorg" --resource-type model --output name | grep '__' | awk -F'.' '{print $NF}' | tr '\n' ',' | sed 's/,$//') - echo "model_list=$reorg_model_list" >> $GITHUB_OUTPUT - - - name: Execute block_reorg macro - run: | - dbt run-operation fsc_utils.block_reorg --args "{reorg_model_list: '${{ steps.list_models.outputs.model_list }}', hours: '169'}" && awk '/SQL status/ {print; next} /DELETE FROM/{getline; print} /\/\* {/ {print}' logs/dbt.log - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file 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 987286c..61d9d16 100644 --- a/.github/workflows/dbt_run_scheduled_curated.yml +++ b/.github/workflows/dbt_run_scheduled_curated.yml @@ -5,49 +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 "avalanche_models,tag:curated" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ 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..253ad79 --- /dev/null +++ b/.github/workflows/dbt_run_scheduled_main.yml @@ -0,0 +1,19 @@ +name: dbt_run_scheduled_main +run-name: dbt_run_scheduled_main + +on: + workflow_dispatch: + branches: + - "main" + +concurrency: + group: ${{ github.workflow }} + +jobs: + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + command_name: Run Main Models + command: | + dbt run -m "fsc_evm,tag:bronze,tag:core" "fsc_evm,tag:silver,tag:core" "fsc_evm,tag:gold,tag:core" "fsc_evm,tag:silver,tag:prices" "fsc_evm,tag:gold,tag:prices" "fsc_evm,tag:silver,tag:labels" "fsc_evm,tag:gold,tag:labels" "fsc_evm,tag:streamline,tag:decoded_logs,tag:realtime" "fsc_evm,tag:streamline,tag:decoded_logs,tag:complete" "fsc_evm,tag:streamline,tag:abis,tag:realtime" "fsc_evm,tag:streamline,tag:abis,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True}' + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_scheduled_non_realtime.yml b/.github/workflows/dbt_run_scheduled_non_realtime.yml deleted file mode 100644 index 2d24523..0000000 --- a/.github/workflows/dbt_run_scheduled_non_realtime.yml +++ /dev/null @@ -1,53 +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 "avalanche_models,tag:non_realtime" "avalanche_models,tag:streamline_decoded_logs_complete" "avalanche_models,tag:streamline_decoded_logs_realtime" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ 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 020f603..efa0176 100644 --- a/.github/workflows/dbt_run_streamline_chainhead.yml +++ b/.github/workflows/dbt_run_streamline_chainhead.yml @@ -6,52 +6,15 @@ on: branches: - "main" -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - concurrency: group: ${{ github.workflow }} - - jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "avalanche_models,tag:streamline_core_complete" "avalanche_models,tag:streamline_core_realtime" "avalanche_models,tag:streamline_core_complete_receipts" "avalanche_models,tag:streamline_core_realtime_receipts" "avalanche_models,tag:streamline_core_complete_confirm_blocks" "avalanche_models,tag:streamline_core_realtime_confirm_blocks" - - - name: Run Chainhead Tests - run: | - dbt test -m "avalanche_models,tag:chainhead" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ 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:chainhead" "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts_by_hash" + dbt test -m "fsc_evm,tag:chainhead" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/dbt_run_streamline_decoded_logs_history.yml b/.github/workflows/dbt_run_streamline_decoded_logs_history.yml deleted file mode 100644 index 93d737e..0000000 --- a/.github/workflows/dbt_run_streamline_decoded_logs_history.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: dbt_run_streamline_decoded_logs_history -run-name: dbt_run_streamline_decoded_logs_history - -on: - workflow_dispatch: - branches: - - "main" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ vars.WAREHOUSE }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_prod - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - - name: Update complete table - run: | - dbt run -m "avalanche_models,tag:streamline_decoded_logs_complete" - - - name: Decode historical logs - run: | - dbt run-operation decoded_logs_history --vars '{"STREAMLINE_INVOKE_STREAMS":True}' - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ 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 002d147..0000000 --- a/.github/workflows/dbt_run_streamline_decoder.yml +++ /dev/null @@ -1,53 +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 "avalanche_models,tag:decoded_logs" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ 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_dexalot_chainhead.yml b/.github/workflows/dbt_run_streamline_dexalot_chainhead.yml index ed0b444..d216c3c 100644 --- a/.github/workflows/dbt_run_streamline_dexalot_chainhead.yml +++ b/.github/workflows/dbt_run_streamline_dexalot_chainhead.yml @@ -5,6 +5,8 @@ on: workflow_dispatch: branches: - "main" + schedule: + - cron: '50 * * * *' env: DBT_PROFILES_DIR: ./ diff --git a/.github/workflows/dbt_run_streamline_dexalot_history.yml b/.github/workflows/dbt_run_streamline_dexalot_history.yml index 83a3b8b..2fd42cb 100644 --- a/.github/workflows/dbt_run_streamline_dexalot_history.yml +++ b/.github/workflows/dbt_run_streamline_dexalot_history.yml @@ -4,7 +4,6 @@ run-name: dbt_run_streamline_dexalot_history on: workflow_dispatch: schedule: - # Runs at minute 37 past every hour - cron: '37 * * * *' env: diff --git a/.github/workflows/dbt_run_streamline_dexalot_non_realtime.yml b/.github/workflows/dbt_run_streamline_dexalot_non_realtime.yml index f86c3f7..4c9a2b0 100644 --- a/.github/workflows/dbt_run_streamline_dexalot_non_realtime.yml +++ b/.github/workflows/dbt_run_streamline_dexalot_non_realtime.yml @@ -5,6 +5,8 @@ on: workflow_dispatch: branches: - "main" + schedule: + - cron: '5 * * * *' env: DBT_PROFILES_DIR: ./ 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 9d21679..0000000 --- a/.github/workflows/dbt_run_streamline_history_adhoc.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: dbt_run_streamline_history_adhoc -run-name: dbt_run_streamline_history_adhoc - -on: - workflow_dispatch: - branches: - - "main" - inputs: - environment: - type: choice - description: DBT Run Environment - required: true - options: - - dev - - prod - - prod_backfill - default: dev - warehouse: - type: choice - description: Snowflake warehouse - required: true - options: - - DBT - - DBT_CLOUD - - DBT_EMERGENCY - default: DBT - dbt_command: - type: choice - description: 'DBT Run Command' - required: true - options: - - dbt run --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -m "avalanche_models,tag:streamline_core_complete" "avalanche_models,tag:streamline_core_history" "avalanche_models,tag:streamline_core_complete_receipts" "avalanche_models,tag:streamline_core_history_receipts" "avalanche_models,tag:streamline_core_complete_confirm_blocks" "avalanche_models,tag:streamline_core_history_confirm_blocks" - - dbt run --threads 8 --vars '{"STREAMLINE_INVOKE_STREAMS":True,"WAIT":120}' -m "avalanche_models,tag:streamline_decoded_logs_complete" "avalanche_models,tag:streamline_decoded_logs_history" - -env: - DBT_PROFILES_DIR: ./ - - ACCOUNT: "${{ vars.ACCOUNT }}" - ROLE: "${{ vars.ROLE }}" - USER: "${{ vars.USER }}" - PASSWORD: "${{ secrets.PASSWORD }}" - REGION: "${{ vars.REGION }}" - DATABASE: "${{ vars.DATABASE }}" - WAREHOUSE: "${{ inputs.warehouse }}" - SCHEMA: "${{ vars.SCHEMA }}" - -concurrency: - group: ${{ github.workflow }} - - - -jobs: - run_dbt_jobs: - runs-on: ubuntu-latest - environment: - name: workflow_${{ inputs.environment }} - - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: "pip" - - - name: install dependencies - run: | - pip install -r requirements.txt - dbt deps - - name: Run DBT Jobs - run: | - ${{ inputs.dbt_command }} - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dbt_test_daily.yml b/.github/workflows/dbt_test_daily.yml index 8a85872..eaa9635 100644 --- a/.github/workflows/dbt_test_daily.yml +++ b/.github/workflows/dbt_test_daily.yml @@ -1,55 +1,23 @@ -name: dbt_test_daily +name: dbt_test_daily run-name: dbt_test_daily on: workflow_dispatch: - schedule: - # Runs "at 9:00 UTC" (see https://crontab.guru) - - cron: '0 9 * * *' + 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 "avalanche_models,tag:full_test" "avalanche_models,tag:recent_test" "avalanche_models,tag:gha_tasks" livequery_models - - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + 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 54fdcb9..817a126 100644 --- a/.github/workflows/dbt_test_intraday.yml +++ b/.github/workflows/dbt_test_intraday.yml @@ -6,49 +6,16 @@ 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_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 "avalanche_models,tag:observability" - dbt test -m "avalanche_models,tag:recent_test" --exclude models/dexalot - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + target: test + command_name: Run Observability & Recent Tests + command: | + dbt run -m "fsc_evm,tag:observability" + dbt test -m "fsc_evm,tag:recent_test" --exclude models/dexalot + 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 3c97cff..cf47c45 100644 --- a/.github/workflows/dbt_test_monthly.yml +++ b/.github/workflows/dbt_test_monthly.yml @@ -3,52 +3,21 @@ run-name: dbt_test_monthly on: workflow_dispatch: - schedule: - # Runs "at 4:00 UTC on 28th of the month" (see https://crontab.guru) - - cron: '0 4 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 "avalanche_models,tag:full_test" - - notify-failure: - needs: [run_dbt_jobs] - if: failure() - uses: ./.github/workflows/slack_notify.yml - secrets: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + called_workflow_template: + uses: FlipsideCrypto/fsc-evm/.github/workflows/dbt_run_template.yml@pre-release/v4-beta + with: + warehouse: DBT_EMERGENCY + command_name: Build Full Testing Views + command: | + dbt run -m "fsc_evm,tag:full_test" + command_name_2: Run Full Tests + command_2: | + dbt test -m "fsc_evm,tag:full_test" + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/slack_notify.yml b/.github/workflows/slack_notify.yml deleted file mode 100644 index 1866ba2..0000000 --- a/.github/workflows/slack_notify.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Slack Notification -on: - workflow_call: - secrets: - SLACK_WEBHOOK_URL: - required: true - -jobs: - notify: - runs-on: ubuntu-latest - environment: workflow_prod - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Install dependencies - run: pip install requests - - - name: Send Slack notification - run: python python/slack_alert.py - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 772b5fd..c00d5c3 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,4 @@ logs/ dbt-env/ .user.yml -package-lock.yml \ No newline at end of file +/package-lock.yml \ No newline at end of file diff --git a/Makefile b/Makefile index 2a695b8..92ccf34 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,109 @@ -SHELL := /bin/bash +DBT_TARGET ?= dev +RECEIPTS_BY_HASH_ENABLED ?= false -dbt-console: - docker-compose run dbt_console +cleanup_time: + @set -e; \ + rm -f package-lock.yml && dbt clean && dbt deps -.PHONY: dbt-console \ No newline at end of file +deploy_gha_workflows_table: + @set -e; \ + echo "Collecting workflow names..." ; \ + WORKFLOW_VALUES="" ; \ + for file in $$(find .github/workflows -name "*.yml" -type f); do \ + filename=$$(basename "$$file" .yml) ; \ + if [ -z "$$WORKFLOW_VALUES" ]; then \ + WORKFLOW_VALUES="('$$filename')" ; \ + else \ + WORKFLOW_VALUES="$$WORKFLOW_VALUES,('$$filename')" ; \ + fi ; \ + done ; \ + echo "Found workflows: $$WORKFLOW_VALUES" ; \ + dbt run-operation create_workflow_table --args "{\"workflow_values\": \"$$WORKFLOW_VALUES\"}" -t $(DBT_TARGET) + +deploy_gha_tasks: + @set -e; \ + make deploy_gha_workflows_table DBT_TARGET=$(DBT_TARGET); \ + dbt run -s livequery_models.deploy.marketplace.github --vars '{"UPDATE_UDFS_AND_SPS":True}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:gha_tasks" --full-refresh -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.create_gha_tasks --vars '{"RESUME_GHA_TASKS":True}' -t $(DBT_TARGET) + +deploy_new_gha_tasks: + @set -e; \ + make deploy_gha_workflows_table DBT_TARGET=$(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:gha_tasks" --full-refresh -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.create_gha_tasks --vars '{"RESUME_GHA_TASKS":True}' -t $(DBT_TARGET) + +deploy_livequery: + @set -e; \ + dbt run-operation fsc_evm.drop_livequery_schemas --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run -m livequery_models.deploy.core --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.livequery_grants --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET) + +deploy_chain_phase_1: + @set -e; \ + dbt run -m livequery_models.deploy.core --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.livequery_grants --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.create_evm_streamline_udfs --vars '{"UPDATE_UDFS_AND_SPS": true}' -t $(DBT_TARGET); \ + dbt run-operation fsc_evm.call_sample_rpc_node -t $(DBT_TARGET); \ + if [ "$(DBT_TARGET)" != "prod" ]; then \ + if [ "$(RECEIPTS_BY_HASH_ENABLED)" = "true" ]; then \ + dbt run -m "fsc_evm,tag:phase_1" --exclude "fsc_evm,tag:receipts" --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true, "MAIN_SL_NEW_BUILD_ENABLED": true, "GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET); \ + dbt test -m "fsc_evm,tag:chainhead"; \ + dbt run -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts" "fsc_evm,tag:confirm_blocks" --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "STREAMLINE_INVOKE_STREAMS":True, "MAIN_SL_TESTING_LIMIT": 500}' -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_1" --exclude "fsc_evm,tag:receipts_by_hash" --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true, "MAIN_SL_NEW_BUILD_ENABLED": true, "GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET); \ + dbt test -m "fsc_evm,tag:chainhead"; \ + dbt run -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts_by_hash" "fsc_evm,tag:confirm_blocks" --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "STREAMLINE_INVOKE_STREAMS":True, "MAIN_SL_TESTING_LIMIT": 500}' -t $(DBT_TARGET); \ + fi; \ + else \ + if [ "$(RECEIPTS_BY_HASH_ENABLED)" = "true" ]; then \ + dbt run -m "fsc_evm,tag:phase_1" --exclude "fsc_evm,tag:receipts" --full-refresh --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET); \ + dbt test -m "fsc_evm,tag:chainhead"; \ + dbt run -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts" "fsc_evm,tag:confirm_blocks" --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "STREAMLINE_INVOKE_STREAMS":True}' -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_1" --exclude "fsc_evm,tag:receipts_by_hash" --full-refresh --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "GLOBAL_STREAMLINE_FR_ENABLED": true}' -t $(DBT_TARGET); \ + dbt test -m "fsc_evm,tag:chainhead"; \ + dbt run -m "fsc_evm,tag:streamline,tag:core,tag:complete" "fsc_evm,tag:streamline,tag:core,tag:realtime" --exclude "fsc_evm,tag:receipts_by_hash" "fsc_evm,tag:confirm_blocks" --vars '{"MAIN_SL_NEW_BUILD_ENABLED": true, "STREAMLINE_INVOKE_STREAMS":True}' -t $(DBT_TARGET); \ + fi; \ + fi; \ + echo "# wait ~10 minutes"; \ + echo "# run deploy_chain_phase_2" + +deploy_chain_phase_2: + @set -e; \ + if [ "$(DBT_TARGET)" != "prod" ]; then \ + dbt run -m "fsc_evm,tag:phase_2" --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true, "GLOBAL_STREAMLINE_FR_ENABLED": true, "GLOBAL_BRONZE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true, "GLOBAL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:streamline,tag:abis,tag:realtime" "fsc_evm,tag:streamline,tag:abis,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True, "DECODER_SL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_2" --full-refresh --vars '{"GLOBAL_STREAMLINE_FR_ENABLED": true, "GLOBAL_BRONZE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true, "GLOBAL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:streamline,tag:abis,tag:realtime" "fsc_evm,tag:streamline,tag:abis,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True, "DECODER_SL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + fi; \ + echo "# wait ~10 minutes"; \ + echo "# run deploy_chain_phase_3" + +deploy_chain_phase_3: + @set -e; \ + if [ "$(DBT_TARGET)" != "prod" ]; then \ + dbt run -m "fsc_evm,tag:phase_2" --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:phase_3" --full-refresh --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true, "GLOBAL_STREAMLINE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true, "GLOBAL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:silver,tag:abis" "fsc_evm,tag:streamline,tag:decoded_logs,tag:realtime" "fsc_evm,tag:streamline,tag:decoded_logs,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True, "DECODER_SL_TESTING_LIMIT": 500}' -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_2" -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:phase_3" --full-refresh --vars '{"GLOBAL_STREAMLINE_FR_ENABLED": true, "GLOBAL_SILVER_FR_ENABLED": true, "GLOBAL_GOLD_FR_ENABLED": true, "GLOBAL_NEW_BUILD_ENABLED": true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:silver,tag:abis" "fsc_evm,tag:streamline,tag:decoded_logs,tag:realtime" "fsc_evm,tag:streamline,tag:decoded_logs,tag:complete" --vars '{"STREAMLINE_INVOKE_STREAMS":True}' -t $(DBT_TARGET); \ + fi; \ + echo "# wait ~10 minutes"; \ + echo "# run deploy_chain_phase_4" + +deploy_chain_phase_4: + @set -e; \ + if [ "$(DBT_TARGET)" != "prod" ]; then \ + dbt run -m "fsc_evm,tag:phase_3" --vars '{"STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES":true}' -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:phase_4" --full-refresh -t $(DBT_TARGET); \ + else \ + dbt run -m "fsc_evm,tag:phase_3" -t $(DBT_TARGET); \ + dbt run -m "fsc_evm,tag:phase_4" --full-refresh -t $(DBT_TARGET); \ + make deploy_gha_tasks DBT_TARGET=$(DBT_TARGET); \ + fi; \ + +.PHONY: cleanup_time deploy_gha_workflows_table deploy_gha_tasks deploy_new_gha_tasks deploy_livequery deploy_chain_phase_1 deploy_chain_phase_2 deploy_chain_phase_3 deploy_chain_phase_4 \ No newline at end of file diff --git a/data/github_actions__workflows.csv b/data/github_actions__workflows.csv deleted file mode 100644 index 8094966..0000000 --- a/data/github_actions__workflows.csv +++ /dev/null @@ -1,10 +0,0 @@ -workflow_name,workflow_schedule -dbt_run_scheduled_non_realtime,"17,47 * * * *" -dbt_run_streamline_chainhead,"10,40 * * * *" -dbt_run_streamline_decoder,"25,55 * * * *" -dbt_run_scheduled_curated,"35 * * * *" -dbt_test_intraday,"37 */4 * * *" -dbt_run_streamline_dexalot_chainhead,"50 * * * *" -dbt_run_streamline_dexalot_non_realtime,"5 * * * *" -dbt_run_streamline_decoded_logs_history,"19 19 * * 6" -dbt_run_abi_refresh,"10 23 * * *" \ No newline at end of file diff --git a/dbt_project.yml b/dbt_project.yml index 549aaf9..a2adcd8 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -17,6 +17,8 @@ test-paths: ["tests"] seed-paths: ["data"] macro-paths: ["macros"] snapshot-paths: ["snapshots"] +docs-paths: + ["dbt_packages/fsc_evm/doc_descriptions", "models/doc_descriptions", "models"] target-path: "target" # directory which will store compiled SQL files clean-targets: # directories to be removed by `dbt clean` @@ -24,13 +26,6 @@ clean-targets: # directories to be removed by `dbt clean` - "dbt_modules" - "dbt_packages" -models: - +copy_grants: true - +persist_docs: - relation: true - columns: true - +on_schema_change: "append_new_columns" - tests: +store_failures: true # all tests @@ -55,6 +50,61 @@ query-comment: # Configuring models # Full documentation: https://docs.getdbt.com/docs/configuring-models +models: + avalanche_models: # replace with the name of the chain + +copy_grants: true + +persist_docs: + relation: true + columns: true + +on_schema_change: "append_new_columns" + livequery_models: + +materialized: ephemeral + fsc_evm: + +enabled: false # disable fsc_evm package by default + +copy_grants: true + +persist_docs: + relation: true + columns: true + +on_schema_change: "append_new_columns" + main_package: + +enabled: false # disable top level package by default, enabled subpackages as needed + admin: + +enabled: true + core: + +enabled: true # enable subpackages, as needed + bronze: + +enabled: false + token_reads: + +enabled: true + github_actions: + +enabled: true + labels: + +enabled: true + observability: + +enabled: true + prices: + +enabled: true + utils: + +enabled: true + decoder_package: + +enabled: false + abis: + +enabled: true + decoded_logs: + +enabled: false + gold: + +enabled: true + silver: + +enabled: true + streamline: + +enabled: true + curated_package: + +enabled: false + stats: + +enabled: true + scores_package: + +enabled: false + # In this example config, we tell dbt to build all models in the example/ directory # as tables. These settings can be overridden in the individual model files # using the `{{ config(...) }}` macro. @@ -65,13 +115,9 @@ vars: STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES: False UPDATE_UDFS_AND_SPS: False UPDATE_SNOWFLAKE_TAGS: True - LIMIT_PARTITIONS: True - WAIT: 0 - OBSERV_FULL_TEST: False HEAL_MODEL: False HEAL_MODELS: [] START_GHA_TASKS: False - RELOAD_TRACES: False #### STREAMLINE 2.0 BEGIN #### @@ -96,45 +142,4 @@ vars: - INTERNAL_DEV - DBT_CLOUD_AVALANCHE -#### 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: 'avalanche' - GLOBAL_NODE_SECRET_PATH: 'Vault/prod/avalanche/c_chain/quicknode/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 - - # GOLD_FULL_REFRESH: True - # SILVER_FULL_REFRESH: True - - # BLOCKS_COMPLETE_FULL_REFRESH: True - # CONFIRM_BLOCKS_COMPLETE_FULL_REFRESH: True - # RECEIPTS_COMPLETE_FULL_REFRESH: True - # TRACES_COMPLETE_FULL_REFRESH: True - # TRANSACTIONS_COMPLETE_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 5a6080d..b243608 100644 --- a/macros/create_udfs.sql +++ b/macros/create_udfs.sql @@ -1,19 +1,9 @@ {% macro create_udfs() %} - {% if var("UPDATE_UDFS_AND_SPS") %} + {% if var("UPDATE_UDFS_AND_SPS", false) %} {% set sql %} CREATE schema if NOT EXISTS silver; - {{ create_udtf_get_base_table( - schema = "streamline" - ) }} - {{ create_udf_get_chainhead() }} - {{ create_udf_bulk_json_rpc() }} - {{ create_udf_bulk_get_traces() }} - {{ create_udf_decode_array_string() }} - {{ create_udf_decode_array_object() }} - {{ create_udf_bulk_decode_logs() }} - {% endset %} {% do run_query(sql) %} {{- fsc_utils.create_udfs() -}} {% endif %} -{% endmacro %} +{% endmacro %} \ No newline at end of file diff --git a/macros/dbt/incremental_predicates.sql b/macros/dbt/incremental_predicates.sql deleted file mode 100644 index 47d3c72..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 %} \ No newline at end of file diff --git a/macros/decoder/decoded_logs_history.sql b/macros/decoder/decoded_logs_history.sql deleted file mode 100644 index 4fe2282..0000000 --- a/macros/decoder/decoded_logs_history.sql +++ /dev/null @@ -1,124 +0,0 @@ -{% macro decoded_logs_history(backfill_mode=false) %} - - {%- set params = { - "sql_limit": var("DECODED_LOGS_HISTORY_SQL_LIMIT", 8000000), - "producer_batch_size": var("DECODED_LOGS_HISTORY_PRODUCER_BATCH_SIZE", 400000), - "worker_batch_size": var("DECODED_LOGS_HISTORY_WORKER_BATCH_SIZE", 100000) - } -%} - - {% set wait_time = var("DECODED_LOGS_HISTORY_WAIT_TIME", 60) %} - {% set find_months_query %} - SELECT - DISTINCT date_trunc('month', block_timestamp)::date as month - FROM {{ ref('core__fact_blocks') }} - ORDER BY month ASC - {% endset %} - {% set results = run_query(find_months_query) %} - - {% if execute %} - {% set months = results.columns[0].values() %} - - {% for month in months %} - {% set view_name = 'decoded_logs_history_' ~ month.strftime('%Y_%m') %} - - {% set create_view_query %} - create or replace view streamline.{{view_name}} as ( - WITH target_blocks AS ( - SELECT - block_number - FROM {{ ref('core__fact_blocks') }} - WHERE date_trunc('month', block_timestamp) = '{{month}}'::timestamp - ), - new_abis AS ( - SELECT - abi, - parent_contract_address, - event_signature, - start_block, - end_block - FROM {{ ref('silver__complete_event_abis') }} - {% if not backfill_mode %} - WHERE inserted_timestamp > dateadd('day', -30, sysdate()) - {% endif %} - ), - existing_logs_to_exclude AS ( - SELECT _log_id - FROM {{ ref('streamline__decoded_logs_complete') }} l - INNER JOIN target_blocks b using (block_number) - ), - candidate_logs AS ( - SELECT - l.block_number, - l.tx_hash, - l.event_index, - l.contract_address, - l.topics, - l.data, - concat(l.tx_hash::string, '-', l.event_index::string) as _log_id - FROM target_blocks b - INNER JOIN {{ ref('core__fact_event_logs') }} l using (block_number) - WHERE l.tx_status = 'SUCCESS' and date_trunc('month', l.block_timestamp) = '{{month}}'::timestamp - ) - SELECT - l.block_number, - l._log_id, - A.abi, - OBJECT_CONSTRUCT( - 'topics', l.topics, - 'data', l.data, - 'address', l.contract_address - ) AS data - FROM candidate_logs l - INNER JOIN new_abis A - ON A.parent_contract_address = l.contract_address - AND A.event_signature = l.topics[0]::STRING - AND l.block_number BETWEEN A.start_block AND A.end_block - WHERE NOT EXISTS ( - SELECT 1 - FROM existing_logs_to_exclude e - WHERE e._log_id = l._log_id - ) - LIMIT {{ params.sql_limit }} - ) - {% endset %} - {# Create the view #} - {% do run_query(create_view_query) %} - {{ log("Created view for month " ~ month.strftime('%Y-%m'), info=True) }} - {% if var("STREAMLINE_INVOKE_STREAMS", false) %} - {# Check if rows exist first #} - {% set check_rows_query %} - SELECT EXISTS(SELECT 1 FROM streamline.{{view_name}} LIMIT 1) - {% endset %} - - {% set results = run_query(check_rows_query) %} - {% set has_rows = results.columns[0].values()[0] %} - - {% if has_rows %} - {# Invoke streamline, if rows exist to decode #} - {% set decode_query %} - SELECT - streamline.udf_bulk_decode_logs_v2( - PARSE_JSON( - $${ "external_table": "decoded_logs", - "producer_batch_size": {{ params.producer_batch_size }}, - "sql_limit": {{ params.sql_limit }}, - "sql_source": "{{view_name}}", - "worker_batch_size": {{ params.worker_batch_size }} }$$ - ) - ); - {% endset %} - - {% do run_query(decode_query) %} - {{ log("Triggered decoding for month " ~ month.strftime('%Y-%m'), info=True) }} - {# Call wait since we actually did some decoding #} - {% do run_query("call system$wait(" ~ wait_time ~ ")") %} - {{ log("Completed wait after decoding for month " ~ month.strftime('%Y-%m'), info=True) }} - {% else %} - {{ log("No rows to decode for month " ~ month.strftime('%Y-%m'), info=True) }} - {% endif %} - {% endif %} - - {% endfor %} - {% endif %} - -{% endmacro %} \ No newline at end of file diff --git a/macros/decoder/run_decoded_logs_history.sql b/macros/decoder/run_decoded_logs_history.sql deleted file mode 100644 index 3954afb..0000000 --- a/macros/decoder/run_decoded_logs_history.sql +++ /dev/null @@ -1,29 +0,0 @@ -{% macro run_decoded_logs_history() %} - -{% set blockchain = var('GLOBAL_PROD_DB_NAME','').lower() %} - -{% set check_for_new_user_abis_query %} - select 1 - from {{ ref('silver__user_verified_abis') }} - where _inserted_timestamp::date = sysdate()::date - and dayname(sysdate()) <> 'Sat' -{% endset %} -{% set results = run_query(check_for_new_user_abis_query) %} -{% if execute %} - {% set new_user_abis = results.columns[0].values()[0] %} - - {% if new_user_abis %} - {% set invoke_workflow_query %} - SELECT - github_actions.workflow_dispatches( - 'FlipsideCrypto', - '{{ blockchain }}' || '-models', - 'dbt_run_streamline_decoded_logs_history.yml', - NULL - ) - {% endset %} - - {% do run_query(invoke_workflow_query) %} - {% endif %} -{% endif %} -{% endmacro %} \ No newline at end of file diff --git a/macros/fsc_evm_temp/_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/lookback.sql b/macros/lookback.sql deleted file mode 100644 index 129795b..0000000 --- a/macros/lookback.sql +++ /dev/null @@ -1,12 +0,0 @@ -{% macro lookback() %} - {% if execute and is_incremental() %} - {% set query %} - SELECT - MAX(_inserted_timestamp) :: DATE - 3 - FROM - {{ this }}; -{% endset %} - {% set last_week = run_query(query).columns [0] [0] %} - {% do return(last_week) %} - {% endif %} -{% endmacro %} diff --git a/macros/streamline/api_integrations.sql b/macros/streamline/api_integrations.sql deleted file mode 100644 index fc45e63..0000000 --- a/macros/streamline/api_integrations.sql +++ /dev/null @@ -1,11 +0,0 @@ -{% macro create_aws_avalanche_api() %} - {% if target.name == "prod" %} - {% set sql %} - CREATE api integration IF NOT EXISTS aws_avalanche_api api_provider = aws_api_gateway api_aws_role_arn = 'arn:aws:iam::490041342817:role/snowflake-api-avalanche' api_allowed_prefixes = ( - 'https://87yvk5d2sf.execute-api.us-east-1.amazonaws.com/prod/', - 'https://28hv9m0ra8.execute-api.us-east-1.amazonaws.com/dev/' - ) enabled = TRUE; -{% endset %} - {% do run_query(sql) %} - {% endif %} -{% endmacro %} \ No newline at end of file diff --git a/macros/streamline/get_base_table_udft.sql b/macros/streamline/get_base_table_udft.sql deleted file mode 100644 index a488d14..0000000 --- a/macros/streamline/get_base_table_udft.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 38670d2..0000000 --- a/macros/streamline/streamline_udfs.sql +++ /dev/null @@ -1,66 +0,0 @@ -{% macro create_udf_get_chainhead() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_get_chainhead() returns variant api_integration = aws_avalanche_api AS {% if target.name == "prod" %} - 'https://87yvk5d2sf.execute-api.us-east-1.amazonaws.com/prod/get_chainhead' - {% else %} - 'https://28hv9m0ra8.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 = aws_avalanche_api AS {% if target.name == "prod" %} - 'https://87yvk5d2sf.execute-api.us-east-1.amazonaws.com/prod/udf_bulk_json_rpc' - {% else %} - 'https://28hv9m0ra8.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 = aws_avalanche_api AS {% if target.name == "prod" %} - 'https://87yvk5d2sf.execute-api.us-east-1.amazonaws.com/prod/udf_bulk_get_traces' - {% else %} - 'https://28hv9m0ra8.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 = aws_avalanche_api AS {% if target.name == "prod" %} - 'https://87yvk5d2sf.execute-api.us-east-1.amazonaws.com/prod/decode_function' - {% else %} - 'https://28hv9m0ra8.execute-api.us-east-1.amazonaws.com/dev/decode_function' - {%- endif %}; -{% endmacro %} - - -{% macro create_udf_decode_array_object() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_decode( - abi ARRAY, - DATA OBJECT - ) returns ARRAY api_integration = aws_avalanche_api AS {% if target.name == "prod" %} - 'https://87yvk5d2sf.execute-api.us-east-1.amazonaws.com/prod/decode_log' - {% else %} - 'https://28hv9m0ra8.execute-api.us-east-1.amazonaws.com/dev/decode_log' - {%- endif %}; -{% endmacro %} - -{% macro create_udf_bulk_decode_logs() %} - CREATE - OR REPLACE EXTERNAL FUNCTION streamline.udf_bulk_decode_logs( - json OBJECT - ) returns ARRAY api_integration = aws_avalanche_api AS {% if target.name == "prod" %} - 'https://87yvk5d2sf.execute-api.us-east-1.amazonaws.com/prod/bulk_decode_logs' - {% else %} - 'https://28hv9m0ra8.execute-api.us-east-1.amazonaws.com/dev/bulk_decode_logs' - {%- endif %}; -{% endmacro %} \ No newline at end of file diff --git a/macros/tests/missing_decoding.sql b/macros/tests/missing_decoding.sql deleted file mode 100644 index f1e2beb..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('0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7') -- WAVAX - 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 72058f0..0000000 --- a/macros/tests/missing_txs.sql +++ /dev/null @@ -1,254 +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 }} - ), - FINAL AS ( - 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 - ), - errors AS ( - SELECT - COUNT(*) > 9 AS threshold - FROM - FINAL - ) -SELECT - * -FROM - FINAL -WHERE - ( - SELECT - threshold - FROM - errors - ) -{% endmacro %} - -{% macro missing_receipts( - 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_receipts( - 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 -{% endmacro %} - -{% macro missing_traces( - model - ) %} - WITH txs_base AS ( - SELECT - block_number AS base_block_number, - tx_hash AS base_tx_hash - FROM - {{ ref('test_silver__transactions_full') }} - WHERE - from_address <> '0x0000000000000000000000000000000000000000' - AND to_address <> '0x0000000000000000000000000000000000000000' - ), - 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_traces( - model - ) %} - WITH txs_base AS ( - SELECT - block_number AS base_block_number, - tx_hash AS base_tx_hash - FROM - {{ ref('test_silver__transactions_recent') }} - WHERE - from_address <> '0x0000000000000000000000000000000000000000' - AND to_address <> '0x0000000000000000000000000000000000000000' - ), - 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 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/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/models/doc_descriptions/general/__overview__.md b/models/__overview__.md similarity index 68% rename from models/doc_descriptions/general/__overview__.md rename to models/__overview__.md index fe3461e..9f38993 100644 --- a/models/doc_descriptions/general/__overview__.md +++ b/models/__overview__.md @@ -1,6 +1,6 @@ {% docs __overview__ %} -# Welcome to the Flipside Crypto Avalanche C-Chain Models Documentation! +# Welcome to the Flipside Crypto Avalanche Models Documentation! ## **What does this documentation cover?** The documentation included here details the design of the Avalanche 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/avalanche-models) @@ -16,48 +16,49 @@ There is more information on how to use dbt docs in the last section of this doc **Click on the links below to jump to the documentation for each schema.** -### Core Tables (avalanche.core) +### Core Tables -**Dimension Tables:** -- [dim_contracts](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.core__dim_contracts) -- [dim_labels](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.core__dim_labels) +**Dimensional Tables** +- [dim_contracts](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.core__dim_contracts) +- [dim_contract_abis](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.core__dim_contract_abis) +- [dim_labels](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.core__dim_labels) **Fact Tables:** -- [fact_blocks](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.core__fact_blocks) -- [fact_decoded_event_logs](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.core__fact_decoded_event_logs) -- [fact_event_logs](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.core__fact_event_logs) -- [fact_token_transfers](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.core__fact_token_transfers) -- [fact_traces](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.core__fact_traces) -- [fact_transactions](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.core__fact_transactions) +- [fact_blocks](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.core__fact_blocks) +- [fact_transactions](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.core__fact_transactions) +- [fact_event_logs](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.core__fact_event_logs) +- [fact_traces](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.core__fact_traces) **Convenience Tables:** -- [ez_decoded_event_logs](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.core__ez_decoded_event_logs) -- [ez_native_transfers](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.core__ez_native_transfers) -- [ez_token_transfers](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.core__ez_token_transfers) +- [ez_decoded_event_logs](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.core__ez_decoded_event_logs) +- [ez_native_transfers](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.core__ez_native_transfers) +- [ez_token_transfers](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.core__ez_token_transfers) ### Price Tables (avalanche.price) -- [dim_asset_metadata](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.price__dim_asset_metadata) -- [fact_prices_ohlc_hourly](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.price__fact_prices_ohlc_hourly) -- [ez_asset_metadata](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.price__ez_asset_metadata) -- [ez_prices_hourly](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.price__ez_prices_hourly) +- [dim_asset_metadata](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.price__dim_asset_metadata) +- [fact_prices_ohlc_hourly](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.price__fact_prices_ohlc_hourly) +- [ez_asset_metadata](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.price__ez_asset_metadata) +- [ez_prices_hourly](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.price__ez_prices_hourly) ### DeFi Tables (avalanche.defi) -- [dim_dex_liquidity_pools](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.defi__dim_dex_liquidity_pools) -- [ez_dex_swaps](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.defi__ez_dex_swaps) - [ez_bridge_activity](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.defi__ez_bridge_activity) -- [ez_lending_borrows](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.defi__ez_lending_borrows) +- [ez_dex_swaps](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.defi__ez_dex_swaps) +- [dim_dex_liquidity_pools](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.defi__dim_dex_liquidity_pools) +- [ez_lending_borrows](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.defi__ez_lending_borrows) - [ez_lending_deposits](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.defi__ez_lending_deposits) - [ez_lending_flashloans](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.defi__ez_lending_flashloans) - [ez_lending_liquidations](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.defi__ez_lending_liquidations) - [ez_lending_repayments](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.defi__ez_lending_repayments) - [ez_lending_withdraws](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.defi__ez_lending_withdraws) +### Flipside Partner Tables (avalanche.partner_name) + ### NFT Tables (avalanche.nft) +- [ez_nft_transfers](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.nft__ez_nft_transfers) - [ez_nft_sales](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.nft__ez_nft_sales) -- [ez_nft_transfers](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.nft__ez_nft_transfers) ### Stats Tables (avalanche.stats) -- [ez_core_metrics_hourly](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.avalanche_models.stats__ez_core_metrics_hourly) +- [ez_core_metrics_hourly](https://flipsidecrypto.github.io/avalanche-models/#!/model/model.fsc_evm.stats__ez_core_metrics_hourly) ### Dexalot Tables (avalanche.dexalot) @@ -85,18 +86,7 @@ The dimension tables are sourced from a variety of on-chain and off-chain source Convenience views (denoted ez_) are a combination of different fact and dimension tables. These views are built to make it easier to query the data. -## **Contract Decoding** -### Adding a contract for decoding -To add a contract for decoding, please visit [here](https://science.flipsidecrypto.xyz/abi-requestor/). - -Assuming the submitted ABI is valid, records will be decoded within 24 hours. If records are not decoded within 24 hours, or for any ABI updates, please submit a ticket within our Discord. - -### General Process Overview - -The majority of our ABIs have been sourced from Etherscan, and we are constantly asking Etherscan for new ABIs. However, this is not comprehensive, and therefore we must also rely on our users to submit ABIs for decoding. -If we are unable to locate an ABI for the contract from either Etherscan or our users, we will attempt to match the contract to a similar ABI. This is done by comparing the contract bytecode to a list of known contract bytecodes. If we are able to match the contract to a similar ABI, we will decode the contract using the similar ABI. You can see the source of each ABI in the `dim_contract_abis` table within the `abi_source` column. - -Once ABIs have been verified, events within the last day of blocks will be decoded within approximately 90 minutes. Events older than 1 day will be decoded within 24 hours in the majority of cases. The exception here is if the contract has a massive number of events, in which case it may take longer. +NOTE: Avalanche is currently operating in it's Testnet phase. Flipside will provide Mainnet data tables once Avalanche Mainnet is deployed. ## **Using dbt docs** ### Navigation @@ -105,7 +95,7 @@ You can use the ```Project``` and ```Database``` navigation tabs on the left sid ### Database Tab -This view shows relations (tables and views) grouped into database schemas. Note that ephemeral models are *not* shown in this interface, as they do not exist in the database. +This view shows relations (tables and views) grouped into database schemas. Note that ephemeral models are *not* shown in this interface, as they do not exist in the dataavalanche. ### Graph Exploration @@ -119,10 +109,11 @@ Note that you can also right-click on models to interactively filter and explore ### **More information** -- [Flipside](https://flipsidecrypto.xyz) +- [Flipside](https://flipsidecrypto.xyz/) +- [Velocity](https://app.flipsidecrypto.com/velocity?nav=Discover) - [Tutorials](https://docs.flipsidecrypto.com/our-data/tutorials) - [Github](https://github.com/FlipsideCrypto/avalanche-models) -- [Query Editor Shortcuts](https://docs.flipsidecrypto.com/velocity/query-editor-shortcuts) - [What is dbt?](https://docs.getdbt.com/docs/introduction) -{% enddocs %} + +{% enddocs %} \ 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 9ff9b31..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( - 'avalanche_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( - 'avalanche_bronze_api', - 'contract_abis' - ) }} - WHERE - _inserted_timestamp >= CURRENT_DATE - INTERVAL '30 days' -- this won't let us retry the same contract within 30 days - AND abi_data :data :result :: STRING <> 'Max rate limit reached' - ) - ORDER BY - total_interaction_count DESC - LIMIT - 25 -), FINAL AS ( - SELECT - proxy_address AS contract_address, - start_block AS block_number - FROM - {{ ref("silver__proxies") }} - p - JOIN retry r USING (contract_address) - LEFT JOIN {{ source( - 'avalanche_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( - 'avalanche_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 ac4185f..0000000 --- a/models/bronze/api_udf/bronze_api__contract_abis.sql +++ /dev/null @@ -1,80 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = "contract_address", - full_refresh = false, - tags = ['curated'] -) }} - -WITH base AS ( - - SELECT - contract_address - FROM - {{ ref('silver__relevant_contracts') }} - WHERE - total_interaction_count >= 100 - -{% if is_incremental() %} -and contract_address not in ( -SELECT - contract_address -FROM - {{ this }} - WHERE - abi_data :data :result :: STRING <> 'Max rate limit reached' -) -{% endif %} -order by total_interaction_count desc -LIMIT - 50 -), 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(101) %} -SELECT - rn.contract_address, - live.udf_api('GET', - CONCAT('https://api.routescan.io/v2/network/mainnet/evm/', '43114', --avax C-chain ID - '/etherscan/api?module=contract&action=getabi&address=', - contract_address, '&apikey=none'), - OBJECT_CONSTRUCT( - 'Content-Type', 'application/json', - 'fsc-quantum-state', 'livequery' - ), - NULL, - '' - ) 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 5785b15..0000000 --- a/models/bronze/api_udf/bronze_api__contract_abis.yml +++ /dev/null @@ -1,22 +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 - - 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 534e97e..0000000 --- a/models/bronze/api_udf/bronze_api__token_reads.sql +++ /dev/null @@ -1,129 +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 %} -LIMIT - 500 -), function_sigs AS ( - SELECT - '0x313ce567' AS function_sig, - 'decimals' AS function_name - UNION - SELECT - '0x06fdde03', - 'name' - UNION - SELECT - '0x95d89b41', - 'symbol' -), -all_reads AS ( - SELECT - * - FROM - base - JOIN function_sigs - ON 1 = 1 -), -ready_reads AS ( - SELECT - contract_address, - latest_block, - function_sig, - RPAD( - function_sig, - 64, - '0' - ) AS input, - utils.udf_json_rpc_call( - 'eth_call', - [{'to': contract_address, 'from': null, 'data': input}, utils.udf_int_to_hex(latest_block)], - concat_ws( - '-', - contract_address, - input, - latest_block - ) - ) AS rpc_request - FROM - all_reads -), -batch_reads AS ( - SELECT - ARRAY_AGG(rpc_request) AS batch_rpc_request - FROM - ready_reads -), -node_call AS ( - SELECT - *, - live.udf_api( - 'POST', - CONCAT( - '{service}', - '/', - '{Authentication}', - '/ext/bc/C/rpc' - ),{}, - batch_rpc_request, - 'Vault/prod/avalanche/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 cfbf685..0000000 --- a/models/bronze/api_udf/bronze_api__token_reads.yml +++ /dev/null @@ -1,18 +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: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ \ No newline at end of file diff --git a/models/bronze/labels/bronze__labels.sql b/models/bronze/labels/bronze__labels.sql deleted file mode 100644 index f88ce3b..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( - 'crosschain_silver', - 'labels_combined' - ) }} -WHERE - blockchain = 'avalanche' - AND address LIKE '0x%' 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 1dfef03..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( - 'crosschain_silver', - 'complete_native_asset_metadata' - ) }} -WHERE - blockchain = 'avalanche' - AND symbol = 'AVAX' 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 1242726..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( - 'crosschain_silver', - 'complete_native_prices' - ) }} -WHERE - blockchain = 'avalanche' - AND symbol = 'AVAX' 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 556b9ef..0000000 --- a/models/bronze/prices/bronze__complete_provider_asset_metadata.sql +++ /dev/null @@ -1,28 +0,0 @@ -{{ config ( - materialized = 'view' -) }} - -SELECT - asset_id, - token_address, - NAME, - symbol, - platform, - platform_id, - provider, - source, - _inserted_timestamp, - inserted_timestamp, - modified_timestamp, - complete_provider_asset_metadata_id, - _invocation_id -FROM - {{ source( - 'crosschain_silver', - 'complete_provider_asset_metadata' - ) }} -WHERE - platform IN ( - 'Avalanche', - 'Avalanche C-Chain' - ) -- platforms specific to Avalanche 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 28ed566..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( - 'crosschain_silver', - 'complete_provider_prices' - ) }} --- prices for all ids \ No newline at end of file diff --git a/models/bronze/prices/bronze__complete_token_asset_metadata.sql b/models/bronze/prices/bronze__complete_token_asset_metadata.sql deleted file mode 100644 index 2e13fe1..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( - 'crosschain_silver', - 'complete_token_asset_metadata' - ) }} -WHERE - blockchain = 'avalanche' \ 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 e64362c..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( - 'crosschain_silver', - 'complete_token_prices' - ) }} -WHERE - blockchain = 'avalanche' diff --git a/models/dexalot/bronze/bronze_dexalot__streamline_traces.sql b/models/dexalot/bronze/bronze_dexalot__streamline_traces.sql index 9a4e6af..9a47eff 100644 --- a/models/dexalot/bronze/bronze_dexalot__streamline_traces.sql +++ b/models/dexalot/bronze/bronze_dexalot__streamline_traces.sql @@ -1,7 +1,7 @@ {{ config ( materialized = 'view' ) }} -{{ fsc_evm.streamline_external_table_query( +{{ fsc_utils.streamline_external_table_query_v2( model = "dexalot_traces", partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 4), '_', 1) AS INTEGER )" ) }} diff --git a/models/dexalot/gold/dexalot__fact_blocks.sql b/models/dexalot/gold/dexalot__fact_blocks.sql index 62c8270..f9d70f6 100644 --- a/models/dexalot/gold/dexalot__fact_blocks.sql +++ b/models/dexalot/gold/dexalot__fact_blocks.sql @@ -31,6 +31,9 @@ SELECT state_root, transactions_root, logs_bloom, + blocks_id AS fact_blocks_id, + inserted_timestamp, + modified_timestamp, OBJECT_CONSTRUCT( 'baseFeePerGas', base_fee_per_gas, @@ -70,12 +73,9 @@ SELECT transactions_root, 'uncles', uncles - ) AS block_header_json, - blocks_id AS fact_blocks_id, - inserted_timestamp, - modified_timestamp, - 'dexalot' AS blockchain, - hash + ) AS block_header_json, --deprecate + 'dexalot' AS blockchain, --deprecate + hash --deprecate FROM {{ ref('silver_dexalot__blocks') }} A diff --git a/models/dexalot/gold/dexalot__fact_blocks.yml b/models/dexalot/gold/dexalot__fact_blocks.yml index 93fcfe1..b877ea8 100644 --- a/models/dexalot/gold/dexalot__fact_blocks.yml +++ b/models/dexalot/gold/dexalot__fact_blocks.yml @@ -10,8 +10,6 @@ models: 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 @@ -32,8 +30,6 @@ models: description: '{{ doc("evm_base_fee_per_gas") }}' - 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 @@ -50,8 +46,6 @@ models: description: '{{ doc("evm_transactions_root") }}' - name: LOGS_BLOOM description: '{{ doc("evm_logs_bloom") }}' - - name: BLOCK_HEADER_JSON - description: '{{ doc("evm_column_deprecation_notice_block_header_json") }}' - name: BASE_FEE_PER_GAS description: '{{ doc("evm_base_fee_per_gas") }}' - name: FACT_BLOCKS_ID diff --git a/models/dexalot/gold/dexalot__fact_event_logs.sql b/models/dexalot/gold/dexalot__fact_event_logs.sql index 86e21ec..ef42dc3 100644 --- a/models/dexalot/gold/dexalot__fact_event_logs.sql +++ b/models/dexalot/gold/dexalot__fact_event_logs.sql @@ -28,8 +28,7 @@ SELECT logs_id AS fact_event_logs_id, inserted_timestamp, modified_timestamp, - tx_status, - -- deprecate + tx_status, -- deprecate _log_id -- deprecate FROM {{ ref('silver_dexalot__logs') }} diff --git a/models/dexalot/gold/dexalot__fact_event_logs.yml b/models/dexalot/gold/dexalot__fact_event_logs.yml index 3393583..3d2cc10 100644 --- a/models/dexalot/gold/dexalot__fact_event_logs.yml +++ b/models/dexalot/gold/dexalot__fact_event_logs.yml @@ -28,10 +28,6 @@ models: 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 diff --git a/models/dexalot/gold/dexalot__fact_traces.yml b/models/dexalot/gold/dexalot__fact_traces.yml index c3aea56..fd83580 100644 --- a/models/dexalot/gold/dexalot__fact_traces.yml +++ b/models/dexalot/gold/dexalot__fact_traces.yml @@ -23,9 +23,9 @@ models: - name: VALUE description: '{{ doc("dexalot_traces_value") }}' - name: VALUE_PRECISE_RAW - description: '{{ doc("precise_amount_unadjusted") }}' + description: '{{ doc("evm_precise_amount_unadjusted") }}' - name: VALUE_PRECISE - description: '{{ doc("precise_amount_adjusted") }}' + description: '{{ doc("evm_precise_amount_adjusted") }}' - name: VALUE_HEX description: '{{ doc("dexalot_traces_value_hex") }}' - name: GAS @@ -55,8 +55,8 @@ models: - name: TRACE_INDEX description: '{{ doc("dexalot_traces_trace_index") }}' - name: FACT_TRACES_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/dexalot/gold/dexalot__fact_transactions.sql b/models/dexalot/gold/dexalot__fact_transactions.sql index 58b063d..36a4bee 100644 --- a/models/dexalot/gold/dexalot__fact_transactions.sql +++ b/models/dexalot/gold/dexalot__fact_transactions.sql @@ -37,8 +37,7 @@ SELECT transactions_id AS fact_transactions_id, inserted_timestamp, modified_timestamp, - block_hash, - -- deprecate + block_hash, -- deprecate position -- deprecate FROM {{ ref('silver_dexalot__transactions') }} diff --git a/models/dexalot/gold/dexalot__fact_transactions.yml b/models/dexalot/gold/dexalot__fact_transactions.yml index 0f4e749..18ce089 100644 --- a/models/dexalot/gold/dexalot__fact_transactions.yml +++ b/models/dexalot/gold/dexalot__fact_transactions.yml @@ -8,14 +8,10 @@ models: description: '{{ doc("dexalot_block_number") }}' - name: BLOCK_TIMESTAMP description: '{{ doc("dexalot_block_timestamp") }}' - - name: BLOCK_HASH - description: '{{ doc("evm_column_deprecation_notice_block_hash") }}' - name: TX_HASH description: '{{ doc("dexalot_tx_hash") }}' - name: NONCE description: '{{ doc("dexalot_tx_nonce") }}' - - name: POSITION - description: '{{ doc("evm_column_deprecation_notice_position") }}' - name: TX_POSITION description: '{{ doc("dexalot_tx_position") }}' - name: FROM_ADDRESS @@ -25,13 +21,13 @@ models: - name: VALUE description: '{{ doc("dexalot_value") }}' - name: VALUE_PRECISE_RAW - description: '{{ doc("precise_amount_unadjusted") }}' + description: '{{ doc("evm_precise_amount_unadjusted") }}' - name: VALUE_PRECISE - description: '{{ doc("precise_amount_adjusted") }}' + description: '{{ doc("evm_precise_amount_adjusted") }}' - name: TX_FEE description: '{{ doc("dexalot_tx_fee") }}' - name: TX_FEE_PRECISE - description: '{{ doc("tx_fee_precise") }}' + description: '{{ doc("evm_tx_fee_precise") }}' - name: GAS_PRICE description: '{{ doc("dexalot_tx_gas_price") }}' - name: EFFECTIVE_GAS_PRICE @@ -59,8 +55,8 @@ models: - name: V description: The v value of the transaction signature. - name: FACT_TRANSACTIONS_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/dexalot/streamline/streamline__dexalot_blocks.sql b/models/dexalot/streamline/streamline__dexalot_blocks.sql index 3029aff..a2636b9 100644 --- a/models/dexalot/streamline/streamline__dexalot_blocks.sql +++ b/models/dexalot/streamline/streamline__dexalot_blocks.sql @@ -11,10 +11,7 @@ SELECT '' ) AS block_number_hex FROM - {{ source( - 'crosschain_silver', - 'number_sequence' - ) }} + {{ ref('admin__number_sequence') }} WHERE _id <= ( SELECT diff --git a/models/doc_descriptions/Borrowing/Borrow_symbol.md b/models/doc_descriptions/Borrowing/Borrow_symbol.md deleted file mode 100644 index 2aa7055..0000000 --- a/models/doc_descriptions/Borrowing/Borrow_symbol.md +++ /dev/null @@ -1,4 +0,0 @@ -{% docs borrow_symbol %} - -The symbol of the asset/collateral that is payed or received, depending on the action -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Borrowing/action.md b/models/doc_descriptions/Borrowing/action.md deleted file mode 100644 index d9b1b40..0000000 --- a/models/doc_descriptions/Borrowing/action.md +++ /dev/null @@ -1,9 +0,0 @@ -{% docs borrow_action %} - -The action that the user is taking. - Borrow: user is borrowing an asset - Repay: user is repaying the asset that they have borrowed in a previous loan - Add collateral: user is depositing collateral for their loan. This happens some times in the same transaction as the borrowing transaction and some times in a separate transaction. - Remove collateral: user is withdrawing collateral. This happens some times in the same transaction as the borrowing transaction and some times in a separate transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Borrowing/amount.md b/models/doc_descriptions/Borrowing/amount.md deleted file mode 100644 index 16b2cbe..0000000 --- a/models/doc_descriptions/Borrowing/amount.md +++ /dev/null @@ -1,9 +0,0 @@ -{% docs borrow_amount %} - -The meaning depends on the action: -Borrow: The amount of the asset that the user is borrowing or -Repay: The amount of the asset that the user is repaying -Add collateral: The amount of collateral that the user is depositing -Remove collateral: The amount of collateral that the user is withdrawing - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Borrowing/amount_usd.md b/models/doc_descriptions/Borrowing/amount_usd.md deleted file mode 100644 index feac2c9..0000000 --- a/models/doc_descriptions/Borrowing/amount_usd.md +++ /dev/null @@ -1,8 +0,0 @@ -{% docs borrow_amount_usd %} - -The meaning depends on the action: -Borrow: The amount of the asset in USD that the user is borrowing or -Repay: The amount of the asset in USD that the user is repaying -Add collateral: The amount of collateral in USD that the user is depositing -Remove collateral: The amount of collateral in USD that the user is withdrawing -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Borrowing/asset.md b/models/doc_descriptions/Borrowing/asset.md deleted file mode 100644 index 236f8b1..0000000 --- a/models/doc_descriptions/Borrowing/asset.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs borrow_asset %} - -The address of the asset/collateral token that is being borrowed/repayed/deposited etc. depending on the action - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Borrowing/collateral_address.md b/models/doc_descriptions/Borrowing/collateral_address.md deleted file mode 100644 index f582e43..0000000 --- a/models/doc_descriptions/Borrowing/collateral_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs collateral_address %} - -The address of the asset that is used for collateral when borrowing funds. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Borrowing/collateral_symbol.md b/models/doc_descriptions/Borrowing/collateral_symbol.md deleted file mode 100644 index 745bb56..0000000 --- a/models/doc_descriptions/Borrowing/collateral_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs collateral_symbol %} - -The symbol of the asset that is used for collateral when borrowing funds. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/Depositor.md b/models/doc_descriptions/Lending/Depositor.md deleted file mode 100644 index 4de0533..0000000 --- a/models/doc_descriptions/Lending/Depositor.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_depositor %} - -Its the address of the user who is depositing for lending or withdrawing, depending on the action. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/Lending_asset_address.md b/models/doc_descriptions/Lending/Lending_asset_address.md deleted file mode 100644 index 4843a37..0000000 --- a/models/doc_descriptions/Lending/Lending_asset_address.md +++ /dev/null @@ -1,4 +0,0 @@ -{% docs lending_asset_address %} - -The address of the asset in the token pair. This asset is either deposited ot withdrawn for lending purposes. -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/Lending_pool_address.md b/models/doc_descriptions/Lending/Lending_pool_address.md deleted file mode 100644 index ad26555..0000000 --- a/models/doc_descriptions/Lending/Lending_pool_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_pool_address %} - -The address of the lending pool. For sushi this will be the address of the kashi pair. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/Lending_symbol.md b/models/doc_descriptions/Lending/Lending_symbol.md deleted file mode 100644 index e0ad325..0000000 --- a/models/doc_descriptions/Lending/Lending_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_symbol %} - -The symbol of the asset that is lent or withdrawn, depending on the action - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/action.md b/models/doc_descriptions/Lending/action.md deleted file mode 100644 index e4751e8..0000000 --- a/models/doc_descriptions/Lending/action.md +++ /dev/null @@ -1,7 +0,0 @@ -{% docs lending_action %} - -The action that the user is taking. - Deposit: user is depositing funds to be used for lending - Withdraw: user has changed their mind and are no longer willing to lend, so they withdraw their asset - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/amount.md b/models/doc_descriptions/Lending/amount.md deleted file mode 100644 index 04e910c..0000000 --- a/models/doc_descriptions/Lending/amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_amount %} - -The amount of the asset that the user is depositing or withdrawing, depending on the action. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/amount_usd.md b/models/doc_descriptions/Lending/amount_usd.md deleted file mode 100644 index ba05220..0000000 --- a/models/doc_descriptions/Lending/amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_amount_usd %} - -The amount of the asset that the user is depositing or withdrawing, depending on the action. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/asset.md b/models/doc_descriptions/Lending/asset.md deleted file mode 100644 index 05dc210..0000000 --- a/models/doc_descriptions/Lending/asset.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_asset %} - -The address of the asset (token) that is being deposited/withdrawn, depending on the action - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/borrower_is_a_contract.md b/models/doc_descriptions/Lending/borrower_is_a_contract.md deleted file mode 100644 index 998338f..0000000 --- a/models/doc_descriptions/Lending/borrower_is_a_contract.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_borrower_is_a_contract %} - -If the depositor of collateral is a contract then its a Yes, if the depositor of collateral is a normal address it is a No. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/lender_is_a_contract.md b/models/doc_descriptions/Lending/lender_is_a_contract.md deleted file mode 100644 index f4c063e..0000000 --- a/models/doc_descriptions/Lending/lender_is_a_contract.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_lender_is_a_contract %} - -If the depositor is a contract then its a Yes, if the depositor is a normal address it is a No. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/lending_pool.md b/models/doc_descriptions/Lending/lending_pool.md deleted file mode 100644 index 9a39ba3..0000000 --- a/models/doc_descriptions/Lending/lending_pool.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_lending_pool %} - -The name of the lending pool. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/origin_from_address.md b/models/doc_descriptions/Lending/origin_from_address.md deleted file mode 100644 index 83d1741..0000000 --- a/models/doc_descriptions/Lending/origin_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_origin_from_address %} - -The address of the user who initiates the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/Lending/origin_to_address.md b/models/doc_descriptions/Lending/origin_to_address.md deleted file mode 100644 index 329250a..0000000 --- a/models/doc_descriptions/Lending/origin_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs lending_origin_to_address %} - -The person who initiates the depositing transaction has to interact with this address. This address belongs to the lending platform or directs the transactio there. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/avax_block_header_json.md b/models/doc_descriptions/blocks/avax_block_header_json.md deleted file mode 100644 index 3ef36a9..0000000 --- a/models/doc_descriptions/blocks/avax_block_header_json.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_blockchain.md b/models/doc_descriptions/blocks/avax_blockchain.md deleted file mode 100644 index df3aa76..0000000 --- a/models/doc_descriptions/blocks/avax_blockchain.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_blockchain %} - -The blockchain on which transactions are being confirmed. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/avax_blocks_hash.md b/models/doc_descriptions/blocks/avax_blocks_hash.md deleted file mode 100644 index 6e6ff1a..0000000 --- a/models/doc_descriptions/blocks/avax_blocks_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_blocks_nonce.md b/models/doc_descriptions/blocks/avax_blocks_nonce.md deleted file mode 100644 index f9e73bd..0000000 --- a/models/doc_descriptions/blocks/avax_blocks_nonce.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_blocks_table_doc.md b/models/doc_descriptions/blocks/avax_blocks_table_doc.md deleted file mode 100644 index 5479418..0000000 --- a/models/doc_descriptions/blocks/avax_blocks_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_blocks_table_doc %} - -This table contains block level data for the Avalanche 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/avax_difficulty.md b/models/doc_descriptions/blocks/avax_difficulty.md deleted file mode 100644 index 1f83004..0000000 --- a/models/doc_descriptions/blocks/avax_difficulty.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_difficulty %} - -The effort required to mine the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/avax_extra_data.md b/models/doc_descriptions/blocks/avax_extra_data.md deleted file mode 100644 index 2dcfe87..0000000 --- a/models/doc_descriptions/blocks/avax_extra_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_gas_limit.md b/models/doc_descriptions/blocks/avax_gas_limit.md deleted file mode 100644 index 201504a..0000000 --- a/models/doc_descriptions/blocks/avax_gas_limit.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_gas_used.md b/models/doc_descriptions/blocks/avax_gas_used.md deleted file mode 100644 index 51b95af..0000000 --- a/models/doc_descriptions/blocks/avax_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_gas_used %} - -Total gas used in the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/avax_miner.md b/models/doc_descriptions/blocks/avax_miner.md deleted file mode 100644 index f852957..0000000 --- a/models/doc_descriptions/blocks/avax_miner.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_network.md b/models/doc_descriptions/blocks/avax_network.md deleted file mode 100644 index 62c18a1..0000000 --- a/models/doc_descriptions/blocks/avax_network.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_network %} - -The network on the blockchain used by a transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/avax_parent_hash.md b/models/doc_descriptions/blocks/avax_parent_hash.md deleted file mode 100644 index 0d4f93d..0000000 --- a/models/doc_descriptions/blocks/avax_parent_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_receipts_root.md b/models/doc_descriptions/blocks/avax_receipts_root.md deleted file mode 100644 index 8aa66aa..0000000 --- a/models/doc_descriptions/blocks/avax_receipts_root.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_receipts_root %} - -The root of the state trie. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/avax_sha3_uncles.md b/models/doc_descriptions/blocks/avax_sha3_uncles.md deleted file mode 100644 index 8204c7b..0000000 --- a/models/doc_descriptions/blocks/avax_sha3_uncles.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_size.md b/models/doc_descriptions/blocks/avax_size.md deleted file mode 100644 index ea315f5..0000000 --- a/models/doc_descriptions/blocks/avax_size.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_total_difficulty.md b/models/doc_descriptions/blocks/avax_total_difficulty.md deleted file mode 100644 index dfeaa06..0000000 --- a/models/doc_descriptions/blocks/avax_total_difficulty.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_tx_count.md b/models/doc_descriptions/blocks/avax_tx_count.md deleted file mode 100644 index 66d138a..0000000 --- a/models/doc_descriptions/blocks/avax_tx_count.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_tx_count %} - -Total number of transactions within a block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/blocks/avax_uncle_blocks.md b/models/doc_descriptions/blocks/avax_uncle_blocks.md deleted file mode 100644 index d726fd5..0000000 --- a/models/doc_descriptions/blocks/avax_uncle_blocks.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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 3e39b14..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: ALLBRIDGE, AXELAR, CELER, CBRIDGE, DLN, DEBRIDGE, EYWA, MESON, MULTICHAIN, STARGATE, SYMBIOSIS, SYNAPSE, WORMHOLE along with other helpful columns, including an amount USD where available. Note, this table only includes records for the protocols listed above with live, onchain bridge activity and may not represent the complete bridging picture. - -{% enddocs %} - -{% docs evm_bridge_platform %} - -The platform or protocol from which the bridge transaction or event originates. - -{% enddocs %} - -{% docs evm_bridge_origin_from %} - -The from address where the transaction originated from. This may be an EOA or contract address, however in most cases this is the user that initiated the bridge deposit or transfer. - -{% enddocs %} - -{% docs evm_bridge_sender %} - -The address that initiated the bridge deposit or transfer. This address is the sender of the tokens/assets being bridged to the destination chain. This may be an EOA or contract address. - -{% enddocs %} - -{% docs evm_bridge_receiver %} - -The designated address set to receive the deposit or transfer. This may be an EOA or contract address. - -{% enddocs %} - -{% docs evm_bridge_destination_chain_receiver %} - -The designated address set to receive the bridged tokens on the target chain after the completion of the bridge transaction. For non-evm chains, the hex address is decoded/encoded to match the data format of the destination chain, where possible. This may be an EOA or contract address. - -{% enddocs %} - -{% docs evm_bridge_destination_chain %} - -The name of the blockchain network to which the assets are being bridged. It could be any EVM compatible chain or other blockchain networks that the bridging protocol supports. - -{% enddocs %} - -{% docs evm_bridge_destination_chain_id %} - -The numeric identifier associated with the destination blockchain network. This is specific to the chain and helps in uniquely identifying it. - -{% enddocs %} - -{% docs evm_bridge_address %} - -The address of the contract responsible for handling the bridge deposit or transfer. This contract mediates the transfer and ensures that assets are sent and received appropriately. - -{% enddocs %} - -{% docs evm_bridge_token_address %} - -The address associated with the token that is being bridged. It provides a unique identifier for the token within its origin blockchain. - -{% enddocs %} - -{% docs evm_bridge_token_symbol %} - -The symbol representing the token being bridged. This provides a shorthand representation of the token. - -{% enddocs %} - -{% docs evm_bridge_amount_unadj %} - -The raw, non-decimal adjusted amount of tokens involved in the bridge transaction. - -{% enddocs %} - -{% docs evm_bridge_amount %} - -The decimal adjusted amount of tokens involved in the bridge transaction, where available. - -{% enddocs %} - -{% docs evm_bridge_amount_usd %} - -The value of the bridged tokens in USD at the time of the bridge transaction, where available. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/complete_lending/complete_lending_column_docs.md b/models/doc_descriptions/complete_lending/complete_lending_column_docs.md deleted file mode 100644 index 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 f614310..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, BENQI, and TRADER JOE protocols. In order to borrow assets, a user must first deposit their preferred asset and amount as collateral. - - -{% enddocs %} - -{% docs complete_lending_deposits_table_doc %} - -This table contains deposit transactions across AAVE, BENQI, and TRADER JOE protocols. A user deposits their preferred asset and amount. After depositing, users earn passive income based on the market borrowing demand. Additionally, depositing allows users to borrow by using their deposited assets as a collateral. Any interest earned by depositing funds helps offset the interest rate accumulated by borrowing. - -{% enddocs %} - -{% docs complete_lending_flashloans_table_doc %} - -This table contains flash loan transactions across AAVE protocol. 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, BENQI, and TRADER JOE 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, BENQI, and TRADER JOE protocols. Loans are repaid in the same asset borrowed, plus accrued interest. Borrowers can pay back their loan based on the USD price as they can borrow any of the available stable coins (USDC, DAI, USDT, etc.). - -{% enddocs %} - -{% docs complete_lending_withdraws_table_doc %} - -This table contains transactions in which a user withdraws liquidity across the AAVE, BENQI, and TRADER JOE protocols. Users need to make sure there is enough liquidity (not borrowed) in order to withdraw, if this is not the case, users need to wait for more liquidity from depositors or borrowers repaying. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/avax_ez_dex_swaps_table_doc.md b/models/doc_descriptions/dex - (imported from layer 1)/avax_ez_dex_swaps_table_doc.md deleted file mode 100644 index 9c25203..0000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/avax_ez_dex_swaps_table_doc.md +++ /dev/null @@ -1,6 +0,0 @@ -{% docs avax_ez_dex_swaps_table_doc %} - -This table currently contains swap events from the ```fact_event_logs``` table for CURVE, FRAXSWAP, KYBERSWAP, PANGOLIN, PHARAOH, PLATYPUS, SUSHISWAP, TRADER JOE, AND UNISWAP along with other helpful columns including an amount USD where possible. Other dexes coming soon! -Note: A rule has been put in place to null out the amount_USD if that number is too divergent between amount_in_USD and amount_out_usd. This can happen for swaps of less liquid tokens during very high fluctuation of price. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dex - (imported from layer 1)/avax_sushi__ez_swaps.md b/models/doc_descriptions/dex - (imported from layer 1)/avax_sushi__ez_swaps.md deleted file mode 100644 index 59ff029..0000000 --- a/models/doc_descriptions/dex - (imported from layer 1)/avax_sushi__ez_swaps.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_sushi__ez_swaps %} - -This table currently contains swap events from the ```logs``` table for SushiSwap on avalanche, along with other helpful columns including an amount USD where possible. - -{% 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 8d123ca..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 avalanche.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 4dffdf9..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 avalanche.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 2dca7da..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 Avalanche blockchain, including the tokens, symbols and decimals within each pool alongside the following protocols: CURVE, FRAXSWAP, KYBERSWAP, PANGOLIN, PHARAOH, PLATYPUS, SUSHISWAP, TRADER JOE, UNISWAP. - -{% 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 879d5e6..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 avalanche.defi.dim_dex_liquidity_pools -WHERE token0 = '0x49d5c2bdffac6ce2bfdb6640f4f80f226bc10bab' -; - -{% 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/dexalot/core/dexalot_blocks.md b/models/doc_descriptions/dexalot/core/dexalot_blocks.md deleted file mode 100644 index 1e362c4..0000000 --- a/models/doc_descriptions/dexalot/core/dexalot_blocks.md +++ /dev/null @@ -1,126 +0,0 @@ -{% docs dexalot_block_header_json %} - -This JSON column contains the block header details. - -{% enddocs %} - - -{% docs dexalot_blockchain %} - -The blockchain on which transactions are being confirmed. - -{% enddocs %} - - -{% docs dexalot_blocks_hash %} - -The hash of the block header for a given block. - -{% enddocs %} - - -{% docs dexalot_blocks_nonce %} - -Block nonce is a value used during mining to demonstrate proof of work for a given block. - -{% enddocs %} - - -{% docs dexalot_blocks_table_doc %} - -This table contains block level data for the dexalot 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 %} - - -{% docs dexalot_difficulty %} - -The effort required to mine the block. - -{% enddocs %} - - -{% docs dexalot_extra_data %} - -Any data included by the validator for a given block. - -{% enddocs %} - - -{% docs dexalot_gas_limit %} - -Total gas limit provided by all transactions in the block. - -{% enddocs %} - - -{% docs dexalot_gas_used %} - -Total gas used in the block. - -{% enddocs %} - - -{% docs dexalot_miner %} - -Miner who successfully added a given block to the blockchain. - -{% enddocs %} - - -{% docs dexalot_network %} - -The network on the blockchain used by a transaction. - -{% enddocs %} - - -{% docs dexalot_parent_hash %} - -The hash of the block from which a given block is generated. Also known as the parent block. - -{% enddocs %} - - -{% docs dexalot_receipts_root %} - -The root of the state trie. - -{% enddocs %} - - -{% docs dexalot_sha3_uncles %} - -The mechanism which Ethereum Javascript RLP encodes an empty string. - -{% enddocs %} - - -{% docs dexalot_size %} - -Block size, which is determined by a given block's gas limit. - -{% enddocs %} - - -{% docs dexalot_total_difficulty %} - -Total difficulty of the chain at a given block. - -{% enddocs %} - - -{% docs dexalot_tx_count %} - -Total number of transactions within a block. - -{% enddocs %} - - -{% docs dexalot_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 %} - - diff --git a/models/doc_descriptions/dexalot/core/dexalot_event_logs.md b/models/doc_descriptions/dexalot/core/dexalot_event_logs.md deleted file mode 100644 index b1e36be..0000000 --- a/models/doc_descriptions/dexalot/core/dexalot_event_logs.md +++ /dev/null @@ -1,96 +0,0 @@ -{% docs dexalot_event_index %} - -Event number within a transaction. - -{% enddocs %} - - -{% docs dexalot_event_inputs %} - -The decoded event inputs for a given event. - -{% enddocs %} - - -{% docs dexalot_event_name %} - -The decoded event name for a given event. - -{% enddocs %} - - -{% docs dexalot_event_removed %} - -Whether the event has been removed from the transaction. - -{% enddocs %} - - -{% docs dexalot_origin_sig %} - -The function signature of this transaction. - -{% enddocs %} - - -{% docs dexalot_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 %} - - -{% docs dexalot_logs_contract_address %} - -The address interacted with for a given event. - -{% enddocs %} - - -{% docs dexalot_logs_contract_name %} - -The name of the contract or token, where possible. - -{% enddocs %} - - -{% docs dexalot_logs_data %} - -The un-decoded event data. - -{% enddocs %} - - -{% docs dexalot_logs_table_doc %} - -This table contains flattened event logs from transactions on the Dexalot Subnet. 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 %} - - -{% docs dexalot_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 dexalot_origin_from %} - -The from address of this transaction. - -{% enddocs %} - - -{% docs dexalot_origin_to %} - -The to address of this transaction. - -{% enddocs %} - - -{% docs dexalot_topics %} - -The un-decoded event input topics. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dexalot/core/dexalot_traces.md b/models/doc_descriptions/dexalot/core/dexalot_traces.md deleted file mode 100644 index 45d6aa9..0000000 --- a/models/doc_descriptions/dexalot/core/dexalot_traces.md +++ /dev/null @@ -1,142 +0,0 @@ -{% docs dexalot_traces_block_no %} - -The block number of this transaction. - -{% enddocs %} - - -{% docs dexalot_traces_blocktime %} - -The block timestamp of this transaction. - -{% enddocs %} - - -{% docs dexalot_traces_call_data %} - -The raw JSON data for this trace. - -{% enddocs %} - - -{% docs dexalot_traces_from %} - -The sending address of this trace. This is not necessarily the from address of the transaction. - -{% enddocs %} - - -{% docs dexalot_traces_gas %} - -The gas supplied for this trace. - -{% enddocs %} - - -{% docs dexalot_traces_gas_used %} - -The gas used for this trace. - -{% enddocs %} - - -{% docs dexalot_traces_identifier %} - -This field represents the position and type of the trace within the transaction. - -{% enddocs %} - - -{% docs dexalot_trace_index %} - -The index of the trace within the transaction. - -{% enddocs %} - - -{% docs dexalot_traces_input %} - -The input data for this trace. - -{% enddocs %} - - -{% docs dexalot_traces_output %} - -The output data for this trace. - -{% enddocs %} - - -{% docs dexalot_traces_sub %} - -The amount of nested sub traces for this trace. - -{% enddocs %} - - -{% docs dexalot_traces_table_doc %} - -Data is reliable starting on block 21248026. This table contains flattened trace data for internal contract calls on the Dexalot Blockchain. Hex encoded fields can be decoded to integers by using `utils.udf_hex_to_int()`. - -{% enddocs %} - - -{% docs dexalot_traces_to %} - -The receiving address of this trace. This is not necessarily the to address of the transaction. - -{% enddocs %} - - -{% docs dexalot_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 dexalot_traces_type %} - -The type of internal transaction. Common trace types are `CALL`, `DELEGATECALL`, and `STATICCALL`. - -{% enddocs %} - - -{% docs dexalot_traces_value %} - -The amount of ETH transferred in this trace. - -{% enddocs %} - - -{% docs dexalot_traces_value_hex %} - -The amount of ETH transferred in this trace, in hexadecimal format. - -{% enddocs %} - - -{% docs dexalot_traces_trace_succeeded %} - -The status of the trace, where TRUE = SUCCESS and FALSE = FAILED. - -{% enddocs %} - -{% docs dexalot_traces_error_reason %} - -The reason for the trace failure, if any. - -{% enddocs %} - -{% docs dexalot_traces_revert_reason %} - -The reason for the trace revert, if any. - -{% enddocs %} - -{% docs dexalot_traces_trace_index %} - -The index of the trace within the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dexalot/core/dexalot_transactions.md b/models/doc_descriptions/dexalot/core/dexalot_transactions.md deleted file mode 100644 index 1fee5ad..0000000 --- a/models/doc_descriptions/dexalot/core/dexalot_transactions.md +++ /dev/null @@ -1,105 +0,0 @@ -{% docs dexalot_cumulative_gas_used %} - -The total amount of gas used when this transaction was executed in the block. - -{% enddocs %} - - -{% docs dexalot_tx_block_hash %} - -Block hash is a unique 66-character identifier that is generate when a block is produced. - -{% enddocs %} - - -{% docs dexalot_tx_fee %} - -Amount paid to validate the transaction in ALOT. - -{% enddocs %} - - -{% docs dexalot_tx_gas_limit %} - -Maximum amount of gas allocated for the transaction. - -{% enddocs %} - - -{% docs dexalot_tx_gas_price %} - -Cost per unit of gas in Gwei. - -{% enddocs %} - - -{% docs dexalot_tx_gas_used %} - -Gas used by transaction. - -{% enddocs %} - - -{% docs dexalot_tx_hash %} - -Transaction hash is a unique 66-character identifier that is generated when a transaction is executed. - -{% enddocs %} - - -{% docs dexalot_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 dexalot_tx_json %} - -This JSON column contains the transaction details, including event logs. - -{% enddocs %} - - -{% docs dexalot_tx_nonce %} - -The number of transactions sent from a given address. - -{% enddocs %} - - -{% docs dexalot_tx_origin_sig %} - -The function signature of the contract call. - -{% enddocs %} - - -{% docs dexalot_tx_position %} - -The position of the transaction within the block. - -{% enddocs %} - - -{% docs dexalot_tx_status %} - -Status of the transaction. - -{% enddocs %} - - -{% docs dexalot_tx_table_doc %} - -This table contains transaction level data for the Dexalot Subnet. Each transaction will have a unique transaction hash, along with transactions fees and a ALOT value transferred when applicable. Transactions may be native ALOT transfers or interactions with contract addresses. For more information, please see [The Ethereum Organization - Transactions](https://ethereum.org/en/developers/docs/transactions/) - -{% enddocs %} - - -{% docs dexalot_value %} - -The value transacted in ALOT. - -{% enddocs %} - - diff --git a/models/doc_descriptions/dexalot/general/dexalot_block_number.md b/models/doc_descriptions/dexalot/general/dexalot_block_number.md deleted file mode 100644 index 798e5d7..0000000 --- a/models/doc_descriptions/dexalot/general/dexalot_block_number.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs dexalot_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/dexalot/general/dexalot_block_timestamp.md b/models/doc_descriptions/dexalot/general/dexalot_block_timestamp.md deleted file mode 100644 index 8c9466e..0000000 --- a/models/doc_descriptions/dexalot/general/dexalot_block_timestamp.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs dexalot_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/dexalot/general/dexalot_decimals.md b/models/doc_descriptions/dexalot/general/dexalot_decimals.md deleted file mode 100644 index 4c5378d..0000000 --- a/models/doc_descriptions/dexalot/general/dexalot_decimals.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs dexalot_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/dexalot/general/dexalot_from_address.md b/models/doc_descriptions/dexalot/general/dexalot_from_address.md deleted file mode 100644 index e48b6ce..0000000 --- a/models/doc_descriptions/dexalot/general/dexalot_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs dexalot_from_address %} - -The sending address of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dexalot/general/dexalot_ingested_at.md b/models/doc_descriptions/dexalot/general/dexalot_ingested_at.md deleted file mode 100644 index e71d6c6..0000000 --- a/models/doc_descriptions/dexalot/general/dexalot_ingested_at.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs dexalot_ingested_at %} - -Internal column. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dexalot/general/dexalot_symbol.md b/models/doc_descriptions/dexalot/general/dexalot_symbol.md deleted file mode 100644 index 41cf81e..0000000 --- a/models/doc_descriptions/dexalot/general/dexalot_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs dexalot_symbol %} - -The symbol belonging to the address of the token - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/dexalot/general/dexalot_to_address.md b/models/doc_descriptions/dexalot/general/dexalot_to_address.md deleted file mode 100644 index 8622564..0000000 --- a/models/doc_descriptions/dexalot/general/dexalot_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs dexalot_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/event_logs/avax_event_index.md b/models/doc_descriptions/event_logs/avax_event_index.md deleted file mode 100644 index 1199c30..0000000 --- a/models/doc_descriptions/event_logs/avax_event_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_event_index %} - -Event number within a transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/avax_event_inputs.md b/models/doc_descriptions/event_logs/avax_event_inputs.md deleted file mode 100644 index caa9bb0..0000000 --- a/models/doc_descriptions/event_logs/avax_event_inputs.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_event_name.md b/models/doc_descriptions/event_logs/avax_event_name.md deleted file mode 100644 index 63dc280..0000000 --- a/models/doc_descriptions/event_logs/avax_event_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_event_removed.md b/models/doc_descriptions/event_logs/avax_event_removed.md deleted file mode 100644 index e0e1b3d..0000000 --- a/models/doc_descriptions/event_logs/avax_event_removed.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_event_sig.md b/models/doc_descriptions/event_logs/avax_event_sig.md deleted file mode 100644 index 2e38d08..0000000 --- a/models/doc_descriptions/event_logs/avax_event_sig.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_origin_sig %} - -The function signature of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/avax_log_id_events.md b/models/doc_descriptions/event_logs/avax_log_id_events.md deleted file mode 100644 index f894a4d..0000000 --- a/models/doc_descriptions/event_logs/avax_log_id_events.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_logs_contract_address.md b/models/doc_descriptions/event_logs/avax_logs_contract_address.md deleted file mode 100644 index 4234f83..0000000 --- a/models/doc_descriptions/event_logs/avax_logs_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_logs_contract_name.md b/models/doc_descriptions/event_logs/avax_logs_contract_name.md deleted file mode 100644 index 60e3579..0000000 --- a/models/doc_descriptions/event_logs/avax_logs_contract_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_logs_data.md b/models/doc_descriptions/event_logs/avax_logs_data.md deleted file mode 100644 index 9eb17e0..0000000 --- a/models/doc_descriptions/event_logs/avax_logs_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_logs_data %} - -The un-decoded event data. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/avax_logs_table_doc.md b/models/doc_descriptions/event_logs/avax_logs_table_doc.md deleted file mode 100644 index 0a12aa2..0000000 --- a/models/doc_descriptions/event_logs/avax_logs_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_logs_table_doc %} - -This table contains flattened event logs from transactions on the Avalanche 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 %} diff --git a/models/doc_descriptions/event_logs/avax_logs_tx_hash.md b/models/doc_descriptions/event_logs/avax_logs_tx_hash.md deleted file mode 100644 index a8fd912..0000000 --- a/models/doc_descriptions/event_logs/avax_logs_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_origin_from.md b/models/doc_descriptions/event_logs/avax_origin_from.md deleted file mode 100644 index e6bd337..0000000 --- a/models/doc_descriptions/event_logs/avax_origin_from.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_origin_from %} - -The from address of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/avax_origin_to.md b/models/doc_descriptions/event_logs/avax_origin_to.md deleted file mode 100644 index 7c0c8ed..0000000 --- a/models/doc_descriptions/event_logs/avax_origin_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_origin_to %} - -The to address of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/event_logs/avax_topics.md b/models/doc_descriptions/event_logs/avax_topics.md deleted file mode 100644 index 6961b21..0000000 --- a/models/doc_descriptions/event_logs/avax_topics.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_topics %} - -The un-decoded event input topics. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/fsc_evm/blocks.md b/models/doc_descriptions/fsc_evm/blocks.md deleted file mode 100644 index 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/avax_block_number.md b/models/doc_descriptions/general/avax_block_number.md deleted file mode 100644 index b2f2b45..0000000 --- a/models/doc_descriptions/general/avax_block_number.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_block_timestamp.md b/models/doc_descriptions/general/avax_block_timestamp.md deleted file mode 100644 index 40ed0cd..0000000 --- a/models/doc_descriptions/general/avax_block_timestamp.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_decimals.md b/models/doc_descriptions/general/avax_decimals.md deleted file mode 100644 index 80633d9..0000000 --- a/models/doc_descriptions/general/avax_decimals.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_from_address.md b/models/doc_descriptions/general/avax_from_address.md deleted file mode 100644 index 76e25a4..0000000 --- a/models/doc_descriptions/general/avax_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_from_address %} - -The sending address of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/avax_ingested_at.md b/models/doc_descriptions/general/avax_ingested_at.md deleted file mode 100644 index 398a5a9..0000000 --- a/models/doc_descriptions/general/avax_ingested_at.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_ingested_at %} - -Internal column. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/avax_symbol.md b/models/doc_descriptions/general/avax_symbol.md deleted file mode 100644 index e8b5e7b..0000000 --- a/models/doc_descriptions/general/avax_symbol.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_symbol %} - -The symbol belonging to the address of the token - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/general/avax_to_address.md b/models/doc_descriptions/general/avax_to_address.md deleted file mode 100644 index 3f34e01..0000000 --- a/models/doc_descriptions/general/avax_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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 cba900e..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 `avax_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/avax_label.md b/models/doc_descriptions/labels/avax_label.md deleted file mode 100644 index ee33800..0000000 --- a/models/doc_descriptions/labels/avax_label.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_project_name %} - -The name of the project for this address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/avax_label_address.md b/models/doc_descriptions/labels/avax_label_address.md deleted file mode 100644 index 812c0fc..0000000 --- a/models/doc_descriptions/labels/avax_label_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_label_address_name.md b/models/doc_descriptions/labels/avax_label_address_name.md deleted file mode 100644 index fa303ea..0000000 --- a/models/doc_descriptions/labels/avax_label_address_name.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_label_address_name %} - -The most granular label for this address. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/avax_label_blockchain.md b/models/doc_descriptions/labels/avax_label_blockchain.md deleted file mode 100644 index 79a4dcc..0000000 --- a/models/doc_descriptions/labels/avax_label_blockchain.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_label_blockchain %} - -The name of the blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/avax_label_creator.md b/models/doc_descriptions/labels/avax_label_creator.md deleted file mode 100644 index c9e5153..0000000 --- a/models/doc_descriptions/labels/avax_label_creator.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_label_creator %} - -The name of the creator of the label. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/labels/avax_label_subtype.md b/models/doc_descriptions/labels/avax_label_subtype.md deleted file mode 100644 index 52978e3..0000000 --- a/models/doc_descriptions/labels/avax_label_subtype.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_label_type.md b/models/doc_descriptions/labels/avax_label_type.md deleted file mode 100644 index 2751f13..0000000 --- a/models/doc_descriptions/labels/avax_label_type.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_labels_table_doc.md b/models/doc_descriptions/labels/avax_labels_table_doc.md deleted file mode 100644 index 3e88b42..0000000 --- a/models/doc_descriptions/labels/avax_labels_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_labels_table %} - -This table contains labels for addresses on the Avalanche 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 964184c..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 `AVAX` for native AVAX transactions. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_currency_symbol.md b/models/doc_descriptions/nft/nft_currency_symbol.md deleted file mode 100644 index 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 eb6e868..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 Avalanche 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 8d6c6ef..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 Avalanche blockchain. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mint_price.md b/models/doc_descriptions/nft/nft_mint_price.md deleted file mode 100644 index 7b3633e..0000000 --- a/models/doc_descriptions/nft/nft_mint_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs nft_mint_price %} - -The price paid in AVAX to mint the NFT(s). - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/nft/nft_mint_price_usd.md b/models/doc_descriptions/nft/nft_mint_price_usd.md deleted file mode 100644 index 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 5dcc436..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 Avalanche 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 d4b58d1..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 AVAX. - -{% 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 60d4e96..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 asset. - -{% enddocs %} - -{% docs prices_symbol %} - -The symbol of asset. - -{% enddocs %} - -{% docs prices_token_address %} - -The specific address representing the asset on a specific platform. This will be NULL if referring to a native asset. - -{% enddocs %} - -{% docs prices_token_address_evm %} - -The specific address representing the asset on a specific platform. This will be NULL if referring to a native asset. The case (upper / lower) may or may not be specified within the `dim_asset_metadata` table, as this column is raw and not transformed, coming directly from the provider APIs. However, in the `ez_` views, it will be lowercase by default for all EVMs. - -{% enddocs %} - -{% docs prices_blockchain %} - -The Blockchain, Network, or Platform for this asset. - -{% enddocs %} - -{% docs prices_blockchain_id %} - -The unique identifier of the Blockchain, Network, or Platform for this asset. - -{% enddocs %} - -{% docs prices_decimals %} - -The number of decimals for the asset. May be NULL. - -{% enddocs %} - -{% docs prices_is_native %} - -A flag indicating assets native to the respective blockchain. - -{% enddocs %} - -{% docs prices_is_deprecated %} - -A flag indicating if the asset is deprecated or no longer supported by the provider. - -{% enddocs %} - -{% docs prices_id_deprecation %} - -Deprecating soon! Please use the `asset_id` column instead. - -{% enddocs %} - -{% docs prices_decimals_deprecation %} - -Deprecating soon! Please use the decimals column in `ez_asset_metadata` or join in `dim_contracts` instead. - -{% enddocs %} - -{% docs prices_hour %} - -Hour that the price was recorded at. - -{% enddocs %} - -{% docs prices_price %} - -Closing price of the recorded hour in USD. - -{% enddocs %} - -{% docs prices_is_imputed %} - -A flag indicating if the price was imputed, or derived, from the last arriving record. This is generally used for tokens with low-liquidity or inconsistent reporting. - -{% enddocs %} - -{% docs prices_open %} - -Opening price of the recorded hour in USD. - -{% enddocs %} - -{% docs prices_high %} - -Highest price of the recorded hour in USD - -{% enddocs %} - -{% docs prices_low %} - -Lowest price of the recorded hour in USD - -{% enddocs %} - -{% docs prices_close %} - -Closing price of the recorded hour in USD - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/stats/evm_stats_core.md b/models/doc_descriptions/stats/evm_stats_core.md deleted file mode 100644 index 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/avax_traces_block_no.md b/models/doc_descriptions/traces/avax_traces_block_no.md deleted file mode 100644 index 2fb5e93..0000000 --- a/models/doc_descriptions/traces/avax_traces_block_no.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_traces_block_no %} - -The block number of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/avax_traces_blocktime.md b/models/doc_descriptions/traces/avax_traces_blocktime.md deleted file mode 100644 index e248b67..0000000 --- a/models/doc_descriptions/traces/avax_traces_blocktime.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_traces_blocktime %} - -The block timestamp of this transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/avax_traces_call_data.md b/models/doc_descriptions/traces/avax_traces_call_data.md deleted file mode 100644 index cb835a7..0000000 --- a/models/doc_descriptions/traces/avax_traces_call_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_traces_call_data %} - -The raw JSON data for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/avax_traces_from.md b/models/doc_descriptions/traces/avax_traces_from.md deleted file mode 100644 index 5003bc6..0000000 --- a/models/doc_descriptions/traces/avax_traces_from.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_traces_gas.md b/models/doc_descriptions/traces/avax_traces_gas.md deleted file mode 100644 index c2fdda8..0000000 --- a/models/doc_descriptions/traces/avax_traces_gas.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_traces_gas %} - -The gas supplied for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/avax_traces_gas_used.md b/models/doc_descriptions/traces/avax_traces_gas_used.md deleted file mode 100644 index 17da65f..0000000 --- a/models/doc_descriptions/traces/avax_traces_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_traces_gas_used %} - -The gas used for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/avax_traces_identifier.md b/models/doc_descriptions/traces/avax_traces_identifier.md deleted file mode 100644 index d1b85d8..0000000 --- a/models/doc_descriptions/traces/avax_traces_identifier.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_traces_index.md b/models/doc_descriptions/traces/avax_traces_index.md deleted file mode 100644 index e382671..0000000 --- a/models/doc_descriptions/traces/avax_traces_index.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_trace_index %} - -The index of the trace within the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/avax_traces_input.md b/models/doc_descriptions/traces/avax_traces_input.md deleted file mode 100644 index 2b2d1ed..0000000 --- a/models/doc_descriptions/traces/avax_traces_input.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_traces_input %} - -The input data for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/avax_traces_output.md b/models/doc_descriptions/traces/avax_traces_output.md deleted file mode 100644 index 11743d4..0000000 --- a/models/doc_descriptions/traces/avax_traces_output.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_traces_output %} - -The output data for this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/avax_traces_sub.md b/models/doc_descriptions/traces/avax_traces_sub.md deleted file mode 100644 index 570d7fd..0000000 --- a/models/doc_descriptions/traces/avax_traces_sub.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_traces_table_doc.md b/models/doc_descriptions/traces/avax_traces_table_doc.md deleted file mode 100644 index 543b937..0000000 --- a/models/doc_descriptions/traces/avax_traces_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_traces_table_doc %} - -This table contains flattened trace data for internal contract calls on the Avalanche Blockchain. Hex encoded fields can be decoded to integers by using `ethereum.public.udf_hex_to_int()`. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/traces/avax_traces_to.md b/models/doc_descriptions/traces/avax_traces_to.md deleted file mode 100644 index c054280..0000000 --- a/models/doc_descriptions/traces/avax_traces_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_traces_tx_hash.md b/models/doc_descriptions/traces/avax_traces_tx_hash.md deleted file mode 100644 index da61aee..0000000 --- a/models/doc_descriptions/traces/avax_traces_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_traces_type.md b/models/doc_descriptions/traces/avax_traces_type.md deleted file mode 100644 index 768428f..0000000 --- a/models/doc_descriptions/traces/avax_traces_type.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_traces_value.md b/models/doc_descriptions/traces/avax_traces_value.md deleted file mode 100644 index a6aa992..0000000 --- a/models/doc_descriptions/traces/avax_traces_value.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_traces_value %} - -The amount of AVAX transferred in this trace. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/avax_cumulative_gas_used.md b/models/doc_descriptions/transactions/avax_cumulative_gas_used.md deleted file mode 100644 index 48fc568..0000000 --- a/models/doc_descriptions/transactions/avax_cumulative_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_tx_block_hash.md b/models/doc_descriptions/transactions/avax_tx_block_hash.md deleted file mode 100644 index 2e09696..0000000 --- a/models/doc_descriptions/transactions/avax_tx_block_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_tx_fee.md b/models/doc_descriptions/transactions/avax_tx_fee.md deleted file mode 100644 index cb5ff2d..0000000 --- a/models/doc_descriptions/transactions/avax_tx_fee.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_tx_fee %} - -Amount paid to validate the transaction in AVAX. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/avax_tx_gas_limit.md b/models/doc_descriptions/transactions/avax_tx_gas_limit.md deleted file mode 100644 index 2077f4b..0000000 --- a/models/doc_descriptions/transactions/avax_tx_gas_limit.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_tx_gas_price.md b/models/doc_descriptions/transactions/avax_tx_gas_price.md deleted file mode 100644 index bc6cb4e..0000000 --- a/models/doc_descriptions/transactions/avax_tx_gas_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_tx_gas_price %} - -Cost per unit of gas in Gwei. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/avax_tx_gas_used.md b/models/doc_descriptions/transactions/avax_tx_gas_used.md deleted file mode 100644 index 3a9b74c..0000000 --- a/models/doc_descriptions/transactions/avax_tx_gas_used.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_tx_gas_used %} - -Gas used by transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/avax_tx_hash.md b/models/doc_descriptions/transactions/avax_tx_hash.md deleted file mode 100644 index 7cee633..0000000 --- a/models/doc_descriptions/transactions/avax_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_tx_input_data.md b/models/doc_descriptions/transactions/avax_tx_input_data.md deleted file mode 100644 index b501905..0000000 --- a/models/doc_descriptions/transactions/avax_tx_input_data.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_tx_json.md b/models/doc_descriptions/transactions/avax_tx_json.md deleted file mode 100644 index 2776607..0000000 --- a/models/doc_descriptions/transactions/avax_tx_json.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_tx_nonce.md b/models/doc_descriptions/transactions/avax_tx_nonce.md deleted file mode 100644 index c0eaeed..0000000 --- a/models/doc_descriptions/transactions/avax_tx_nonce.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_tx_origin_sig.md b/models/doc_descriptions/transactions/avax_tx_origin_sig.md deleted file mode 100644 index 4d0ae50..0000000 --- a/models/doc_descriptions/transactions/avax_tx_origin_sig.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_tx_origin_sig %} - -The function signature of the contract call. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/avax_tx_position.md b/models/doc_descriptions/transactions/avax_tx_position.md deleted file mode 100644 index a84e1c1..0000000 --- a/models/doc_descriptions/transactions/avax_tx_position.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_tx_position %} - -The position of the transaction within the block. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/avax_tx_status.md b/models/doc_descriptions/transactions/avax_tx_status.md deleted file mode 100644 index f3a041d..0000000 --- a/models/doc_descriptions/transactions/avax_tx_status.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_tx_status %} - -Status of the transaction. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transactions/avax_tx_table_doc.md b/models/doc_descriptions/transactions/avax_tx_table_doc.md deleted file mode 100644 index 2fbe5cf..0000000 --- a/models/doc_descriptions/transactions/avax_tx_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_tx_table_doc %} - -This table contains transaction level data for the Avalanche 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/avax_value.md b/models/doc_descriptions/transactions/avax_value.md deleted file mode 100644 index 6ebd0e7..0000000 --- a/models/doc_descriptions/transactions/avax_value.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_value %} - -The value transacted in AVAX. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/avax_eth_amount.md b/models/doc_descriptions/transfers/avax_eth_amount.md deleted file mode 100644 index 6b6316d..0000000 --- a/models/doc_descriptions/transfers/avax_eth_amount.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_amount %} - -AVAX value transferred. - -{% enddocs %} diff --git a/models/doc_descriptions/transfers/avax_eth_amount_usd.md b/models/doc_descriptions/transfers/avax_eth_amount_usd.md deleted file mode 100644 index 1b34ed2..0000000 --- a/models/doc_descriptions/transfers/avax_eth_amount_usd.md +++ /dev/null @@ -1,6 +0,0 @@ - -{% docs avax_eth_amount_usd %} - -AVAX value transferred, in USD. - -{% enddocs %} diff --git a/models/doc_descriptions/transfers/avax_ez_eth_transfers_table_doc.md b/models/doc_descriptions/transfers/avax_ez_eth_transfers_table_doc.md deleted file mode 100644 index c195fd3..0000000 --- a/models/doc_descriptions/transfers/avax_ez_eth_transfers_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_ez_eth_transfers_table_doc %} - -This table contains all native AVAX 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/avax_ez_transfer_table_doc.md b/models/doc_descriptions/transfers/avax_ez_transfer_table_doc.md deleted file mode 100644 index 7ac838a..0000000 --- a/models/doc_descriptions/transfers/avax_ez_transfer_table_doc.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_ez_transfer_table_doc %} - -This table will contain all events in the ```fact_token_transfers table```, along with joined columns such as token price, symbol, and decimals where possible that allow for easier analysis of token transfer events. Please note Native AVAX transfers are not included here. *Column Name Update: ```eth__address``` has been migrated to ```avax__address```, values remain unchanged.* - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/avax_log_id_transfers.md b/models/doc_descriptions/transfers/avax_log_id_transfers.md deleted file mode 100644 index d43dab3..0000000 --- a/models/doc_descriptions/transfers/avax_log_id_transfers.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_origin_to.md b/models/doc_descriptions/transfers/avax_origin_to.md deleted file mode 100644 index 0f9d9d2..0000000 --- a/models/doc_descriptions/transfers/avax_origin_to.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_eth_origin_to %} - -The to address at the transaction level. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/avax_transfer_amount.md b/models/doc_descriptions/transfers/avax_transfer_amount.md deleted file mode 100644 index dfa08a9..0000000 --- a/models/doc_descriptions/transfers/avax_transfer_amount.md +++ /dev/null @@ -1,11 +0,0 @@ -{% docs avax_transfer_amount %} - -The decimal transformed amount for this token. Tokens without a decimal adjustment will be nulled out here. - -{% enddocs %} - -{% docs avax_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/avax_transfer_amount_usd.md b/models/doc_descriptions/transfers/avax_transfer_amount_usd.md deleted file mode 100644 index 19bb374..0000000 --- a/models/doc_descriptions/transfers/avax_transfer_amount_usd.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_transfer_contract_address.md b/models/doc_descriptions/transfers/avax_transfer_contract_address.md deleted file mode 100644 index e580c45..0000000 --- a/models/doc_descriptions/transfers/avax_transfer_contract_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_transfer_contract_address %} - -Contract address of the token being transferred. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/avax_transfer_from_address.md b/models/doc_descriptions/transfers/avax_transfer_from_address.md deleted file mode 100644 index ecfe112..0000000 --- a/models/doc_descriptions/transfers/avax_transfer_from_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_transfer_from_address %} - -The sending address of this transfer. - -{% enddocs %} \ No newline at end of file diff --git a/models/doc_descriptions/transfers/avax_transfer_has_decimal.md b/models/doc_descriptions/transfers/avax_transfer_has_decimal.md deleted file mode 100644 index 5f4fb9d..0000000 --- a/models/doc_descriptions/transfers/avax_transfer_has_decimal.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_transfer_has_price.md b/models/doc_descriptions/transfers/avax_transfer_has_price.md deleted file mode 100644 index bd11b1c..0000000 --- a/models/doc_descriptions/transfers/avax_transfer_has_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_transfer_raw_amount.md b/models/doc_descriptions/transfers/avax_transfer_raw_amount.md deleted file mode 100644 index 38869c3..0000000 --- a/models/doc_descriptions/transfers/avax_transfer_raw_amount.md +++ /dev/null @@ -1,11 +0,0 @@ -{% docs avax_transfer_raw_amount %} - -The amount of tokens transferred. This value is not decimal adjusted. - -{% enddocs %} - -{% docs avax_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/avax_transfer_to_address.md b/models/doc_descriptions/transfers/avax_transfer_to_address.md deleted file mode 100644 index 7eaee07..0000000 --- a/models/doc_descriptions/transfers/avax_transfer_to_address.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_transfer_token_price.md b/models/doc_descriptions/transfers/avax_transfer_token_price.md deleted file mode 100644 index c54ebf9..0000000 --- a/models/doc_descriptions/transfers/avax_transfer_token_price.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/avax_transfer_tx_hash.md b/models/doc_descriptions/transfers/avax_transfer_tx_hash.md deleted file mode 100644 index ef253db..0000000 --- a/models/doc_descriptions/transfers/avax_transfer_tx_hash.md +++ /dev/null @@ -1,5 +0,0 @@ -{% docs avax_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/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 2775791..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 Snowtrace, 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 Snowtrace. If we cannot find an ABI on Snowtrace, 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 Snowtrace 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 `Snowtrace`, `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 c0d24ac..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 Avalanche C-Chain 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 d0b0e8f..0000000 --- a/models/gold/core/core__dim_labels.yml +++ /dev/null @@ -1,61 +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("avax_label_blockchain") }}' - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_set: - value_set: ['avalanche'] - - name: CREATOR - description: '{{ doc("avax_label_creator") }}' - tests: - - not_null - - name: ADDRESS - description: '{{ doc("avax_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("avax_labels_table") }}' - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - STRING - - VARCHAR - - name: LABEL_TYPE - description: '{{ doc("avax_label_type") }}' - tests: - - not_null - - name: LABEL_SUBTYPE - description: '{{ doc("avax_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("avax_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 d5b365a..0000000 --- a/models/gold/core/core__ez_decoded_event_logs.sql +++ /dev/null @@ -1,70 +0,0 @@ -{{ config ( - materialized = "incremental", - unique_key = "ez_decoded_event_logs_id", - incremental_strategy = 'delete+insert', - cluster_by = "block_timestamp::date", - incremental_predicates = [standard_predicate()], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(ez_decoded_event_logs_id, contract_name, contract_address)", - tags = ['decoded_logs'] -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - {# tx_position, #} -- new column - event_index, - contract_address, - topics, - topics [0] :: STRING AS topic_0, - --new column - topics [1] :: STRING AS topic_1, - --new column - topics [2] :: STRING AS topic_2, - --new column - topics [3] :: STRING AS topic_3, - --new column - DATA, - event_removed, - origin_from_address, - origin_to_address, - origin_function_signature, - CASE - WHEN tx_status = 'SUCCESS' THEN TRUE - ELSE FALSE - END AS tx_succeeded, - event_name, - decoded_data AS full_decoded_log, - decoded_flat AS decoded_log, - token_name AS contract_name, - COALESCE ( - decoded_logs_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} - ) AS ez_decoded_event_logs_id, -{% if is_incremental() %} - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, -{% else %} - GREATEST(block_timestamp, dateadd('day', -10, SYSDATE())) AS inserted_timestamp, - GREATEST(block_timestamp, dateadd('day', -10, SYSDATE())) AS modified_timestamp, -{% endif %} - tx_status --deprecate -FROM - {{ ref('silver__decoded_logs') }} - l - LEFT JOIN {{ ref('silver__contracts') }} C USING (contract_address) -WHERE 1=1 - - {% if is_incremental() %} - AND l.modified_timestamp > ( - SELECT - COALESCE( - MAX(modified_timestamp), - '2000-01-01'::TIMESTAMP - ) - FROM - {{ this }} - ) - {% endif %} \ No newline at end of file diff --git a/models/gold/core/core__ez_decoded_event_logs.yml b/models/gold/core/core__ez_decoded_event_logs.yml deleted file mode 100644 index c63c89c..0000000 --- a/models/gold/core/core__ez_decoded_event_logs.yml +++ /dev/null @@ -1,73 +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("avax_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("avax_logs_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("avax_event_index") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("avax_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("avax_tx_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("avax_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("avax_origin_to") }}' - - name: TOPICS - description: '{{ doc("avax_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("avax_logs_data") }}' - - name: EVENT_REMOVED - description: '{{ doc("avax_event_removed") }}' - - name: TX_STATUS - description: '{{ doc("avax_tx_status") }}' - - name: EZ_DECODED_EVENT_LOGS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__ez_native_transfers.sql b/models/gold/core/core__ez_native_transfers.sql deleted file mode 100644 index 5f8cc7f..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 - block_number, - block_timestamp, - tx_hash, - tx_position, - trace_index, - from_address, - to_address, - amount, - amount_precise_raw, - amount_precise, - amount_usd, - origin_from_address, - origin_to_address, - origin_function_signature, - 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 5bd902d..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("avax_transfer_tx_hash") }}' - - name: BLOCK_NUMBER - description: '{{ doc("avax_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' - - name: TX_POSITION - description: '{{ doc("avax_tx_position") }}' - - name: TRACE_INDEX - description: '{{ doc("avax_trace_index") }}' - - name: IDENTIFIER - description: '{{ doc("evm_column_deprecation_notice_identifier") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("avax_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("avax_origin_to") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("avax_origin_sig") }}' - - name: FROM_ADDRESS - description: '{{ doc("avax_transfer_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("avax_transfer_to_address") }}' - - name: AMOUNT - description: '{{ doc("avax_amount") }}' - - name: AMOUNT_PRECISE_RAW - description: '{{ doc("precise_amount_unadjusted") }}' - - name: AMOUNT_PRECISE - description: '{{ doc("precise_amount_adjusted") }}' - - name: AMOUNT_USD - description: '{{ doc("avax_eth_amount_usd") }}' - - name: EZ_NATIVE_TRANSFERS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__ez_token_transfers.sql b/models/gold/core/core__ez_token_transfers.sql deleted file mode 100644 index e62fc4c..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') }} \ No newline at end of file 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 2d9f130..0000000 --- a/models/gold/core/core__ez_token_transfers.yml +++ /dev/null @@ -1,58 +0,0 @@ -version: 2 -models: - - name: core__ez_token_transfers - description: '{{ doc("evm_ez_token_transfers_table_doc") }}' - - columns: - - name: BLOCK_NUMBER - description: '{{ doc("avax_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("avax_transfer_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("avax_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("avax_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("avax_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("avax_origin_to") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("avax_transfer_contract_address") }}' - - name: FROM_ADDRESS - description: '{{ doc("avax_transfer_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("avax_transfer_to_address") }}' - - name: RAW_AMOUNT_PRECISE - description: '{{ doc("avax_transfer_raw_amount_precise") }}' - - name: RAW_AMOUNT - description: '{{ doc("avax_transfer_raw_amount") }}' - - name: AMOUNT_PRECISE - description: '{{ doc("avax_transfer_amount_precise") }}' - - name: TOKEN_PRICE - description: '{{ doc("evm_column_deprecation_notice_token_price") }}' - - name: AMOUNT - description: '{{ doc("avax_transfer_amount") }}' - - name: AMOUNT_USD - description: '{{ doc("avax_transfer_amount_usd") }}' - - name: DECIMALS - description: '{{ doc("avax_decimals") }}' - - name: SYMBOL - description: '{{ doc("avax_symbol") }}' - - name: TOKEN_PRICE - description: '{{ doc("avax_transfer_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("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_blocks.sql b/models/gold/core/core__fact_blocks.sql deleted file mode 100644 index adf9494..0000000 --- a/models/gold/core/core__fact_blocks.sql +++ /dev/null @@ -1,100 +0,0 @@ -{{ config( - materialized = 'view', - persist_docs ={ "relation": true, - "columns": true } -) }} - -SELECT - block_number, - hash as block_hash, - block_timestamp, - 'mainnet' AS network, - tx_count, - size, - miner, - extra_data, - parent_hash, - gas_used, - gas_limit, - base_fee_per_gas, - difficulty, - total_difficulty, - sha3_uncles, - uncles AS uncle_blocks, - nonce, - receipts_root, - state_root, - transactions_root, - logs_bloom, - COALESCE ( - blocks_id, - {{ dbt_utils.generate_surrogate_key( - ['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, - 'avalanche' AS blockchain, - hash, - 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 -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 a78f9a5..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: GAS_USED - description: '{{ doc("evm_gas_used") }}' - - name: BASE_FEE_PER_GAS - description: '{{ doc("evm_base_fee_per_gas") }}' - - 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: BASE_FEE_PER_GAS - description: '{{ doc("evm_base_fee_per_gas") }}' - - name: FACT_BLOCKS_ID - description: '{{ doc("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_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 14f54be..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("avax_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("avax_logs_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("avax_event_index") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("avax_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("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_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 edbf358..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("evm_pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("evm_inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_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 c523e79..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("avax_block_number") }}' - - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' - - name: TX_HASH - description: '{{ doc("avax_transfer_tx_hash") }}' - - name: EVENT_INDEX - description: '{{ doc("avax_event_index") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("avax_origin_sig") }}' - - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("avax_origin_from") }}' - - name: ORIGIN_TO_ADDRESS - description: '{{ doc("avax_origin_to") }}' - - name: CONTRACT_ADDRESS - description: '{{ doc("avax_transfer_contract_address") }}' - - name: FROM_ADDRESS - description: '{{ doc("avax_transfer_from_address") }}' - - name: TO_ADDRESS - description: '{{ doc("avax_transfer_to_address") }}' - - name: RAW_AMOUNT - description: '{{ doc("avax_transfer_raw_amount") }}' - - name: RAW_AMOUNT_PRECISE - description: '{{ doc("avax_transfer_raw_amount_precise") }}' - - name: _LOG_ID - description: '{{ doc("internal_column") }}' - - name: FACT_TOKEN_TRANSFERS_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_traces.sql b/models/gold/core/core__fact_traces.sql deleted file mode 100644 index dd0e744..0000000 --- a/models/gold/core/core__fact_traces.sql +++ /dev/null @@ -1,490 +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 = ['non_realtime'], - full_refresh = false -) }} -{# {{ fsc_evm.gold_traces_v1( -full_reload_start_block = 5000000, -full_reload_blocks = 2000000 -) }} -#} -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 - ) + 2000000 - FROM - {{ this }} -) -{% else %} - AND block_number <= 5000000 -{% 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, - DATA, - tx_status, - trace_status, - {{ 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 eb1e2f1..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") }}' \ No newline at end of file diff --git a/models/gold/core/core__fact_transactions.sql b/models/gold/core/core__fact_transactions.sql deleted file mode 100644 index 8cea79e..0000000 --- a/models/gold/core/core__fact_transactions.sql +++ /dev/null @@ -1,57 +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, - nonce, - position as tx_position, - input_data, - gas_price, - gas AS gas_limit, - gas_used, - cumulative_gas_used, - effective_gas_price, - max_fee_per_gas, - max_priority_fee_per_gas, - r, - s, - v, - tx_type, - chain_id, - COALESCE ( - transactions_id, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash'] - ) }} - ) AS fact_transactions_id, - COALESCE( - inserted_timestamp, - '2000-01-01' - ) AS inserted_timestamp, - COALESCE( - modified_timestamp, - '2000-01-01' - ) AS modified_timestamp, - block_hash, - tx_status as status, - position -FROM - {{ ref('silver__transactions') }} diff --git a/models/gold/core/core__fact_transactions.yml b/models/gold/core/core__fact_transactions.yml deleted file mode 100644 index 9dff395..0000000 --- a/models/gold/core/core__fact_transactions.yml +++ /dev/null @@ -1,68 +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_LIMIT - description: '{{ doc("evm_tx_gas_limit") }}' - - name: GAS_USED - description: '{{ doc("evm_tx_gas_used") }}' - - name: CUMULATIVE_GAS_USED - description: '{{ doc("evm_cumulative_gas_used") }}' - - name: MAX_FEE_PER_GAS - description: The maximum fee per gas of the transaction, in Gwei. - - name: MAX_PRIORITY_FEE_PER_GAS - description: The maximum priority fee per gas of the transaction, in Gwei. - - name: STATUS - description: '{{ doc("evm_column_deprecation_notice_tx_status") }}' - - name: TX_SUCCEEDED - description: '{{ doc("evm_tx_succeeded") }}' - - name: INPUT_DATA - description: '{{ doc("evm_tx_input_data") }}' - - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("evm_tx_origin_sig") }}' - - name: 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") }}' \ No newline at end of file diff --git a/models/gold/core/tests/traces/test_gold__fact_traces_full.sql b/models/gold/core/tests/traces/test_gold__fact_traces_full.sql deleted file mode 100644 index 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 04632d8..cd8eade 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 e1c032e..e07a686 100644 --- a/models/gold/defi/defi__ez_bridge_activity.sql +++ b/models/gold/defi/defi__ez_bridge_activity.sql @@ -7,7 +7,8 @@ 'table':{ 'PROTOCOL': 'ALLBRIDGE, AXELAR, CELER, CBRIDGE, DLN, DEBRIDGE, EYWA, MESON, MULTICHAIN, STARGATE, SYMBIOSIS, SYNAPSE, WORMHOLE, CCTP, CCIP', 'PURPOSE': 'BRIDGE' - } } } + } } }, + tags = ['gold','defi','bridge','curated','ez'] ) }} SELECT diff --git a/models/gold/defi/defi__ez_bridge_activity.yml b/models/gold/defi/defi__ez_bridge_activity.yml index ac95b07..cc7a271 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("avax_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("avax_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("avax_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("avax_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("avax_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS description: '{{ doc("evm_bridge_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("avax_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 c6bfc51..f37070d 100644 --- a/models/gold/defi/defi__ez_dex_swaps.sql +++ b/models/gold/defi/defi__ez_dex_swaps.sql @@ -9,7 +9,8 @@ 'PURPOSE': 'DEX, SWAPS' } } - } + }, + tags = ['gold','defi','dex','curated','ez'] ) }} SELECT @@ -71,7 +72,5 @@ SELECT COALESCE( modified_timestamp, '2000-01-01' - ) AS modified_timestamp, - _log_id - + ) AS modified_timestamp FROM {{ ref('silver_dex__complete_dex_swaps') }} \ No newline at end of file diff --git a/models/gold/defi/defi__ez_dex_swaps.yml b/models/gold/defi/defi__ez_dex_swaps.yml index 5562824..dfc894f 100644 --- a/models/gold/defi/defi__ez_dex_swaps.yml +++ b/models/gold/defi/defi__ez_dex_swaps.yml @@ -1,55 +1,53 @@ version: 2 models: - name: defi__ez_dex_swaps - description: '{{ doc("avax_ez_dex_swaps_table_doc") }}' + description: '{{ doc("evm_ez_dex_swaps_table_doc") }}' columns: - name: BLOCK_NUMBER - description: '{{ doc("avax_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("avax_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("avax_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("avax_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("avax_event_index") }}' - - name: _LOG_ID - description: '{{ doc("evm_column_deprecation_notice_log_id") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("avax_tx_origin_sig") }}' + description: '{{ doc("evm_tx_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("avax_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("avax_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("evm_pk") }}' - name: INSERTED_TIMESTAMP diff --git a/models/gold/defi/lending/defi__ez_lending_borrows.sql b/models/gold/defi/lending/defi__ez_lending_borrows.sql index ebc0864..7f4c450 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 e5fbac1..dea4046 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("avax_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("avax_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("avax_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("avax_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("avax_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("avax_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("avax_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("avax_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 071eafa..7b0ee05 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 937a7b3..c0a10a4 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("avax_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("avax_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("avax_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("avax_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("avax_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("avax_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("avax_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("avax_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 6f328ed..25fea3b 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 548dae4..3e26134 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("avax_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("avax_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("avax_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("avax_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("avax_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("avax_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("avax_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("avax_symbol") }}' + description: '{{ doc("evm_complete_lending_flashloan_token_symbol") }}' - name: FLASHLOAN_AMOUNT_UNADJ - description: '{{ doc("complete_lending_flashloan_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_flashloan_amount_unadj") }}' - name: FLASHLOAN_AMOUNT - description: '{{ doc("complete_lending_flashloan_amount") }}' + description: '{{ doc("evm_complete_lending_flashloan_amount") }}' - name: FLASHLOAN_AMOUNT_USD - description: '{{ doc("complete_lending_flashloan_amount_usd") }}' + description: '{{ doc("evm_complete_lending_flashloan_amount_usd") }}' - name: PREMIUM_AMOUNT_UNADJ - description: '{{ doc("complete_lending_premium_amount_unadj") }}' + description: '{{ doc("evm_complete_lending_premium_amount_unadj") }}' - name: PREMIUM_AMOUNT - description: '{{ doc("complete_lending_premium_amount") }}' + description: '{{ doc("evm_complete_lending_premium_amount") }}' - name: PREMIUM_AMOUNT_USD - description: '{{ doc("complete_lending_premium_amount_usd") }}' + description: '{{ doc("evm_complete_lending_premium_amount_usd") }}' - name: EZ_LENDING_FLASHLOANS_ID - description: '{{ doc("pk") }}' + description: '{{ doc("evm_pk") }}' - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' + description: '{{ doc("evm_inserted_timestamp") }}' - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file + description: '{{ doc("evm_modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/defi/lending/defi__ez_lending_liquidations.sql b/models/gold/defi/lending/defi__ez_lending_liquidations.sql index 7a8d1c0..a53ba29 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 4e08777..d8b189a 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("avax_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("avax_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("avax_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("avax_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("avax_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("avax_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("avax_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("avax_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("avax_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 c5cf895..0ab63a4 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 c03ea83..01c40db 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("avax_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("avax_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("avax_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("avax_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("avax_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("avax_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("avax_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 60705f6..012abb8 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 36b853c..1c08816 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("avax_block_number") }}' + description: '{{ doc("evm_block_number") }}' - name: BLOCK_TIMESTAMP - description: '{{ doc("avax_block_timestamp") }}' + description: '{{ doc("evm_block_timestamp") }}' - name: TX_HASH - description: '{{ doc("avax_logs_tx_hash") }}' + description: '{{ doc("evm_logs_tx_hash") }}' - name: CONTRACT_ADDRESS - description: '{{ doc("avax_logs_contract_address") }}' + description: '{{ doc("evm_logs_contract_address") }}' - name: EVENT_NAME - description: '{{ doc("avax_event_name") }}' + description: '{{ doc("evm_event_name") }}' - name: EVENT_INDEX - description: '{{ doc("avax_event_index") }}' + description: '{{ doc("evm_event_index") }}' - name: ORIGIN_FUNCTION_SIGNATURE - description: '{{ doc("nft_origin_sig") }}' + description: '{{ doc("evm_nft_origin_sig") }}' - name: ORIGIN_FROM_ADDRESS - description: '{{ doc("avax_origin_from") }}' + description: '{{ doc("evm_origin_from") }}' - name: ORIGIN_TO_ADDRESS - description: '{{ doc("avax_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 e20fc19..7af940f 100644 --- a/models/gold/nft/nft__ez_nft_sales.sql +++ b/models/gold/nft/nft__ez_nft_sales.sql @@ -2,10 +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 @@ -19,15 +17,12 @@ SELECT platform_exchange_version, aggregator_name, seller_address, - buyer_address, - nft_address as contract_address, -- new - project_name as name, -- new - tokenid as token_id, --new - COALESCE(erc1155_value, '1') :: STRING AS quantity, --new - CASE - WHEN erc1155_value IS NULL THEN 'erc721' - ELSE 'erc1155' - END AS token_standard, --new + buyer_address, + nft_address as contract_address, + project_name as name, + tokenId as token_id, + coalesce(erc1155_value, '1')::STRING AS quantity, + case when erc1155_value is null then 'erc721' else 'erc1155' end as token_standard, currency_symbol, currency_address, price, @@ -56,9 +51,7 @@ SELECT COALESCE( modified_timestamp, '2000-01-01' - ) AS modified_timestamp, - tokenId, -- deprecate - erc1155_value, -- deprecate - project_name, -- deprecate - nft_address -- deprecate -FROM {{ ref('silver__complete_nft_sales') }} \ No newline at end of file + ) 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 39bb71e..a4003b1 100644 --- a/models/gold/nft/nft__ez_nft_sales.yml +++ b/models/gold/nft/nft__ez_nft_sales.yml @@ -5,71 +5,63 @@ 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("evm_pk") }}' - name: INSERTED_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 fdf2de8..0000000 --- a/models/gold/nft/nft__ez_nft_transfers.sql +++ /dev/null @@ -1,59 +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, --new - CASE - WHEN token_transfer_type = 'erc721_Transfer' THEN 'erc721' - WHEN token_transfer_type = 'erc1155_TransferSingle' THEN 'erc1155' - WHEN token_transfer_type = 'erc1155_TransferBatch' THEN 'erc1155' - END AS token_standard, --new - 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') }} \ No newline at end of file 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 bfe9865..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") }}' \ No newline at end of file diff --git a/models/gold/price/price__dim_asset_metadata.sql b/models/gold/price/price__dim_asset_metadata.sql deleted file mode 100644 index 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 96cf4e5..0000000 --- a/models/gold/price/price__ez_prices_hourly.yml +++ /dev/null @@ -1,30 +0,0 @@ -version: 2 -models: - - name: price__ez_prices_hourly - description: '{{ doc("prices_ez_prices_hourly_table_doc") }}' - - columns: - - name: HOUR - description: '{{ doc("prices_hour")}}' - - name: TOKEN_ADDRESS - description: '{{ doc("prices_token_address_evm") }}' - - name: SYMBOL - description: '{{ doc("prices_symbol") }}' - - name: BLOCKCHAIN - description: '{{ doc("prices_blockchain") }}' - - name: DECIMALS - description: '{{ doc("prices_decimals") }}' - - name: PRICE - description: '{{ doc("prices_price") }}' - - name: IS_NATIVE - description: '{{ doc("prices_is_native") }}' - - name: IS_IMPUTED - description: '{{ doc("prices_is_imputed") }}' - - name: IS_DEPRECATED - description: '{{ doc("prices_is_deprecated") }}' - - name: EZ_PRICES_HOURLY_ID - description: '{{ doc("pk") }}' - - name: INSERTED_TIMESTAMP - description: '{{ doc("inserted_timestamp") }}' - - name: MODIFIED_TIMESTAMP - description: '{{ doc("modified_timestamp") }}' \ No newline at end of file diff --git a/models/gold/price/price__fact_prices_ohlc_hourly.sql b/models/gold/price/price__fact_prices_ohlc_hourly.sql deleted file mode 100644 index 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/stats/stats__ez_core_metrics_hourly.sql b/models/gold/stats/stats__ez_core_metrics_hourly.sql deleted file mode 100644 index 34fd6cc..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('price__ez_prices_hourly') }} - p - ON s.block_timestamp_hour = p.hour - AND p.token_address = '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7' --WAVAX 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/gold/tests/test_gold__ez_avax_transfers_full.sql b/models/gold/tests/test_gold__ez_avax_transfers_full.sql deleted file mode 100644 index c216052..0000000 --- a/models/gold/tests/test_gold__ez_avax_transfers_full.sql +++ /dev/null @@ -1,9 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['full_test'] -) }} - -SELECT - * -FROM - {{ ref('core__ez_native_transfers') }} diff --git a/models/gold/tests/test_gold__ez_avax_transfers_full.yml b/models/gold/tests/test_gold__ez_avax_transfers_full.yml deleted file mode 100644 index 3b6e208..0000000 --- a/models/gold/tests/test_gold__ez_avax_transfers_full.yml +++ /dev/null @@ -1,60 +0,0 @@ -version: 2 -models: - - name: test_gold__ez_avax_transfers_full - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - BLOCK_NUMBER - - TX_POSITION - - TRACE_INDEX - 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: FROM_ADDRESS - tests: - - not_null - - 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: AMOUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - 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/gold/tests/test_gold__ez_avax_transfers_recent.sql b/models/gold/tests/test_gold__ez_avax_transfers_recent.sql deleted file mode 100644 index 64c13ee..0000000 --- a/models/gold/tests/test_gold__ez_avax_transfers_recent.sql +++ /dev/null @@ -1,27 +0,0 @@ -{{ config ( - materialized = 'view', - tags = ['recent_test'] -) }} - -WITH last_3_days AS ( - - SELECT - block_number - FROM - {{ ref("_max_block_by_date") }} - qualify ROW_NUMBER() over ( - ORDER BY - block_number DESC - ) = 3 -) -SELECT - * -FROM - {{ ref('core__ez_native_transfers') }} -WHERE - block_number >= ( - SELECT - block_number - FROM - last_3_days - ) diff --git a/models/gold/tests/test_gold__ez_avax_transfers_recent.yml b/models/gold/tests/test_gold__ez_avax_transfers_recent.yml deleted file mode 100644 index bd272fd..0000000 --- a/models/gold/tests/test_gold__ez_avax_transfers_recent.yml +++ /dev/null @@ -1,60 +0,0 @@ -version: 2 -models: - - name: test_gold__ez_avax_transfers_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - BLOCK_NUMBER - - TX_POSITION - - TRACE_INDEX - 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: FROM_ADDRESS - tests: - - not_null - - 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: AMOUNT - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - 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/_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 bf88e6f..0000000 --- a/models/silver/_observability/silver_observability__logs_completeness.sql +++ /dev/null @@ -1,119 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -broken_blocks AS ( - SELECT - DISTINCT block_number - FROM - {{ ref("silver__receipts") }} - r - LEFT JOIN {{ ref("silver__logs") }} - l USING ( - block_number, - tx_hash - ) - JOIN block_range USING (block_number) - WHERE - l.tx_hash IS NULL - AND ARRAY_SIZE( - r.logs - ) > 0 -), -impacted_blocks AS ( - SELECT - COUNT(1) AS blocks_impacted_count, - ARRAY_AGG(block_number) within GROUP ( - ORDER BY - block_number - ) AS blocks_impacted_array - FROM - broken_blocks -) -SELECT - 'event_logs' AS test_name, - min_block, - max_block, - min_block_timestamp, - max_block_timestamp, - blocks_tested, - blocks_impacted_count, - blocks_impacted_array, - CURRENT_TIMESTAMP() AS test_timestamp -FROM - summary_stats - JOIN impacted_blocks - ON 1 = 1 diff --git a/models/silver/_observability/silver_observability__receipts_completeness.sql b/models/silver/_observability/silver_observability__receipts_completeness.sql deleted file mode 100644 index c491166..0000000 --- a/models/silver/_observability/silver_observability__receipts_completeness.sql +++ /dev/null @@ -1,117 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -broken_blocks AS ( - SELECT - DISTINCT block_number - FROM - {{ ref("silver__transactions") }} - t - LEFT JOIN {{ ref("silver__receipts") }} - r USING ( - block_number, - tx_hash, - block_hash - ) - JOIN block_range USING (block_number) - WHERE - r.tx_hash IS NULL -), -impacted_blocks AS ( - SELECT - COUNT(1) AS blocks_impacted_count, - ARRAY_AGG(block_number) within GROUP ( - ORDER BY - block_number - ) AS blocks_impacted_array - FROM - broken_blocks -) -SELECT - 'receipts' AS test_name, - min_block, - max_block, - min_block_timestamp, - max_block_timestamp, - blocks_tested, - blocks_impacted_count, - blocks_impacted_array, - CURRENT_TIMESTAMP() AS test_timestamp -FROM - summary_stats - JOIN impacted_blocks - ON 1 = 1 diff --git a/models/silver/_observability/silver_observability__traces_completeness.sql b/models/silver/_observability/silver_observability__traces_completeness.sql deleted file mode 100644 index 932611c..0000000 --- a/models/silver/_observability/silver_observability__traces_completeness.sql +++ /dev/null @@ -1,116 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = 'test_timestamp', - full_refresh = false, - tags = ['observability'] -) }} - -WITH summary_stats AS ( - - SELECT - MIN(block_number) AS min_block, - MAX(block_number) AS max_block, - MIN(block_timestamp) AS min_block_timestamp, - MAX(block_timestamp) AS max_block_timestamp, - COUNT(1) AS blocks_tested - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp <= DATEADD('hour', -12, CURRENT_TIMESTAMP()) - -{% if is_incremental() %} -AND ( - block_number >= ( - SELECT - MIN(block_number) - FROM - ( - SELECT - MIN(block_number) AS block_number - FROM - {{ ref('silver__blocks') }} - WHERE - block_timestamp BETWEEN DATEADD('hour', -96, CURRENT_TIMESTAMP()) - AND DATEADD('hour', -95, CURRENT_TIMESTAMP()) - UNION - SELECT - MIN(VALUE) - 1 AS block_number - FROM - ( - SELECT - blocks_impacted_array - FROM - {{ this }} - qualify ROW_NUMBER() over ( - ORDER BY - test_timestamp DESC - ) = 1 - ), - LATERAL FLATTEN( - input => blocks_impacted_array - ) - ) - ) {% if var('OBSERV_FULL_TEST') %} - OR block_number >= 0 - {% endif %} -) -{% endif %} -), -block_range AS ( - SELECT - _id AS block_number - FROM - {{ ref('silver__number_sequence') }} - WHERE - _id BETWEEN ( - SELECT - min_block - FROM - summary_stats - ) - AND ( - SELECT - max_block - FROM - summary_stats - ) -), -broken_blocks AS ( - SELECT - DISTINCT block_number - FROM - {{ ref("silver__transactions") }} - tx - LEFT JOIN {{ ref("core__fact_traces") }} - tr USING ( - block_number, - tx_hash - ) - JOIN block_range USING (block_number) - WHERE - tr.tx_hash IS NULL -), -impacted_blocks AS ( - SELECT - COUNT(1) AS blocks_impacted_count, - ARRAY_AGG(block_number) within GROUP ( - ORDER BY - block_number - ) AS blocks_impacted_array - FROM - broken_blocks -) -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 fbb1106..0000000 --- a/models/silver/abis/silver__abis.sql +++ /dev/null @@ -1,184 +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 IN ('snowscan', 'routescan') - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX( - _inserted_timestamp - ) - FROM - {{ this }} - WHERE - abi_source IN ( - 'snowscan', - 'routescan' - ) -) -{% 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 d3e7442..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 = 'avalanche' - 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 6aee4a8..0000000 --- a/models/silver/abis/silver__verified_abis.sql +++ /dev/null @@ -1,108 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = "contract_address", - tags = ['abis'] -) }} - -WITH base AS ( - - SELECT - contract_address, - PARSE_JSON( - abi_data :data :result - ) AS DATA, - _inserted_timestamp - FROM - {{ ref('bronze_api__contract_abis') }} - WHERE - abi_data :data :message :: STRING = 'OK' - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - COALESCE( - MAX( - _inserted_timestamp - ), - '1970-01-01' - ) - FROM - {{ this }} -) -{% endif %} -), -routescan_abis AS ( - SELECT - contract_address, - DATA, - _inserted_timestamp, - 'routescan' 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 - routescan_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 5c63fe8..0000000 --- a/models/silver/core/silver__blocks.sql +++ /dev/null @@ -1,75 +0,0 @@ --- depends_on: {{ ref('bronze__blocks') }} -{{ config( - materialized = 'incremental', - unique_key = "block_number", - cluster_by = "block_timestamp::date", - tags = ['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)", - 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, - 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, - _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 76eb92d..0000000 --- a/models/silver/core/silver__confirmed_blocks.sql +++ /dev/null @@ -1,50 +0,0 @@ --- depends_on: {{ ref('bronze__confirm_blocks') }} -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = "round(block_number,-3)", - tags = ['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 7a68519..0000000 --- a/models/silver/core/silver__contracts.sql +++ /dev/null @@ -1,108 +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 LENGTH( - read_output :: STRING - ) <= 4300 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 AS contract_address, - token_name, - token_decimals :: INTEGER AS token_decimals, - token_symbol, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['c1.contract_address'] - ) }} AS contracts_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id - FROM - contracts c1 - LEFT JOIN token_names - ON c1.contract_address = token_names.contract_address - LEFT JOIN token_symbols - ON c1.contract_address = token_symbols.contract_address - LEFT JOIN token_decimals - ON c1.contract_address = token_decimals.contract_address - AND dec_length < 3 qualify(ROW_NUMBER() over(PARTITION BY c1.contract_address - ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/core/silver__contracts.yml b/models/silver/core/silver__contracts.yml deleted file mode 100644 index 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 f1818da..0000000 --- a/models/silver/core/silver__created_contracts.sql +++ /dev/null @@ -1,44 +0,0 @@ -{{ config ( - materialized = "incremental", - unique_key = "created_contract_address", - merge_exclude_columns = ["inserted_timestamp"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(block_timestamp, tx_hash, created_contract_address, creator_address), SUBSTRING(created_contract_address, creator_address)", - tags = ['non_realtime'] -) }} - -SELECT - block_number, - block_timestamp, - tx_hash, - to_address AS created_contract_address, - from_address AS creator_address, - input AS created_contract_input, - modified_timestamp AS _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['to_address'] - ) }} AS created_contracts_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - {{ ref('core__fact_traces') }} -WHERE - TYPE ILIKE 'create%' - AND to_address IS NOT NULL - AND input IS NOT NULL - AND input != '0x' - AND tx_succeeded - AND trace_succeeded - -{% if is_incremental() %} -AND _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '24 hours' - FROM - {{ this }} -) -{% endif %} - -qualify(ROW_NUMBER() over(PARTITION BY created_contract_address -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/core/silver__created_contracts.yml b/models/silver/core/silver__created_contracts.yml deleted file mode 100644 index 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 7e5e748..0000000 --- a/models/silver/core/silver__decoded_logs.sql +++ /dev/null @@ -1,239 +0,0 @@ --- depends_on: {{ ref('bronze__decoded_logs') }} -{{ config ( - materialized = "incremental", - unique_key = ['block_number', 'event_index'], - cluster_by = "block_timestamp::date", - incremental_predicates = ["dynamic_range", "block_number"], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION", - merge_exclude_columns = ["inserted_timestamp"], - full_refresh = false, - tags = ['decoded_logs','reorg'] -) }} - -WITH base_data AS ( - - SELECT - block_number :: INTEGER AS block_number, - SPLIT( - id, - '-' - ) [0] :: STRING AS tx_hash, - SPLIT( - id, - '-' - ) [1] :: INTEGER AS event_index, - DATA :name :: STRING AS event_name, - LOWER( - DATA :address :: STRING - ) :: STRING AS contract_address, - DATA AS decoded_data, - id :: STRING AS _log_id, - TO_TIMESTAMP_NTZ(_inserted_timestamp) AS _inserted_timestamp - FROM - -{% if is_incremental() %} -{{ ref('bronze__decoded_logs') }} -WHERE - TO_TIMESTAMP_NTZ(_inserted_timestamp) >= ( - SELECT - MAX(_inserted_timestamp) - INTERVAL '2 hours' - FROM - {{ this }} - ) - AND DATA NOT ILIKE '%Event topic is not present in given ABI%' -{% else %} - {{ ref('bronze__decoded_logs_fr') }} -WHERE - _partition_by_block_number <= 2500000 - AND DATA NOT ILIKE '%Event topic is not present in given ABI%' -{% endif %} - -qualify(ROW_NUMBER() over (PARTITION BY block_number, event_index -ORDER BY - _inserted_timestamp DESC, _partition_by_created_date DESC)) = 1 -), -transformed_logs AS ( - SELECT - block_number, - tx_hash, - event_index, - contract_address, - event_name, - decoded_data, - _inserted_timestamp, - _log_id, - utils.udf_transform_logs(decoded_data) AS transformed - FROM - base_data -), -FINAL AS ( - SELECT - b.tx_hash, - b.block_number, - b.event_index, - b.event_name, - b.contract_address, - b.decoded_data, - transformed, - b._log_id, - b._inserted_timestamp, - OBJECT_AGG( - DISTINCT CASE - WHEN v.value :name = '' THEN CONCAT( - 'anonymous_', - v.index - ) - ELSE v.value :name - END, - v.value :value - ) AS decoded_flat - FROM - transformed_logs b, - LATERAL FLATTEN( - input => transformed :data - ) v - GROUP BY - b.tx_hash, - b.block_number, - b.event_index, - b.event_name, - b.contract_address, - b.decoded_data, - transformed, - b._log_id, - b._inserted_timestamp -), -new_records AS ( - SELECT - b.tx_hash, - b.block_number, - b.event_index, - b.event_name, - b.contract_address, - b.decoded_data, - b.transformed, - b._log_id, - b._inserted_timestamp, - b.decoded_flat, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - topics, - DATA, - event_removed :: STRING AS event_removed, - tx_status, - CASE - WHEN block_timestamp IS NULL THEN TRUE - ELSE FALSE - END AS is_pending - FROM - FINAL b - LEFT JOIN {{ ref('silver__logs') }} USING ( - block_number, - _log_id - ) -) - -{% if is_incremental() %}, -missing_data AS ( - SELECT - t.tx_hash, - t.block_number, - t.event_index, - t.event_name, - t.contract_address, - t.decoded_data, - t.transformed, - t._log_id, - GREATEST( - TO_TIMESTAMP_NTZ( - t._inserted_timestamp - ), - TO_TIMESTAMP_NTZ( - l._inserted_timestamp - ) - ) AS _inserted_timestamp, - t.decoded_flat, - l.block_timestamp, - l.origin_function_signature, - l.origin_from_address, - l.origin_to_address, - l.topics, - l.data, - l.event_removed :: STRING AS event_removed, - l.tx_status, - FALSE AS is_pending - FROM - {{ this }} - t - INNER JOIN {{ ref('silver__logs') }} - l USING ( - block_number, - _log_id - ) - WHERE - t.is_pending - AND l.block_timestamp IS NOT NULL -) -{% endif %} -SELECT - tx_hash, - block_number, - event_index, - event_name, - contract_address, - decoded_data, - transformed, - _log_id, - _inserted_timestamp, - decoded_flat, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - topics, - DATA, - event_removed, - tx_status, - is_pending, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} AS decoded_logs_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - new_records - -{% if is_incremental() %} -UNION -SELECT - tx_hash, - block_number, - event_index, - event_name, - contract_address, - decoded_data, - transformed, - _log_id, - _inserted_timestamp, - decoded_flat, - block_timestamp, - origin_function_signature, - origin_from_address, - origin_to_address, - topics, - DATA, - event_removed, - tx_status, - is_pending, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash', 'event_index'] - ) }} AS decoded_logs_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - missing_data -{% endif %} diff --git a/models/silver/core/silver__logs.sql b/models/silver/core/silver__logs.sql deleted file mode 100644 index b052ff2..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", - full_refresh = false, - tags = ['non_realtime'] -) }} - -WITH base AS ( - - SELECT - block_number, - tx_hash, - from_address AS origin_from_address, - to_address AS origin_to_address, - tx_status, - {# position AS tx_position, --new column #} - logs, - _inserted_timestamp - FROM - {{ ref('silver__receipts') }} - WHERE - ARRAY_SIZE(logs) > 0 - -{% if is_incremental() %} -AND _INSERTED_TIMESTAMP >= ( - SELECT - MAX(_INSERTED_TIMESTAMP) _INSERTED_TIMESTAMP - FROM - {{ this }} -) -{% endif %} -), -flat_logs AS ( - SELECT - block_number, - tx_hash, - origin_from_address, - origin_to_address, - tx_status, - {# position AS tx_position, --new column #} - VALUE :address :: STRING AS contract_address, - VALUE :blockHash :: STRING AS block_hash, - VALUE :data :: STRING AS DATA, - utils.udf_hex_to_int( - VALUE :logIndex :: STRING - ) :: INT AS event_index, - VALUE :removed :: BOOLEAN AS event_removed, - VALUE :topics AS topics, - _inserted_timestamp - FROM - base, - LATERAL FLATTEN( - input => logs - ) -), -new_records AS ( - SELECT - l.block_number, - txs.block_timestamp, - l.tx_hash, - l.origin_from_address, - l.origin_to_address, - txs.origin_function_signature, - l.tx_status, - {# l.tx_position, --new column #} - l.contract_address, - l.block_hash, - l.data, - l.event_index, - l.event_removed, - l.topics, - l._inserted_timestamp, - CASE - WHEN txs.block_timestamp IS NULL - OR txs.origin_function_signature IS NULL THEN TRUE - ELSE FALSE - END AS is_pending, - CONCAT( - l.tx_hash :: STRING, - '-', - l.event_index :: STRING - ) AS _log_id - FROM - flat_logs l - LEFT OUTER JOIN {{ ref('silver__transactions') }} - txs - ON l.block_number = txs.block_number - AND l.tx_hash = txs.tx_hash - -{% if is_incremental() %} -AND txs._INSERTED_TIMESTAMP >= ( - SELECT - MAX(_inserted_timestamp) :: DATE - 1 - FROM - {{ this }} -) -{% endif %} -) - -{% if is_incremental() %}, -missing_data AS ( - SELECT - t.block_number, - txs.block_timestamp, - t.tx_hash, - t.origin_from_address, - t.origin_to_address, - txs.origin_function_signature, - t.tx_status, - {# t.tx_position, --new column #} - 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 column #} - 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 column #} - 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 e01aad6..0000000 --- a/models/silver/core/silver__native_transfers.sql +++ /dev/null @@ -1,88 +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 avax_base AS ( - - SELECT - tx_hash, - block_number, - block_timestamp, - from_address, - to_address, - VALUE AS avax_value, - identifier, - CONCAT( - tx_hash :: STRING, - '-', - trace_index :: STRING - ) AS _call_id, - input, - modified_timestamp AS _INSERTED_TIMESTAMP, - value_precise_raw AS avax_value_precise_raw, - value_precise AS avax_value_precise, - tx_position, - trace_index, - origin_from_address, - origin_to_address, - origin_function_signature - FROM - {{ ref('core__fact_traces') }} - WHERE - avax_value > 0 - AND tx_succeeded - AND trace_succeeded - AND TYPE NOT IN ( - 'DELEGATECALL', - 'STATICCALL' - ) - -{% if is_incremental() %} -AND modified_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, - avax_value AS amount, - avax_value_precise_raw AS amount_precise_raw, - avax_value_precise AS amount_precise, - ROUND( - avax_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 - avax_base A - LEFT JOIN {{ ref('silver__complete_token_prices') }} - ON DATE_TRUNC( - 'hour', - A.block_timestamp - ) = HOUR - AND token_address = '0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7' \ No newline at end of file diff --git a/models/silver/core/silver__receipts.sql b/models/silver/core/silver__receipts.sql deleted file mode 100644 index 620905d..0000000 --- a/models/silver/core/silver__receipts.sql +++ /dev/null @@ -1,92 +0,0 @@ --- depends_on: {{ ref('bronze__receipts') }} -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = "block_number", - cluster_by = "ROUND(block_number, -3)", - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(block_hash, tx_hash, from_address, to_address)", - full_refresh = false, - tags = ['non_realtime'] -) }} - -WITH base AS ( - - SELECT - block_number, - DATA, - _inserted_timestamp - FROM - -{% if is_incremental() %} -{{ ref('bronze__receipts') }} -WHERE - _inserted_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) - AND IS_OBJECT(DATA) -{% else %} - {{ ref('bronze__receipts_fr') }} -WHERE - IS_OBJECT(DATA) -{% endif %} -), -FINAL AS ( - SELECT - block_number, - DATA :blockHash :: STRING AS block_hash, - utils.udf_hex_to_int( - DATA :blockNumber :: STRING - ) :: INT AS blockNumber, - utils.udf_hex_to_int( - DATA :cumulativeGasUsed :: STRING - ) :: INT AS cumulative_gas_used, - utils.udf_hex_to_int( - DATA :effectiveGasPrice :: STRING - ) :: INT / pow( - 10, - 9 - ) AS effective_gas_price, - DATA :from :: STRING AS from_address, - utils.udf_hex_to_int( - DATA :gasUsed :: STRING - ) :: INT AS gas_used, - DATA :logs AS logs, - DATA :logsBloom :: STRING AS logs_bloom, - utils.udf_hex_to_int( - DATA :status :: STRING - ) :: INT AS status, - CASE - WHEN status = 1 THEN TRUE - ELSE FALSE - END AS tx_success, - CASE - WHEN status = 1 THEN 'SUCCESS' - ELSE 'FAIL' - END AS tx_status, - DATA :to :: STRING AS to_address1, - CASE - WHEN to_address1 = '' THEN NULL - ELSE to_address1 - END AS to_address, - DATA :transactionHash :: STRING AS tx_hash, - utils.udf_hex_to_int( - DATA :transactionIndex :: STRING - ) :: INT AS POSITION, - utils.udf_hex_to_int( - DATA :type :: STRING - ) :: INT AS TYPE, - _inserted_timestamp - FROM - base -) -SELECT - * -FROM - FINAL -WHERE - tx_hash IS NOT NULL qualify(ROW_NUMBER() over (PARTITION BY block_number, POSITION -ORDER BY - _inserted_timestamp DESC)) = 1 diff --git a/models/silver/core/silver__relevant_contracts.sql b/models/silver/core/silver__relevant_contracts.sql deleted file mode 100644 index 083e8bc..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(_inserted_timestamp) AS max_inserted_timestamp_logs, - MAX(block_number) AS latest_event_block - FROM - {{ ref('silver__logs') }} - -{% if is_incremental() %} -WHERE - _inserted_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 f80d2c9..0000000 --- a/models/silver/core/silver__traces.sql +++ /dev/null @@ -1,15 +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 = ['non_realtime'] -) }} -{{ silver_traces_v1( - full_reload_start_block = 5000000, - full_reload_blocks = 3000000, - use_partition_key = true -) }} \ No newline at end of file diff --git a/models/silver/core/silver__transactions.sql b/models/silver/core/silver__transactions.sql deleted file mode 100644 index 043a846..0000000 --- a/models/silver/core/silver__transactions.sql +++ /dev/null @@ -1,322 +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 = ['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, - utils.udf_hex_to_int( - A.data :blockNumber :: STRING - ) :: INT AS blockNumber, - utils.udf_hex_to_int( - A.data :chainId :: STRING - ) :: INT AS chain_id, - A.data :from :: STRING AS from_address, - utils.udf_hex_to_int( - A.data :gas :: STRING - ) :: INT AS gas, - utils.udf_hex_to_int( - A.data :gasPrice :: STRING - ) :: INT / pow( - 10, - 9 - ) AS gas_price, - A.data :hash :: STRING AS tx_hash, - A.data :input :: STRING AS input_data, - SUBSTR( - input_data, - 1, - 10 - ) AS origin_function_signature, - utils.udf_hex_to_int( - A.data :maxFeePerGas :: STRING - ) :: INT / pow( - 10, - 9 - ) AS max_fee_per_gas, - utils.udf_hex_to_int( - A.data :maxPriorityFeePerGas :: STRING - ) :: INT / pow( - 10, - 9 - ) AS max_priority_fee_per_gas, - utils.udf_hex_to_int( - A.data :nonce :: STRING - ) :: INT AS nonce, - A.data :r :: STRING AS r, - A.data :s :: STRING AS s, - A.data :to :: STRING AS to_address1, - CASE - WHEN to_address1 = '' THEN NULL - ELSE to_address1 - END AS to_address, - utils.udf_hex_to_int( - A.data :transactionIndex :: STRING - ) :: INT AS POSITION, - A.data :type :: STRING AS TYPE, - A.data :v :: STRING AS v, - utils.udf_hex_to_int( - A.data :value :: STRING - ) AS value_precise_raw, - utils.udf_decimal_adjust( - value_precise_raw, - 18 - ) AS value_precise, - value_precise :: FLOAT AS VALUE, - A._INSERTED_TIMESTAMP, - A.data - FROM - base A -), -new_records AS ( - SELECT - t.block_number, - t.block_hash, - t.chain_id, - t.from_address, - t.gas, - t.gas_price, - t.tx_hash, - t.input_data, - t.origin_function_signature, - t.max_fee_per_gas, - t.max_priority_fee_per_gas, - t.nonce, - t.r, - t.s, - t.to_address, - t.position, - t.type, - t.v, - t.value_precise_raw, - t.value_precise, - t.value, - block_timestamp, - CASE - WHEN block_timestamp IS NULL - OR tx_status IS NULL THEN TRUE - ELSE FALSE - END AS is_pending, - r.gas_used, - tx_success, - tx_status, - cumulative_gas_used, - effective_gas_price, - utils.udf_decimal_adjust( - utils.udf_hex_to_int( - t.data :gasPrice :: STRING - ) :: bigint * r.gas_used, - 18 - ) AS tx_fee_precise, - COALESCE( - tx_fee_precise :: FLOAT, - 0 - ) AS tx_fee, - r.type AS tx_type, - t._inserted_timestamp, - t.data - FROM - base_tx t - LEFT OUTER JOIN {{ ref('silver__blocks') }} - b - ON t.block_number = b.block_number - LEFT OUTER JOIN {{ ref('silver__receipts') }} - r - ON t.block_number = r.block_number - AND t.tx_hash = r.tx_hash - -{% if is_incremental() %} -AND r._INSERTED_TIMESTAMP >= ( - SELECT - MAX(_inserted_timestamp) :: DATE - 1 - FROM - {{ this }} -) -{% endif %} -) - -{% if is_incremental() %}, -missing_data AS ( - SELECT - t.block_number, - t.block_hash, - t.chain_id, - t.from_address, - t.gas, - t.gas_price, - t.tx_hash, - t.input_data, - t.origin_function_signature, - t.max_fee_per_gas, - t.max_priority_fee_per_gas, - t.nonce, - t.r, - t.s, - t.to_address, - t.position, - t.type, - t.v, - t.value_precise_raw, - t.value_precise, - t.value, - b.block_timestamp, - FALSE AS is_pending, - r.gas_used, - r.tx_success, - r.tx_status, - r.cumulative_gas_used, - r.effective_gas_price, - utils.udf_decimal_adjust( - utils.udf_hex_to_int( - t.data :gasPrice :: STRING - ) :: bigint * r.gas_used, - 18 - ) AS tx_fee_precise_heal, - COALESCE( - tx_fee_precise_heal :: FLOAT, - 0 - ) AS tx_fee, - r.type AS tx_type, - GREATEST( - t._inserted_timestamp, - b._inserted_timestamp, - r._inserted_timestamp - ) AS _inserted_timestamp, - t.data - 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, - tx_fee, - tx_fee_precise, - tx_type, - _inserted_timestamp, - DATA - FROM - new_records - -{% if is_incremental() %} -UNION -SELECT - block_number, - block_hash, - chain_id, - from_address, - gas, - gas_price, - tx_hash, - input_data, - origin_function_signature, - max_fee_per_gas, - max_priority_fee_per_gas, - nonce, - r, - s, - to_address, - POSITION, - TYPE, - v, - VALUE, - value_precise_raw, - value_precise, - block_timestamp, - is_pending, - gas_used, - tx_success, - tx_status, - cumulative_gas_used, - effective_gas_price, - tx_fee, - tx_fee_precise_heal AS tx_fee_precise, - tx_type, - _inserted_timestamp, - DATA -FROM - missing_data -{% endif %} -) -SELECT - *, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash'] - ) }} AS transactions_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - FINAL -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 c02c8aa..0000000 --- a/models/silver/core/silver__tx_count.sql +++ /dev/null @@ -1,40 +0,0 @@ -{{ config( - materialized = 'incremental', - unique_key = "block_number", - merge_exclude_columns = ["inserted_timestamp"], - tags = ['non_realtime'] -) }} - -WITH base AS ( - - SELECT - block_number, - MIN(modified_timestamp) AS _inserted_timestamp, - COUNT(*) AS tx_count - FROM - {{ ref('core__fact_transactions') }} - -{% if is_incremental() %} -WHERE - modified_timestamp >= ( - SELECT - MAX(_inserted_timestamp) _inserted_timestamp - FROM - {{ this }} - ) -{% endif %} -GROUP BY - block_number -) -SELECT - block_number, - _inserted_timestamp, - tx_count, - {{ 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 \ No newline at end of file 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 d5df7b8..0000000 --- a/models/silver/core/tests/blocks/test_silver__blocks_full.yml +++ /dev/null @@ -1,94 +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_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 d55ba9c..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 6db6969..0000000 --- a/models/silver/core/tests/blocks/test_silver__blocks_recent.yml +++ /dev/null @@ -1,26 +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_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 a88692b..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 5078522..0000000 --- a/models/silver/core/tests/event_logs/test_silver__logs_full.yml +++ /dev/null @@ -1,76 +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_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 60c1785..0000000 --- a/models/silver/core/tests/event_logs/test_silver__logs_recent.yml +++ /dev/null @@ -1,32 +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_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 1e8cfa1..0000000 --- a/models/silver/core/tests/receipts/test_silver__receipts_recent.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 2 -models: - - name: test_silver__receipts_recent - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - TX_HASH - - fsc_utils.sequence_gaps: - partition_by: - - BLOCK_NUMBER - column_name: POSITION - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: _INSERTED_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: hour - interval: 3 - - diff --git a/models/silver/core/tests/traces/test_silver__traces_full.sql b/models/silver/core/tests/traces/test_silver__traces_full.sql deleted file mode 100644 index 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 c891306..0000000 --- a/models/silver/core/tests/transactions/test_silver__transactions_full.yml +++ /dev/null @@ -1,118 +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_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 73431ac..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") }} - ) 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 054aa33..0000000 --- a/models/silver/core/tests/transfers/test_silver__transfers_full.yml +++ /dev/null @@ -1,69 +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 - - 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 8f0554f..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") }} - ) \ No newline at end of file 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/allbridge/silver_bridge__allbridge_sent.sql b/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_sent.sql index 819a45d..f7534c7 100644 --- a/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_sent.sql +++ b/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_sent.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_tokens_sent.sql b/models/silver/defi/bridge/allbridge/silver_bridge__allbridge_tokens_sent.sql index fc17c8a..b0de540 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 152a232..c84a981 100644 --- a/models/silver/defi/bridge/axelar/silver_bridge__axelar_contractcallwithtoken.sql +++ b/models/silver/defi/bridge/axelar/silver_bridge__axelar_contractcallwithtoken.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/ccip/silver_bridge__ccip_send_requested.sql b/models/silver/defi/bridge/ccip/silver_bridge__ccip_send_requested.sql index 2e1f963..16e3e4e 100644 --- a/models/silver/defi/bridge/ccip/silver_bridge__ccip_send_requested.sql +++ b/models/silver/defi/bridge/ccip/silver_bridge__ccip_send_requested.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH on_ramp_set AS ( diff --git a/models/silver/defi/bridge/cctp/silver_bridge__cctp_depositforburn.sql b/models/silver/defi/bridge/cctp/silver_bridge__cctp_depositforburn.sql index e9e86a2..9da25ee 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 f164df9..c323ed3 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 ab4373c..21690db 100644 --- a/models/silver/defi/bridge/dln/silver_bridge__dln_debridge_createdorder.sql +++ b/models/silver/defi/bridge/dln/silver_bridge__dln_debridge_createdorder.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/eywa/silver_bridge__eywa_requestsent.sql b/models/silver/defi/bridge/eywa/silver_bridge__eywa_requestsent.sql index 3c90927..df73346 100644 --- a/models/silver/defi/bridge/eywa/silver_bridge__eywa_requestsent.sql +++ b/models/silver/defi/bridge/eywa/silver_bridge__eywa_requestsent.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/meson/silver_bridge__meson_transfers.sql b/models/silver/defi/bridge/meson/silver_bridge__meson_transfers.sql index 57e84d9..04c7687 100644 --- a/models/silver/defi/bridge/meson/silver_bridge__meson_transfers.sql +++ b/models/silver/defi/bridge/meson/silver_bridge__meson_transfers.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH token_transfers AS ( diff --git a/models/silver/defi/bridge/multichain/silver_bridge__multichain_v7_loganyswapout.sql b/models/silver/defi/bridge/multichain/silver_bridge__multichain_v7_loganyswapout.sql index 8fa3fd2..f5a3c73 100644 --- a/models/silver/defi/bridge/multichain/silver_bridge__multichain_v7_loganyswapout.sql +++ b/models/silver/defi/bridge/multichain/silver_bridge__multichain_v7_loganyswapout.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH base_evt AS ( diff --git a/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql b/models/silver/defi/bridge/silver_bridge__complete_bridge_activity.sql index c6f5a25..60c9343 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 allbridge 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 c110d96..38ca81c 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 74b485f..c0ef718 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 cb3a073..f182e43 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 a81d008..628bc3b 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 9416bc8..6d5da51 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 4515bbb..cf79118 100644 --- a/models/silver/defi/bridge/wormhole/silver_bridge__wormhole_transfers.sql +++ b/models/silver/defi/bridge/wormhole/silver_bridge__wormhole_transfers.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_bridge','defi','bridge','curated'] ) }} WITH token_transfers AS ( diff --git a/models/silver/defi/dex/balancer/silver_dex__balancer_pools.sql b/models/silver/defi/dex/balancer/silver_dex__balancer_pools.sql index 8062520..db726fa 100644 --- a/models/silver/defi/dex/balancer/silver_dex__balancer_pools.sql +++ b/models/silver/defi/dex/balancer/silver_dex__balancer_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'pool_address', full_refresh = false, - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools_registered AS ( diff --git a/models/silver/defi/dex/balancer/silver_dex__balancer_swaps.sql b/models/silver/defi/dex/balancer/silver_dex__balancer_swaps.sql index 20871ef..967c77c 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 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 896fac5..8d81ec8 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 a2c8c08..de7a0ae 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/fraxswap/silver_dex__fraxswap_pools.sql b/models/silver/defi/dex/fraxswap/silver_dex__fraxswap_pools.sql index 6038f9b..49ab847 100644 --- a/models/silver/defi/dex/fraxswap/silver_dex__fraxswap_pools.sql +++ b/models/silver/defi/dex/fraxswap/silver_dex__fraxswap_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/fraxswap/silver_dex__fraxswap_swaps.sql b/models/silver/defi/dex/fraxswap/silver_dex__fraxswap_swaps.sql index 06ab4ae..0b5e7a5 100644 --- a/models/silver/defi/dex/fraxswap/silver_dex__fraxswap_swaps.sql +++ b/models/silver/defi/dex/fraxswap/silver_dex__fraxswap_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/gmx/silver_dex__gmx_swaps.sql b/models/silver/defi/dex/gmx/silver_dex__gmx_swaps.sql index b762943..a00fbc3 100644 --- a/models/silver/defi/dex/gmx/silver_dex__gmx_swaps.sql +++ b/models/silver/defi/dex/gmx/silver_dex__gmx_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/hashflow/silver_dex__hashflow_pools.sql b/models/silver/defi/dex/hashflow/silver_dex__hashflow_pools.sql index bd159cc..13bf317 100644 --- a/models/silver/defi/dex/hashflow/silver_dex__hashflow_pools.sql +++ b/models/silver/defi/dex/hashflow/silver_dex__hashflow_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH contract_deployments AS ( diff --git a/models/silver/defi/dex/hashflow/silver_dex__hashflow_swaps.sql b/models/silver/defi/dex/hashflow/silver_dex__hashflow_swaps.sql index 7df3e1f..e8a0fc1 100644 --- a/models/silver/defi/dex/hashflow/silver_dex__hashflow_swaps.sql +++ b/models/silver/defi/dex/hashflow/silver_dex__hashflow_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_pools.sql b/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_pools.sql index cd757c7..b7740d7 100644 --- a/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_pools.sql +++ b/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = "pool_address", - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH contract_deployments AS ( diff --git a/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_swaps.sql b/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_swaps.sql index a082bc9..bd4d01b 100644 --- a/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_swaps.sql +++ b/models/silver/defi/dex/hashflow/silver_dex__hashflow_v3_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_pools.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_pools.sql index 9d49e6d..498dbd0 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_pools.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_swaps.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_swaps.sql index 757fd5d..b84a290 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_swaps.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_dynamic_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_pools.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_pools.sql index 1d5d8bc..cb34019 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_pools.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_swaps.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_swaps.sql index 5606f8b..b8dcea7 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_swaps.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v1_static_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_pools.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_pools.sql index d222b44..d68eb1f 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_pools.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_swaps.sql b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_swaps.sql index 8ac89e4..69d27ed 100644 --- a/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_swaps.sql +++ b/models/silver/defi/dex/kyberswap/silver_dex__kyberswap_v2_elastic_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/pangolin/silver_dex__pangolin_pools.sql b/models/silver/defi/dex/pangolin/silver_dex__pangolin_pools.sql index 918c4ad..cdd9755 100644 --- a/models/silver/defi/dex/pangolin/silver_dex__pangolin_pools.sql +++ b/models/silver/defi/dex/pangolin/silver_dex__pangolin_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/pangolin/silver_dex__pangolin_swaps.sql b/models/silver/defi/dex/pangolin/silver_dex__pangolin_swaps.sql index d25f388..44fbd2e 100644 --- a/models/silver/defi/dex/pangolin/silver_dex__pangolin_swaps.sql +++ b/models/silver/defi/dex/pangolin/silver_dex__pangolin_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/pharaoh/silver_dex__pharaoh_v1_pools.sql b/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v1_pools.sql index ae263cd..6099785 100644 --- a/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v1_pools.sql +++ b/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v1_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v1_swaps.sql b/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v1_swaps.sql index 75be918..e1ddf95 100644 --- a/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v1_swaps.sql +++ b/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v1_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v2_pools.sql b/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v2_pools.sql index ab35f2a..c01cc8a 100644 --- a/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v2_pools.sql +++ b/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v2_pools.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'pool_address', cluster_by = ['_inserted_timestamp::DATE'], - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH created_pools AS ( diff --git a/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v2_swaps.sql b/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v2_swaps.sql index 229cbf6..8895abb 100644 --- a/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_v2_swaps.sql +++ b/models/silver/defi/dex/pharaoh/silver_dex__pharaoh_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 base_swaps AS ( diff --git a/models/silver/defi/dex/platypus/silver_dex__platypus_pools.sql b/models/silver/defi/dex/platypus/silver_dex__platypus_pools.sql index ed723c2..c07d4d2 100644 --- a/models/silver/defi/dex/platypus/silver_dex__platypus_pools.sql +++ b/models/silver/defi/dex/platypus/silver_dex__platypus_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH contract_deployments AS ( diff --git a/models/silver/defi/dex/platypus/silver_dex__platypus_swaps.sql b/models/silver/defi/dex/platypus/silver_dex__platypus_swaps.sql index ce75391..2d971dd 100644 --- a/models/silver/defi/dex/platypus/silver_dex__platypus_swaps.sql +++ b/models/silver/defi/dex/platypus/silver_dex__platypus_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 867b63f..5c5b1f2 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 e073461..541ef94 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 balancer 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 a7bd652..82f1904 100644 --- a/models/silver/defi/dex/sushi/silver_dex__sushi_pools.sql +++ b/models/silver/defi/dex/sushi/silver_dex__sushi_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/sushi/silver_dex__sushi_swaps.sql b/models/silver/defi/dex/sushi/silver_dex__sushi_swaps.sql index cfe911d..7e7449b 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 pools AS ( diff --git a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v1_pools.sql b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v1_pools.sql index 5556a19..71e6443 100644 --- a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v1_pools.sql +++ b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v1_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'pool_address', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v1_swaps.sql b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v1_swaps.sql index 6d7be3c..3d94641 100644 --- a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v1_swaps.sql +++ b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v1_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_1_swaps.sql b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_1_swaps.sql index 378d2f3..b1d4a3d 100644 --- a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_1_swaps.sql +++ b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_1_swaps.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pools AS ( diff --git a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_pools.sql b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_pools.sql index be9c7c9..68cbfcc 100644 --- a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_pools.sql +++ b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_pools.sql @@ -2,7 +2,7 @@ materialized = 'incremental', incremental_strategy = 'delete+insert', unique_key = 'lb_pair', - tags = ['curated'] + tags = ['silver_dex','defi','dex','curated'] ) }} WITH pool_creation AS ( diff --git a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_swaps.sql b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_swaps.sql index 08da763..a314c9b 100644 --- a/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_v2_swaps.sql +++ b/models/silver/defi/dex/trader_joe/silver_dex__trader_joe_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/uniswap/silver_dex__univ2_pools.sql b/models/silver/defi/dex/uniswap/silver_dex__univ2_pools.sql index ffe43c4..8b6cda4 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 a8d7ed1..ae9ca4e 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 540dbba..26163a1 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 = ['_inserted_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 3b76223..02cc1e1 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/woofi/silver_dex__woofi_swaps.sql b/models/silver/defi/dex/woofi/silver_dex__woofi_swaps.sql index ab004a5..6dce3a2 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 603ef79..975f381 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 4091c11..05600e4 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 diff --git a/models/silver/defi/lending/aave/silver__aave_flashloans.sql b/models/silver/defi/lending/aave/silver__aave_flashloans.sql index 42c9c88..b9072c8 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 diff --git a/models/silver/defi/lending/aave/silver__aave_liquidations.sql b/models/silver/defi/lending/aave/silver__aave_liquidations.sql index 16ef720..69e1004 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 diff --git a/models/silver/defi/lending/aave/silver__aave_repayments.sql b/models/silver/defi/lending/aave/silver__aave_repayments.sql index f7c2214..697b3cc 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 diff --git a/models/silver/defi/lending/aave/silver__aave_tokens.sql b/models/silver/defi/lending/aave/silver__aave_tokens.sql index a9ae9d1..d92225a 100644 --- a/models/silver/defi/lending/aave/silver__aave_tokens.sql +++ b/models/silver/defi/lending/aave/silver__aave_tokens.sql @@ -1,7 +1,7 @@ {{ config( materialized = 'incremental', unique_key = 'atoken_address', - tags = ['curated'] + tags = ['silver','defi','lending','curated'] ) }} WITH contracts AS ( diff --git a/models/silver/defi/lending/aave/silver__aave_withdraws.sql b/models/silver/defi/lending/aave/silver__aave_withdraws.sql index 52020aa..746df8c 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 = ['curated','reorg'] + tags = ['silver','defi','lending','curated'] ) }} WITH diff --git a/models/silver/defi/lending/benqi/silver__benqi_asset_details.sql b/models/silver/defi/lending/benqi/silver__benqi_asset_details.sql index 7c8919a..80daa7c 100644 --- a/models/silver/defi/lending/benqi/silver__benqi_asset_details.sql +++ b/models/silver/defi/lending/benqi/silver__benqi_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/benqi/silver__benqi_borrows.sql b/models/silver/defi/lending/benqi/silver__benqi_borrows.sql index a8cd57c..6d3dfb0 100644 --- a/models/silver/defi/lending/benqi/silver__benqi_borrows.sql +++ b/models/silver/defi/lending/benqi/silver__benqi_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/benqi/silver__benqi_deposits.sql b/models/silver/defi/lending/benqi/silver__benqi_deposits.sql index e0fed92..d6a959b 100644 --- a/models/silver/defi/lending/benqi/silver__benqi_deposits.sql +++ b/models/silver/defi/lending/benqi/silver__benqi_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/benqi/silver__benqi_liquidations.sql b/models/silver/defi/lending/benqi/silver__benqi_liquidations.sql index d8c827c..8be2275 100644 --- a/models/silver/defi/lending/benqi/silver__benqi_liquidations.sql +++ b/models/silver/defi/lending/benqi/silver__benqi_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/benqi/silver__benqi_repayments.sql b/models/silver/defi/lending/benqi/silver__benqi_repayments.sql index 0747b85..54104de 100644 --- a/models/silver/defi/lending/benqi/silver__benqi_repayments.sql +++ b/models/silver/defi/lending/benqi/silver__benqi_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/benqi/silver__benqi_withdraws.sql b/models/silver/defi/lending/benqi/silver__benqi_withdraws.sql index e9cb52e..cedfeb3 100644 --- a/models/silver/defi/lending/benqi/silver__benqi_withdraws.sql +++ b/models/silver/defi/lending/benqi/silver__benqi_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/complete_lending/silver__complete_lending_borrows.sql b/models/silver/defi/lending/complete_lending/silver__complete_lending_borrows.sql index 1418abd..4b28d74 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 f7c2fe4..1f4e4d0 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 @@ -4,7 +4,7 @@ incremental_strategy = 'delete+insert', unique_key = ['block_number','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 8c61949..b1b6412 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 b0d523f..ece69fd 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 286c7b9..b468d02 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 1c7792e..9a5452b 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/trader_joe/silver__trader_joe_asset_details.sql b/models/silver/defi/lending/trader_joe/silver__trader_joe_asset_details.sql index 55ab257..dfcf12f 100644 --- a/models/silver/defi/lending/trader_joe/silver__trader_joe_asset_details.sql +++ b/models/silver/defi/lending/trader_joe/silver__trader_joe_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/trader_joe/silver__trader_joe_borrows.sql b/models/silver/defi/lending/trader_joe/silver__trader_joe_borrows.sql index 6454488..ece4c61 100644 --- a/models/silver/defi/lending/trader_joe/silver__trader_joe_borrows.sql +++ b/models/silver/defi/lending/trader_joe/silver__trader_joe_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/trader_joe/silver__trader_joe_deposits.sql b/models/silver/defi/lending/trader_joe/silver__trader_joe_deposits.sql index 804ac4e..a24cf84 100644 --- a/models/silver/defi/lending/trader_joe/silver__trader_joe_deposits.sql +++ b/models/silver/defi/lending/trader_joe/silver__trader_joe_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/trader_joe/silver__trader_joe_liquidations.sql b/models/silver/defi/lending/trader_joe/silver__trader_joe_liquidations.sql index f0001d7..27db19a 100644 --- a/models/silver/defi/lending/trader_joe/silver__trader_joe_liquidations.sql +++ b/models/silver/defi/lending/trader_joe/silver__trader_joe_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/trader_joe/silver__trader_joe_repayments.sql b/models/silver/defi/lending/trader_joe/silver__trader_joe_repayments.sql index 1b09e8b..f7a1a51 100644 --- a/models/silver/defi/lending/trader_joe/silver__trader_joe_repayments.sql +++ b/models/silver/defi/lending/trader_joe/silver__trader_joe_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/trader_joe/silver__trader_joe_withdraws.sql b/models/silver/defi/lending/trader_joe/silver__trader_joe_withdraws.sql index bd2c5e3..d2ae8e7 100644 --- a/models/silver/defi/lending/trader_joe/silver__trader_joe_withdraws.sql +++ b/models/silver/defi/lending/trader_joe/silver__trader_joe_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/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 1e81b25..97dd7b2 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 85ba2da..2013ff5 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 ab13d90..c51f741 100644 --- a/models/silver/nft/sales/silver__element_sales.sql +++ b/models/silver/nft/sales/silver__element_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH settings AS ( diff --git a/models/silver/nft/sales/silver__joepegs_sales.sql b/models/silver/nft/sales/silver__joepegs_sales.sql index ff7d6ca..3006a2b 100644 --- a/models/silver/nft/sales/silver__joepegs_sales.sql +++ b/models/silver/nft/sales/silver__joepegs_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_decoded_logs AS ( diff --git a/models/silver/nft/sales/silver__salvor_sales.sql b/models/silver/nft/sales/silver__salvor_sales.sql index f279f88..ae99bc1 100644 --- a/models/silver/nft/sales/silver__salvor_sales.sql +++ b/models/silver/nft/sales/silver__salvor_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 ( 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 9117587..3741925 100644 --- a/models/silver/nft/sales/silver__seaport_1_5_sales.sql +++ b/models/silver/nft/sales/silver__seaport_1_5_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = 'block_number', cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH seaport_fees_wallet AS ( diff --git a/models/silver/nft/sales/silver__seaport_1_6_sales.sql b/models/silver/nft/sales/silver__seaport_1_6_sales.sql index a2cd083..63ada72 100644 --- a/models/silver/nft/sales/silver__seaport_1_6_sales.sql +++ b/models/silver/nft/sales/silver__seaport_1_6_sales.sql @@ -3,7 +3,7 @@ incremental_strategy = 'delete+insert', unique_key = "block_number", cluster_by = ['block_timestamp::DATE'], - tags = ['curated','reorg'] + tags = ['silver','nft','curated'] ) }} WITH seaport_fees_wallet AS ( diff --git a/models/silver/nft/silver__nft_transfers.sql b/models/silver/nft/silver__nft_transfers.sql deleted file mode 100644 index 725eff7..0000000 --- a/models/silver/nft/silver__nft_transfers.sql +++ /dev/null @@ -1,436 +0,0 @@ -{{ config( - materialized = 'incremental', - incremental_strategy = 'delete+insert', - unique_key = 'block_number', - cluster_by = ['block_timestamp::DATE', '_inserted_timestamp::DATE'], - post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, contract_address, project_name, from_address, to_address, event_type, token_transfer_type), SUBSTRING(contract_address, project_name, from_address, to_address, event_type, token_transfer_type)", - tags = ['curated','reorg', 'heal'] -) }} - -WITH base AS ( - - SELECT - concat_ws('-', tx_hash, event_index) AS _log_id, - block_number, - tx_hash, - block_timestamp, - event_index, - contract_address, - topics, - DATA, - regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}') AS segmented_data, - modified_timestamp AS _inserted_timestamp - FROM - {{ ref('core__fact_event_logs') }} - WHERE - tx_succeeded - AND ( - ( - topics [0] :: STRING = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' - AND DATA = '0x' - AND topics [3] IS NOT NULL - ) --erc721s - OR ( - topics [0] :: STRING = '0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62' - ) --erc1155s - OR ( - topics [0] :: STRING = '0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb' - ) --erc1155s TransferBatch event - ) - -{% if is_incremental() %} -AND modified_timestamp >= ( - SELECT - MAX(modified_timestamp) - INTERVAL '24 hours' - FROM - {{ this }} -) -{% endif %} -), -erc721s AS ( - SELECT - _log_id, - block_number, - tx_hash, - block_timestamp, - contract_address, - CONCAT('0x', SUBSTR(topics [1] :: STRING, 27, 40)) AS from_address, - CONCAT('0x', SUBSTR(topics [2] :: STRING, 27, 40)) AS to_address, - utils.udf_hex_to_int( - topics [3] :: STRING - ) :: STRING AS token_id, - NULL AS erc1155_value, - TO_TIMESTAMP_NTZ(_inserted_timestamp) AS _inserted_timestamp, - event_index - FROM - base - WHERE - topics [0] :: STRING = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' - AND DATA = '0x' - AND topics [3] IS NOT NULL -), -transfer_singles AS ( - SELECT - _log_id, - block_number, - tx_hash, - block_timestamp, - contract_address, - CONCAT('0x', SUBSTR(topics [1] :: STRING, 27, 40)) AS operator_address, - CONCAT('0x', SUBSTR(topics [2] :: STRING, 27, 40)) AS from_address, - CONCAT('0x', SUBSTR(topics [3] :: STRING, 27, 40)) AS to_address, - utils.udf_hex_to_int( - segmented_data [0] :: STRING - ) :: STRING AS token_id, - utils.udf_hex_to_int( - segmented_data [1] :: STRING - ) :: STRING AS erc1155_value, - TO_TIMESTAMP_NTZ(_inserted_timestamp) AS _inserted_timestamp, - event_index - FROM - base - WHERE - topics [0] :: STRING = '0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62' - AND to_address IS NOT NULL -), -transfer_batch_raw AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - segmented_data, - CONCAT('0x', SUBSTR(topics [1] :: STRING, 27, 40)) AS operator_address, - CONCAT('0x', SUBSTR(topics [2] :: STRING, 27, 40)) AS from_address, - CONCAT('0x', SUBSTR(topics [3] :: STRING, 27, 40)) AS to_address, - contract_address, - utils.udf_hex_to_int( - segmented_data [2] :: STRING - ) AS tokenid_length, - tokenid_length AS quantity_length, - _log_id, - TO_TIMESTAMP_NTZ(_inserted_timestamp) AS _inserted_timestamp - FROM - base - WHERE - topics [0] :: STRING = '0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb' - AND to_address IS NOT NULL -), -flattened AS ( - SELECT - block_number, - block_timestamp, - _log_id, - _inserted_timestamp, - tx_hash, - event_index, - operator_address, - from_address, - to_address, - contract_address, - INDEX, - VALUE, - tokenid_length, - quantity_length, - 2 + tokenid_length AS tokenid_indextag, - 4 + tokenid_length AS quantity_indextag_start, - 4 + tokenid_length + tokenid_length AS quantity_indextag_end, - CASE - WHEN INDEX BETWEEN 3 - AND ( - tokenid_indextag - ) THEN 'tokenid' - WHEN INDEX BETWEEN ( - quantity_indextag_start - ) - AND ( - quantity_indextag_end - ) THEN 'quantity' - ELSE NULL - END AS label - FROM - transfer_batch_raw, - LATERAL FLATTEN ( - input => segmented_data - ) -), -tokenid_list AS ( - SELECT - block_number, - block_timestamp, - _log_id, - _inserted_timestamp, - tx_hash, - event_index, - operator_address, - from_address, - to_address, - contract_address, - utils.udf_hex_to_int( - VALUE :: STRING - ) :: STRING AS tokenId, - ROW_NUMBER() over ( - PARTITION BY tx_hash, - event_index - ORDER BY - INDEX ASC - ) AS tokenid_order - FROM - flattened - WHERE - label = 'tokenid' -), -quantity_list AS ( - SELECT - tx_hash, - event_index, - utils.udf_hex_to_int( - VALUE :: STRING - ) :: STRING AS quantity, - ROW_NUMBER() over ( - PARTITION BY tx_hash, - event_index - ORDER BY - INDEX ASC - ) AS quantity_order - FROM - flattened - WHERE - label = 'quantity' -), -transfer_batch_final AS ( - SELECT - block_number, - block_timestamp, - _log_id, - _inserted_timestamp, - t.tx_hash, - t.event_index, - operator_address, - from_address, - to_address, - contract_address, - t.tokenId AS token_id, - q.quantity AS erc1155_value, - tokenid_order AS intra_event_index - FROM - tokenid_list t - INNER JOIN quantity_list q - ON t.tx_hash = q.tx_hash - AND t.event_index = q.event_index - AND t.tokenid_order = q.quantity_order -), -all_transfers AS ( - SELECT - block_number, - tx_hash, - block_timestamp, - contract_address, - from_address, - to_address, - token_id, - erc1155_value, - _inserted_timestamp, - event_index, - 1 AS intra_event_index, - 'erc721_Transfer' AS token_transfer_type, - CONCAT( - _log_id, - '-', - contract_address, - '-', - token_id - ) AS _log_id - FROM - erc721s - UNION ALL - SELECT - block_number, - tx_hash, - block_timestamp, - contract_address, - from_address, - to_address, - token_id, - erc1155_value, - _inserted_timestamp, - event_index, - 1 AS intra_event_index, - 'erc1155_TransferSingle' AS token_transfer_type, - CONCAT( - _log_id, - '-', - contract_address, - '-', - token_id - ) AS _log_id - FROM - transfer_singles - WHERE - erc1155_value != '0' - UNION ALL - SELECT - block_number, - tx_hash, - block_timestamp, - contract_address, - from_address, - to_address, - token_id, - erc1155_value, - _inserted_timestamp, - event_index, - intra_event_index, - 'erc1155_TransferBatch' AS token_transfer_type, - CONCAT( - _log_id, - '-', - contract_address, - '-', - token_id, - '-', - intra_event_index - ) AS _log_id - FROM - transfer_batch_final - WHERE - erc1155_value != '0' -), -transfer_base AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - intra_event_index, - contract_address, - C.token_name AS project_name, - from_address, - to_address, - A.token_id AS tokenId, - erc1155_value, - CASE - WHEN from_address = '0x0000000000000000000000000000000000000000' THEN 'mint' - ELSE 'other' - END AS event_type, - token_transfer_type, - A._log_id, - A._inserted_timestamp - FROM - all_transfers A - LEFT JOIN {{ ref('silver__contracts') }} C USING (contract_address) - WHERE - to_address IS NOT NULL -) - -{% if is_incremental() and var( - 'HEAL_MODEL' -) %}, -heal_model AS ( - SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - intra_event_index, - contract_address, - C.token_name AS project_name, - from_address, - to_address, - tokenId, - erc1155_value, - event_type, - token_transfer_type, - _log_id, - t._inserted_timestamp - FROM - {{ this }} - t - LEFT JOIN {{ ref('silver__contracts') }} C USING (contract_address) - WHERE - t.block_number IN ( - SELECT - DISTINCT t1.block_number AS block_number - FROM - {{ this }} - t1 - WHERE - t1.project_name IS NULL - AND _inserted_timestamp < ( - SELECT - MAX( - _inserted_timestamp - ) - INTERVAL '{{ var("LOOKBACK", "4 hours") }}' - FROM - {{ this }} - ) - AND EXISTS ( - SELECT - 1 - FROM - {{ ref('silver__contracts') }} C - WHERE - C._inserted_timestamp > DATEADD('DAY', -14, SYSDATE()) - AND C.token_name IS NOT NULL - AND C.contract_address = t1.contract_address) - ) - ) - {% endif %} - SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - intra_event_index, - contract_address, - project_name, - from_address, - to_address, - tokenId, - erc1155_value, - event_type, - token_transfer_type, - _log_id, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash','event_index','intra_event_index'] - ) }} AS nft_transfers_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id - FROM - transfer_base qualify ROW_NUMBER() over ( - PARTITION BY _log_id - ORDER BY - _inserted_timestamp DESC - ) = 1 - -{% if is_incremental() and var( - 'HEAL_MODEL' -) %} -UNION ALL -SELECT - block_number, - block_timestamp, - tx_hash, - event_index, - intra_event_index, - contract_address, - project_name, - from_address, - to_address, - tokenId, - erc1155_value, - event_type, - token_transfer_type, - _log_id, - _inserted_timestamp, - {{ dbt_utils.generate_surrogate_key( - ['tx_hash','event_index','intra_event_index'] - ) }} AS nft_transfers_id, - SYSDATE() AS inserted_timestamp, - SYSDATE() AS modified_timestamp, - '{{ invocation_id }}' AS _invocation_id -FROM - heal_model -{% endif %} diff --git a/models/silver/nft/silver__nft_transfers.yml b/models/silver/nft/silver__nft_transfers.yml deleted file mode 100644 index 6ba35b3..0000000 --- a/models/silver/nft/silver__nft_transfers.yml +++ /dev/null @@ -1,66 +0,0 @@ - -version: 2 -models: - - name: silver__nft_transfers - tests: - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - _LOG_ID - columns: - - name: BLOCK_NUMBER - tests: - - not_null - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - NUMBER - - FLOAT - - name: BLOCK_TIMESTAMP - tests: - - not_null - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ - - name: TX_HASH - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: EVENT_INDEX - tests: - - not_null - - name: INTRA_EVENT_INDEX - tests: - - not_null - - name: CONTRACT_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: FROM_ADDRESS - tests: - - not_null: - where: BLOCK_TIMESTAMP > '2021-08-01' - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TO_ADDRESS - tests: - - not_null - - dbt_expectations.expect_column_values_to_match_regex: - regex: 0[xX][0-9a-fA-F]+ - - name: TOKENID - tests: - - not_null - - name: _LOG_ID - tests: - - not_null - - name: _INSERTED_TIMESTAMP - tests: - - dbt_expectations.expect_row_values_to_have_recent_data: - datepart: day - interval: 1 - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - TIMESTAMP_NTZ \ No newline at end of file diff --git a/models/silver/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/stats/silver_stats__core_metrics_hourly.sql b/models/silver/stats/silver_stats__core_metrics_hourly.sql deleted file mode 100644 index d16c1bb..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 - _inserted_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_success THEN tx_hash - END - ) AS transaction_count_success, - COUNT( - DISTINCT CASE - WHEN NOT tx_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(_inserted_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 af529b4..e6bff54 100644 --- a/models/sources.yml +++ b/models/sources.yml @@ -1,29 +1,10 @@ version: 2 sources: - - name: crosschain - database: "{{ 'crosschain' if target.database == 'AVALANCHE' else 'crosschain_dev' }}" - schema: core - tables: - - name: dim_labels - - name: crosschain_silver - database: crosschain - schema: silver - tables: - - name: address_labels - - 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: number_sequence - 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 @@ -31,35 +12,44 @@ sources: - name: debug_traceblockbynumber - name: decoded_logs - name: confirm_blocks - - name: dexalot_blocks - - name: dexalot_transactions - - name: dexalot_receipts - - name: dexalot_traces - - name: dexalot_confirm_blocks - - name: dexalot_receipts_by_hash - name: blocks_v2 - name: transactions_v2 - name: receipts_v2 - name: traces_v2 - name: confirm_blocks_v2 - name: decoded_logs_v2 + - name: contract_abis + - name: dexalot_blocks + - name: dexalot_transactions + - name: dexalot_receipts + - name: dexalot_traces + - name: dexalot_confirm_blocks + - name: dexalot_receipts_by_hash + - 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_provider_asset_metadata + - name: complete_native_asset_metadata + - name: complete_native_prices + - name: complete_provider_prices + - name: complete_token_asset_metadata + - name: complete_token_prices - name: crosschain_public database: crosschain schema: bronze_public tables: - name: user_abis - - name: avalanche_silver - database: avalanche - schema: silver + - name: complete_streamline + database: "{{ target.database }}" + schema: streamline tables: - - name: verified_abis - - name: avalanche_bronze_api - database: avalanche - schema: bronze_api - tables: - - name: contract_abis + - name: complete_contract_abis - name: github_actions - database: avalanche + database: "{{ target.database }}" schema: github_actions tables: - name: workflows @@ -68,3 +58,22 @@ sources: schema: defillama tables: - name: dim_chains + - name: abis_silver + database: "{{ target.database }}" + schema: silver + tables: + - name: verified_abis + - name: complete_event_abis + - name: fsc_evm_admin + database: >- + {{ 'FSC_EVM_DEV' if '_DEV' in target.database.upper() else 'FSC_EVM' }} + schema: admin + tables: + - name: _master_keys + - name: rpc_node_logs + - name: logs_temp + database: "{{ target.database }}" + schema: silver + tables: + - name: logs + - name: decoded_logs \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__blocks.sql b/models/streamline/bronze/core/bronze__blocks.sql index 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 3b861c0..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,25 +17,18 @@ SELECT _inserted_timestamp FROM {{ ref('bronze__receipts_fr_v2') }} - - {% if var('GLOBAL_USES_STREAMLINE_V1',false) %} - UNION ALL - SELECT - _partition_by_block_id AS partition_key, - block_number, - COALESCE( - VALUE :"array_index" :: INT, - TRY_TO_NUMBER( - utils.udf_hex_to_int( - VALUE :"data" :"transactionIndex" :: STRING - ) - ) - ) AS array_index, - VALUE, - DATA, - metadata, - file_name, - _inserted_timestamp - FROM - {{ ref('bronze__receipts_fr_v1') }} - {% endif %} +UNION ALL +SELECT + _partition_by_block_id AS partition_key, + block_number, + COALESCE( + VALUE :array_index :: INT, + TRY_TO_NUMBER(utils.udf_hex_to_int(VALUE :data :"transactionIndex" :: STRING)) + ) AS array_index, + VALUE, + DATA, + metadata, + file_name, + _inserted_timestamp +FROM + {{ ref('bronze__receipts_fr_v1') }} \ No newline at end of file diff --git a/models/streamline/bronze/core/bronze__receipts_fr_v1.sql b/models/streamline/bronze/core/bronze__receipts_fr_v1.sql index 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 fb055b6..0000000 --- a/models/streamline/silver/core/retry/_missing_receipts.sql +++ /dev/null @@ -1,34 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -WITH lookback AS ( - - SELECT - block_number - FROM - {{ ref("_block_lookback") }} -) -SELECT - DISTINCT t.block_number AS block_number -FROM - {{ ref("silver__transactions") }} - t - LEFT JOIN {{ ref("silver__receipts") }} - r USING ( - block_number, - block_hash, - tx_hash - ) -WHERE - r.tx_hash IS NULL - AND t.block_number >= ( - SELECT - block_number - FROM - lookback - ) - AND t.block_timestamp >= DATEADD('hour', -84, SYSDATE()) - AND ( - r._inserted_timestamp >= DATEADD('hour', -84, SYSDATE()) - OR r._inserted_timestamp IS NULL) diff --git a/models/streamline/silver/core/retry/_missing_traces.sql b/models/streamline/silver/core/retry/_missing_traces.sql deleted file mode 100644 index 346f556..0000000 --- a/models/streamline/silver/core/retry/_missing_traces.sql +++ /dev/null @@ -1,17 +0,0 @@ -{{ config ( - materialized = "ephemeral" -) }} - -SELECT - DISTINCT tx.block_number -FROM - {{ ref("test_silver__transactions_recent") }} - tx - LEFT JOIN {{ ref("test_gold__fact_traces_recent") }} - tr USING ( - block_number, - tx_hash - ) -WHERE - tr.tx_hash IS NULL - AND tx.block_timestamp > DATEADD('day', -5, SYSDATE()) diff --git a/models/streamline/silver/core/retry/_missing_txs.sql b/models/streamline/silver/core/retry/_missing_txs.sql deleted file mode 100644 index 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 a0ff21b..0000000 --- a/models/streamline/silver/decoded_logs/realtime/streamline__decoded_logs_realtime.sql +++ /dev/null @@ -1,110 +0,0 @@ -{%- set testing_limit = var('DECODED_LOGS_REALTIME_TESTING_LIMIT', none) -%} - -{%- set streamline_params = { - "external_table": var("DECODED_LOGS_REALTIME_EXTERNAL_TABLE", "decoded_logs"), - "sql_limit": var("DECODED_LOGS_REALTIME_SQL_LIMIT", 10000000), - "producer_batch_size": var("DECODED_LOGS_REALTIME_PRODUCER_BATCH_SIZE", 400000), - "worker_batch_size": var("DECODED_LOGS_REALTIME_WORKER_BATCH_SIZE", 200000), - "sql_source": "decoded_logs_realtime" -} -%} - -{# Log configuration details #} -{{ log_model_details( - params = streamline_params -) }} - -{# Set up dbt configuration #} -{{ config ( - materialized = "view", - post_hook = [fsc_utils.if_data_call_function_v2( - func = 'streamline.udf_bulk_decode_logs_v2', - target = "{{this.schema}}.{{this.identifier}}", - params = { - "external_table": streamline_params['external_table'], - "sql_limit": streamline_params['sql_limit'], - "producer_batch_size": streamline_params['producer_batch_size'], - "worker_batch_size": streamline_params['worker_batch_size'], - "sql_source": streamline_params['sql_source'] - } - ), - fsc_utils.if_data_call_wait()], - tags = ['streamline_decoded_logs_realtime'] -) }} - -WITH target_blocks AS ( - SELECT - block_number - FROM - {{ ref('core__fact_blocks') }} - WHERE - block_number >= ( - SELECT - block_number - FROM - {{ ref('_24_hour_lookback') }} - ) -), -existing_logs_to_exclude AS ( - SELECT - _log_id - FROM - {{ ref('streamline__decoded_logs_complete') }} - l - INNER JOIN target_blocks b USING (block_number) - WHERE - l.inserted_timestamp :: DATE >= DATEADD('day', -2, SYSDATE()) -), -candidate_logs AS ( - SELECT - l.block_number, - l.tx_hash, - l.event_index, - l.contract_address, - l.topics, - l.data, - CONCAT( - l.tx_hash :: STRING, - '-', - l.event_index :: STRING - ) AS _log_id - FROM - target_blocks b - INNER JOIN {{ ref('core__fact_event_logs') }} - l USING (block_number) - WHERE - l.tx_succeeded - AND l.inserted_timestamp :: DATE >= DATEADD('day', -2, SYSDATE()) -) -SELECT - l.block_number, - l._log_id, - A.abi, - OBJECT_CONSTRUCT( - 'topics', - l.topics, - 'data', - l.data, - 'address', - l.contract_address - ) AS DATA -FROM - candidate_logs l - INNER JOIN {{ ref('silver__complete_event_abis') }} A - ON A.parent_contract_address = l.contract_address - AND A.event_signature = l.topics [0] :: STRING - AND l.block_number BETWEEN A.start_block - AND A.end_block -WHERE - NOT EXISTS ( - SELECT - 1 - FROM - existing_logs_to_exclude e - WHERE - e._log_id = l._log_id - ) - -{% if testing_limit is not none %} - LIMIT - {{ testing_limit }} -{% endif %} \ No newline at end of file diff --git a/package-lock.yml b/package-lock.yml deleted file mode 100644 index c863d28..0000000 --- a/package-lock.yml +++ /dev/null @@ -1,18 +0,0 @@ -packages: -- package: calogica/dbt_expectations - version: 0.8.2 -- package: dbt-labs/dbt_external_tables - version: 0.8.2 -- package: dbt-labs/dbt_utils - version: 1.0.0 -- git: https://github.com/FlipsideCrypto/fsc-utils.git - revision: c3ab97e8e06d31e8c6f63819714e0a2d45c45e82 -- package: get-select/dbt_snowflake_query_tags - version: 2.5.0 -- git: https://github.com/FlipsideCrypto/fsc-evm.git - revision: a8c221cb3286460d2481411a4d0f01e9f3eba734 -- package: calogica/dbt_date - version: 0.7.2 -- git: https://github.com/FlipsideCrypto/livequery-models.git - revision: b024188be4e9c6bc00ed77797ebdc92d351d620e -sha1_hash: 719ce6a7a9b3c45e61f260f4d98aec7642e3b0f4 diff --git a/packages.yml b/packages.yml index 81211eb..bd22686 100644 --- a/packages.yml +++ b/packages.yml @@ -1,13 +1,3 @@ packages: - - package: calogica/dbt_expectations - version: 0.8.2 - - package: dbt-labs/dbt_external_tables - version: 0.8.2 - - package: dbt-labs/dbt_utils - version: 1.0.0 - - git: https://github.com/FlipsideCrypto/fsc-utils.git - revision: v1.33.1 - - package: get-select/dbt_snowflake_query_tags - version: [">=2.0.0", "<3.0.0"] - git: https://github.com/FlipsideCrypto/fsc-evm.git - revision: v1.8.2 + revision: v4.0.0-beta.64 diff --git a/python/slack_alert.py b/python/slack_alert.py deleted file mode 100644 index 4e624f7..0000000 --- a/python/slack_alert.py +++ /dev/null @@ -1,74 +0,0 @@ -import requests -import os -import sys - -def create_message(): - """Creates a simple failure notification message with repo, workflow name, and URL""" - - # Get GitHub environment variables - repository = os.environ.get('GITHUB_REPOSITORY', 'Unknown repository') - repo_name = repository.split('/')[-1] if '/' in repository else repository - workflow_name = os.environ.get('GITHUB_WORKFLOW', 'Unknown workflow') - run_id = os.environ.get('GITHUB_RUN_ID', '') - server_url = os.environ.get('GITHUB_SERVER_URL', 'https://github.com') - - # Build the workflow URL - workflow_url = f"{server_url}/{repository}/actions/runs/{run_id}" - - message_body = { - "text": f"Failure in {repo_name}", - "attachments": [ - { - "color": "#f44336", # Red color for failures - "fields": [ - { - "title": "Repository", - "value": repository, - "short": True - }, - { - "title": "Workflow", - "value": workflow_name, - "short": True - } - ], - "actions": [ - { - "type": "button", - "text": "View Workflow Run", - "style": "primary", - "url": workflow_url - } - ], - "footer": "GitHub Actions" - } - ] - } - - return message_body - -def send_alert(webhook_url): - """Sends a failure notification to Slack""" - - message = create_message() - - try: - response = requests.post(webhook_url, json=message) - - if response.status_code == 200: - print("Successfully sent Slack notification") - else: - print(f"Failed to send Slack notification: {response.status_code} {response.text}") - sys.exit(1) - except Exception as e: - print(f"Error sending Slack notification: {str(e)}") - sys.exit(1) - -if __name__ == '__main__': - webhook_url = os.environ.get("SLACK_WEBHOOK_URL") - - if not webhook_url: - print("ERROR: SLACK_WEBHOOK_URL environment variable is required") - sys.exit(1) - - send_alert(webhook_url) \ No newline at end of file diff --git a/tests/avax/test_gold__missing_traces.sql b/tests/avax/test_gold__missing_traces.sql deleted file mode 100644 index 514d31c..0000000 --- a/tests/avax/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/avax/test_gold__recent_missing_traces.sql b/tests/avax/test_gold__recent_missing_traces.sql deleted file mode 100644 index 9a571ca..0000000 --- a/tests/avax/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/avax/test_silver__confirmed_blocks.sql b/tests/avax/test_silver__confirmed_blocks.sql deleted file mode 100644 index 8cbac8b..0000000 --- a/tests/avax/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/avax/test_silver__missing_receipts.sql b/tests/avax/test_silver__missing_receipts.sql deleted file mode 100644 index 8481599..0000000 --- a/tests/avax/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/avax/test_silver__recent_confirmed_blocks.sql b/tests/avax/test_silver__recent_confirmed_blocks.sql deleted file mode 100644 index 79cdd66..0000000 --- a/tests/avax/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/avax/test_silver__recent_missing_receipts.sql b/tests/avax/test_silver__recent_missing_receipts.sql deleted file mode 100644 index f657fd3..0000000 --- a/tests/avax/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")) }}