# QFEX — markets, exact numbers, and price bands

This file covers reference-data decoding, symbol identity, tick and lot arithmetic, quantity bounds, and live price bands. Public metadata was checked on 2026-10-03; minimum and band observations are dated separately.

## TL;DR

1. Identify a market by its complete `BASE-QUOTE` symbol. `clobPairId` is not unique across markets.
2. Quantity and price travel as JSON numbers, but exact decimal arithmetic should produce their wire literals.
3. Enforce tick, lot, `min_quantity`, and `max_quantity`; do not invent a dollar minimum.
4. Non-USD quote currencies exist. A quoted price is not necessarily a USD value.
5. Reference-data bands are cached. Clamp an IoC only using a fresh live band.

## 1. Reference data and listing status

`GET /refdata` returns a `refdata` envelope with `data` rows. Important fields are `symbol`, `base_asset`, `quote_asset`, `margin_asset`, `tick_size`, `lot_size`, `min_price`, `max_price`, `min_quantity`, `max_quantity`, `default_max_leverage`, `status`, `order_types`, `order_time_in_force`, `market_hours`, and `product_category`. Most scalar values are strings; leverage is numeric.

The unauthenticated check on 2026-10-03 returned 242 rows, 213 `ACTIVE`, and 205 both `ACTIVE` and USD quoted. Every symbol equaled `base_asset + '-' + quote_asset`. This is a dated inventory, never an allowed-market list. The same venue had different counts in earlier public probes.

Statuses are `ACTIVE`, `INACTIVE`, and `DELISTED`. Unknown statuses mean unknown listing state. Reject malformed payloads, duplicate symbols, invalid grids, and contradictory base/quote identity. A decoder failure must not produce an empty market list.

`clobPairId` repeated across distinct markets in public data observed 2026-09-30. Key by symbol. Currency codes in the quote component must remain part of that identity.

## 2. Grid arithmetic and wire serialization

Reference data supplies both price step and size step. The examined grids were powers of ten, but arithmetic should operate on the supplied decimal step rather than infer it from the displayed price. A decimal represented as integer numerator and power-of-ten denominator supports exact floor, ceil, nearest, and decimal formatting.

The order frame requires JSON numeric values for `quantity` and `price`. A numeric string was rejected with `InvalidJSONFormat` on 2026-10-01. Build canonical decimal literals on the grid, so serializing a binary floating-point number does not add an accidental decimal tail. The venue accepted decimal and exponent forms; canonical decimal strings simplify auditing.

For comparisons of REST doubles, snap to the nearest valid lot and validate the residual against a half-lot bound. This addresses representation artifacts; it does not establish freshness. Do not normalize values so far that malformed quantities become valid.

## 3. Minimum and maximum quantities

Validate positive price, tick alignment, lot alignment, `quantity >= min_quantity`, and `quantity <= max_quantity`. A resting order at the stated minimum, worth a few cents, was accepted on 2026-10-01. That disproved a separate notional floor for that tested market and order type; it did not establish all-market IoC or reduce-only dust behavior.

`REJECTED_LESS_THAN_MIN_NOTIONAL` exists in documented enums. Its existence is not proof of an active universal dollar minimum. Expose venue quantity bounds without adding caller trading preferences as defaults.

## 4. Price bands and sessions

Risk documentation describes bands around the latest market-data price and session-dependent risk limits. `market_hours` describes underlier/funding sessions; it does not by itself mean the trading API is closed. The venue advertises round-the-clock trading.

Public refdata responses observed 2026-09-30 used CDN caching with `max-age=5` and `stale-while-revalidate=30`. An age header showed that a band could already be stale. The `minmax_price` market-data stream is the preferred live source, with freshness measured from receipt on a healthy connection.

On 2026-10-01, passive GTC bids below the lower band and asks above the upper band were accepted. An aggressive IoC beyond the permitted edge returned an `InvalidOrder` error frame; it did not necessarily return a band-specific order status. A fresh clamp uses floor for a buy limit and ceil for a sell limit, preserving the permitted worst price after quantization.

Do not apply a band from a disconnected stream or silently fall back to stale reference data. Caller-selected freshness limits remain explicit policy values.

## 5. Metadata cache safeguards

A metadata cache can preserve the last valid response on fetch failure while exposing whether it is fresh. Prevent a refresh from silently changing the symbol's tick, lot, or currency identity while it is in use. Freeze that symbol until the caller reviews the change. These are toolkit safeguards, not exchange promises.

Corporate actions may adjust price and quantity. A stale quantizer can remain syntactically valid while expressing the wrong instrument size. Refresh and compare metadata before constructing new writes.

## Pitfalls

| What breaks | Why | Correct approach |
|---|---|---|
| Two markets share one cache row | `clobPairId` repeats | Use full symbol |
| A price is reported as USD incorrectly | Non-USD quotes exist | Preserve quote currency |
| A valid size changes every read | Binary floating-point tails | Compare on the supplied lot grid |
| An IoC clamp still fails | Cached refdata band | Use a fresh live band and correct rounding |
| Passive orders are suppressed unnecessarily | Both band edges were applied to resting orders | Follow the observed directional rule |

## Open questions / not verified

- Currency conversion of non-USD products into margin equity.
- IoC/reduce-only dust and a possible minimum beyond `min_quantity` on other products.
- Live behavior of `REJECTED_MARKET_CLOSED`, and corporate-action transitions under resting orders.

## Sources

Public metadata: [Public QFEX reference data](https://api.qfex.com/refdata) (GET checked 2026-10-03); schema: [Refdata](https://docs.qfex.com/api-reference/rest/market-data/refdata); risk: [Risk limits](https://docs.qfex.com/qfex/risk-limits); sessions: [Specification index](https://docs.qfex.com/qfex/specification-index); corporate actions: [Corporate actions](https://docs.qfex.com/qfex/corporate-actions). Grid, minimum, and directional-band observations: 2026-10-01. No account measurements are included.

<!-- license-footer -->
_© markpaper authors. Licensed under [CC BY 4.0](LICENSE.md): when publishing or adapting this material, credit “markpaper — QFEX knowledge base” and link to the original and the license._
