# 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nunchi.trade/nunchi-yield-exchange-perps/oracles-pyth-and-seda.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
