pub fn parse_instrument_any(
definition: &PerpetualMarket,
maker_fee: Option<Decimal>,
taker_fee: Option<Decimal>,
ts_init: UnixNanos,
) -> Result<InstrumentAny>Expand description
Parses a dYdX perpetual market into a Nautilus [InstrumentAny].
dYdX v4 only supports perpetual markets, so this function creates a
[CryptoPerpetual] instrument with the appropriate fields mapped from
the dYdX market definition.
ยงErrors
Returns an error if:
- Ticker format is invalid (not BASE-QUOTE).
- Required fields are missing or invalid.
- Price or quantity values cannot be parsed.
- Currency parsing fails.
- Margin fractions are out of valid range.
Note: Callers should pre-filter inactive markets using is_market_active.