pause for metrics update first

This commit is contained in:
Eric Laurello 2025-04-29 17:09:22 -04:00
parent 15cd08394b
commit 5eefbf41ca
8 changed files with 248 additions and 1 deletions

View File

@ -0,0 +1,64 @@
{{ config(
materialized = 'incremental',
full_refresh = false,
tags = ['noncore']
) }}
WITH tokens_base AS (
SELECT
DISTINCT token_address
FROM
{{ ref('bronze__complete_provider_asset_metadata') }}
UNION
SELECT
DISTINCT token_address
FROM
{{ ref('bronze__complete_token_asset_metadata') }}
),
tokens AS (
SELECT
token_address
FROM
tokens_base A
{% if is_incremental() %}
LEFT JOIN {{ this }}
b USING(token_address)
{% endif %}
{% if is_incremental() %}
WHERE
b.token_address IS NULL
{% endif %}
LIMIT
20
), res AS (
SELECT
token_address,
{{ target.database }}.live.udf_api(
'GET',
'{Service}/{Authentication}/detectAddress?address=' || token_address,
OBJECT_CONSTRUCT(
'Content-Type',
'application/json'
),
OBJECT_CONSTRUCT(),
'Vault/prod/ton/quicknode/mainnet'
) :data :result AS DATA
FROM
tokens
)
SELECT
token_address,
DATA,
DATA :bounceable AS bounceable,
DATA :given_type :: STRING AS given_type,
DATA :non_bounceable AS non_bounceable,
DATA :raw_form :: STRING AS raw_form,
DATA :test_only AS test_only,
SYSDATE() AS _inserted_timestamp
FROM
res
WHERE
raw_form IS NOT NULL

View File

@ -0,0 +1,26 @@
{{ config (
materialized = 'view',
tags = ['bronze_prices']
) }}
SELECT
asset_id,
symbol,
NAME,
decimals,
blockchain,
is_deprecated,
provider,
source,
_inserted_timestamp,
inserted_timestamp,
modified_timestamp,
complete_native_asset_metadata_id,
_invocation_id
FROM
{{ source(
'crosschain_silver',
'complete_native_asset_metadata'
) }}
WHERE
blockchain = 'toncoin'

View File

@ -0,0 +1,29 @@
{{ config (
materialized = 'view',
tags = ['bronze_prices']
) }}
SELECT
HOUR,
asset_id,
symbol,
NAME,
decimals,
price,
blockchain,
is_imputed,
is_deprecated,
provider,
source,
_inserted_timestamp,
inserted_timestamp,
modified_timestamp,
complete_native_prices_id,
_invocation_id
FROM
{{ source(
'crosschain_silver',
'complete_native_prices'
) }}
WHERE
blockchain = 'toncoin'

View File

@ -0,0 +1,31 @@
{{ config (
materialized = 'view',
tags = ['bronze_prices']
) }}
SELECT
asset_id,
token_address,
NAME,
symbol,
platform,
platform_id,
provider,
source,
_inserted_timestamp,
inserted_timestamp,
modified_timestamp,
complete_provider_asset_metadata_id,
_invocation_id
FROM
{{ source(
'crosschain_silver',
'complete_provider_asset_metadata'
) }}
WHERE
LOWER(platform) IN (
'ton',
'toncoin'
)
AND len(token_address) > 5
AND token_address LIKE 'E%'

View File

@ -0,0 +1,24 @@
{{ config (
materialized = 'view',
tags = ['bronze_prices']
) }}
SELECT
asset_id,
recorded_hour,
OPEN,
high,
low,
CLOSE,
provider,
source,
_inserted_timestamp,
inserted_timestamp,
modified_timestamp,
complete_provider_prices_id,
_invocation_id
FROM
{{ source(
'crosschain_silver',
'complete_provider_prices'
) }}

View File

@ -0,0 +1,32 @@
{{ config (
materialized = 'view',
tags = ['bronze_prices']
) }}
SELECT
token_address,
asset_id,
symbol,
NAME,
decimals,
blockchain,
blockchain_name,
blockchain_id,
is_deprecated,
provider,
source,
_inserted_timestamp,
inserted_timestamp,
modified_timestamp,
complete_token_asset_metadata_id,
_invocation_id
FROM
{{ source(
'crosschain_silver',
'complete_token_asset_metadata'
) }}
WHERE
LOWER(blockchain) IN (
'ton',
'toncoin'
)

View File

@ -0,0 +1,36 @@
{{ config (
materialized = 'view',
tags = ['bronze_prices']
) }}
SELECT
HOUR,
token_address,
asset_id,
symbol,
NAME,
decimals,
price,
blockchain,
blockchain_name,
blockchain_id,
is_imputed,
is_deprecated,
provider,
source,
_inserted_timestamp,
inserted_timestamp,
modified_timestamp,
complete_token_prices_id,
_invocation_id
FROM
{{ source(
'crosschain_silver',
'complete_token_prices'
) }}
WHERE
LOWER(blockchain) IN (
'ton',
'toncoin'
)
AND len(token_address) > 5

View File

@ -36,5 +36,10 @@ sources:
schema: silver
tables:
- name: number_sequence
- name: labels_combined
- name: complete_native_asset_metadata
- name: complete_native_prices
- name: labels_combined
- name: complete_provider_asset_metadata
- name: complete_provider_prices
- name: complete_token_asset_metadata
- name: complete_token_prices