mirror of
https://github.com/FlipsideCrypto/blast-models.git
synced 2026-02-06 14:11:55 +00:00
juice asset fixes and init timestamps
This commit is contained in:
parent
abc5ae25d7
commit
fc44512798
@ -10,12 +10,12 @@ models:
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: BLOCK_TIMESTAMP
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- dbt_expectations.expect_row_values_to_have_recent_data:
|
||||
datepart: day
|
||||
interval: 3
|
||||
@ -25,67 +25,67 @@ models:
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: EVENT_INDEX
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: ORIGIN_FROM_ADDRESS
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: ORIGIN_TO_ADDRESS
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: ORIGIN_FUNCTION_SIGNATURE
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: CONTRACT_ADDRESS
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: BORROWER
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: BORROWS_CONTRACT_ADDRESS
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: BORROWS_SYMBOL
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: TOKEN_ADDRESS
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: TOKEN_SYMBOL
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: UNDERLYING_SYMBOL
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: AMOUNT_UNADJ
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: AMOUNT
|
||||
tests:
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
@ -96,7 +96,7 @@ models:
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: UNDERLYING_AMOUNT
|
||||
tests:
|
||||
- dbt_expectations.expect_column_values_to_be_in_type_list:
|
||||
@ -107,14 +107,14 @@ models:
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: MODIFIED_TIMESTAMP
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
- name: _LOG_ID
|
||||
tests:
|
||||
- not_null:
|
||||
error_if: ">10"
|
||||
warn_if: "<10"
|
||||
warn_if: ">0"
|
||||
@ -24,7 +24,7 @@ WITH asset_details AS (
|
||||
underlying_unwrap_name,
|
||||
underlying_unwrap_symbol,
|
||||
underlying_unwrap_decimals,
|
||||
_inserted_timestamp
|
||||
modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__init_asset_details') }}
|
||||
),
|
||||
|
||||
@ -24,7 +24,7 @@ WITH asset_details AS (
|
||||
underlying_unwrap_name,
|
||||
underlying_unwrap_symbol,
|
||||
underlying_unwrap_decimals,
|
||||
_inserted_timestamp
|
||||
modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__init_asset_details') }}
|
||||
),
|
||||
|
||||
@ -24,7 +24,7 @@ WITH asset_details AS (
|
||||
underlying_unwrap_name,
|
||||
underlying_unwrap_symbol,
|
||||
underlying_unwrap_decimals,
|
||||
_inserted_timestamp
|
||||
modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__init_asset_details') }}
|
||||
),
|
||||
|
||||
@ -35,18 +35,9 @@ juice_contracts AS (
|
||||
NAME,
|
||||
decimals
|
||||
FROM
|
||||
{{ ref('core__dim_contracts') }}
|
||||
contracts
|
||||
WHERE
|
||||
NAME LIKE 'Juice%'
|
||||
{% if is_incremental() %}
|
||||
AND modified_timestamp > (
|
||||
SELECT
|
||||
max(modified_timestamp)
|
||||
FROM
|
||||
{{ this }}
|
||||
)
|
||||
AND modified_timestamp >= SYSDATE() - INTERVAL '7 day'
|
||||
{% endif %}
|
||||
NAME like 'Juice%Collateral%'
|
||||
),
|
||||
collateral_tokens AS (
|
||||
SELECT
|
||||
@ -96,12 +87,7 @@ tx_pull AS (
|
||||
WHERE
|
||||
origin_from_address = '0x0ee09b204ffebf9a1f14c99e242830a09958ba34'
|
||||
AND origin_to_address = '0x4e59b44847b379578588920ca78fbf26c0b4956c'
|
||||
AND CONCAT('0x', SUBSTR(topics [1], 27, 40)) IN (
|
||||
SELECT
|
||||
pool_address
|
||||
FROM
|
||||
asset_list
|
||||
)
|
||||
AND concat('0x',substr(topics[1], 27,40)) in (select pool_address from asset_list)
|
||||
{% if is_incremental() %}
|
||||
AND modified_timestamp > (
|
||||
SELECT
|
||||
|
||||
@ -83,8 +83,7 @@ log_pull AS (
|
||||
l.modified_timestamp,
|
||||
l._log_id
|
||||
FROM
|
||||
{{ ref('core__fact_event_logs') }}
|
||||
l
|
||||
log_pull_1 l
|
||||
LEFT JOIN contracts C
|
||||
ON C.contract_address = l.contract_address
|
||||
),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user