Skip to content

Commit

Permalink
Merge pull request #770 from tellor-io/adding-frax
Browse files Browse the repository at this point in the history
Adding frax to telliot-feeds
  • Loading branch information
brendaloya authored Mar 29, 2024
2 parents 1867a90 + 3fa64cb commit a57be1a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ install_requires =
rlp==2.0.1
simple-term-menu==1.5.2
six==1.16.0
telliot-core==0.3.2
telliot-core==0.3.3
toolz==0.12.0
typing_extensions==4.4.0
urllib3==1.26.12
Expand Down
2 changes: 1 addition & 1 deletion src/telliot_feeds/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.19"
__version__ = "0.1.20"
2 changes: 2 additions & 0 deletions src/telliot_feeds/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
PULSECHAIN_CHAINS = {369, 943}

MANTLE_CHAINS = {5001, 5000}

FRAX_CHAINS = {2522, 252}
5 changes: 5 additions & 0 deletions src/telliot_feeds/utils/reporter_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from telliot_feeds.constants import ETHEREUM_CHAINS
from telliot_feeds.constants import FILECOIN_CHAINS
from telliot_feeds.constants import FRAX_CHAINS
from telliot_feeds.constants import GNOSIS_CHAINS
from telliot_feeds.constants import MANTLE_CHAINS
from telliot_feeds.constants import POLYGON_CHAINS
Expand Down Expand Up @@ -182,6 +183,8 @@ def get_native_token_feed(chain_id: int) -> DataFeed[float]:
return pls_usd_median_feed
elif chain_id in MANTLE_CHAINS:
return mnt_usd_median_feed
elif chain_id in FRAX_CHAINS:
return eth_usd_median_feed
else:
raise ValueError(f"Cannot fetch native token feed. Invalid chain ID: {chain_id}")

Expand All @@ -199,6 +202,8 @@ def tkn_symbol(chain_id: int) -> str:
return "PLS"
elif chain_id in MANTLE_CHAINS:
return "MNT"
elif chain_id in FRAX_CHAINS:
return "frxETH"
else:
return "Unknown native token"

Expand Down

0 comments on commit a57be1a

Please sign in to comment.