# Oracle Integration

### Oracle Integration

The Symmio Options Protocol uses secure, decentralized price feeds to power settlement, liquidation, and real-time solvency checks. Its oracle system is built on the **Muon Network**, which provides cryptographically verified price data using a distributed validator set.

## Muon Network

* **Threshold Signature Scheme (TSS):** Prevents single points of failure.
* **Schnorr Signatures:** Enables efficient multi-party signature verification.
* **Gateway Validation Layer:** Adds an off-chain signature from a trusted gateway.
* **Decentralized Validation:** Multiple validators must agree on price updates.

## Oracle Architecture

| Component              | Purpose                                           |
| ---------------------- | ------------------------------------------------- |
| **MuonOracle**         | Main on-chain oracle contract for price delivery  |
| **Schnorr Verifier**   | Performs cryptographic verification of signatures |
| **Gateway Signature**  | Ensures a second, trusted source signs data       |
| **SettlementPriceSig** | Encapsulates verified price + metadata for trades |

## Verification Process

```solidity
function verifyTSSAndGW(
    bytes32 _data,
    bytes calldata _reqId,
    SchnorrSign calldata _signature,
    bytes calldata _gatewaySignature
) external view;
```

1. **TSS Verification:**

   Uses Schnorr signatures and public key matching to validate data from Muon.
2. **Gateway Signature:**

   Validates an additional ECDSA signature from a trusted gateway signer.
3. **Integrity Checks:**

   Confirms request freshness, symbol correctness, and data authenticity.

#### Key Integration Points

**1. Trade Settlement**

* Prices are verified during trade execution.
* Verified price is used to calculate PnL and finalize trades.

**2. Liquidation Triggers**

* Collateral prices and unrealized PnL are validated before liquidation.
* Oracle data ensures fair execution and risk isolation.

**3. Real-Time Risk Monitoring**

* Party-level PnL is updated using oracle-verified snapshots.
* Enables automated flagging of risky accounts.

## Role in Liquidation Lifecycle

| Phase     | Oracle Role                                             |
| --------- | ------------------------------------------------------- |
| Flagging  | Real-time collateral valuation for solvency checks      |
| Execution | Provides final settlement prices and deficit validation |
| Closure   | Supports asset redistribution based on verified values  |

## Oracle Data Flow

<figure><img src="/files/1XXkk8nTSjKdD0mr6IQh" alt=""><figcaption></figcaption></figure>


---

# 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.symm.io/options-protocol-architecture/technical-architecture/oracle-integration.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.
