Skip to main content

Module market

Module market 

Source
Expand description

Shared trade market projection helpers.

These are pure helpers used by gateway response projection and CLI/domain adapters. Keep them here instead of in one surface handler so market prefix and futures-ticker fallback rules have a single callable source.

Structs§

CachedAccountMarket
Market namespace read from CachedTrdAcc.trd_market.
RawAccountMarket
Backend raw Account.market value cached in CachedTrdAcc.trd_market.

Constants§

TRD_MARKET_INT_VALUES
Official OpenAPI Trd_Common.TrdMarket integer values accepted by read surfaces, including view-only fund markets.
TRD_MARKET_NON_FUND_INT_VALUES
Official OpenAPI Trd_Common.TrdMarket integer values accepted by active write/calculation surfaces. Fund markets stay read-only.
TRD_MARKET_NON_FUND_PARSE_CHOICES
TRD_MARKET_NON_FUND_STRING_VALUES
User-facing aliases accepted for active write/calculation paths.
TRD_MARKET_PARSE_CHOICES
TRD_MARKET_STRING_VALUES
User-facing aliases accepted for Trd_Common.TrdMarket read paths.

Functions§

canonical_fund_trd_market_label
Label for canonical OpenAPI fund markets only.
derive_sec_market
Derive FTAPI TrdSecMarket from explicit value, account market, and code.
derive_trd_sec_market
Derive FTAPI TrdSecMarket from explicit value, account market, and code.
extract_futures_ticker_prefix
Extract the ticker prefix from a futures code.
futures_ticker_to_sec_market
Legacy raw-value facade for futures ticker fallback.
futures_ticker_to_trd_sec_market
Derive TrdSecMarket from known futures ticker prefixes.
is_futures_code
Return whether the code looks like a futures symbol.
parse_non_fund_trd_market
Parse a trade market for active write/calculation paths.
parse_trd_market
Parse a user-facing trade market string into the canonical OpenAPI Trd_Common.TrdMarket enum.
sec_market_from_code_prefix
Derive TrdSecMarket from an explicit code prefix such as HK. / US..
sec_market_from_code_prefix_typed
Typed variant of sec_market_from_code_prefix.
strip_market_prefix
Strip a known FTAPI market prefix from a user/security code.
trd_market_from_i32
Convert official OpenAPI Trd_Common.TrdMarket integer values into the canonical project enum.
trd_market_label
Canonical Trd_Common.TrdMarket label used by user-facing filters and surface adapters.
view_only_fund_market_label
Label for fund markets that are view-only on active write/calculation paths.