Unified market/instrument metadata.
Describes a trading pair and its properties — spot, derivatives, precision, limits, and fee structure.
Fields
id- Exchange-native market ID (e.g., "BTCUSDT")symbol- Unified symbol (e.g., "BTC/USDT")base,quote- Base and quote currency codesbase_id,quote_id- Exchange-native currency IDstype- Market type: "spot", "swap", "future", "option". Multi-leg books that do not satisfy a single-leg type keep the venue kind ("option_combo","future_combo") instead of borrowingoption/future.sub_type- "linear" or "inverse" for derivativesspot,margin,swap,future,option,contract- Type flagsactive- Whether the market is currently tradingsettle,settle_id- Settlement currencycontract_size- Base-asset units represented by one contract. Linear quantity is already base-denominated, so this is the venue's contract unit (1 for Binance USD-M BTCUSDT). Inverse venues publish a multiplier (100 USD for Binance COIN-M BTCUSD). Linear notional isquantity * price * contract_size; inverse notional iscontracts * contract_size. Nil when the venue states no unit. On a multi-leg book (combo?/1) the mark is a spread or premium difference, not an underlying — do not form a notional against it.quantity_unit- Denomination of order quantity."base"for base-asset linear contracts and for the canonical option unit.native_quantity_unit- Venue option quantity unit ("base"or"contracts")native_quantity_field- Venue option order field carrying the quantitynative_amount_step- Venue-native quantity increment before conversionlinear,inverse- Settlement direction flagsexpiry,expiry_datetime- Futures/options expirationstrike- Options strike priceoption_type- "call" or "put"taker,maker- Fee rates as decimalspercentage- Whether fees are charged as a percentagetier_based- Whether fees use a tiered scheduleprecision_mode- Authored precision interpretation modeprecision- Price/amount/cost precision ruleslimits- Min/max for price, amount, cost, leveragecreated- Market listing timestamp in millisecondsasset_index- Venue signing index for L1 actions (Hyperliquid: meta/spotMeta universe position with spot/HIP-3 offsets). Explicit — not overloaded ontoid/base_id(carve C-T339).info- Raw exchange response
Summary
Functions
True when this market is a multi-leg combo/strategy book.
True when contract_size has a resolvable unit for exposure math.
JSON Schema for the Market unified type.
Types
@type t() :: %Bourse.Market{ active: boolean() | nil, asset_index: integer() | nil, base: String.t() | nil, base_id: String.t() | nil, contract: boolean() | nil, contract_size: number() | nil, created: integer() | nil, expiry: integer() | nil, expiry_datetime: String.t() | nil, future: boolean() | nil, id: String.t() | nil, info: map() | nil, inverse: boolean() | nil, limits: map() | nil, linear: boolean() | nil, maker: number() | nil, margin: boolean() | nil, native_amount_step: number() | nil, native_quantity_field: String.t() | nil, native_quantity_unit: String.t() | nil, option: boolean() | nil, option_type: String.t() | nil, percentage: boolean() | nil, precision: map() | nil, precision_mode: String.t() | nil, quantity_unit: String.t() | nil, quote: String.t() | nil, quote_id: String.t() | nil, settle: String.t() | nil, settle_id: String.t() | nil, spot: boolean() | nil, strike: number() | nil, sub_type: String.t() | nil, swap: boolean() | nil, symbol: String.t() | nil, taker: number() | nil, tier_based: boolean() | nil, type: String.t() | nil }
Functions
True when this market is a multi-leg combo/strategy book.
Deribit option_combo / future_combo are the current cases. The mark
of a combo is a spread or premium difference between legs, not an
underlying price — contracts * contract_size / mark is not a notional.
True when contract_size has a resolvable unit for exposure math.
False when this is a multi-leg combo (the mark is a spread or premium
difference, not an underlying), and false when both
native_quantity_unit and quantity_unit are unset on a market that is
not a single-leg inverse or linear contract with a published size.
Block exposure on false rather than multiplying by a unit-less
contract_size.
@spec schema() :: map()
JSON Schema for the Market unified type.