Skip to content

GuidesCookbook

Scan for qualified cross-venue opportunities

The same question trades on more than one venue, and the two prices are rarely identical. Most of those gaps are not tradeable. This recipe keeps only the ones that survive every gate.

A polling loop that calls fetchArbitrage with executableOnly=true and revalidates anything it is about to act on. When you need to diagnose an empty result, make a separate call without executableOnly=true; only that unfiltered response includes non-qualifying candidates and their rejection reasons.

Use the per-leg freshness guidance to distinguish book observation times from assessment time and apply your own freshness policy.

Prerequisites: a Pro plan or above, and an API key from the dashboard.

fetchArbitrage is the only verb that applies the word arbitrage to anything, and it does so only when every gate passes: live non-synthetic asks on both legs, both markets open, real depth at the size you asked for, verified per-venue fees, compatible resolution rules, and a net edge that survives all of it.

Returned rows that fall short of that stay labelled an indicative price discrepancy. label carries exactly two values — arbitrage and indicative price discrepancy — and executable is the boolean form of the same judgement. There is no partial credit.

Two fields describe resolution, and they are not the same claim:

  • resolution.compatible is a cheap fingerprint veto. Its reason is one of threshold_conflict, stage_conflict, source_conflict, or empty. Compatible does not mean verified equivalent.
  • resolutionEquivalence is the stronger statement — verified only when a high-confidence persisted verdict matches both legs’ current resolution-rule content hashes.

similarity is candidate similarity from matching, not matchScore or verdict confidence. Two markets can read alike and settle differently, which is why the resolution gates exist.

matchScore compares resolution rules on a scale from 0 to 100. A score of 100 requires a fresh, high-confidence equivalent verdict against the current rules. It does not establish executable prices, available depth, or a profitable trade.

matchBandScoreMeaning
verified100Rules verified equivalent; every execution gate still applies.
minor85 to 99Visible as indicative, unverified and non-executable.
material60 to 84Visible with the listed differences, unverified and non-executable.
hiddenBelow 60, or a vetoExcluded from the feed; qualification can still explain it.
unscorednullNo current verdict; visible unless the close-date veto applies.

The fixed deductions below apply to every score. The rules comparison reports differences; the score is computed deterministically from them.

Difference kindPoints deducted
event_identity50
deadline_handling20
resolution_authority15
cancellation_handling10
successor_handling10
other5
confidence when medium5
confidence when low10

Each difference kind is charged once, with its explanations joined. confidence is a scoring-only kind. An equivalent verdict at medium or low confidence scores 95 or 90 and stays unverified. matchDifferences lists every charged { kind, detail, points } entry, including confidence. For every visible numeric score, the points sum to 100 - matchScore.

A polarity inversion hides the pair. Close dates more than 21 days apart also hide it, even if there is no verdict yet. A numeric veto is accounted for with 100 points (polarity, or deadline_handling with detail close_time_mismatch); this is a hide rule, not a graded fine-print difference. Without a close-date veto, insufficient evidence or a malformed verdict has no numeric score. Hidden numeric scores use max(0, 100 - sum(points)).

The meaning of resolutionEquivalence: "verified", executable, and the arbitrage label is unchanged. A score below 100 never enables execution. The qualification endpoint exposes the same explanation as checks.resolutionEquivalence.matchDeductions; its differenceKinds contains resolution verdict kinds only, while differences remains a string list for compatibility.

The match score is a rules comparison produced by an automated review of the two venues’ published resolution rules; it is not a probability that the markets settle identically, and trading a pair below 100 is your own risk.

Terminal window
curl -s "$PREDICTEFY_API_URL/api/router/fetchArbitrage?executableOnly=true&contracts=100&limit=500" \
-H "Authorization: Bearer pk_live_YOUR_KEY"
  • contracts is the size the assessment is made at — depth and fees are judged for that fill, not for one contract. Change it and the answer legitimately changes.
  • limit supports up to 500 rows per page, paginated via cursor (page.nextCursor).
  • executableOnly=true returns only rows passing every executable gate. Drop it to also receive visible non-qualifying candidates with rejection reasons; hidden match bands remain excluded.
  • venues (optional) keeps a row when either leg touches the listed venues (for example, venues=polymarket,kalshi). It does not require both legs to stay inside the list.
  • minEdge (optional) filters rows by minimum net edge.

This loop walks the published surface: use contracts=100 (or omit it), omit category, and start without a cursor. Page 1 also requires a fresh published set; otherwise the server returns meta.source: 'computed-fallback', which this example rejects. Later pages reuse the cursor’s pinned version. On 400 Cursor has expired, the loop discards partial results and restarts from page 1 at most three times. A fourth expiry throws the error. snapshotTTL=0 uses the server’s published-version retention cap, which defaults to 600,000 ms per hop.

