A direct EUR/JPY quote and a rate calculated from EUR/USD and USD/JPY can disagree without either feed being broken. First check that the three quotes are fresh and close enough in time. Then compare their bid/ask intervals. A persistent gap is something to investigate, not evidence of an executable trade.
Build an interval, not a midpoint
EUR/USD is USD per euro. USD/JPY is JPY per dollar. Multiplication cancels USD, leaving JPY per euro. For positive quotes in those orientations, multiply bid by bid and ask by ask. Don't apply those formulas unchanged if you reverse a pair: the inverse bid is 1/ask, and the inverse ask is 1/bid.
In this synthetic example, EUR/USD is 1.1000–1.1002 and USD/JPY is 150.00–150.04. The implied EUR/JPY interval is 165.000000–165.074008. A direct EUR/JPY quote of 165.03–165.08 overlaps even though its midpoint differs. A quote of 165.10–165.13 does not overlap.
Reject mismatched timestamps before comparing
A snapshot can contain quotes captured at different times. Check both the age of the oldest quote and the difference between the earliest and latest source timestamps. Use one clock basis and one timestamp unit. For example, TickDB documents millisecond timestamps and bid and ask fields when present; don't silently replace a missing side with the last price. Align the product and methodology too: a reference rate, an indicative quote and a futures price aren't interchangeable.
This offline example uses a 1,000 ms age limit and a 250 ms skew limit to illustrate the branches. Choose real limits from the feed's measurement and your application's needs; neither value is a provider guarantee.
from decimal import Decimal as D def check(eur_usd, usd_jpy, eur_jpy, now_ms, max_age=1000, max_skew=250): quotes = (eur_usd, usd_jpy, eur_jpy) if any(not bid.is_finite() or not ask.is_finite() or not (0 < bid <= ask) for bid, ask, _ in quotes): return "invalid_quote" ts = [q[2] for q in quotes] if max(ts) > now_ms or now_ms - min(ts) > max_age: return "check_freshness" if max(ts) - min(ts) > max_skew: return "not_comparable_yet" synthetic_bid = eur_usd[0] * usd_jpy[0] synthetic_ask = eur_usd[1] * usd_jpy[1] return ("overlap" if eur_jpy[0] <= synthetic_ask and eur_jpy[1] >= synthetic_bid else "investigate_gap") eur_usd = (D("1.1000"), D("1.1002"), 9900) usd_jpy = (D("150.00"), D("150.04"), 9950) direct = (D("165.03"), D("165.08"), 10000) gap = (D("165.10"), D("165.13"), 10000) assert check(eur_usd, usd_jpy, direct, 10000) == "overlap" assert check(eur_usd, usd_jpy, (*gap[:2], 9650), 10000) == "not_comparable_yet" assert check(eur_usd, usd_jpy, gap, 10000) == "investigate_gap" assert check(eur_usd, usd_jpy, direct, 11000) == "check_freshness" assert check(eur_usd, usd_jpy, (D("166"), D("165"), 10000), 10000) == "invalid_quote" assert check(eur_usd, usd_jpy, (*direct[:2], 10001), 10000) == "check_freshness" At 350 ms of skew the example refuses to compare, even with fresh quotes. It flags the same disjoint numbers once the timestamps are aligned. Log the three pairs, both sides and source timestamps, and take another comparable sample before escalating. Repeated gaps can point to stale inputs, reversed pairs, different providers or instruments, or a problem further upstream. Overlap is a consistency check, not a guarantee of accuracy or execution.

