We’re currently working on two implementations of Band integration. The first one is our existing integration implemented on Equinox, but this approach less secure/decentralized due to the need for a set of relayers. While this is the common approach for Band’s price feed integration for all other projects, there’s a better way to go about this. Thankfully, Band’s next mainnet version enables IBC and allows for the price feed to be fed directly via IBC in a secure and decentralized way. But this does require band to finish their mainnet upgrade and enable IBC.
- New Band price feed providers must first obtain oracle privileges through a governance proposal(
GrantBandOraclePrivilegeProposal) which grants privileges to a list of relayers.
- Once the governance proposal is approved, the specified relayers can publish oracle data by sending
MsgRelayBandRatesrelay messages to Injective Chain.
- Upon receiving the relay message, the oracle module of Injective Chain checks if the relayer account has grant privileges and persists the latest price data in the state.
- It relies on the set of band relayers acting honestly
- Not fully secure/decentralized
- On the current Equinox Staking testnet, the Injective team has been running off chain band relayer with Band Price feeder privilege which fetches and publishes the Band price feed to Injective.
- We’re currently onboarding the Band team to actually be a Band relayer and grant them Band Price feeder privileges on the Injective Mainnet.
- To make a request to the BandChain’s oracle using IBC, Injective Chain must first initialize a communication tunnel with the oracle module on the BandChain.
- Once the connection has been established, a pair of channel identifiers is generated – one for the Injective Chain and one for Band. The channel identifier is used by Injective Chain to route outgoing oracle request packets to Band. Similarly, Band’s oracle module uses the channel identifier when sending back the oracle response.
- The Injective Chain generates an
OracleRequestPacketDatadata packet and relays it to Band.
- Once the request is submitted to Band, randomly chosen validators on Band will attempt to retrieve the information requested from the data sources and then submit the data in a report to the BandChain. For doing so, validators also earn a fee.
- If the number of validators that successfully submit the report exceeds the
minCountspecified in the OracleRequestPacketData, Band then computes and stores an aggregate final value.
- The final result is also directly relayed back to Injective Chain in the form of a
- The Injective Chain decodes PriceFeed data from
OracleResponsePacketDataand persists the latest price data in the state.
- Interoperate with BandChain directly for PriceFeed.
- Fully decentralized.
- Security is tied with the validators/consensus of both chains instead of the relayers between two chains.
- The Injective team is currently implementing consumer side IBC functionalities and integrating PriceFeeds from
Band's Laozi Testnet 2using IBC.
- In the near-mid term we’ll integrate Band pricefeeds on Mainnet through IBC for our derivative markets, as Band is launching a new mainnet version that supports IBC.