Skip to main content

extract_condition_id

Function extract_condition_id 

Source
pub fn extract_condition_id(instrument_id: &InstrumentId) -> Result<String>
Expand description

Extracts the condition ID from an instrument symbol.

Polymarket instrument symbols follow the pattern {condition_id}-{token_id}. The condition_id is a hex string (e.g. 0xabc123...) and the token_id is a large decimal number. This extracts the condition_id by splitting at the last -.