From 70a8c7caec4f9b654927d3affad873942bb926e6 Mon Sep 17 00:00:00 2001 From: mattromano Date: Thu, 16 Jan 2025 10:09:03 -0800 Subject: [PATCH] update tests --- .../lending/init/silver__init_borrows.yml | 17 +-- .../lending/init/silver__init_deposits.yml | 103 +++++++++++--- .../init/silver__init_liquidations.yml | 123 +++++++++++++---- .../lending/init/silver__init_repayments.yml | 102 +++++++++++--- .../lending/init/silver__init_withdraws.yml | 98 +++++++++---- .../lending/juice/silver__juice_borrows.yml | 82 ++++++++--- .../lending/juice/silver__juice_deposits.yml | 103 +++++++++++--- .../juice/silver__juice_liquidations.yml | 127 +++++++++++++---- .../juice/silver__juice_repayments.sql | 2 + .../juice/silver__juice_repayments.yml | 102 +++++++++++--- .../lending/juice/silver__juice_withdraws.yml | 98 +++++++++---- .../lending/orbit/silver__orbit_borrows.yml | 82 ++++++++--- .../lending/orbit/silver__orbit_deposits.yml | 103 +++++++++++--- .../orbit/silver__orbit_liquidations.yml | 129 +++++++++++++----- .../orbit/silver__orbit_repayments.sql | 1 + .../orbit/silver__orbit_repayments.yml | 103 +++++++++++--- .../lending/orbit/silver__orbit_withdraws.yml | 98 +++++++++---- 17 files changed, 1138 insertions(+), 335 deletions(-) diff --git a/models/silver/defi/lending/init/silver__init_borrows.yml b/models/silver/defi/lending/init/silver__init_borrows.yml index 35118ab..ed2dfc0 100644 --- a/models/silver/defi/lending/init/silver__init_borrows.yml +++ b/models/silver/defi/lending/init/silver__init_borrows.yml @@ -102,19 +102,4 @@ models: - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float - - name: PLATFORM - tests: - - not_null: - error_if: ">10" - warn_if: ">0" - - name: MODIFIED_TIMESTAMP - tests: - - not_null: - error_if: ">10" - warn_if: ">0" - - name: _LOG_ID - tests: - - not_null: - error_if: ">10" - warn_if: ">0" \ No newline at end of file + - float \ No newline at end of file diff --git a/models/silver/defi/lending/init/silver__init_deposits.yml b/models/silver/defi/lending/init/silver__init_deposits.yml index b004f5c..2a38643 100644 --- a/models/silver/defi/lending/init/silver__init_deposits.yml +++ b/models/silver/defi/lending/init/silver__init_deposits.yml @@ -4,44 +4,107 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">3" + error_if: ">14" + - name: TX_HASH + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_SYMBOL tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: ISSUED_TOKENS tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float - - name: SUPPLIED_BASE_ASSET + - float + - name: AMOUNT_UNADJ tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float + - float - name: SUPPLIED_CONTRACT_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: SUPPLIED_SYMBOL tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: SUPPLIER - tests: - - not_null - - name: TX_HASH - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PLATFORM + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: MODIFIED_TIMESTAMP + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: _LOG_ID + tests: + - not_null: + error_if: ">10" + warn_if: ">0" \ No newline at end of file diff --git a/models/silver/defi/lending/init/silver__init_liquidations.yml b/models/silver/defi/lending/init/silver__init_liquidations.yml index a24dd69..52be4b1 100644 --- a/models/silver/defi/lending/init/silver__init_liquidations.yml +++ b/models/silver/defi/lending/init/silver__init_liquidations.yml @@ -4,51 +4,116 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null - - name: BORROWER + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">14" + error_if: ">30" + - name: TX_HASH tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: LIQUIDATOR tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - name: BORROWER + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PROTOCOL_MARKET + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: COLLATERAL_TOKEN + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: COLLATERAL_TOKEN_SYMBOL + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: AMOUNT_UNADJ tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - decimal - - float - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: AMOUNT tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - float - - name: TX_HASH - tests: - - not_null - - name: COLLATERAL_TOKEN - tests: - - not_null - - name: COLLATERAL_TOKEN_SYMBOL - tests: - - not_null - name: DEBT_TOKEN - tests: - - not_null + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: DEBT_TOKEN_SYMBOL - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PLATFORM + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: MODIFIED_TIMESTAMP + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: _LOG_ID + tests: + - not_null: + error_if: ">10" + warn_if: ">0" \ No newline at end of file diff --git a/models/silver/defi/lending/init/silver__init_repayments.yml b/models/silver/defi/lending/init/silver__init_repayments.yml index 687b398..26e38cd 100644 --- a/models/silver/defi/lending/init/silver__init_repayments.yml +++ b/models/silver/defi/lending/init/silver__init_repayments.yml @@ -4,38 +4,102 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">3" + error_if: ">14" + - name: TX_HASH + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: BORROWER tests: - - not_null - - name: TOKEN_ADDRESS + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PROTOCOL_MARKET tests: - - not_null - - name: TOKEN_SYMBOL + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PAYER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: REPAY_CONTRACT_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: REPAY_CONTRACT_SYMBOL tests: - - not_null - - name: REPAYED_AMOUNT + - not_null: + error_if: ">10" + warn_if: ">0" + - name: TOKEN_ADDRESS tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: TOKEN_SYMBOL + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT_UNADJ + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: TOTAL_REPAID + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float - - name: TX_HASH - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + - float + - name: AMOUNT + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: + column_type_list: + - decimal + - float \ No newline at end of file diff --git a/models/silver/defi/lending/init/silver__init_withdraws.yml b/models/silver/defi/lending/init/silver__init_withdraws.yml index 1ae58aa..1634046 100644 --- a/models/silver/defi/lending/init/silver__init_withdraws.yml +++ b/models/silver/defi/lending/init/silver__init_withdraws.yml @@ -4,44 +4,92 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">3" + error_if: ">14" + - name: TX_HASH + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_SYMBOL tests: - - not_null - - name: RECEIVED_AMOUNT + - not_null: + error_if: ">10" + warn_if: ">0" + - name: REDEEMER tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - decimal - - float - - name: RECEIVED_CONTRACT_ADDRESS + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT_UNADJ tests: - - not_null - - name: RECEIVED_SYMBOL + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT tests: - - not_null - - name: REDEEMED_TOKEN - tests: - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - float - - name: REDEEMER - tests: - - not_null - - name: TX_HASH - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + - name: RECEIVED_CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: RECEIVED_SYMBOL + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: REDEEMED_TOKENS + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: + column_type_list: + - decimal + - float \ No newline at end of file diff --git a/models/silver/defi/lending/juice/silver__juice_borrows.yml b/models/silver/defi/lending/juice/silver__juice_borrows.yml index 2eb391f..e9d2124 100644 --- a/models/silver/defi/lending/juice/silver__juice_borrows.yml +++ b/models/silver/defi/lending/juice/silver__juice_borrows.yml @@ -4,38 +4,86 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">3" + error_if: ">14" + - name: TX_HASH + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: BORROWER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BORROWS_CONTRACT_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BORROWS_SYMBOL tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_SYMBOL tests: - - not_null - - name: LOAN_AMOUNT + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT_UNADJ tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float - - name: TX_HASH - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + - float \ No newline at end of file diff --git a/models/silver/defi/lending/juice/silver__juice_deposits.yml b/models/silver/defi/lending/juice/silver__juice_deposits.yml index 8581214..d157608 100644 --- a/models/silver/defi/lending/juice/silver__juice_deposits.yml +++ b/models/silver/defi/lending/juice/silver__juice_deposits.yml @@ -4,44 +4,107 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">3" + error_if: ">14" + - name: TX_HASH + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_SYMBOL tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: ISSUED_TOKENS tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float - - name: SUPPLIED_BASE_ASSET + - float + - name: AMOUNT_UNADJ tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float + - float - name: SUPPLIED_CONTRACT_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: SUPPLIED_SYMBOL tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: SUPPLIER - tests: - - not_null - - name: TX_HASH - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PLATFORM + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: MODIFIED_TIMESTAMP + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: _LOG_ID + tests: + - not_null: + error_if: ">10" + warn_if: ">0" \ No newline at end of file diff --git a/models/silver/defi/lending/juice/silver__juice_liquidations.yml b/models/silver/defi/lending/juice/silver__juice_liquidations.yml index b3e7b48..eeab3b6 100644 --- a/models/silver/defi/lending/juice/silver__juice_liquidations.yml +++ b/models/silver/defi/lending/juice/silver__juice_liquidations.yml @@ -4,47 +4,116 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null - - name: BORROWER + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">14" + error_if: ">30" + - name: TX_HASH tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN tests: - - not_null - - name: TOKEN_SYMBOL - tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: LIQUIDATOR tests: - - not_null - - name: TOKENS_SEIZED + - not_null: + error_if: ">10" + warn_if: ">0" + - name: BORROWER tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - decimal - - float - - name: LIQUIDATION_AMOUNT + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PROTOCOL_MARKET tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: COLLATERAL_TOKEN + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: COLLATERAL_TOKEN_SYMBOL + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT_UNADJ + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - float - - name: TX_HASH - tests: - - not_null - - name: COLLATERAL_TOKEN - tests: - - not_null - - name: COLLATERAL_TOKEN_SYMBOL - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + - name: DEBT_TOKEN + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: DEBT_TOKEN_SYMBOL + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PLATFORM + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: MODIFIED_TIMESTAMP + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: _LOG_ID + tests: + - not_null: + error_if: ">10" + warn_if: ">0" \ No newline at end of file diff --git a/models/silver/defi/lending/juice/silver__juice_repayments.sql b/models/silver/defi/lending/juice/silver__juice_repayments.sql index cb5053d..eb653bd 100644 --- a/models/silver/defi/lending/juice/silver__juice_repayments.sql +++ b/models/silver/defi/lending/juice/silver__juice_repayments.sql @@ -101,6 +101,8 @@ SELECT origin_to_address, origin_function_signature, contract_address, + contract_address as protocol_market, + origin_from_address as payer, borrower, token as token_address, token_symbol, diff --git a/models/silver/defi/lending/juice/silver__juice_repayments.yml b/models/silver/defi/lending/juice/silver__juice_repayments.yml index e145e18..155917f 100644 --- a/models/silver/defi/lending/juice/silver__juice_repayments.yml +++ b/models/silver/defi/lending/juice/silver__juice_repayments.yml @@ -4,38 +4,102 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">3" + error_if: ">14" + - name: TX_HASH + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: BORROWER tests: - - not_null - - name: TOKEN_ADDRESS + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PROTOCOL_MARKET tests: - - not_null - - name: TOKEN_SYMBOL + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PAYER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: REPAY_CONTRACT_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: REPAY_CONTRACT_SYMBOL tests: - - not_null - - name: REPAYED_AMOUNT + - not_null: + error_if: ">10" + warn_if: ">0" + - name: TOKEN_ADDRESS tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: TOKEN_SYMBOL + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT_UNADJ + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: TOTAL_REPAID + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float - - name: TX_HASH - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + - float + - name: AMOUNT + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: + column_type_list: + - decimal + - float \ No newline at end of file diff --git a/models/silver/defi/lending/juice/silver__juice_withdraws.yml b/models/silver/defi/lending/juice/silver__juice_withdraws.yml index a8e22a5..8111a71 100644 --- a/models/silver/defi/lending/juice/silver__juice_withdraws.yml +++ b/models/silver/defi/lending/juice/silver__juice_withdraws.yml @@ -4,44 +4,92 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">3" + error_if: ">14" + - name: TX_HASH + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_SYMBOL tests: - - not_null - - name: RECEIVED_AMOUNT + - not_null: + error_if: ">10" + warn_if: ">0" + - name: REDEEMER tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - decimal - - float - - name: RECEIVED_CONTRACT_ADDRESS + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT_UNADJ tests: - - not_null - - name: RECEIVED_SYMBOL + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT tests: - - not_null - - name: REDEEMED_TOKEN - tests: - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - float - - name: REDEEMER - tests: - - not_null - - name: TX_HASH - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + - name: RECEIVED_CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: RECEIVED_SYMBOL + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: REDEEMED_TOKENS + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: + column_type_list: + - decimal + - float \ No newline at end of file diff --git a/models/silver/defi/lending/orbit/silver__orbit_borrows.yml b/models/silver/defi/lending/orbit/silver__orbit_borrows.yml index 53ac677..0401598 100644 --- a/models/silver/defi/lending/orbit/silver__orbit_borrows.yml +++ b/models/silver/defi/lending/orbit/silver__orbit_borrows.yml @@ -4,38 +4,86 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">3" + error_if: ">14" + - name: TX_HASH + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: BORROWER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BORROWS_CONTRACT_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BORROWS_SYMBOL tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_SYMBOL tests: - - not_null - - name: LOAN_AMOUNT + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT_UNADJ tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float - - name: TX_HASH - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + - float \ No newline at end of file diff --git a/models/silver/defi/lending/orbit/silver__orbit_deposits.yml b/models/silver/defi/lending/orbit/silver__orbit_deposits.yml index 962a24d..4664c70 100644 --- a/models/silver/defi/lending/orbit/silver__orbit_deposits.yml +++ b/models/silver/defi/lending/orbit/silver__orbit_deposits.yml @@ -4,44 +4,107 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">3" + error_if: ">14" + - name: TX_HASH + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_SYMBOL tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: ISSUED_TOKENS tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float - - name: SUPPLIED_BASE_ASSET + - float + - name: AMOUNT_UNADJ tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float + - float - name: SUPPLIED_CONTRACT_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: SUPPLIED_SYMBOL tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: SUPPLIER - tests: - - not_null - - name: TX_HASH - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PLATFORM + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: MODIFIED_TIMESTAMP + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: _LOG_ID + tests: + - not_null: + error_if: ">10" + warn_if: ">0" \ No newline at end of file diff --git a/models/silver/defi/lending/orbit/silver__orbit_liquidations.yml b/models/silver/defi/lending/orbit/silver__orbit_liquidations.yml index 742e544..fe9e25b 100644 --- a/models/silver/defi/lending/orbit/silver__orbit_liquidations.yml +++ b/models/silver/defi/lending/orbit/silver__orbit_liquidations.yml @@ -4,53 +4,116 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null - - name: BORROWER + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">14" + error_if: ">30" + - name: TX_HASH tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN tests: - - not_null - - name: TOKEN_SYMBOL - tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: LIQUIDATOR tests: - - not_null - - name: TOKENS_SEIZED + - not_null: + error_if: ">10" + warn_if: ">0" + - name: BORROWER tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PROTOCOL_MARKET + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: COLLATERAL_TOKEN + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: COLLATERAL_TOKEN_SYMBOL + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT_UNADJ + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float - - name: LIQUIDATION_AMOUNT - tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - decimal - - float + - float - name: DEBT_TOKEN tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: DEBT_TOKEN_SYMBOL tests: - - not_null - - name: TX_HASH - tests: - - not_null - - name: COLLATERAL_TOKEN - tests: - - not_null - - name: COLLATERAL_TOKEN_SYMBOL - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PLATFORM + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: MODIFIED_TIMESTAMP + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: _LOG_ID + tests: + - not_null: + error_if: ">10" + warn_if: ">0" \ No newline at end of file diff --git a/models/silver/defi/lending/orbit/silver__orbit_repayments.sql b/models/silver/defi/lending/orbit/silver__orbit_repayments.sql index c3b03d0..67dd2e5 100644 --- a/models/silver/defi/lending/orbit/silver__orbit_repayments.sql +++ b/models/silver/defi/lending/orbit/silver__orbit_repayments.sql @@ -96,6 +96,7 @@ SELECT origin_to_address, origin_function_signature, contract_address, + contract_address as protocol_market, borrower, token as token_address, token_symbol, diff --git a/models/silver/defi/lending/orbit/silver__orbit_repayments.yml b/models/silver/defi/lending/orbit/silver__orbit_repayments.yml index 681d8e6..52d121f 100644 --- a/models/silver/defi/lending/orbit/silver__orbit_repayments.yml +++ b/models/silver/defi/lending/orbit/silver__orbit_repayments.yml @@ -4,41 +4,102 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">3" + error_if: ">14" + - name: TX_HASH + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: BORROWER tests: - - not_null - - name: TOKEN_ADDRESS + - not_null: + error_if: ">10" + warn_if: ">0" + - name: PROTOCOL_MARKET tests: - - not_null - - name: TOKEN_SYMBOL - tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: PAYER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: REPAY_CONTRACT_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: REPAY_CONTRACT_SYMBOL tests: - - not_null - - name: REPAYED_AMOUNT + - not_null: + error_if: ">10" + warn_if: ">0" + - name: TOKEN_ADDRESS tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: TOKEN_SYMBOL + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT_UNADJ + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: TOTAL_REPAID + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - - float - - name: TX_HASH - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + - float + - name: AMOUNT + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: + column_type_list: + - decimal + - float \ No newline at end of file diff --git a/models/silver/defi/lending/orbit/silver__orbit_withdraws.yml b/models/silver/defi/lending/orbit/silver__orbit_withdraws.yml index f1abe94..d80f698 100644 --- a/models/silver/defi/lending/orbit/silver__orbit_withdraws.yml +++ b/models/silver/defi/lending/orbit/silver__orbit_withdraws.yml @@ -4,44 +4,92 @@ models: tests: - dbt_utils.unique_combination_of_columns: combination_of_columns: - - _log_id + - _LOG_ID columns: - name: BLOCK_NUMBER tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: BLOCK_TIMESTAMP tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" + - dbt_expectations.expect_row_values_to_have_recent_data: + datepart: day + interval: 3 + warn_if: ">3" + error_if: ">14" + - name: TX_HASH + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: EVENT_INDEX + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FROM_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_TO_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: ORIGIN_FUNCTION_SIGNATURE + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_ADDRESS tests: - - not_null + - not_null: + error_if: ">10" + warn_if: ">0" - name: TOKEN_SYMBOL tests: - - not_null - - name: RECEIVED_AMOUNT + - not_null: + error_if: ">10" + warn_if: ">0" + - name: REDEEMER tests: - - dbt_expectations.expect_column_values_to_be_in_type_list: - column_type_list: - - decimal - - float - - name: RECEIVED_CONTRACT_ADDRESS + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT_UNADJ tests: - - not_null - - name: RECEIVED_SYMBOL + - not_null: + error_if: ">10" + warn_if: ">0" + - name: AMOUNT tests: - - not_null - - name: REDEEMED_TOKEN - tests: - dbt_expectations.expect_column_values_to_be_in_type_list: column_type_list: - decimal - float - - name: REDEEMER - tests: - - not_null - - name: TX_HASH - tests: - - not_null - - name: EVENT_INDEX - tests: - - not_null \ No newline at end of file + - name: RECEIVED_CONTRACT_ADDRESS + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: RECEIVED_SYMBOL + tests: + - not_null: + error_if: ">10" + warn_if: ">0" + - name: REDEEMED_TOKENS + tests: + - dbt_expectations.expect_column_values_to_be_in_type_list: + column_type_list: + - decimal + - float \ No newline at end of file