Skip to content

Commit

Permalink
revert (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
austinFlipside authored Oct 18, 2023
1 parent 1823ce3 commit 84e509d
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 316 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/dbt_run_heal_models.yml

This file was deleted.

3 changes: 1 addition & 2 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,4 @@ vars:
STREAMLINE_INVOKE_STREAMS: False
STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES: False
WAIT: 0
OBSERV_FULL_TEST: False
HEAL_MODEL: False
OBSERV_FULL_TEST: False
51 changes: 37 additions & 14 deletions models/gold/core/core__ez_token_transfers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,47 @@ SELECT
block_number,
block_timestamp,
tx_hash,
event_index,
origin_function_signature,
origin_from_address,
origin_to_address,
contract_address,
t.contract_address,
from_address,
to_address,
raw_amount_precise,
raw_amount,
amount_precise,
amount,
amount_usd,
decimals,
symbol,
token_price,
has_decimal,
has_price,
_log_id,
_inserted_timestamp
raw_amount_precise,
C.token_decimals AS decimals,
C.token_symbol AS symbol,
price AS token_price,
CASE
WHEN C.token_decimals IS NOT NULL THEN raw_amount / pow(
10,
C.token_decimals
)
ELSE NULL
END AS amount,
CASE
WHEN C.token_decimals IS NOT NULL
AND price IS NOT NULL THEN amount * price
ELSE NULL
END AS amount_usd,
CASE
WHEN C.token_decimals IS NULL THEN 'false'
ELSE 'true'
END AS has_decimal,
CASE
WHEN price IS NULL THEN 'false'
ELSE 'true'
END AS has_price,
_log_id
FROM
{{ ref('silver__transfers') }}
{{ ref('core__fact_token_transfers') }}
t
LEFT JOIN {{ ref('price__ez_hourly_token_prices') }}
p
ON t.contract_address = p.token_address
AND DATE_TRUNC(
'hour',
t.block_timestamp
) = HOUR
LEFT JOIN {{ ref('silver__contracts') }} C
ON t.contract_address = C.contract_address
32 changes: 13 additions & 19 deletions models/gold/core/core__ez_token_transfers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,35 @@ models:
description: '{{ doc("gno_block_timestamp") }}'
- name: TX_HASH
description: '{{ doc("gno_transfer_tx_hash") }}'
- name: EVENT_INDEX
description: '{{ doc("gno_event_index") }}'
- name: ORIGIN_FUNCTION_SIGNATURE
description: '{{ doc("gno_origin_sig") }}'
- name: ORIGIN_FROM_ADDRESS
description: '{{ doc("gno_origin_from") }}'
- name: ORIGIN_TO_ADDRESS
description: '{{ doc("gno_origin_to") }}'
- name: CONTRACT_ADDRESS
description: '{{ doc("gno_transfer_contract_address") }}'
- name: FROM_ADDRESS
description: '{{ doc("gno_transfer_from_address") }}'
- name: TO_ADDRESS
description: '{{ doc("gno_transfer_to_address") }}'
- name: RAW_AMOUNT_PRECISE
description: '{{ doc("gno_transfer_raw_amount_precise") }}'
- name: RAW_AMOUNT
description: '{{ doc("gno_transfer_raw_amount") }}'
- name: AMOUNT_PRECISE
description: '{{ doc("gno_transfer_amount_precise") }}'
- name: RAW_AMOUNT_PRECISE
description: '{{ doc("precise_amount_unadjusted") }}'
- name: DECIMALS
description: 'The number of decimal places this contract needs adjusted where token values exist.'
- name: SYMBOL
description: 'The symbol belonging to the address of the token.'
- name: TOKEN_PRICE
description: '{{ doc("gno_transfer_token_price") }}'
- name: AMOUNT
description: '{{ doc("gno_transfer_amount") }}'
- name: AMOUNT_USD
description: '{{ doc("gno_transfer_amount_usd") }}'
- name: DECIMALS
description: '{{ doc("gno_decimals") }}'
- name: SYMBOL
description: '{{ doc("gno_symbol") }}'
- name: TOKEN_PRICE
description: '{{ doc("gno_transfer_token_price") }}'
- name: HAS_DECIMAL
description: '{{ doc("gno_transfer_has_decimal") }}'
- name: HAS_PRICE
description: '{{ doc("gno_transfer_has_price") }}'
- name: _LOG_ID
description: '{{ doc("gno_log_id_transfers") }}'
description: '{{ doc("gno_log_id_transfers") }}'
- name: ORIGIN_FUNCTION_SIGNATURE
description: '{{ doc("gno_origin_sig") }}'
- name: ORIGIN_FROM_ADDRESS
description: '{{ doc("gno_eth_origin_from") }}'
- name: ORIGIN_TO_ADDRESS
description: '{{ doc("gno_eth_origin_to") }}'
1 change: 0 additions & 1 deletion models/gold/core/core__fact_token_transfers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ SELECT
block_number,
block_timestamp,
tx_hash,
event_index,
origin_function_signature,
origin_from_address,
origin_to_address,
Expand Down
18 changes: 8 additions & 10 deletions models/gold/core/core__fact_token_transfers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ models:
description: '{{ doc("gno_block_timestamp") }}'
- name: TX_HASH
description: '{{ doc("gno_transfer_tx_hash") }}'
- name: EVENT_INDEX
description: '{{ doc("gno_event_index") }}'
- name: ORIGIN_FUNCTION_SIGNATURE
description: '{{ doc("gno_origin_sig") }}'
- name: ORIGIN_FROM_ADDRESS
description: '{{ doc("gno_origin_from") }}'
- name: ORIGIN_TO_ADDRESS
description: '{{ doc("gno_origin_to") }}'
- name: CONTRACT_ADDRESS
description: '{{ doc("gno_transfer_contract_address") }}'
- name: FROM_ADDRESS
Expand All @@ -27,6 +19,12 @@ models:
- name: RAW_AMOUNT
description: '{{ doc("gno_transfer_raw_amount") }}'
- name: RAW_AMOUNT_PRECISE
description: '{{ doc("gno_transfer_raw_amount_precise") }}'
description: '{{ doc("precise_amount_unadjusted") }}'
- name: _LOG_ID
description: '{{ doc("gno_log_id_transfers") }}'
description: '{{ doc("gno_log_id_transfers") }}'
- name: ORIGIN_FUNCTION_SIGNATURE
description: '{{ doc("gno_origin_sig") }}'
- name: ORIGIN_FROM_ADDRESS
description: '{{ doc("gno_eth_origin_from") }}'
- name: ORIGIN_TO_ADDRESS
description: '{{ doc("gno_eth_origin_to") }}'
Loading

0 comments on commit 84e509d

Please sign in to comment.