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
3 changes: 3 additions & 0 deletions apps/developer-hub/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.env*.local
.source
dist/

# Ai Migration
.ai/**
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function requestRandomNumber() external payable {

This method returns a sequence number and emits a [`Requested`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/EntropyEventsV2.sol#L30) event. You can store this sequence number to identify the request in next step.

Note that there are several variants of `requestV2` that allow the caller to configure the provider fulfilling the request and the gas limit for the callback. Refer [request callback variants](./entropy/request-callback-variants.mdx) for more details.
Note that there are several variants of `requestV2` that allow the caller to configure the provider fulfilling the request and the gas limit for the callback. Refer [request callback variants](./entropy/request-callback-variants) for more details.

Please see the method documentation in the [IEntropyV2 interface](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropyV2.sol).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Custom gas limits are useful when your callback function requires more gas than

## Prerequisites

Before following this guide, you should first complete the basic setup from the [Generate Random Numbers in EVM Contracts](./entropy/generate-random-numbers-evm.mdx) guide. This guide builds upon that foundation and assumes you have:
Before following this guide, you should first complete the basic setup from the [Generate Random Numbers in EVM Contracts](./entropy/generate-random-numbers-evm) guide. This guide builds upon that foundation and assumes you have:

- Installed the Pyth Entropy Solidity SDK
- Set up your contract with the `IEntropyConsumer` interface
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Benchmarks
description: Access Benchmarks API instances for Pyth Price Feeds
slug: /price-feeds/core/api-instances-and-providers/benchmarks
---

The Pyth Data Association hosts a public instance of the Benchmarks API at the following URL:

| Channel | URL |
| ------- | ------------------------------- |
| Stable | https://benchmarks.pyth.network |

There is currently no Benchmarks instance for the Beta channel.
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
---
title: "Hermes: Open-Source Service for Pyth Price Updates"
description: >-
Experience real-time Pyth price feeds with Hermes: an open-source REST and
streaming API. Use public endpoints or self-host for reliable, decentralized
data.
full: false
index: false
title: Hermes
description: Guide to Hermes API endpoints for real-time Pyth price delivery
slug: /price-feeds/core/api-instances-and-providers/hermes
---

# Hermes
import { Callout } from "fumadocs-ui/components/callout";

Hermes is an open-source service that listens to the Pythnet and the Wormhole Network for Pyth price updates, and
serves them via a convenient web API.

Hermes allows users to easily [fetch price updates](../fetch-price-updates) via a REST API, or subscribe to server-side streaming
Hermes allows users to easily [fetch price updates](../fetch-price-updates.mdx) via a REST API, or subscribe to server-side streaming
updates.

## Public Endpoints
Expand All @@ -23,16 +19,21 @@ Network:

URL: https://hermes.pyth.network

<InfoBox variant="warning">
<div>For developers building on **Aptos testnet**, **Sui testnet** or **Near testnet**, please use the Hermes Beta endpoint:</div>
<Callout type="warning" title="Hermes Beta">
For developers building on **Aptos testnet**, **Sui testnet** or **Near testnet**, please use the Hermes Beta endpoint:
URL: https://hermes-beta.pyth.network

<div>URL: https://hermes-beta.pyth.network</div>
</Callout>

</InfoBox>
### Rate limits

In order to maximize the reliability of the Public Hermes API, a request rate limit is enforced.
All endpoints limits are set at 30 requests every 10 seconds per IP address.
Clients issuing request above the limit will receive a 429 (Too Many Requests) response for the subsequent 60-second period.

For production deployments, developers integrating with Pyth Network are **strongly encouraged** to use Node Providers
for maximum resilience and decentralization. Moreover, Hermes is designed to be self-hosted, so developers can run their own
instance of Hermes to fetch Pyth price updates. Please note it is not recommended to use the public endpoint for production as it has rate limits.
instance of Hermes to fetch Pyth price updates.

## Node Providers

Expand All @@ -48,4 +49,4 @@ The following node providers offer Hermes:
The Pyth Data Association provides a Helm chart for running Hermes in
[charts](https://github.com/pyth-network/charts/tree/main/charts/hermes) repository. Please refer to the chart's readme
for the configuration values.
You will need a Pythnet RPC to run Hermes; see the [guide for accessing a Pythnet RPC](pythnet-rpc).
You will need a Pythnet RPC to run Hermes; see the [guide for accessing a Pythnet RPC](pythnet-rpc.mdx).
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: API Instances and Providers
description: Access API instances and providers for Pyth Price Feeds
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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"pages": [
"[Hermes](./hermes)",
"[Benchmarks / Historical Prices](./benchmarks)",
"[Pythnet RPC](./pythnet-rpc)"
]
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
---
title: "Pythnet RPC: How to Access and Use for Developers"
description: >-
Use Hermes to configure Pythnet RPC. Choose from trusted providers like Triton
or P2P, or self-host a node for secure, reliable data access.
full: false
index: false
title: Pythnet RPC
description: Access Pythnet RPC providers for Pyth price feeds
slug: /price-feeds/core/api-instances-and-providers/pythnet-rpc
---

# Pythnet RPC

You will need a Pythnet RPC to run Hermes, which you can obtain from any of the Pythnet RPC
providers below:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
---
title: "Pyth API Reference: On- and Off-Chain Developer Tools"
description: >-
Pyth Core’s API reference covers EVM, Aptos, CosmWasm, and Hermes. It provides
interactive documentation and guides for both on-chain and off-chain
integration.
full: false
index: false
title: API Reference
description: Explore interactive Pyth API references for on-chain and off-chain integrations
slug: /price-feeds/core/api-reference
---

# API Reference

The API reference is a comprehensive guide to the various APIs -- both on- and off-chain -- that developers can use in their applications.
Developers can consult this reference to better understand what methods exist and what they do.
The API reference is interactive, so developers can try out the APIs from the website to better understand their behavior.

The following on-chain contracts are documented in the API reference:

- [EVM](api-reference/evm)
- [Aptos](api-reference/aptos)
- [CosmWasm](api-reference/cosmwasm)
- [EVM](https://api-reference.pyth.network/price-feeds/evm/getPriceNoOlderThan)

Hermes also has interactive API documentation hosted by the service itself:

- [Hermes](https://hermes.pyth.network/docs/)
- [Benchmarks / Historical Prices](https://benchmarks.pyth.network/docs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pages": [
"[EVM \u2197](https://api-reference.pyth.network/price-feeds/evm/getPriceNoOlderThan)",
"[Hermes \u2197](https://hermes.pyth.network/docs/)"
]
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
---
title: "Pyth Price Feeds: Best Practices for Safe Use"
description: >-
Best practices for Pyth price feeds: secure fixed-point representation,
mitigate latency & threats, use confidence intervals, and follow futures
pricing guidelines.
full: false
index: false
title: Best Practices
description: Learn how to integrate Pyth price feeds safely and effectively
slug: /price-feeds/core/best-practices
---

# Best Practices

This page provides some technical details about Pyth price feeds that are necessary to use them safely and correctly.
Please read this page before using Pyth price feeds in your application.

Expand All @@ -31,7 +25,7 @@ Sometimes, Pyth will not be able to provide a current price for a product.
This situation can happen for various reasons.
For example, US equity markets only trade during certain hours, and outside those hours, it's not clear what an equity's price is.
Pyth price feeds follow the traditional market hours for each asset class. \
Consult [Market Hours](./market-hours.md) to know the market hours for each asset class.
Consult [Market Hours](./market-hours) to know the market hours for each asset class.

Alternatively, a network outage (at the internet level, blockchain level, or at multiple data providers) may prevent the protocol from producing new price updates.
(Such outages are unlikely, but integrators should still be prepared for the possibility.)
Expand All @@ -54,7 +48,7 @@ The simplest way to guard against this attack vector is to incorporate a **stale

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](best-practices.md#latency) for additional ideas on how latency-sensitive protocols can minimize the impact of oracle latency.
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.

## Latency

Expand Down Expand Up @@ -98,7 +92,7 @@ To expand upon the first option, it is recommended to use the confidence interva

The same principle would apply if you wrote a derivative contract. If someone wants to open a derivative contract with you, you would value their collateral at the lower price. However, if you were deciding whether someone's margin limits were violated, you could value their outstanding leveraged position at the higher price. If a contract needs to be settled at a price, you could take approaches such as the following:

1. Using Pyth's exponential moving average price, which represents estimates of the average price of the asset over a specified time period (e.g., over the past 1 hour). The exponential moving average price is computed such that it lessens the influence of prices with wide confidence intervals. You may find more details in [EMA Price Aggregation](./how-pyth-works/ema-price-aggregation.md).
1. Using Pyth's exponential moving average price, which represents estimates of the average price of the asset over a specified time period (e.g., over the past 1 hour). The exponential moving average price is computed such that it lessens the influence of prices with wide confidence intervals. You may find more details in [EMA Price Aggregation](./how-pyth-works/ema-price-aggregation.mdx).
2. Using the aggregate price, which is Pyth's best estimate of the price at a single point in time. The quality of this estimate depends on the width of the confidence interval at settlement time and on occasion, it may be imprecise. However, it is the best you can do with Pyth data if you need a single price at that exact point in time.
3. Defining the contract to depend on confidence. For example, you could create an option that refunds the option premium to the buyer (so both sides of the transaction are even) if the strike price is within the confidence interval at settlement time. You could also create a contract that delayed settlement until the confidence interval was sufficiently small. If you choose this second option, you should ensure that your contract is guaranteed to eventually settle even if the confidence interval never narrows.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
---
title: "Aptos Pyth Contract Addresses (Mainnet, Testnet, Devnet)"
description: >-
Browse Pyth’s Aptos contract addresses on Mainnet, Testnet, and Devnet with
direct links to Pyth, Wormhole, and the Deployer for quick reference.
full: false
index: false
title: Price Feed Contract Addresses on Aptos
description: Find Pyth price feed contract addresses on Aptos networks
slug: /price-feeds/core/contract-addresses/aptos
---

# Price Feed Contract Addresses on Aptos
import CopyAddress from "../../../../../src/components/CopyAddress";

Pyth is currently deployed on Aptos Mainnet, Aptos Testnet, and Movement devnet.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
---
title: Price Feed Contract Addresses on CosmWasm Networks
description: >-
Find Pyth contract addresses on CosmWasm networks—mainnets and testnets across
multiple chains. Access your network’s address instantly.
full: false
index: false
description: Find Pyth price feed contract addresses across CosmWasm ecosystems
slug: /price-feeds/core/contract-addresses/cosmwasm
---

# Price Feed Contract Addresses on CosmWasm Networks

Pyth is currently available on the following cosmwasm chains:

### Stable
Expand Down
Loading
Loading