dotMarket
Docs
Trade Terminal
Oracle System

The Oracle System: Pyth Network Integration

How DotMarket leverages the Pyth Network to ensure sub-second, highly reliable, and cryptographically secure price updates for the 1-minute BTC market.

In a decentralized prediction market, the platform is only as trustworthy and accurate as the data it uses to resolve outcomes. For DotMarket to operate a fair and precise 1-minute BTC prediction cycle, it requires a price feed capable of delivering extreme accuracy, sub-second latency, and absolute cryptographic security. To achieve this, DotMarket integrates exclusively with the Pyth Network as its primary oracle system.

This document details how the Pyth Oracle operates, how DotMarket fetches and verifies price updates, and the robust reliability and fallback mechanisms built into the protocol.

The Oracle Problem and the Pyth Solution

Traditional blockchain oracles operate on a "push" model. In these legacy systems, the oracle network periodically pushes a new price update to the blockchain—often only when the price deviates by a certain percentage (e.g., 0.5%) or when a long time interval has passed (e.g., 10 minutes).

For a 1-minute market like DotMarket, this legacy approach is completely non-viable. If the price of Bitcoin moves by a tiny fraction of a percent during a 60-second Live phase, a traditional oracle might not push an update at all, making it impossible to determine a winner.

Pyth Network solves this through a "pull" model (also known as on-demand updates). Pyth publishers—which include tier-1 exchanges, market makers, and institutional trading firms—stream sub-second price updates to the off-chain Pythnet. This data is cryptographically signed and immediately available for anyone to pull onto the destination blockchain exactly when it is needed.

Sub-Second Latency

Pyth Network aggregates price data from over 90 first-party publishers and updates prices at a frequency of 400 milliseconds. This ensures that DotMarket always has access to the most accurate reflection of the global Bitcoin market at the exact second a round locks or settles.

How Price Updates are Fetched

Because Pyth utilizes an on-demand pull architecture, the DotMarket smart contracts cannot automatically fetch the price themselves; blockchains cannot initiate external network requests. Instead, the protocol relies on a decentralized network of automated Keeper bots.

When a 60-second Prediction phase or Live phase ends, the following sequence occurs:

On-Chain Price Verification

When the Keeper bot submits the Pyth payload to the DotMarket smart contract, the contract does not blindly accept the data. It performs rigorous cryptographic checks:

  1. Signature Verification: The contract mathematically verifies the cryptographic signature attached to the payload to ensure it was legitimately generated by the Pyth Network and has not been tampered with in transit.
  2. Timestamp Freshness: The contract checks the timestamp of the Pyth price update. To prevent malicious actors from submitting old prices, DotMarket strictly enforces a freshness threshold. If the price update is more than a few seconds older than the current block timestamp, the contract rejects it.

This dual-layer verification guarantees that both the Entry Price and Settlement Price are perfectly accurate and securely sourced.

Reliability and Anti-Manipulation

The integrity of a prediction market relies heavily on the resistance of its oracle to manipulation. By aggregating data from a massive, diverse set of institutional publishers, Pyth Network provides immense resilience against single-point-of-failure manipulation.

If a malicious actor wanted to manipulate the DotMarket Settlement Price, they would have to simultaneously compromise dozens of major centralized and decentralized exchanges globally—a virtually impossible feat. Furthermore, Pyth utilizes a robust confidence interval system that detects and weights against outlier data points. If one exchange experiences a sudden, isolated flash crash, the Pyth aggregation algorithm minimizes its impact on the final consensus price.

Market Volatility

While the Oracle is secure against malicious manipulation, extreme natural market volatility can cause slippage across global exchanges. Pyth faithfully reports this aggregate volatility, and predictors should be aware that high volatility can lead to unpredictable 1-minute outcomes.

Fallback Mechanisms and Pauses

Although Pyth is highly robust, DotMarket is designed with fail-safes to protect users in the event of an extreme catastrophic failure, such as a complete Pyth Network outage or a massive desynchronization of the Arc Testnet.

If the decentralized Keeper network is unable to fetch a valid, fresh price from Pyth for a prolonged period (e.g., passing a hardcoded safety threshold of several minutes past the expected settlement time), the DotMarket contract automatically enters a Fallback State.

During a Fallback State:

  1. No new prediction rounds can be created.
  2. The current Live round and any pending Prediction rounds are immediately aborted.
  3. All funds currently locked in the contract for those active rounds are marked for a 100% refund.
  4. Users can manually withdraw their initial prediction amounts without penalty.

This fallback mechanism ensures that user funds are never permanently locked due to oracle failure.

No. The Keeper bot only transports the data. The Pyth price payload is cryptographically signed by the Pyth Network itself. If a Keeper attempted to alter the price value, the cryptographic signature would instantly invalidate, and the DotMarket smart contract would reject the transaction.

While Chainlink is an exceptional oracle for many DeFi applications, its traditional push-model feeds are not optimized for the strict 1-minute, high-frequency settlement required by DotMarket. Pyth's on-demand, sub-second pull architecture is the perfect technical fit for our specific protocol design.

Understanding the Oracle system is vital to trusting the outcomes of your predictions. With Pyth Network securing the price feeds, DotMarket ensures absolute fairness. To learn more about how the smart contracts themselves are secured, review our Security documentation.