added 5 silver models with yml configs and tests

This commit is contained in:
Mike Stepanovic 2024-07-02 11:28:23 -06:00
parent 27c74a8851
commit a089df1426
10 changed files with 247 additions and 0 deletions

View File

@ -0,0 +1,14 @@
{{ config(
materialized = 'view'
) }}
SELECT
rune_price_e8,
block_timestamp,
DATEADD(
ms,
__HEVO__LOADED_AT,
'1970-01-01'
) AS _INSERTED_TIMESTAMP
FROM
{{ ref('bronze__rune_price') }}

View File

@ -0,0 +1,10 @@
version: 2
models:
- name: silver__rune_price
columns:
- name: RUNE_PRICE_E8
tests:
- not_null
- name: BLOCK_TIMESTAMP
tests:
- not_null

View File

@ -0,0 +1,28 @@
{{ config(
materialized = 'view'
) }}
SELECT
chain,
to_addr as to_address,
asset,
asset_e8,
asset_decimals,
gas_rate,
memo,
in_hash,
out_hash,
max_gas_amount,
max_gas_decimals,
max_gas_asset,
module_name,
vault_pub_key,
event_id,
block_timestamp,
DATEADD(
ms,
__HEVO__LOADED_AT,
'1970-01-01'
) AS _INSERTED_TIMESTAMP
FROM
{{ ref('bronze__scheduled_outbound_events') }}

View File

@ -0,0 +1,50 @@
version: 2
models:
- name: silver__scheduled_outbound_events
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- EVENT_ID
columns:
- name: CHAIN
tests:
- not_null
- name: TO_ADDRESS
tests:
- not_null
- name: ASSET
tests:
- not_null
- name: ASSET_E8
tests:
- not_null
- name: ASSET_DECIMALS
tests:
- not_null
- name: GAS_RATE
tests:
- not_null
- name: MEMO
- name: IN_HASH
tests:
- not_null
- name: OUT_HASH
- name: MAX_GAS_AMOUNT
tests:
- not_null
- name: MAX_GAS_DECIMALS
tests:
- not_null
- name: MAX_GAS_ASSET
tests:
- not_null
- name: MODULE_NAME
- name: VAULT_PUB_KEY
tests:
- not_null
- name: EVENT_ID
tests:
- not_null
- name: BLOCK_TIMESTAMP
tests:
- not_null

View File

@ -0,0 +1,23 @@
{{ config(
materialized = 'view'
) }}
SELECT
amount_e8,
asset,
from_addr as from_address,
to_addr as to_address,
memo
tx_id,
event_id,
block_timestamp,
DATEADD(
ms,
__HEVO__LOADED_AT,
'1970-01-01'
) AS _INSERTED_TIMESTAMP
FROM
{{ ref('bronze__send_messages') }}
qualify(ROW_NUMBER() over(PARTITION BY event_id
ORDER BY
__HEVO__LOADED_AT DESC)) = 1

View File

@ -0,0 +1,30 @@
version: 2
models:
- name: silver__send_messages
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- EVENT_ID
columns:
- name: AMOUNT_E8
tests:
- not_null
- name: ASSET
tests:
- not_null
- name: FROM_ADDRESS
tests:
- not_null
- name: TO_ADDRESS
tests:
- not_null
- name: MEMO
- name: TX_ID
tests:
- not_null
- name: EVENT_ID
tests:
- not_null
- name: BLOCK_TIMESTAMP
tests:
- not_null

View File

@ -0,0 +1,19 @@
{{ config(
materialized = 'view'
) }}
SELECT
amount_e8,
asset,
asset_address,
rune_address,
tx_id,
event_id,
block_timestamp,
DATEADD(
ms,
__HEVO__LOADED_AT,
'1970-01-01'
) AS _INSERTED_TIMESTAMP
FROM
{{ ref('bronze__trade_account_deposit_events') }}

View File

@ -0,0 +1,27 @@
version: 2
models:
- name: silver__trade_account_deposit_events
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- EVENT_ID
columns:
- name: AMOUNT_E8
tests:
- not_null
- name: ASSET
tests:
- not_null
- name: ASSET_ADDRESS
- name: RUNE_ADDRESS
tests:
- not_null
- name: TX_ID
tests:
- not_null
- name: EVENT_ID
tests:
- not_null
- name: BLOCK_TIMESTAMP
tests:
- not_null

View File

@ -0,0 +1,19 @@
{{ config(
materialized = 'view'
) }}
SELECT
amount_e8,
asset,
asset_address,
rune_address,
tx_id,
event_id,
block_timestamp,
DATEADD(
ms,
__HEVO__LOADED_AT,
'1970-01-01'
) AS _INSERTED_TIMESTAMP
FROM
{{ ref('bronze__trade_account_withdraw_events') }}

View File

@ -0,0 +1,27 @@
version: 2
models:
- name: silver__trade_account_withdraw_events
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- EVENT_ID
columns:
- name: AMOUNT_E8
tests:
- not_null
- name: ASSET
tests:
- not_null
- name: ASSET_ADDRESS
- name: RUNE_ADDRESS
tests:
- not_null
- name: TX_ID
tests:
- not_null
- name: EVENT_ID
tests:
- not_null
- name: BLOCK_TIMESTAMP
tests:
- not_null