From ed221775f0321a654a58a997da0bab81993acdda Mon Sep 17 00:00:00 2001 From: tarikceric Date: Fri, 12 Sep 2025 10:16:18 -0700 Subject: [PATCH] remove pyth workflow --- ...t_run_decode_instructions_orchestrator.yml | 5 -- ...e__decode_instructions_2_pyth_realtime.sql | 89 ------------------- ...e__decode_instructions_3_pyth_realtime.sql | 89 ------------------- 3 files changed, 183 deletions(-) delete mode 100644 models/streamline/decode_instructions/streamline__decode_instructions_2_pyth_realtime.sql delete mode 100644 models/streamline/decode_instructions/streamline__decode_instructions_3_pyth_realtime.sql diff --git a/.github/workflows/dbt_run_decode_instructions_orchestrator.yml b/.github/workflows/dbt_run_decode_instructions_orchestrator.yml index e055d00e..a83ba248 100644 --- a/.github/workflows/dbt_run_decode_instructions_orchestrator.yml +++ b/.github/workflows/dbt_run_decode_instructions_orchestrator.yml @@ -55,11 +55,6 @@ jobs: run: | dbt run -s streamline__complete_decoded_instructions_2 streamline__complete_decoded_instructions_3 - - name: Run Real Time Pyth Every 15 minutes - run: | - dbt run-operation dispatch_github_workflow --args "{'workflow_name': 'dbt_run_decode_instructions_pyth'}" - if: ${{ github.event_name == 'workflow_dispatch' && contains(fromJSON('["00", "15", "30", "45"]'), steps.capture_minute.outputs.formatted_minute) }} - - name: Run Real Time Core on minutes 0 and 30 every hour run: | dbt run-operation dispatch_github_workflow --args "{'workflow_name': 'dbt_run_decode_instructions'}" diff --git a/models/streamline/decode_instructions/streamline__decode_instructions_2_pyth_realtime.sql b/models/streamline/decode_instructions/streamline__decode_instructions_2_pyth_realtime.sql deleted file mode 100644 index b1f90f23..00000000 --- a/models/streamline/decode_instructions/streamline__decode_instructions_2_pyth_realtime.sql +++ /dev/null @@ -1,89 +0,0 @@ -{{ config ( - materialized = "view", - post_hook = if_data_call_function( - func = "{{this.schema}}.udf_bulk_instructions_decoder(object_construct('sql_source', '{{this.identifier}}', 'external_table', 'decoded_instructions_2', 'sql_limit', {{var('sql_limit','10000000')}}, 'producer_batch_size', {{var('producer_batch_size','10000000')}}, 'worker_batch_size', {{var('worker_batch_size','100000')}}, 'batch_call_limit', {{var('batch_call_limit','1000')}}, 'call_type', 'RT_PYTH'))", - target = "{{this.schema}}.{{this.identifier}}" - ), - tags = ['streamline_decoder'] -) }} - -{% if execute %} - {% set max_block_id_query %} - select max(block_id) - from {{ ref('silver__events') }} - {% endset %} - {% set max_block_id = run_query(max_block_id_query).columns[0].values()[0] %} - {% set min_block_id = max_block_id - 150000 %} -{% endif %} - -WITH event_subset AS ( - SELECT - e.program_id, - e.tx_id, - e.index, - NULL as inner_index, - e.instruction, - e.block_id, - e.block_timestamp, - {{ dbt_utils.generate_surrogate_key(['e.block_id','e.tx_id','e.index','inner_index','e.program_id']) }} as id - FROM - {{ ref('silver__events') }} - e - WHERE - e.program_id = 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH' - AND - e.block_timestamp >= CURRENT_DATE - 1 - AND - e.block_id between {{ min_block_id }} and {{ max_block_id}} - AND - e.succeeded - UNION ALL - SELECT - i.value :programId :: STRING AS inner_program_id, - e.tx_id, - e.index, - i.index AS inner_index, - i.value AS instruction, - e.block_id, - e.block_timestamp, - {{ dbt_utils.generate_surrogate_key(['e.block_id','e.tx_id','e.index','inner_index','inner_program_id']) }} as id - FROM - {{ ref('silver__events') }} - e - JOIN table(flatten(e.inner_instruction:instructions)) i - WHERE - ARRAY_CONTAINS('FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH'::variant, e.inner_instruction_program_ids) - AND - e.block_timestamp >= CURRENT_DATE - 1 - AND - e.block_id between {{ min_block_id }} and {{ max_block_id}} - AND - e.succeeded - AND - inner_program_id = 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH' - -), -completed_subset AS ( - SELECT - block_id, - complete_decoded_instructions_2_id as id - FROM - {{ ref('streamline__complete_decoded_instructions_2') }} - WHERE - block_id >= {{ min_block_id }} -) -SELECT - e.program_id, - e.tx_id, - e.index, - e.inner_index, - e.instruction, - e.block_id, - e.block_timestamp -FROM - event_subset e - LEFT OUTER JOIN completed_subset C - ON C.block_id = e.block_id - AND e.id = C.id -WHERE - C.block_id IS NULL \ No newline at end of file diff --git a/models/streamline/decode_instructions/streamline__decode_instructions_3_pyth_realtime.sql b/models/streamline/decode_instructions/streamline__decode_instructions_3_pyth_realtime.sql deleted file mode 100644 index dafcc64f..00000000 --- a/models/streamline/decode_instructions/streamline__decode_instructions_3_pyth_realtime.sql +++ /dev/null @@ -1,89 +0,0 @@ -{{ config ( - materialized = "view", - post_hook = if_data_call_function( - func = "{{this.schema}}.udf_bulk_instructions_decoder_v2(object_construct('sql_source', '{{this.identifier}}', 'external_table', 'decoded_instructions_3', 'sql_limit', {{var('sql_limit','10000000')}}, 'producer_batch_size', {{var('producer_batch_size','10000000')}}, 'worker_batch_size', {{var('worker_batch_size','100000')}}, 'batch_call_limit', {{var('batch_call_limit','1000')}}, 'call_type', 'RT_PYTH'))", - target = "{{this.schema}}.{{this.identifier}}" - ), - tags = ['streamline_decoder'] -) }} - -{% if execute %} - {% set max_block_id_query %} - select max(block_id) - from {{ ref('silver__events') }} - {% endset %} - {% set max_block_id = run_query(max_block_id_query).columns[0].values()[0] %} - {% set min_block_id = max_block_id - 150000 %} -{% endif %} - -WITH event_subset AS ( - SELECT - e.program_id, - e.tx_id, - e.index, - NULL as inner_index, - e.instruction, - e.block_id, - e.block_timestamp, - {{ dbt_utils.generate_surrogate_key(['e.block_id','e.tx_id','e.index','inner_index','e.program_id']) }} as id - FROM - {{ ref('silver__events') }} - e - WHERE - e.program_id = 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH' - AND - e.block_timestamp >= CURRENT_DATE - 1 - AND - e.block_id between {{ min_block_id }} and {{ max_block_id}} - AND - e.succeeded - UNION ALL - SELECT - i.value :programId :: STRING AS inner_program_id, - e.tx_id, - e.index, - i.index AS inner_index, - i.value AS instruction, - e.block_id, - e.block_timestamp, - {{ dbt_utils.generate_surrogate_key(['e.block_id','e.tx_id','e.index','inner_index','inner_program_id']) }} as id - FROM - {{ ref('silver__events') }} - e - JOIN table(flatten(e.inner_instruction:instructions)) i - WHERE - ARRAY_CONTAINS('FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH'::variant, e.inner_instruction_program_ids) - AND - e.block_timestamp >= CURRENT_DATE - 1 - AND - e.block_id between {{ min_block_id }} and {{ max_block_id}} - AND - e.succeeded - AND - inner_program_id = 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH' - -), -completed_subset AS ( - SELECT - block_id, - complete_decoded_instructions_3_id as id - FROM - {{ ref('streamline__complete_decoded_instructions_3') }} - WHERE - block_id >= {{ min_block_id }} -) -SELECT - e.program_id, - e.tx_id, - e.index, - e.inner_index, - e.instruction, - e.block_id, - e.block_timestamp -FROM - event_subset e - LEFT OUTER JOIN completed_subset C - ON C.block_id = e.block_id - AND e.id = C.id -WHERE - C.block_id IS NULL \ No newline at end of file