ethereum-models/macros/tests/token_address_match.sql
drethereum 9d935537c6
An 2385/eth silver token prices hourly (#256)
* added silver tables for coingecko and coinmarketcap hourly token prices, includes new yml files and updates to sources

* updated streamline dex pool SLP ratio model by changing coingecko sources from uppercase to lowercase to match sources.yml case

* added additional source for legacy prices

* removed users file

* dupes test

* fixed issue with duplicate values by removing id, symbol and decimal columns from final output

* added regex filter to clean up token_address

* created custom generic test to flag token addresses with improper formatting

* reformatted models with dbt formatter and added unique key column for incremental merge

* resolved spacing error from reformat

Co-authored-by: Austin <austin@flipsidecrypto.com>
2022-11-10 13:33:27 -07:00

14 lines
262 B
SQL

{% test token_address_match(
model,
column_name
) %}
SELECT DISTINCT {{ column_name }}
FROM
{{ model }}
WHERE
{{ column_name }} IS NOT NULL
AND (LEN({{ column_name }}) != 42
OR {{ column_name }} NOT ILIKE '0x%')
{% endtest %}