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

Add new api for yearn #8299

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Add new api for yearn #8299

merged 1 commit into from
Jul 19, 2024

Conversation

yabirgb
Copy link
Member

@yabirgb yabirgb commented Jul 19, 2024

  • 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

- 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
@yabirgb yabirgb marked this pull request as ready for review July 19, 2024 13:24
Copy link

codecov bot commented Jul 19, 2024

Codecov Report

Attention: Patch coverage is 73.21429% with 15 lines in your changes missing coverage. Please review.

Project coverage is 53.80%. Comparing base (fb43066) to head (b1689e3).
Report is 6 commits behind head on bugfixes.

Files Patch % Lines
rotkehlchen/chain/ethereum/modules/yearn/utils.py 62.50% 10 Missing and 5 partials ⚠️
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     
Flag Coverage Δ
backend 80.88% <73.21%> ( 0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yabirgb yabirgb added the ready for final review Backend PR ready to be reviewed by great Lefteris label Jul 19, 2024
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""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.
Copy link
Member

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:
Copy link
Member

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)
Copy link
Member

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?

Copy link
Member

@LefterisJP LefterisJP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@LefterisJP LefterisJP merged commit bdd9560 into rotki:bugfixes Jul 19, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for final review Backend PR ready to be reviewed by great Lefteris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants