├── .env.sample ├── .github └── workflows │ ├── dbt_alter_gha_tasks.yml │ ├── dbt_docs_update.yml │ ├── dbt_integration_test.yml │ ├── dbt_run_adhoc.yml │ ├── dbt_run_batch_backfill.yml │ ├── dbt_run_daily.yml │ ├── dbt_run_decode_instructions.yml │ ├── dbt_run_decode_instructions_backfill.yml │ ├── dbt_run_decode_instructions_orchestrator.yml │ ├── dbt_run_decode_instructions_pyth.yml │ ├── dbt_run_decode_logs.yml │ ├── dbt_run_decode_logs_backfill.yml │ ├── dbt_run_decode_logs_orchestrator.yml │ ├── dbt_run_deploy_seeds.yml │ ├── dbt_run_deploy_udfs_and_sps.yml │ ├── dbt_run_deployment.yml │ ├── dbt_run_dev_refresh.yml │ ├── dbt_run_full_observability.yml │ ├── dbt_run_helius_metadata.yml │ ├── dbt_run_idls_history.yml │ ├── dbt_run_incremental.yml │ ├── dbt_run_incremental_intermediate.yml │ ├── dbt_run_incremental_non_core.yml │ ├── dbt_run_incremental_non_core_hourly.yml │ ├── dbt_run_macro_get_block_production.yml │ ├── dbt_run_macro_get_compressed_nft.yml │ ├── dbt_run_nft_compressed_mints_backfill.yml │ ├── dbt_run_nft_compressed_mints_realtime.yml │ ├── dbt_run_nft_compressed_mints_sales_backfill.yml │ ├── dbt_run_nft_compressed_mints_sales_realtime.yml │ ├── dbt_run_stage_block_txs.yml │ ├── dbt_run_streamline_block_rewards.yml │ ├── dbt_run_streamline_block_txs.yml │ ├── dbt_run_streamline_blocks.yml │ ├── dbt_run_streamline_helius_cnft_metadata.yml │ ├── dbt_run_streamline_solscan_blocks.yml │ ├── dbt_run_streamline_solscan_token_list.yml │ ├── dbt_run_streamline_stake_accounts_snapshot.yml │ ├── dbt_run_streamline_validator_metadata_snapshot.yml │ ├── dbt_run_streamline_validator_vote_accounts_snapshot.yml │ ├── dbt_run_streamline_validator_vote_program_accounts_snapshot.yml │ ├── dbt_run_streamline_validators_list_snapshot.yml │ ├── dbt_test.yml │ ├── dbt_test_hourly.yml │ ├── dbt_test_intraday.yml │ ├── dbt_test_tasks.yml │ ├── dbt_test_weekly.yml │ └── slack_notify.yml ├── .gitignore ├── .user.yml ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── analysis └── .gitkeep ├── data ├── .gitkeep ├── github_actions__workflows.csv ├── seed__missing_token_metadata.csv ├── testing__bridge_debridge_transfers.csv ├── testing__bridge_mayan_transfers.csv ├── testing__bridge_wormhole_transfers.csv ├── testing__burn_actions.csv ├── testing__ez_staking_lp_actions.csv ├── testing__liquidity_pool_actions_meteora.csv ├── testing__liquidity_pool_actions_meteora_dlmm.csv ├── testing__liquidity_pool_actions_meteora_multi.csv ├── testing__liquidity_pool_actions_orca.csv ├── testing__liquidity_pool_actions_raydium.csv ├── testing__liquidity_pool_actions_saber.csv ├── testing__missing_block_txs.csv ├── testing__nft_compressed_mints.csv ├── testing__nft_mint_price.csv ├── testing__nft_mints.csv ├── testing__nft_sales_amm_sell.csv ├── testing__nft_sales_amm_sell_decoded.csv ├── testing__nft_sales_coral_cube.csv ├── testing__nft_sales_exchange_art.csv ├── testing__nft_sales_hadeswap.csv ├── testing__nft_sales_hyperspace.csv ├── testing__nft_sales_magic_eden_v2.csv ├── testing__nft_sales_solsniper.csv ├── testing__nft_sales_solsniper_v1_events.csv ├── testing__nft_sales_tensorswap.csv ├── testing__nft_sales_tensorswap_cnft.csv ├── testing__stake_pool_actions_eversol.csv ├── testing__stake_pool_actions_generic.csv ├── testing__stake_pool_actions_jito.csv ├── testing__stake_pool_actions_lido.csv ├── testing__stake_pool_actions_marinade.csv ├── testing__stake_pool_actions_socean.csv ├── testing__staking_lp_actions_labeled_2.csv ├── testing__swaps.csv ├── testing__swaps_inner_intermediate_jupiterv4.csv ├── testing__swaps_inner_intermediate_jupiterv5.csv ├── testing__swaps_inner_intermediate_jupiterv6.csv ├── testing__swaps_intermediate_bonkswap.csv ├── testing__swaps_intermediate_dooar.csv ├── testing__swaps_intermediate_generic.csv ├── testing__swaps_intermediate_jupiterv4.csv ├── testing__swaps_intermediate_jupiterv4_2.csv ├── testing__swaps_intermediate_jupiterv5_1.csv ├── testing__swaps_intermediate_jupiterv5_2.csv ├── testing__swaps_intermediate_jupiterv6.csv ├── testing__swaps_intermediate_jupiterv6_2.csv ├── testing__swaps_intermediate_meteora.csv ├── testing__swaps_intermediate_orca.csv ├── testing__swaps_intermediate_orca_whirlpool.csv ├── testing__swaps_intermediate_phoenix.csv ├── testing__swaps_intermediate_raydium.csv ├── testing__swaps_intermediate_raydium_clmm.csv ├── testing__swaps_intermediate_raydium_cpmm.csv ├── testing__swaps_intermediate_raydium_stable.csv ├── testing__swaps_intermediate_raydium_v4_amm.csv └── testing__swaps_pumpfun.csv ├── dbt_project.yml ├── docker-compose.yml ├── docs ├── catalog.json ├── index.html └── manifest.json ├── macros ├── bronze_api │ └── get_block_production.sql ├── create_sps.sql ├── create_udfs.sql ├── custom_naming_macros.sql ├── dbt │ ├── get_merge.sql │ └── get_tmp_relation_type.sql ├── helpers │ ├── decoded_instructions_backfill_helpers.sql │ ├── decoded_logs_backfill_helpers.sql │ ├── helpers.sql │ └── nft_compressed_mints_backfill_helpers.sql ├── python │ └── udfs.sql ├── run_sp_create_prod_clone.sql ├── run_sp_create_prod_community_clone.sql ├── sp_create_prod_clone.sql ├── streamline │ ├── bulk_get_decoded_instructions_data.sql │ │ ├── sp_create_bulk_get_decoded_instructions_data.sql │ │ └── udf_bulk_get_decoded_instructions_data.sql │ ├── bulk_get_solscan_blocks │ │ └── udf_bulk_get_solscan_blocks.sql │ ├── bulk_parse_compressed_nft_mints │ │ └── udf_bulk_parse_compressed_nft_mints.sql │ ├── bulk_program_parser │ │ ├── run_sp_clean_program_parser_historical_queue.sql │ │ ├── run_sp_program_parser.sql │ │ ├── sp_create_clean_program_parser_historical_queue.sql │ │ ├── sp_create_program_parser.sql │ │ └── udf_program_parser.sql │ ├── decode_instructions │ │ └── udf_decode_instructions.sql │ ├── models.sql │ ├── run_sp_refresh_external_tables_full.sql │ ├── snapshot_get_stake_accounts │ │ ├── run_sp_snapshot_get_stake_accounts.sql │ │ ├── sp_create_snapshot_get_stake_accounts.sql │ │ └── udf_snapshot_get_stake_accounts.sql │ ├── sp_refresh_external_table_batch.sql │ ├── sp_refresh_external_tables_full.sql │ └── streamline_udfs.sql ├── tags │ ├── add_database_or_schema_tags.sql │ └── snowflake_tagging.sql ├── tests │ ├── compare_model_subset.sql │ ├── null_threshold.sql │ ├── reference_tx_count_comparison.sql │ ├── reference_tx_missing.sql │ └── tx_excluded.sql └── utils.sql ├── models ├── bronze │ ├── bronze__block_rewards.sql │ ├── bronze__blocks.sql │ ├── bronze__blocks2.sql │ ├── bronze__stake_program_accounts.sql │ ├── bronze__transactions.sql │ ├── bronze__transactions2.sql │ ├── bronze__validators_app_api.sql │ ├── bronze__vote_accounts.sql │ ├── bronze__vote_accounts_extended_stats.sql │ ├── bronze_api │ │ ├── bronze_api__helius_nft_metadata.sql │ │ ├── bronze_api__helius_nft_metadata.yml │ │ ├── bronze_api__parse_compressed_nft_mints.sql │ │ ├── bronze_api__parse_compressed_nft_sales_magic_eden.sql │ │ ├── bronze_api__parse_compressed_nft_sales_solsniper.sql │ │ └── bronze_api__solscan_blocks.sql │ ├── labels │ │ ├── bronze__date_hours.sql │ │ └── bronze__labels.sql │ ├── prices │ │ ├── bronze__complete_native_asset_metadata.sql │ │ ├── bronze__complete_native_prices.sql │ │ ├── bronze__complete_provider_asset_metadata.sql │ │ ├── bronze__complete_provider_prices.sql │ │ ├── bronze__complete_token_asset_metadata.sql │ │ └── bronze__complete_token_prices.sql │ ├── stage │ │ └── bronze__stage_block_txs_2.sql │ └── streamline │ │ ├── bronze__streamline_FR_block_rewards_2.sql │ │ ├── bronze__streamline_FR_block_tx_index_backfill.sql │ │ ├── bronze__streamline_FR_block_txs_2.sql │ │ ├── bronze__streamline_FR_blocks_2.sql │ │ ├── bronze__streamline_FR_decoded_instructions_2.sql │ │ ├── bronze__streamline_FR_decoded_instructions_3.sql │ │ ├── bronze__streamline_FR_decoded_logs.sql │ │ ├── bronze__streamline_FR_decoded_logs_2.sql │ │ ├── bronze__streamline_FR_helius_blocks.sql │ │ ├── bronze__streamline_FR_helius_cnft_metadata.sql │ │ ├── bronze__streamline_FR_program_parser.sql │ │ ├── bronze__streamline_FR_solscan_blocks_2.sql │ │ ├── bronze__streamline_FR_solscan_token_list.sql │ │ ├── bronze__streamline_FR_stake_prgram_accounts_2.sql │ │ ├── bronze__streamline_FR_validator_metadata_2.sql │ │ ├── bronze__streamline_FR_validator_vote_accounts_2.sql │ │ ├── bronze__streamline_FR_validator_vote_program_accounts_2.sql │ │ ├── bronze__streamline_FR_validators_list_2.sql │ │ ├── bronze__streamline_block_rewards_2.sql │ │ ├── bronze__streamline_block_tx_index_backfill.sql │ │ ├── bronze__streamline_block_txs_2.sql │ │ ├── bronze__streamline_blocks_2.sql │ │ ├── bronze__streamline_decoded_instructions_2.sql │ │ ├── bronze__streamline_decoded_instructions_3.sql │ │ ├── bronze__streamline_decoded_logs.sql │ │ ├── bronze__streamline_decoded_logs_2.sql │ │ ├── bronze__streamline_helius_blocks.sql │ │ ├── bronze__streamline_helius_cnft_metadata.sql │ │ ├── bronze__streamline_program_parser.sql │ │ ├── bronze__streamline_solscan_blocks_2.sql │ │ ├── bronze__streamline_solscan_token_list.sql │ │ ├── bronze__streamline_stake_program_accounts_2.sql │ │ ├── bronze__streamline_validator_metadata_2.sql │ │ ├── bronze__streamline_validator_vote_accounts_2.sql │ │ ├── bronze__streamline_validator_vote_program_accounts_2.sql │ │ └── bronze__streamline_validators_list_2.sql ├── descriptions │ ├── __overview__.md │ ├── _inserted_timestamp.md │ ├── _invocation_id.md │ ├── action.md │ ├── amount.md │ ├── amount_usd.md │ ├── backfill_status.md │ ├── balances │ │ └── balances.md │ ├── block_id.md │ ├── block_timestamp.md │ ├── blockchain.md │ ├── bridge │ │ └── bridge_activity.md │ ├── burn_amount.md │ ├── contract_address.md │ ├── contract_name.md │ ├── created_at_timestamp.md │ ├── creator_address.md │ ├── creator_name.md │ ├── date_submitted.md │ ├── decimal.md │ ├── earliest_decoded_block.md │ ├── end_block.md │ ├── epoch.md │ ├── epoch_earned.md │ ├── event_index.md │ ├── event_type.md │ ├── ez_core_metrics.md │ ├── first_block_id.md │ ├── gov_action_action.md │ ├── gov_action_amount.md │ ├── gov_action_escrow_account.md │ ├── gov_action_locker_account.md │ ├── gov_action_locker_nft.md │ ├── gov_action_mint.md │ ├── gov_action_signer.md │ ├── id.md │ ├── image_url.md │ ├── index.md │ ├── ingested_at.md │ ├── inner_index.md │ ├── inner_instruction.md │ ├── inserted_timestamp.md │ ├── instruction.md │ ├── is_compressed.md │ ├── is_valid.md │ ├── leaf_index.md │ ├── liquidity_pool_address.md │ ├── liquidity_pool_token_mint.md │ ├── liquidity_provider.md │ ├── log_index.md │ ├── marketplace.md │ ├── merkle_tree.md │ ├── mint.md │ ├── mint_amount.md │ ├── mint_currency.md │ ├── mint_payer.md │ ├── mint_price.md │ ├── mint_standard_type.md │ ├── modified_timestamp.md │ ├── pk.md │ ├── post_balance.md │ ├── prices │ │ └── prices.md │ ├── program_id.md │ ├── project_name.md │ ├── purchaser.md │ ├── sales_amount.md │ ├── seller.md │ ├── signers.md │ ├── stake_account.md │ ├── stake_authority.md │ ├── stake_pool.md │ ├── stake_pool_action.md │ ├── stake_pool_address.md │ ├── stake_pool_amount.md │ ├── stake_pool_deposit_authority.md │ ├── stake_pool_reserve_stake_address.md │ ├── stake_pool_withdraw_authority.md │ ├── start_block.md │ ├── submitted_by.md │ ├── swaps_from_amt.md │ ├── swaps_from_mint.md │ ├── swaps_swap_index.md │ ├── swaps_swapper.md │ ├── swaps_to_amt.md │ ├── swaps_to_mint.md │ ├── symbol.md │ ├── table_dim_labels.md │ ├── token_a_account.md │ ├── token_a_amount.md │ ├── token_a_mint.md │ ├── token_account.md │ ├── token_b_account.md │ ├── token_b_amount.md │ ├── token_b_mint.md │ ├── token_id.md │ ├── token_metadata.md │ ├── token_metadata_uri.md │ ├── token_name.md │ ├── tree_authority.md │ ├── tribeca_gauge.md │ ├── tribeca_gauge_delegated_shares.md │ ├── tribeca_gauge_power.md │ ├── tribeca_gauge_validator_account.md │ ├── tribeca_gauge_voter.md │ ├── tribeca_gaugemeister.md │ ├── tx_from.md │ ├── tx_id.md │ ├── tx_index.md │ ├── tx_succeeded.md │ ├── tx_to.md │ ├── vote_pubkey.md │ └── withdraw_authority.md ├── github_actions │ ├── github_actions__current_task_status.sql │ ├── github_actions__current_task_status.yml │ ├── github_actions__task_history.sql │ ├── github_actions__task_performance.sql │ ├── github_actions__task_schedule.sql │ └── github_actions__tasks.sql ├── gold │ ├── core │ │ ├── core__dim_idls.sql │ │ ├── core__dim_idls.yml │ │ ├── core__dim_labels.sql │ │ ├── core__dim_labels.yml │ │ ├── core__ez_events_decoded.sql │ │ ├── core__ez_events_decoded.yml │ │ ├── core__ez_signers.sql │ │ ├── core__ez_signers.yml │ │ ├── core__ez_transfers.sql │ │ ├── core__ez_transfers.yml │ │ ├── core__fact_blocks.sql │ │ ├── core__fact_blocks.yml │ │ ├── core__fact_decoded_instructions.sql │ │ ├── core__fact_decoded_instructions.yml │ │ ├── core__fact_events.sql │ │ ├── core__fact_events.yml │ │ ├── core__fact_events_inner.sql │ │ ├── core__fact_events_inner.yml │ │ ├── core__fact_sol_balances.sql │ │ ├── core__fact_sol_balances.yml │ │ ├── core__fact_token_account_owners.sql │ │ ├── core__fact_token_account_owners.yml │ │ ├── core__fact_token_balances.sql │ │ ├── core__fact_token_balances.yml │ │ ├── core__fact_transactions.sql │ │ ├── core__fact_transactions.yml │ │ ├── core__fact_transfers.sql │ │ └── core__fact_transfers.yml │ ├── defi │ │ ├── defi__ez_bridge_activity.sql │ │ ├── defi__ez_bridge_activity.yml │ │ ├── defi__ez_dex_swaps.sql │ │ ├── defi__ez_dex_swaps.yml │ │ ├── defi__ez_liquidity_pool_actions.sql │ │ ├── defi__ez_liquidity_pool_actions.yml │ │ ├── defi__fact_bridge_activity.sql │ │ ├── defi__fact_bridge_activity.yml │ │ ├── defi__fact_stake_pool_actions.sql │ │ ├── defi__fact_stake_pool_actions.yml │ │ ├── defi__fact_swaps.sql │ │ ├── defi__fact_swaps.yml │ │ ├── defi__fact_swaps_jupiter_inner.sql │ │ ├── defi__fact_swaps_jupiter_inner.yml │ │ ├── defi__fact_swaps_jupiter_summary.sql │ │ ├── defi__fact_swaps_jupiter_summary.yml │ │ ├── defi__fact_token_burn_actions.sql │ │ ├── defi__fact_token_burn_actions.yml │ │ ├── defi__fact_token_mint_actions.sql │ │ └── defi__fact_token_mint_actions.yml │ ├── gov │ │ ├── gov__dim_epoch.sql │ │ ├── gov__dim_epoch.yml │ │ ├── gov__ez_staking_lp_actions.sql │ │ ├── gov__ez_staking_lp_actions.yml │ │ ├── gov__fact_block_production.sql │ │ ├── gov__fact_block_production.yml │ │ ├── gov__fact_gauges_creates.sql │ │ ├── gov__fact_gauges_creates.yml │ │ ├── gov__fact_gauges_votes.sql │ │ ├── gov__fact_gauges_votes.yml │ │ ├── gov__fact_gov_actions.sql │ │ ├── gov__fact_gov_actions.yml │ │ ├── gov__fact_proposal_creation.sql │ │ ├── gov__fact_proposal_creation.yml │ │ ├── gov__fact_proposal_votes.sql │ │ ├── gov__fact_proposal_votes.yml │ │ ├── gov__fact_rewards_fee.sql │ │ ├── gov__fact_rewards_fee.yml │ │ ├── gov__fact_rewards_rent.sql │ │ ├── gov__fact_rewards_rent.yml │ │ ├── gov__fact_rewards_staking.sql │ │ ├── gov__fact_rewards_staking.yml │ │ ├── gov__fact_rewards_voting.sql │ │ ├── gov__fact_rewards_voting.yml │ │ ├── gov__fact_stake_accounts.sql │ │ ├── gov__fact_stake_accounts.yml │ │ ├── gov__fact_staking_lp_actions.sql │ │ ├── gov__fact_staking_lp_actions.yml │ │ ├── gov__fact_validators.sql │ │ ├── gov__fact_validators.yml │ │ ├── gov__fact_vote_accounts.sql │ │ ├── gov__fact_vote_accounts.yml │ │ ├── gov__fact_votes_agg_block.sql │ │ └── gov__fact_votes_agg_block.yml │ ├── marinade │ │ ├── marinade__dim_pools.sql │ │ ├── marinade__dim_pools.yml │ │ ├── marinade__ez_liquid_staking_actions.sql │ │ ├── marinade__ez_liquid_staking_actions.yml │ │ ├── marinade__ez_liquidity_pool_actions.sql │ │ ├── marinade__ez_liquidity_pool_actions.yml │ │ ├── marinade__ez_native_staking_actions.sql │ │ ├── marinade__ez_native_staking_actions.yml │ │ ├── marinade__ez_swaps.sql │ │ ├── marinade__ez_swaps.yml │ │ ├── marinade__meteora_dlmm_pivot.sql │ │ ├── marinade__meteora_dlmm_pivot.yml │ │ ├── marinade__meteora_multi_pivot.sql │ │ ├── marinade__meteora_multi_pivot.yml │ │ ├── marinade__meteora_pivot.sql │ │ └── marinade__meteora_pivot.yml │ ├── nft │ │ ├── nft__dim_nft_metadata.sql │ │ ├── nft__dim_nft_metadata.yml │ │ ├── nft__ez_nft_sales.sql │ │ ├── nft__ez_nft_sales.yml │ │ ├── nft__fact_nft_burn_actions.sql │ │ ├── nft__fact_nft_burn_actions.yml │ │ ├── nft__fact_nft_mint_actions.sql │ │ ├── nft__fact_nft_mint_actions.yml │ │ ├── nft__fact_nft_mints.sql │ │ └── nft__fact_nft_mints.yml │ ├── price │ │ ├── price__dim_asset_metadata.sql │ │ ├── price__dim_asset_metadata.yml │ │ ├── price__ez_asset_metadata.sql │ │ ├── price__ez_asset_metadata.yml │ │ ├── price__ez_prices_hourly.sql │ │ ├── price__ez_prices_hourly.yml │ │ ├── price__fact_prices_ohlc_hourly.sql │ │ └── price__fact_prices_ohlc_hourly.yml │ ├── stats │ │ ├── stats__ez_core_metrics_hourly.sql │ │ └── stats__ez_core_metrics_hourly.yml │ └── user │ │ ├── sa__consumption_results.sql │ │ ├── sa__crafting_results.sql │ │ ├── sa__mining_fleets.sql │ │ ├── sa__mining_results.sql │ │ ├── sa__profile_wallets.sql │ │ ├── sa__r4_harvest_results.sql │ │ ├── sa__refill_results.sql │ │ ├── sa__scanning_fleets.sql │ │ └── sa__scanning_results.sql ├── silver │ ├── _observability │ │ ├── silver_observability__blocks_completeness.sql │ │ ├── silver_observability__blocks_completeness.yml │ │ ├── silver_observability__blocks_tx_count.sql │ │ ├── silver_observability__blocks_tx_count.yml │ │ ├── silver_observability__transactions_completeness.sql │ │ └── silver_observability__transactions_completeness.yml │ ├── accounts │ │ ├── silver__stake_account_ownership_events.sql │ │ ├── silver__stake_account_ownership_events.yml │ │ ├── silver__token_account_owners.sql │ │ ├── silver__token_account_owners.yml │ │ ├── silver__token_account_owners_intermediate.sql │ │ ├── silver__token_account_owners_intermediate.yml │ │ ├── silver__token_account_ownership_events.sql │ │ └── silver__token_account_ownership_events.yml │ ├── backfill │ │ ├── silver__backfill_transactions_index.sql │ │ ├── silver__backfill_transactions_units_consumed.sql │ │ ├── silver__transactions_votes_with_non_votes.sql │ │ └── silver__transfers_null_mints_fix.sql │ ├── balances │ │ ├── silver__sol_balances.sql │ │ ├── silver__sol_balances.yml │ │ ├── silver__token_balances.sql │ │ └── silver__token_balances.yml │ ├── bridges │ │ ├── silver__bridge_debridge_transfers.sql │ │ ├── silver__bridge_debridge_transfers.yml │ │ ├── silver__bridge_mayan_transfers.sql │ │ ├── silver__bridge_mayan_transfers.yml │ │ ├── silver__bridge_mayan_transfers_decoded.sql │ │ ├── silver__bridge_mayan_transfers_decoded.yml │ │ ├── silver__bridge_mayan_transfers_view.sql │ │ ├── silver__bridge_wormhole_transfers.sql │ │ └── silver__bridge_wormhole_transfers.yml │ ├── core │ │ ├── silver___inner_instructions.sql │ │ ├── silver___inner_instructions.yml │ │ ├── silver___instructions.sql │ │ ├── silver___instructions.yml │ │ ├── silver___post_token_balances.sql │ │ ├── silver___post_token_balances.yml │ │ ├── silver___pre_token_balances.sql │ │ ├── silver___pre_token_balances.yml │ │ ├── silver__blocks.sql │ │ ├── silver__blocks.yml │ │ ├── silver__decoded_instructions_data.sql │ │ ├── silver__decoded_instructions_data.yml │ │ ├── silver__events.sql │ │ ├── silver__events.yml │ │ ├── silver__events_inner.sql │ │ ├── silver__events_inner.yml │ │ ├── silver__transactions.sql │ │ ├── silver__transactions.yml │ │ ├── silver__transfers.sql │ │ ├── silver__transfers.yml │ │ ├── silver__votes.sql │ │ └── silver__votes.yml │ ├── gauges │ │ ├── silver__gauges_creates_marinade.sql │ │ ├── silver__gauges_creates_marinade.yml │ │ ├── silver__gauges_creates_marinade_view.sql │ │ ├── silver__gauges_votes_marinade.sql │ │ ├── silver__gauges_votes_marinade.yml │ │ ├── silver__gauges_votes_marinade_view.sql │ │ ├── silver__gauges_votes_saber.sql │ │ └── silver__gauges_votes_saber.yml │ ├── governance │ │ ├── silver__gov_actions_marinade.sql │ │ ├── silver__gov_actions_marinade.yml │ │ ├── silver__gov_actions_marinade_tmp.sql │ │ ├── silver__gov_actions_saber.sql │ │ ├── silver__gov_actions_saber.yml │ │ ├── silver__gov_actions_saber_view.sql │ │ ├── silver__proposal_creation_realms.sql │ │ ├── silver__proposal_creation_realms.yml │ │ ├── silver__proposal_votes_marinade.sql │ │ ├── silver__proposal_votes_marinade.yml │ │ ├── silver__proposal_votes_marinade_view.sql │ │ ├── silver__proposal_votes_realms.sql │ │ └── silver__proposal_votes_realms.yml │ ├── idls │ │ ├── silver__idls.sql │ │ ├── silver__idls.yml │ │ ├── silver__verified_idls.sql │ │ └── silver__verified_user_idls.sql │ ├── labels │ │ ├── silver__date_hours.sql │ │ ├── silver__labels.sql │ │ ├── silver__labels.yml │ │ ├── silver__mint_types.sql │ │ └── silver__mint_types.yml │ ├── liquidity_pool │ │ ├── meteora │ │ │ ├── amm │ │ │ │ ├── silver__initialization_pools_meteora.sql │ │ │ │ ├── silver__initialization_pools_meteora.yml │ │ │ │ ├── silver__liquidity_pool_actions_meteora_2.sql │ │ │ │ └── silver__liquidity_pool_actions_meteora_2.yml │ │ │ ├── dlmm │ │ │ │ ├── silver__initialization_pools_meteora_dlmm.sql │ │ │ │ ├── silver__initialization_pools_meteora_dlmm.yml │ │ │ │ ├── silver__liquidity_pool_actions_meteora_dlmm_2.sql │ │ │ │ └── silver__liquidity_pool_actions_meteora_dlmm_2.yml │ │ │ └── multi │ │ │ │ ├── silver__liquidity_pool_actions_meteora_multi_2.sql │ │ │ │ └── silver__liquidity_pool_actions_meteora_multi_2.yml │ │ ├── orca │ │ │ ├── v1 │ │ │ │ ├── silver__initialization_pools_orcav1.sql │ │ │ │ ├── silver__initialization_pools_orcav1.yml │ │ │ │ ├── silver__liquidity_pool_actions_orcav1.sql │ │ │ │ └── silver__liquidity_pool_actions_orcav1.yml │ │ │ ├── v2 │ │ │ │ ├── silver__initialization_pools_orcav2.sql │ │ │ │ ├── silver__initialization_pools_orcav2.yml │ │ │ │ ├── silver__liquidity_pool_actions_orcav2.sql │ │ │ │ └── silver__liquidity_pool_actions_orcav2.yml │ │ │ └── whirlpool │ │ │ │ ├── silver__initialization_pools_orca_whirlpool.sql │ │ │ │ ├── silver__initialization_pools_orca_whirlpool.yml │ │ │ │ ├── silver__liquidity_pool_actions_orca_whirlpool.sql │ │ │ │ └── silver__liquidity_pool_actions_orca_whirlpool.yml │ │ ├── pools │ │ │ ├── silver__liquidity_pools.sql │ │ │ └── silver__liquidity_pools.yml │ │ ├── raydium │ │ │ ├── clmm │ │ │ │ ├── silver__initialization_pools_raydium_clmm.sql │ │ │ │ ├── silver__initialization_pools_raydium_clmm.yml │ │ │ │ ├── silver__liquidity_pool_actions_raydium_clmm.sql │ │ │ │ └── silver__liquidity_pool_actions_raydium_clmm.yml │ │ │ ├── cpmm │ │ │ │ ├── silver__initialization_pools_raydium_cpmm.sql │ │ │ │ ├── silver__intialization_pools_raydium_cpmm.yml │ │ │ │ ├── silver__liquidity_pool_actions_raydium_cpmm.sql │ │ │ │ └── silver__liquidity_pool_actions_raydium_cpmm.yml │ │ │ ├── stable │ │ │ │ ├── silver__initialization_pools_raydiumstable.sql │ │ │ │ ├── silver__initialization_pools_raydiumstable.yml │ │ │ │ ├── silver__liquidity_pool_actions_raydiumstable.sql │ │ │ │ └── silver__liquidity_pool_actions_raydiumstable.yml │ │ │ └── v4 │ │ │ │ ├── silver__initialization_pools_raydiumv4.sql │ │ │ │ ├── silver__initialization_pools_raydiumv4.yml │ │ │ │ ├── silver__liquidity_pool_actions_raydiumv4.sql │ │ │ │ └── silver__liquidity_pool_actions_raydiumv4.yml │ │ ├── silver__burns_orca_non_whirlpool.sql │ │ ├── silver__burns_orca_non_whirlpool.yml │ │ ├── silver__burns_orca_non_whirlpool_view.sql │ │ ├── silver__burns_orca_whirlpool.sql │ │ ├── silver__burns_orca_whirlpool.yml │ │ ├── silver__burns_raydium.sql │ │ ├── silver__burns_raydium.yml │ │ ├── silver__initialization_pools_orca.sql │ │ ├── silver__initialization_pools_orca.yml │ │ ├── silver__initialization_pools_orca_view.sql │ │ ├── silver__initialization_pools_raydium.sql │ │ ├── silver__initialization_pools_raydium.yml │ │ ├── silver__liquidity_pool_actions_meteora.sql │ │ ├── silver__liquidity_pool_actions_meteora.yml │ │ ├── silver__liquidity_pool_actions_meteora_dlmm.sql │ │ ├── silver__liquidity_pool_actions_meteora_dlmm.yml │ │ ├── silver__liquidity_pool_actions_meteora_multi.sql │ │ ├── silver__liquidity_pool_actions_meteora_multi.yml │ │ ├── silver__liquidity_pool_actions_orca.sql │ │ ├── silver__liquidity_pool_actions_orca.yml │ │ ├── silver__liquidity_pool_actions_raydium.sql │ │ ├── silver__liquidity_pool_actions_raydium.yml │ │ ├── silver__liquidity_pool_actions_saber.sql │ │ ├── silver__liquidity_pool_actions_saber.yml │ │ ├── silver__liquidity_pool_events_orca.sql │ │ ├── silver__liquidity_pool_events_orca.yml │ │ ├── silver__liquidity_pool_events_raydium.sql │ │ ├── silver__liquidity_pool_events_raydium.yml │ │ ├── silver__mints_orca_non_whirlpool.sql │ │ ├── silver__mints_orca_non_whirlpool.yml │ │ ├── silver__mints_orca_non_whirlpool_view.sql │ │ ├── silver__mints_orca_whirlpool.sql │ │ ├── silver__mints_orca_whirlpool.yml │ │ ├── silver__mints_raydium.sql │ │ ├── silver__mints_raydium.yml │ │ ├── silver__pool_transfers_orca_non_whirlpool.sql │ │ ├── silver__pool_transfers_orca_non_whirlpool.yml │ │ ├── silver__pool_transfers_orca_non_whirlpool_view.sql │ │ ├── silver__pool_transfers_orca_whirlpool.sql │ │ ├── silver__pool_transfers_orca_whirlpool.yml │ │ ├── silver__pool_transfers_raydium.sql │ │ └── silver__pool_transfers_raydium.yml │ ├── metadata │ │ ├── helius │ │ │ ├── silver__helius_cnft_metadata.sql │ │ │ ├── silver__helius_cnft_metadata.yml │ │ │ ├── silver__helius_nft_metadata.sql │ │ │ ├── silver__helius_nft_metadata.yml │ │ │ ├── silver__helius_nft_requests.sql │ │ │ └── silver__helius_nft_requests.yml │ │ ├── legacy │ │ │ ├── silver__nft_metadata.sql │ │ │ └── silver__nft_metadata.yml │ │ ├── silver__decoded_metadata.sql │ │ ├── silver__decoded_metadata.yml │ │ ├── silver__nft_collection.sql │ │ ├── silver__nft_collection.yml │ │ ├── silver__nft_collection_view.sql │ │ ├── silver__solscan_tokens.sql │ │ └── silver__solscan_tokens.yml │ ├── nfts │ │ ├── silver___nft_distinct_mints.sql │ │ ├── silver___nft_distinct_mints.yml │ │ ├── silver__nft_bids_yawww.sql │ │ ├── silver__nft_bids_yawww.yml │ │ ├── silver__nft_burn_actions.sql │ │ ├── silver__nft_burn_actions.yml │ │ ├── silver__nft_compressed_mints.sql │ │ ├── silver__nft_compressed_mints.yml │ │ ├── silver__nft_compressed_mints_onchain.sql │ │ ├── silver__nft_compressed_mints_onchain.yml │ │ ├── silver__nft_mint_actions.sql │ │ ├── silver__nft_mint_actions.yml │ │ ├── silver__nft_mint_price.sql │ │ ├── silver__nft_mint_price.yml │ │ ├── silver__nft_mint_price_candy_machine.sql │ │ ├── silver__nft_mint_price_candy_machine.yml │ │ ├── silver__nft_mint_price_generic.sql │ │ ├── silver__nft_mint_price_generic.yml │ │ ├── silver__nft_mint_price_other.sql │ │ ├── silver__nft_mint_price_other.yml │ │ ├── silver__nft_mint_price_other_view.sql │ │ ├── silver__nft_mints.sql │ │ ├── silver__nft_mints.yml │ │ ├── silver__nft_sales_amm_sell.sql │ │ ├── silver__nft_sales_amm_sell.yml │ │ ├── silver__nft_sales_amm_sell_decoded.sql │ │ ├── silver__nft_sales_amm_sell_decoded.yml │ │ ├── silver__nft_sales_amm_sell_view.sql │ │ ├── silver__nft_sales_coral_cube.sql │ │ ├── silver__nft_sales_coral_cube.yml │ │ ├── silver__nft_sales_coral_cube_view.sql │ │ ├── silver__nft_sales_exchange_art.sql │ │ ├── silver__nft_sales_exchange_art.yml │ │ ├── silver__nft_sales_hadeswap.sql │ │ ├── silver__nft_sales_hadeswap.yml │ │ ├── silver__nft_sales_hadeswap_decoded.sql │ │ ├── silver__nft_sales_hadeswap_decoded.yml │ │ ├── silver__nft_sales_hadeswap_view.sql │ │ ├── silver__nft_sales_hyperspace.sql │ │ ├── silver__nft_sales_hyperspace.yml │ │ ├── silver__nft_sales_hyperspace_view.sql │ │ ├── silver__nft_sales_legacy_combined_view.sql │ │ ├── silver__nft_sales_magic_eden_cnft.sql │ │ ├── silver__nft_sales_magic_eden_cnft.yml │ │ ├── silver__nft_sales_magic_eden_cnft_onchain.sql │ │ ├── silver__nft_sales_magic_eden_cnft_onchain.yml │ │ ├── silver__nft_sales_magic_eden_v1.sql │ │ ├── silver__nft_sales_magic_eden_v1.yml │ │ ├── silver__nft_sales_magic_eden_v1_view.sql │ │ ├── silver__nft_sales_magic_eden_v2.sql │ │ ├── silver__nft_sales_magic_eden_v2.yml │ │ ├── silver__nft_sales_magic_eden_v2_decoded.sql │ │ ├── silver__nft_sales_magic_eden_v2_decoded.yml │ │ ├── silver__nft_sales_magic_eden_v2_view.sql │ │ ├── silver__nft_sales_opensea.sql │ │ ├── silver__nft_sales_opensea.yml │ │ ├── silver__nft_sales_opensea_view.sql │ │ ├── silver__nft_sales_smb.sql │ │ ├── silver__nft_sales_smb.yml │ │ ├── silver__nft_sales_smb_view.sql │ │ ├── silver__nft_sales_solanart.sql │ │ ├── silver__nft_sales_solanart.yml │ │ ├── silver__nft_sales_solanart_view.sql │ │ ├── silver__nft_sales_solport.sql │ │ ├── silver__nft_sales_solport.yml │ │ ├── silver__nft_sales_solport_view.sql │ │ ├── silver__nft_sales_solsniper.sql │ │ ├── silver__nft_sales_solsniper.yml │ │ ├── silver__nft_sales_solsniper_cnft.sql │ │ ├── silver__nft_sales_solsniper_cnft.yml │ │ ├── silver__nft_sales_solsniper_cnft_onchain.sql │ │ ├── silver__nft_sales_solsniper_cnft_onchain.yml │ │ ├── silver__nft_sales_solsniper_cnft_view.sql │ │ ├── silver__nft_sales_solsniper_v1_events.sql │ │ ├── silver__nft_sales_solsniper_v1_events.yml │ │ ├── silver__nft_sales_solsniper_v1_events_view.sql │ │ ├── silver__nft_sales_solsniper_view.sql │ │ ├── silver__nft_sales_tensor_bid.sql │ │ ├── silver__nft_sales_tensor_bid.yml │ │ ├── silver__nft_sales_tensorswap.sql │ │ ├── silver__nft_sales_tensorswap.yml │ │ ├── silver__nft_sales_tensorswap_buysellevent.sql │ │ ├── silver__nft_sales_tensorswap_buysellevent.yml │ │ ├── silver__nft_sales_tensorswap_buysellevent_view.sql │ │ ├── silver__nft_sales_tensorswap_cnft.sql │ │ ├── silver__nft_sales_tensorswap_cnft.yml │ │ ├── silver__nft_sales_tensorswap_view.sql │ │ ├── silver__nft_sales_yawww.sql │ │ ├── silver__nft_sales_yawww.yml │ │ └── silver__nft_sales_yawww_view.sql │ ├── non_core │ │ ├── silver___all_undecoded_instructions_data.sql │ │ ├── silver___blocks_tx_count.sql │ │ ├── silver__burn_actions.sql │ │ ├── silver__burn_actions.yml │ │ ├── silver__daily_signers.sql │ │ ├── silver__daily_signers.yml │ │ ├── silver__epoch.sql │ │ ├── silver__epoch.yml │ │ ├── silver__mint_actions.sql │ │ ├── silver__mint_actions.yml │ │ ├── silver__signers.sql │ │ ├── silver__signers.yml │ │ ├── silver__signers_nfts_held.sql │ │ ├── silver__signers_nfts_held.yml │ │ ├── silver__staking_lp_actions.sql │ │ ├── silver__staking_lp_actions.yml │ │ ├── silver__staking_lp_actions_2.sql │ │ ├── silver__staking_lp_actions_2.yml │ │ ├── silver__staking_lp_actions_labeled.sql │ │ ├── silver__staking_lp_actions_labeled.yml │ │ ├── silver__staking_lp_actions_labeled_2.sql │ │ ├── silver__staking_lp_actions_labeled_2.yml │ │ ├── silver__votes_agg_block.sql │ │ └── silver__votes_agg_block.yml │ ├── olas │ │ ├── silver_olas__registry_metadata.sql │ │ ├── silver_olas__registry_metadata.yml │ │ ├── silver_olas__registry_metadata_complete.sql │ │ ├── silver_olas__registry_metadata_complete.yml │ │ ├── silver_olas__service_event_logs.sql │ │ ├── silver_olas__service_event_logs.yml │ │ ├── silver_olas__service_registrations.sql │ │ └── silver_olas__service_registrations.yml │ ├── parser │ │ ├── silver__decoded_instructions.sql │ │ ├── silver__decoded_instructions.yml │ │ ├── silver__decoded_instructions_combined.sql │ │ ├── silver__decoded_instructions_combined.yml │ │ ├── silver__decoded_logs.sql │ │ └── silver__decoded_logs.yml │ ├── prices │ │ ├── silver__complete_native_asset_metadata.sql │ │ ├── silver__complete_native_asset_metadata.yml │ │ ├── silver__complete_native_prices.sql │ │ ├── silver__complete_native_prices.yml │ │ ├── silver__complete_provider_asset_metadata.sql │ │ ├── silver__complete_provider_asset_metadata.yml │ │ ├── silver__complete_provider_prices.sql │ │ ├── silver__complete_provider_prices.yml │ │ ├── silver__complete_token_asset_metadata.sql │ │ ├── silver__complete_token_asset_metadata.yml │ │ ├── silver__complete_token_prices.sql │ │ └── silver__complete_token_prices.yml │ ├── program_logs │ │ ├── silver__transaction_logs_program_data.sql │ │ └── silver__transaction_logs_program_data.yml │ ├── protocols │ │ └── marinade │ │ │ ├── silver__marinade_liquid_staking_actions.sql │ │ │ ├── silver__marinade_liquid_staking_actions.yml │ │ │ ├── silver__marinade_native_staking_account_withdraw_authority_mapping.sql │ │ │ ├── silver__marinade_native_staking_account_withdraw_authority_mapping.yml │ │ │ ├── silver__marinade_swaps.sql │ │ │ └── silver__marinade_swaps.yml │ ├── rewards │ │ ├── silver__rewards_fee.sql │ │ ├── silver__rewards_fee.yml │ │ ├── silver__rewards_fee_2.sql │ │ ├── silver__rewards_fee_2.yml │ │ ├── silver__rewards_fee_view.sql │ │ ├── silver__rewards_rent.sql │ │ ├── silver__rewards_rent.yml │ │ ├── silver__rewards_rent_view.sql │ │ ├── silver__rewards_staking.sql │ │ ├── silver__rewards_staking.yml │ │ ├── silver__rewards_staking_2.sql │ │ ├── silver__rewards_staking_2.yml │ │ ├── silver__rewards_staking_view.sql │ │ ├── silver__rewards_voting.sql │ │ ├── silver__rewards_voting.yml │ │ ├── silver__rewards_voting_2.sql │ │ ├── silver__rewards_voting_2.yml │ │ └── silver__rewards_voting_view.sql │ ├── staking │ │ ├── silver__stake_pool_actions_eversol.sql │ │ ├── silver__stake_pool_actions_eversol.yml │ │ ├── silver__stake_pool_actions_eversol_view.sql │ │ ├── silver__stake_pool_actions_generic.sql │ │ ├── silver__stake_pool_actions_generic.yml │ │ ├── silver__stake_pool_actions_jito.sql │ │ ├── silver__stake_pool_actions_jito.yml │ │ ├── silver__stake_pool_actions_lido.sql │ │ ├── silver__stake_pool_actions_lido.yml │ │ ├── silver__stake_pool_actions_lido_view.sql │ │ ├── silver__stake_pool_actions_marinade.sql │ │ ├── silver__stake_pool_actions_marinade.yml │ │ ├── silver__stake_pool_actions_socean.sql │ │ ├── silver__stake_pool_actions_socean.yml │ │ └── silver__stake_pool_actions_socean_view.sql │ ├── stats │ │ ├── silver__core_metrics_hourly.sql │ │ └── silver__core_metrics_hourly.yml │ ├── swaps │ │ ├── bonkswap │ │ │ ├── silver__swaps_intermediate_bonkswap.sql │ │ │ └── silver__swaps_intermediate_bonkswap.yml │ │ ├── dooar │ │ │ ├── silver__swaps_intermediate_dooar.sql │ │ │ └── silver__swaps_intermediate_dooar.yml │ │ ├── generic │ │ │ ├── silver__swaps_intermediate_generic.sql │ │ │ ├── silver__swaps_intermediate_generic.yml │ │ │ └── silver__swaps_intermediate_generic_view.sql │ │ ├── jupiter │ │ │ ├── v4 │ │ │ │ ├── silver__swaps_inner_intermediate_jupiterv4.sql │ │ │ │ ├── silver__swaps_inner_intermediate_jupiterv4.yml │ │ │ │ ├── silver__swaps_intermediate_jupiterv4.sql │ │ │ │ ├── silver__swaps_intermediate_jupiterv4.yml │ │ │ │ ├── silver__swaps_intermediate_jupiterv4_2.sql │ │ │ │ ├── silver__swaps_intermediate_jupiterv4_2.yml │ │ │ │ └── silver__swaps_intermediate_jupiterv4_view.sql │ │ │ ├── v5 │ │ │ │ ├── silver__swaps_inner_intermediate_jupiterv5.sql │ │ │ │ ├── silver__swaps_inner_intermediate_jupiterv5.yml │ │ │ │ ├── silver__swaps_intermediate_jupiterv5_1.sql │ │ │ │ ├── silver__swaps_intermediate_jupiterv5_1.yml │ │ │ │ ├── silver__swaps_intermediate_jupiterv5_1_view.sql │ │ │ │ ├── silver__swaps_intermediate_jupiterv5_2.sql │ │ │ │ ├── silver__swaps_intermediate_jupiterv5_2.yml │ │ │ │ └── silver__swaps_intermediate_jupiterv5_2_view.sql │ │ │ └── v6 │ │ │ │ ├── silver__swaps_inner_intermediate_jupiterv6.sql │ │ │ │ ├── silver__swaps_inner_intermediate_jupiterv6.yml │ │ │ │ ├── silver__swaps_intermediate_jupiterv6.sql │ │ │ │ ├── silver__swaps_intermediate_jupiterv6.yml │ │ │ │ ├── silver__swaps_intermediate_jupiterv6_2.sql │ │ │ │ ├── silver__swaps_intermediate_jupiterv6_2.yml │ │ │ │ └── silver__swaps_intermediate_jupiterv6_view.sql │ │ ├── lifinity │ │ │ ├── silver__swaps_intermediate_lifinity.sql │ │ │ └── silver__swaps_intermediate_lifinity.yml │ │ ├── meteora │ │ │ ├── silver__swaps_intermediate_meteora.sql │ │ │ ├── silver__swaps_intermediate_meteora.yml │ │ │ ├── silver__swaps_intermediate_meteora_bonding.sql │ │ │ └── silver__swaps_intermediate_meteora_bonding.yml │ │ ├── orca │ │ │ ├── legacy │ │ │ │ ├── silver__swaps_intermediate_orca.sql │ │ │ │ ├── silver__swaps_intermediate_orca.yml │ │ │ │ └── silver__swaps_intermediate_orca_view.sql │ │ │ ├── token_swap │ │ │ │ ├── silver__swaps_intermediate_orca_token_swap.sql │ │ │ │ └── silver__swaps_intermediate_orca_token_swap.yml │ │ │ └── whirlpool │ │ │ │ ├── silver__swaps_intermediate_orca_whirlpool.sql │ │ │ │ └── silver__swaps_intermediate_orca_whirlpool.yml │ │ ├── phoenix │ │ │ ├── silver__swaps_intermediate_phoenix.sql │ │ │ └── silver__swaps_intermediate_phoenix.yml │ │ ├── pumpfun │ │ │ ├── silver__swaps_pumpfun.sql │ │ │ ├── silver__swaps_pumpfun.yml │ │ │ ├── silver__swaps_pumpswap.sql │ │ │ └── silver__swaps_pumpswap.yml │ │ ├── raydium │ │ │ ├── legacy │ │ │ │ ├── silver__swaps_intermediate_raydium.sql │ │ │ │ └── silver__swaps_intermediate_raydium.yml │ │ │ ├── silver__swaps_intermediate_raydium_clmm.sql │ │ │ ├── silver__swaps_intermediate_raydium_clmm.yml │ │ │ ├── silver__swaps_intermediate_raydium_cpmm.sql │ │ │ ├── silver__swaps_intermediate_raydium_cpmm.yml │ │ │ ├── silver__swaps_intermediate_raydium_stable.sql │ │ │ ├── silver__swaps_intermediate_raydium_stable.yml │ │ │ ├── silver__swaps_intermediate_raydium_v4_amm.sql │ │ │ └── silver__swaps_intermediate_raydium_v4_amm.yml │ │ ├── saber │ │ │ ├── silver__swaps_intermediate_saber.sql │ │ │ └── silver__swaps_intermediate_saber.yml │ │ ├── silver__swaps.sql │ │ ├── silver__swaps.yml │ │ └── silver__swaps_view.sql │ ├── tokens │ │ ├── silver__token_burn_actions.sql │ │ ├── silver__token_burn_actions.yml │ │ ├── silver__token_mint_actions.sql │ │ └── silver__token_mint_actions.yml │ ├── utils │ │ └── silver___number_sequence.sql │ └── validator │ │ ├── run_models │ │ └── silver__run_stake_accounts_snapshot.sql │ │ ├── silver__historical_block_production.sql │ │ ├── silver__historical_block_production.yml │ │ ├── silver__historical_stake_account.sql │ │ ├── silver__historical_stake_account.yml │ │ ├── silver__historical_validator_app_data.sql │ │ ├── silver__historical_validator_app_data.yml │ │ ├── silver__historical_vote_account.sql │ │ ├── silver__historical_vote_account.yml │ │ ├── silver__snapshot_block_production.sql │ │ ├── silver__snapshot_block_production.yml │ │ ├── silver__snapshot_block_production_2.sql │ │ ├── silver__snapshot_block_production_2.yml │ │ ├── silver__snapshot_block_production_view.sql │ │ ├── silver__snapshot_stake_accounts.sql │ │ ├── silver__snapshot_stake_accounts.yml │ │ ├── silver__snapshot_stake_accounts_2.sql │ │ ├── silver__snapshot_stake_accounts_2.yml │ │ ├── silver__snapshot_validators_app_data.sql │ │ ├── silver__snapshot_validators_app_data.yml │ │ ├── silver__snapshot_vote_accounts.sql │ │ ├── silver__snapshot_vote_accounts.yml │ │ ├── silver__snapshot_vote_accounts_extended_stats.sql │ │ └── silver__snapshot_vote_accounts_extended_stats.yml ├── solana_share │ ├── solana_share__dim_labels.sql │ ├── solana_share__dim_nft_metadata.sql │ ├── solana_share__ez_staking_lp_actions.sql │ ├── solana_share__fact_blocks.sql │ ├── solana_share__fact_events.sql │ ├── solana_share__fact_gauges_creates.sql │ ├── solana_share__fact_gauges_votes.sql │ ├── solana_share__fact_gov_actions.sql │ ├── solana_share__fact_nft_mints.sql │ ├── solana_share__fact_proposal_votes.sql │ ├── solana_share__fact_staking_lp_actions.sql │ ├── solana_share__fact_swaps.sql │ ├── solana_share__fact_transactions.sql │ ├── solana_share__fact_transfers.sql │ └── solana_share__fact_votes_agg_block.sql ├── sources.yml └── streamline │ ├── core │ ├── complete │ │ ├── streamline__complete_block_rewards_2.sql │ │ ├── streamline__complete_block_txs_2.sql │ │ └── streamline__complete_blocks_2.sql │ ├── realtime │ │ ├── streamline__block_rewards_2.sql │ │ ├── streamline__block_txs_2.sql │ │ ├── streamline__block_txs_index.sql │ │ ├── streamline__blocks_2.sql │ │ ├── streamline__helius_blocks.sql │ │ └── streamline__solscan_blocks.sql │ ├── snapshot │ │ ├── streamline__stake_program_accounts_2.sql │ │ ├── streamline__validator_metadata_2.sql │ │ ├── streamline__validator_vote_accounts_2.sql │ │ ├── streamline__validator_vote_program_accounts_2.sql │ │ └── streamline__validators_list_2.sql │ ├── streamline__blocks.sql │ ├── streamline__chainhead.sql │ └── streamline__transactions_and_votes_missing_7_days.sql │ ├── decode_instructions │ ├── streamline__complete_decoded_instructions_2.sql │ ├── streamline__complete_decoded_instructions_2_backfill.sql │ ├── streamline__complete_decoded_instructions_3.sql │ ├── streamline__complete_decoded_instructions_3_backfill.sql │ ├── streamline__decode_instructions_2_pyth_realtime.sql │ ├── streamline__decode_instructions_2_realtime.sql │ ├── streamline__decode_instructions_3_pyth_realtime.sql │ ├── streamline__decode_instructions_3_realtime.sql │ └── streamline__idls_nft_compression.sql │ ├── decode_logs │ ├── streamline__complete_decoded_logs.sql │ ├── streamline__complete_decoded_logs_2.sql │ ├── streamline__complete_decoded_logs_2_backfill.sql │ ├── streamline__complete_decoded_logs_backfill.sql │ ├── streamline__decode_logs_2_realtime.sql │ └── streamline__decode_logs_realtime.sql │ ├── nft │ └── metadata │ │ ├── complete │ │ └── streamline__complete_helius_cnft_metadata_requests.sql │ │ └── requests │ │ └── streamline__helius_cnft_metadata_requests.sql │ ├── parser │ ├── history │ │ ├── streamline__all_undecoded_instructions_history.sql │ │ ├── streamline__all_undecoded_instructions_history_in_progress.sql │ │ ├── streamline__all_undecoded_instructions_history_queue.sql │ │ ├── streamline__complete_decoded_history.sql │ │ └── streamline__idls_history.sql │ ├── streamline__all_undecoded_instructions_two_days.sql │ ├── streamline__complete_decoded_instructions.sql │ ├── streamline__retry_error_instructions.sql │ └── streamline__unknown_error_instructions.sql │ ├── stake_accounts │ ├── streamline__stake_account_states.sql │ └── streamline__stake_account_states.yml │ ├── streamline__all_unknown_block_rewards_historical.sql │ ├── streamline__all_unknown_block_rewards_real_time.sql │ ├── streamline__all_unknown_block_txs_historical.sql │ ├── streamline__all_unknown_block_txs_real_time.sql │ ├── streamline__all_unknown_blocks_historical.sql │ ├── streamline__all_unknown_blocks_real_time.sql │ ├── streamline__complete_block_rewards.sql │ ├── streamline__complete_block_rewards.yml │ ├── streamline__complete_block_txs.sql │ ├── streamline__complete_block_txs.yml │ ├── streamline__complete_blocks.sql │ ├── streamline__complete_blocks.yml │ └── token │ └── metadata │ └── streamline__solscan_token_list_by_market_cap.sql ├── package-lock.yml ├── packages.yml ├── profiles.yml ├── python └── slack_alert.py ├── requirements.txt ├── selectors.yml ├── snapshots └── .gitkeep └── tests ├── .gitkeep ├── test_silver__blocks_gaps.sql ├── test_silver__blocks_tx_count_missing_7_days.sql ├── test_silver__decoded_instructions_combined_error_threshold_7_days.sql ├── test_silver__decoded_instructions_combined_static_error_threshold_7_days.sql ├── test_silver__decoded_instructions_jupiter_limit_signers.sql ├── test_silver__decoded_instructions_missing.sql ├── test_silver__decoded_logs_jupiter_dca_signers.sql ├── test_silver__rewards_gaps.sql ├── test_silver__snapshot_stake_accounts_recency.sql ├── test_silver__token_account_owners_recency.sql ├── test_silver__transactions_and_votes_missing_7_days.sql ├── test_streamline__complete_block_txs__gaps.sql └── test_streamline__complete_decoded_instructions_2__missing.sql /.env.sample: -------------------------------------------------------------------------------- 1 | ACCOUNT=vna27887.us-east-1 2 | USERNAME= 3 | PASSWORD= 4 | REGION=us-east-1 5 | DATABASE=SOLANA_COMMUNITY_DEV 6 | WAREHOUSE=FLIPSIDE_COMMUNITY_CURATOR 7 | ROLE=FLIPSIDE_COMMUNITY_CURATOR 8 | SCHEMA=SILVER 9 | QUERY_TAG=solana_curator -------------------------------------------------------------------------------- /.github/workflows/dbt_integration_test.yml: -------------------------------------------------------------------------------- 1 | name: dbt_run_integration_test 2 | run-name: ${{ github.event.inputs.branch }} 3 | 4 | on: 5 | workflow_dispatch: 6 | inputs: 7 | environment: 8 | required: true 9 | type: string 10 | 11 | concurrency: ${{ github.workflow }} 12 | 13 | jobs: 14 | prepare_vars: 15 | runs-on: ubuntu-latest 16 | environment: 17 | name: ${{ inputs.environment }} 18 | outputs: 19 | warehouse: ${{ steps.set_outputs.outputs.warehouse }} 20 | steps: 21 | - name: Set warehouse output 22 | id: set_outputs 23 | run: | 24 | echo "warehouse=${{ vars.WAREHOUSE }}" >> $GITHUB_OUTPUT 25 | 26 | called_workflow_template: 27 | needs: prepare_vars 28 | uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt.yml@main 29 | with: 30 | command: > 31 | dbt test --selector 'integration_tests' 32 | environment: ${{ inputs.environment }} 33 | warehouse: ${{ needs.prepare_vars.outputs.warehouse }} 34 | secrets: inherit -------------------------------------------------------------------------------- /.github/workflows/dbt_test_tasks.yml: -------------------------------------------------------------------------------- 1 | name: dbt_test_tasks 2 | run-name: dbt_test_tasks 3 | 4 | on: 5 | workflow_dispatch: 6 | branches: 7 | - "main" 8 | 9 | env: 10 | DBT_PROFILES_DIR: ./ 11 | 12 | ACCOUNT: "${{ vars.ACCOUNT }}" 13 | ROLE: "${{ vars.ROLE }}" 14 | USER: "${{ vars.USER }}" 15 | PASSWORD: "${{ secrets.PASSWORD }}" 16 | REGION: "${{ vars.REGION }}" 17 | DATABASE: "${{ vars.DATABASE }}" 18 | WAREHOUSE: "${{ vars.WAREHOUSE }}" 19 | SCHEMA: "${{ vars.SCHEMA }}" 20 | 21 | concurrency: 22 | group: ${{ github.workflow }} 23 | 24 | jobs: 25 | called_workflow_template: 26 | uses: FlipsideCrypto/analytics-workflow-templates/.github/workflows/dbt_test_tasks.yml@AN-4374/upgrade-dbt-1.7 27 | secrets: inherit 28 | 29 | notify-failure: 30 | needs: [called_workflow_template] 31 | if: failure() 32 | uses: ./.github/workflows/slack_notify.yml 33 | secrets: 34 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} -------------------------------------------------------------------------------- /.github/workflows/slack_notify.yml: -------------------------------------------------------------------------------- 1 | name: Slack Notification 2 | on: 3 | workflow_call: 4 | secrets: 5 | SLACK_WEBHOOK_URL: 6 | required: true 7 | 8 | jobs: 9 | notify: 10 | runs-on: ubuntu-latest 11 | environment: workflow_prod 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v3 15 | 16 | - name: Set up Python 17 | uses: actions/setup-python@v4 18 | with: 19 | python-version: "3.10" 20 | 21 | - name: Install dependencies 22 | run: pip install requests 23 | 24 | - name: Send Slack notification 25 | run: python python/slack_alert.py 26 | env: 27 | SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | target/ 3 | dbt_modules/ 4 | # newer versions of dbt use this directory instead of dbt_modules for test dependencies 5 | dbt_packages/ 6 | logs/ 7 | 8 | .venv/ 9 | .python-version 10 | 11 | # Visual Studio Code files 12 | */.vscode 13 | *.code-workspace 14 | .history/ 15 | **/.DS_Store 16 | .vscode/ 17 | .env 18 | dbt-env/ -------------------------------------------------------------------------------- /.user.yml: -------------------------------------------------------------------------------- 1 | id: a98e72da-488e-4e5a-980b-5c0b59143929 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ghcr.io/dbt-labs/dbt-snowflake:1.2.latest 2 | WORKDIR /support 3 | RUN mkdir /root/.dbt 4 | COPY profiles.yml /root/.dbt 5 | RUN mkdir /root/solana 6 | WORKDIR /solana 7 | COPY . . 8 | EXPOSE 8080 9 | ENTRYPOINT [ "bash"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Flipside Crypto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SHELL := /bin/bash 2 | 3 | dbt-console: 4 | docker-compose run dbt_console 5 | 6 | .PHONY: dbt-console -------------------------------------------------------------------------------- /analysis/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlipsideCrypto/solana-models/ec1f2c24ffe475d4860d373950ce301e667eab7c/analysis/.gitkeep -------------------------------------------------------------------------------- /data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlipsideCrypto/solana-models/ec1f2c24ffe475d4860d373950ce301e667eab7c/data/.gitkeep -------------------------------------------------------------------------------- /data/github_actions__workflows.csv: -------------------------------------------------------------------------------- 1 | workflow_name,workflow_schedule 2 | dbt_run_decode_instructions_orchestrator,"*/5 * * * *" 3 | dbt_run_decode_logs_orchestrator,"*/15 * * * *" 4 | dbt_run_incremental,"16,46 1-3,5-7,9-11,13-15,17-19,21-23 * * *" 5 | dbt_run_incremental_intermediate,"46 */4 * * *" 6 | dbt_run_incremental_non_core,"1 */4 * * *" 7 | dbt_run_incremental_non_core_hourly,"1 1-3,5-7,9-11,13-15,17-19,21-23 * * *" 8 | dbt_run_nft_compressed_mints_realtime,"*/15 * * * *" 9 | dbt_run_nft_compressed_mints_sales_realtime,"55 * * * *" 10 | dbt_run_streamline_blocks,"*/5 * * * *" 11 | dbt_run_streamline_block_rewards,"*/15 * * * *" 12 | dbt_run_streamline_block_txs,"*/6 * * * *" 13 | dbt_run_stage_block_txs,"*/6 * * * *" 14 | dbt_run_streamline_helius_cnft_metadata,"*/10 * * * *" 15 | dbt_run_streamline_solscan_blocks,"7,27,47 * * * *" 16 | dbt_test_tasks,"0,30 * * * *" 17 | dbt_run_streamline_stake_accounts_snapshot,"22 1 * * 6" -------------------------------------------------------------------------------- /data/testing__bridge_mayan_transfers.csv: -------------------------------------------------------------------------------- 1 | tx_id,program_id,direction,user_address,amount,mint 2 | 4qqEcftiXE4ug5dmEPNpqqJ2f82CYTYwmhVJRWTpwftrLxQTwQzGW8D6sWFbR7BxXjKfvuitHPUFJTME6B5cxiE8,8LPjGDbxhW4G2Q8S6FvdvUdfGWssgtqmvsc63bwNFA7E,inbound,9YFeuz8q9WMSJpeNhNHj6LSbZnQ6BvDt5u9CV2ALhPWv,4418582.24475,DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263 3 | 4g5MiEFhfTWpctmWAS5Q435NxZxQWkTNQ22Lj7VVRx9BS6Tbeg8ACq7k25qN2EyUBG5eVFenqcSyFJKQgxFyud2Q,8LPjGDbxhW4G2Q8S6FvdvUdfGWssgtqmvsc63bwNFA7E,inbound,Az6gg8n9w57MSnT7tNeabY9xdAF6mxi94vcJk9MCWvav,0.572620188,So11111111111111111111111111111111111111112 4 | 4AcYHm3GoS7efSHTXfsrPhmwFfeT9QASFraSeJHoJyZA3mpPfWuzeG9eyFKyn8ibW1dfCsuwfr3iFMx4GFTeBWHy,8LPjGDbxhW4G2Q8S6FvdvUdfGWssgtqmvsc63bwNFA7E,outbound,HGDcnZRSNRPLbWaGBsP2Pm7TMhwz2BafoL3UdFtnVvLv,25,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v 5 | -------------------------------------------------------------------------------- /data/testing__nft_sales_coral_cube.csv: -------------------------------------------------------------------------------- 1 | tx_id,purchaser,seller,mint,sales_amount 2 | 3z2bVCGpjTrF5HEeezN46jEmdN34ZAJ2crR5hxJA5AwGWJ6mNdtYuJxc3r24RVCNvKa2qqLQR843dHZAUPXCSb58,2DvdkRLsjx8sy6g5fbJvrcExndSXgxFx1VoWV8iTahQw,2DAF5XRgnt5EAC3t4vWbap6QWyjseAjVFqagRsNpFnr5,H5MhhjoqAtv6YAmyz8E91TbxopMJGYWB6o55rjTi1qVT,0.02303928 3 | 52A5MK1MRryhY7PuX3Q9yWnXAd9WZvzUrUJgyRzKhbsG4UJ3PzBRuw2KiQM7AqwveXtf6jWadEMLfjuvSTzjjynf,2uRG2BSVDBdBP1PZA6Dhde5qqs6eJZfx2jbxA148yY9n,ESBjMYBxbsSidbQxKpY77W1V5Ewht4T1JNjqn9Qw9e7y,XMKDjR3wRYLWHWakMmpWmuWJwCRrvvSTtyUpASeYgcb,0.20203928 -------------------------------------------------------------------------------- /data/testing__nft_sales_hyperspace.csv: -------------------------------------------------------------------------------- 1 | tx_id,purchaser,seller,mint,sales_amount 2 | 4dVZSdzGgRdJxM4j3JVwwo5t9sxZEB5SkcMU5tWe7dsnZKJvthwy2jHwxmhwApR2QFgD6h9DSc2nTt2JpziGDLKM,6JP6yRoBPYWzhUwvDAq4yND6Aq2kUhPvn5ciLxkUiRzz,EDx5p5oauVsC71FVdy9gqScmD5EbNUcfA744tzMweLs2,DnmmanrQ5WTzuWV9zZcrunNAwcToqKBE3arKwL4k5fhx,0.01 3 | 3qRyNqFzkSKSf4cB43nfMS8VTSvMGe4zkG2jFF7Azhhxrw4HqimseHN7w6ox1G87yrr4ruaAjK6838eL7oAJiy7s,DBho2RcnzkxLyVTeAhWPbFjX7tQqoat29ipHG8hzUEGA,G5cCsPPf6mqFqzV4WKk8uEocMs73KZoUWkPKN5BcC6Qx,39EQ7EQPNadkqxT4WCUv7NEBjgTTREpeTuS7ijCHCGTQ,8.15 -------------------------------------------------------------------------------- /data/testing__nft_sales_solsniper.csv: -------------------------------------------------------------------------------- 1 | tx_id,purchaser,seller,mint,sales_amount 2 | 4PvnivhKKYjwXmQrTHo2E3xAnaajNkLpFvH4ZpbJvEE7RsmgGZ7pmPwoBoSwbyAFfrkMNHHUDiLbmkzoz3FUPv41,6e3LxX21vhhPx9rkBQnZ6VFnf15NoXPCUuJMP9XrzZQy,A42sG3sKAYCWQJokBq5A1ZYdHjmzpr9whHvQ9gXKP8nW,5MKTQzs5ey4ZivtPgniYBE3WNPuzXBWzaXXbjC1R5amG,0.013 3 | 3r2HhjQJSC2BbGrxR3QvAxWiEz5ypnbGmxtMkEfDvv2ZYs6177uMeCS4DZqKN4VBs4Kn2p2AGBNdtSDw2vXbMYgH,9rPC8qp7vzTVBbUA9Khh3Hiig4oQChRraEJEYXQMwrQg,3hbssdZztFHNxGdNhqmhUkn8HkRXv8E6UBS6qmRDbnKz,AkGDLvhV2SMZ5qe1JVoYnp8RGfgdYS1vwPsuysvUXxP1,0.1111 4 | -------------------------------------------------------------------------------- /data/testing__nft_sales_solsniper_v1_events.csv: -------------------------------------------------------------------------------- 1 | tx_id,purchaser,seller,mint,sales_amount 2 | 2xBQgZdJ97wtAta6Ru7J2zn65YQJMc36nh8bDqAcuKA9x7EscBm5QDfo6g4DPBbSGGN67gGmFkLQZtTVkSZWHDb,2eB7soMqQdSmUVGxP7hyzAZaT3P3F2fjqZSqtgT5Yy4w,FNBb12zch5XdYXy2ahYHWopbmDat9HmQYdJTiuB9qXLF,5QuiyuGr5qDLGXeggan9gybirnRBMswweygBFMtjmMjP,0.1468825 3 | 2Ebi5XwpsUhcoFveoenc9SSkCDibsyAqR2ZqxwUGefZq7cCf6ouhDdBWMWLssj2t69R6hmLJXg8sUjqzT2opXURo,26wmwTQnyG9mKgfRowUYoYXwZujhFJ6YjE5VB2HweyqG,Gkngxrgn3UemyyTBXoxgqHLuQk5TRFrnrAQJDZkYvAUZ,4i2boE1zgGU3gVDZxdNt76MK3NUy9Ua7QD9DJkC8TV4P,0.0385 4 | 3Ybf7TeVmSAvfXGJTuTa7oZpd5ohHW7YgZ1AtS1LGjMKAS68rNUmAAJtD4nNYqGy7V5QPpyB2ZGNvALsDpEmS5JR,D2wko4M68sNgKK82UJkT2eA6U6YMHjsrWPHwCpgDEufU,7mPs4ApQNvMKB5GczGAfUL3SvkbkKB6WRmpJ8bvgKwsb,45u5M3VNFKdsk1vn9hrTbxP1jF2oMjGxPgBZxyKRraaF,2.436075 5 | R61rsLJ5EXfXW5kkcukjAUKTMeMrr9qZhwtmpcQfx9eXJe5CRPPKoW7wh7HSUnW2r34JQobMKvoPSzKD2JY41D9,FzdLkwyjQDhzMo4FPnXXjVLoJHH7TgZLu3Syyrv3mekE,F4T7B6jjNgRNudhA57WaQKna2aam626dZjNDbe1mMAy3,Gygeawu4KAZAeZQUhMBFXb2BnMezoUi3eS4tvbsSdGwU,0.2335825 -------------------------------------------------------------------------------- /data/testing__nft_sales_tensorswap_cnft.csv: -------------------------------------------------------------------------------- 1 | tx_id,purchaser,seller,mint,sales_amount 2 | 2T4LVBT6wUiW3VbTBoMg6ry8BmT7GzrhQeeaKUKjnn9XRzgGNrEzYviTUv1FQgW4FCoN2r9o7sNxQeyqLb52AjPj,FYz5ZqtKkRGAFaodArkcUwmtGDhdbowgFU4q7SXc3Mie,GxwR9kYzDJDmxqbsPhnGBwUvK4i29EcMbEm2tomNcDLj,2L2iNR4q4efKsPs58udXfvnNA1SHeWNvbroU1GMNvYLB,4.892198498 3 | 3km8gnunyq2qTuPongzqwGdWGKGDEXTmbnusYbAAieUSwNpxBprQRM6XkzGhgbWkn6sBj3TLcBZHk8ihRfYgk57N,8uTruHG5hyhezmiNPVP4E4KRhZZPjadpSV7TLLqfMiGH,7fFCQtH44BazcoQCFGveQUBawfmu8ZsEJoacxFsBqYxy,2mFHWsqZSWfXUDPxDvCJdwm1NW2uH1uecc4FcSnnRkzC,7.55548 4 | 3asER9bSgki7Xod7m6d7bsYg3h4h8QaLsCdWdV4eA4QznndjEULtfQDVSebcAgsCsCjJHpmn7e4sPWFdtRD33p9d,4LcLBr9q7SuVvEeFCRtEdetdcHVP47jWL9HafGo4sdMp,GxkZwiNkML9qQfHV44jug8T1sRrNw8iEPr979FZvThnu,4u4HDDr5A9JsaK6728s9k9cTx3g2iTHjqDSkrbBbS9eQ,5.42 -------------------------------------------------------------------------------- /data/testing__swaps_intermediate_raydium_cpmm.csv: -------------------------------------------------------------------------------- 1 | tx_id,swapper,swap_from_amount,swap_from_mint,swap_to_amount,swap_to_mint,swap_index 2 | 3o7EsrU2JaxUGcdDzLEUXAptsaq9M2xeub6RJMcXZ1zfEmsNs4QzLGFD64j3L3KpMgq7y43VrxwL2ZxRZd1tx5S5,5JGSn76EcwF1dkiF213iptW5AaKQwYnnY6WKaTbv7eyE,0.001343562,So11111111111111111111111111111111111111112,6501189.665,HECZgs7unJtJ2626a1FV4BnmVr5BphuZWobVavdmpYnY,1 3 | 5c8f2zz7WVULKouc4U9jmikkmnY1C9eFMBRvAb3wD7JB1uckLdNGmWF2tv8ZJhzEUKHiAmkzQR25YhqMbT6fy4NT,8ZnvqGzD8AeJ158k4bMYNkbELn35x6uWoZZogGHArpeQ,1.0031e-05,So11111111111111111111111111111111111111112,0.001231,3Ae4HCpJqYdDSY4eHsSZyYhwp1zy2oerk5CFpV26eaMx,1 -------------------------------------------------------------------------------- /data/testing__swaps_intermediate_raydium_stable.csv: -------------------------------------------------------------------------------- 1 | tx_id,swapper,from_amt,from_mint,to_amt,to_mint,swap_index 2 | 31JsUv3c9J5FMFJgxrBTeXghAVK3qnAKEjCBrZTXXjXvgxh6LUCc1yRuoNDXXDyywxwvcKxKGMaQh3GCsGLnAFAo,D7fbzwdBxdn3yNqTDZs4PJLnXnBDMcQT6RmmgBNdYVaW,3.659271,USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX,3.509682,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v,1 3 | 4hCaNMB42Gg1YedK91GzZKpJS25sGpgB2sri8vatLn6S4WUU3MKCANTXepsBPjPewzjhefeTUFKG36BTr8y7hweh,HU58ZPNjL7TZUhbAgz7zWxdUxh7zG9yUgvdeENaovuFP,254.532412,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v,254.535243,Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB,1 -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.4" 2 | 3 | services: 4 | dbt_console: 5 | build: . 6 | volumes: 7 | - .:/solana 8 | env_file: 9 | - .env 10 | -------------------------------------------------------------------------------- /macros/create_sps.sql: -------------------------------------------------------------------------------- 1 | {% macro create_sps() %} 2 | {% if var("UPDATE_UDFS_AND_SPS") %} 3 | {% if target.database == 'SOLANA' %} 4 | CREATE SCHEMA IF NOT EXISTS _internal; 5 | {{ sp_create_prod_clone('_internal') }}; 6 | {% endif %} 7 | {% endif %} 8 | {% endmacro %} 9 | 10 | {% macro enable_search_optimization(schema_name, table_name, condition = '') %} 11 | {% if target.database == 'SOLANA' %} 12 | ALTER TABLE {{ schema_name }}.{{ table_name }} ADD SEARCH OPTIMIZATION {{ condition }} 13 | {% endif %} 14 | {% endmacro %} -------------------------------------------------------------------------------- /macros/custom_naming_macros.sql: -------------------------------------------------------------------------------- 1 | {% macro generate_schema_name( 2 | custom_schema_name = none, 3 | node = none 4 | ) -%} 5 | {% set node_name = node.name %} 6 | {% set split_name = node_name.split('__') %} 7 | {{ split_name [0] | trim }} 8 | {%- endmacro %} 9 | 10 | {% macro generate_alias_name( 11 | custom_alias_name = none, 12 | node = none 13 | ) -%} 14 | {% set node_name = node.name %} 15 | {% set split_name = node_name.split('__') %} 16 | {{ split_name [1] | trim }} 17 | {%- endmacro %} 18 | 19 | {% macro generate_tmp_view_name(model_name) -%} 20 | {% set node_name = model_name.name %} 21 | {% set split_name = node_name.split('__') %} 22 | {{ target.database ~ '.' ~ split_name[0] ~ '.' ~ split_name [1] ~ '__dbt_tmp' | trim }} 23 | {%- endmacro %} 24 | 25 | {% macro generate_view_name(model_name) -%} 26 | {% set node_name = model_name.name %} 27 | {% set split_name = node_name.split('__') %} 28 | {{ target.database ~ '.' ~ split_name[0] ~ '.' ~ split_name [1] | trim }} 29 | {%- endmacro %} -------------------------------------------------------------------------------- /macros/dbt/get_tmp_relation_type.sql: -------------------------------------------------------------------------------- 1 | {% macro dbt_snowflake_get_tmp_relation_type(strategy, unique_key, language) %} 2 | -- always table 3 | {{ return('table') }} 4 | {% endmacro %} -------------------------------------------------------------------------------- /macros/run_sp_create_prod_clone.sql: -------------------------------------------------------------------------------- 1 | {% macro run_sp_create_prod_clone() %} 2 | {% set clone_query %} 3 | call solana._internal.create_prod_clone('solana', 'solana_dev', 'internal_dev'); 4 | {% endset %} 5 | 6 | {% do run_query(clone_query) %} 7 | {% endmacro %} -------------------------------------------------------------------------------- /macros/run_sp_create_prod_community_clone.sql: -------------------------------------------------------------------------------- 1 | {% macro run_sp_create_prod_community_clone() %} 2 | {% set clone_query %} 3 | call solana._internal.create_prod_clone('solana', 'solana_community_dev', 'flipside_community_curator'); 4 | {% endset %} 5 | 6 | {% do run_query(clone_query) %} 7 | 8 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/bulk_get_decoded_instructions_data.sql/sp_create_bulk_get_decoded_instructions_data.sql: -------------------------------------------------------------------------------- 1 | {% macro sp_create_bulk_get_decoded_instructions_data() %} 2 | {% if var("UPDATE_UDFS_AND_SPS") %} 3 | {% set sql %} 4 | CREATE OR REPLACE PROCEDURE silver.sp_bulk_get_decoded_instructions_data() 5 | RETURNS variant 6 | LANGUAGE SQL 7 | AS 8 | $$ 9 | DECLARE 10 | RESULT VARCHAR; 11 | row_cnt INTEGER; 12 | BEGIN 13 | row_cnt:= ( 14 | SELECT 15 | COUNT(1) 16 | FROM 17 | silver._all_undecoded_instructions_data 18 | ); 19 | if ( 20 | row_cnt > 0 21 | ) THEN RESULT:= ( 22 | SELECT 23 | silver.udf_bulk_get_decoded_instructions_data() 24 | ); 25 | ELSE RESULT:= NULL; 26 | END if; 27 | RETURN RESULT; 28 | END; 29 | $${% endset %} 30 | {% do run_query(sql) %} 31 | {% endif %} 32 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/bulk_get_decoded_instructions_data.sql/udf_bulk_get_decoded_instructions_data.sql: -------------------------------------------------------------------------------- 1 | {% macro udf_bulk_get_decoded_instructions_data() %} 2 | CREATE 3 | OR REPLACE EXTERNAL FUNCTION silver.udf_bulk_get_decoded_instructions_data() returns text api_integration = aws_solana_api_dev AS {% if target.database == 'SOLANA' -%} 4 | 'https://pj4rqb8z96.execute-api.us-east-1.amazonaws.com/prod/bulk_decode_instruction_arguments' 5 | {% else %} 6 | 'https://11zlwk4fm3.execute-api.us-east-1.amazonaws.com/dev/bulk_decode_instruction_arguments' 7 | {%- endif %} 8 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/bulk_get_solscan_blocks/udf_bulk_get_solscan_blocks.sql: -------------------------------------------------------------------------------- 1 | {% macro udf_bulk_get_solscan_blocks() %} 2 | CREATE 3 | OR REPLACE EXTERNAL FUNCTION streamline.udf_bulk_get_solscan_blocks(url string, endpoint string, headers object, block_ids ARRAY) returns VARIANT api_integration = aws_solana_api_dev AS {% if target.database == 'SOLANA' -%} 4 | 'https://pj4rqb8z96.execute-api.us-east-1.amazonaws.com/prod/bulk_get_solscan_blocks' 5 | {% else %} 6 | 'https://11zlwk4fm3.execute-api.us-east-1.amazonaws.com/dev/bulk_get_solscan_blocks' 7 | {%- endif %} 8 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/bulk_parse_compressed_nft_mints/udf_bulk_parse_compressed_nft_mints.sql: -------------------------------------------------------------------------------- 1 | {% macro udf_bulk_parse_compressed_nft_mints() %} 2 | CREATE 3 | OR REPLACE EXTERNAL FUNCTION streamline.udf_bulk_parse_compressed_nft_mints("JSON" ARRAY) 4 | returns ARRAY 5 | api_integration = aws_solana_api_dev 6 | max_batch_rows = 1 7 | AS {% if target.database == 'SOLANA' -%} 8 | 'https://cpzzn7ohu0.execute-api.us-east-1.amazonaws.com/prod/parse' 9 | {% else %} 10 | 'https://rd7pddtgl9.execute-api.us-east-1.amazonaws.com/dev/parse' 11 | {%- endif %} 12 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/bulk_program_parser/run_sp_clean_program_parser_historical_queue.sql: -------------------------------------------------------------------------------- 1 | {% macro run_sp_clean_program_parser_historical_queue() %} 2 | {% set sql %} 3 | call streamline.sp_clean_program_parser_historical_queue(); 4 | {% endset %} 5 | 6 | {% do run_query(sql) %} 7 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/bulk_program_parser/run_sp_program_parser.sql: -------------------------------------------------------------------------------- 1 | {% macro run_sp_udf_bulk_program_parser() %} 2 | {% set sql %} 3 | call silver.sp_udf_bulk_program_parser(); 4 | {% endset %} 5 | 6 | {% do run_query(sql) %} 7 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/bulk_program_parser/sp_create_program_parser.sql: -------------------------------------------------------------------------------- 1 | {% macro sp_create_udf_bulk_program_parser() %} 2 | {% if var("UPDATE_UDFS_AND_SPS") %} 3 | {% set sql %} 4 | CREATE OR REPLACE PROCEDURE silver.sp_udf_bulk_program_parser() 5 | RETURNS variant 6 | LANGUAGE SQL 7 | AS 8 | $$ 9 | DECLARE 10 | RESULT VARCHAR; 11 | BEGIN 12 | RESULT:= ( 13 | SELECT 14 | streamline.udf_bulk_program_parser(object_construct('realtime', 'False')) 15 | ); 16 | RETURN RESULT; 17 | END; 18 | $${% endset %} 19 | {% do run_query(sql) %} 20 | {% endif %} 21 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/bulk_program_parser/udf_program_parser.sql: -------------------------------------------------------------------------------- 1 | {% macro udf_bulk_program_parser() %} 2 | CREATE 3 | OR REPLACE EXTERNAL FUNCTION streamline.udf_bulk_program_parser("JSON" OBJECT) returns ARRAY api_integration = aws_solana_api_dev AS {% if target.database == 'SOLANA' -%} 4 | 'https://pj4rqb8z96.execute-api.us-east-1.amazonaws.com/prod/bulk_program_parser' 5 | {% else %} 6 | 'https://89kf6gtxr0.execute-api.us-east-1.amazonaws.com/dev/bulk_program_parser' 7 | {%- endif %} 8 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/decode_instructions/udf_decode_instructions.sql: -------------------------------------------------------------------------------- 1 | {% macro udf_decode_instructions() %} 2 | CREATE 3 | OR REPLACE EXTERNAL FUNCTION streamline.udf_decode_instructions("JSON" ARRAY) returns VARIANT api_integration = aws_solana_api_dev AS {% if target.database == 'SOLANA' -%} 4 | 'https://pj4rqb8z96.execute-api.us-east-1.amazonaws.com/prod/decode_instructions' 5 | {% else %} 6 | 'https://89kf6gtxr0.execute-api.us-east-1.amazonaws.com/dev/decode_instructions' 7 | {%- endif %} 8 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/run_sp_refresh_external_tables_full.sql: -------------------------------------------------------------------------------- 1 | {% macro run_sp_refresh_external_tables_full() %} 2 | {% set sql %} 3 | call streamline.sp_refresh_external_tables_full(); 4 | {% endset %} 5 | 6 | {% do run_query(sql) %} 7 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/snapshot_get_stake_accounts/run_sp_snapshot_get_stake_accounts.sql: -------------------------------------------------------------------------------- 1 | {% macro run_sp_snapshot_get_stake_accounts() %} 2 | {% set sql %} 3 | call silver.sp_snapshot_get_stake_accounts(); 4 | {% endset %} 5 | 6 | {% do run_query(sql) %} 7 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/snapshot_get_stake_accounts/sp_create_snapshot_get_stake_accounts.sql: -------------------------------------------------------------------------------- 1 | {% macro sp_create_snapshot_get_stake_accounts() %} 2 | {% if var("UPDATE_UDFS_AND_SPS") %} 3 | {% set sql %} 4 | CREATE OR REPLACE PROCEDURE silver.sp_snapshot_get_stake_accounts() 5 | RETURNS variant 6 | LANGUAGE SQL 7 | AS 8 | $$ 9 | DECLARE 10 | RESULT VARCHAR; 11 | BEGIN 12 | RESULT:= ( 13 | SELECT 14 | silver.udf_snapshot_get_stake_accounts() 15 | ); 16 | RETURN RESULT; 17 | END; 18 | $${% endset %} 19 | {% do run_query(sql) %} 20 | {% endif %} 21 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/snapshot_get_stake_accounts/udf_snapshot_get_stake_accounts.sql: -------------------------------------------------------------------------------- 1 | {% macro udf_snapshot_get_stake_accounts() %} 2 | CREATE 3 | OR REPLACE EXTERNAL FUNCTION silver.udf_snapshot_get_stake_accounts() returns text api_integration = aws_solana_api_dev AS {% if target.database == 'SOLANA' -%} 4 | 'https://pj4rqb8z96.execute-api.us-east-1.amazonaws.com/prod/bulk_snapshot_get_stake_program_accounts' 5 | {% else %} 6 | 'https://11zlwk4fm3.execute-api.us-east-1.amazonaws.com/dev/bulk_snapshot_get_stake_program_accounts' 7 | {%- endif %} 8 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/sp_refresh_external_table_batch.sql: -------------------------------------------------------------------------------- 1 | {% macro sp_refresh_external_table_batch() %} 2 | {% set sql %} 3 | create or replace procedure streamline.refresh_external_table_next_batch(external_table_name string, streamline_table_name string) 4 | returns string 5 | language sql 6 | execute as caller 7 | as 8 | $$ 9 | declare 10 | path string; 11 | select_stmt string; 12 | refresh_stmt string; 13 | res resultset; 14 | begin 15 | select_stmt := 'select concat(\'batch=\',coalesce(max(_partition_id),0)+1,\'/\') as path from streamline.' || :streamline_table_name; 16 | res := (execute immediate :select_stmt); 17 | let c1 cursor for res; 18 | for row_variable in c1 do 19 | path := row_variable.path; 20 | end for; 21 | refresh_stmt := 'alter external table streamline.{{ target.database }}.' || :external_table_name || ' refresh \'' || :PATH || '\''; 22 | res := (execute immediate :refresh_stmt); 23 | return 'table refreshed with ' || :refresh_stmt; 24 | end; 25 | $${% endset %} 26 | {% do run_query(sql) %} 27 | {% endmacro %} -------------------------------------------------------------------------------- /macros/streamline/sp_refresh_external_tables_full.sql: -------------------------------------------------------------------------------- 1 | {% macro sp_refresh_external_tables_full() %} 2 | {% set sql %} 3 | create or replace procedure streamline.sp_refresh_external_tables_full() 4 | returns boolean 5 | language sql 6 | execute as caller 7 | as 8 | $$ 9 | begin 10 | alter external table streamline.{{ target.database }}.decoded_instructions_data_api refresh; 11 | alter external table streamline.{{ target.database }}.validator_metadata_api refresh; 12 | alter external table streamline.{{ target.database }}.validator_vote_accounts refresh; 13 | alter external table streamline.{{ target.database }}.validators_app_list_api refresh; 14 | alter external table streamline.{{ target.database }}.stake_program_accounts refresh; 15 | alter external table streamline.{{ target.database }}.validator_vote_program_accounts refresh; 16 | return TRUE; 17 | end; 18 | $${% endset %} 19 | {% do run_query(sql) %} 20 | {% endmacro %} -------------------------------------------------------------------------------- /macros/tags/add_database_or_schema_tags.sql: -------------------------------------------------------------------------------- 1 | {% macro add_database_or_schema_tags() %} 2 | {{ set_database_tag_value('BLOCKCHAIN_NAME','SOLANA') }} 3 | {% endmacro %} -------------------------------------------------------------------------------- /macros/tests/compare_model_subset.sql: -------------------------------------------------------------------------------- 1 | {% test compare_model_subset(model, compare_model, compare_columns, model_condition) %} 2 | 3 | {% set compare_cols_csv = compare_columns | join(', ') %} 4 | 5 | with a as ( 6 | select {{compare_cols_csv}} from {{ model }} 7 | {{ model_condition }} 8 | ), 9 | b as ( 10 | select {{compare_cols_csv}} from {{ compare_model }} 11 | ), 12 | a_minus_b as ( 13 | select * from a 14 | except 15 | select * from b 16 | ), 17 | b_minus_a as ( 18 | select * from b 19 | except 20 | select * from a 21 | ), 22 | unioned as ( 23 | select 'in_actual_not_in_expected' as which_diff, a_minus_b.* from a_minus_b 24 | union all 25 | select 'in_expected_not_in_actual' as which_diff, b_minus_a.* from b_minus_a 26 | ) 27 | select * from unioned 28 | 29 | {% endtest %} -------------------------------------------------------------------------------- /macros/tests/null_threshold.sql: -------------------------------------------------------------------------------- 1 | {% test null_threshold( 2 | model, 3 | column_name, 4 | threshold_percent 5 | ) %} 6 | -- threshold_percent: decimal representing percent of values that should NOT be null 7 | WITH t AS ( 8 | SELECT 9 | COUNT(*) * {{ threshold_percent }} AS threshold_num 10 | FROM 11 | {{ model }} 12 | ), 13 | C AS ( 14 | SELECT 15 | COUNT(*) AS cnt 16 | FROM 17 | {{ model }} 18 | WHERE 19 | {{ column_name }} IS NOT NULL 20 | ) 21 | SELECT 22 | * 23 | FROM 24 | C 25 | WHERE 26 | C.cnt <= ( 27 | SELECT 28 | MAX(threshold_num) 29 | FROM 30 | t 31 | ) 32 | {% endtest %} 33 | -------------------------------------------------------------------------------- /macros/tests/reference_tx_missing.sql: -------------------------------------------------------------------------------- 1 | {% test reference_tx_missing(model, reference_tables, id_column='tx_id') %} 2 | {% set failures %} 3 | SELECT 4 | reference_table_name, 5 | {{ id_column }} AS missing_tx_id 6 | FROM ( 7 | {% for reference_table in reference_tables %} 8 | SELECT 9 | '{{ reference_table }}' AS reference_table_name, 10 | {{ id_column }} 11 | FROM {{ ref(reference_table) }} 12 | WHERE {{ id_column }} NOT IN (SELECT {{ id_column }} FROM {{ model }} where modified_timestamp >= current_date - 7) 13 | AND _inserted_timestamp between current_date - 7 and current_timestamp() - INTERVAL '1 HOUR' 14 | {% if not loop.last %} UNION ALL {% endif %} 15 | {% endfor %} 16 | ) missing_tx_ids 17 | {% endset %} 18 | 19 | SELECT * 20 | FROM ({{ failures }}) 21 | {% endtest %} 22 | 23 | -------------------------------------------------------------------------------- /macros/tests/tx_excluded.sql: -------------------------------------------------------------------------------- 1 | {% test tx_excluded( 2 | model, 3 | excluded_tx_ids 4 | ) %} 5 | 6 | SELECT 7 | * 8 | FROM 9 | {{ model }} 10 | WHERE 11 | tx_id IN( 12 | {{ "'" + excluded_tx_ids | join("','") + "'"}} 13 | ) 14 | {% endtest %} 15 | -------------------------------------------------------------------------------- /models/bronze/bronze__block_rewards.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | value, 7 | _partition_id, 8 | metadata, 9 | block_id, 10 | data, 11 | error, 12 | TO_TIMESTAMP_NTZ( 13 | SUBSTR(SPLIT_PART(metadata$filename, '/', 4), 1, 10) :: NUMBER, 14 | 0 15 | ) as _inserted_timestamp 16 | FROM 17 | {{ source( 18 | 'bronze_streamline', 19 | 'block_rewards_api' 20 | )}} -------------------------------------------------------------------------------- /models/bronze/bronze__blocks.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view', 3 | enabled = false, 4 | ) }} 5 | 6 | SELECT 7 | record_id, 8 | offset_id AS block_id, 9 | block_id AS offset_id, 10 | block_timestamp, 11 | network, 12 | chain_id, 13 | tx_count, 14 | header, 15 | ingested_at, 16 | _inserted_timestamp 17 | FROM 18 | {{ source( 19 | 'prod', 20 | 'solana_blocks' 21 | ) }} -------------------------------------------------------------------------------- /models/bronze/bronze__blocks2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | value, 7 | _inserted_date, 8 | metadata, 9 | block_id, 10 | data, 11 | error, 12 | TO_TIMESTAMP_NTZ( 13 | SUBSTR(SPLIT_PART(metadata$filename, '/', 4), 1, 10) :: NUMBER, 14 | 0 15 | ) as _inserted_timestamp 16 | FROM 17 | {{ source( 18 | 'bronze_streamline', 19 | 'blocks_api' 20 | )}} -------------------------------------------------------------------------------- /models/bronze/bronze__stake_program_accounts.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | $1 as json_data, 7 | TO_TIMESTAMP_NTZ( 8 | SUBSTR(SPLIT_PART(METADATA$FILENAME, '/', 3), 1, 10) :: NUMBER, 9 | 0 10 | ) as _inserted_timestamp 11 | FROM 12 | {{ source( 13 | 'bronze_streamline', 14 | 'stake_program_accounts' 15 | )}} -------------------------------------------------------------------------------- /models/bronze/bronze__transactions.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view', 3 | enabled = false, 4 | ) }} 5 | 6 | SELECT 7 | record_id, 8 | tx_id, 9 | tx_block_index, 10 | offset_id AS block_id, 11 | block_id AS offset_id, 12 | block_timestamp, 13 | network, 14 | chain_id, 15 | tx, 16 | ingested_at, 17 | _inserted_timestamp 18 | FROM 19 | {{ source( 20 | 'prod', 21 | 'solana_txs' 22 | ) }} -------------------------------------------------------------------------------- /models/bronze/bronze__transactions2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | value, 7 | _partition_id, 8 | metadata, 9 | block_id, 10 | tx_id, 11 | data, 12 | error, 13 | TO_TIMESTAMP_NTZ( 14 | SUBSTR(SPLIT_PART(metadata$filename, '/', 4), 1, 10) :: NUMBER, 15 | 0 16 | ) as _inserted_timestamp 17 | FROM 18 | {{ source( 19 | 'bronze_streamline', 20 | 'block_txs_api' 21 | )}} -------------------------------------------------------------------------------- /models/bronze/bronze__validators_app_api.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | $1 as json_data, 7 | TO_TIMESTAMP_NTZ( 8 | SUBSTR(SPLIT_PART(METADATA$FILENAME, '/', 3), 1, 10) :: NUMBER, 9 | 0 10 | ) as _inserted_timestamp 11 | FROM 12 | {{ source( 13 | 'bronze_streamline', 14 | 'validators_app_list_api' 15 | )}} -------------------------------------------------------------------------------- /models/bronze/bronze__vote_accounts.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | $1 as json_data, 7 | TO_TIMESTAMP_NTZ( 8 | SUBSTR(SPLIT_PART(METADATA$FILENAME, '/', 3), 1, 10) :: NUMBER, 9 | 0 10 | ) as _inserted_timestamp 11 | FROM 12 | {{ source( 13 | 'bronze_streamline', 14 | 'validator_vote_program_accounts' 15 | )}} -------------------------------------------------------------------------------- /models/bronze/bronze__vote_accounts_extended_stats.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | $1 as json_data, 7 | TO_TIMESTAMP_NTZ( 8 | SUBSTR(SPLIT_PART(METADATA$FILENAME, '/', 3), 1, 10) :: NUMBER, 9 | 0 10 | ) as _inserted_timestamp 11 | FROM 12 | {{ source( 13 | 'bronze_streamline', 14 | 'validator_vote_accounts' 15 | )}} -------------------------------------------------------------------------------- /models/bronze/labels/bronze__date_hours.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | * 7 | FROM 8 | {{ source( 9 | 'crosschain', 10 | 'dim_date_hours' 11 | ) }} -------------------------------------------------------------------------------- /models/bronze/labels/bronze__labels.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | system_created_at, 7 | insert_date, 8 | blockchain, 9 | address, 10 | creator, 11 | label_type, 12 | label_subtype, 13 | address_name, 14 | project_name, 15 | _is_deleted, 16 | modified_timestamp, 17 | labels_combined_id 18 | FROM 19 | {{ source( 20 | 'crosschain_silver', 21 | 'labels_combined' 22 | ) }} 23 | WHERE 24 | blockchain = 'solana' 25 | -------------------------------------------------------------------------------- /models/bronze/prices/bronze__complete_native_asset_metadata.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | asset_id, 7 | symbol, 8 | NAME, 9 | decimals, 10 | blockchain, 11 | is_deprecated, 12 | provider, 13 | source, 14 | _inserted_timestamp, 15 | inserted_timestamp, 16 | modified_timestamp, 17 | complete_native_asset_metadata_id, 18 | _invocation_id 19 | FROM 20 | {{ source( 21 | 'crosschain_silver', 22 | 'complete_native_asset_metadata' 23 | ) }} 24 | WHERE 25 | blockchain = 'solana' 26 | AND symbol = 'SOL' 27 | -------------------------------------------------------------------------------- /models/bronze/prices/bronze__complete_native_prices.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | HOUR, 7 | asset_id, 8 | symbol, 9 | NAME, 10 | decimals, 11 | price, 12 | blockchain, 13 | is_imputed, 14 | is_deprecated, 15 | provider, 16 | source, 17 | _inserted_timestamp, 18 | inserted_timestamp, 19 | modified_timestamp, 20 | complete_native_prices_id, 21 | _invocation_id 22 | FROM 23 | {{ source( 24 | 'crosschain_silver', 25 | 'complete_native_prices' 26 | ) }} 27 | WHERE 28 | blockchain = 'solana' 29 | AND symbol = 'SOL' 30 | -------------------------------------------------------------------------------- /models/bronze/prices/bronze__complete_provider_asset_metadata.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | asset_id, 7 | token_address, 8 | NAME, 9 | symbol, 10 | platform, 11 | platform_id, 12 | provider, 13 | source, 14 | _inserted_timestamp, 15 | inserted_timestamp, 16 | modified_timestamp, 17 | complete_provider_asset_metadata_id, 18 | _invocation_id 19 | FROM 20 | {{ source( 21 | 'crosschain_silver', 22 | 'complete_provider_asset_metadata' 23 | ) }} 24 | WHERE 25 | platform IN ( 26 | 'solana', 27 | 'Solana' 28 | ) 29 | -- platforms specific to Solana -------------------------------------------------------------------------------- /models/bronze/prices/bronze__complete_provider_prices.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | asset_id, 7 | recorded_hour, 8 | OPEN, 9 | high, 10 | low, 11 | CLOSE, 12 | provider, 13 | source, 14 | _inserted_timestamp, 15 | inserted_timestamp, 16 | modified_timestamp, 17 | complete_provider_prices_id, 18 | _invocation_id 19 | FROM 20 | {{ source( 21 | 'crosschain_silver', 22 | 'complete_provider_prices' 23 | ) }} 24 | -- prices for all ids -------------------------------------------------------------------------------- /models/bronze/prices/bronze__complete_token_asset_metadata.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | token_address, 7 | asset_id, 8 | symbol, 9 | NAME, 10 | decimals, 11 | blockchain, 12 | blockchain_name, 13 | blockchain_id, 14 | is_deprecated, 15 | provider, 16 | source, 17 | _inserted_timestamp, 18 | inserted_timestamp, 19 | modified_timestamp, 20 | complete_token_asset_metadata_id, 21 | _invocation_id 22 | FROM 23 | {{ source( 24 | 'crosschain_silver', 25 | 'complete_token_asset_metadata' 26 | ) }} 27 | WHERE 28 | blockchain = 'solana' -------------------------------------------------------------------------------- /models/bronze/prices/bronze__complete_token_prices.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | HOUR, 7 | token_address, 8 | asset_id, 9 | symbol, 10 | NAME, 11 | decimals, 12 | price, 13 | blockchain, 14 | blockchain_name, 15 | blockchain_id, 16 | is_imputed, 17 | is_deprecated, 18 | is_verified, 19 | provider, 20 | source, 21 | _inserted_timestamp, 22 | inserted_timestamp, 23 | modified_timestamp, 24 | complete_token_prices_id, 25 | _invocation_id 26 | FROM 27 | {{ source( 28 | 'crosschain_silver', 29 | 'complete_token_prices' 30 | ) }} 31 | WHERE 32 | blockchain = 'solana' 33 | -------------------------------------------------------------------------------- /models/bronze/stage/bronze__stage_block_txs_2.sql: -------------------------------------------------------------------------------- 1 | {{ 2 | config( 3 | materialized = 'incremental', 4 | cluster_by = '_partition_id', 5 | post_hook = ['DELETE FROM {{ this }} WHERE _partition_id < (SELECT max(_partition_id)-1680 FROM {{ this }})'], 6 | full_refresh = false, 7 | ) 8 | }} 9 | 10 | SELECT 11 | to_timestamp_ntz(t.value:"result.blockTime"::int) AS block_timestamp, 12 | t.block_id, 13 | t.value:array_index::int AS tx_index, 14 | t.data, 15 | t._partition_id, 16 | t._inserted_timestamp 17 | FROM 18 | {{ ref('bronze__streamline_block_txs_2') }} AS t 19 | WHERE 20 | {% if is_incremental() %} 21 | _partition_id >= (SELECT max(_partition_id) FROM {{ this }}) 22 | AND _inserted_timestamp >= (SELECT max(_inserted_timestamp) FROM {{ this }}) 23 | {% else %} 24 | _partition_id = (SELECT max(_partition_id) FROM {{ source('solana_streamline', 'complete_block_txs_2') }}) -- Reference this once to get a starting point 25 | {% endif %} 26 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_block_rewards_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "block_rewards_2" %} 6 | {{ streamline_external_table_FR_query_v2( 7 | model, 8 | partition_function = "to_number(split_part(split_part(split_part(file_name,'/',3),'=',2),'_',1))", 9 | partition_name = "_partition_id", 10 | unique_key = "block_id", 11 | other_cols="error" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_block_tx_index_backfill.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "block_txs_index_backfill" %} 6 | {{ streamline_external_table_FR_query_v2( 7 | model, 8 | partition_function = "to_timestamp_ntz(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD_HH24_MI')", 9 | partition_name = "_partition_by_created_timestamp", 10 | unique_key = "block_id", 11 | other_cols="" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_block_txs_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "block_txs_2" %} 6 | {{ streamline_external_table_FR_query_v2( 7 | model, 8 | partition_function = "to_number(split_part(split_part(split_part(file_name,'/',3),'=',2),'_',1))", 9 | partition_name = "_partition_id", 10 | unique_key = "block_id", 11 | other_cols="" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_blocks_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "blocks_2" %} 6 | {{ streamline_external_table_FR_query_v2( 7 | model, 8 | partition_function = "split_part(file_name, '/', 3)", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "block_id", 11 | other_cols="error" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_decoded_instructions_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "decoded_instructions_2" %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "to_timestamp_ntz(concat(split_part(file_name, '/', 3),'-',split_part(file_name, '/', 4),'-',split_part(file_name, '/', 5),' ',split_part(file_name, '/', 6),':00:00.000'))", 9 | partition_name = "_partition_by_created_date_hour", 10 | unique_key = "block_id", 11 | other_cols = "tx_id,index,inner_index,program_id,_partition_by_block_id" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_decoded_instructions_3.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "decoded_instructions_3" %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "to_timestamp_ntz(concat(split_part(file_name, '/', 3),'-',split_part(file_name, '/', 4),'-',split_part(file_name, '/', 5),' ',split_part(file_name, '/', 6),':00:00.000'))", 9 | partition_name = "_partition_by_created_date_hour", 10 | unique_key = "block_id", 11 | other_cols = "tx_id,index,inner_index,program_id,_partition_by_block_id" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_decoded_logs.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "decoded_logs" %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "to_timestamp_ntz(concat(split_part(file_name, '/', 3),'-',split_part(file_name, '/', 4),'-',split_part(file_name, '/', 5),' ',split_part(file_name, '/', 6),':00:00.000'))", 9 | partition_name = "_partition_by_created_date_hour", 10 | unique_key = "block_id", 11 | other_cols = "tx_id,index,inner_index,log_index,program_id,_partition_by_block_id" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_decoded_logs_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "decoded_logs_2" %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "to_timestamp_ntz(concat(split_part(file_name, '/', 3),'-',split_part(file_name, '/', 4),'-',split_part(file_name, '/', 5),' ',split_part(file_name, '/', 6),':00:00.000'))", 9 | partition_name = "_partition_by_created_date_hour", 10 | unique_key = "block_id", 11 | other_cols = "tx_id,index,inner_index,log_index,program_id,_partition_by_block_id" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_helius_blocks.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "helius_blocks" %} 6 | {{ streamline_external_table_FR_query_v2( 7 | model, 8 | partition_function = "split_part(file_name, '/', 3)", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "block_id", 11 | other_cols="array_size(data:result:signatures::array) AS transaction_count" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_helius_cnft_metadata.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "helius_nft_metadata" %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "to_timestamp(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD_HH24')", 9 | partition_name = "_partition_by_created_hour", 10 | unique_key = "data:id::STRING AS mint", 11 | other_cols="HELIUS_NFT_METADATA_REQUESTS_ID, MAX_MINT_EVENT_INSERTED_TIMESTAMP" 12 | ) }} -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_program_parser.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = this.identifier.split("_") [-2] + '_' + this.identifier.split("_") [-1] %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 4), '_', 1) AS INTEGER )", 9 | partition_name = "_partition_by_block_id", 10 | unique_key = "block_id", 11 | other_cols = "tx_id,index,program_id" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_solscan_blocks_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "solscan_blocks_2" %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "to_date(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD')", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "BLOCK_ID", 11 | other_cols="" 12 | ) }} -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_solscan_token_list.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "solscan_token_list" %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "to_date(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD')", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "", 11 | other_cols = "" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_stake_prgram_accounts_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "stake_program_accounts_2" %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "split_part(file_name, '/', 3)", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "", 11 | other_cols = "ACCOUNTS_REQUESTED, GROUP_NUM, INVOCATION_ID" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_validator_metadata_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "validator_metadata_2" %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "to_date(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD')", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "", 11 | other_cols = "" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_validator_vote_accounts_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "validator_vote_accounts_2" %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "to_date(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD')", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "", 11 | other_cols = "split_part(split_part(file_name, '/', -2),'.',-1)::string AS status" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_validator_vote_program_accounts_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "validator_vote_program_accounts_2" %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "to_date(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD')", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "", 11 | other_cols = "" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_FR_validators_list_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "validators_list_2" %} 6 | {{ streamline_external_table_FR_query( 7 | model, 8 | partition_function = "to_date(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD')", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "", 11 | other_cols = "" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_block_rewards_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "block_rewards_2" %} 6 | {{ streamline_external_table_query_v2( 7 | model, 8 | partition_function = "to_number(split_part(split_part(split_part(file_name,'/',3),'=',2),'_',1))", 9 | partition_name = "_partition_id", 10 | unique_key = "block_id", 11 | other_cols="error" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_block_tx_index_backfill.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "block_txs_index_backfill" %} 6 | {{ streamline_external_table_query_v2( 7 | model, 8 | partition_function = "to_timestamp_ntz(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD_HH24_MI')", 9 | partition_name = "_partition_by_created_timestamp", 10 | unique_key = "block_id", 11 | other_cols="" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_block_txs_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "block_txs_2" %} 6 | {{ streamline_external_table_query_v2( 7 | model, 8 | partition_function = "to_number(split_part(split_part(split_part(file_name,'/',3),'=',2),'_',1))", 9 | partition_name = "_partition_id", 10 | unique_key = "block_id", 11 | other_cols="" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_blocks_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "blocks_2" %} 6 | {{ streamline_external_table_query_v2( 7 | model, 8 | partition_function = "split_part(file_name, '/', 3)", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "block_id", 11 | other_cols="error" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_decoded_instructions_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "decoded_instructions_2" %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "to_timestamp_ntz(concat(split_part(file_name, '/', 3),'-',split_part(file_name, '/', 4),'-',split_part(file_name, '/', 5),' ',split_part(file_name, '/', 6),':00:00.000'))", 9 | partition_name = "_partition_by_created_date_hour", 10 | unique_key = "block_id", 11 | other_cols = "tx_id,index,inner_index,program_id,_partition_by_block_id" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_decoded_instructions_3.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "decoded_instructions_3" %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "to_timestamp_ntz(concat(split_part(file_name, '/', 3),'-',split_part(file_name, '/', 4),'-',split_part(file_name, '/', 5),' ',split_part(file_name, '/', 6),':00:00.000'))", 9 | partition_name = "_partition_by_created_date_hour", 10 | unique_key = "block_id", 11 | other_cols = "tx_id,index,inner_index,program_id,_partition_by_block_id" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_decoded_logs.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "decoded_logs" %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "to_timestamp_ntz(concat(split_part(file_name, '/', 3),'-',split_part(file_name, '/', 4),'-',split_part(file_name, '/', 5),' ',split_part(file_name, '/', 6),':00:00.000'))", 9 | partition_name = "_partition_by_created_date_hour", 10 | unique_key = "block_id", 11 | other_cols = "tx_id,index,inner_index,log_index,program_id,_partition_by_block_id" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_decoded_logs_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "decoded_logs_2" %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "to_timestamp_ntz(concat(split_part(file_name, '/', 3),'-',split_part(file_name, '/', 4),'-',split_part(file_name, '/', 5),' ',split_part(file_name, '/', 6),':00:00.000'))", 9 | partition_name = "_partition_by_created_date_hour", 10 | unique_key = "block_id", 11 | other_cols = "tx_id,index,inner_index,log_index,program_id,_partition_by_block_id" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_helius_blocks.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "helius_blocks" %} 6 | {{ streamline_external_table_query_v2( 7 | model, 8 | partition_function = "split_part(file_name, '/', 3)", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "block_id", 11 | other_cols="array_size(data:result:signatures::array) AS transaction_count" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_helius_cnft_metadata.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "helius_nft_metadata" %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "to_timestamp(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD_HH24')", 9 | partition_name = "_partition_by_created_hour", 10 | unique_key = "data:id::STRING AS mint", 11 | other_cols="HELIUS_NFT_METADATA_REQUESTS_ID, MAX_MINT_EVENT_INSERTED_TIMESTAMP" 12 | ) }} -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_program_parser.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = this.identifier.split("_") [-2] + '_' + this.identifier.split("_") [-1] %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 4), '_', 1) AS INTEGER )", 9 | partition_name = "_partition_by_block_id", 10 | unique_key = "block_id", 11 | other_cols = "tx_id,index,program_id" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_solscan_blocks_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "solscan_blocks_2" %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "to_date(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD')", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "BLOCK_ID", 11 | other_cols="" 12 | ) }} -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_solscan_token_list.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "solscan_token_list" %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "to_date(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD')", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "", 11 | other_cols = "" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_stake_program_accounts_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "stake_program_accounts_2" %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "split_part(file_name, '/', 3)", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "", 11 | other_cols = "ACCOUNTS_REQUESTED, GROUP_NUM, INVOCATION_ID" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_validator_metadata_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "validator_metadata_2" %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "to_date(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD')", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "", 11 | other_cols = "" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_validator_vote_accounts_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "validator_vote_accounts_2" %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "to_date(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD')", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "", 11 | other_cols = "split_part(split_part(file_name, '/', -2),'.',-1)::string AS status" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_validator_vote_program_accounts_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "validator_vote_program_accounts_2" %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "to_date(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD')", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "", 11 | other_cols = "" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/bronze/streamline/bronze__streamline_validators_list_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'view' 3 | ) }} 4 | 5 | {% set model = "validators_list_2" %} 6 | {{ streamline_external_table_query( 7 | model, 8 | partition_function = "to_date(split_part(split_part(file_name, '/', -2), '_result', 1), 'YYYY_MM_DD')", 9 | partition_name = "_partition_by_created_date", 10 | unique_key = "", 11 | other_cols = "" 12 | ) }} 13 | -------------------------------------------------------------------------------- /models/descriptions/_inserted_timestamp.md: -------------------------------------------------------------------------------- 1 | {% docs _inserted_timestamp %} 2 | 3 | Time the record was inserted into snowflake 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/_invocation_id.md: -------------------------------------------------------------------------------- 1 | {% docs _invocation_id %} 2 | 3 | Unique identifier for DBT job run that inserted/modified this record 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/action.md: -------------------------------------------------------------------------------- 1 | {% docs action %} 2 | 3 | The type of event action being performed 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/amount.md: -------------------------------------------------------------------------------- 1 | {% docs amount %} 2 | 3 | The number of tokens sent during an event 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/amount_usd.md: -------------------------------------------------------------------------------- 1 | {% docs amount_usd %} 2 | 3 | The USD value of the transferred amount, calculated using the token price at the time of the transfer. This field enables value-based analytics and comparisons across different tokens. 4 | 5 | **Data type:** Numeric (decimal) 6 | **Example:** 7 | - 123.45 (represents $123.45 USD) 8 | 9 | **Business Context:** 10 | - Used for tracking transaction volumes, wallet activity, and payment flows in USD terms. 11 | - Supports analytics on large value transfers, protocol revenue, and user behavior. 12 | 13 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/backfill_status.md: -------------------------------------------------------------------------------- 1 | {% docs backfill_status%} 2 | 3 | Status for the decoding of historical events - complete/in progress/not started 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/block_id.md: -------------------------------------------------------------------------------- 1 | {% docs block_id %} 2 | 3 | Slot for which a block can be created. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/block_timestamp.md: -------------------------------------------------------------------------------- 1 | {% docs block_timestamp %} 2 | 3 | The date and time at which the block began. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/blockchain.md: -------------------------------------------------------------------------------- 1 | {% docs blockchain %} 2 | 3 | In this table, always Solana. Used to join to cross-chain tables. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/burn_amount.md: -------------------------------------------------------------------------------- 1 | {% docs burn_amount %} 2 | 3 | The number of tokens burned during an event 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/contract_address.md: -------------------------------------------------------------------------------- 1 | {% docs contract_address %} 2 | 3 | Address unique to an NFT series 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/contract_name.md: -------------------------------------------------------------------------------- 1 | {% docs contract_name %} 2 | 3 | Name of the contract that identifies an NFT series. Example - tcgdragons 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/created_at_timestamp.md: -------------------------------------------------------------------------------- 1 | {% docs created_at_timestamp %} 2 | 3 | timestamp in UTC that the NFT was minted at 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/creator_address.md: -------------------------------------------------------------------------------- 1 | {% docs creator_address %} 2 | 3 | address provided by the creator of the project where mint payments and secondary market royalties are sent 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/creator_name.md: -------------------------------------------------------------------------------- 1 | {% docs creator_name %} 2 | 3 | name of the project creator - this can be an individual or a company name 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/date_submitted.md: -------------------------------------------------------------------------------- 1 | {% docs date_submitted %} 2 | 3 | Date at which the IDL was submitted. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/decimal.md: -------------------------------------------------------------------------------- 1 | {% docs decimal %} 2 | 3 | Number of decimals in the token value, need to divide amount by 10^decimal 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/earliest_decoded_block.md: -------------------------------------------------------------------------------- 1 | {% docs earliest_decoded_block %} 2 | 3 | The oldest block where events has been decoded 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/end_block.md: -------------------------------------------------------------------------------- 1 | {% docs end_block %} 2 | 3 | The last block within an Epoch 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/epoch.md: -------------------------------------------------------------------------------- 1 | {% docs epoch %} 2 | 3 | A period of time consisting of 432,000 blocks, which represents a higher-level timekeeping unit within the Solana network 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/epoch_earned.md: -------------------------------------------------------------------------------- 1 | {% docs epoch_earned %} 2 | 3 | The epoch that rewards were recieved for. Staking and voting rewards for an epoch are recieved in the first block of the following epoch, so this would identify the prior epoch, which is where the rewards were determined. Fee and rent rewards are determined in the epoch they are recieved. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/event_index.md: -------------------------------------------------------------------------------- 1 | {% docs event_index %} 2 | 3 | Location of the instruction (event) within a transaction 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/event_type.md: -------------------------------------------------------------------------------- 1 | {% docs event_type %} 2 | 3 | The type of event (i.e. "delegate", "withdraw") that is occurring 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/first_block_id.md: -------------------------------------------------------------------------------- 1 | {% docs first_block_id %} 2 | 3 | The block where the program was first called in a transaction 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/gov_action_action.md: -------------------------------------------------------------------------------- 1 | {% docs gov_action_action %} 2 | 3 | NFT mint associated with the action 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/gov_action_amount.md: -------------------------------------------------------------------------------- 1 | {% docs gov_action_amount %} 2 | 3 | Amount being locked or exited 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/gov_action_escrow_account.md: -------------------------------------------------------------------------------- 1 | {% docs gov_action_escrow_account %} 2 | 3 | Account owner of the locker account for governance 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/gov_action_locker_account.md: -------------------------------------------------------------------------------- 1 | {% docs gov_action_locker_account %} 2 | 3 | Account holding tokens for governance 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/gov_action_locker_nft.md: -------------------------------------------------------------------------------- 1 | {% docs gov_action_locker_nft %} 2 | 3 | NFT representing tokens for governance. This is only available for certain types of governance. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/gov_action_mint.md: -------------------------------------------------------------------------------- 1 | {% docs gov_action_mint %} 2 | 3 | Mint being locked or exited 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/gov_action_signer.md: -------------------------------------------------------------------------------- 1 | {% docs gov_action_signer %} 2 | 3 | Address initiating the action 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/id.md: -------------------------------------------------------------------------------- 1 | {% docs id %} 2 | 3 | A unique identifier for the record. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/image_url.md: -------------------------------------------------------------------------------- 1 | {% docs image_url %} 2 | 3 | URL that links to the image on the ipfs service 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/index.md: -------------------------------------------------------------------------------- 1 | {% docs index %} 2 | 3 | A unique key that identifies the event's position within a transaction 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/ingested_at.md: -------------------------------------------------------------------------------- 1 | {% docs ingested_at %} 2 | 3 | Time the record was ingested by the source 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/inner_index.md: -------------------------------------------------------------------------------- 1 | {% docs inner_index %} 2 | 3 | Location of the instruction within an instruction's (event) inner instruction 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/inner_instruction.md: -------------------------------------------------------------------------------- 1 | {% docs inner_instruction %} 2 | 3 | A call from one smart contract program to another 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/inserted_timestamp.md: -------------------------------------------------------------------------------- 1 | {% docs inserted_timestamp %} 2 | 3 | The timestamp at which the record was initially created and inserted into this table. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/instruction.md: -------------------------------------------------------------------------------- 1 | {% docs instruction %} 2 | 3 | Specifies which program it is calling, which accounts it wants to read or modify, and additional data that serves as auxiliary input to the program 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/is_compressed.md: -------------------------------------------------------------------------------- 1 | {% docs is_compressed %} 2 | 3 | Identifies if the NFT is a compressed NFT 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/is_valid.md: -------------------------------------------------------------------------------- 1 | {% docs is_valid %} 2 | 3 | Whether events are properly decoding with the IDL 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/leaf_index.md: -------------------------------------------------------------------------------- 1 | {% docs leaf_index %} 2 | 3 | The position of the leaf within the merkle tree used to locate and verify the leaf's data 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/liquidity_pool_address.md: -------------------------------------------------------------------------------- 1 | {% docs liquidity_pool_address %} 2 | 3 | Address of the liquidity pool 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/liquidity_pool_token_mint.md: -------------------------------------------------------------------------------- 1 | {% docs liquidity_pool_token_mint %} 2 | 3 | Address of the liquidity pool token mint 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/liquidity_provider.md: -------------------------------------------------------------------------------- 1 | {% docs liquidity_provider %} 2 | 3 | Wallet address initiating the deposit/withdraw or mint/burn 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/log_index.md: -------------------------------------------------------------------------------- 1 | {% docs log_index %} 2 | 3 | Position of program data log for a specific transaction. Used to differentiate logs with the same (index, inner_index) 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/marketplace.md: -------------------------------------------------------------------------------- 1 | {% docs marketplace %} 2 | 3 | NFT Marketplace platform where transaction occured 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/merkle_tree.md: -------------------------------------------------------------------------------- 1 | {% docs merkle_tree %} 2 | 3 | The address of the merkle tree which contains the cNFT 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/mint.md: -------------------------------------------------------------------------------- 1 | {% docs mint %} 2 | 3 | Unique address representing a specific token 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/mint_amount.md: -------------------------------------------------------------------------------- 1 | {% docs mint_amount %} 2 | 3 | Number of tokens minted 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/mint_currency.md: -------------------------------------------------------------------------------- 1 | {% docs mint_currency %} 2 | 3 | Currency used to pay for the NFT mint. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/mint_payer.md: -------------------------------------------------------------------------------- 1 | {% docs mint_payer %} 2 | 3 | Wallet address associated with paying for the mint 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/mint_price.md: -------------------------------------------------------------------------------- 1 | {% docs mint_price %} 2 | 3 | Price that it cost to mint the NFT in SOL or other currency. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/mint_standard_type.md: -------------------------------------------------------------------------------- 1 | {% docs mint_standard_type %} 2 | 3 | The type of mint following Metaplex mint standards 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/modified_timestamp.md: -------------------------------------------------------------------------------- 1 | {% docs modified_timestamp %} 2 | 3 | The timestamp at which this record was last modified by an internal process. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/pk.md: -------------------------------------------------------------------------------- 1 | {% docs pk %} 2 | 3 | The unique identifier for each row in the table. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/post_balance.md: -------------------------------------------------------------------------------- 1 | {% docs post_balance %} 2 | 3 | The amount of SOL in the account after event 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/program_id.md: -------------------------------------------------------------------------------- 1 | {% docs program_id %} 2 | 3 | An address that identifies the program that is being interacted with. I.E. which DEX for a swap or marketplace for an NFT sale. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/project_name.md: -------------------------------------------------------------------------------- 1 | {% docs project_name %} 2 | 3 | Name of the project the NFT token belongs to 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/purchaser.md: -------------------------------------------------------------------------------- 1 | {% docs purchaser %} 2 | 3 | The wallet address that purchased the NFT 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/sales_amount.md: -------------------------------------------------------------------------------- 1 | {% docs sales_amount %} 2 | 3 | The amount of Solana the NFT was purchased for 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/seller.md: -------------------------------------------------------------------------------- 1 | {% docs seller %} 2 | 3 | The wallet address that sold the NFT 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/signers.md: -------------------------------------------------------------------------------- 1 | {% docs signers %} 2 | 3 | List of accounts that signed the transaction 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/stake_account.md: -------------------------------------------------------------------------------- 1 | {% docs stake_account %} 2 | 3 | An account address containing balances of staked SOL. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/stake_authority.md: -------------------------------------------------------------------------------- 1 | {% docs stake_authority %} 2 | 3 | The authority that can perform staking related actions on the stake account except for withdrawing. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/stake_pool.md: -------------------------------------------------------------------------------- 1 | {% docs stake_pool %} 2 | 3 | Address for a given stake pool 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/stake_pool_action.md: -------------------------------------------------------------------------------- 1 | {% docs stake_pool_action %} 2 | 3 | Action performed against a given stake pool 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/stake_pool_address.md: -------------------------------------------------------------------------------- 1 | {% docs stake_pool_address %} 2 | 3 | Wallet address initiating the deposit/stake or withdraw/unstake 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/stake_pool_amount.md: -------------------------------------------------------------------------------- 1 | {% docs stake_pool_amount %} 2 | 3 | Amount of SOL being deposited/staked or withdrawn/unstaked 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/stake_pool_deposit_authority.md: -------------------------------------------------------------------------------- 1 | {% docs stake_pool_deposit_authority %} 2 | 3 | System address with authority to deposit into stake pool 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/stake_pool_reserve_stake_address.md: -------------------------------------------------------------------------------- 1 | {% docs stake_pool_reserve_stake_address %} 2 | 3 | Address holding the reserved stake pool SOL 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/stake_pool_withdraw_authority.md: -------------------------------------------------------------------------------- 1 | {% docs stake_pool_withdraw_authority %} 2 | 3 | System address with authority to withdraw from stake pool 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/start_block.md: -------------------------------------------------------------------------------- 1 | {% docs start_block %} 2 | 3 | The first block within an Epoch 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/submitted_by.md: -------------------------------------------------------------------------------- 1 | {% docs submitted_by%} 2 | 3 | The discord username for the individual that submitted the IDL, or 'flipside' if submitted by internal team 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/swaps_from_amt.md: -------------------------------------------------------------------------------- 1 | {% docs swaps_from_amt %} 2 | 3 | Total amount of the token sent in to initiate the swap 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/swaps_from_mint.md: -------------------------------------------------------------------------------- 1 | {% docs swaps_from_mint %} 2 | 3 | Token being sent or swapped from 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/swaps_swap_index.md: -------------------------------------------------------------------------------- 1 | {% docs swaps_swap_index %} 2 | 3 | Order in which the intermediate swap was executed 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/swaps_swapper.md: -------------------------------------------------------------------------------- 1 | {% docs swaps_swapper %} 2 | 3 | Address that initiated the swap 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/swaps_to_amt.md: -------------------------------------------------------------------------------- 1 | {% docs swaps_to_amt %} 2 | 3 | Total amount of the token received in the swap 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/swaps_to_mint.md: -------------------------------------------------------------------------------- 1 | {% docs swaps_to_mint %} 2 | 3 | Token being received or swapped for 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/symbol.md: -------------------------------------------------------------------------------- 1 | {% docs symbol %} 2 | 3 | The symbol of the token involved in the transfer (e.g., SOL, USDC, RAY). Used to identify the asset type in analytics and reporting. 4 | 5 | **Data type:** String 6 | **Example:** 7 | - SOL 8 | - USDC 9 | 10 | **Business Context:** 11 | - Enables grouping and filtering of transfers by token. 12 | - Supports analytics on asset flows, protocol usage, and user preferences. 13 | 14 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/token_a_account.md: -------------------------------------------------------------------------------- 1 | {% docs token_a_account %} 2 | 3 | Address of the account containing the first token in a liquidity pool pair 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/token_a_amount.md: -------------------------------------------------------------------------------- 1 | {% docs token_a_amount %} 2 | 3 | Amount of the first token in a liquidity pool pair transferred during a liquidity pool action 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/token_a_mint.md: -------------------------------------------------------------------------------- 1 | {% docs token_a_mint %} 2 | 3 | Address of the mint representing the first token in a liquidity pool pair 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/token_account.md: -------------------------------------------------------------------------------- 1 | {% docs token_account %} 2 | 3 | Address of the account containing a specific token 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/token_b_account.md: -------------------------------------------------------------------------------- 1 | {% docs token_b_account %} 2 | 3 | Address of the account containing the second token in a liquidity pool pair 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/token_b_amount.md: -------------------------------------------------------------------------------- 1 | {% docs token_b_amount %} 2 | 3 | Amount of the second token in a liquidity pool pair transferred during a liquidity pool action 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/token_b_mint.md: -------------------------------------------------------------------------------- 1 | {% docs token_b_mint %} 2 | 3 | Address of the mint representing the second token in a liquidity pool pair 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/token_id.md: -------------------------------------------------------------------------------- 1 | {% docs token_id %} 2 | 3 | Numeric value that identifies the NFT within it's series 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/token_metadata.md: -------------------------------------------------------------------------------- 1 | {% docs token_metadata %} 2 | 3 | a block of json that describes the traits of an NFT 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/token_metadata_uri.md: -------------------------------------------------------------------------------- 1 | {% docs token_metadata_uri %} 2 | 3 | URL that links to the token metadata on the ipfs service 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/token_name.md: -------------------------------------------------------------------------------- 1 | {% docs token_name %} 2 | 3 | Name of the NFT token - this is unique to token. Example SMB #284 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/tree_authority.md: -------------------------------------------------------------------------------- 1 | {% docs tree_authority %} 2 | 3 | The address that has authority to manage the merkle tree, inclding adding new leaves or updating the tree structure 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/tribeca_gauge.md: -------------------------------------------------------------------------------- 1 | {% docs tribeca_gauge %} 2 | 3 | Address that determines the rewards share to give to a liquidity pool, or in the case of Marinade, the amount of SOL that should be delegated to a given validator 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/tribeca_gauge_delegated_shares.md: -------------------------------------------------------------------------------- 1 | {% docs tribeca_gauge_delegated_shares %} 2 | 3 | Number of shares delegated to vote for this gauge 4 | 5 | {% enddocs %} 6 | -------------------------------------------------------------------------------- /models/descriptions/tribeca_gauge_power.md: -------------------------------------------------------------------------------- 1 | {% docs tribeca_gauge_power%} 2 | 3 | Total voting power of the voter. This is only available for certain types of gauge votes. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/tribeca_gauge_validator_account.md: -------------------------------------------------------------------------------- 1 | {% docs tribeca_gauge_validator_account %} 2 | 3 | Validator vote key linked to a gauge 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/tribeca_gauge_voter.md: -------------------------------------------------------------------------------- 1 | {% docs tribeca_gauge_voter %} 2 | 3 | Address performing the vote 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/tribeca_gaugemeister.md: -------------------------------------------------------------------------------- 1 | {% docs tribeca_gaugemeister %} 2 | 3 | Address that manages the rewards shares of all gauges 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/tx_from.md: -------------------------------------------------------------------------------- 1 | {% docs tx_from %} 2 | 3 | The wallet address that initiated an event 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/tx_id.md: -------------------------------------------------------------------------------- 1 | {% docs tx_id %} 2 | 3 | A unique key that identifies a transaction 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/tx_index.md: -------------------------------------------------------------------------------- 1 | {% docs tx_index %} 2 | 3 | The index of the transaction in the block. Index of 0 is the first transaction executed in the block. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/tx_succeeded.md: -------------------------------------------------------------------------------- 1 | {% docs tx_succeeded %} 2 | 3 | True when a transaction is successful, otherwise false. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/tx_to.md: -------------------------------------------------------------------------------- 1 | {% docs tx_to %} 2 | 3 | The wallet address that receives tokens in an event 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/vote_pubkey.md: -------------------------------------------------------------------------------- 1 | {% docs vote_pubkey %} 2 | 3 | Account address of voter 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/descriptions/withdraw_authority.md: -------------------------------------------------------------------------------- 1 | {% docs withdraw_authority %} 2 | 3 | The authority that can withdraw SOL from the stake account. 4 | 5 | {% enddocs %} -------------------------------------------------------------------------------- /models/github_actions/github_actions__current_task_status.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['gha_tasks'] 4 | ) }} 5 | 6 | {{ fsc_utils.gha_task_current_status_view() }} -------------------------------------------------------------------------------- /models/github_actions/github_actions__current_task_status.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: github_actions__current_task_status 4 | columns: 5 | - name: PIPELINE_ACTIVE 6 | tests: 7 | - dbt_expectations.expect_column_values_to_be_in_set: 8 | value_set: 9 | - TRUE 10 | where: "workflow_name != 'dbt_run_streamline_stake_accounts_snapshot'" 11 | - name: SUCCESSES 12 | tests: 13 | - dbt_expectations.expect_column_values_to_be_in_set: 14 | value_set: 15 | - 2 16 | config: 17 | severity: warn 18 | warn_if: ">0" 19 | where: "workflow_name != 'dbt_run_streamline_stake_accounts_snapshot'" -------------------------------------------------------------------------------- /models/github_actions/github_actions__task_history.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['gha_tasks'] 4 | ) }} 5 | 6 | {{ fsc_utils.gha_task_history_view() }} -------------------------------------------------------------------------------- /models/github_actions/github_actions__task_performance.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['gha_tasks'] 4 | ) }} 5 | 6 | {{ fsc_utils.gha_task_performance_view() }} -------------------------------------------------------------------------------- /models/github_actions/github_actions__task_schedule.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['gha_tasks'] 4 | ) }} 5 | 6 | {{ fsc_utils.gha_task_schedule_view() }} -------------------------------------------------------------------------------- /models/github_actions/github_actions__tasks.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['gha_tasks'] 4 | ) }} 5 | 6 | {{ fsc_utils.gha_tasks_view() }} -------------------------------------------------------------------------------- /models/gold/core/core__dim_idls.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized='view', 3 | tags = ['idls'] 4 | ) 5 | }} 6 | 7 | SELECT 8 | program_id, 9 | idl, 10 | idl_hash, 11 | is_valid, 12 | is_active, 13 | last_activity_timestamp, 14 | submitted_by, 15 | date_submitted, 16 | first_block_id, 17 | earliest_decoded_block, 18 | backfill_status, 19 | idls_id as dim_idls_id, 20 | inserted_timestamp, 21 | modified_timestamp 22 | FROM {{ ref('silver__idls') }} -------------------------------------------------------------------------------- /models/gold/core/core__dim_labels.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['scheduled_non_core'] 4 | ) }} 5 | 6 | SELECT 7 | blockchain, 8 | creator, 9 | address, 10 | label_type, 11 | label_subtype, 12 | project_name AS label, 13 | address_name, 14 | labels_combined_id AS dim_labels_id, 15 | inserted_timestamp, 16 | modified_timestamp 17 | FROM 18 | {{ ref('silver__labels') }} 19 | -------------------------------------------------------------------------------- /models/gold/core/core__ez_events_decoded.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['scheduled_non_core'], 4 | ) }} 5 | 6 | SELECT 7 | A.block_timestamp, 8 | A.block_id, 9 | A.tx_id, 10 | A.signers, 11 | A.succeeded, 12 | A.index, 13 | A.inner_index, 14 | A.event_type, 15 | A.program_id, 16 | A.decoded_instruction, 17 | A.decoded_instruction :accounts :: ARRAY AS decoded_accounts, 18 | A.decoded_instruction :args :: variant AS decoded_args, 19 | A.decoded_instruction :error :: STRING AS decoding_error, 20 | A.decoded_instructions_combined_id AS ez_events_decoded_id, 21 | A.inserted_timestamp, 22 | A.modified_timestamp 23 | FROM 24 | {{ ref('silver__decoded_instructions_combined') }} A 25 | -------------------------------------------------------------------------------- /models/gold/core/core__ez_signers.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['scheduled_daily','signers'] 4 | ) }} 5 | 6 | SELECT 7 | signer, 8 | first_tx_date, 9 | first_program_id, 10 | last_tx_date, 11 | last_program_id, 12 | num_days_active, 13 | num_txs, 14 | total_fees, 15 | programs_used, 16 | COALESCE ( 17 | signers_id, 18 | {{ dbt_utils.generate_surrogate_key( 19 | ['signer'] 20 | ) }} 21 | ) AS ez_signers_id, 22 | COALESCE( 23 | inserted_timestamp, 24 | '2000-01-01' 25 | ) AS inserted_timestamp, 26 | COALESCE( 27 | modified_timestamp, 28 | '2000-01-01' 29 | ) AS modified_timestamp 30 | FROM 31 | {{ ref('silver__signers') }} 32 | -------------------------------------------------------------------------------- /models/gold/core/core__ez_transfers.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['scheduled_core', 'exclude_change_tracking'] 4 | ) }} 5 | 6 | SELECT 7 | a.block_timestamp, 8 | a.block_id, 9 | a.tx_id, 10 | COALESCE(SPLIT_PART(a.INDEX :: text, '.', 1) :: INT, a.INDEX :: INT) AS index, 11 | NULLIF(SPLIT_PART(a.INDEX :: text, '.', 2), '') :: INT AS inner_index, 12 | a.tx_from, 13 | a.tx_to, 14 | a.amount, 15 | a.amount * p.price AS amount_usd, 16 | a.mint, 17 | COALESCE( 18 | p.symbol, 19 | b.symbol 20 | ) AS symbol, 21 | COALESCE( 22 | p.is_verified, 23 | FALSE 24 | ) AS token_is_verified, 25 | a.fact_transfers_id AS ez_transfers_id, 26 | a.inserted_timestamp, 27 | a.modified_timestamp 28 | FROM 29 | {{ ref('core__fact_transfers') }} a 30 | LEFT JOIN {{ ref('price__ez_asset_metadata') }} b 31 | ON a.mint = b.token_address 32 | LEFT JOIN {{ ref('price__ez_prices_hourly') }} p 33 | ON a.mint = p.token_address 34 | AND DATE_TRUNC( 35 | 'hour', 36 | a.block_timestamp 37 | ) = p.hour 38 | -------------------------------------------------------------------------------- /models/gold/core/core__fact_blocks.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['scheduled_core'] 4 | ) }} 5 | 6 | SELECT 7 | block_id, 8 | block_timestamp, 9 | network, 10 | chain_id, 11 | block_height, 12 | block_hash, 13 | previous_block_id, 14 | previous_block_hash, 15 | COALESCE ( 16 | blocks_id, 17 | {{ dbt_utils.generate_surrogate_key( 18 | ['block_id'] 19 | ) }} 20 | ) AS fact_blocks_id, 21 | COALESCE( 22 | inserted_timestamp, 23 | '2000-01-01' 24 | ) AS inserted_timestamp, 25 | COALESCE( 26 | modified_timestamp, 27 | '2000-01-01' 28 | ) AS modified_timestamp 29 | FROM 30 | {{ ref('silver__blocks') }} -------------------------------------------------------------------------------- /models/gold/core/core__fact_decoded_instructions.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['scheduled_non_core'], 4 | ) }} 5 | 6 | SELECT 7 | block_timestamp, 8 | block_id, 9 | tx_id, 10 | signers, 11 | INDEX, 12 | inner_index, 13 | program_id, 14 | event_type, 15 | decoded_instruction, 16 | decoded_instructions_combined_id AS fact_decoded_instructions_id, 17 | inserted_timestamp, 18 | modified_timestamp 19 | FROM 20 | {{ ref('silver__decoded_instructions_combined') }} 21 | -------------------------------------------------------------------------------- /models/gold/core/core__fact_events.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['scheduled_core'] 4 | ) }} 5 | 6 | SELECT 7 | block_timestamp, 8 | block_id, 9 | tx_id, 10 | signers, 11 | succeeded, 12 | index, 13 | event_type, 14 | program_id, 15 | instruction, 16 | inner_instruction, 17 | COALESCE ( 18 | events_id, 19 | {{ dbt_utils.generate_surrogate_key( 20 | ['block_id', 'tx_id', 'index'] 21 | ) }} 22 | ) AS fact_events_id, 23 | COALESCE( 24 | inserted_timestamp, 25 | '2000-01-01' 26 | ) AS inserted_timestamp, 27 | COALESCE( 28 | modified_timestamp, 29 | '2000-01-01' 30 | ) AS modified_timestamp 31 | FROM 32 | {{ ref('silver__events') }} 33 | -------------------------------------------------------------------------------- /models/gold/core/core__fact_sol_balances.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = ['fact_sol_balances_id'], 4 | incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"], 5 | cluster_by = ['block_timestamp::DATE','modified_timestamp::DATE'], 6 | merge_exclude_columns = ["inserted_timestamp"], 7 | post_hook = enable_search_optimization('{{this.schema}}', '{{this.identifier}}', 'ON EQUALITY(tx_id, account_address)'), 8 | tags = ['scheduled_non_core'] 9 | ) }} 10 | 11 | SELECT 12 | block_timestamp, 13 | block_id, 14 | tx_id, 15 | tx_index, 16 | succeeded, 17 | account AS account_address, 18 | mint, 19 | account AS owner, 20 | pre_amount AS pre_balance, 21 | post_amount AS balance, 22 | sol_balances_id AS fact_sol_balances_id, 23 | inserted_timestamp, 24 | modified_timestamp 25 | FROM 26 | {{ ref('silver__sol_balances') }} 27 | 28 | {% if is_incremental() %} 29 | WHERE 30 | modified_timestamp >= ( 31 | SELECT 32 | MAX(modified_timestamp) 33 | FROM 34 | {{ this }} 35 | ) 36 | {% endif %} 37 | -------------------------------------------------------------------------------- /models/gold/core/core__fact_token_account_owners.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized='view', 3 | tags = ['daily'] 4 | ) 5 | }} 6 | 7 | SELECT 8 | account_address, 9 | owner, 10 | start_block_id, 11 | end_block_id, 12 | token_account_owners_id AS fact_token_account_owners_id, 13 | inserted_timestamp, 14 | modified_timestamp 15 | FROM {{ ref('silver__token_account_owners') }} -------------------------------------------------------------------------------- /models/gold/core/core__fact_transactions.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | post_hook = 'ALTER VIEW {{this}} SET CHANGE_TRACKING = TRUE;', 4 | tags = ['scheduled_core'] 5 | ) }} 6 | 7 | SELECT 8 | block_timestamp, 9 | block_id, 10 | tx_id, 11 | recent_block_hash, 12 | signers, 13 | fee, 14 | succeeded, 15 | account_keys, 16 | pre_balances, 17 | post_balances, 18 | pre_token_balances, 19 | post_token_balances, 20 | instructions, 21 | inner_instructions, 22 | log_messages, 23 | units_consumed, 24 | units_limit, 25 | tx_size, 26 | tx_index, 27 | COALESCE ( 28 | transactions_id, 29 | {{ dbt_utils.generate_surrogate_key( 30 | ['tx_id'] 31 | ) }} 32 | ) AS fact_transactions_id, 33 | COALESCE( 34 | inserted_timestamp, 35 | '2000-01-01' 36 | ) AS inserted_timestamp, 37 | COALESCE( 38 | modified_timestamp, 39 | '2000-01-01' 40 | ) AS modified_timestamp 41 | FROM 42 | {{ ref('silver__transactions') }} 43 | -------------------------------------------------------------------------------- /models/gold/core/core__fact_transfers.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['scheduled_core'] 4 | ) }} 5 | 6 | SELECT 7 | block_timestamp, 8 | block_id, 9 | tx_id, 10 | index, 11 | tx_from, 12 | tx_to, 13 | amount, 14 | mint, 15 | COALESCE ( 16 | transfers_id, 17 | {{ dbt_utils.generate_surrogate_key( 18 | ['block_id', 'tx_id', 'index'] 19 | ) }} 20 | ) AS fact_transfers_id, 21 | COALESCE( 22 | inserted_timestamp, 23 | '2000-01-01' 24 | ) AS inserted_timestamp, 25 | COALESCE( 26 | modified_timestamp, 27 | '2000-01-01' 28 | ) AS modified_timestamp 29 | FROM 30 | {{ ref('silver__transfers') }} 31 | WHERE 32 | succeeded 33 | -------------------------------------------------------------------------------- /models/gold/gov/gov__dim_epoch.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'table', 3 | unique_key = ['dim_epoch_id'] 4 | ) }} 5 | 6 | SELECT 7 | epoch, 8 | start_block, 9 | end_block, 10 | epoch_id as dim_epoch_id, 11 | SYSDATE() AS modified_timestamp, 12 | SYSDATE() AS inserted_timestamp 13 | from 14 | {{ ref('silver__epoch') }} 15 | -------------------------------------------------------------------------------- /models/gold/gov/gov__dim_epoch.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: gov__dim_epoch 4 | description: "Contains the block range for epochs" 5 | columns: 6 | - name: EPOCH 7 | description: "{{ doc('epoch') }}" 8 | tests: 9 | - dbt_expectations.expect_column_to_exist 10 | - name: START_BLOCK 11 | description: "{{ doc('start_block') }}" 12 | tests: 13 | - dbt_expectations.expect_column_to_exist 14 | - name: END_BLOCK 15 | description: "{{ doc('end_block') }}" 16 | tests: 17 | - dbt_expectations.expect_column_to_exist 18 | - name: DIM_EPOCH_ID 19 | description: "{{ doc('id') }}" 20 | tests: 21 | - dbt_expectations.expect_column_to_exist 22 | - name: MODIFIED_TIMESTAMP 23 | description: "{{ doc('modified_timestamp') }}" 24 | tests: 25 | - dbt_expectations.expect_column_to_exist 26 | - name: INSERTED_TIMESTAMP 27 | description: "{{ doc('inserted_timestamp') }}" 28 | tests: 29 | - dbt_expectations.expect_column_to_exist -------------------------------------------------------------------------------- /models/gold/gov/gov__fact_gauges_creates.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'table', 3 | meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'GOVERNANCE' }}} 4 | ) }} 5 | 6 | SELECT 7 | 'marinade' AS program_name, 8 | block_timestamp, 9 | block_id, 10 | tx_id, 11 | succeeded, 12 | signer, 13 | gauge, 14 | gaugemeister, 15 | validator_account, 16 | {{ dbt_utils.generate_surrogate_key( 17 | ['tx_id'] 18 | ) }} AS fact_gauges_creates_id, 19 | SYSDATE() AS inserted_timestamp, 20 | SYSDATE() AS modified_timestamp 21 | FROM 22 | {{ ref('silver__gauges_creates_marinade_view') }} 23 | -------------------------------------------------------------------------------- /models/gold/gov/gov__fact_rewards_rent.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'table', 3 | meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'REWARDS' }}} 4 | ) }} 5 | 6 | SELECT 7 | block_timestamp, 8 | block_id, 9 | vote_pubkey, 10 | epoch_earned, 11 | reward_amount_sol, 12 | post_balance_sol, 13 | rewards_rent_id as fact_rewards_rent_id, 14 | SYSDATE() AS modified_timestamp, 15 | SYSDATE() AS inserted_timestamp, 16 | epoch_id as dim_epoch_id 17 | from 18 | {{ ref('silver__rewards_rent_view') }} 19 | -------------------------------------------------------------------------------- /models/gold/gov/gov__fact_staking_lp_actions.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | meta = { 4 | 'database_tags': { 5 | 'table': { 6 | 'PURPOSE': 'STAKING' 7 | } 8 | } 9 | }, 10 | tags = ['scheduled_non_core'] 11 | ) }} 12 | 13 | SELECT 14 | block_timestamp, 15 | block_id, 16 | tx_id, 17 | succeeded, 18 | index, 19 | inner_index, 20 | event_type, 21 | program_id, 22 | signers, 23 | account_keys, 24 | instruction, 25 | inner_instruction, 26 | pre_balances, 27 | post_balances, 28 | pre_token_balances, 29 | post_token_balances, 30 | coalesce( 31 | staking_lp_actions_2_id, 32 | {{ dbt_utils.generate_surrogate_key( 33 | ['block_id', 'tx_id', 'index', 'inner_index'] 34 | ) }} 35 | ) AS fact_staking_lp_actions_id, 36 | coalesce(inserted_timestamp,'2000-01-01') AS inserted_timestamp, 37 | coalesce(modified_timestamp, '2000-01-01') AS modified_timestamp 38 | FROM 39 | {{ ref('silver__staking_lp_actions_2') }} 40 | -------------------------------------------------------------------------------- /models/gold/gov/gov__fact_votes_agg_block.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: gov__fact_votes_agg_block 4 | description: An aggregate table containing the number of automatic validator voting transactions that occurred during a block. 5 | columns: 6 | - name: BLOCK_TIMESTAMP 7 | description: "{{ doc('block_timestamp') }}" 8 | tests: 9 | - dbt_expectations.expect_column_to_exist 10 | - dbt_expectations.expect_row_values_to_have_recent_data: 11 | datepart: day 12 | interval: 2 13 | - name: BLOCK_ID 14 | description: "{{ doc('block_id') }}" 15 | tests: 16 | - dbt_expectations.expect_column_to_exist 17 | - name: NUM_VOTES 18 | description: The number of vote events that occurred within the block 19 | tests: 20 | - dbt_expectations.expect_column_to_exist 21 | - name: FACT_VOTES_AGG_BLOCK_ID 22 | description: '{{ doc("pk") }}' 23 | - name: INSERTED_TIMESTAMP 24 | description: '{{ doc("inserted_timestamp") }}' 25 | - name: MODIFIED_TIMESTAMP 26 | description: '{{ doc("modified_timestamp") }}' -------------------------------------------------------------------------------- /models/gold/price/price__dim_asset_metadata.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | persist_docs ={ "relation": true, 4 | "columns": true } 5 | ) }} 6 | 7 | SELECT 8 | token_address, 9 | asset_id, 10 | symbol, 11 | name, 12 | platform AS blockchain, 13 | platform_id AS blockchain_id, 14 | provider, 15 | inserted_timestamp, 16 | modified_timestamp, 17 | complete_provider_asset_metadata_id AS dim_asset_metadata_id 18 | FROM 19 | {{ ref('silver__complete_provider_asset_metadata') }} 20 | -------------------------------------------------------------------------------- /models/gold/price/price__dim_asset_metadata.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: price__dim_asset_metadata 4 | description: '{{ doc("prices_dim_asset_metadata_table_doc") }}' 5 | 6 | columns: 7 | - name: PROVIDER 8 | description: '{{ doc("prices_provider")}}' 9 | - name: ASSET_ID 10 | description: '{{ doc("prices_asset_id") }}' 11 | - name: NAME 12 | description: '{{ doc("prices_name") }}' 13 | - name: SYMBOL 14 | description: '{{ doc("prices_symbol") }}' 15 | - name: TOKEN_ADDRESS 16 | description: '{{ doc("prices_token_address") }}' 17 | - name: BLOCKCHAIN 18 | description: '{{ doc("prices_blockchain") }}' 19 | - name: BLOCKCHAIN_ID 20 | description: '{{ doc("prices_blockchain_id") }}' 21 | - name: DIM_ASSET_METADATA_ID 22 | description: '{{ doc("pk") }}' 23 | - name: INSERTED_TIMESTAMP 24 | description: '{{ doc("inserted_timestamp") }}' 25 | - name: MODIFIED_TIMESTAMP 26 | description: '{{ doc("modified_timestamp") }}' -------------------------------------------------------------------------------- /models/gold/price/price__fact_prices_ohlc_hourly.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | persist_docs ={ "relation": true, 4 | "columns": true } 5 | ) }} 6 | 7 | SELECT 8 | asset_id, 9 | recorded_hour AS HOUR, 10 | OPEN, 11 | high, 12 | low, 13 | CLOSE, 14 | provider, 15 | inserted_timestamp, 16 | modified_timestamp, 17 | complete_provider_prices_id AS fact_prices_ohlc_hourly_id 18 | FROM 19 | {{ ref('silver__complete_provider_prices') }} 20 | -------------------------------------------------------------------------------- /models/gold/price/price__fact_prices_ohlc_hourly.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: price__fact_prices_ohlc_hourly 4 | description: '{{ doc("prices_fact_prices_ohlc_hourly_table_doc") }}' 5 | 6 | columns: 7 | - name: HOUR 8 | description: '{{ doc("prices_hour")}}' 9 | - name: ASSET_ID 10 | description: '{{ doc("prices_asset_id") }}' 11 | - name: OPEN 12 | description: '{{ doc("prices_open") }}' 13 | - name: HIGH 14 | description: '{{ doc("prices_high") }}' 15 | - name: LOW 16 | description: '{{ doc("prices_low") }}' 17 | - name: CLOSE 18 | description: '{{ doc("prices_close") }}' 19 | - name: FACT_PRICES_OHLC_HOURLY_ID 20 | description: '{{ doc("pk") }}' 21 | - name: INSERTED_TIMESTAMP 22 | description: '{{ doc("inserted_timestamp") }}' 23 | - name: MODIFIED_TIMESTAMP 24 | description: '{{ doc("modified_timestamp") }}' -------------------------------------------------------------------------------- /models/gold/stats/stats__ez_core_metrics_hourly.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | meta ={ 'database_tags':{ 'table':{ 'PURPOSE': 'STATS, METRICS, CORE, HOURLY', 4 | }} }, 5 | tags = ['scheduled_non_core','exclude_change_tracking'] 6 | ) }} 7 | 8 | SELECT 9 | block_timestamp_hour, 10 | block_number_min, 11 | block_number_max, 12 | block_count, 13 | transaction_count, 14 | transaction_count_success, 15 | transaction_count_failed, 16 | unique_signers_count, 17 | total_fees AS total_fees_native, 18 | ROUND( 19 | ( 20 | total_fees / pow( 21 | 10, 22 | 9 23 | ) 24 | ) * p.price, 25 | 2 26 | ) AS total_fees_usd, 27 | core_metrics_hourly_id AS ez_core_metrics_hourly_id, 28 | s.inserted_timestamp AS inserted_timestamp, 29 | s.modified_timestamp AS modified_timestamp 30 | FROM 31 | {{ ref('silver__core_metrics_hourly') }} 32 | s 33 | LEFT JOIN {{ ref('silver__complete_token_prices') }} 34 | p 35 | ON s.block_timestamp_hour = p.hour 36 | AND p.token_address = 'So11111111111111111111111111111111111111112' 37 | -------------------------------------------------------------------------------- /models/silver/_observability/silver_observability__blocks_tx_count.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver_observability__blocks_tx_count 4 | description: Records of all block transaction counts. This is an intermediate table used for transaction completeness testing 5 | columns: 6 | - name: BLOCK_ID 7 | description: The lowest block id in the test 8 | tests: 9 | - not_null 10 | - unique 11 | - dbt_expectations.expect_column_values_to_be_in_type_list: 12 | column_type_list: 13 | - NUMBER 14 | - name: TRANSACTION_COUNT 15 | description: The lowest block id in the test 16 | tests: 17 | - not_null 18 | - dbt_expectations.expect_column_values_to_be_in_type_list: 19 | column_type_list: 20 | - NUMBER 21 | - name: _INSERTED_TIMESTAMP 22 | description: The lowest block timestamp in the test 23 | tests: 24 | - not_null 25 | - dbt_expectations.expect_column_values_to_be_in_type_list: 26 | column_type_list: 27 | - TIMESTAMP_NTZ -------------------------------------------------------------------------------- /models/silver/accounts/silver__token_account_owners_intermediate.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__token_account_owners_intermediate 4 | columns: 5 | - name: ACCOUNT_ADDRESS 6 | description: address of token account 7 | tests: 8 | - not_null 9 | - name: OWNER 10 | description: address of owner 11 | tests: 12 | - not_null 13 | - name: START_BLOCK_ID 14 | description: block where this ownership begins 15 | tests: 16 | - not_null 17 | - name: END_BLOCK_ID 18 | description: block where this ownership ends, null value represents current ownership 19 | - name: _INSERTED_TIMESTAMP 20 | description: "{{ doc('_inserted_timestamp') }}" 21 | tests: 22 | - not_null -------------------------------------------------------------------------------- /models/silver/backfill/silver__transfers_null_mints_fix.sql: -------------------------------------------------------------------------------- 1 | {{ 2 | config( 3 | materialized = 'incremental', 4 | full_refresh = false 5 | ) 6 | }} 7 | 8 | {% if execute and is_incremental() %} 9 | {% set next_block_date_to_process_query %} 10 | select min(block_timestamp::date)-1 from {{ this }} 11 | {% endset %} 12 | {% set next_block_date_to_process = run_query(next_block_date_to_process_query)[0][0] %} 13 | {% endif %} 14 | 15 | select 16 | t.block_timestamp, 17 | tr.*, 18 | ( 19 | silver.udf_get_account_balances_index(dest_token_account, t.account_keys) IS NOT NULL 20 | OR silver.udf_get_account_balances_index(source_token_account, t.account_keys) IS NOT NULL 21 | ) AS is_wsol 22 | from solana.silver.transfers_null_mints AS tr 23 | join solana.silver.transactions AS t 24 | using(tx_id) 25 | where 26 | {% if is_incremental() %} 27 | t.block_timestamp::date = '{{ next_block_date_to_process }}' 28 | {% else %} 29 | t.block_timestamp::date = '2024-12-04' 30 | {% endif %} -------------------------------------------------------------------------------- /models/silver/bridges/silver__bridge_mayan_transfers_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | 6 | SELECT 7 | block_timestamp, 8 | block_id, 9 | tx_id, 10 | succeeded, 11 | index, 12 | program_id, 13 | platform, 14 | direction, 15 | user_address, 16 | amount, 17 | mint, 18 | _inserted_timestamp, 19 | bridge_mayan_transfers_id, 20 | inserted_timestamp, 21 | modified_timestamp, 22 | _invocation_id 23 | FROM 24 | {{ source('solana_silver', 'bridge_mayan_transfers') }} 25 | 26 | 27 | -------------------------------------------------------------------------------- /models/silver/core/silver__decoded_instructions_data.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "CONCAT_WS('-', tx_id, event_index)", 4 | incremental_strategy = 'delete+insert', 5 | cluster_by = ['program_id'], 6 | full_refresh = false, 7 | enabled = false, 8 | ) }} 9 | 10 | SELECT 11 | tx_id, 12 | event_index, 13 | program_id, 14 | instruction_type, 15 | DATA, 16 | TO_TIMESTAMP_NTZ( 17 | SUBSTR(SPLIT_PART(metadata$filename, '/', 4), 1, 10) :: NUMBER, 18 | 0 19 | ) AS _inserted_timestamp 20 | FROM 21 | {{ source( 22 | 'bronze_streamline', 23 | 'decoded_instructions_data_api' 24 | ) }} 25 | 26 | {% if is_incremental() %} 27 | WHERE _inserted_timestamp >= ( 28 | SELECT 29 | MAX(_inserted_timestamp) 30 | FROM 31 | {{ this }} 32 | ) 33 | {% endif %} 34 | 35 | qualify(ROW_NUMBER() over (PARTITION BY tx_id, event_index 36 | ORDER BY 37 | _inserted_timestamp DESC)) = 1 38 | -------------------------------------------------------------------------------- /models/silver/core/silver__decoded_instructions_data.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__decoded_instructions_data 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - TX_ID 8 | - EVENT_INDEX 9 | columns: 10 | - name: TX_ID 11 | description: "{{ doc('tx_id') }}" 12 | tests: 13 | - not_null 14 | - name: EVENT_INDEX 15 | description: "{{ doc('event_index') }}" 16 | tests: 17 | - not_null 18 | - name: PROGRAM_ID 19 | description: "{{ doc('program_id') }}" 20 | tests: 21 | - not_null 22 | - name: INSTRUCTION_TYPE 23 | description: "Type of instruction being decoded for the specific program" 24 | tests: 25 | - not_null 26 | - name: DATA 27 | description: "JSON object with decoded instructions data" 28 | tests: 29 | - not_null 30 | - name: _INSERTED_TIMESTAMP 31 | description: "{{ doc('_inserted_timestamp') }}" 32 | tests: 33 | - not_null -------------------------------------------------------------------------------- /models/silver/gauges/silver__gauges_creates_marinade_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | signer, 11 | gauge, 12 | gaugemeister, 13 | validator_account 14 | FROM 15 | {{ source( 16 | 'solana_silver', 17 | 'gauges_creates_marinade' 18 | ) }} -------------------------------------------------------------------------------- /models/silver/gauges/silver__gauges_votes_marinade_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | voter, 11 | voter_nft, 12 | gauge, 13 | NULL AS power, 14 | delegated_shares 15 | FROM 16 | {{ source( 17 | 'solana_silver', 18 | 'gauges_votes_marinade' 19 | ) }} -------------------------------------------------------------------------------- /models/silver/gauges/silver__gauges_votes_saber.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__gauges_votes_saber 4 | columns: 5 | - name: BLOCK_TIMESTAMP 6 | description: "{{ doc('block_timestamp') }}" 7 | - name: BLOCK_ID 8 | description: "{{ doc('block_id') }}" 9 | - name: TX_ID 10 | description: "{{ doc('tx_id') }}" 11 | - name: SUCCEEDED 12 | description: "{{ doc('tx_succeeded') }}" 13 | - name: VOTER 14 | description: "{{ doc('tribeca_gauge_voter') }}" 15 | - name: GAUGE 16 | description: "{{ doc('tribeca_gauge') }}" 17 | - name: DELEGATED_SHARES 18 | description: "{{ doc('tribeca_gauge_delegated_shares') }}" 19 | - name: POWER 20 | description: "{{ doc('tribeca_gauge_power') }}" 21 | - name: _INSERTED_TIMESTAMP 22 | description: "{{ doc('_inserted_timestamp') }}" -------------------------------------------------------------------------------- /models/silver/governance/silver__gov_actions_saber_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | signer, 11 | locker_account, 12 | escrow_account, 13 | mint, 14 | action, 15 | amount, 16 | _inserted_timestamp, 17 | gov_actions_saber_id, 18 | inserted_timestamp, 19 | modified_timestamp, 20 | _invocation_id 21 | FROM 22 | {{ source( 23 | 'solana_silver', 24 | 'gov_actions_saber' 25 | ) }} 26 | -------------------------------------------------------------------------------- /models/silver/governance/silver__proposal_votes_marinade_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | voter, 11 | voter_nft, 12 | voter_account, 13 | proposal, 14 | _inserted_timestamp, 15 | proposal_votes_marinade_id, 16 | inserted_timestamp, 17 | modified_timestamp, 18 | _invocation_id 19 | FROM 20 | {{ source( 21 | 'solana_silver', 22 | 'proposal_votes_marinade' 23 | ) }} -------------------------------------------------------------------------------- /models/silver/idls/silver__idls.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__idls 4 | columns: 5 | - name: PROGRAM_ID 6 | description: "{{ doc('program_id') }}" 7 | tests: 8 | - not_null 9 | - name: EARLIEST_DECODED_BLOCK 10 | description: "{{ doc('earliest_decoded_block') }}" 11 | - name: IDL 12 | description: "The complete IDL that defines the program" 13 | - name: IDL_HASH 14 | description: "The deployed hash of the program IDL" 15 | - name: IS_VALID 16 | description: "{{ doc('is_valid') }}" 17 | tests: 18 | - not_null 19 | - name: SUBMITTED_BY 20 | description: "{{ doc('submitted_by') }}" 21 | tests: 22 | - not_null 23 | - name: FIRST_BLOCK_ID 24 | description: "{{ doc('first_block_id') }}" 25 | - name: BACKFILL_STATUS 26 | description: "{{ doc('backfill_status') }}" 27 | - name: DATE_SUBMITTED 28 | description: "{{ doc('backfill_status') }}" 29 | 30 | -------------------------------------------------------------------------------- /models/silver/labels/silver__date_hours.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'table', 3 | tags=['scheduled_non_core'], 4 | ) }} 5 | 6 | SELECT 7 | * 8 | FROM 9 | {{ ref('bronze__date_hours') }} 10 | -------------------------------------------------------------------------------- /models/silver/labels/silver__labels.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = ['address','blockchain'], 4 | incremental_strategy = 'merge', 5 | merge_exclude_columns = ["inserted_timestamp"], 6 | cluster_by = 'modified_timestamp::DATE', 7 | post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(address); DELETE FROM {{ this }} WHERE _is_deleted = TRUE;", 8 | tags=['scheduled_non_core','scheduled_non_core_hourly'], 9 | ) }} 10 | 11 | SELECT 12 | system_created_at, 13 | insert_date, 14 | blockchain, 15 | address, 16 | creator, 17 | label_type, 18 | label_subtype, 19 | address_name, 20 | project_name, 21 | _is_deleted, 22 | labels_combined_id, 23 | SYSDATE() AS inserted_timestamp, 24 | SYSDATE() AS modified_timestamp, 25 | '{{ invocation_id }}' AS _invocation_id 26 | FROM 27 | {{ ref('bronze__labels') }} 28 | WHERE 29 | 1 = 1 30 | 31 | {% if is_incremental() %} 32 | AND modified_timestamp >= ( 33 | SELECT 34 | MAX( 35 | modified_timestamp 36 | ) 37 | FROM 38 | {{ this }} 39 | ) 40 | {% endif %} -------------------------------------------------------------------------------- /models/silver/labels/silver__labels.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__labels 4 | 5 | columns: 6 | - name: BLOCKCHAIN 7 | tests: 8 | - not_null 9 | - name: ADDRESS 10 | tests: 11 | - not_null -------------------------------------------------------------------------------- /models/silver/labels/silver__mint_types.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__mint_types 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - mint 8 | columns: 9 | - name: mint 10 | description: "{{ doc('mint') }}" 11 | tests: 12 | - not_null 13 | - name: decimal 14 | description: "{{ doc('decimal') }}" 15 | tests: 16 | - not_null 17 | - name: mint_type 18 | description: "General type of the mint" 19 | tests: 20 | - not_null 21 | - name: mint_standard_type 22 | description: "{{ doc('mint_standard_type') }}" 23 | -------------------------------------------------------------------------------- /models/silver/liquidity_pool/silver__burns_orca_non_whirlpool_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_id, 7 | block_timestamp, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | action, 14 | mint, 15 | amount, 16 | liquidity_provider, 17 | liquidity_pool_address, 18 | _inserted_timestamp 19 | FROM 20 | {{ source( 21 | 'solana_silver', 22 | 'burns_orca_non_whirlpool' 23 | ) }} 24 | -------------------------------------------------------------------------------- /models/silver/liquidity_pool/silver__initialization_pools_orca_view.sql: -------------------------------------------------------------------------------- 1 | 2 | {{ config( 3 | materialized = 'view' 4 | ) }} 5 | 6 | SELECT 7 | block_timestamp, 8 | block_id, 9 | tx_id, 10 | liquidity_pool, 11 | owner, 12 | mint_authority, 13 | token_a_account, 14 | token_b_account, 15 | pool_token, 16 | _inserted_timestamp 17 | FROM 18 | {{ source( 19 | 'solana_silver', 20 | 'initialization_pools_orca' 21 | ) }} 22 | -------------------------------------------------------------------------------- /models/silver/liquidity_pool/silver__mints_orca_non_whirlpool_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_id, 7 | block_timestamp, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | action, 14 | mint, 15 | amount, 16 | liquidity_provider, 17 | liquidity_pool_address, 18 | _inserted_timestamp 19 | FROM 20 | {{ source( 21 | 'solana_silver', 22 | 'mints_orca_non_whirlpool' 23 | ) }} 24 | -------------------------------------------------------------------------------- /models/silver/liquidity_pool/silver__pool_transfers_orca_non_whirlpool_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_id, 7 | block_timestamp, 8 | tx_id, 9 | succeeded, 10 | INDEX, 11 | inner_index, 12 | program_id, 13 | action, 14 | mint, 15 | amount, 16 | liquidity_provider, 17 | liquidity_pool_address, 18 | _inserted_timestamp 19 | FROM 20 | {{ source( 21 | 'solana_silver', 22 | 'pool_transfers_orca_non_whirlpool' 23 | ) }} 24 | -------------------------------------------------------------------------------- /models/silver/metadata/helius/silver__helius_nft_metadata.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__helius_nft_metadata 4 | description: Contains NFT metadata provided by Helius DAS API 5 | columns: 6 | - name: MINT 7 | description: "{{ doc('mint') }}" 8 | tests: 9 | - not_null 10 | - unique 11 | - name: CREATORS 12 | description: "Creators of the NFT and what percentage of royalties they receive" 13 | - name: AUTHORITY 14 | description: "Authority address for the mint. When editions are minted, the authority remains the one from the master NFT" 15 | - name: NFT_METADATA 16 | description: "Metadata attributes that describe the NFT" 17 | - name: IMAGE_URL 18 | description: "{{ doc('image_url') }}" 19 | - name: METADATA_URI 20 | description: "{{ doc('token_metadata_uri') }}" 21 | - name: NFT_NAME 22 | description: "The name of the NFT" 23 | - name: _INSERTED_TIMESTAMP 24 | description: "{{ doc('_inserted_timestamp') }}" 25 | tests: 26 | - not_null 27 | -------------------------------------------------------------------------------- /models/silver/metadata/helius/silver__helius_nft_requests.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__helius_nft_requests 4 | description: Contains requests to be sent to Helius API 5 | columns: 6 | - name: calls 7 | description: "Request to be passed to LiveQuery" 8 | - name: MAX_MINT_EVENT_INSERTED_TIMESTAMP 9 | description: "The latest inserted timestamp for the mints passed to a call" 10 | - name: _id 11 | description: "The unique id of the request" 12 | tests: 13 | - unique -------------------------------------------------------------------------------- /models/silver/metadata/silver__nft_collection.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__nft_collection 4 | columns: 5 | - name: COLLECTION_ID 6 | description: "The address of the NFT collection" 7 | tests: 8 | - not_null 9 | - unique 10 | - name: NFT_COLLECTION_NAME 11 | description: "The name of the collection provided by Solscan" 12 | - name: SOLSCAN_COLLECTION_ID 13 | description: "Solscan's unique id for the collection" 14 | - name: _inserted_timestamp 15 | description: "{{ doc('_inserted_timestamp') }}" 16 | tests: 17 | - not_null 18 | - name: inserted_timestamp 19 | description: "{{ doc('inserted_timestamp') }}" 20 | tests: 21 | - not_null 22 | - dbt_expectations.expect_row_values_to_have_recent_data: 23 | datepart: day 24 | interval: 2 25 | -------------------------------------------------------------------------------- /models/silver/metadata/silver__nft_collection_view.sql: -------------------------------------------------------------------------------- 1 | {{ 2 | config( 3 | materialized = 'view', 4 | ) 5 | }} 6 | 7 | SELECT * 8 | FROM 9 | {{ source('solana_silver', 'nft_collection') }} -------------------------------------------------------------------------------- /models/silver/nfts/silver___nft_distinct_mints.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver___nft_distinct_mints 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - MINT 8 | columns: 9 | - name: MINT 10 | description: "{{ doc('mint') }}" 11 | tests: 12 | - not_null 13 | - name: _INSERTED_TIMESTAMP 14 | description: "{{ doc('_inserted_timestamp') }}" 15 | tests: 16 | - not_null -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_mint_price_other_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | mint, 7 | payer, 8 | mint_currency, 9 | decimal, 10 | program_id, 11 | mint_price, 12 | tx_ids, 13 | block_timestamp, 14 | _inserted_timestamp 15 | FROM 16 | {{ source( 17 | 'solana_silver', 18 | 'nft_mint_price_other' 19 | ) }} -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_amm_sell_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | mint, 14 | purchaser, 15 | seller, 16 | sales_amount, 17 | marketplace, 18 | _inserted_timestamp, 19 | nft_sales_amm_sell_id, 20 | inserted_timestamp, 21 | modified_timestamp, 22 | _invocation_id 23 | FROM 24 | {{ source( 25 | 'solana_silver', 26 | 'nft_sales_amm_sell' 27 | ) }} 28 | -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_coral_cube_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | purchaser, 14 | seller, 15 | mint, 16 | sales_amount 17 | FROM 18 | {{ source( 19 | 'solana_silver', 20 | 'nft_sales_coral_cube' 21 | ) }} -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_hadeswap_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | mint, 14 | purchaser, 15 | seller, 16 | sales_amount, 17 | _inserted_timestamp, 18 | nft_sales_hadeswap_id, 19 | inserted_timestamp, 20 | modified_timestamp, 21 | _invocation_id 22 | FROM 23 | {{ source( 24 | 'solana_silver', 25 | 'nft_sales_hadeswap' 26 | ) }} 27 | -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_hyperspace_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | purchaser, 14 | seller, 15 | mint, 16 | sales_amount, 17 | _inserted_timestamp, 18 | nft_sales_hyperspace_id, 19 | inserted_timestamp, 20 | modified_timestamp, 21 | _invocation_id 22 | FROM 23 | {{ source( 24 | 'solana_silver', 25 | 'nft_sales_hyperspace' 26 | ) }} 27 | -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_magic_eden_v1_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | purchaser, 14 | seller, 15 | mint, 16 | sales_amount 17 | FROM 18 | {{ source( 19 | 'solana_silver', 20 | 'nft_sales_magic_eden_v1' 21 | ) }} 22 | -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_opensea_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | purchaser, 14 | seller, 15 | mint, 16 | sales_amount 17 | FROM 18 | {{ source( 19 | 'solana_silver', 20 | 'nft_sales_opensea' 21 | ) }} -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_smb_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | mint, 14 | purchaser, 15 | seller, 16 | sales_amount, 17 | _inserted_timestamp, 18 | nft_sales_smb_id, 19 | inserted_timestamp, 20 | modified_timestamp, 21 | _invocation_id 22 | FROM 23 | {{ source( 24 | 'solana_silver', 25 | 'nft_sales_smb' 26 | ) }} 27 | -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_solanart_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | program_id, 11 | index, 12 | inner_index, 13 | mint, 14 | purchaser, 15 | seller, 16 | sales_amount, 17 | _inserted_timestamp, 18 | nft_sales_solanart_id, 19 | inserted_timestamp, 20 | modified_timestamp, 21 | _invocation_id 22 | FROM 23 | {{ source( 24 | 'solana_silver', 25 | 'nft_sales_solanart' 26 | ) }} 27 | -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_solport_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | purchaser, 14 | seller, 15 | mint, 16 | sales_amount 17 | FROM 18 | {{ source( 19 | 'solana_silver', 20 | 'nft_sales_solport' 21 | ) }} 22 | -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_solsniper_cnft_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_id, 7 | block_timestamp, 8 | program_id, 9 | tx_id, 10 | succeeded, 11 | index, 12 | inner_index, 13 | purchaser, 14 | seller, 15 | tree_authority, 16 | merkle_tree, 17 | leaf_index, 18 | mint, 19 | mint_inserted_timestamp, 20 | sales_amount, 21 | _inserted_timestamp, 22 | nft_sales_solsniper_cnft_id, 23 | inserted_timestamp, 24 | modified_timestamp 25 | FROM 26 | {{ source( 27 | 'solana_silver', 28 | 'nft_sales_solsniper_cnft' 29 | ) }} -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_solsniper_v1_events_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | purchaser, 14 | seller, 15 | mint, 16 | sales_amount, 17 | _inserted_timestamp, 18 | nft_sales_solsniper_id, 19 | inserted_timestamp, 20 | modified_timestamp, 21 | invocation_id 22 | FROM 23 | {{ source( 24 | 'solana_silver', 25 | 'nft_sales_solsniper_v1_events' 26 | ) }} 27 | -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_solsniper_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | purchaser, 14 | seller, 15 | mint, 16 | sales_amount, 17 | _inserted_timestamp, 18 | nft_sales_solsniper_id, 19 | inserted_timestamp, 20 | modified_timestamp, 21 | invocation_id 22 | FROM 23 | {{ source( 24 | 'solana_silver', 25 | 'nft_sales_solsniper' 26 | ) }} 27 | -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_tensorswap_buysellevent_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | INDEX, 11 | inner_index, 12 | log_index, 13 | program_id, 14 | event_type, 15 | creator_fee, 16 | mm_fee, 17 | tswap_fee, 18 | sales_amount, 19 | _inserted_timestamp, 20 | nft_sales_tensorswap_buysellevent_id, 21 | inserted_timestamp, 22 | modified_timestamp, 23 | _invocation_id 24 | FROM 25 | {{ source( 26 | 'solana_silver', 27 | 'nft_sales_tensorswap_buysellevent' 28 | ) }} 29 | -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_tensorswap_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | purchaser, 14 | seller, 15 | mint, 16 | sales_amount, 17 | _inserted_timestamp, 18 | nft_sales_tensorswap_id, 19 | inserted_timestamp, 20 | modified_timestamp, 21 | _invocation_id 22 | FROM 23 | {{ source( 24 | 'solana_silver', 25 | 'nft_sales_tensorswap' 26 | ) }} 27 | -------------------------------------------------------------------------------- /models/silver/nfts/silver__nft_sales_yawww_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | tx_id, 9 | succeeded, 10 | index, 11 | inner_index, 12 | program_id, 13 | purchaser, 14 | seller, 15 | mint, 16 | sales_amount 17 | FROM 18 | {{ source( 19 | 'solana_silver', 20 | 'nft_sales_yawww' 21 | ) }} -------------------------------------------------------------------------------- /models/silver/non_core/silver__epoch.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'table', 3 | unique_key = ['epoch'] 4 | ) }} 5 | 6 | SELECT 7 | ROW_NUMBER() over ( 8 | ORDER BY 9 | SEQ4() 10 | ) - 1 :: INT AS epoch, 11 | CASE 12 | WHEN epoch = 0 THEN 1 13 | ELSE epoch * 432000 14 | END AS start_block, 15 | CASE 16 | WHEN epoch = 0 THEN 431999 17 | ELSE ((epoch + 1) * 432000) -1 18 | END AS end_block, 19 | {{ dbt_utils.generate_surrogate_key(['epoch']) }} AS epoch_id, 20 | SYSDATE() AS inserted_timestamp, 21 | SYSDATE() AS modified_timestamp, 22 | '{{ invocation_id }}' AS invocation_id 23 | FROM 24 | TABLE(GENERATOR(rowcount => 5000)) 25 | -------------------------------------------------------------------------------- /models/silver/non_core/silver__epoch.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__epoch 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - EPOCH 8 | columns: 9 | - name: EPOCH 10 | description: "{{ doc('epoch') }}" 11 | tests: 12 | - not_null 13 | - name: START_BLOCK 14 | description: "{{ doc('start_block') }}" 15 | tests: 16 | - not_null 17 | - name: END_BLOCK 18 | description: "{{ doc('end_block') }}" 19 | tests: 20 | - not_null -------------------------------------------------------------------------------- /models/silver/non_core/silver__signers_nfts_held.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__signers_nfts_held 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - SIGNER 8 | - NFT_HELD 9 | columns: 10 | - name: SIGNER 11 | description: The address of the user that initiated the transaction 12 | tests: 13 | - not_null 14 | - name: NFT_HELD 15 | description: The mint of an NFT currently held by the signer 16 | tests: 17 | - not_null 18 | - name: _INSERTED_TIMESTAMP 19 | descripton: The time the record was inserted into the table 20 | tests: 21 | - not_null -------------------------------------------------------------------------------- /models/silver/non_core/silver__votes_agg_block.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "block_id", 4 | incremental_strategy = 'delete+insert', 5 | cluster_by = ['block_timestamp::DATE'], 6 | tags = ['scheduled_non_core'] 7 | ) }} 8 | 9 | WITH pre_final AS ( 10 | SELECT 11 | block_id, 12 | max(block_timestamp) as block_timestamp, 13 | count(block_id) AS num_votes 14 | FROM {{ ref('silver__votes') }} 15 | 16 | {% if is_incremental() %} 17 | WHERE _inserted_timestamp::date >= current_date - 1 18 | {% endif %} 19 | 20 | GROUP BY block_id 21 | ) 22 | 23 | SELECT 24 | block_timestamp, 25 | block_id, 26 | num_votes, 27 | {{ dbt_utils.generate_surrogate_key( 28 | ['block_id'] 29 | ) }} AS votes_agg_block_id, 30 | SYSDATE() AS inserted_timestamp, 31 | SYSDATE() AS modified_timestamp, 32 | '{{ invocation_id }}' AS _invocation_id 33 | FROM pre_final -------------------------------------------------------------------------------- /models/silver/non_core/silver__votes_agg_block.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__votes_agg_block 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - BLOCK_ID 8 | where: block_timestamp::date >= current_date - 2 9 | columns: 10 | - name: BLOCK_TIMESTAMP 11 | description: "{{ doc('block_timestamp') }}" 12 | tests: 13 | - not_null: 14 | where: block_id > 39824213 15 | - dbt_expectations.expect_row_values_to_have_recent_data: 16 | datepart: day 17 | interval: 2 18 | - name: BLOCK_ID 19 | description: "{{ doc('block_id') }}" 20 | tests: 21 | - not_null 22 | - name: NUM_VOTES 23 | description: The number of vote events that occurred within the block 24 | tests: 25 | - not_null -------------------------------------------------------------------------------- /models/silver/olas/silver_olas__registry_metadata.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver_olas__registry_metadata 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - REGISTRY_METADATA_ID 8 | columns: 9 | - name: BLOCK_ID 10 | tests: 11 | - not_null 12 | - name: PROGRAM_ID 13 | tests: 14 | - not_null 15 | - name: REGISTRY_ID 16 | tests: 17 | - not_null -------------------------------------------------------------------------------- /models/silver/olas/silver_olas__registry_metadata_complete.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | m.name, 7 | m.description, 8 | m.registry_id, 9 | m.program_id, 10 | CASE 11 | WHEN m.program_id = 'AU428Z7KbjRMjhmqWmQwUta2AvydbpfEZNBh8dStHTDi' THEN 'Service' 12 | END AS registry_type, 13 | m.trait_type, 14 | m.trait_value, 15 | m.code_uri_link, 16 | m.image_link, 17 | s.agent_ids, 18 | m.registry_metadata_id, 19 | m.inserted_timestamp, 20 | GREATEST( 21 | COALESCE( 22 | m.modified_timestamp, 23 | '1970-01-01' :: TIMESTAMP 24 | ), 25 | COALESCE( 26 | s.modified_timestamp, 27 | '1970-01-01' :: TIMESTAMP 28 | ) 29 | ) AS modified_timestamp 30 | FROM 31 | {{ ref('silver_olas__registry_metadata') }} 32 | m 33 | LEFT JOIN {{ ref('silver_olas__service_registrations') }} 34 | s 35 | ON m.registry_id = s.service_id -------------------------------------------------------------------------------- /models/silver/olas/silver_olas__registry_metadata_complete.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver_olas__registry_metadata_complete 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - REGISTRY_METADATA_ID 8 | columns: 9 | - name: PROGRAM_ID 10 | tests: 11 | - not_null 12 | - name: REGISTRY_ID 13 | tests: 14 | - not_null -------------------------------------------------------------------------------- /models/silver/olas/silver_olas__service_event_logs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver_olas__service_event_logs 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - TX_ID 8 | - INDEX 9 | - INNER_INDEX 10 | columns: 11 | - name: BLOCK_ID 12 | tests: 13 | - not_null 14 | - name: BLOCK_TIMESTAMP 15 | tests: 16 | - not_null 17 | - name: TX_ID 18 | tests: 19 | - not_null 20 | - name: MULTISIG_ADDRESS 21 | tests: 22 | - not_null -------------------------------------------------------------------------------- /models/silver/olas/silver_olas__service_registrations.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver_olas__service_registrations 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - TX_ID 8 | - INDEX 9 | columns: 10 | - name: BLOCK_ID 11 | tests: 12 | - not_null 13 | - name: BLOCK_TIMESTAMP 14 | tests: 15 | - not_null 16 | - name: TX_ID 17 | tests: 18 | - not_null 19 | - name: OWNER_ADDRESS 20 | tests: 21 | - not_null 22 | - name: MULTISIG_ADDRESS 23 | tests: 24 | - not_null 25 | - name: SERVICE_ID 26 | tests: 27 | - not_null -------------------------------------------------------------------------------- /models/silver/prices/silver__complete_native_asset_metadata.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | incremental_strategy = 'delete+insert', 4 | unique_key = 'complete_native_asset_metadata_id', 5 | tags = ['scheduled_non_core'] 6 | ) }} 7 | 8 | SELECT 9 | asset_id, 10 | symbol, 11 | NAME, 12 | decimals, 13 | blockchain, 14 | is_deprecated, 15 | provider, 16 | source, 17 | _inserted_timestamp, 18 | inserted_timestamp, 19 | modified_timestamp, 20 | complete_native_asset_metadata_id, 21 | _invocation_id 22 | FROM 23 | {{ ref( 24 | 'bronze__complete_native_asset_metadata' 25 | ) }} 26 | 27 | {% if is_incremental() %} 28 | WHERE 29 | modified_timestamp >= ( 30 | SELECT 31 | MAX( 32 | modified_timestamp 33 | ) 34 | FROM 35 | {{ this }} 36 | ) 37 | {% endif %} 38 | -------------------------------------------------------------------------------- /models/silver/prices/silver__complete_native_asset_metadata.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__complete_native_asset_metadata 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - SYMBOL 8 | 9 | columns: 10 | - name: PROVIDER 11 | tests: 12 | - not_null 13 | - name: SYMBOL 14 | tests: 15 | - not_null 16 | - name: BLOCKCHAIN 17 | tests: 18 | - not_null 19 | - name: MODIFIED_TIMESTAMP 20 | tests: 21 | - not_null 22 | - name: COMPLETE_NATIVE_ASSET_METADATA_ID 23 | tests: 24 | - unique -------------------------------------------------------------------------------- /models/silver/prices/silver__complete_native_prices.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | incremental_strategy = 'delete+insert', 4 | unique_key = 'complete_native_prices_id', 5 | cluster_by = ['HOUR::DATE'], 6 | tags = ['scheduled_non_core','scheduled_non_core_hourly'] 7 | ) }} 8 | 9 | SELECT 10 | HOUR, 11 | asset_id, 12 | symbol, 13 | NAME, 14 | decimals, 15 | price, 16 | blockchain, 17 | is_imputed, 18 | is_deprecated, 19 | provider, 20 | source, 21 | _inserted_timestamp, 22 | inserted_timestamp, 23 | modified_timestamp, 24 | complete_native_prices_id, 25 | _invocation_id 26 | FROM 27 | {{ ref( 28 | 'bronze__complete_native_prices' 29 | ) }} 30 | 31 | {% if is_incremental() %} 32 | WHERE 33 | modified_timestamp >= ( 34 | SELECT 35 | MAX( 36 | modified_timestamp 37 | ) 38 | FROM 39 | {{ this }} 40 | ) 41 | {% endif %} 42 | -------------------------------------------------------------------------------- /models/silver/prices/silver__complete_native_prices.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__complete_native_prices 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - HOUR 8 | - SYMBOL 9 | 10 | columns: 11 | - name: HOUR 12 | tests: 13 | - not_null 14 | - name: SYMBOL 15 | tests: 16 | - not_null 17 | - name: BLOCKCHAIN 18 | tests: 19 | - not_null 20 | - name: PROVIDER 21 | tests: 22 | - not_null 23 | - name: PRICE 24 | tests: 25 | - not_null 26 | - name: IS_IMPUTED 27 | tests: 28 | - not_null 29 | - name: _INSERTED_TIMESTAMP 30 | tests: 31 | - not_null 32 | - name: MODIFIED_TIMESTAMP 33 | tests: 34 | - not_null 35 | - name: COMPLETE_NATIVE_PRICES_ID 36 | tests: 37 | - unique -------------------------------------------------------------------------------- /models/silver/prices/silver__complete_provider_asset_metadata.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | incremental_strategy = 'delete+insert', 4 | unique_key = 'complete_provider_asset_metadata_id', 5 | post_hook = enable_search_optimization('{{this.schema}}', '{{this.identifier}}', 'ON EQUALITY(asset_id,token_address,name,symbol)'), 6 | tags = ['scheduled_non_core'] 7 | ) }} 8 | 9 | SELECT 10 | asset_id, 11 | token_address, 12 | NAME, 13 | symbol, 14 | platform, 15 | platform_id, 16 | provider, 17 | source, 18 | _inserted_timestamp, 19 | inserted_timestamp, 20 | modified_timestamp, 21 | complete_provider_asset_metadata_id, 22 | _invocation_id 23 | FROM 24 | {{ ref( 25 | 'bronze__complete_provider_asset_metadata' 26 | ) }} 27 | 28 | {% if is_incremental() %} 29 | WHERE 30 | modified_timestamp >= ( 31 | SELECT 32 | MAX( 33 | modified_timestamp 34 | ) 35 | FROM 36 | {{ this }} 37 | ) 38 | {% endif %} -------------------------------------------------------------------------------- /models/silver/prices/silver__complete_provider_asset_metadata.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__complete_provider_asset_metadata 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - ASSET_ID 8 | - TOKEN_ADDRESS 9 | - NAME 10 | - SYMBOL 11 | - PLATFORM 12 | - PLATFORM_ID 13 | - PROVIDER 14 | columns: 15 | - name: PROVIDER 16 | tests: 17 | - not_null 18 | - name: ASSET_ID 19 | tests: 20 | - not_null 21 | - name: MODIFIED_TIMESTAMP 22 | tests: 23 | - not_null 24 | - name: COMPLETE_PROVIDER_ASSET_METADATA_ID 25 | tests: 26 | - unique -------------------------------------------------------------------------------- /models/silver/prices/silver__complete_provider_prices.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__complete_provider_prices 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - ASSET_ID 8 | - RECORDED_HOUR 9 | - PROVIDER 10 | columns: 11 | - name: PROVIDER 12 | tests: 13 | - not_null 14 | - name: ASSET_ID 15 | tests: 16 | - not_null 17 | - name: RECORDED_HOUR 18 | tests: 19 | - not_null 20 | - name: MODIFIED_TIMESTAMP 21 | tests: 22 | - not_null 23 | - name: COMPLETE_PROVIDER_PRICES_ID 24 | tests: 25 | - unique -------------------------------------------------------------------------------- /models/silver/prices/silver__complete_token_asset_metadata.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | incremental_strategy = 'delete+insert', 4 | unique_key = 'complete_token_asset_metadata_id', 5 | post_hook = enable_search_optimization('{{this.schema}}', '{{this.identifier}}', 'ON EQUALITY(asset_id,token_address,name,symbol)'), 6 | tags = ['scheduled_non_core'] 7 | ) }} 8 | 9 | SELECT 10 | token_address, 11 | asset_id, 12 | symbol, 13 | NAME, 14 | decimals, 15 | blockchain, 16 | blockchain_name, 17 | blockchain_id, 18 | is_deprecated, 19 | provider, 20 | source, 21 | _inserted_timestamp, 22 | inserted_timestamp, 23 | modified_timestamp, 24 | complete_token_asset_metadata_id, 25 | _invocation_id 26 | FROM 27 | {{ ref( 28 | 'bronze__complete_token_asset_metadata' 29 | ) }} 30 | 31 | {% if is_incremental() %} 32 | WHERE 33 | modified_timestamp >= ( 34 | SELECT 35 | MAX( 36 | modified_timestamp 37 | ) 38 | FROM 39 | {{ this }} 40 | ) 41 | {% endif %} 42 | -------------------------------------------------------------------------------- /models/silver/prices/silver__complete_token_asset_metadata.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__complete_token_asset_metadata 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - TOKEN_ADDRESS 8 | - BLOCKCHAIN 9 | 10 | columns: 11 | - name: PROVIDER 12 | tests: 13 | - not_null 14 | - name: TOKEN_ADDRESS 15 | tests: 16 | - not_null 17 | - name: BLOCKCHAIN 18 | tests: 19 | - not_null 20 | - name: BLOCKCHAIN_ID 21 | tests: 22 | - not_null 23 | - name: MODIFIED_TIMESTAMP 24 | tests: 25 | - not_null 26 | - name: COMPLETE_TOKEN_ASSET_METADATA_ID 27 | tests: 28 | - unique -------------------------------------------------------------------------------- /models/silver/prices/silver__complete_token_prices.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__complete_token_prices 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - HOUR 8 | - TOKEN_ADDRESS 9 | - BLOCKCHAIN 10 | 11 | columns: 12 | - name: HOUR 13 | tests: 14 | - not_null 15 | - name: TOKEN_ADDRESS 16 | tests: 17 | - not_null 18 | - name: BLOCKCHAIN 19 | tests: 20 | - not_null 21 | - name: BLOCKCHAIN_ID 22 | tests: 23 | - not_null 24 | - name: PROVIDER 25 | tests: 26 | - not_null 27 | - name: PRICE 28 | tests: 29 | - not_null 30 | - name: IS_IMPUTED 31 | tests: 32 | - not_null 33 | - name: _INSERTED_TIMESTAMP 34 | tests: 35 | - not_null 36 | - name: MODIFIED_TIMESTAMP 37 | tests: 38 | - not_null 39 | - name: COMPLETE_TOKEN_PRICES_ID 40 | tests: 41 | - unique -------------------------------------------------------------------------------- /models/silver/rewards/silver__rewards_fee_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | reward_amount_sol, 9 | post_balance_sol, 10 | vote_pubkey, 11 | epoch_earned, 12 | _partition_id, 13 | rewards_fee_id, 14 | epoch_id, 15 | inserted_timestamp, 16 | modified_timestamp, 17 | invocation_id, 18 | _inserted_timestamp 19 | FROM 20 | {{ source('solana_silver', 'rewards_fee') }} -------------------------------------------------------------------------------- /models/silver/rewards/silver__rewards_rent_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | reward_amount_sol, 9 | post_balance_sol, 10 | vote_pubkey, 11 | epoch_earned, 12 | _partition_id, 13 | rewards_rent_id, 14 | epoch_id, 15 | inserted_timestamp, 16 | modified_timestamp, 17 | invocation_id, 18 | _inserted_timestamp 19 | FROM 20 | {{ source( 21 | 'solana_silver', 22 | 'rewards_rent' 23 | ) }} -------------------------------------------------------------------------------- /models/silver/rewards/silver__rewards_staking_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | reward_amount_sol, 9 | post_balance_sol, 10 | commission, 11 | stake_pubkey, 12 | epoch_earned, 13 | _partition_id, 14 | rewards_staking_id, 15 | epoch_id, 16 | inserted_timestamp, 17 | modified_timestamp, 18 | invocation_id, 19 | _inserted_timestamp 20 | FROM 21 | {{ source('solana_silver', 'rewards_staking') }} -------------------------------------------------------------------------------- /models/silver/rewards/silver__rewards_voting_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_timestamp, 7 | block_id, 8 | reward_amount_sol, 9 | post_balance_sol, 10 | commission, 11 | vote_pubkey, 12 | epoch_earned, 13 | _partition_id, 14 | rewards_voting_id, 15 | epoch_id, 16 | inserted_timestamp, 17 | modified_timestamp, 18 | invocation_id, 19 | _inserted_timestamp 20 | FROM 21 | {{ source('solana_silver', 'rewards_voting') }} -------------------------------------------------------------------------------- /models/silver/staking/silver__stake_pool_actions_eversol_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | tx_id, 7 | block_id, 8 | block_timestamp, 9 | index, 10 | succeeded, 11 | action, 12 | stake_pool, 13 | stake_pool_withdraw_authority, 14 | stake_pool_deposit_authority, 15 | address, -- use signers instead of instruction account because of "passthrough" wallets 16 | reserve_stake_address, 17 | amount, 18 | _inserted_timestamp, 19 | _unique_key, 20 | stake_pool_actions_eversol_id, 21 | inserted_timestamp, 22 | modified_timestamp, 23 | _invocation_id 24 | FROM 25 | {{ source( 26 | 'solana_silver', 27 | 'stake_pool_actions_eversol' 28 | ) }} -------------------------------------------------------------------------------- /models/silver/staking/silver__stake_pool_actions_lido_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | tx_id, 7 | block_id, 8 | block_timestamp, 9 | index, 10 | succeeded, 11 | action, 12 | stake_pool, 13 | stake_pool_withdraw_authority, 14 | stake_pool_deposit_authority, 15 | address, 16 | reserve_stake_address, 17 | amount, 18 | _inserted_timestamp, 19 | _unique_key, 20 | stake_pool_actions_lido_id, 21 | inserted_timestamp, 22 | modified_timestamp, 23 | _invocation_id 24 | FROM 25 | {{ source( 26 | 'solana_silver', 27 | 'stake_pool_actions_lido' 28 | ) }} -------------------------------------------------------------------------------- /models/silver/staking/silver__stake_pool_actions_socean_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | tx_id, 7 | block_id, 8 | block_timestamp, 9 | index, 10 | succeeded, 11 | action, 12 | stake_pool, 13 | stake_pool_withdraw_authority, 14 | stake_pool_deposit_authority, 15 | address, 16 | reserve_stake_address, 17 | amount, 18 | _inserted_timestamp, 19 | _unique_key, 20 | stake_pool_actions_socean_id, 21 | inserted_timestamp, 22 | modified_timestamp, 23 | _invocation_id 24 | FROM 25 | {{ source( 26 | 'solana_silver', 27 | 'stake_pool_actions_socean' 28 | ) }} -------------------------------------------------------------------------------- /models/silver/swaps/generic/silver__swaps_intermediate_generic_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_id, 7 | block_timestamp, 8 | tx_id, 9 | succeeded, 10 | program_id, 11 | index, 12 | inner_index, 13 | swapper, 14 | from_mint, 15 | from_amt, 16 | to_mint, 17 | to_amt, 18 | _inserted_timestamp, 19 | swap_index, 20 | _log_id 21 | FROM 22 | {{ source( 23 | 'solana_silver', 24 | 'swaps_intermediate_generic' 25 | ) }} 26 | -------------------------------------------------------------------------------- /models/silver/swaps/jupiter/v4/silver__swaps_intermediate_jupiterv4_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | *, 7 | '2000-01-01' as inserted_timestamp, 8 | '2000-01-01' AS modified_timestamp 9 | FROM 10 | {{ source( 11 | 'solana_silver', 12 | 'swaps_intermediate_jupiterv4' 13 | ) }} 14 | -------------------------------------------------------------------------------- /models/silver/swaps/jupiter/v5/silver__swaps_intermediate_jupiterv5_1_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | * 7 | FROM 8 | {{ source( 9 | 'solana_silver', 10 | 'swaps_intermediate_jupiterv5_1' 11 | ) }} 12 | -------------------------------------------------------------------------------- /models/silver/swaps/jupiter/v5/silver__swaps_intermediate_jupiterv5_2_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | * 7 | FROM 8 | {{ source( 9 | 'solana_silver', 10 | 'swaps_intermediate_jupiterv5_2' 11 | ) }} 12 | -------------------------------------------------------------------------------- /models/silver/swaps/jupiter/v6/silver__swaps_intermediate_jupiterv6_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_id, 7 | block_timestamp, 8 | tx_id, 9 | swap_index, 10 | program_id, 11 | succeeded, 12 | swapper, 13 | from_amt, 14 | from_mint, 15 | to_amt, 16 | to_mint, 17 | _inserted_timestamp, 18 | swaps_intermediate_jupiterv6_id, 19 | inserted_timestamp, 20 | modified_timestamp, 21 | invocation_id 22 | FROM 23 | {{ source('solana_silver', 'swaps_intermediate_jupiterv6') }} 24 | -------------------------------------------------------------------------------- /models/silver/swaps/orca/legacy/silver__swaps_intermediate_orca_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_id, 7 | block_timestamp, 8 | tx_id, 9 | succeeded, 10 | program_id, 11 | index, 12 | inner_index, 13 | swapper, 14 | from_mint, 15 | from_amt, 16 | to_mint, 17 | to_amt, 18 | _inserted_timestamp, 19 | swap_index, 20 | _log_id 21 | FROM 22 | {{ source( 23 | 'solana_silver', 24 | 'swaps_intermediate_orca' 25 | ) }} 26 | -------------------------------------------------------------------------------- /models/silver/swaps/silver__swaps_view.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view' 3 | ) }} 4 | 5 | SELECT 6 | block_id, 7 | block_timestamp, 8 | program_id, 9 | tx_id, 10 | succeeded, 11 | swapper, 12 | from_amt, 13 | from_mint, 14 | to_amt, 15 | to_mint, 16 | _log_id, 17 | _inserted_timestamp, 18 | swaps_id, 19 | inserted_timestamp, 20 | modified_timestamp, 21 | _invocation_id 22 | FROM 23 | {{ source( 24 | 'solana_silver', 25 | 'swaps' 26 | ) }} 27 | -------------------------------------------------------------------------------- /models/silver/utils/silver___number_sequence.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'table', 3 | cluster_by = 'round(_id,-3)' 4 | ) }} 5 | 6 | SELECT 7 | ROW_NUMBER() over ( 8 | ORDER BY 9 | SEQ4() 10 | ) - 1 :: INT AS _id 11 | FROM 12 | TABLE(GENERATOR(rowcount => 50000000)) -------------------------------------------------------------------------------- /models/silver/validator/silver__historical_block_production.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['validator_historical'] 4 | ) }} 5 | 6 | SELECT 7 | a.json_data:metadata:epoch AS epoch, 8 | f.value:identityPubkey::STRING AS node_pubkey, 9 | f.value:leaderSlots::INT AS num_leader_slots, 10 | f.value:blocksProduced::INT AS num_blocks_produced, 11 | a.json_data:metadata:start_slot::INT AS start_slot, 12 | a.json_data:metadata:end_slot::INT AS end_slot 13 | FROM 14 | {{ source('bronze', 'block_production') }} a, 15 | LATERAL FLATTEN(input => a.json_data:metadata:leaders) AS f 16 | GROUP BY 17 | 1, 2, 3, 4, 5, 6 18 | QUALIFY 19 | row_number() OVER ( 20 | PARTITION BY epoch, node_pubkey 21 | ORDER BY epoch DESC 22 | ) = 1 23 | 24 | UNION ALL 25 | 26 | SELECT 27 | epoch, 28 | node_pubkey, 29 | num_leader_slots, 30 | num_blocks_produced, 31 | start_slot, 32 | end_slot 33 | FROM 34 | {{ ref('silver__snapshot_block_production_view') }} 35 | WHERE 36 | epoch BETWEEN 469 AND 552 -------------------------------------------------------------------------------- /models/silver/validator/silver__historical_block_production.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__historical_block_production 4 | columns: 5 | - name: epoch 6 | description: "Epoch number for the ingested data" 7 | tests: 8 | - not_null 9 | - name: node_pubkey 10 | description: "Pubkey for the Solana validator node" 11 | tests: 12 | - not_null 13 | - name: num_leader_slots 14 | description: "Number of slots the validator was the leader for in the epoch" 15 | - name: num_blocks_produced 16 | description: "Number of blocks the validator produced in the epoch" 17 | - name: start_slot 18 | description: "First slot of the epoch" 19 | - name: end_slot 20 | description: "Final slot of the epoch" 21 | 22 | 23 | -------------------------------------------------------------------------------- /models/silver/validator/silver__snapshot_block_production.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: silver__snapshot_block_production 4 | columns: 5 | - name: epoch 6 | description: "Epoch number for the ingested data" 7 | tests: 8 | - not_null 9 | - name: node_pubkey 10 | description: "Pubkey for the Solana validator node" 11 | tests: 12 | - not_null 13 | - name: num_leader_slots 14 | description: "Number of slots the validator was the leader for in the epoch" 15 | - name: num_blocks_produced 16 | description: "Number of blocks the validator produced in the epoch" 17 | - name: start_slot 18 | description: "First slot of the epoch" 19 | - name: end_slot 20 | description: "Final slot of the epoch" 21 | - name: _inserted_timestamp 22 | description: "{{ doc('_inserted_timestamp') }}" 23 | tests: 24 | - not_null 25 | - dbt_expectations.expect_row_values_to_have_recent_data: 26 | datepart: day 27 | interval: 2 28 | 29 | 30 | -------------------------------------------------------------------------------- /models/silver/validator/silver__snapshot_block_production_view.sql: -------------------------------------------------------------------------------- 1 | {{ 2 | config( 3 | materialized = 'view', 4 | ) 5 | }} 6 | 7 | SELECT 8 | * 9 | FROM 10 | {{ source('solana_silver', 'snapshot_block_production') }} -------------------------------------------------------------------------------- /models/solana_share/solana_share__dim_labels.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "address", 4 | cluster_by = ['address'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | blockchain, 10 | creator, 11 | address, 12 | label_type, 13 | label_subtype, 14 | label, 15 | address_name 16 | FROM {{ref('core__dim_labels')}} -------------------------------------------------------------------------------- /models/solana_share/solana_share__dim_nft_metadata.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "contract_address", 4 | cluster_by = ['contract_address'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | blockchain, 10 | contract_address, 11 | contract_name, 12 | created_at_timestamp, 13 | mint, 14 | creator_address, 15 | creator_name, 16 | image_url, 17 | project_name, 18 | token_id, 19 | token_metadata, 20 | token_metadata_uri, 21 | token_name 22 | FROM {{ref('nft__dim_nft_metadata')}} -------------------------------------------------------------------------------- /models/solana_share/solana_share__ez_staking_lp_actions.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "block_id", 4 | cluster_by = ['block_timestamp::date'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | block_id, 10 | block_timestamp, 11 | tx_id, 12 | succeeded, 13 | INDEX, 14 | event_type, 15 | signers, 16 | stake_authority, 17 | withdraw_authority, 18 | stake_account, 19 | stake_active, 20 | pre_tx_staked_balance, 21 | post_tx_staked_balance, 22 | withdraw_amount, 23 | withdraw_destination, 24 | vote_account, 25 | node_pubkey, 26 | validator_rank, 27 | commission, 28 | validator_name 29 | FROM {{ref('gov__ez_staking_lp_actions')}} 30 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/solana_share/solana_share__fact_blocks.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "block_id", 4 | cluster_by = ['block_timestamp::date'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | block_id, 10 | block_timestamp, 11 | network, 12 | chain_id, 13 | tx_count, 14 | block_height, 15 | block_hash, 16 | previous_block_id, 17 | previous_block_hash 18 | FROM {{ref('core__fact_blocks')}} 19 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/solana_share/solana_share__fact_events.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "tx_id", 4 | cluster_by = ['block_timestamp::date'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | block_timestamp, 10 | block_id, 11 | tx_id, 12 | succeeded, 13 | index, 14 | event_type, 15 | program_id, 16 | instruction, 17 | inner_instruction 18 | FROM {{ref('core__fact_events')}} 19 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/solana_share/solana_share__fact_gauges_creates.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "tx_id", 4 | cluster_by = ['block_timestamp::date'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | program_name, 10 | block_timestamp, 11 | block_id, 12 | tx_id, 13 | succeeded, 14 | signer, 15 | gauge, 16 | gaugemeister, 17 | validator_account 18 | FROM {{ref('gov__fact_gauges_creates')}} 19 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/solana_share/solana_share__fact_gauges_votes.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "tx_id", 4 | cluster_by = ['block_timestamp::date'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | program_name, 10 | block_timestamp, 11 | block_id, 12 | tx_id, 13 | succeeded, 14 | voter, 15 | voter_nft, 16 | gauge, 17 | power, 18 | delegated_shares 19 | FROM {{ref('gov__fact_gauges_votes')}} 20 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/solana_share/solana_share__fact_gov_actions.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "tx_id", 4 | cluster_by = ['block_timestamp::date'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | program_name, 10 | block_timestamp, 11 | block_id, 12 | tx_id, 13 | succeeded, 14 | signer, 15 | locker_account, 16 | locker_nft, 17 | mint, 18 | action, 19 | amount 20 | FROM {{ref('gov__fact_gov_actions')}} 21 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/solana_share/solana_share__fact_nft_mints.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "tx_id", 4 | cluster_by = ['block_timestamp::date'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | block_timestamp, 10 | block_id, 11 | tx_id, 12 | succeeded, 13 | program_id, 14 | purchaser, 15 | mint_price, 16 | mint_currency, 17 | mint 18 | FROM {{ref('nft__fact_nft_mints')}} 19 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/solana_share/solana_share__fact_proposal_votes.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "tx_id", 4 | cluster_by = ['block_timestamp::date'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | governance_platform, 10 | program_name, 11 | block_timestamp, 12 | block_id, 13 | tx_id, 14 | succeeded, 15 | voter, 16 | voter_account, 17 | voter_nft, 18 | proposal, 19 | realms_id, 20 | vote_choice, 21 | vote_rank, 22 | vote_weight 23 | FROM {{ref('gov__fact_proposal_votes')}} 24 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/solana_share/solana_share__fact_staking_lp_actions.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "tx_id", 4 | cluster_by = ['block_timestamp::date'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | block_timestamp, 10 | block_id, 11 | tx_id, 12 | succeeded, 13 | index, 14 | event_type, 15 | program_id, 16 | signers, 17 | account_keys, 18 | instruction, 19 | inner_instruction, 20 | pre_balances, 21 | post_balances, 22 | pre_token_balances, 23 | post_token_balances 24 | FROM {{ref('gov__fact_staking_lp_actions')}} 25 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/solana_share/solana_share__fact_swaps.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'table', 3 | cluster_by = ['block_timestamp::date'], 4 | tags = ['share'] 5 | ) }} 6 | 7 | SELECT 8 | block_timestamp, 9 | block_id, 10 | tx_id, 11 | succeeded, 12 | swapper, 13 | swap_from_amount, 14 | swap_from_mint, 15 | swap_to_amount, 16 | swap_to_mint, 17 | program_id, 18 | swap_program 19 | FROM {{ref('defi__fact_swaps')}} 20 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/solana_share/solana_share__fact_transactions.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "tx_id", 4 | cluster_by = ['block_timestamp::date'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | block_timestamp, 10 | block_id, 11 | tx_id, 12 | recent_block_hash, 13 | signers, 14 | fee, 15 | succeeded, 16 | account_keys, 17 | pre_balances, 18 | post_balances, 19 | pre_token_balances, 20 | post_token_balances, 21 | instructions, 22 | inner_instructions, 23 | log_messages 24 | FROM {{ref('core__fact_transactions')}} 25 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/solana_share/solana_share__fact_transfers.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "tx_id", 4 | cluster_by = ['block_timestamp::date'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | block_timestamp, 10 | block_id, 11 | tx_id, 12 | index, 13 | tx_from, 14 | tx_to, 15 | amount, 16 | mint 17 | FROM {{ref('core__fact_transfers')}} 18 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/solana_share/solana_share__fact_votes_agg_block.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'incremental', 3 | unique_key = "block_id", 4 | cluster_by = ['block_timestamp::date'], 5 | tags = ['share'] 6 | ) }} 7 | 8 | SELECT 9 | block_timestamp, 10 | block_id, 11 | num_votes 12 | FROM {{ref('gov__fact_votes_agg_block')}} 13 | where block_timestamp::date between '2021-12-01' and '2021-12-31' -------------------------------------------------------------------------------- /models/streamline/core/complete/streamline__complete_block_rewards_2.sql: -------------------------------------------------------------------------------- 1 | -- depends_on: {{ ref('bronze__streamline_block_rewards_2') }} 2 | -- depends_on: {{ ref('bronze__streamline_FR_block_rewards_2') }} 3 | 4 | {{ config ( 5 | materialized = "incremental", 6 | unique_key = 'block_id', 7 | cluster_by = "ROUND(block_id, -6)", 8 | ) }} 9 | 10 | SELECT 11 | block_id, 12 | error, 13 | _partition_id, 14 | _inserted_timestamp 15 | FROM 16 | {% if is_incremental() %} 17 | {{ ref('bronze__streamline_block_rewards_2') }} 18 | WHERE 19 | _inserted_timestamp >= ( 20 | SELECT 21 | COALESCE(MAX(_INSERTED_TIMESTAMP), '1970-01-01' :: DATE) max_INSERTED_TIMESTAMP 22 | FROM 23 | {{ this }} 24 | ) 25 | {% else %} 26 | {{ ref('bronze__streamline_FR_block_rewards_2') }} 27 | {% endif %} 28 | QUALIFY 29 | row_number() OVER (PARTITION BY block_id ORDER BY _inserted_timestamp DESC) = 1 -------------------------------------------------------------------------------- /models/streamline/core/complete/streamline__complete_block_txs_2.sql: -------------------------------------------------------------------------------- 1 | -- depends_on: {{ ref('bronze__streamline_block_txs_2') }} 2 | -- depends_on: {{ ref('bronze__streamline_FR_block_txs_2') }} 3 | 4 | {{ config ( 5 | materialized = "incremental", 6 | unique_key = 'block_id', 7 | cluster_by = "ROUND(block_id, -6)", 8 | ) }} 9 | 10 | SELECT 11 | block_id, 12 | _partition_id, 13 | max(_inserted_timestamp) AS _inserted_timestamp 14 | FROM 15 | {% if is_incremental() %} 16 | {{ ref('bronze__streamline_block_txs_2') }} 17 | WHERE 18 | _partition_id > (SELECT coalesce(max(_partition_id), 0) FROM {{ this }}) 19 | AND _inserted_timestamp >= (SELECT coalesce(max(_inserted_timestamp), '1970-01-01' :: DATE) FROM {{ this }}) 20 | {% else %} 21 | {{ ref('bronze__streamline_FR_block_txs_2') }} 22 | {% endif %} 23 | GROUP BY 1,2 -------------------------------------------------------------------------------- /models/streamline/core/complete/streamline__complete_blocks_2.sql: -------------------------------------------------------------------------------- 1 | -- depends_on: {{ ref('bronze__streamline_blocks_2') }} 2 | -- depends_on: {{ ref('bronze__streamline_FR_blocks_2') }} 3 | 4 | {{ config ( 5 | materialized = "incremental", 6 | unique_key = 'block_id', 7 | cluster_by = "ROUND(block_id, -6)", 8 | ) }} 9 | 10 | SELECT 11 | block_id, 12 | error, 13 | _partition_by_created_date, 14 | _inserted_timestamp 15 | FROM 16 | {% if is_incremental() %} 17 | {{ ref('bronze__streamline_blocks_2') }} 18 | {% else %} 19 | {{ ref('bronze__streamline_FR_blocks_2') }} 20 | {% endif %} 21 | WHERE 22 | data IS NOT NULL 23 | {% if is_incremental() %} 24 | AND _inserted_timestamp >= ( 25 | SELECT 26 | coalesce(max(_inserted_timestamp), '1970-01-01'::DATE) max_inserted_timestamp 27 | FROM 28 | {{ this }} 29 | ) 30 | {% endif %} 31 | QUALIFY 32 | row_number() OVER ( 33 | PARTITION BY block_id 34 | ORDER BY _inserted_timestamp DESC 35 | ) = 1 36 | -------------------------------------------------------------------------------- /models/streamline/core/snapshot/streamline__validator_metadata_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = "view", 3 | post_hook = fsc_utils.if_data_call_function_v2( 4 | func = 'streamline.udf_bulk_rest_api_v2', 5 | target = "{{this.schema}}.{{this.identifier}}", 6 | params ={ 7 | "external_table" :"validator_metadata_2", 8 | "sql_limit" :"1", 9 | "producer_batch_size" :"1", 10 | "worker_batch_size" :"1", 11 | "sql_source" :"{{this.identifier}}", 12 | } 13 | ) 14 | ) }} 15 | 16 | SELECT 17 | replace(current_date::string,'-','_') AS partition_key, -- Issue with streamline handling `-` in partition key so changing to `_` 18 | '{{ invocation_id }}' AS invocation_id, 19 | {{ target.database }}.live.udf_api( 20 | 'GET', 21 | '{Service}/validators', 22 | OBJECT_CONSTRUCT( 23 | 'Content-Type', 24 | 'application/json' 25 | ), 26 | {}, 27 | 'Vault/prod/solana/topvalidators_app' 28 | ) AS request 29 | 30 | -------------------------------------------------------------------------------- /models/streamline/core/snapshot/streamline__validators_list_2.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = "view", 3 | post_hook = fsc_utils.if_data_call_function_v2( 4 | func = 'streamline.udf_bulk_rest_api_v2', 5 | target = "{{this.schema}}.{{this.identifier}}", 6 | params ={ 7 | "external_table" :"validators_list_2", 8 | "sql_limit" :"1", 9 | "producer_batch_size" :"1", 10 | "worker_batch_size" :"1", 11 | "sql_source" :"{{this.identifier}}", 12 | } 13 | ) 14 | ) }} 15 | 16 | SELECT 17 | replace(current_date::string,'-','_') AS partition_key, -- Issue with streamline handling `-` in partition key so changing to `_` 18 | '{{ invocation_id }}' AS invocation_id, 19 | {{ target.database }}.live.udf_api( 20 | 'GET', 21 | '{Service}/validators/mainnet.json', 22 | OBJECT_CONSTRUCT( 23 | 'Content-Type', 24 | 'application/json', 25 | 'Token', 26 | '{Authentication}' 27 | ), 28 | {}, 29 | 'Vault/prod/solana/validators_app/api' 30 | ) AS request 31 | -------------------------------------------------------------------------------- /models/streamline/core/streamline__blocks.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = "view", 3 | tags = ['streamline_view'] 4 | ) }} 5 | 6 | SELECT 7 | _id AS block_id 8 | FROM 9 | {{ source( 10 | 'crosschain_silver', 11 | 'number_sequence' 12 | ) }} 13 | WHERE 14 | _id <= ( 15 | SELECT 16 | MAX(block_id) 17 | FROM 18 | {{ ref('streamline__chainhead') }} 19 | ) -------------------------------------------------------------------------------- /models/streamline/core/streamline__chainhead.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = "view", 3 | tags = ['streamline_view'] 4 | ) }} 5 | 6 | SELECT 7 | {{ target.database }}.live.udf_api( 8 | 'POST', 9 | '{service}/{Authentication}', 10 | OBJECT_CONSTRUCT( 11 | 'Content-Type', 12 | 'application/json', 13 | 'fsc-quantum-state', 14 | 'livequery' 15 | ), 16 | OBJECT_CONSTRUCT( 17 | 'id', 18 | 0, 19 | 'jsonrpc', 20 | '2.0', 21 | 'method', 22 | 'getSlot', 23 | 'params', 24 | [] 25 | ), 26 | 'Vault/prod/solana/quicknode/mainnet' 27 | ) :data :result :: INT AS block_id -------------------------------------------------------------------------------- /models/streamline/core/streamline__transactions_and_votes_missing_7_days.sql: -------------------------------------------------------------------------------- 1 | {{ 2 | config( 3 | materialized = 'table', 4 | ) 5 | }} 6 | 7 | SELECT 8 | * 9 | FROM 10 | {{ source('solana_test_silver','transactions_and_votes_missing_7_days') }} 11 | -------------------------------------------------------------------------------- /models/streamline/decode_instructions/streamline__complete_decoded_instructions_2_backfill.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'incremental', 3 | unique_key = 'table_name', 4 | full_refresh = false, 5 | tags = ['streamline_decoder'], 6 | ) }} 7 | 8 | select 9 | 'placeholder'::string as schema_name, 10 | 'placeholder'::string as table_name -------------------------------------------------------------------------------- /models/streamline/decode_instructions/streamline__complete_decoded_instructions_3_backfill.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'incremental', 3 | unique_key = 'table_name', 4 | full_refresh = false, 5 | tags = ['streamline_decoder'], 6 | ) }} 7 | 8 | select 9 | 'placeholder'::string as schema_name, 10 | 'placeholder'::string as table_name -------------------------------------------------------------------------------- /models/streamline/decode_instructions/streamline__idls_nft_compression.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'incremental', 3 | unique_key = 'program_id', 4 | full_refresh = false, 5 | tags = ['streamline_decoder'], 6 | ) }} 7 | 8 | select 9 | 'placeholder'::string as program_id, 10 | {'hello':'world'}::variant as idl, 11 | 'placeholder' as idl_source, 12 | 'flipside' as discord_username, 13 | sha2(idl) as idl_hash, 14 | sysdate() as _inserted_timestamp -------------------------------------------------------------------------------- /models/streamline/decode_logs/streamline__complete_decoded_logs_2_backfill.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'incremental', 3 | unique_key = 'table_name', 4 | full_refresh = false, 5 | tags = ['streamline_decoder_logs'], 6 | ) }} 7 | 8 | select 9 | 'placeholder'::string as schema_name, 10 | 'placeholder'::string as table_name -------------------------------------------------------------------------------- /models/streamline/decode_logs/streamline__complete_decoded_logs_backfill.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'incremental', 3 | unique_key = 'table_name', 4 | full_refresh = false, 5 | tags = ['streamline_decoder_logs'], 6 | ) }} 7 | 8 | select 9 | 'placeholder'::string as schema_name, 10 | 'placeholder'::string as table_name -------------------------------------------------------------------------------- /models/streamline/parser/history/streamline__all_undecoded_instructions_history.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = "view", 3 | post_hook = if_data_call_function( 4 | func = "{{this.schema}}.udf_bulk_program_parser(object_construct('realtime', 'False'))", 5 | target = "{{this.schema}}.{{this.identifier}}" 6 | ), 7 | tags = ['streamline'], 8 | ) }} 9 | 10 | with m as ( 11 | select max(block_id) as max_block_id 12 | from {{ ref('streamline__all_undecoded_instructions_history_queue') }} h 13 | ) 14 | select 15 | INDEX, 16 | program_id, 17 | instruction, 18 | tx_id, 19 | h.block_id 20 | from {{ ref('streamline__all_undecoded_instructions_history_queue') }} h 21 | where h.block_id between (select max_block_id-200000 from m) and (select max_block_id from m) -------------------------------------------------------------------------------- /models/streamline/parser/history/streamline__all_undecoded_instructions_history_in_progress.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'incremental', 3 | cluster_by = "ROUND(block_id, -6)", 4 | full_refresh = false, 5 | tags = ['streamline'], 6 | ) }} 7 | 8 | SELECT 9 | *, 10 | sysdate() as _inserted_timestamp 11 | FROM 12 | {{ ref('streamline__all_undecoded_instructions_history_queue') }} 13 | LIMIT 14 | 0 15 | -------------------------------------------------------------------------------- /models/streamline/parser/history/streamline__complete_decoded_history.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = 'incremental', 3 | unique_key = 'program_id', 4 | tags = ['streamline'], 5 | ) }} 6 | 7 | WITH min_decoded AS ( 8 | 9 | SELECT 10 | SPLIT_PART( 11 | id, 12 | '-', 13 | 3 14 | ) :: STRING AS program_id, 15 | MIN(block_id) AS block_id 16 | FROM 17 | {{ ref('streamline__complete_decoded_instructions') }} 18 | GROUP BY 19 | 1 20 | ) 21 | SELECT 22 | h.program_id 23 | FROM 24 | {{ ref('streamline__idls_history') }} 25 | h 26 | JOIN min_decoded 27 | ON min_decoded.block_id = h.first_block_id 28 | 29 | {% if is_incremental() %} 30 | WHERE 31 | h.program_id NOT IN ( 32 | SELECT 33 | DISTINCT(program_id) 34 | FROM 35 | {{ this }} 36 | ) 37 | {% endif %} 38 | -------------------------------------------------------------------------------- /models/streamline/parser/streamline__complete_decoded_instructions.sql: -------------------------------------------------------------------------------- 1 | -- depends_on: {{ ref('bronze__streamline_program_parser') }} 2 | {{ config ( 3 | materialized = "incremental", 4 | unique_key = "id", 5 | cluster_by = "ROUND(block_id, -3)", 6 | post_hook = enable_search_optimization('{{this.schema}}','{{this.identifier}}','ON EQUALITY(id)'), 7 | tags = ['streamline'], 8 | ) }} 9 | 10 | SELECT 11 | block_id, 12 | concat_ws( 13 | '-', 14 | block_id, 15 | tx_id, 16 | program_id, 17 | index 18 | ) AS id, 19 | _inserted_timestamp 20 | FROM 21 | 22 | {% if is_incremental() %} 23 | {{ ref('bronze__streamline_program_parser') }} 24 | WHERE 25 | _inserted_timestamp >= ( 26 | SELECT 27 | COALESCE(MAX(_inserted_timestamp),'2000-01-01'::timestamp_ntz) _inserted_timestamp 28 | FROM 29 | {{ this }} 30 | ) 31 | {% else %} 32 | {{ ref('bronze__streamline_FR_program_parser') }} 33 | {% endif %} 34 | qualify(ROW_NUMBER() over (PARTITION BY id 35 | ORDER BY 36 | _inserted_timestamp DESC)) = 1 -------------------------------------------------------------------------------- /models/streamline/parser/streamline__unknown_error_instructions.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = "view", 3 | post_hook = if_data_call_function( 4 | func = "{{this.schema}}.udf_bulk_program_parser(object_construct('realtime', 'retry'))", 5 | target = "{{this.schema}}.{{this.identifier}}" 6 | ), 7 | tags = ['streamline'], 8 | ) }} 9 | 10 | SELECT 11 | * 12 | FROM 13 | {{ ref('silver__decoded_instructions') }} 14 | WHERE 15 | decoded_instruction :error IS NOT NULL 16 | -------------------------------------------------------------------------------- /models/streamline/streamline__all_unknown_block_rewards_historical.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['streamline'], 4 | enabled = false, 5 | ) }} 6 | 7 | WITH pre_final AS ( 8 | 9 | SELECT 10 | SEQ8()+99360012 AS block_id 11 | FROM 12 | TABLE(GENERATOR(rowcount => 80000000)) 13 | WHERE 14 | block_id >= 99360012 15 | AND block_id <= 163728008 16 | EXCEPT 17 | SELECT 18 | block_id 19 | FROM 20 | {{ ref('streamline__complete_block_rewards') }} 21 | WHERE 22 | _partition_id > 38754 23 | ) 24 | SELECT 25 | block_id, 26 | ( 27 | SELECT 28 | coalesce(MAX(_partition_id) + 1,1) 29 | FROM 30 | {{ ref('streamline__complete_block_rewards') }} 31 | ) AS batch_id 32 | FROM 33 | pre_final 34 | -------------------------------------------------------------------------------- /models/streamline/streamline__all_unknown_block_txs_historical.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['streamline'], 4 | ) }} 5 | 6 | WITH pre_final AS ( 7 | 8 | SELECT 9 | SEQ8()+98680445 AS block_id 10 | FROM 11 | TABLE(GENERATOR(rowcount => 60000000)) 12 | WHERE 13 | block_id > 98680445 14 | AND block_id <= 148693779 15 | EXCEPT 16 | SELECT 17 | block_id 18 | FROM 19 | {{ ref('streamline__complete_block_txs') }} 20 | ) 21 | SELECT 22 | block_id, 23 | ( 24 | SELECT 25 | coalesce(MAX(_partition_id) + 1,1) 26 | FROM 27 | {{ ref('streamline__complete_block_txs') }} 28 | ) AS batch_id 29 | FROM 30 | pre_final 31 | -------------------------------------------------------------------------------- /models/streamline/streamline__all_unknown_blocks_historical.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | materialized = 'view', 3 | tags = ['streamline'], 4 | ) }} 5 | 6 | SELECT 7 | SEQ8() + 98680445 AS block_id 8 | FROM 9 | TABLE(GENERATOR(rowcount => 60000000)) 10 | WHERE 11 | block_id > 98680445 12 | AND block_id <= 148693779 13 | EXCEPT 14 | SELECT 15 | block_id 16 | FROM 17 | {{ ref('streamline__complete_blocks') }} 18 | -------------------------------------------------------------------------------- /models/streamline/streamline__complete_block_rewards.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = "incremental", 3 | unique_key = "block_id", 4 | cluster_by = "_partition_id", 5 | merge_update_columns = ["_partition_id"], 6 | tags = ['streamline'], 7 | full_refresh = false, 8 | enabled = false, 9 | ) }} 10 | 11 | SELECT 12 | block_id, 13 | error, 14 | _partition_id 15 | FROM 16 | {{ source( 17 | "bronze_streamline", 18 | "block_rewards_api" 19 | ) }} AS s 20 | WHERE 21 | s.block_id IS NOT NULL 22 | 23 | {% if is_incremental() %} 24 | AND s._partition_id > ( 25 | select 26 | coalesce(max(_partition_id),0) 27 | from 28 | {{ this }} 29 | ) 30 | {% endif %} 31 | group by 1,2,3 32 | -------------------------------------------------------------------------------- /models/streamline/streamline__complete_block_rewards.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: streamline__complete_block_rewards 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - BLOCK_ID 8 | columns: 9 | - name: BLOCK_ID 10 | description: "{{ doc('block_id') }}" 11 | tests: 12 | - not_null 13 | - name: _PARTITION_ID 14 | description: Value representing a single pipeline execution batch 15 | tests: 16 | - not_null -------------------------------------------------------------------------------- /models/streamline/streamline__complete_block_txs.sql: -------------------------------------------------------------------------------- 1 | {{ config ( 2 | materialized = "incremental", 3 | unique_key = "block_id", 4 | cluster_by = "_partition_id", 5 | merge_update_columns = ["_partition_id"], 6 | tags = ['streamline'], 7 | ) }} 8 | 9 | SELECT 10 | block_id, 11 | error, 12 | _partition_id 13 | FROM 14 | {{ source( 15 | "bronze_streamline", 16 | "block_txs_api" 17 | ) }} AS s 18 | WHERE 19 | s.block_id IS NOT NULL 20 | 21 | {% if is_incremental() %} 22 | AND s._partition_id > ( 23 | select 24 | coalesce(max(_partition_id),0) 25 | from 26 | {{ this }} 27 | ) 28 | {% endif %} 29 | group by 1,2,3 30 | {% if not is_incremental() %} 31 | qualify(ROW_NUMBER() over (PARTITION BY block_id 32 | ORDER BY 33 | _partition_id DESC)) = 1 34 | {% endif %} 35 | -------------------------------------------------------------------------------- /models/streamline/streamline__complete_block_txs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: streamline__complete_block_txs 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - BLOCK_ID 8 | columns: 9 | - name: BLOCK_ID 10 | description: "{{ doc('block_id') }}" 11 | tests: 12 | - not_null 13 | - name: _PARTITION_ID 14 | description: Value representing a single pipeline execution batch 15 | tests: 16 | - not_null -------------------------------------------------------------------------------- /models/streamline/streamline__complete_blocks.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | models: 3 | - name: streamline__complete_blocks 4 | tests: 5 | - dbt_utils.unique_combination_of_columns: 6 | combination_of_columns: 7 | - BLOCK_ID 8 | columns: 9 | - name: BLOCK_ID 10 | description: "{{ doc('block_id') }}" 11 | tests: 12 | - not_null 13 | - name: _INSERTED_DATE 14 | description: Date that the external file was inserted into s3 15 | tests: 16 | - not_null 17 | - name: _INSERTED_TIMESTAMP 18 | description: "{{ doc('_inserted_timestamp') }}" -------------------------------------------------------------------------------- /package-lock.yml: -------------------------------------------------------------------------------- 1 | packages: 2 | - package: calogica/dbt_expectations 3 | version: 0.8.2 4 | - package: dbt-labs/dbt_external_tables 5 | version: 0.8.2 6 | - package: dbt-labs/dbt_utils 7 | version: 1.0.0 8 | - git: https://github.com/FlipsideCrypto/fsc-utils.git 9 | revision: 62dbf237680acb2f3c68821e279e056f93af7b2f 10 | - package: get-select/dbt_snowflake_query_tags 11 | version: 2.5.0 12 | - package: calogica/dbt_date 13 | version: 0.7.2 14 | - git: https://github.com/FlipsideCrypto/livequery-base.git 15 | revision: 6a453542476e9e36959fbee3b09105c4949833fe 16 | sha1_hash: ae0cad367e221f56ebfd3136a0430e8bc50e0457 17 | -------------------------------------------------------------------------------- /packages.yml: -------------------------------------------------------------------------------- 1 | packages: 2 | - package: calogica/dbt_expectations 3 | version: 0.8.2 4 | - package: dbt-labs/dbt_external_tables 5 | version: 0.8.2 6 | - package: dbt-labs/dbt_utils 7 | version: 1.0.0 8 | - git: https://github.com/FlipsideCrypto/fsc-utils.git 9 | revision: v1.35.0 10 | - package: get-select/dbt_snowflake_query_tags 11 | version: [">=2.0.0", "<3.0.0"] 12 | -------------------------------------------------------------------------------- /profiles.yml: -------------------------------------------------------------------------------- 1 | solana: 2 | target: dev 3 | outputs: 4 | dev: 5 | type: snowflake 6 | account: "{{ env_var('ACCOUNT') }}" 7 | user: "{{ env_var('USER') }}" 8 | password: "{{ env_var('PASSWORD') }}" 9 | role: "{{ env_var('ROLE') }}" 10 | schema: "{{ env_var('SCHEMA') }}" 11 | region: "{{ env_var('REGION') }}" 12 | database: "{{ env_var('DATABASE') }}" 13 | warehouse: "{{ env_var('WAREHOUSE') }}" 14 | threads: 8 15 | client_session_keep_alive: False 16 | prod: 17 | type: snowflake 18 | account: "{{ env_var('ACCOUNT') }}" 19 | user: "{{ env_var('USER') }}" 20 | password: "{{ env_var('PASSWORD') }}" 21 | role: "{{ env_var('ROLE') }}" 22 | schema: "{{ env_var('SCHEMA') }}" 23 | region: "{{ env_var('REGION') }}" 24 | database: "{{ env_var('DATABASE') }}" 25 | warehouse: "{{ env_var('WAREHOUSE') }}" 26 | threads: 8 27 | client_session_keep_alive: False 28 | config: 29 | send_anonymous_usage_stats: False -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | dbt-core>=1.8,<1.9 2 | dbt-snowflake>=1.8,<1.9 3 | protobuf==4.25.3 4 | certifi==2025.1.31 -------------------------------------------------------------------------------- /selectors.yml: -------------------------------------------------------------------------------- 1 | selectors: 2 | - name: integration_tests 3 | description: "Selector for integration tests" 4 | definition: 5 | union: 6 | - method: fqn 7 | value: "livequery_models.deploy.core._utils" 8 | -------------------------------------------------------------------------------- /snapshots/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlipsideCrypto/solana-models/ec1f2c24ffe475d4860d373950ce301e667eab7c/snapshots/.gitkeep -------------------------------------------------------------------------------- /tests/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlipsideCrypto/solana-models/ec1f2c24ffe475d4860d373950ce301e667eab7c/tests/.gitkeep -------------------------------------------------------------------------------- /tests/test_silver__blocks_gaps.sql: -------------------------------------------------------------------------------- 1 | WITH tmp AS ( 2 | SELECT 3 | block_id, 4 | previous_block_id, 5 | block_timestamp 6 | FROM 7 | {{ ref('silver__blocks') }} 8 | ), 9 | missing AS ( 10 | SELECT 11 | t1.previous_block_id AS missing_block_id, 12 | t1.block_timestamp 13 | FROM 14 | tmp t1 15 | LEFT OUTER JOIN tmp t2 16 | ON t1.previous_block_id = t2.block_id 17 | WHERE 18 | t2.block_id IS NULL 19 | AND t1.previous_block_id IS NOT NULL 20 | ), 21 | gaps AS ( 22 | SELECT 23 | ( 24 | SELECT 25 | MAX(block_id) 26 | FROM 27 | solana.silver.blocks 28 | WHERE 29 | block_id > 0 30 | AND block_id < missing_block_id 31 | ) AS gap_start_block_id, 32 | missing_block_id AS gap_end_block_id, 33 | gap_end_block_id - gap_start_block_id AS diff 34 | FROM 35 | missing 36 | WHERE 37 | block_timestamp :: DATE < CURRENT_DATE 38 | ) 39 | SELECT 40 | * 41 | FROM 42 | gaps 43 | WHERE 44 | gap_end_block_id <> 1690556 -- this block is not available 45 | -------------------------------------------------------------------------------- /tests/test_silver__blocks_tx_count_missing_7_days.sql: -------------------------------------------------------------------------------- 1 | {{ 2 | config( 3 | tags=["test_hourly"] 4 | ) 5 | }} 6 | 7 | SELECT 8 | b.block_id 9 | FROM 10 | solana.silver.blocks b 11 | LEFT OUTER JOIN {{ ref('silver___blocks_tx_count') }} 12 | b2 13 | ON b.block_id = b2.block_id 14 | WHERE 15 | b.block_id >= 226000000 16 | AND b.block_timestamp BETWEEN CURRENT_DATE - 8 AND CURRENT_TIMESTAMP - INTERVAL '12 HOUR' 17 | AND b2.block_id IS NULL 18 | -------------------------------------------------------------------------------- /tests/test_silver__decoded_instructions_combined_static_error_threshold_7_days.sql: -------------------------------------------------------------------------------- 1 | {{ 2 | config( 3 | tags=["test_weekly"] 4 | ) 5 | }} 6 | 7 | WITH current_rates AS ( 8 | SELECT 9 | program_id, 10 | block_timestamp :: DATE AS block_date, 11 | count_if( 12 | decoded_instruction :error :: STRING IS NOT NULL 13 | ) AS error_count, 14 | error_count / COUNT(*) AS error_rate 15 | FROM 16 | {{ ref('silver__decoded_instructions_combined') }} 17 | WHERE 18 | block_timestamp :: DATE >= CURRENT_DATE - 7 19 | GROUP BY 20 | 1, 21 | 2 22 | ) 23 | SELECT 24 | * 25 | FROM 26 | current_rates 27 | WHERE 28 | error_rate > 0.01 29 | -------------------------------------------------------------------------------- /tests/test_silver__decoded_instructions_jupiter_limit_signers.sql: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT 2 | signers[0]::string AS signer 3 | FROM 4 | {{ ref('silver__decoded_instructions_combined') }} 5 | WHERE 6 | program_id in ('j1o2qRpjcyUwEvwtcfhEQefh773ZgjxcVRry7LDqg5X','jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu') 7 | AND event_type = 'flashFillOrder' 8 | AND _inserted_timestamp >= current_date - 7 9 | AND signer NOT IN ('j1oAbxxiDUWvoHxEDhWE7THLjEkDQW2cSHYn2vttxTF', 10 | 'Gw9QoW4y72hFDVt3RRzyqcD4qrV4pSqjhMMzwdGunz6H', 11 | 'LoAFmGjxUL84rWHk4X6k8jzrw12Hmb5yyReUXfkFRY6', 12 | '71WDyyCsZwyEYDV91Qrb212rdg6woCHYQhFnmZUBxiJ6', 13 | 'EccxYg7rViwYfn9EMoNu7sUaV82QGyFt6ewiQaH1GYjv', 14 | 'j1oeQoPeuEDmjvyMwBmCWexzCQup77kbKKxV59CnYbd', 15 | 'JTJ9Cz7i43DBeps5PZdX1QVKbEkbWegBzKPxhWgkAf1', 16 | 'j1opmdubY84LUeidrPCsSGskTCYmeJVzds1UWm6nngb', 17 | 'AfQ1oaudsGjvznX4JNEw671hi57JfWo4CWqhtkdgoVHU' 18 | ) -------------------------------------------------------------------------------- /tests/test_silver__decoded_instructions_missing.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | block_id, 3 | tx_id, 4 | INDEX, 5 | COALESCE( 6 | inner_index, 7 | -1 8 | ) 9 | FROM 10 | {% if target.database == 'SOLANA' %} 11 | solana.streamline.complete_decoded_instructions_2 12 | {% else %} 13 | solana_dev.streamline.complete_decoded_instructions_2 14 | {% endif %} 15 | 16 | WHERE 17 | _inserted_timestamp between current_date - 2 and current_date - 1 18 | EXCEPT 19 | SELECT 20 | block_id, 21 | tx_id, 22 | INDEX, 23 | COALESCE( 24 | inner_index, 25 | -1 26 | ) 27 | FROM 28 | {{ ref('silver__decoded_instructions') }} 29 | WHERE 30 | _inserted_timestamp BETWEEN current_date - 2 and current_date - 1 31 | -------------------------------------------------------------------------------- /tests/test_silver__decoded_logs_jupiter_dca_signers.sql: -------------------------------------------------------------------------------- 1 | SELECT DISTINCT 2 | signers[0]::string AS signer 3 | FROM 4 | {{ ref('silver__decoded_logs') }} 5 | WHERE 6 | program_id = 'DCA265Vj8a9CEuX1eb1LWRnDT7uK6q1xMipnNyatn23M' 7 | AND event_type = 'Filled' 8 | AND _inserted_timestamp >= current_date - 7 9 | AND signer NOT IN ('DCAKxn5PFNN1mBREPWGdk1RXg5aVH9rPErLfBFEi2Emb', 10 | 'DCAK36VfExkPdAkYUQg6ewgxyinvcEyPLyHjRbmveKFw', 11 | 'DCAKuApAuZtVNYLk3KTAVW9GLWVvPbnb5CxxRRmVgcTr', 12 | 'BFQ2te7ERN319HA87mn6NJ9oxMUvNxyifqEhUWHFTie9', /* this was used early on for a few dca txs */ 13 | 'JD1dHSqYkrXvqUVL8s6gzL1yB7kpYymsHfwsGxgwp55h', 14 | 'JD38n7ynKYcgPpF7k1BhXEeREu1KqptU93fVGy3S624k', 15 | 'JD25qVdtd65FoiXNmR89JjmoJdYk9sjYQeSTZAALFiMy' 16 | ) -------------------------------------------------------------------------------- /tests/test_silver__rewards_gaps.sql: -------------------------------------------------------------------------------- 1 | {{ 2 | config( 3 | tags=["test_hourly"] 4 | ) 5 | }} 6 | 7 | WITH missing AS ( 8 | SELECT 9 | block_id 10 | FROM 11 | solana.silver.blocks 12 | WHERE 13 | block_timestamp < current_date - INTERVAL '12 HOUR' 14 | EXCEPT 15 | SELECT 16 | block_id 17 | FROM 18 | {{ source('solana_streamline', 'complete_block_rewards') }} 19 | EXCEPT 20 | SELECT 21 | block_id 22 | FROM 23 | {{ ref('streamline__complete_block_rewards_2') }} 24 | ), 25 | first_block_of_epoch AS ( 26 | SELECT 27 | b.block_id 28 | FROM 29 | solana.silver.blocks b 30 | JOIN 31 | solana.silver.epoch e 32 | ON b.block_id BETWEEN e.start_block AND e.end_block 33 | QUALIFY 34 | row_number() OVER (PARTITION BY e.epoch ORDER BY b.block_id) = 1 35 | ) 36 | SELECT 37 | m.*, 38 | f.block_id IS NOT NULL AS is_epoch_first_block 39 | FROM 40 | missing m 41 | LEFT JOIN 42 | first_block_of_epoch f 43 | USING(block_id) 44 | -------------------------------------------------------------------------------- /tests/test_silver__token_account_owners_recency.sql: -------------------------------------------------------------------------------- 1 | {{ config( 2 | tags = ["test_daily"] 3 | ) }} 4 | 5 | WITH most_recent_block AS ( 6 | 7 | SELECT 8 | MAX(start_block_id) AS recent_block_id 9 | FROM 10 | {{ ref('silver__token_account_owners') }} 11 | ) 12 | SELECT 13 | A.recent_block_id, 14 | b.block_id, 15 | b.block_timestamp 16 | FROM 17 | most_recent_block A 18 | LEFT JOIN {{ ref('silver__blocks') }} b 19 | ON A.recent_block_id = b.block_id 20 | WHERE 21 | b.block_timestamp <= ( 22 | SYSDATE() - INTERVAL '12 HOUR' 23 | ) 24 | -------------------------------------------------------------------------------- /tests/test_streamline__complete_decoded_instructions_2__missing.sql: -------------------------------------------------------------------------------- 1 | {{ 2 | config( 3 | tags=["test_hourly"] 4 | ) 5 | }} 6 | 7 | SELECT 8 | MD5( 9 | CAST( 10 | COALESCE(CAST(block_id AS text), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(tx_id AS text), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(INDEX AS text), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(inner_index AS text), '_dbt_utils_surrogate_key_null_') || '-' || COALESCE(CAST(program_id AS text), '_dbt_utils_surrogate_key_null_') AS text 11 | ) 12 | ) AS complete_decoded_instructions_2_id 13 | FROM 14 | {{ target.database }}.bronze.streamline_decoded_instructions_2 15 | WHERE 16 | _partition_by_created_date_hour >= dateadd('hour',-3,date_trunc('hour',current_timestamp())) 17 | AND _partition_by_created_date_hour < dateadd('hour',-2, date_trunc('hour',current_timestamp())) 18 | EXCEPT 19 | SELECT 20 | complete_decoded_instructions_2_id 21 | FROM 22 | {{ ref('streamline__complete_decoded_instructions_2') }} 23 | WHERE 24 | _inserted_timestamp >= dateadd('hour',-3,date_trunc('hour',current_timestamp())) 25 | --------------------------------------------------------------------------------