mirror of
https://github.com/FlipsideCrypto/thorchain-models.git
synced 2026-02-06 17:36:46 +00:00
added 5 silver models with yml configs and tests
This commit is contained in:
parent
27c74a8851
commit
a089df1426
14
models/silver/silver__rune_price.sql
Normal file
14
models/silver/silver__rune_price.sql
Normal 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') }}
|
||||
10
models/silver/silver__rune_price.yml
Normal file
10
models/silver/silver__rune_price.yml
Normal 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
|
||||
28
models/silver/silver__scheduled_outbound_events.sql
Normal file
28
models/silver/silver__scheduled_outbound_events.sql
Normal 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') }}
|
||||
50
models/silver/silver__scheduled_outbound_events.yml
Normal file
50
models/silver/silver__scheduled_outbound_events.yml
Normal 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
|
||||
23
models/silver/silver__send_messages.sql
Normal file
23
models/silver/silver__send_messages.sql
Normal 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
|
||||
30
models/silver/silver__send_messages.yml
Normal file
30
models/silver/silver__send_messages.yml
Normal 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
|
||||
19
models/silver/silver__trade_account_deposit_events.sql
Normal file
19
models/silver/silver__trade_account_deposit_events.sql
Normal 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') }}
|
||||
27
models/silver/silver__trade_account_deposit_events.yml
Normal file
27
models/silver/silver__trade_account_deposit_events.yml
Normal 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
|
||||
19
models/silver/silver__trade_account_withdraw_events.sql
Normal file
19
models/silver/silver__trade_account_withdraw_events.sql
Normal 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') }}
|
||||
27
models/silver/silver__trade_account_withdraw_events.yml
Normal file
27
models/silver/silver__trade_account_withdraw_events.yml
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user