Skip to content

Commit

Permalink
Add mantle prices feed (#6112)
Browse files Browse the repository at this point in the history
* Add prices_mantle.tokens

* Add prices_mantle.tokens

* Fix token-id

* Fix quote

* Add mantle support

* Add and clasify tokens

* finalize prices file

---------

Co-authored-by: jeff-dude <[email protected]>
  • Loading branch information
Hosuke and jeff-dude authored Jun 11, 2024
1 parent f94d856 commit cd72e2f
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 2 deletions.
29 changes: 29 additions & 0 deletions models/prices/mantle/prices_mantle_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2

models:
- name: prices_mantle_tokens
meta:
blockchain: mantle
sector: prices
contributors: hosuke
config:
tags: ['prices', 'tokens', 'usd', 'mantle']
description: "Price tokens on mantle L2 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: [ "mantle" ]
- 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"
30 changes: 30 additions & 0 deletions models/prices/mantle/prices_mantle_tokens.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{ config(
schema='prices_mantle',
alias='tokens',
materialized='table',
file_format='delta',
tags=['static']
)
}}

SELECT
token_id,
blockchain,
symbol,
contract_address,
decimals
FROM
(
VALUES
('mnt-mantle', 'mantle', 'MNT', 0xdeaddeaddeaddeaddeaddeaddeaddeaddead0000, 18),
('mnt-mantle', 'mantle', 'WMNT', 0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8, 18),
('joe-trader-joe', 'mantle', 'JOE', 0x371c7ec6d8039ff7933a2aa28eb827ffe1f52f07, 18),
('usdc-usd-coin', 'mantle', 'USDC', 0x09bc4e0d864854c6afb6eb9a9cdf58ac190d0df9, 6),
('weth-weth', 'mantle', 'WETH', 0xdeaddeaddeaddeaddeaddeaddeaddeaddead1111, 18),
('meth-meth', 'mantle', 'mETH', 0xcda86a272531e8640cd7f1a92c01839911b90bb0, 18),
('usdt-tether', 'mantle', 'USDT', 0x201eba5cc46d216ce6dc03f6a759e8e766e956ae, 6),
('axlusdc-axelar-wrapped-usdc', 'mantle', 'axlUSDC', 0xeb466342c4d449bc9f53a865d5cb90586f405215, 6),
('stg-stargatetoken', 'mantle', 'STG', 0x8731d54e9d02c286767d56ac03e8037c07e01e98, 18),
('pendle-pendle', 'mantle', 'PENDLE', 0xd27b18915e7acc8fd6ac75db6766a80f8d2f5729, 18),
('ena-ethena', 'mantle', 'ENA', 0x58538e6a46e07434d7e7375bc268d3cb839c0133, 18)
) as temp (token_id, blockchain, symbol, contract_address, decimals)
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", "0xRob"]\') }}'
\'["aalan3", "jeff-dude", "umer_h_adil", "0xBoxer", "rantum", "lgingerich", "hildobby", "cryptokoryo", "0xRob", "hosuke"]\') }}'
)
}}

Expand All @@ -31,6 +31,7 @@ ref('prices_native_tokens')
,ref('prices_scroll_tokens')
,ref('prices_linea_tokens')
,ref('prices_zkevm_tokens')
,ref('prices_mantle_tokens')
] %}


Expand Down
3 changes: 2 additions & 1 deletion scripts/token_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def __init__(self):
"celo": "celo-celo",
"base": "base-base",
"zksync": "zksync-zksync",
"zora": "eth-ethereum"
"zora": "eth-ethereum",
"mantle": "mnt-mantle"
}
self.tokens_by_id = self.get_tokens()
self.contracts_by_chain = self.get_contracts()
Expand Down

0 comments on commit cd72e2f

Please sign in to comment.