-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initiate corn in spellbook #7394
base: main
Are you sure you want to change the base?
Changes from all commits
98abc2c
e12926c
b43843c
81606e6
b4321ea
8b414d3
a7ada63
de4ccf4
1c1da36
d8e8b7d
48d995d
3b5935e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: prices_corn_tokens | ||
meta: | ||
blockchain: corn | ||
sector: prices | ||
contributors: hosuke | ||
config: | ||
tags: ['prices', 'tokens', 'usd', 'corn'] | ||
description: "Price tokens on Corn 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: [ "corn" ] | ||
- 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" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% set blockchain = 'corn' %} | ||
|
||
{{ 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 | ||
('wbtc-wrapped-bitcoin', 'wBTCN', 0xda5ddd7270381a7c2717ad10d1c0ecb19e3cdfb2, 18) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should I use wbtc price feed for wBTCN? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good question, let me ask 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay, we should be good to use bitcoin pricing for this. here is answer from corn team:
|
||
, ('lbtc-lombard-staked-btc', 'LBTC', 0xecAc9C5F704e954931349Da37F60E39f515c11c1, 8) | ||
, ('usdce-usd-coine', 'USDC.e', 0xDF0B24095e15044538866576754F3C964e902Ee6, 6) | ||
, ('pumpbtc-pumpbtc', 'pumpBTC', 0xF469fBD2abcd6B9de8E169d128226C0Fc90a012e, 8) | ||
) as temp (token_id, symbol, contract_address, decimals) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: tokens_corn_erc20 | ||
meta: | ||
blockchain: corn | ||
sector: tokens | ||
contributors: hosuke | ||
config: | ||
tags: ['tokens', 'corn', 'erc20'] | ||
description: "Known CORN ERC20 tokens" | ||
columns: | ||
- name: contract_address | ||
description: "Contract address of the ERC20 token" | ||
data_tests: | ||
- unique | ||
- not_null | ||
- name: symbol | ||
description: "Symbol of the token" | ||
data_tests: | ||
- not_null | ||
- name: decimals | ||
description: "Number of decimals the token has" | ||
data_tests: | ||
- not_null |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{ | ||
config( | ||
schema = 'tokens_corn' | ||
,alias = 'erc20' | ||
,tags = ['static'] | ||
,materialized = 'table' | ||
) | ||
}} | ||
|
||
SELECT | ||
contract_address | ||
, symbol | ||
, decimals | ||
FROM (VALUES | ||
(0xda5ddd7270381a7c2717ad10d1c0ecb19e3cdfb2, 'wBTCN', 18) | ||
, (0xecAc9C5F704e954931349Da37F60E39f515c11c1, 'LBTC', 8) | ||
, (0xDF0B24095e15044538866576754F3C964e902Ee6, 'USDC.e', 6) | ||
, (0xF469fBD2abcd6B9de8E169d128226C0Fc90a012e, 'pumpBTC', 8) | ||
) as temp (contract_address, symbol, decimals) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think we're safe to say
true
now, right?