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

Implement Oracle in replacement of CoinGecko #352

Merged
merged 9 commits into from
Apr 24, 2024
Merged

Conversation

JSKitty
Copy link
Member

@JSKitty JSKitty commented Apr 18, 2024

Abstract

This PR integrates Labs Oracle, our in-house price aggregation system, in full replacement of our current "generic" MarketSource system that we implemented CoinGecko with, this integration grants a couple benefits:

  • Much more efficient, dropping each refresh request from ~45kb to a one-time 4kb and per-call ~60 bytes.
  • More currencies: Oracle can aggregate from any source on behalf of MPW, forever extending our currency options.
  • Standardised and Open-Source, unlike CoinGecko, many Oracles can be hosted, each with the same API interface, for better privacy and decentralisation, as well as removing a proprietary API from MPW.
  • Just more reliable: CoinGecko frequently limits their public APIs, and sometimes they just outright fail, Oracle is stable.

Rather than spending time integrating various external price sources alongside CoinGecko - which is time consuming, cumbersome, and harder on MPW maintainers, this PR proposes a standardised price API schema, which MPW and all other Labs projects will adopt.

Oracle has the same - and even more - currencies than CoinGecko, so no user options will be affected by this, all of their regular currencies will continue to display as expected.


Testing

To test this PR, it's suggested to attempt these user flows, or variations of these:

  • Check your settings, ensure MPW and Oracle use your chosen currency and that it changes and refreshes successfully.
  • Check your balances, make sure the price loads and updates accordingly.
  • (Devs Only) check that the cache system works as expected, only doing a single "heavy" request, with smaller subsequent requests.

If any errors are found, the PR works unexpectedly, or you have viable suggestions to improve the UX or functionality of the PR, let me know!


@JSKitty JSKitty added the Enhancement New feature or request label Apr 18, 2024
@JSKitty JSKitty self-assigned this Apr 18, 2024
Copy link

netlify bot commented Apr 18, 2024

Deploy Preview for cheery-moxie-4f1121 ready!

Name Link
🔨 Latest commit 8bdf5a6
🔍 Latest deploy log https://app.netlify.com/sites/cheery-moxie-4f1121/deploys/6627c2fd4b55f60008db2044
😎 Deploy Preview https://deploy-preview-352--cheery-moxie-4f1121.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@JSKitty JSKitty requested a review from Duddino April 22, 2024 16:20
Duddino
Duddino previously approved these changes Apr 22, 2024
Copy link
Member

@Duddino Duddino left a comment

Choose a reason for hiding this comment

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

tACK

Copy link
Member

@panleone panleone left a comment

Choose a reason for hiding this comment

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

Seems to work but there are some code changes I'd like to see before merging

Copy link
Member

@panleone panleone left a comment

Choose a reason for hiding this comment

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

tACK working as expected and bandwidth is reduced

@Duddino Duddino merged commit c20e023 into master Apr 24, 2024
7 checks passed
@JSKitty JSKitty deleted the oracle-integration branch October 1, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants