-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
dbt_subprojects/tokens/models/prices/unichain/prices_unichain_schema.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: prices_unichain_tokens | ||
meta: | ||
blockchain: unichain | ||
sector: prices | ||
contributors: hosuke | ||
config: | ||
tags: ['prices', 'tokens', 'usd', 'unichain'] | ||
description: "Price tokens on unichain chain" | ||
data_tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- contract_address | ||
columns: | ||
- name: token_id | ||
description: "Id of the token at coinpaprika. This id is required to pull the price feed data. NOTE: Not all tokens are listed at coinpaprika - consider using price data from DEX sources in this case or submit a listing request at coinpaprika." | ||
- name: blockchain | ||
description: "Native blockchain of the token, if any" | ||
data_tests: | ||
- accepted_values: | ||
values: [ "unichain" ] | ||
- name: contract_address | ||
description: "Contract address of the token, if any" | ||
- name: symbol | ||
description: "Token symbol" | ||
- name: decimals | ||
description: "Number of decimals for the token contract" |
25 changes: 25 additions & 0 deletions
25
dbt_subprojects/tokens/models/prices/unichain/prices_unichain_tokens.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% set blockchain = 'unichain' %} | ||
|
||
{{ config( | ||
schema = 'prices_' + blockchain, | ||
alias = 'tokens', | ||
materialized = 'table', | ||
file_format = 'delta', | ||
tags = ['static'] | ||
) | ||
}} | ||
|
||
SELECT | ||
token_id | ||
, '{{ blockchain }}' as blockchain | ||
, symbol | ||
, contract_address | ||
, decimals | ||
FROM | ||
( | ||
VALUES | ||
('eth-ethereum', 'WETH', 0x4200000000000000000000000000000000000006, 18) | ||
, ('usdc-usd-coin', 'USDC', 0x078d782b760474a361dda0af3839290b0ef57ad6, 6) | ||
, ('uni-uniswap', 'UNI', 0x8f187aa05619a017077f5308904739877ce9ea21, 18) | ||
, ('dai-dai', 'DAI', 0x20cab320a855b39f724131c69424240519573f81, 18) | ||
) as temp (token_id, symbol, contract_address, decimals) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
dbt_subprojects/tokens/models/tokens/unichain/tokens_unichain_erc20.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{ | ||
config( | ||
schema = 'tokens_unichain' | ||
,alias = 'erc20' | ||
,tags = ['static'] | ||
,materialized = 'table' | ||
) | ||
}} | ||
|
||
SELECT | ||
contract_address | ||
, symbol | ||
, decimals | ||
FROM (VALUES | ||
(0x4200000000000000000000000000000000000006, 'WETH', 18) | ||
, (0x078d782b760474a361dda0af3839290b0ef57ad6, 'USDC', 6) | ||
, (0x8f187aa05619a017077f5308904739877ce9ea21, 'UNI', 18) | ||
, (0x20cab320a855b39f724131c69424240519573f81, 'DAI', 18) | ||
) AS temp_table (contract_address, symbol, decimals) |
22 changes: 22 additions & 0 deletions
22
dbt_subprojects/tokens/models/tokens/unichain/tokens_unichain_schema.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: tokens_unichain_erc20 | ||
meta: | ||
blockchain: unichain | ||
sector: tokens | ||
contributors: hosuke | ||
config: | ||
tags: ['tokens', 'unichain'] | ||
description: "Known tokens on Unichain" | ||
columns: | ||
- name: contract_address | ||
description: "Token contract address" | ||
tests: | ||
- unique | ||
- name: symbol | ||
description: "Token symbol" | ||
- name: decimals | ||
description: "Number of decimals the token has" | ||
- name: token_name | ||
description: "Name of the token" |