fix log config and doc fixes

This commit is contained in:
mattromano 2024-06-25 11:45:57 -07:00
parent d757b0ccc2
commit ac5c43d76a
12 changed files with 24 additions and 102 deletions

View File

@ -1,3 +1,4 @@
workflow_name,workflow_schedule
dbt_run_scheduled_non_realtime,"15,45 * * * *"
dbt_run_streamline_decoder,"25,55 * * * *"
dbt_run_scheduled_curated,"30 * * * *"
1 workflow_name workflow_schedule
2 dbt_run_scheduled_non_realtime 15,45 * * * *
3 dbt_run_streamline_decoder 25,55 * * * *
4 dbt_run_scheduled_curated 30 * * * *

View File

@ -11,7 +11,7 @@ FROM
ON l.block_number = d.block_number
AND l._log_id = d._log_id
WHERE
l.contract_address = LOWER('0xe4f05a66ec68b54a58b17c22107b02e0232cc817') -- WKLAY
l.contract_address = LOWER('0x19aac5f612f524b754ca7e7c41cbfa2e981a4432') -- WKLAY
AND l.topics [0] :: STRING = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' -- Transfer
AND l.block_timestamp BETWEEN DATEADD('hour', -48, SYSDATE())
AND DATEADD('hour', -6, SYSDATE())
@ -30,7 +30,7 @@ FROM
ON l.tx_hash = d.tx_hash
AND l.event_index = d.event_index
WHERE
l.contract_address = LOWER('0xe4f05a66ec68b54a58b17c22107b02e0232cc817') -- WKLAY
l.contract_address = LOWER('0x19aac5f612f524b754ca7e7c41cbfa2e981a4432') -- WKLAY
AND l.topics [0] :: STRING = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' -- Transfer
AND l.block_timestamp BETWEEN DATEADD('hour', -48, SYSDATE())
AND DATEADD('hour', -6, SYSDATE())

View File

@ -1,77 +1,3 @@
{# {% macro missing_txs(
model,
where_clause=None
) %}
WITH txs_base AS (
SELECT
block_number AS base_block_number,
tx_hash AS base_tx_hash
FROM
{{ ref('test_silver__transactions_full') }}
{% if where_clause %}
WHERE {{ where_clause }}
{% endif %}
),
model_name AS (
SELECT
block_number AS model_block_number,
tx_hash AS model_tx_hash
FROM
{{ model }}
)
SELECT
base_block_number,
base_tx_hash,
model_block_number,
model_tx_hash
FROM
txs_base
LEFT JOIN model_name
ON base_block_number = model_block_number
AND base_tx_hash = model_tx_hash
WHERE
(
model_tx_hash IS NULL
OR model_block_number IS NULL
)
{% endmacro %}
{% macro recent_missing_txs(
model,
where_clause=None
) %}
WITH txs_base AS (
SELECT
block_number AS base_block_number,
tx_hash AS base_tx_hash
FROM
{{ ref('test_silver__transactions_recent') }}
{% if where_clause %}
WHERE {{ where_clause }}
{% endif %}
),
model_name AS (
SELECT
block_number AS model_block_number,
tx_hash AS model_tx_hash
FROM
{{ model }}
)
SELECT
base_block_number,
base_tx_hash,
model_block_number,
model_tx_hash
FROM
txs_base
LEFT JOIN model_name
ON base_block_number = model_block_number
AND base_tx_hash = model_tx_hash
WHERE
model_tx_hash IS NULL
OR model_block_number IS NULL
{% endmacro %} #}
{% macro gold_missing_txs(
model,
where_clause=None

View File

@ -84,7 +84,7 @@ The position of the transaction within the block.
{% docs kaia_tx_status %}
Status of the transaction.
Boolean status of the transaction. True indicates a successful transaction and false indicates a failed transaction.
{% enddocs %}

View File

@ -30,7 +30,7 @@ There is more information on how to use dbt docs in the last section of this doc
***Please note that the traces are reliable starting on June 1st, 2024. We are in the process of backfilling traces further.***
- [fact_traces](https://flipsidecrypto.github.io/kaia-models/#!/model/model.kaia_models.core__fact_traces)
**EZ Tables:**
**Convenience Tables:**
- [ez_decoded_event_logs](https://flipsidecrypto.github.io/kaia-models/#!/model/model.kaia_models.core__ez_decoded_event_logs)
### Price Tables (ethereum.price)

View File

@ -1,11 +1,12 @@
{{ config(
materialized = 'incremental',
incremental_strategy = 'delete+insert',
unique_key = "block_number",
{{ config (
materialized = "incremental",
unique_key = ['block_number', 'event_index'],
cluster_by = "block_timestamp::date",
incremental_predicates = ["dynamic_range", "block_number"],
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
tags = ['decoded_logs']
) }}
merge_exclude_columns = ["inserted_timestamp"],
tags = ['decoded_logs','reorg']
) }}
SELECT
block_number,

View File

@ -55,7 +55,7 @@ models:
description: '{{ doc("kaia_logs_data") }}'
- name: EVENT_REMOVED
description: '{{ doc("kaia_event_removed") }}'
- name: TX_STATUS
- name: TX_SUCCEEDED
description: '{{ doc("kaia_tx_status") }}'
- name: EZ_DECODED_EVENT_LOGS_ID
description: '{{ doc("pk") }}'

View File

@ -1,11 +1,12 @@
{{ config(
materialized = 'incremental',
incremental_strategy = 'delete+insert',
unique_key = "block_number",
{{ config (
materialized = "incremental",
unique_key = ['block_number', 'event_index'],
cluster_by = "block_timestamp::date",
incremental_predicates = ["dynamic_range", "block_number"],
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
tags = ['decoded_logs']
) }}
merge_exclude_columns = ["inserted_timestamp"],
tags = ['decoded_logs','reorg']
) }}
SELECT
block_number,

View File

@ -44,7 +44,7 @@ models:
description: The maximum fee per gas of the transaction, in Gwei.
- name: MAX_PRIORITY_FEE_PER_GAS
description: The maximum priority fee per gas of the transaction, in Gwei.
- name: SUCCEEDED
- name: TX_SUCCEEDED
description: '{{ doc("kaia_tx_status") }}'
- name: INPUT_DATA
description: '{{ doc("kaia_tx_input_data") }}'

View File

@ -6,5 +6,4 @@
SELECT
*
FROM
{{ ref('core__fact_decoded_event_logs') }}
{{ ref('silver__')}}
{{ ref('core__ez_decoded_event_logs') }}

View File

@ -14,10 +14,4 @@ models:
tests:
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
interval: 1
interval: 1

View File

@ -13,7 +13,7 @@ WITH last_3_days AS (
SELECT
*
FROM
{{ ref('core__fact_decoded_event_logs') }}
{{ ref('core__ez_decoded_event_logs') }}
WHERE
block_number >= (
SELECT