Injective | Documentation
InjectiveGithub
Injective | Documentation
Injective | Documentation
  • About Injective
  • Getting Started
    • Wallet
      • Create a wallet
      • Accounts
      • Staking
      • Governance
      • Auction
    • Token Standards
      • INJ coin
      • Token Factory
      • CW20 Standard
    • Transactions
      • Gas and Fees
  • Guides
    • Create a Wallet
    • Bridge
      • From Ethereum
      • Using Wormhole
      • Using IBC
      • From Solana
    • Launch a Token
    • Launch a Market
    • Denom Metadata
    • Get INJ
  • Toolkits
    • injectived
      • Install injectived
      • Using injectived
      • Commands
    • Injective TS SDK
    • Injective Go SDK
    • Injective Python SDK
    • Injective CW SDK
    • Injective Rust
    • The Graph
  • References
  • Glossary
  • Developers
    • Getting Started
      • Guides
        • Testnet Proposals
        • Convert addresses
        • Calculations
          • Min Price Tick Size
          • Min Quantity Tick Size
        • Testnet Faucet Integration
    • Exchange Developers
      • Build a DEX
      • Provider Oracle
    • Cosmwasm Developers
      • Your First Smart Contract
      • Guides
        • Local Development
        • Mainnet Deployment
        • Whitelisting deployment address
        • Create your Swap Contract
        • Creating UIs
      • Using Injective Queries and Messages
      • CW20 Adapter
      • Injective Test Tube
    • Modules
      • Injective
        • Auction
          • State
          • Messages
          • EndBlock
          • Events
          • Params
          • Errors
        • Exchange
          • Derivative Markets Concepts
          • Spot Markets Concepts
          • Binary Option Markets Concepts
          • Other Concepts
          • State
          • State Transitions
          • Messages
          • Proposals
          • BeginBlock
          • EndBlock
          • Events
          • Params
          • MsgPrivilegedExecuteContract
          • Errors
        • Insurance
          • State
          • State Transitions
          • Messages
          • EndBlock
          • Events
          • Params
          • Improvements
          • Errors
        • OCR
          • Concepts
          • State
          • Messages
          • Proposals
          • BeginBlock
          • Hooks
          • Events
          • Params
          • Errors
        • Oracle
          • State
          • Keeper
          • Messages
          • Proposals
          • Events
          • Improvements
          • Errors
        • Peggy
          • Definitions
          • Workflow
          • State
          • Messages
          • Slashing
          • EndBlock
          • Events
          • Params
          • Relay Semantics
          • Improvements
          • Errors
        • Permissions
          • Concepts
          • State
          • State Transition
          • Errors
        • TokenFactory
          • Concepts
          • State
          • Messages
          • Events
          • Params
          • Errors
        • WasmX
          • Concepts
          • Data
          • Proposals
          • Messages
          • Params
          • Errors
        • Lanes
        • TxFees
      • Core
        • Auth
        • AuthZ
        • Bank
        • Consensus
        • Crisis
        • Distribution
        • Evidence
        • Feegrant
        • Gov
        • Group
        • Mint
        • NFT
        • Params
        • Slashing
        • Staking
        • Upgrade
        • Circuit
        • Genutils
    • dApps Documentation
  • Nodes
    • Getting Started
      • Interact with a node
      • Running a node
        • Setting up the keyring
        • Join a network
        • Cosmovisor
        • Upgrade your node
    • Validators
      • Mainnet
        • Peggo
        • Canonical Chain Upgrades
          • Upgrade to 10002-rc1
          • Upgrade to 10002-rc2
          • Upgrade to 10003-rc1
          • Upgrade to 10004-rc1
          • Upgrade to 10004-rc1-patch
          • Upgrade to 10005-rc1
          • Upgrade to 10006-rc1
          • Upgrade to 10007-rc1
          • Upgrade to 10008 - Camelot
          • Upgrade to 10009
          • Upgrade to v1.10
          • Upgrade to v1.11
          • Upgrade to v1.12.0 - Volan
          • Upgrade to v1.12.1
          • Upgrade to v1.13.0 - Altaris
          • Upgrade to v1.13.2
          • Upgrade to v1.13.3
          • Upgrade to v1.14.0
          • Upgrade to v1.14.1
          • Upgrade to v1.15.0
      • Testnet
        • Testnet Peggo
    • Public Endpoints
    • Premium Endpoints
    • Injective Indexer Setup
  • Traders
    • Getting Started
    • Documentation
    • API Reference
  • Useful Links
    • Injective 101
    • Injective Hub
    • Injective Explorer
    • Chain API Reference
    • Indexer API Reference
    • Testnet Faucet
Powered by GitBook
On this page
  • MsgRelayBandRates
  • MsgRelayCoinbaseMessages
  • MsgRelayPriceFeedPrice
  • MsgRequestBandIBCRates
  • MsgRelayPythPrices
  • MsgRelayStorkPrices
  • MsgRelayProviderPrices
Edit on GitHub
Export as PDF
  1. Developers
  2. Modules
  3. Injective
  4. Oracle

Messages

MsgRelayBandRates

Authorized Band relayers can relay price feed data for multiple symbols with the MsgRelayBandRates message. The registered handler iterates over all the symbols present in the MsgRelayBandRates and creates/updates the BandPriceState for each symbol.

