-
-
Notifications
You must be signed in to change notification settings - Fork 522
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
Add new api for yearn #8299
Add new api for yearn #8299
Conversation
- Adds ydemon as new source for yearn vaults. Since it doesn't support the v1 and the old api wasn't being updated with the new vaults we need to aggreagate information from both of them - Also updates the logics to update only the protocol of tokens since it was a common path in the app
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## bugfixes #8299 /- ##
============================================
Coverage 53.77% 53.80% 0.02%
============================================
Files 1707 1707
Lines 168729 168700 -29
Branches 13946 13953 7
============================================
Hits 90742 90765 23
Misses 75561 75505 -56
- Partials 2426 2430 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -72,30 73,62 @@ def _maybe_reset_yearn_cache_timestamp(data: dict[str, Any] | None) -> bool: | |||
return False # will continue | |||
|
|||
|
|||
def _merge_data_yearn_vaults() -> tuple[list[dict[str, Any]] | None, str | None]: | |||
"""At the moment of writing this logic ydemon doesn't support yearn v1 so we |
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.
"""At the moment of writing this logic ydemon doesn't support yearn v1 so we | |
"""At the moment of writing the logic of ydemon doesn't support yearn v1 so we``` |
@@ -72,30 73,62 @@ def _maybe_reset_yearn_cache_timestamp(data: dict[str, Any] | None) -> bool: | |||
return False # will continue | |||
|
|||
|
|||
def _merge_data_yearn_vaults() -> tuple[list[dict[str, Any]] | None, str | None]: | |||
"""At the moment of writing this logic ydemon doesn't support yearn v1 so we | |||
need to aggregate the information from two different apis and remove duplicates. |
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.
are you sure about this need for aggregation? Have you confirmed with yearn people?
log.debug(f'Skipping yearn v3 vault {vault.get("address")}') | ||
continue # skip v3 vaults until we add them #7540 | ||
|
||
if vault_address in vaults_seen: |
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.
why not make them both sets and avoid this extra if? Since you are adding it if it's not there already and that's a set. So that's not needed right?
(new_protocol, token.identifier), | ||
) | ||
|
||
AssetResolver.clean_memory_cache(token.identifier) |
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.
setting these here both in this and edit function changes behaviour for many places. That's correct though right?
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.
Lgtm
the old api wasn't being updated with the new vaults we need to aggreagate information
from both of them
path in the app