Event:
Cost: 0.2 credits per delivery
close_to_bond Cost: 0.2 credits per delivery
close_to_bond callback fires when a trade occurs at the near-certain end of a market — for example an outcome trading at ≥ 95¢ or ≤ 5¢. The full callback schema is in the auto-generated Close to bond callback reference; this page explains the one part the schema can’t show on its own: how the probability filters define the zone.
Defining the bond zone
The bond zone is defined entirely by how you combinemin_probability and max_probability. The relationship between the two values selects one of four modes:
| You set | Mode | Fires when | bond_side |
|---|---|---|---|
min_probability only | Single high edge | probability ≥ min_probability | "high" |
max_probability only | Single low edge | probability ≤ max_probability | "low" |
Both, with min < max | Bounded range | min_probability ≤ probability ≤ max_probability | "high" |
Both, with min > max | Two edges | probability ≥ min_probability or probability ≤ max_probability | "high" or "low" |
Alerting on near-certain outcomes
To get notified when an outcome becomes near-certain in either direction — trading at or above 90% or at or below 10% — setmin_probability higher than max_probability:
0.90 > 0.10, this is read as two separate edges. A trade at 96¢ fires with bond_side: "high"; a trade at 4¢ fires with bond_side: "low". For a single edge, set just one of the two.
How probability is read
- The trade’s
probabilityis used when present; otherwise itspriceis used as the probability. - Trades with a probability of exactly
0or1are skipped — there is no remaining risk to alert on. probabilityandpriceare on a0.0–1.0scale (so 95¢ =0.95).
Picking the right side
On a binary market, “YES at ≤10%” and “NO at ≥90%” are the same event priced from opposite tokens. If you addposition_outcome_indices: [0] you will only ever see trades that print on the Yes/Up token (index 0); trades on the No token (index 1) won’t fire even when they hit the same bond zone. Omit position_outcome_indices to catch the zone regardless of which side the trade prints on.
Subscription filters
Add these to thefilters object when you create the subscription. At least one of min_probability or max_probability is required.
| Filter | Type | Description |
|---|---|---|
min_probability | number | High-edge / lower bound of the zone, 0.0–1.0. |
max_probability | number | Low-edge / upper bound of the zone, 0.0–1.0. |
condition_ids | string[] | Restrict to specific markets (max 500). |
position_ids | string[] | Restrict to specific outcome tokens (max 500). |
outcomes | string[] | Restrict by outcome name, e.g. ["Yes", "No"] (max 500). |
position_outcome_indices | number[] | Restrict by outcome index: 0 (Yes/Up) or 1 (No). |
event_slugs | string[] | Restrict to specific events (max 500). |
exclude_shortterm_markets | boolean | Exclude short-term Up/Down markets. |