const BASE = 'https://data.predictefy.com';
async function scan({ minNetEdge = 0.01, venues } = {}) {
const maxRestarts = 3;
let restarts = 0;
let cursor;
const results = [];
for (;;) {
const url = new URL('/api/router/fetchArbitrage', BASE);
url.searchParams.set('executableOnly', 'true');
url.searchParams.set('contracts', '100');
url.searchParams.set('limit', '500');
url.searchParams.set('snapshotTTL', '0');
if (venues) url.searchParams.set('venues', venues.join(','));
if (cursor) url.searchParams.set('cursor', cursor);
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.PREDICTEFY_API_KEY}` },
});
const body = await res.json();
if (!body.success) {
if (res.status === 400 && body.error.message?.startsWith('Cursor has expired')) {
if (restarts >= maxRestarts) {
throw new Error(`${body.error.code}: ${body.error.message}`);
}
restarts += 1;
cursor = undefined;
results.length = 0;
continue;
}
// PLAN_REQUIRED on Free and Builder keys; RATE_LIMITED and INSUFFICIENT_CREDITS are also expected.
if (body.error.retryable) return results;
throw new Error(`${body.error.code}: ${body.error.message}`);
}
if (body.meta?.source !== 'published') {
throw new Error('Published surface is unavailable; retry later.');
}
// netEdge is nullable — an unpriced pair is not a zero-edge pair.
results.push(...body.data.filter((row) => row.netEdge !== null && row.netEdge >= minNetEdge));
cursor = body.page?.hasMore ? body.page.nextCursor : undefined;
if (!cursor) return results;
}
}

Illustrative 100-contract response for an economics market, using a placeholder market. Numeric values are rounded for readability.

{
"success": true,
"data": [
{
"clusterId": "clr_9f2a7c41:kalshi:polymarket",
"question": "Will the Fed cut rates at the January 2027 meeting?",
"similarity": 0.94,
"contracts": 100,
"legs": {
"buyYes": {
"venue": "kalshi",
"canonicalMarketId": "kalshi:FED-27JAN-CUT",
"side": "yes",
"executable": true,
"reasons": [],
"vwap": 0.412,
"cost": 41.2,
"fee": 1.7,
"feeBasis": "general-nondirect",
"filled": 100,
"fullyFilled": true
},
"buyNo": {
"venue": "polymarket",
"canonicalMarketId": "polymarket:0x7d3f...c19a",
"side": "no",
"executable": true,
"reasons": [],
"vwap": 0.55,
"cost": 55.0,
"fee": 1.2375,
"feeBasis": "economics",
"filled": 100,
"fullyFilled": true
}
},
"resolutionEquivalence": "verified",
"matchScore": 100,
"matchBand": "verified",
"matchDifferences": [],
"resolution": { "compatible": true, "reason": "", "auditReasons": [] },
"settlementFee": 0.0,
"totalCost": 99.1375,
"payout": 100.0,
"netEdge": 0.8625,
"roi": 0.0087,
"executable": true,
"reasons": [],
"label": "arbitrage",
"asOf": "2026-08-31T14:22:08.412Z"
}
],
"meta": {
"live": true,
"contracts": 100,
"provenance": { "source": "predictefy-live" },
"asOf": "2026-08-31T14:22:08.412Z",
"seq": 1042,
"source": "published"
},
"page": {
"limit": 500,
"offset": 0,
"total": 1,
"hasMore": false
}
}

Every leg carries its own executable and reasons, so a pair can fail on one side only. Read the leg-level reasons when the pair-level reasons array does not explain enough.

fullyFilled is the field to branch on for sizing: filled is what the walked asks could actually absorb, and it is less than or equal to what you requested.

Each legs.*.selection names the real-world outcome the leg buys, for example home, away, over or under. It is an optional string, absent on unpaired rows.

Canonical sides let complete mapped legs receive a resolution-equivalence verdict. A mapping alone never makes a row executable: every existing gate still applies, and an unresolved mapping stays unverified, so its row stays an indicative price discrepancy.

Catalog-mapped selections are served wherever sports data is available, so they appear on unpaired sports rows. Leg-paired selections appear only where leg pairing is available on your account.

  • meta.source discloses the data origin. 'published' means the response was served from the continuously published surface (fresh within its publish cadence: about 30 seconds, with a 3-second floor); 'computed-fallback' indicates bounded on-demand computation over at most 10 candidate clusters, without the precomputed set. An initial page uses the fallback for a non-default contracts value, any category, or an unavailable or stale published surface. One candidate cluster can emit multiple ordered pair rows. meta.asOf and meta.seq record the timestamp and sequence number.
  • netEdge, roi, totalCost, vwap, cost, fee and settlementFee are all nullable. A null is “not priced”, not “zero”. Filtering with row.netEdge >= x silently drops nulls in some languages and admits them in others — test for null explicitly.
  • fee is a verified taker fee or nothing. Where a venue’s schedule is not verified, the leg carries a note explaining why no model was applied, and the edge is unknown rather than optimistic.
  • page.total may be null, which means not counted, not zero. Paginate on hasMore and nextCursor.
  • meta.judgeBeforeServe explains withheld clusters. When rules review is required, a cluster is assessed only after every cross-venue pair has a resolution verdict. heldClusters counts the clusters inside your scope that are held, and reason is judge_verdict_pending. A held cluster is absent from data, so an expected row can be missing here while it is held.

Good market data on a venue does not mean you can trade there. GET /v1/exec/venues is the authoritative list of execution services; see Trading & execution. Several venues serve real books with no hosted trading service at all.

Venues with reconstructed books cannot qualify by design: a synthetic book is a faithful representation of price and is not executable depth. Venue coverage records which venues have a real book.

An arbitrage query is the most expensive read on the platform at 15 credits; a cross-venue price comparison is 10 and an order-book snapshot is 5. Continuous polling adds up:

IntervalQueries/dayCredits/dayCredits/30 days
5 min2884,320129,600
60 s1,44021,600648,000
10 s8,640129,6003,888,000

Budget before you poll, and add revalidation on top — 5 credits per leg per check. Current weights and plan allowances are in Credits & billing.