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
DEGRADED, treat the asset as degraded: do not liquidate on Guard’s price alone, and fall back to your current oracle.Reconnecting
- Reconnect with a short back-off (for example 0.5, 1, 2, 4 seconds, then every 5 seconds).
- On reconnection the latest message for each asset is sent at once.
- Keep the last accepted
seqper asset across reconnections, so an old message is never accepted twice.
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
- Poll
GET /v1/healthfrom your monitoring and alert when an asset’s last message is older than your limit. - Alert on the share of time an asset spends in
DEGRADED. - Pilot partners are told by email about incidents that affect their assets.