DIA Brings Market Prices to Midnight DeFi
Protofire adapted DIA’s oracle infrastructure for Midnight, giving applications access to asset prices. Eligible projects can also seek funding to cover oracle costs for up to 12 months.
By SongMarketCap
Updated:
A Midnight lending application can now use DIA’s oracle to access asset prices when calculating the value of collateral.
Protofire, the engineering company that built and operates the deployment, reports that the oracle provides 25 price feeds on Midnight. The feeds update at intervals of five to 30 seconds.
What DIA’s Oracle Provides on Midnight
An oracle brings external information into blockchain applications. Price feeds give smart contracts access to market data they can use when executing rules.
In a lending application, for example, a borrower can deposit an asset as collateral. The application needs a price for that asset to calculate its value and assess how much the user can borrow. Updated prices also help the application track the relationship between the loan and its collateral as markets change.
DIA’s deployment provides shared price feeds that Midnight developers can integrate into their applications. Protofire’s case study identifies 25 feeds in the initial deployment but does not list the assets they cover.
The company designed the architecture to support more than 100 feeds without a redesign. That figure describes the system’s intended capacity, while the initial deployment comprises 25 feeds.
How Protofire Adapted the Oracle for Midnight
Midnight uses Compact as its smart contract language and has a different development environment from Ethereum compatible networks. According to Protofire, DIA’s existing oracle infrastructure could not be deployed on Midnight unchanged.
The team rewrote the oracle contract logic in Compact and rebuilt the programs that send prices to the blockchain using the MidnightJS software development kit.
Protofire reports that the programs draw market data from multiple sources, including DIA and Lumina. The deployment also includes monitoring for feeder health, update frequency and differences between prices from the sources.
The software was packaged in containers so additional operators can run the same feeder program. Protofire reports that the project took 61 days from the start of development to the operational feeds.
The company notes that its Compact contracts and Midnight feeder programs are not in its public repositories.
[NEWSBREAK]
Funding Oracle Costs for Midnight Projects
Midnight developers can apply to DIA’s Oracle Grants program, which can cover the deployment and maintenance of oracle feeds for approved projects for up to 12 months. Covered costs include feed updates and the delivery of data onchain.
The program is open to projects working on decentralized finance, stablecoins, tokenized real world assets, gaming and infrastructure. Applicants must have a product running on a test network or mainnet, but they do not need to be existing DIA users.
DIA’s grant program covers several types of oracle products, including token prices, real world asset data, valuations for less liquid assets and verifiable random numbers. The data a project receives depends on its application and integration requirements.
Teams submit a request on the DIA forum describing their project, target network and intended use of the oracle. The proposal then goes to a Snapshot vote, where approval requires more than 50% of votes in favor and at least 10,000 DIA in voting power.
Once approved, a project receives tokens in its wallet to cover the infrastructure costs. For a Midnight team building a lending application, that can include the cost of maintaining the price feed its smart contracts use to value collateral.