pub enum Market {
Hyperliquid(HyperliquidMarket),
}Expand description
Unified market configuration — replaces scattered config fields.
This is the canonical representation of “where to trade”. All exchange/market-type-specific details are encapsulated here.
Variants§
Hyperliquid(HyperliquidMarket)
Hyperliquid exchange markets
Implementations§
Source§impl Market
impl Market
Sourcepub fn instrument_id(&self) -> InstrumentId
pub fn instrument_id(&self) -> InstrumentId
Get the canonical instrument ID for engine use.
Sourcepub fn market_index(&self) -> MarketIndex
pub fn market_index(&self) -> MarketIndex
Get the exchange-specific market index.
Sourcepub fn is_spot_like(&self) -> bool
pub fn is_spot_like(&self) -> bool
Check if this market settles like spot with no margin/leverage.
Sourcepub fn uses_margin(&self) -> bool
pub fn uses_margin(&self) -> bool
Check if this market uses margin/leverage.
Sourcepub fn base_asset(&self) -> AssetId
pub fn base_asset(&self) -> AssetId
Get the base asset ID.
Sourcepub fn quote_asset(&self) -> AssetId
pub fn quote_asset(&self) -> AssetId
Get the quote asset ID.
Sourcepub fn instrument_kind(&self) -> InstrumentKind
pub fn instrument_kind(&self) -> InstrumentKind
Get the instrument kind (Spot, Perp, or Outcome).
Sourcepub fn is_outcome(&self) -> bool
pub fn is_outcome(&self) -> bool
Check if this is a prediction market (outcome).
Sourcepub fn outcome_params(&self) -> Option<(u32, u8, String)>
pub fn outcome_params(&self) -> Option<(u32, u8, String)>
Get outcome parameters (outcome_id, side, name) if this is an Outcome market.
Sourcepub fn exchange_instance(&self, environment: Environment) -> ExchangeInstance
pub fn exchange_instance(&self, environment: Environment) -> ExchangeInstance
Get the exchange instance for this market.
Sourcepub fn effective_asset_id(&self) -> u32
pub fn effective_asset_id(&self) -> u32
Get the effective asset ID for order placement (Hyperliquid-specific).
Sourcepub fn spot_coin(&self) -> Option<String>
pub fn spot_coin(&self) -> Option<String>
Get the spot coin name for alias resolution (e.g., “@107” -> “HYPE”).
Sourcepub fn spot_market_index(&self) -> Option<u32>
pub fn spot_market_index(&self) -> Option<u32>
Get the spot market index for price lookups (e.g., 10107 for HYPE).
Sourcepub fn hip3_config(&self) -> Option<Hip3MarketConfig>
pub fn hip3_config(&self) -> Option<Hip3MarketConfig>
Get HIP-3 configuration if this is a HIP-3 market.
Sourcepub fn instrument_meta(&self) -> Option<&InstrumentMetaConfig>
pub fn instrument_meta(&self) -> Option<&InstrumentMetaConfig>
Get instrument metadata if configured.
Sourcepub fn price_bounds(&self) -> Option<(Decimal, Decimal)>
pub fn price_bounds(&self) -> Option<(Decimal, Decimal)>
Optional exclusive price bounds for markets with bounded price domains.
Sourcepub fn validation_errors(&self) -> Vec<String>
pub fn validation_errors(&self) -> Vec<String>
Validate market-specific invariants.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Market
impl<'de> Deserialize<'de> for Market
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Market
impl JsonSchema for Market
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more