Settlement Key Differences
Surface how each venue settles a matched market — resolution source, timing, and edge cases — on the event detail
The same prediction lives on more than one venue, but the venues don't always settle it the same way. One resolves "US presidential election" on the AP call; another waits for official certification weeks later. One voids a cancelled match; another resolves it 50‑50. Those differences are real settlement risk — and historically a trader had to read three sets of rules to find them.
Settlement Key Differences does that reading for you. For any matched cross‑venue event, sufwan-local-test returns a structured, per‑venue breakdown of how the settlements differ, plus each venue's full rules — so you can render a "Settlement" panel that tells a user exactly what they're trading before they trade it.
It's returned automatically on the single event‑detail endpoint — no extra parameter, no extra call.
What you get
GET /venue-events/{id} adds settlementDiff on the event. differences[] carries type, title, perVenue, and summary. A venue is omitted from perVenue when its rules do not ground a value. The full object is on Get venue event.
settlementDiffStatus says what the diff means:
settlementDiffStatus | settlementDiff | Meaning |
|---|---|---|
computed | object | Compared. differences: [] means no key differences were found. |
pending | null | The event is matched, but the comparison has not run yet. |
not_applicable | null | No comparison: the event is in no cross-venue cluster, every venue's event has ended, or the differences only concern venues your app excludes. |
computed with differences: [] is a comparison of the venues' rules, not a guarantee that they settle the same way. Treat pending as unknown, not as equivalent.
type is an open enum. Known values are resolution_source, resolution_timing, scope, threshold, start_date, end_date, edge_cases, and wording, with other as the catch-all. Map known types to an icon and use a generic icon for anything else.
Fetch it
import { createAggClient } from "@agg-build/sdk";
const client = createAggClient({
baseUrl: "https://api.t.sufwankhalid.com",
appId: "YOUR_APP_ID",
});
const event = await client.getVenueEventById("evt_123");
if (event.settlementDiff) {
// render the "Key differences" cards from event.settlementDiff.differences
}Settlement data is returned on the single event‑detail endpoint only — it is intentionally
not included in the /venue-events listing, where running a per‑event settlement lookup for
every row would be wasteful. Fetch it when a user opens an event.
Render it
The fields map one‑to‑one to a settlement panel. Render it with Settlement, or from the fields below.
- Key differences — one card per
settlementDiff.differences[]entry: thetitleas the heading, an icon chosen fromtype, and one row per venue fromperVenue(key = venue, value = the short per‑venue value). The card count isdifferences.length. - Empty — when
settlementDiffisnullordifferencesis[], hide the "Key differences" block.settlementDiffStatustells "no differences found" (computed) apart from "not compared yet" (pending) and "no comparison" (not_applicable).
How it's built
The differences are produced by a small hybrid engine, computed once per matched cross‑venue cluster and persisted — it runs in the background, completely off the trade/quote path, so reading them never adds latency to execution.
- Deterministic core (no model): the structured facts sufwan-local-test already ingests — resolution dates, resolution sources, thresholds, market scope — are compared directly across venues. This is exact and grounds the timing/source/threshold/scope differences with zero ambiguity.
- Language model gap‑fill: for the nuances that only live in prose (edge cases like recounts, walkovers, void conditions, or a resolution source named only in the rules text), a cost‑efficient model reads each venue's rules and fills the remaining differences — and is only invoked when a venue's settlement genuinely isn't captured structurally.
Both paths emit the same structure, and a difference is surfaced only when venues actually diverge and the value can be grounded in a venue's own rules — sufwan-local-test omits a venue rather than guess. The result is cached per cluster and refreshed as venues update their rules.