-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: ♻️ use native osETH price #129
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
refactor: ♻️ use native osETH price #129
Conversation
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.
Pull request overview
This PR refactors the oracle to add native support for osETH (StakeWise's osToken) as a default asset on mainnet. The changes include adding osETH price fetching via the OsTokenVaultController contract, making osETH a default supported asset, simplifying the StakeWise adapter by removing escrow handling, and introducing a global additional_asset_support toggle to enable/disable additional asset features.
Key changes:
- Added OsTokenVaultController ABI and osETH native pricing in the ETH price adapter
- Made osETH a default additional asset for mainnet that's automatically included
- Removed StakeWise escrow functionality and simplified exit queue processing
- Added
additional_asset_supportconfiguration flag to enable/disable osETH and other additional assets globally
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tq_oracle/constants.py | Added OSETH to network assets, new os_token_vault_controller address, and DEFAULT_ADDITIONAL_ASSETS mapping |
| src/tq_oracle/settings.py | Added additional_asset_support flag and new StakeWise adapter settings (exit_max_lookback_blocks, extra_addresses, skip_exit_queue_scan) |
| src/tq_oracle/abi.py | Added OsTokenVaultController ABI loader and extracted fetch_subvault_addresses function |
| src/tq_oracle/abis/OsTokenVaultController.json | New ABI file for OsTokenVaultController contract |
| src/tq_oracle/adapters/price_adapters/eth.py | Added osETH pricing via OsTokenVaultController.convertToAssets() |
| src/tq_oracle/adapters/price_adapters/cow_swap.py | Added osETH to skipped assets list to avoid pricing conflicts |
| src/tq_oracle/adapters/asset_adapters/stakewise.py | Removed escrow handling, added fetch_all_assets(), updated exit queue calculation, added skip_exit_queue_scan option |
| src/tq_oracle/adapters/asset_adapters/idle_balances.py | Distinguished between default and extra additional assets, with default assets (osETH) coming from constants |
| src/tq_oracle/pipeline/assets.py | Refactored to use centralized fetch_subvault_addresses and added default StakeWise adapter initialization |
| tests/test_settings.py | Added tests for new StakeWise adapter settings and additional_asset_support toggle |
| tests/adapters/test_stakewise_adapter.py | Updated tests to reflect new exit queue return signature and removed escrow tests |
| tests/adapters/price_adapters/test_eth.py | Added tests for osETH pricing and additional_asset_support flag |
| tests/adapters/price_adapters/test_cow_swap.py | Added tests to verify osETH is skipped in CowSwap |
| tests/adapters/asset_adapters/test_idle_balances.py | Added tests for default additional assets, additional_asset_support toggle, and error handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
superseded by #130 |
This pull request adds native support for osETH (the StakeWise osToken) throughout the oracle, including asset and price adapters, configuration, and constants. It introduces osETH as a default supported asset on mainnet, enables fetching its price via the OsTokenVaultController contract, and improves the way additional assets are handled in the idle balances adapter.