forked from duneanalytics/spellbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initiate ink chain (duneanalytics#7469)
* Add Ink sources * Fix docs * Update ink_base_sources.yml * initiate ink * fix bugs, remove tests --------- Co-authored-by: jeff-dude <[email protected]>
- Loading branch information
Showing
13 changed files
with
903 additions
and
5 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
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_ink_tokens | ||
meta: | ||
blockchain: ink | ||
sector: prices | ||
contributors: jeff-dude | ||
config: | ||
tags: ['prices', 'tokens', 'usd', 'ink'] | ||
description: "Price tokens on ink EVM 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: [ "ink" ] | ||
- 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" |
23 changes: 23 additions & 0 deletions
23
dbt_subprojects/tokens/models/prices/ink/prices_ink_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,23 @@ | ||
{% set blockchain = 'ink' %} | ||
|
||
{{ 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 | ||
('weth-weth', 'WETH', 0x4200000000000000000000000000000000000006, 18) | ||
, ('usdc-usd-coin', 'USDC.e', 0xF1815bd50389c46847f0Bda824eC8da914045D14, 6) | ||
) 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
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,21 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: tokens_ink_erc20 | ||
meta: | ||
blockchain: ink | ||
sector: tokens | ||
project: erc20 | ||
contributors: jeff-dude | ||
config: | ||
tags: ['table', 'erc20', 'ink'] | ||
description: "ERC20 Token Addresses, Symbols and Decimals" | ||
columns: | ||
- name: contract_address | ||
description: "ERC20 token contract address" | ||
data_tests: | ||
- unique | ||
- name: symbol | ||
description: "ERC20 token symbol" | ||
- name: decimals | ||
description: "Number of decimals, refers to how divisible an ERC20 token can be" |
20 changes: 20 additions & 0 deletions
20
dbt_subprojects/tokens/models/tokens/ink/tokens_ink_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,20 @@ | ||
{{ | ||
config( | ||
schema = 'tokens_ink' | ||
,alias = 'erc20' | ||
,tags = ['static'] | ||
,materialized = 'table' | ||
) | ||
}} | ||
|
||
SELECT | ||
contract_address | ||
, symbol | ||
, decimals | ||
FROM (VALUES | ||
(0x4200000000000000000000000000000000000006, 'WETH', 18) | ||
, (0xf1815bd50389c46847f0bda824ec8da914045d14, 'USDC.e', 6) | ||
, (0xca5f2ccbd9c40b32657df57c716de44237f80f05, 'KRAKEN', 18) | ||
, (0x2e1ac42aef8dc9fb4c661d017273e93ba82d3d0e, 'IAGENT', 18) | ||
, (0xbf0cafcbaaf0be8221ae8d630500984edc908861, 'SQUIDS', 18) | ||
) AS temp_table (contract_address, symbol, 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
Oops, something went wrong.