#[unsafe(no_mangle)]pub unsafe extern "C" fn synthetic_instrument_new(
symbol: Symbol,
price_precision: u8,
components_ptr: *const c_char,
formula_ptr: *const c_char,
ts_event: u64,
ts_init: u64,
) -> *mut SyntheticInstrumentExpand description
Creates a new SyntheticInstrument from the given components and formula.
§Panics
Panics if:
- The components string contains invalid UTF-8 or JSON, or is not an array of instrument IDs.
- An instrument construction check fails, including formula validation.
§Safety
This function assumes:
components_ptris a valid C string pointer.formula_ptris a valid C string pointer.
Returns an owning pointer to the heap-allocated SyntheticInstrument which the
caller must eventually pass to synthetic_instrument_drop.