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

fix: use crypto swap registry if available #188

Merged
merged 2 commits into from
Dec 30, 2021

Conversation

jstashh
Copy link
Contributor

@jstashh jstashh commented Dec 22, 2021

Fixes #187

Check to see if the 'CryptoSwap' registry can be used before falling back to the original registry

The crypto swap registry can be found at position 5 in the address provider

@jstashh
Copy link
Contributor Author

jstashh commented Dec 22, 2021

Gauge isn't currently being provided by the curve crypto swap registry.. Have let them know and waiting for a response

Copy link
Contributor

@mariuspod mariuspod left a comment

Choose a reason for hiding this comment

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

I've tested this locally and it returns now the correct prices:

>>> curve.get_price("0x3D229E1B4faab62F621eF2F6A610961f7BD7b23B", 13907523)
2.129874676823631
>>> curve.get_price("0x3D229E1B4faab62F621eF2F6A610961f7BD7b23B", 13907516)
2.129874676823631
>>> curve.get_price("0x3b6831c0077a1e44ed0a21841c3bc4dc11bce833", 13907523)
2.1665122547780067
>>> curve.get_price("0x3b6831c0077a1e44ed0a21841c3bc4dc11bce833", 13907516)
2.1665122547780067

@mariuspod
Copy link
Contributor

Gauge isn't currently being provided by the curve crypto swap registry.. Have let them know and waiting for a response

@jstashh Is this a blocker for this merge ?

@jstashh
Copy link
Contributor Author

jstashh commented Dec 30, 2021

Gauge isn't currently being provided by the curve crypto swap registry.. Have let them know and waiting for a response

@jstashh Is this a blocker for this merge ?

No, this should be fine to merge now, the incorrect gauge behavior is present in the current code so we're not introducing a regression

@jstashh jstashh merged commit 4afe6cd into yearn:master Dec 30, 2021
@jstashh jstashh deleted the fix/crypto-swap-registry branch December 30, 2021 22:01
mariuspod pushed a commit that referenced this pull request Jan 17, 2022
* fix: use crypto swap registry if available

* fix: make boolean check more explicit
mariuspod pushed a commit to BobTheBuidler/yearn-exporter that referenced this pull request Jan 27, 2022
* fix: use crypto swap registry if available

* fix: make boolean check more explicit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prices for crvEURSUSDC and crvEURTUSD are incorrect
2 participants