Skip to main content

parse_outcome_symbol

Function parse_outcome_symbol 

Source
pub fn parse_outcome_symbol(symbol: &str) -> Result<HyperliquidAssetId>
Expand description

Parses an outcome (HIP-4) spot coin or token symbol into an asset ID.

Hyperliquid represents outcome spot coins as #<encoding> and outcome token names as +<encoding>, where encoding = 10 * outcome + side.

ยงErrors

Returns an error if the symbol is not an outcome symbol, the encoding is not numeric, overflows the asset id range, or carries an invalid side digit.