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 Switchboard to Suilend #44

Open
wants to merge 8 commits into
base: devel
Choose a base branch
from
Open

Conversation

ahermida
Copy link

@ahermida ahermida commented Dec 4, 2024

Add Switchboard to Suilend

This PR:

  • adds switchboard deps to Move.toml and Move.lock
  • updates oracles.move to include reading switchboard values and filtering stale or out-of-range oracles (same logic as is used within Save)
  • updates reserve.move to include a reference to switchboard feeds with a new SwitchboardConfig dynamic child
  • SwitchboardConfig is created when the public function to update switchboard price feed is called (and removed if exists when a pyth price feed is configured)
  • Add relevant functions to lending_market.move and label pyth-version / switchboard-version functions
  • Clone and edit lending_market_tests.move into a switchboard-variant which maintains the same logic, but mocks switchboard instead of pyth (mock_switchboard.move) and uses it instead
  • Add some tests to oracles.move and ensure that all the tests pass across the board

Notes:

  • Some public functions have been renamed, and some have been added. This is mostly in service of adding switchboard-variants.
  • In these edits, reserves are expected to use either switchboard or pyth, but not both at the same time. This can be changed with some minor edits (if we wanted to swap it to use both).
  • This PR fixes most existing warnings related to imports.

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.

1 participant