# Oracles: Pyth and SEDA

On YEX Perps markets, **oracles are the safety boundary**. They define what the system considers “true” for **marking**, **risk**, and **settlement,** so neither traders nor the House can win by manipulating a single venue.

This is especially important for **HIP‑3 index perps**: they’re easy to quote and hedge at scale *only if the index is robust*.

***

### Architecture

<table><thead><tr><th width="158.390625">Component</th><th>Role</th><th>Responsibility</th></tr></thead><tbody><tr><td><strong>Pyth</strong></td><td>Data source</td><td>High‑quality real‑time feeds</td></tr><tr><td><strong>SEDA</strong></td><td>Aggregator</td><td>Combines Pyth + other sources into a composite rate</td></tr><tr><td><strong>Pyth Relayers</strong></td><td>Relayer</td><td>Listens to SEDA output and updates HIP‑3 oracles</td></tr><tr><td><strong>Oracle Updater</strong></td><td>Executor</td><td>Calls <code>SetOracle</code> with the composite rate</td></tr></tbody></table>

1. **Raw sources:** Pyth publishes onchain feeds; additional venue signals (e.g., mark prices) can be included.
2. **Aggregation:** SEDA computes a robust **composite rate** (weighted blend + guardrails).
3. **Relay:** decentralized relayers push the composite rate to HIP‑3.
4. **SetOracle:** the oracle updater commits the value used for OraclePx/MarkPx/ExternalPerpPx.

***

### Design principles

#### Fast path // safe path

* **Fast path:** low‑latency reference for quoting and UX.
* **Safe path:** conservative reference for liquidation triggers and settlement.

#### Safety&#x20;

Oracle inputs are wrapped with

* outlier filtering
* staleness checks
* confidence/uncertainty handling
* circuit breakers / safe‑degrade behavior

#### Why this matters to the House

The **Agentic Binned‑liquidity Manager (ABM)** uses oracle context to

* tighten spreads when safe,
* widen and reduce size when risk rises,
* avoid being run over by adverse selection.

***

### Practical note

Oracles are **risk references**, not guaranteed executable prices. In extreme volatility, markets may trade away from oracle marks; safety systems respond accordingly.

```python
```
