Skip to content

Commit

Permalink
Add sonic prices
Browse files Browse the repository at this point in the history
  • Loading branch information
Hosuke committed Dec 23, 2024
1 parent b580934 commit 3642773
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dbt_subprojects/tokens/models/prices/prices_tokens.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
, "scroll"
, "sei"
, "solana"
, "sonic"
, "viction"
, "worldchain"
, "zksync"
Expand Down Expand Up @@ -70,6 +71,7 @@ ref('prices_native_tokens')
,ref('prices_ronin_tokens')
,ref('prices_boba_tokens')
,ref('prices_viction_tokens')
,ref('prices_sonic_tokens')
] %}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ WITH trusted_tokens AS (
, ('solana', from_base58('mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So'))
, ('solana', from_base58('Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'))
, ('solana', from_base58('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'))
, ('sonic', 0x309C92261178fA0CF748A855e90Ae73FDb79EBc7)
, ('sonic', 0x29219dd400f2Bf60E5a23d13Be72B486D4038894)
, ('sonic', 0xe715cba7b5ccb33790cebff1436809d36cb17e57)
, ('worldchain', 0x2cFc85d8E48F8EAB294be644d9E25C3030863003)
, ('worldchain', 0x79A02482A880bCE3F13e09Da970dC34db4CD24d1)
, ('worldchain', 0x03C7054BCB39f7b2e5B2c7AcB37583e32D70Cfa3)
Expand Down
22 changes: 22 additions & 0 deletions dbt_subprojects/tokens/models/prices/sonic/_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2

models:
- name: prices_sonic_tokens
meta:
blockchain: sonic
sector: tokens
contributors: hosuke
config:
tags: ['tokens', 'sonic', 'prices']
description: "Token prices and metadata on Sonic"
columns:
- name: token_id
description: "Unique identifier for the token"
- name: blockchain
description: "Blockchain where the token is deployed"
- name: symbol
description: "Token symbol"
- name: contract_address
description: "Contract address of the token"
- name: decimals
description: "Number of decimal places for the token"
24 changes: 24 additions & 0 deletions dbt_subprojects/tokens/models/prices/sonic/prices_sonic_tokens.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% set blockchain = 'sonic' %}

{{ 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', 0x309C92261178fA0CF748A855e90Ae73FDb79EBc7, 18)
, ('usdc-usd-coin', 'USDC.e', 0x29219dd400f2Bf60E5a23d13Be72B486D4038894, 6)
, ('euroc-euro-coin', 'EURC.e', 0xe715cba7b5ccb33790cebff1436809d36cb17e57, 6)
) as temp (token_id, symbol, contract_address, decimals)

0 comments on commit 3642773

Please sign in to comment.