> For the complete documentation index, see [llms.txt](https://paragon-protocol.gitbook.io/paragon-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://paragon-protocol.gitbook.io/paragon-protocol/p10-index/pricing-and-oracles.md).

# Pricing & Oracles

### What Pricing Is Used For

Paragon pricing supports:

***

#### Swaps & Routing

* validates execution routes
* enforces minimum output conditions
* prevents invalid pricing

***

#### Pools & APR

* calculates TVL
* normalizes asset values
* displays consistent APR

***

#### Farming

* tracks rewards accurately
* ensures consistent valuation

***

#### Index Products (P10)

* computes NAV
* validates mint and redeem
* supports rebalancing

***

👉 Pricing is not just UI — it is part of protocol safety.

***

### Source of Truth (3 Layers)

Paragon combines three pricing layers:

***

#### 1. External Oracles (Primary)

* Chainlink (primary source)
* Pyth / Redstone (secondary)

Used for:

* major assets
* stablecoins
* index valuation

***

#### 2. On-Chain TWAP (Safety Layer)

* time-weighted average price
* typically 10–30 minute window

Used for:

* cross-checking oracle values
* fallback validation

***

#### 3. AMM Spot Price (Routing Only)

* real-time pool pricing
* used for execution routing

***

👉 Spot prices are **never used alone for settlement validation**.

***

### Core Validation Rules

Any price used for value transfer must pass:

* freshness checks
* deviation limits
* cross-validation (oracle vs TWAP)

***

👉 If validation fails:

* execution is restricted or blocked

***

### Safeguards

Paragon enforces multiple protections:

***

#### Freshness Checks

* outdated data is rejected

***

#### Deviation Filters

* large price changes are ignored
* unless confirmed across sources

***

#### Cross-Validation

* oracle values must align with TWAP
* prevents manipulation

***

#### Stablecoin Guard

* detects depegs
* adjusts behavior automatically

***

#### Global Protection Mode

If multiple price sources fail:

* sensitive actions are paused
* swaps remain available
* system enters a restricted mode

***

### Pricing in Swaps

Pricing is used to:

* validate routes
* enforce minimum output (minOut)
* prevent invalid execution

***

👉 Oracles do **not** determine swap prices —\
they act as a validation layer.

***

### Pricing for P10

P10 uses oracle pricing to compute NAV.

***

#### NAV Formula

NAV = Σ (weight × price)

***

#### Mint & Redeem

* mint price = NAV + fee
* redeem price = NAV − fee

***

👉 Fully transparent and verifiable.

***

#### Index Pricing Model

* multiple oracle sources
* median-based pricing
* outlier filtering

***

If validation fails:

* minting pauses
* redemption remains active

***

### Architecture Overview

* **OracleHub** → manages and validates price feeds
* **Flow Settlement** → validates execution conditions
* **Index Oracle** → computes NAV
* **Index Contracts** → enforce mint / redeem logic

***

### Manipulation Resistance

Paragon protects against:

***

#### Flashloan Attacks

* TWAP windows
* oracle cross-checks

***

#### Price Manipulation

* deviation filters
* multi-source validation

***

#### Execution Abuse

* minimum output enforcement
* route validation

***

#### Circuit Breakers

* minting pauses if unsafe
* redemption remains available

***

### Testnet Setup

Current configuration:

* mock oracle feeds
* configurable thresholds
* synthetic P10

***

### What Users See

**On Swap**

* execution validation
* protected routing
* savings indicator

***

**On P10**

* NAV
* composition
* oracle status

***

**On Pools**

* APR based on normalized pricing

***

### TL;DR

* Chainlink = primary source
* Pyth / Redstone = secondary
* TWAP = safety layer
* strict validation rules
* minting pauses if unsafe
* redemption remains available

***

Paragon pricing acts as a validation layer that protects execution, liquidity, and capital across the protocol.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://paragon-protocol.gitbook.io/paragon-protocol/p10-index/pricing-and-oracles.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
