Skip to content

Commit

Permalink
styles and typing
Browse files Browse the repository at this point in the history
  • Loading branch information
0xSpuddy committed Jan 31, 2024
1 parent 62f695a commit 5d32881
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
14 changes: 1 addition & 13 deletions src/telliot_feeds/sources/price/spot/uniswapV3Pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@

logger = get_logger(__name__)


"""
Use the UniswapV3 subgraph playground to determine
if the spot price asset is token0 or token1.
Add the pool's contract address to either the
uniswapV3token0_map or uniswapV3token1_map accordingly
https://thegraph.com/hosted-service/subgraph/uniswap/uniswap-v3
"""
uniswapV3token0__pool_map = {
"oeth": "0x52299416c469843f4e0d54688099966a6c7d720f",
}
Expand All @@ -42,16 +34,12 @@ def __init__(self, **kwargs: Any) -> None:

async def get_price(self, asset: str, currency: str) -> OptionalDataPoint[float]:
"""Implement PriceServiceInterface
This implementation gets the price from the UniswapV3 subgraph using the pool query
https://docs.uniswap.org/sdk/subgraph/subgraph-examples
"""

asset = asset.lower()

pool0 = uniswapV3token0__pool_map.get(asset, None)

pool1 = uniswapV3token1__pool_map.get(asset, None)

if not pool0 and not pool1:
Expand Down Expand Up @@ -100,7 +88,7 @@ async def get_price(self, asset: str, currency: str) -> OptionalDataPoint[float]
msg = "Error parsing UniswapV3 pool response: KeyError: {}".format(e)
logger.critical(msg)
return None, None

else:
raise Exception("Invalid response from get_url")

Expand Down
1 change: 0 additions & 1 deletion tests/feeds/test_wsteth_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pytest

from telliot_feeds.feeds.wsteth_feed import wsteth_eth_median_feed
from telliot_feeds.feeds.wsteth_feed import wsteth_usd_median_feed


@pytest.mark.asyncio
Expand Down

0 comments on commit 5d32881

Please sign in to comment.