Skip to main content
Event: close_to_bond
Endpoint: wss://api.struct.to/ws/alerts
Cost: 0.2 credits per event
Get notified when a trade occurs at a near-certain-outcome price. At least one of min_probability or max_probability is required to define the bond zone.
Related guide: Bond-zone alerts is a worked walkthrough of this event across both websockets and webhooks.

Defining the bond zone

The bond zone is defined entirely by how you combine min_probability and max_probability. The relationship between the two values selects one of four modes:
You setModeFires whenbond_side
min_probability onlySingle high edgeprobability ≥ min_probability"high"
max_probability onlySingle low edgeprobability ≤ max_probability"low"
Both, with min < maxBounded rangemin_probability ≤ probability ≤ max_probability"high"
Both, with min > maxTwo edgesprobability ≥ min_probability or probability ≤ max_probability"high" or "low"
min < max is a band, not a bond. If you set min_probability: 0.75 and max_probability: 0.90, you do not get “fires above 90% or below 75%”. Because min < max, it switches to bounded-range mode and fires only when probability lands inside the 75–90% band. To alert on the two near-certain extremes, you must set min > max (see below).

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% — set min_probability higher than max_probability:
{
  "min_probability": 0.90,
  "max_probability": 0.10
}
Because 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 probability is used when present; otherwise its price is used as the probability.
  • Trades with a probability of exactly 0 or 1 are skipped — there is no remaining risk to alert on.
  • probability and price are on a 0.01.0 scale (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 add position_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.

Filters

FilterTypeRequiredDescription
min_probabilitynumberYes*High zone threshold, 0.0-1.0 (e.g. 0.95). *At least one of min_probability or max_probability is required.
max_probabilitynumberYes*Low zone threshold, 0.0-1.0 (e.g. 0.05). *At least one of min_probability or max_probability is required.
condition_idsstring[]NoRestrict to specific conditions (max 500)
position_idsstring[]NoRestrict to specific positions (max 500)
outcomesstring[]NoFilter by outcome name, e.g. ["Yes", "No"] (max 500)
position_outcome_indicesnumber[]NoFilter by outcome index: 0 or 1 (max 500)
event_slugsstring[]NoRestrict to specific events (max 500)
exclude_shortterm_marketsbooleanNoExclude short-term markets from results

Subscribe

Single high edge — fire when an outcome is near-certain (≥ 95%):
{
  "op": "subscribe",
  "event": "close_to_bond",
  "min_probability": 0.95
}
Both edges — fire when an outcome is near-certain in either direction (≥ 90% or ≤ 10%). Note min_probability is set higher than max_probability:
{
  "op": "subscribe",
  "event": "close_to_bond",
  "min_probability": 0.90,
  "max_probability": 0.10
}

Response

{
  "event": "close_to_bond",
  "timestamp": 1775913505260,
  "data": {
    "trader": "0x9d84cef98b41a5b88dafb55c05e9a7e0f1a4f4d6",
    "taker": "0x4bfb41d5b3570defd03c39a9a4d8de6bd8b8982e",
    "position_id": "452312848583266388373324160190187140051835877600158453279131187530910662656",
    "condition_id": "0x4fec624c0ff2bfae89956cebd6fbc9c58f995f824382dc587dc5a32a4b15940b",
    "outcome": "Yes",
    "outcome_index": 0,
    "question": "Will candidate X win the 2028 election?",
    "market_slug": "will-candidate-x-win",
    "event_slug": "us-presidential-election-2028",
    "trade_id": "0x9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b",
    "hash": "0x1f2e3d4c5b6a7988deadbeefcafebabe0011223344556677889900aabbccddee",
    "block": 19456789,
    "confirmed_at": 1713012000,
    "amount_usd": 5000.00,
    "shares_amount": 5263.16,
    "fee": 50.00,
    "side": "Buy",
    "price": 0.96,
    "probability": 0.96,
    "bond_side": "high",
    "threshold": 0.95
  }
}
Last modified on June 8, 2026