LogoLogo
WebsiteDIA AppRequest integration
  • DIA Oracles Overview
  • Intro to Lumina
    • How it works
    • Integrated chains
  • Data products & Tools
    • Token price feeds
  • Oracle Builder (Beta)
  • How-to guides
    • Fetch price data
      • Push based oracles
      • Pull based oracles
      • Contract Addresses
    • Run a Feeder
      • Hardware specs
      • Setting up the node
        • Docker compose
        • Docker run
        • Kubernetes
    • Stake DIA
    • Request a custom oracle
  • Reference
    • Architecture
      • Data sourcing
      • Data computation
      • Data delivery
    • Cross-chain Messaging
  • Resources
    • Audits
    • Chain information
    • Nexus Documentation
    • Community & Support
    • T&C
      • Licence Agreement
      • Contributor Covenant Code of Conduct
      • Disclaimer
Powered by GitBook
On this page
  • Spectra
  • Pull Model
  • Push Model
  • Fees
  • Key Benefits:
  1. Reference
  2. Architecture

Data delivery

PreviousData computationNextCross-chain Messaging

Last updated 1 month ago

DIA Lumina achieves full interoperability, delivering oracle data to any blockchain with minimal friction through the Spectra protocol, a message passing layer powering both the push and pull oracle models.

Spectra

An interchain message passing protocol. Spectra is formed by a network of nodes, running a custom instance of Hyperlane, an open interoperability framework. It facilitates secure and rapid transmission of oracle data to any blockchain, without the need for chain-specific integrations.

The Spectra validators observe messages on the mailboxes of the destination and origin chains. The messages are then checked through the ISM (Interchain Security Module) and delivered to these components:

  • RequestOracle (Pull oracle)

  • PushOracleReceiver (Push oracle)

The gas for processing messages are funded by imposing a fee for calling request() on RequestOracle, or handle() on the PushOracleReceiver contracts. The fees are transferred to the ProtocolFeeHook – an instance of Hyperlane's hooks - that are then withdrawn manually to the Spectra gas wallet.

Let's explore how Spectra contributes to the flow of messages in the Push and Pull oracle models and how that translates to the data you receive on the destination chain.

Pull Model

  • User initiates a request to the RequestOracle contract and pays a fee.

  • RequestOracle processes the request on the origin chain (e.g. Ethereum), creates a message containing the request details (destination chain id, OracleRequestRecipient address, exchange pair, ...etc), then dispatches it through the Mailbox.

  • The validators observes the mailbox and picks up the request. once it verifies its validity through the ISM and signs it, the relayer carries out the message delivery to the mailbox of the destination chain (DIA lasernet).

  • Message is picked up by Spectra protocol and sent back to the RequestOracle which then checks for data freshness and adds the value to the updatesmapping.

Push Model

  • Go feeder service initiates a price update based on certain parameters (such as deviation, heartbeat, & refresh frequency) on the origin chain (DIA's lasernet).

  • OracleTrigger processes the update request, reads the latest price from the meta-contract, creates a message, & dispatches it through the Mailbox.

  • The validators observes the mailbox and picks up the update request. once it verifies its validity through the ISM and signs it, the relayer carries out the message delivery to the mailbox of the destination chain.

  • PushOracleReceiver receives the update, validates the message through the ISM, checks for the data freshness, the adds the value to the updatesmapping.

Fees

Cost of updating data on the destination chain is calculated as follows:

uint256 gasUsedPerTx = 97440; // Fixed gas amount
uint256 gasPrice = tx.gasprice; // Current network gas price
uint256 cost = gasUsedPerTx * gasPrice; // Total fee

Key Benefits:

OracleRequestRecipient receives and validates the message through the ISM, and passes it forward to OracleTrigger that fetches the values from the or meta-contract. It then creates a message with the latest price, and dispatches it back to Lasernet's mailbox.

Post-Dispatch
Aggregator