-
Notifications
You must be signed in to change notification settings - Fork 327
feat(mobula-state): add 38 includes.json entries for production and regression fixes #4339
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Replace symbol-based firehose with targeted asset_id subscriptions - Add includes.json for symbol-to-asset-ID mapping (EZETH→102478632, GHO→2921, ETH→100004304) - Switch to PriceAdapter + CryptoPriceEndpoint for proper includes support - Implement WebsocketReverseMappingTransport for parameter matching - Support multi-quote pairs (USD, ETH) - Real-time WebSocket streaming from wss://production-feed.mobula.io Tested pairs: - EZETH/USD ✅ - GHO/USD ✅ - ETH/USD ✅ - EZETH/ETH ✅
- Fixed issue where multiple quote currencies for same base asset overwrote each other - Changed from baseID-only key to baseID-quoteID composite key - Prevents EZETH/ETH returning USD price instead of ETH ratio - Now EZETH/ETH correctly returns ~1.06 instead of ~4,233
- Added 207 new symbol mappings to includes.json (211 total entries) - Added BBSOL (Bybit Staked SOL) hardcoded quote currency: 102484775 - Supports major DeFi pairs: CBETH/ETH, LBTC/BTC, SOLVBTC/BTC, OS/S, etc. - Added 7 BBSOL pairs: VSOL/BBSOL, MSOL/BBSOL, JITOSOL/BBSOL, etc. - Comprehensive coverage of liquid staking tokens, Bitcoin variants, Solana ecosystem - Ready for production with 6 quote currencies: USD, BTC, ETH, SOL, HYPE, S, BBSOL
…pport - Updated integration tests to validate v2 functionality instead of old ETH/USD pairs - Added mock WebSocket responses with baseID/quoteID for composite key testing - Added test cases for includes.json mapping (EZETH, CBETH, LBTC, GHO) - Added test cases for hardcoded quote currencies (BTC, ETH, SOL validation) - Added override functionality tests (base/quote overrides with custom asset IDs) - Added direct asset ID tests (bypass symbol resolution entirely) - Updated test-payload.json with realistic v2 examples - Comprehensive coverage: static mappings, dynamic overrides, direct IDs - Tests all 3 asset resolution methods + 6 quote currencies + error handling
…as requirement Clarifies that 'market' must be in quote aliases due to TypeScript type constraints in CryptoPriceEndpoint, not runtime validation. This is a compile-time requirement from the framework.
- Fix timestamp values in test fixtures (use 4040ms instead of Sep 2024 timestamps) - Update Jest snapshots to match v2 response format changes - Remove debug logging for clean production code - All 18 integration tests now pass with proper snapshot validation Fixes CI job 53290359217 failures
- Update all 18 integration test snapshots for v2 API format - Fix timestamp handling in test fixtures using Date.now() + offset - All snapshot tests now pass successfully - Resolve job 53315497853 failures Tests: 18 passed, 7 snapshots updated, 11 passed
- Use timestamp 1514764861500 that meets framework minimum requirements - Update all 18 integration test snapshots for consistent CI/local behavior - All tests pass: 18 passed, 7 snapshots updated, 11 passed - Resolves job 53316053810 snapshot failures The timestamp warnings are expected due to FakeTimer test environment but don't affect test success.
- Update @chainlink/external-adapter-framework from 2.7.0 → 2.8.0 to match CI - Update 9 Jest snapshots to exclude meta field when METRICS_ENABLED=false - All 18 integration tests now pass and match CI environment exactly - Resolves job 53316053810 snapshot failures Framework v2.8.0 + METRICS_ENABLED=false removes meta field from test responses, matching the CI environment behavior and eliminating snapshot mismatches.
… safety 1. Fix SOL asset ID inconsistency: - Correct SOL mapping from 102484775 → 100010811 in includes.json - 102484775 is BBSOL (Bybit Staked SOL), not SOL (Solana) - Ensures consistency between base currency and quote currency mappings 2. Improve TypeScript type safety: - Replace 'any' type with proper MobulaSubscribeMessage interface - Define structure for WebSocket subscription messages - Maintains type safety throughout transport logic All hardcoded quote currencies now match includes.json mappings: ✅ BTC: 100001656, ETH: 100004304, SOL: 100010811
Co-authored-by: Copilot <[email protected]>
- Refactor USD handling: Moved USD logic entirely into getQuoteId function - getQuoteId now returns number | 'USD' instead of number | undefined - Simplified composite key creation by removing || 'USD' fallback - Keep hardcoded quote currencies in transport (optimal for architecture) - Restored QUOTE_ASSET_IDS constant with BTC, ETH, SOL, HYPE, S, BBSOL - Faster O(1) lookups for common quotes vs iterating includes.json - includes.json-derived map serves as fallback for less common quotes - Maintains separation: includes.json for base symbols, QUOTE_ASSET_IDS for quote resolution - Update changeset with simplified upgrade instructions - 'Do not upgrade to this version until instructed to do so.' - Evaluate requestTransforms suggestion - Documented decision to keep ID resolution in transport layer - Maintains better support for overrides and direct asset ID usage - Preserves logical cohesion with WebSocket subscription logic All tests passing (18/18). Framework updated to v2.8.0.
…le it Framework's PriceAdapter handles includes.json resolution for exact base/quote pairs. We only need hardcoded QUOTE_ASSET_IDS for common crypto quotes (BTC, ETH, SOL, etc). Removed buildSymbolToAssetIdMap() and SYMBOL_TO_ASSET_ID fallback lookup.
Added proper includes.json mappings for test asset pairs: - TESTCOIN/USD (999888777/USD) - base override test - ANOTHERCOIN/BTC (111222333/100001656) - base override with BTC quote - CUSTOMTOKEN/ETH (444555666/100004304) - base override with ETH quote - EZETH/CUSTOMQUOTE (102478632/100004304) - quote override test Also fixed adapter name in override tests from 'mobula-state' to 'MOBULA_STATE'. All 18 tests now passing with successful override test cases.
- Changed fixtures from firehose pattern (send all data) to v2 API pattern (parse subscription, send targeted responses) - This matches cfbenchmarks approach and the real Mobula v2 API behavior - Fixes override tests which now correctly return success instead of 504 errors - All 18 tests now passing with proper data handling
…on messages - Changed mock to check parsed.type === 'funding' instead of parsed.kind === 'funding-rate' - The actual funding rate transport sends subscriptions with type: 'funding', not kind: 'funding-rate' - This fixes the funding rate tests that were broken in the previous v2 mock refactor - Funding rate tests now return 200 success (with actual data) instead of 504 errors
… entries - Removed TESTCOIN, ANOTHERCOIN, and CUSTOMTOKEN from includes.json - These test entries were preventing the override mechanism from working correctly - Override tests now properly use the overrides mechanism instead of includes.json - All override tests now return 200 success instead of 504 errors - Updated snapshots to reflect successful responses with actual data This resolves all test contradictions where tests named 'should return success' were returning 504 errors.
- CI was failing because override tests ran before mock WebSocket sent data - Now beforeAll primes cache with TESTCOIN, ANOTHERCOIN, and CUSTOMTOKEN - This ensures all test data is cached before tests run - Updated snapshots with new timestamps due to additional cache priming
- Added GHO/BTC (2921/100001656) and LBTC/SOL (102484658/100010811) to cache priming - These direct asset ID tests were returning 504s in CI due to missing cache data - All 14 success tests now properly return 200 with data - All 3 failure tests correctly return 504 errors
- Adding GHO/BTC and LBTC/SOL cache priming shifted timing for all subsequent tests - Updated 16 snapshots to match new timing (tests now run 2 seconds later) - This is expected behavior - more cache priming = later timestamps
Production pairs (33): - Added all missing production feeds/streams where mobula-state is an approved provider Regression fixes (5): - FAI: corrected to 102500349 - USDM: added new (6038) - USDZ: corrected to 102483737 - BTC.B: added new (101650461) - BTCB: added new (102500249) Total: 218 includes.json entries Resolves all identified regressions and ensures production feed coverage.
🦋 Changeset detectedLatest commit: 51d490f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Corrections: - ARCH/USD: 60896 → 914 - HYUSD/USD: 3248 → 102479726 - WBTC/ETH: 9993 → 100001656 Additions: - CBETH/USD: 100029813 (new functionality) Removals: - BTC/USD (not needed) - WBTC/BTC (not functional) Total entries: 217 All pairs tested and verified working on feature EA.
Added bases from override configuration: - 21BTC: 102482302 - APU: 102480878 - BOLD: 63471 - EURA: 100000512 (same ID as AGEUR) - KUDAI: 102501730 - METRO: 102503398 - SRM: 100010390 - XSGD: 100013108 Total entries: 217 → 225 Ensures all bases from data provider override config are covered.
Contributor
|
Closing, will reopen will @FionnL with fresh pull from main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds 38 includes.json entries to support production feeds/streams and fix all identified regressions.
Changes
Production Pairs (33 entries)
All missing production feeds/streams where
mobula-stateis an approved data provider from BigQuery configs.Regression Fixes (5 entries)
102478915→1025003496038102483988→102483737101650461102500249Testing
All 38 pairs tested and verified against locally deployed EA:
Impact
Dependencies
Checklist