Skip to main content

Crate safe_oracle

Crate safe_oracle 

Source

Modules§

circuit_breaker
Circuit breaker state machine for safe_oracle (Phase 5.1).

Structs§

LiquidityRegistryClient
LiquidityRegistryClient is a client for calling the contract defined in “LiquidityRegistry”.
LiquiditySnapshot
Mirror of liquidity-registry::LiquiditySnapshot.
PriceData
ReflectorClient
ReflectorClient is a client for calling the contract defined in “Reflector”.
SafeOracleConfig
Configuration for the safe_oracle library — the per-pool tuning surface.

Enums§

Asset
ConfigError
Errors returned by SafeOracleConfig::validate when a config field has an out-of-range value that would silently disable a guardrail or produce nonsensical behavior at runtime.
OracleSafetyViolation
Reasons a guardrail has rejected a price; the Err payload of every safe_oracle public API.
PriceResult
Result type for lastprice() that allows auto-halt to commit even on guardrail violations.

Constants§

MAX_CIRCUIT_BREAKER_HALT_LEDGERS
Maximum allowed circuit breaker halt duration in ledgers.
REFLECTOR_DECIMALS_EXPECTED
Expected decimals() value for the primary Reflector oracle contract.

Statics§

__SPEC_XDR_TYPE_ASSET
__SPEC_XDR_TYPE_CONFIGERROR
__SPEC_XDR_TYPE_ORACLESAFETYVIOLATION
__SPEC_XDR_TYPE_PRICEDATA
__SPEC_XDR_TYPE_PRICERESULT
__SPEC_XDR_TYPE_SAFEORACLECONFIG

Functions§

lastprice
Validates oracle output against five layered guardrails before returning a price, wrapped by the circuit breaker (Phase 5.2 v2).