message MsgRelayBandRates {
  string relayer = 1;
  repeated string symbols = 2;
  repeated uint64 rates = 3;
  repeated uint64 resolve_times = 4;
  repeated uint64 requestIDs = 5;
}

This message is expected to fail if the Relayer is not an authorized Band relayer.

MsgRelayCoinbaseMessages

Relayers of Coinbase provider can send price data using MsgRelayCoinbaseMessages message.

Each Coinbase Messages is authenticated by the Signatures provided by the Coinbase oracle address 0xfCEAdAFab14d46e20144F48824d0C09B1a03F2BC, thus allowing anyone to submit the MsgRelayCoinbaseMessages.

message MsgRelayCoinbaseMessages {
  option (gogoproto.equal) = false;
  option (gogoproto.goproto_getters) = false;
  string sender = 1;

  repeated bytes messages = 2;
  repeated bytes signatures = 3;
}

This message is expected to fail if signature verification fails or if the Timestamp submitted is not more recent than the last previously submitted Coinbase price.

MsgRelayPriceFeedPrice

Relayers of PriceFeed provider can send the price feed using MsgRelayPriceFeedPrice message.

// MsgRelayPriceFeedPrice defines a SDK message for setting a price through the pricefeed oracle.
message MsgRelayPriceFeedPrice {
  option (gogoproto.equal) = false;
  option (gogoproto.goproto_getters) = false;
  string sender = 1;

  repeated string base = 2;
  repeated string quote = 3;

  // price defines the price of the oracle base and quote
  repeated string price = 4 [
    (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
    (gogoproto.nullable) = false
  ];
}

This message is expected to fail if the Relayer (Sender) is not an authorized pricefeed relayer for the given Base Quote pair or if the price is greater than 10000000.

MsgRequestBandIBCRates

MsgRequestBandIBCRates is a message to instantly broadcast a request to bandchain.

// MsgRequestBandIBCRates defines a SDK message for requesting data from BandChain using IBC.
message MsgRequestBandIBCRates {
  option (gogoproto.equal) = false;
  option (gogoproto.goproto_getters) = false;

  string sender = 1;
  uint64 request_id = 2;

}

Anyone can broadcast this message and no specific authorization is needed. The handler checks if BandIbcEnabled flag is true and go ahead sending a request.

MsgRelayPythPrices

MsgRelayPythPrices is a message for the Pyth contract relay prices to the oracle module.

// MsgRelayPythPrices defines a SDK message for updating Pyth prices
message MsgRelayPythPrices {
  option (gogoproto.equal) = false;
  option (gogoproto.goproto_getters) = false;

  string sender = 1;
  repeated PriceAttestation price_attestations = 2;
}

message PriceAttestation {
  string product_id = 1;
  bytes price_id = 2;
  int64 price = 3;
  uint64 conf = 4;
  int32 expo = 5;
  int64 ema_price = 6;
  uint64 ema_conf = 7;
  PythStatus status = 8;
  uint32 num_publishers = 9;
  uint32 max_num_publishers = 10;
  int64 attestation_time = 11;
  int64 publish_time = 12;
}

enum PythStatus {
  // The price feed is not currently updating for an unknown reason.
  Unknown = 0;
  // The price feed is updating as expected.
  Trading = 1;
  // The price feed is not currently updating because trading in the product has been halted.
  Halted = 2;
  // The price feed is not currently updating because an auction is setting the price.
  Auction = 3;
}

This message is expected to fail if the Relayer (sender) does not equal the Pyth contract address as defined in the oracle module Params.

MsgRelayStorkPrices

MsgRelayStorkPrices is a message for the Stork contract relay prices to the oracle module.

// MsgRelayStorkPrices defines a SDK message for relaying price message from Stork API.
message MsgRelayStorkPrices {
  option (gogoproto.equal) = false;
  option (gogoproto.goproto_getters) = false;
  option (cosmos.msg.v1.signer) = "sender";

  string sender = 1;
  repeated AssetPair asset_pairs = 2;
}

message AssetPair {
  string asset_id = 1;
  repeated SignedPriceOfAssetPair signed_prices = 2;
}

message SignedPriceOfAssetPair {
  string publisher_key = 1;
  uint64 timestamp = 2;
  string price = 3 [
    (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
    (gogoproto.nullable) = false
  ];
  bytes signature = 4;
}

This message is expected to fail if:

  • the Relayer (sender) is not an authorized oracle publisher or if assetId is not unique amongst the provided asset pairs

  • ECDSA signature verification fails for the SignedPriceOfAssetPair

  • the difference between timestamps exceeds the MaxStorkTimestampIntervalNano (500 milliseconds).

MsgRelayProviderPrices

Relayers of a particular Provider can send the price feed using MsgRelayProviderPrices message.

// MsgRelayProviderPrice defines a SDK message for setting a price through the provider oracle.
message MsgRelayProviderPrices {
  option (amino.name) = "oracle/MsgRelayProviderPrices";
  option (gogoproto.equal) = false;
  option (gogoproto.goproto_getters) = false;
  option (cosmos.msg.v1.signer) = "sender";

  string sender = 1;
  string provider = 2;
  repeated string symbols = 3;
  repeated string prices = 4 [
    (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
    (gogoproto.nullable) = false
  ];
}

This message is expected to fail if the Relayer (Sender) is not an authorized pricefeed relayer for the given Base Quote pair or if the price is greater than 10000000.

PreviousKeeperNextProposals

Last updated 6 months ago