refactor: ♻️ Simplify Last look pricing checks #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and refactorings to the TQ Oracle codebase, focusing on price feed handling, adapter configuration, and code maintainability. The most notable changes are a major refactor of the Pyth price adapter to dynamically discover price feeds, removal of unused domain models, and updates to pipeline context and pricing logic to support configurable base assets.
Price Adapter Improvements
Pythprice adapter (src/tq_oracle/adapters/price_adapters/pyth.py) was refactored to dynamically discover price feed IDs from the Hermes API instead of relying on hardcoded values. This allows for more flexible asset support and reduces maintenance overhead. The adapter now uses canonicalized addresses, validates staleness and confidence intervals, and provides clearer logging for missing or stale feeds. [1] [2]PYTH_PRICE_FEED_IDSmapping insrc/tq_oracle/constants.pywas emptied to support dynamic discovery.Pipeline and Context Updates
src/tq_oracle/pipeline/context.py) now supports a configurablebase_asset, with a newbase_asset_requiredproperty to enforce its presence. The pricing pipeline (src/tq_oracle/pipeline/pricing.py) uses this base asset instead of a hardcoded value, improving flexibility for different vaults and assets. [1] [2] [3] [4]Codebase Maintenance
Asset,PricedAsset,TvlReport) were removed fromsrc/tq_oracle/domain/__init__.py, simplifying the codebase.Adapter and ABI Registry Updates
src/tq_oracle/abi.py, with a loader function for future protocol support. [1] [2]CCTPBridgeAdapterwas commented out from the check adapters registry, pending Hyperliquid support.Minor Improvements