Skip to content

Commit

Permalink
Merge branch 'main' into stablesurge
Browse files Browse the repository at this point in the history
  • Loading branch information
Hosuke authored Feb 11, 2025
2 parents a500d53 + 4b6790b commit bc7863f
Show file tree
Hide file tree
Showing 12 changed files with 948 additions and 1 deletion.
1 change: 1 addition & 0 deletions dbt_subprojects/daily_spellbook/models/evms/evms_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,6 @@ FROM (
, (146, 'sonic', 'Sonic', 'Layer 1', NULL, 'SONIC', NULL, 'https://sonicscan.org/', timestamp '2024-12-01 00:00', NULL, NULL, NULL, true)
, (57073, 'ink', 'Ink', 'Layer 2', 'Optimistic Rollup', 'ETH', 0x4200000000000000000000000000000000000006, 'https://explorer.inkonchain.com/', timestamp '2024-12-06 15:20', 'OP Stack', 'Ethereum Blobs', 'Ethereum', true)
, (2741, 'abstract', 'Abstract', 'Layer 2', 'Optimistic Rollup', 'ETH', 0x3439153EB7AF838Ad19d56E1571FBD09333C2809, 'https://explorer.testnet.abs.xyz/', timestamp '2024-06-17 22:39', 'OP Stack', 'Ethereum Blobs', 'Ethereum', true)
, (80094, 'berachain', 'Berachain', 'Layer 1', NULL, 'BERA', NULL, 'https://berascan.com/', timestamp '2024-01-20 14:14:11', NULL, NULL, NULL, true)
) AS temp_table (chain_id, blockchain, name, chain_type, rollup_type, native_token_symbol, wrapped_native_token_address, explorer_link, first_block_time, codebase, data_availability, settlement, is_on_dune)

29 changes: 29 additions & 0 deletions dbt_subprojects/tokens/models/prices/berachain/_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2

models:
- name: prices_berachain_tokens
meta:
blockchain: berachain
sector: prices
contributors: hosuke
config:
tags: ['prices', 'tokens', 'usd', 'berachain']
description: "Price tokens on Berachain 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."
- name: blockchain
description: "Native blockchain of the token, if any"
data_tests:
- accepted_values:
values: [ "berachain" ]
- 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,24 @@
{% set blockchain = 'berachain' %}

{{ 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
('usde-ethena-usde', 'USDe', 0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34, 18)
, ('weeth-wrapped-eeth', 'weETH', 0x7dcc39b4d1c53cb31e1abc0e358b43987fef80f7, 18)
, ('lbtc-lombard-staked-btc', 'LBTC', 0xecac9c5f704e954931349da37f60e39f515c11c1, 8)
) as temp (token_id, symbol, contract_address, decimals)
Original file line number Diff line number Diff line change
Expand Up @@ -1875,7 +1875,8 @@ FROM
('wagmi5-wagmi', 'ethereum', 'WAGMI', 0x92CC36D66e9d739D50673d1f27929a371FB83a67, 18),
('deusd-elixir-deusd','ethereum', 'DEUSD', 0x15700b564ca08d9439c58ca5053166e8317aa138, 18),
('unibot-unibot','ethereum', 'UNIBOT', 0xf819d9cb1c2a819fd991781a822de3ca8607c3c9, 18),
('morpho-morpho','ethereum', 'MORPHO', 0x58d97b57bb95320f9a05dc918aef65434969c2b2, 18)
('morpho-morpho','ethereum', 'MORPHO', 0x58d97b57bb95320f9a05dc918aef65434969c2b2, 18),
('scrvusd-savings-crvusd', 'ethereum', 'SCRVUSD', 0x0655977FEb2f289A4aB78af67BAB0d17aAb84367, 18)

) as temp (token_id, blockchain, symbol, contract_address, decimals)
where contract_address not in (
Expand Down
1 change: 1 addition & 0 deletions dbt_subprojects/tokens/models/prices/prices_tokens.sql
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ ref('prices_native_tokens')
,ref('prices_sonic_tokens')
,ref('prices_ink_tokens')
,ref('prices_abstract_tokens')
,ref('prices_berachain_tokens')
] %}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ WITH trusted_tokens AS (
, ('zksync', 0x000000000000000000000000000000000000800a)
, ('zksync', 0xbbeb516fb02a01611cbbe0453fe3c580d7281011)
, ('zora', 0x4200000000000000000000000000000000000006)
, ('berachain', 0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34) -- USDe
, ('berachain', 0x7dcc39b4d1c53cb31e1abc0e358b43987fef80f7) -- weETH
, ('berachain', 0xecac9c5f704e954931349da37f60e39f515c11c1) -- LBTC
) AS t (blockchain, contract_address)
), erc20 as (
SELECT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ FROM
, ('brush-brush', 'BRUSH', 0xe51ee9868c1f0d6cd968a8b8c8376dc2991bfe44, 18)
, ('wagmi5-wagmi', 'WAGMI', 0x0e0Ce4D450c705F8a0B6Dd9d5123e3df2787D16B, 18)
, ('anon-heyanon', 'Anon', 0x79bbf4508b1391af3a0f4b30bb5fc4aa9ab0e07c, 18)
, ('shadow-shadow', 'SHADOW', 0x3333b97138d4b086720b5ae8a7844b1345a33333, 18)
) as temp (token_id, symbol, contract_address, decimals)
21 changes: 21 additions & 0 deletions dbt_subprojects/tokens/models/tokens/berachain/_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2

models:
- name: tokens_berachain_erc20
meta:
blockchain: berachain
sector: tokens
project: erc20
contributors: hosuke
config:
tags: ['table', 'erc20', 'berachain']
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"
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{
config(
schema = 'tokens_berachain'
,alias = 'erc20'
,tags = ['static']
,materialized = 'table'
)
}}

SELECT
contract_address
, symbol
, decimals
FROM (VALUES
(0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34, 'USDe', 18)
, (0x7dcc39b4d1c53cb31e1abc0e358b43987fef80f7, 'weETH', 18)
, (0xecac9c5f704e954931349da37f60e39f515c11c1, 'LBTC', 8)
) AS temp_table (contract_address, symbol, decimals)
2 changes: 2 additions & 0 deletions dbt_subprojects/tokens/models/tokens/tokens_erc20.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
,"zora"
,"bob"
,"sonic"
,"berachain"
]\',
"sector",
"tokens",
Expand Down Expand Up @@ -83,6 +84,7 @@
,'tokens_corn': {'blockchain': 'corn', 'model': ref('tokens_corn_erc20')}
,'tokens_ink': {'blockchain': 'ink', 'model': ref('tokens_ink_erc20')}
,'tokens_abstract': {'blockchain': 'abstract', 'model': ref('tokens_abstract_erc20')}
,'tokens_berachain': {'blockchain': 'berachain', 'model': ref('tokens_berachain_erc20')}
} %}

with automated_source as (
Expand Down
Loading

0 comments on commit bc7863f

Please sign in to comment.