From c2ec6ed28baa0e6cf5c88aef939ad74d7733c6ed Mon Sep 17 00:00:00 2001 From: viniabussafi Date: Tue, 30 Apr 2024 18:46:46 +0100 Subject: [PATCH 1/2] init zkevm prices --- models/prices/prices_schema.yml | 4 +-- models/prices/prices_tokens.sql | 1 + models/prices/zkevm/prices_zkevm_schema.yml | 29 ++++++++++++++++++++ models/prices/zkevm/prices_zkevm_tokens.sql | 30 +++++++++++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 models/prices/zkevm/prices_zkevm_schema.yml create mode 100644 models/prices/zkevm/prices_zkevm_tokens.sql diff --git a/models/prices/prices_schema.yml b/models/prices/prices_schema.yml index 847b02d35d2..32c1ea6e254 100644 --- a/models/prices/prices_schema.yml +++ b/models/prices/prices_schema.yml @@ -3,9 +3,9 @@ version: 2 models: - name: prices_tokens meta: - blockchain: arbitrum, avalanche_c, gnosis, polygon, optimism, ethereum, bnb, solana, fantom, celo, base, zksync, zora + blockchain: arbitrum, avalanche_c, gnosis, polygon, optimism, ethereum, bnb, solana, fantom, celo, base, zksync, zora, zkevm sector: prices - contributors: aalan3, hildobby + contributors: aalan3, hildobby, viniabussafi config: tags: ['prices', 'tokens', 'usd'] description: "Price tokens" diff --git a/models/prices/prices_tokens.sql b/models/prices/prices_tokens.sql index 737a425badb..a47915573f6 100644 --- a/models/prices/prices_tokens.sql +++ b/models/prices/prices_tokens.sql @@ -29,6 +29,7 @@ ref('prices_native_tokens') ,ref('prices_zksync_tokens') ,ref('prices_zora_tokens') ,ref('prices_scroll_tokens') +,ref('prices_zkevm_tokens') ] %} diff --git a/models/prices/zkevm/prices_zkevm_schema.yml b/models/prices/zkevm/prices_zkevm_schema.yml new file mode 100644 index 00000000000..6e26f113317 --- /dev/null +++ b/models/prices/zkevm/prices_zkevm_schema.yml @@ -0,0 +1,29 @@ +version: 2 + +models: + - name: prices_zkevm_tokens + meta: + blockchain: zkevm + sector: prices + contributors: viniabussafi + config: + tags: ['prices', 'tokens', 'usd', 'zkevm'] + description: "Price tokens on polygon zkevm 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: [ "zkevm" ] + - 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" \ No newline at end of file diff --git a/models/prices/zkevm/prices_zkevm_tokens.sql b/models/prices/zkevm/prices_zkevm_tokens.sql new file mode 100644 index 00000000000..170e791af32 --- /dev/null +++ b/models/prices/zkevm/prices_zkevm_tokens.sql @@ -0,0 +1,30 @@ +{{ config( + schema='prices_zkevm', + alias = 'tokens', + materialized='table', + file_format = 'delta', + tags = ['static'] + ) +}} +SELECT + token_id + , blockchain + , symbol + , contract_address + , decimals +FROM +( + VALUES + ('weth-weth','zkevm','WETH',0x4f9a0e7fd2bf6067db6994cf12e4495df938e6e9,18), + ('reth-rocket-pool-eth','zkevm','RETH',0xb23c20efce6e24acca0cef9b7b7aa196b84ec942,18), + ('usdc-usdc','zkevm','USDC',0x37eaa0ef3549a5bb7d431be78a3d99bd360d19e5,6), + ('dai-dai','zkevm','DAI',0x744c5860ba161b5316f7e80d9ec415e2727e5bd5,18), + ('rseth-rseth','zkevm','RSETH',0x8c7d118b5c47a5bcbd47cc51789558b98dad17c5,18), + ('rwsteth-wrapped-liquid-staked-ether-20','zkevm','WSTETH',0x5d8cff95d7a57c0bf50b30b43c7cc0d52825d4a9,18), + ('aura-aura-finance','zkevm','AURA',0x1509706a6c66ca549ff0cb464de88231ddbe213b,18), + ('matic-polygon','zkevm','MATIC',0xa2036f0538221a77a3937f1379699f44945018d0,18), + ('aeth-ankreth','zkevm','AETH',0x12d8ce035c5de3ce39b1fdd4c1d5a745eaba3b8c,18), + ('bal-balancer','zkevm','BAL',0x120ef59b80774f02211563834d8e3b72cb1649d6,18), + ('usdt-tether','zkevm','USDT',0x1e4a5963abfd975d8c9021ce480b42188849d41d,6) +) as temp (token_id, blockchain, symbol, contract_address, decimals) + From 27734e94cd1433500855a3c28811c5bbe784d487 Mon Sep 17 00:00:00 2001 From: jeff-dude <102681548+jeff-dude@users.noreply.github.com> Date: Tue, 30 Apr 2024 19:33:10 -0400 Subject: [PATCH 2/2] remove invalid id --- models/prices/zkevm/prices_zkevm_tokens.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/models/prices/zkevm/prices_zkevm_tokens.sql b/models/prices/zkevm/prices_zkevm_tokens.sql index 170e791af32..7d43ea95cab 100644 --- a/models/prices/zkevm/prices_zkevm_tokens.sql +++ b/models/prices/zkevm/prices_zkevm_tokens.sql @@ -20,7 +20,6 @@ FROM ('usdc-usdc','zkevm','USDC',0x37eaa0ef3549a5bb7d431be78a3d99bd360d19e5,6), ('dai-dai','zkevm','DAI',0x744c5860ba161b5316f7e80d9ec415e2727e5bd5,18), ('rseth-rseth','zkevm','RSETH',0x8c7d118b5c47a5bcbd47cc51789558b98dad17c5,18), - ('rwsteth-wrapped-liquid-staked-ether-20','zkevm','WSTETH',0x5d8cff95d7a57c0bf50b30b43c7cc0d52825d4a9,18), ('aura-aura-finance','zkevm','AURA',0x1509706a6c66ca549ff0cb464de88231ddbe213b,18), ('matic-polygon','zkevm','MATIC',0xa2036f0538221a77a3937f1379699f44945018d0,18), ('aeth-ankreth','zkevm','AETH',0x12d8ce035c5de3ce39b1fdd4c1d5a745eaba3b8c,18),