API v0.1 · pre-release

Stale data and fallbacks

Plan for the moments Guard cannot help: a dropped connection, a stale message, too few sources. The safe default is always the same: do not liquidate on Guard’s price alone.

The rule

If no valid message has arrived within your staleness limit, or the state is DEGRADED, treat the asset as degraded: do not liquidate on Guard’s price alone, and fall back to your current oracle.

Reconnecting

Missed messages

seq increases by one with every message across all assets. A gap on the stream means messages were missed, for example during a reconnection. Messages are self-contained, so you can act on the next valid one; there is nothing to replay.

After Guard restarts, seq jumps forward and keeps increasing. It never goes back.

Staleness

Messages arrive every 500 ms per asset. Choose a staleness limit that suits your system, and compare t with your own clock, synchronised by NTP.

DEGRADED

Guard enters DEGRADED when too few healthy independent sources remain. It holds the last price and widens the band. sources_used and sources_total show how many sources are contributing. The state returns to normal on its own when sources recover.

Monitoring