You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .gitbook/developers-evm/oracle-precompile.mdx
+64-12Lines changed: 64 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,61 @@
1
1
---
2
2
title: Oracle Precompile
3
+
description: Approaches for querying price data on Injective, including native oracle queries, off-chain Pyth, and on-chain Pyth via EVM.
3
4
---
4
5
5
-
import { Callout } from"@/components/ui";
6
+
<Info>
7
+
The Oracle Precompile is not yet available.
8
+
In the meantime, you can query prices using one of the approaches described below.
9
+
</Info>
6
10
7
-
<Callouttype="warning">
8
-
The Oracle Precompile is not yet available. In the meantime, you can query
9
-
prices directly from the Pyth contract deployed on Injective's EVM. Note that
10
-
not all price feeds are available — see the supported feeds below.
11
-
</Callout>
11
+
Injective offers multiple ways to access oracle price data depending on your architecture and requirements.
12
+
The following approaches range from querying Injective's native oracle module directly, to integrating with Pyth off-chain,
13
+
to reading Pyth prices on-chain through Injective's EVM.
12
14
13
-
## Querying Pyth Prices on Injective EVM
15
+
## Approach 1: Query the native oracle module
14
16
15
-
Pyth is deployed at `0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320` on Injective's EVM. You can use it to query prices for the supported feeds listed below.
17
+
You can query price data directly from Injective's native [oracle module](/developers-native/injective/oracle/index),
18
+
which aggregates feeds from multiple providers including Band, Coinbase, and Pyth.
16
19
17
-
### Supported Feeds
20
+
The [injective-price-oracle](https://github.com/InjectiveLabs/injective-price-oracle) repository
21
+
provides a reference implementation for querying the native oracle module programmatically.
22
+
This approach is well-suited for applications that need access to Injective-native price feeds without relying on third-party EVM contracts.
23
+
24
+
For full details on the oracle module's state, messages, and supported providers,
25
+
see the [oracle module documentation](/developers-native/injective/oracle/index).
26
+
27
+
## Approach 2: Off-chain price feeds with Pyth
28
+
29
+
If your application fetches prices off-chain (for example, in a backend service or bot),
30
+
you can query Pyth's HTTP API directly without any on-chain interaction.
31
+
32
+
Refer to the Pyth documentation on [fetching price updates](https://docs.pyth.network/price-feeds/core/fetch-price-updates)
33
+
for details on available endpoints, request formats, and response schemas.
34
+
35
+
This approach is ideal for off-chain trading systems, analytics dashboards,
36
+
or any service that requires price data without submitting transactions.
37
+
38
+
## Approach 3: On-chain price feeds with Pyth (EVM)
39
+
40
+
For smart contracts that need to read prices on-chain, you can interact with the Pyth contract deployed on Injective's EVM.
41
+
This uses Pyth's pull-based oracle model, where price updates are fetched off-chain and submitted on-chain before reading.
42
+
43
+
### Contract addresses
44
+
45
+
To obtain the Pyth contract address for Injective EVM, refer to the Pyth contract addresses page and locate the **Injective EVM** entry:
0 commit comments