Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding frax to telliot-feeds #770

Merged
merged 3 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading