feat(symbolConverter): add hip4 recurring outcome support#132
Open
vtx100 wants to merge 1 commit into
Open
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
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.
Description of the Desired Feature
This PR introduces support for both priceBinary and priceBucket recurring outcomes inside the symbolConverter. It adds full support for generating slugs (identical to the ones used for web URLs) and mapping them to their corresponding assetIds, in accordance with the Hyperliquid documentation for Asset IDs and Contract Specifications.
Motivation and Use Case
Provide a standardized and human friendly way of retrieving assetIds (and eventually other information) about the new HIP4 outcome markets using the hyperliquid URL slug format.
Proposed Solution
I introduced the main orchestrator: _processAllRecurringAssets (which can be easily isolated or toggled via a flag if required). This orchestrator delegates to specific processors depending on how the market data is structured:
Additional Information
Testing limitations: There currently isn't an easy way to write static tests for this feature because the slugs dynamically change based on the day/month. Additionally, the testnet does not provide fixed, long-term markets to test against, so validation requires separate handling.
Scope of the implementation: Support is currently limited to the officially documented recurring outcome markets (so what mainnet does). It does not handle non-standardized testnet cases (for example, the market "What will Hypurr eat the most of in May 2026?", where the name field contains the actual question rather than "Recurring"). These non-standard cases will require separate handling.
Extra: There doesn't seem to be a way to retrieve the getSzDecimals value for a given token, however this seems to be 5 for all markets (which would make sense, considering the nature of the markets), however i've decied not to hardcode this as it doesn't seem to be specified anywhere.
Below is attached a screenshot of the slug->asssetId mapping for currently avaialble mainnet markets:
