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
+65-11Lines changed: 65 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,63 @@
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
6
import { Callout } from"@/components/ui";
6
7
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>
8
+
<Info>
9
+
The Oracle Precompile is not yet available.
10
+
In the meantime, you can query prices using one of the approaches described below.
11
+
</Info>
12
12
13
-
## Querying Pyth Prices on Injective EVM
13
+
Injective offers multiple ways to access oracle price data depending on your architecture and requirements.
14
+
The following approaches range from querying Injective's native oracle module directly, to integrating with Pyth off-chain,
15
+
to reading Pyth prices on-chain through Injective's EVM.
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
+
## Approach 1: Query the native oracle module
16
18
17
-
### Supported Feeds
19
+
You can query price data directly from Injective's native [oracle module](/developers-native/injective/oracle/index),
20
+
which aggregates feeds from multiple providers including Band, Coinbase, and Pyth.
21
+
22
+
The [injective-price-oracle](https://github.com/InjectiveLabs/injective-price-oracle) repository
23
+
provides a reference implementation for querying the native oracle module programmatically.
24
+
This approach is well-suited for applications that need access to Injective-native price feeds without relying on third-party EVM contracts.
25
+
26
+
For full details on the oracle module's state, messages, and supported providers,
27
+
see the [oracle module documentation](/developers-native/injective/oracle/index).
28
+
29
+
## Approach 2: Off-chain price feeds with Pyth
30
+
31
+
If your application fetches prices off-chain (for example, in a backend service or bot),
32
+
you can query Pyth's HTTP API directly without any on-chain interaction.
33
+
34
+
Refer to the Pyth documentation on [fetching price updates](https://docs.pyth.network/price-feeds/core/fetch-price-updates)
35
+
for details on available endpoints, request formats, and response schemas.
36
+
37
+
This approach is ideal for off-chain trading systems, analytics dashboards,
38
+
or any service that requires price data without submitting transactions.
39
+
40
+
## Approach 3: On-chain price feeds with Pyth (EVM)
41
+
42
+
For smart contracts that need to read prices on-chain, you can interact with the Pyth contract deployed on Injective's EVM.
43
+
This uses Pyth's pull-based oracle model, where price updates are fetched off-chain and submitted on-chain before reading.
44
+
45
+
### Contract addresses
46
+
47
+
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