-
Notifications
You must be signed in to change notification settings - Fork 0
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
models for new queries, tests #40
Conversation
bal_tools/pools_gauges.py
Outdated
""" | ||
query all pools from the apiv3 subgraph | ||
filters out disabled pools | ||
""" | ||
data = self.subgraph.fetch_graphql_data("apiv3", "get_pools", {"chain": self.chain.upper()}) | ||
all_pools = [] | ||
for pool in data["poolGetPools"]: | ||
if pool['dynamicData']['swapEnabled']: | ||
all_pools.append({"address": pool['id'], "symbol": pool['symbol']}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note the pool['id']
data here is now referenced with id
rather than address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea i kept it as address
because that is how it is used in bal_addresses, but i think to make it uniform with pool makes more sense. we just need to make sure we propagate this change downstream then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think PoolID and Address are different. Suggest we not remove whatever was already there from results, but it could make sense to add the other. Maybe this was already resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch; fixed in 90061d0
bal_tools/pools_gauges.py
Outdated
""" | ||
query all pools from the apiv3 subgraph | ||
filters out disabled pools | ||
""" | ||
data = self.subgraph.fetch_graphql_data("apiv3", "get_pools", {"chain": self.chain.upper()}) | ||
all_pools = [] | ||
for pool in data["poolGetPools"]: | ||
if pool['dynamicData']['swapEnabled']: | ||
all_pools.append({"address": pool['id'], "symbol": pool['symbol']}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea i kept it as address
because that is how it is used in bal_addresses, but i think to make it uniform with pool makes more sense. we just need to make sure we propagate this change downstream then
class PoolData(BaseModel): | ||
id: str | ||
symbol: str | ||
dynamicData: dict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this can be dropped too. we are always filtering on pool_data.dynamicData['swapEnabled']
, so the attribute is useless no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is independent from whatever the query_all_pools method is doing, the model is for modeling the data from the api. in this case, each element in the poolGetPools
query
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm ok, i guess we could pop it before returning at the end of query_all_pools
but it is not that important
implemented a |
No description provided.