confidence field in every API response captures that quality on a 0.0 – 1.0 scale. Consumers should set a floor (0.9 is the default we recommend) and
ignore prints below it for any automation that pulls a real-money trigger.
What feeds confidence
w_depth = 0.5, w_freshness = 0.3, w_decode = 0.2.
Depth score
How much liquidity was available at the probe size. Computed from Jupiter’s quote metadata — slippage at probe size relative to a configured “healthy” depth band.> $1Mavailable at probe size →depth_score = 1.0< $50k→depth_score = 0.0- Linear interpolation between
Freshness score
Time since the most recent source update (Sanctum, Pyth, etc.).< 5ssince last update →freshness_score = 1.0> 30s→freshness_score = 0.0(and the asset flips toUNKNOWN)- Linear interpolation
Decode score
Did the on-chain decoder produce a result, and did the cached IDL match the on-chain canonical IDL on the last verification?- IDL match + successful decode →
decode_score = 1.0 - IDL drift detected or decoder threw →
decode_score = 0.0(asset →UNKNOWN)
When confidence drops
A drop in confidence does not change the state on its own.PEGGED with confidence
0.6 is still PEGGED — the published state is what the FSM saw. But you should
treat it as “PEGGED, but I wouldn’t bet money on it without re-fetching.”
Three patterns trigger sustained low confidence:
- Thin venues at low volume hours. Common for emerging yield-bearing assets and exotic LSTs during US-night / Asia-morning hours. Confidence floats around 0.6–0.8.
- Source rate limiting. If Pyth or Jupiter hits a quota limit, freshness scores drop. We have backoff with jitter to recover, but during the backoff window confidence will dip.
- IDL drift. When the protocol upgrades and our pinned IDL no longer matches,
decode_score → 0and the asset is forced toUNKNOWN. Worst case — we don’t know the truth about the asset’s intrinsic.
How to use it
confidence before acting. A signed-but-low-confidence webhook is a hint
to act conservatively, not an immediate trigger.
Confidence threshold per use case
| Use case | Min confidence |
|---|---|
| Telegram bot display | 0.0 (we show everything) |
| Dashboard chart | 0.5 (we render with a low-confidence indicator) |
| Webhook to a notifier | 0.8 |
| Webhook to a liquidation pause | 0.9 |
| Webhook to a payout | 0.95 + additional verification (human or multi-sig) |
What happens at confidence = 0
When confidence drops to zero, the asset flips toUNKNOWN and stays there for at
least 60 seconds after the underlying issue resolves. This is the same dwell logic
as the FSM exit threshold — we want subscribers to trust an exit from UNKNOWN,
not chase a flapping signal.
If an asset is UNKNOWN for >15 minutes, treat it as a real problem at the source
and go investigate. The status page at pegana.xyz/status
shows which sources are healthy.