Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/developer-hub/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ build/
node_modules/
package.json
tsconfig*.json
content/docs/price-feeds/core/use-real-time-data/pull-integration/ton.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ slug: /price-feeds/core/api-instances-and-providers
This documentation explains how to get access to API instances and providers for Pyth Price Feeds.
See the following guides to learn more about how to access each service:

- [Hermes](api-instances-and-providers/hermes.mdx)
- [Pythnet RPC](api-instances-and-providers/pythnet-rpc.mdx)
- [Benchmarks/Historical Price](api-instances-and-providers/benchmarks.mdx)
- [Hermes](/price-feeds/core/api-instances-and-providers/hermes)
- [Pythnet RPC](/price-feeds/core/api-instances-and-providers/pythnet-rpc)
- [Benchmarks/Historical Price](/price-feeds/core/api-instances-and-providers/benchmarks)
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{
"pages": [
"[Hermes](./hermes)",
"[Benchmarks / Historical Prices](./benchmarks)",
"[Pythnet RPC](./pythnet-rpc)"
]
"pages": ["hermes", "benchmarks", "pythnet-rpc"]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pages": [
"[EVM \u2197](https://api-reference.pyth.network/price-feeds/evm/getPriceNoOlderThan)",
"[Hermes \u2197](https://hermes.pyth.network/docs/)"
"[EVM](https://api-reference.pyth.network/price-feeds/evm/getPriceNoOlderThan)",
"[Hermes](https://hermes.pyth.network/docs/)"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This ability is functionally equivalent to latency: it allows users to see the p

The simplest way to guard against this attack vector is to incorporate a **staleness check** to ensure that the price used in a transaction is sufficiently recent.

The Pyth SDK provides the [`getPriceNoOlderThan()`](https://api-reference.pyth.network/price-feeds/evm/getPriceNoOlderThan) method to help users guard against this attack vector. This method returns the most recent price update that is not older than a specified threshold.
The Pyth SDK provides the [getPriceNoOlderThan()](https://api-reference.pyth.network/price-feeds/evm/getPriceNoOlderThan) method to help users guard against this attack vector. This method returns the most recent price update that is not older than a specified threshold.
Highly latency-sensitive protocols may wish to reduce the threshold to a few seconds to better suit their needs.
Please also see the section below on [latency mitigations](#latency) for additional ideas on how latency-sensitive protocols can minimize the impact of oracle latency.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Price Feed Contract Addresses on Aptos
description: Find Pyth price feed contract addresses on Aptos networks
title: on Aptos
description: List of Pyth price feed contract addresses on Aptos networks
slug: /price-feeds/core/contract-addresses/aptos
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Price Feed Contract Addresses on CosmWasm Networks
description: Find Pyth price feed contract addresses across CosmWasm ecosystems
title: on CosmWasm
description: List of Pyth price feed contract addresses on CosmWasm networks
slug: /price-feeds/core/contract-addresses/cosmwasm
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Price Feed Contract Addresses on EVM Networks
description: Find Pyth price feed contract addresses on supported EVM mainnets and testnets
title: on EVM Networks
description: List of Pyth price feed contract addresses on supported EVM mainnets and testnets
slug: /price-feeds/core/contract-addresses/evm
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Price Feed Contract Addresses on Fuel
description: Find Pyth price feed contract addresses on Fuel mainnet and testnet
title: on Fuel
description: List of Pyth price feed contract addresses on Fuel mainnet and testnet
slug: /price-feeds/core/contract-addresses/fuel
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ slug: /price-feeds/core/contract-addresses
The following sections list the addresses of deployed Pyth Price Feed contracts across blockchains.
The contracts are split by ecosystem into several different documents:

- [EVM](./contract-addresses/evm)
- [Solana/SVM](./contract-addresses/solana)
- [Aptos](./contract-addresses/aptos)
- [Sui](./contract-addresses/sui)
- [IOTA](./contract-addresses/iota)
- [Movement](./contract-addresses/movement)
- [TON](./contract-addresses/ton)
- [Fuel](./contract-addresses/fuel)
- [CosmWasm](./contract-addresses/cosmwasm)
- [NEAR](./contract-addresses/near)
- [Starknet](./contract-addresses/starknet)
- [Pythnet](./contract-addresses/pythnet)
- [EVM](/price-feeds/core/contract-addresses/evm)
- [Solana/SVM](/price-feeds/core/contract-addresses/solana)
- [Aptos](/price-feeds/core/contract-addresses/aptos)
- [Sui](/price-feeds/core/contract-addresses/sui)
- [IOTA](/price-feeds/core/contract-addresses/iota)
- [Movement](/price-feeds/core/contract-addresses/movement)
- [TON](/price-feeds/core/contract-addresses/ton)
- [Fuel](/price-feeds/core/contract-addresses/fuel)
- [CosmWasm](/price-feeds/core/contract-addresses/cosmwasm)
- [NEAR](/price-feeds/core/contract-addresses/near)
- [Starknet](/price-feeds/core/contract-addresses/starknet)
- [Pythnet](/price-feeds/core/contract-addresses/pythnet)

Please see the relevant ecosystem document to find the Pyth contract address on your blockchain of choice.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Price Feed Contract Addresses on IOTA
description: Find Pyth price feed contract addresses on IOTA networks
title: on IOTA
description: List of Pyth price feed contract addresses on IOTA networks
slug: /price-feeds/core/contract-addresses/iota
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"pages": [
"[EVM](./evm)",
"[Solana / SVM](./solana)",
"[Aptos](./aptos)",
"[Sui](./sui)",
"[IOTA](./iota)",
"[Movement](./movement)",
"[TON](./ton)",
"[Fuel](./fuel)",
"[CosmWasm](./cosmwasm)",
"[NEAR](./near)",
"[Starknet](./starknet)",
"[Pythnet](./pythnet)"
"evm",
"solana",
"aptos",
"sui",
"iota",
"movement",
"ton",
"fuel",
"cosmwasm",
"near",
"starknet",
"pythnet"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Price Feed Contract Addresses on Movement
description: Find Pyth price feed contract addresses on Movement networks
title: on Movement
description: List of Pyth price feed contract addresses on Movement networks
slug: /price-feeds/core/contract-addresses/movement
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Price Feed Contract Addresses on NEAR
description: Find Pyth price feed contract addresses on NEAR networks
title: on NEAR
description: List of Pyth price feed contract addresses on NEAR networks
slug: /price-feeds/core/contract-addresses/near
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Price Feed Contract Addresses on Pythnet
description: Find Pyth price feed contract addresses on Pythnet
title: on Pythnet
description: List of Pyth price feed contract addresses on Pythnet
slug: /price-feeds/core/contract-addresses/pythnet
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Price Feed Contract Addresses on Solana/SVM
description: Find Pyth price feed contract addresses on Solana and other SVM chains
title: on Solana/SVM
description: List of Pyth price feed contract addresses on Solana and other SVM chains
slug: /price-feeds/core/contract-addresses/solana
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Price Feed Contract Addresses on Starknet
description: Find Pyth price feed contract addresses on Starknet networks
title: on Starknet
description: List of Pyth price feed contract addresses on Starknet networks
slug: /price-feeds/core/contract-addresses/starknet
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Price Feed Contract Addresses on Sui
description: Find Pyth price feed contract addresses on Sui networks
title: on Sui
description: List of Pyth price feed contract addresses on Sui networks
slug: /price-feeds/core/contract-addresses/sui
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Price Feed Contract Addresses on TON
description: Find Pyth price feed contract addresses on TON networks
title: on TON
description: List of Pyth price feed contract addresses on TON networks
slug: /price-feeds/core/contract-addresses/ton
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: How to Create TradingView Charts
title: Create TradingView Charts
description: Learn how to build TradingView charts powered by Pyth price feeds
slug: /price-feeds/core/create-tradingview-charts
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ import { Tab, Tabs } from "fumadocs-ui/components/tabs";
This guide shows how to combine two price feeds to derive a cross rate. These are also known as "synthetic" price feeds.
Cross rates or Synthetic Price feeds are useful for trading pairs that are not directly supported by Pyth.

<Tabs items={["EVM", "SVM"]}>
<Tab value="EVM">
### EVM

For example, if you want to trade the price of **`ETH/EUR{:jsx}`**, which is not directly supported by Pyth, you can combine the price of **`ETH/USD{:jsx}`** and **`EUR/USD{:jsx}`** to derive the price of **`ETH/EUR{:jsx}`**.

$$
```math
\large{\text{ETH/EUR} = \text{ETH/USD} \div \text{EUR/USD}}
$$
```

<Tabs items={["EVM", "SVM"]}>
<Tab value="EVM">
### Derive a cross rate

The Pyth Solidity SDK provides [`deriveCrossRate`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/sdk/solidity/PythUtils.sol#L77) function to combine two price feeds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ description: Directory of error code references for Pyth price feeds
slug: /price-feeds/core/error-codes
---

- [EVM](error-codes/evm)
- [EVM](/price-feeds/core/error-codes/evm)
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"pages": ["[EVM](./evm)"]
"title": "Error Codes",
"pages": ["evm"],
"defaultOpen": false
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: How To Fetch Price Updates
title: Fetch Price Updates
description: Learn how to retrieve Pyth price updates via REST, streaming, and SDK
slug: /price-feeds/core/fetch-price-updates
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ slug: /price-feeds/core/how-pyth-works/cross-chain
Pyth uses a cross-chain mechanism to transfer prices from [Pythnet](pythnet) to target chains. The diagram below
shows how prices are delivered from Pythnet to target chains:

![Pyth cross-chain architecture](/images/Pull-Architecture-Hermes.png)
<figure className="image-container">
<img
src="/images/Pull-Architecture-Hermes.png"
alt="Pyth cross-chain architecture"
/>
</figure>

Data providers publish their prices on Pythnet. The on-chain [oracle program](oracle-program) then aggregates prices
for a feed to obtain the aggregate price and confidence. Next, the Pythnet validators send a Wormhole message on each
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ price_account .. CqFJLrT4rSpA46RQkVYWn8tdBDuQ7p7RXcp6Um76oaph

In an EMA the most recent samples receive the most weight, and samples further back in time get exponentially less weight the farther in the past they are. For a 1 hour EMA, the samples 1 hour in the past get 50% of the weighting, samples 2 hours in the past get 25% of the weighting, 3 hours in the past get 12.5% of the weighting, etc.

![EMA price aggregation example 1](/images/EMA_Price_Aggregation_1.png)
<figure className="image-container">
<img
src="/images/EMA_Price_Aggregation_1.png"
alt="EMA price aggregation example 1"
/>
</figure>

While conceptually not as simple as an SMA (Simple Moving Average), the EMA has a particularly simple implementation for streaming applications such as Pyth. The exponential weighting method allows the entire history of prices and weights to be represented by a single number.

Expand All @@ -42,6 +47,11 @@ The current Pyth averaging method is a slot-weighted, inverse confidence-weighte
- **Slot weighted** — The Pyth EMA uses the Pythnet slot number to measure the passage of time. The averaging period is 5921 slots, which corresponds to approximately 1 hour on Pythnet.
- **Inverse confidence weighted** — Weighting each sample by 1/Confidence lets the EMA give more weight to samples with tight confidence and ignore samples with very wide confidence. Below is an example of an outlier aggregate price with a wide confidence interval. Notice how the average using inverse confidence weighting does not get pulled up by the outlier sample while the uniform weighted average does.

![EMA price aggregation example 2](/images/EMA_Price_Aggregation_2.png)
<figure className="image-container">
<img
src="/images/EMA_Price_Aggregation_2.png"
alt="EMA price aggregation example 2"
/>
</figure>

For more details and explanations, be sure to read the dedicated blog post on this topic [here](https://pythnetwork.medium.com/whats-in-a-name-302a03e6c3e1).
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"pages": [
"[Pythnet](./pythnet)",
"[Oracle Program](./oracle-program)",
"[Cross-chain](./cross-chain)",
"[Fees](./fees)",
"[Hermes](./hermes)",
"[Price Aggregation](./price-aggregation)",
"[EMA Price Aggregation](./ema-price-aggregation)"
"pythnet",
"oracle-program",
"cross-chain",
"fees",
"hermes",
"price-aggregation",
"ema-price-aggregation"
]
}
Loading
Loading