HKUDS/Vibe-Trading · error · ValueError
market price {market_price} is at or above the no-arbitrage
Error message
market price {market_price} is at or above the no-arbitrage ceiling {upper}; no implied volatility exists What it means
The upper no-arbitrage bound is the discounted maximum payoff (S for a call, K for a put). At or above that ceiling no implied volatility exists — the price cannot be matched even as sigma -> infinity — so implied_volatility raises rather than returning an arbitrary large sigma.
Source
Thrown at agent/src/quantlib/options.py:453
Raises:
ValueError: If ``option_type`` is invalid, if ``T``, ``S`` or ``K`` is
non-positive, or if ``market_price`` lies outside the no-arbitrage
interval, which includes the intrinsic-value violation
``market_price < discounted intrinsic``.
"""
option_type = normalise_option_type(option_type)
if T <= 0:
raise ValueError(f"T must be > 0 to imply a volatility, got {T}")
if S <= 0 or K <= 0:
raise ValueError(f"S and K must be > 0, got S={S}, K={K}")
lower, upper = _no_arbitrage_bounds(S, K, T, r, option_type, q)
if market_price < lower - tol:
raise ValueError(
f"market price {market_price} is below intrinsic value {lower}"
)
if market_price >= upper:
raise ValueError(
f"market price {market_price} is at or above the no-arbitrage "
f"ceiling {upper}; no implied volatility exists"
)
def identified(candidate: float) -> float:
"""Return the candidate only if the quote actually pins it down.
The test is whether one volatility point of movement shifts the price by
more than the tolerance the solve was run to. If it does not, then a
whole band of volatilities reprices within ``tol`` and whichever one the
search happens to land on is an artefact of the search, not a reading of
the market. Comparing vega against an absolute floor cannot express
this, because the threshold has to scale with ``tol``.
Args:
candidate: A volatility that reprices to within ``tol``.
Returns:View on GitHub (pinned to 80ffdda44c)
Solutions
- Normalise the quote to per-underlying-unit terms (divide by multiplier, handle tick size).
- If the price is at exactly the ceiling legitimately (sigma -> inf), treat it as a cap: report None/inf per your convention instead of calling the solver.
- Sanity-screen quotes: lower <= price < upper before the vol loop.
Example fix
# before iv = implied_volatility(market_price=10500, S=100, K=95, T=1, r=0.05, option_type='call') # lot price # after iv = implied_volatility(10500 / 100, 100, 95, 1, 0.05, 'call') # per-share price 105 -> still bound-checked; fix quote source if wrong
Defensive patterns
Strategy: validation
Validate before calling
ceiling = S if option_type == 'call' else K * math.exp(-r * T) assert market_price < ceiling, 'quote at/above no-arbitrage ceiling'
Type guard
def quote_below_ceiling(price: float, ceiling: float) -> bool:
return price < ceiling Try / catch
try:
iv = implied_volatility(px, S, K, T, r, option_type)
except ValueError as e:
if 'no-arbitrage ceiling' in str(e):
iv = float('inf') # or None, per your reporting convention
else:
raise Prevention
- Normalise quotes to per-unit terms (divide lot multipliers) before solving.
- Validate tick/price units at ingestion.
- Treat ceiling-touching quotes as capped vols, not solver inputs.
When it happens
Trigger: A call quoted at >= S (e.g. price 105 with S=100); quotes scaled by a contract multiplier of 100 fed in unadjusted; premium in different currency units or per-lot versus per-share.
Common situations: Forgetting to divide exchange prices by the lot multiplier (e.g. 100); mixing ticks and decimal price units; obviously bad data such as fat-fingered quotes surviving a screen.
Related errors
- market price {market_price} is below intrinsic value {lower}
- T must be > 0 to imply a volatility, got {T}
- S and K must be > 0, got S={S}, K={K}
- unknown barrier type {barrier_type!r}; valid types: {BARRIER
- unrecognised option_type {option_type!r}. Accepted (any case
AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28).
Data as JSON: /api/errors/c62f8afd84dfc462.
Report an issue: GitHub.