-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add tron prices * add to overall model
- Loading branch information
Showing
4 changed files
with
66 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: prices_tron_tokens | ||
meta: | ||
blockchain: tron | ||
sector: prices | ||
contributors: hosuke | ||
config: | ||
tags: ['prices', 'tokens', 'usd', 'tron'] | ||
description: "Price tokens on TRON chain" | ||
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" | ||
tests: | ||
- accepted_values: | ||
values: [ "tron" ] | ||
- 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" |
35 changes: 35 additions & 0 deletions
35
dbt_subprojects/tokens/models/prices/tron/prices_tron_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,35 @@ | ||
{% set blockchain = 'tron' %} | ||
|
||
{{ config( | ||
schema = 'prices_' + blockchain, | ||
alias = 'tokens', | ||
materialized = 'table', | ||
file_format = 'delta', | ||
tags = ['static'] | ||
) | ||
}} | ||
|
||
SELECT | ||
token_id | ||
, '{{ blockchain }}' as blockchain | ||
, symbol | ||
, from_tron_address(contract_address) as contract_address | ||
, decimals | ||
FROM | ||
( | ||
VALUES | ||
('trx-tron', 'WTRX', 'TNUC9Qb1rRpS5CbWLmNMxXBjyFoydXjWFR', 6) | ||
, ('usdt-tether', 'USDT', 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', 6) | ||
, ('weth-weth', 'ETHB', 'TRFe3hT5oYhjSZ6f3ji5FJ7YCfrkWnHRvh', 18) | ||
, ('usdc-usdc', 'USDCOLD', 'TEkxiTehnzSmSe2XqrBj4w32RUN966rdz8', 6) | ||
, ('doge-dogecoin', 'DOGE', 'THbVQp8kMjStKNnf2iCY6NEzThKMK5aBHg', 8) | ||
, ('weth-weth', 'WETH', 'TXWkP3jLBqRGojUih1ShzNyDaN5Csnebok', 18) | ||
, ('ltc-litecoin', 'LTC', 'TR3DLthpnDdCGabhVDbD3VMsiJoCXY3bZd', 8) | ||
, ('wbtc-wrapped-bitcoin', 'WBTC', 'TXpw8XeWYeTUd4quDskoUqeQPowRh4jY65', 8) | ||
, ('tusd-trueusd', 'TUSD', 'TUpMhErZL2fhh4sVNULAbNKLokS4GjC1F4', 18) | ||
, ('htx-htx', 'HTX', 'TUPM7K8REVzD2UdV4R5fe5M8XbnR2DdoJ6', 18) | ||
, ('jst-just', 'JST', 'TCFLL5dx5ZJdKnWuesXxi1VPwjLVmWZZy9', 18) | ||
, ('wbt-whitebit-coin', 'WBT', 'TFptbWaARrWTX5Yvy3gNG5Lm8BmhPx82Bt', 8) | ||
, ('btt-bittorrent', 'BTT', 'TAFjULxiVgT4qWk6UZwjqwZXTSaGaqnVp4', 18) | ||
, ('usdd-usdd', 'USDD', 'TPYmHEhy5n8TCEfYGqW2rPxsghSfzghPDn', 18) | ||
) as temp (token_id, symbol, contract_address, decimals) |