Skip to content

Commit

Permalink
Scroll prices and tokens (#5569)
Browse files Browse the repository at this point in the history
* scroll prices and tokens

* remove duplicate
  • Loading branch information
0xRobin authored Mar 12, 2024
1 parent 6f20e9e commit 8bca233
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 2 deletions.
3 changes: 2 additions & 1 deletion models/prices/prices_tokens.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
post_hook = '{{ expose_spells(\'["ethereum", "solana", "arbitrum", "gnosis", "optimism", "bnb", "avalanche_c", "polygon", "fantom", "celo", "base", "zksync", "zora", "bitcoin", "cardano"]\',
"sector",
"prices",
\'["aalan3", "jeff-dude", "umer_h_adil", "0xBoxer", "rantum", "lgingerich", "hildobby", "cryptokoryo"]\') }}'
\'["aalan3", "jeff-dude", "umer_h_adil", "0xBoxer", "rantum", "lgingerich", "hildobby", "cryptokoryo", "0xRob"]\') }}'
)
}}

Expand All @@ -28,6 +28,7 @@ ref('prices_native_tokens')
,ref('prices_base_tokens')
,ref('prices_zksync_tokens')
,ref('prices_zora_tokens')
,ref('prices_scroll_tokens')
] %}


Expand Down
29 changes: 29 additions & 0 deletions models/prices/scroll/prices_scroll_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2

models:
- name: prices_scroll_tokens
meta:
blockchain: scroll
sector: prices
contributors: 0xRob
config:
tags: ['prices', 'tokens', 'usd', 'scroll']
description: "Price tokens on scroll 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: [ "scroll" ]
- 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"
27 changes: 27 additions & 0 deletions models/prices/scroll/prices_scroll_tokens.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{ config(
schema='prices_scroll',
alias = 'tokens',
materialized='table',
file_format = 'delta',
tags = ['static']
)
}}
SELECT
token_id
, blockchain
, symbol
, contract_address
, decimals
FROM
(
VALUES
('weth-weth', 'scroll', 'WETH', 0x5300000000000000000000000000000000000004, 18),
('wbtc-wrapped-bitcoin', 'scroll', 'WBTC', 0x3C1BCa5a656e69edCD0D4E36BEbb3FcDAcA60Cf1, 8),
('usdc-usd-coin', 'scroll', 'USDC', 0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4, 6),
('usdt-tether', 'scroll', 'USDT', 0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df, 6),
('izi-izumi-finance', 'scroll', 'iZi', 0x60D01EC2D5E98Ac51C8B4cF84DfCCE98D527c747, 18),
('lusd-liquity-usd', 'scroll', 'LUSD', 0xeDEAbc3A1e7D21fE835FFA6f83a710c70BB1a051, 18),
('wsteth-wrapped-liquid-staked-ether-20', 'scroll', 'wstETH', 0xf610A9dfB7C89644979b4A0f27063E9e7d7Cda32, 18),
('reth-rocket-pool-eth', 'scroll', 'rETH', 0x53878B874283351D26d206FA512aEcE1Bef6C0dD, 18)

) as temp (token_id, blockchain, symbol, contract_address, decimals)
23 changes: 23 additions & 0 deletions tokens/models/tokens/scroll/tokens_scroll_erc20.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{ config(
schema = 'tokens_scroll'
, alias = 'erc20'
, tags=['static']
)
}}

SELECT contract_address, symbol, decimals
FROM (VALUES
(0x5300000000000000000000000000000000000004, 'WETH', 18)
,(0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df, 'USDT', 6)
,(0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4, 'USDC', 6)
,(0x3C1BCa5a656e69edCD0D4E36BEbb3FcDAcA60Cf1, 'WBTC', 8)
,(0x434cdA25E8a2CA5D9c1C449a8Cb6bCbF719233E8, 'UNI', 18)
,(0xcA77eB3fEFe3725Dc33bccB54eDEFc3D9f764f97, 'DAI', 18)
,(0x53878B874283351D26d206FA512aEcE1Bef6C0dD, 'rETH', 18)
,(0x79379C0E09a41d7978f883a56246290eE9a8c4d3, 'AAVE', 18)
,(0x6a28e90582c583fcd3347931c544819C31e9D0e0, 'BAL', 18)
,(0x608ef9A3BffE206B86c3108218003b3cfBf99c84, 'KNC', 18)
,(0xeDEAbc3A1e7D21fE835FFA6f83a710c70BB1a051, 'LUSD', 18)
,(0xf610A9dfB7C89644979b4A0f27063E9e7d7Cda32, 'wstETH', 18)
,(0x60D01EC2D5E98Ac51C8B4cF84DfCCE98D527c747, 'iZi', 18)
) AS temp_table (contract_address, symbol, decimals)
21 changes: 21 additions & 0 deletions tokens/models/tokens/scroll/tokens_scroll_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2

models:
- name: tokens_scroll_erc20
meta:
blockchain: scroll
sector: tokens
project: erc20
contributors: lgingerich
config:
tags: ['table', 'erc20']
description: "ERC20 Token Addresses, Symbols and Decimals"
columns:
- name: contract_address
description: "ERC20 token contract address"
tests:
- unique
- name: symbol
description: "ERC20 token symbol"
- name: decimals
description: "Number of decimals, refers to how divisible an ERC20 token can be"
4 changes: 3 additions & 1 deletion tokens/models/tokens/tokens_erc20.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
post_hook='{{ expose_spells(\'["arbitrum","avalanche_c","bnb","ethereum","optimism", "gnosis", "fantom", "polygon","base", "celo", "zksync","zora"]\',
"sector",
"tokens",
\'["0xManny","hildobby","soispoke","dot2dotseurat","mtitus6","wuligy","lgingerich"]\') }}')}}
\'["0xManny","hildobby","soispoke","dot2dotseurat","mtitus6","wuligy","lgingerich","0xRob"]\') }}')}}

SELECT 'arbitrum' as blockchain, contract_address, symbol, decimals FROM {{ ref('tokens_arbitrum_erc20') }}
UNION ALL
Expand All @@ -30,3 +30,5 @@ UNION ALL
SELECT 'zksync' as blockchain, contract_address, symbol, decimals FROM {{ ref('tokens_zksync_erc20') }}
UNION ALL
SELECT 'zora' as blockchain, contract_address, symbol, decimals FROM {{ ref('tokens_zora_erc20') }}
UNION ALL
SELECT 'scroll' as blockchain, contract_address, symbol, decimals FROM {{ ref('tokens_scroll_erc20') }}

0 comments on commit 8bca233

Please sign in to comment.