close_to_bond event fires when a trade prints inside a zone you define, so you can react to outcomes that are effectively resolved before the oracle settles them.
The same event and filters are available two ways:
When to use this
- Resolution front-running: surface markets the crowd already treats as decided, ahead of on-chain settlement.
- Risk / exit signals: alert when a position you hold flips to near-certain-loss so you can exit the remaining size.
- Mispricing scans: watch one side of a market for prints at the opposite extreme of where you think it should trade.
Defining the bond zone
The bond zone is defined entirely by how you combinemin_price and max_price. The relationship between the two values selects one of four modes:
Alerting on near-certain outcomes
To get notified when an outcome becomes near-certain in either direction (at or above 90% or at or below 10%), setmin_price higher than max_price:
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 price is read
- The traded position’s own
priceis used: the price of the exact outcome token (position_id) that printed. - Trades at a price of exactly
0or1are skipped, since there is no remaining risk to alert on. priceis 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.
Examples
A near-certain-win alert for one specific market, Yes side only:tags:
tags matches a market’s tags or its category by display label (for example "Sports", "Crypto Prices"), case-insensitive.
Both extremes, scoped to the Yes/Up token so each event alerts once:
Reading the payload
Every delivery tells you which zone was hit and the threshold it breached:bond_side:"high"(near-certain) or"low"(near-zero).threshold: the filter value that was breached. In bounded-range mode this ismin_price.price: the value that triggered the alert, on a0.0–1.0scale.
Available filters
At least one of
min_price or max_price is required. Without either, every trade in every market would fire.