Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Glossary

Pull-Based Oracle

A decentralized oracle model where external data is fetched and delivered on-chain only when explicitly requested by a smart contract.
Chainscore © 2026
definition
ORACLE MECHANISM

What is a Pull-Based Oracle?

A pull-based oracle is a decentralized oracle design where data updates are initiated on-demand by a user's smart contract, rather than being pushed automatically.

A pull-based oracle is a decentralized oracle design where data updates are initiated on-demand by a user's smart contract, rather than being pushed automatically. In this model, the oracle network remains passive until a request is made. When a smart contract requires external data to execute its logic—such as a price for a decentralized exchange swap or a random number for an NFT mint—it explicitly calls a function to "pull" the data from the oracle's on-chain contract. This contrasts with a push-based oracle, which continuously broadcasts data updates to subscribed contracts, often incurring gas costs for the oracle provider.

The core mechanism involves a two-step process: request and fulfillment. First, the user's dApp or smart contract submits a request, often including a fee, to the oracle's on-chain oracle contract. This request is typically logged as an event. Second, off-chain oracle nodes monitor the blockchain for these request events. Upon detecting one, they fetch the required data from the specified external API, perform computations or aggregation if needed, and then submit the verified result back to the requesting contract in a subsequent transaction, completing the request. This design shifts the gas cost burden for the final data delivery to the end-user or their application.

Key advantages of the pull-based model include cost efficiency for oracle operators, as they only pay gas when actively fulfilling a request, and reduced on-chain congestion, since data is not broadcast to all contracts unnecessarily. It also offers freshness on demand, ensuring data is as current as possible at the exact moment it's needed. However, it introduces latency (the time between request and fulfillment) and requires the requesting contract to handle asynchronous callbacks. Prominent examples include Chainlink's Any API and VRF (Verifiable Random Function) services, which operate on this pull-based principle, allowing developers to request data or randomness for specific functions.

how-it-works
ORACLE ARCHITECTURE

How a Pull-Based Oracle Works

A pull-based oracle is a decentralized data feed where on-chain applications explicitly request external data on-demand, rather than receiving continuous, unsolicited updates.

In a pull-based oracle model, the smart contract (or dApp) acts as the initiator. When its logic requires external data—such as an asset price, weather result, or sports score—it emits an event or calls a function that constitutes a data request. This request is picked up by a network of off-chain oracle nodes, which fetch, validate, and aggregate the required information from pre-defined external sources. The critical architectural principle is on-demand data retrieval, shifting the gas cost and transaction initiation burden to the end-user or the dApp itself at the moment of need.

The workflow typically follows a request-response pattern. First, a user interacts with a dApp, triggering the need for data. The dApp then sends a request transaction to an oracle smart contract, which logs the request. Off-chain oracle node operators monitor this contract, compete to fulfill the request, and submit their attested data responses back on-chain in a subsequent transaction. A consensus mechanism, like averaging or median selection, is applied to the responses within the oracle contract to derive a single truthful data point that the requesting contract can then consume and act upon.

This architecture contrasts with a push-based oracle, where nodes periodically and proactively push data updates to on-chain contracts. The pull model offers significant advantages in gas efficiency and data freshness. Contracts only pay for data when it is explicitly needed, avoiding the cost of maintaining constantly updated feeds. The data is also fetched at the time of the request, ensuring high timeliness and relevance, which is crucial for applications like decentralized options settlements or dynamic NFT minting that rely on precise, real-time information.

However, the model introduces latency and user experience complexity. The requirement for two blockchain transactions—one to request and one to receive data—creates a delay and requires the user to wait and potentially submit a second transaction to complete the action. This makes it less suitable for high-frequency trading dApps but ideal for less time-sensitive processes like insurance claim adjudication, where a slight delay is acceptable for the benefit of cost savings and data precision.

Prominent examples of pull-based oracle systems include Chainlink's Any API and API3's dAPIs. These frameworks provide the infrastructure for developers to define their own data requests, specify sources and aggregation methods, and have a decentralized network service those requests on-demand. The security model relies on cryptographic proofs and decentralized node operators, ensuring the data delivered is as tamper-resistant and reliable as the underlying blockchain itself.

key-features
ARCHITECTURAL PRINCIPLES

Key Features of Pull-Based Oracles

Pull-based oracles are a decentralized data-fetching model where smart contracts explicitly request off-chain data on-demand, inverting the traditional push-based approach. This design prioritizes security, cost-efficiency, and user control.

01

On-Demand Data Retrieval

In a pull-based oracle system, data is not continuously streamed to the blockchain. Instead, a smart contract initiates a request when it needs specific data, triggering a transaction to fetch it. This contrasts with push oracles, which broadcast data updates automatically, often incurring gas costs for unused data.

  • Example: A lending protocol only requests a user's collateral price when they attempt to borrow, rather than maintaining a constantly updated price feed.
02

User-Pays Model

The transaction cost (gas fee) for fetching and delivering oracle data is borne directly by the end-user or the specific contract function that initiates the request. This creates a clear and efficient cost attribution model.

  • Advantage: Protocols and users only pay for the data they actually consume, eliminating the subsidy costs associated with maintaining universal push feeds.
03

Enhanced Security & Finality

Data is pulled directly into the transaction that requested it, making the oracle's response an atomic part of the transaction's execution. This provides strong cryptographic guarantees that the data was available and verified at the exact block height of the request.

  • Key Benefit: Eliminates the risk of stale data or race conditions that can occur in push-based systems where data updates and contract executions are separate events.
04

Decentralized Execution Layer

The data retrieval and delivery process is performed by a permissionless network of oracle nodes or a decentralized automation network (like a keeper network). These nodes compete to fulfill data requests, with the winning response being delivered on-chain.

  • Mechanism: This creates a trust-minimized and censorship-resistant system for executing off-chain computations and data fetching.
05

Composable Data Feeds

Pull-based oracles enable the creation of custom data feeds tailored to a specific smart contract's needs. Developers can define the exact data source, aggregation method, and update frequency, rather than relying on a one-size-fits-all feed.

  • Use Case: A derivatives contract can request a volume-weighted average price (VWAP) from three specific DEXs over a precise 1-hour window.
examples
PULL-BASED ORACLE

Examples & Implementations

Pull-based oracles are implemented through specific design patterns and protocols. Here are key examples of how they operate and are used in practice.

01

The Request-Response Pattern

This is the core operational model for a pull-based oracle. A smart contract (the requester) emits an on-chain event or stores a request. An off-chain oracle node (the relayer) monitors the blockchain, processes the request by fetching external data, and submits the result back in a subsequent transaction. This decouples the data fetch from the initial contract call, introducing a latency period but allowing for gas cost optimization and customizable data sources.

02

Chainlink Data Feeds (Hybrid Model)

While often cited as a push oracle, Chainlink's decentralized price feeds use a hybrid pull-push mechanism. A network of nodes pulls price data from multiple exchanges off-chain, aggregates it, and periodically pushes the aggregated result on-chain for any contract to consume. The critical 'pull' component is the off-chain data sourcing and consensus, which makes the on-chain data highly reliable and resistant to manipulation.

03

The Tellor Oracle

Tellor is a canonical example of a pure pull-based oracle with a staking and dispute mechanism. Data requests are posted on-chain. Miners (reporters) compete to pull the correct off-chain data, submit it with a Proof-of-Work, and stake TRB tokens. Other participants can dispute incorrect submissions. This creates a cryptoeconomic security model where data accuracy is enforced by financial incentives and penalties, rather than frequent on-chain updates.

04

Optimistic Oracle Pattern

Used by protocols like UMA and Optimism, this pattern assumes data submissions are correct unless challenged. A proposer pulls data and posts it on-chain with a bond. During a dispute window, anyone can challenge the submission by staking a larger bond, triggering a verification process (often via a DAO or decentralized court). This is highly gas-efficient for data that is rarely disputed, such as election results or custom price identifiers.

05

Use Case: Insurance Payouts

Pull oracles are ideal for non-time-sensitive, high-stakes data. For example, a flight delay insurance dApp only needs to know if a specific flight arrived late once, at the time of claim. A user submits a claim, triggering a data request. An oracle node later pulls the flight status from an authoritative API and submits the proof. This avoids the cost of continuously pushing flight data for all possible flights.

06

Use Case: Verifiable Randomness

Protocols like Chainlink VRF utilize a pull-based design for generating randomness. The requesting contract makes a call and provides a seed. An oracle node pulls the request, generates a random number and a cryptographic proof off-chain, then delivers it back. The contract can cryptographically verify that the number was generated correctly and was not known before the request, ensuring fairness for NFTs, gaming, and lotteries.

DATA DELIVERY MECHANISM

Pull-Based vs. Push-Based Oracle

A comparison of the two fundamental architectural patterns for how oracles deliver external data to a blockchain.

FeaturePull-Based OraclePush-Based Oracle

Data Request Initiator

On-chain smart contract

Off-chain oracle node or service

Data Delivery Flow

On-demand, user-initiated

Scheduled or event-triggered

Gas Cost Bearer

End user or requesting contract

Oracle service provider or dApp treasury

Latency

Higher (requires user tx + oracle response)

Lower (data is pre-submitted)

Data Freshness

Stale until requested

Continuously updated per schedule

Use Case Fit

Infrequent, user-specific queries

Frequently updated reference data (e.g., price feeds)

On-Chain Cost Efficiency

Efficient for low-frequency data

Efficient for high-frequency, shared data

Example Protocols

Chainlink Any API, Witnet

Chainlink Data Feeds, Pyth Network

use-cases
PULL-BASED ORACLE

Primary Use Cases

Pull-based oracles, where data is fetched on-demand by smart contracts, are architected for specific, high-value applications that prioritize security and cost-efficiency over low latency.

01

On-Demand Lending & Borrowing

Used for finalizing loan positions and liquidations where price accuracy is critical. The contract pulls the latest price only at the moment of execution (e.g., loan closure, liquidation check), minimizing exposure to stale data and reducing oracle update costs compared to continuous pushes.

  • Example: A user repaying a loan triggers a single, verified price fetch to calculate final collateralization.
02

Insurance Claim Settlement

Ideal for parametric insurance contracts that pay out based on verifiable external events. The payout logic pulls proof (e.g., flight status, weather data) only when a claim is submitted, ensuring the data is fresh and audit-ready for that specific event.

  • Example: A flight delay insurance dApp fetches certified flight arrival data solely when a user files a claim.
03

Sporadic Financial Derivatives

Suits derivatives like options or futures that settle infrequently. Instead of paying for constant price feeds, the settlement function pulls a precise price snapshot from the oracle at expiry, guaranteeing the settlement value is the authentic market price at that exact timestamp.

05

Cross-Chain Asset Bridging

Used in trust-minimized bridges for validating state proofs. The destination chain contract pulls a cryptographic proof from an oracle or relay network to verify an event (like a burn) occurred on the source chain before minting assets. This shifts gas costs to the user's transaction.

06

Enterprise Data Verification

Enables smart contracts to consume authenticated private data. An enterprise's API can be called on-demand (pulled) by an oracle, which returns the data with a verifiable signature. This allows for compliance and KYC checks, supply chain verification, or using proprietary data feeds without maintaining a constant stream.

security-considerations
PULL-BASED ORACLE

Security Considerations

While pull-based oracles offer a fundamental security advantage by eliminating proactive data pushes, their design introduces distinct risks that must be managed by the requesting smart contract.

01

Data Freshness & Timing Attacks

The requesting contract controls when data is fetched, creating a race condition window. If a transaction's execution depends on stale data, an attacker can front-run the update call. Key risks include:

  • Expired Data: Using price data from a block that is no longer valid.
  • MEV Extraction: Bots can sandwich the data pull transaction if the new data triggers a state change with economic value.
  • Solution: Implement time-based validity checks (e.g., require(block.timestamp - updatedAt < MAX_DELAY)) and consider commit-reveal schemes for sensitive operations.
02

Single Point of Failure: The Caller

Security shifts from the oracle to the requesting contract logic. Vulnerabilities in the update function become critical:

  • Access Control: An unprotected updatePrice() function can be called by anyone, potentially with malicious data.
  • Gas Griefing: Attackers may call the function with high gas to force updates at inopportune times, draining contract funds.
  • Solution: Implement robust access control (e.g., OpenZeppelin's Ownable), rate-limiting, and ensure the contract has a perpetual gas budget for essential updates.
03

Source Authenticity & Data Integrity

The contract must cryptographically verify that the data it receives is authentic and untampered. Relying on a single, unsigned off-chain source is a major risk.

  • On-Chain Verification: Use oracle contracts (like Chainlink Data Feeds) that sign data with a decentralized network's private keys. The pull contract verifies these signatures.
  • Data Structure: Ensure the payload includes a timestamp and round ID to prevent replay attacks.
  • Solution: Never parse raw data from an untrusted API directly. Always pull from a consensus-based, cryptographically verifiable on-chain source.
04

Liveness & Incentive Misalignment

A pull-based system requires a willing and incentivized party to pay gas and trigger the update. If no one is incentivized to call the update function, the system stalls (liveness failure).

  • Keeper Networks: Projects like Chainlink Keepers or Gelato provide decentralized services to automate these calls for a fee.
  • Incentive Design: The contract's economic model must ensure updates are profitable for keepers (e.g., via fees or system rewards) and critical for users.
  • Risk: Underfunded contracts or poorly set incentives lead to stale data and a non-functional application.
05

Manipulation of Update Triggers

The conditions that trigger a data pull can be exploited. If updates are based on predictable thresholds (e.g., "update if price moves 5%"), attackers can manipulate the underlying market to trigger or suppress updates.

  • Example: A large trade on a DEX could be used to move the spot price, triggering an oracle update at a manipulated value.
  • Solution: Use time-weighted average prices (TWAPs) or heartbeat updates instead of, or in addition to, deviation-based triggers. This reduces the profitability of short-term manipulation.
06

Comparison: Push vs. Pull Oracle Risks

Understanding the security trade-off between oracle models is crucial.

  • Push-Based Oracle (e.g., traditional data feed): Centralizes risk on the oracle network to update correctly. Risks include transaction ordering dependency and broadcast cost for the oracle.
  • Pull-Based Oracle: Decentralizes the update action but centralizes risk on the caller's logic and incentives. The primary risk shifts from "can the oracle be trusted to push?" to "will the data be pulled on time and verified correctly?"
  • Hybrid Models: Many modern systems use pull-based queries to verifiable on-chain data feeds that are themselves maintained by push-based decentralized networks, combining strengths.
PULL-BASED ORACLE

Frequently Asked Questions

Common questions about the on-demand data retrieval mechanism where smart contracts initiate data requests.

A pull-based oracle is an on-demand data feed mechanism where a smart contract explicitly initiates a request for external data. It works through a multi-step process: 1) A user transaction triggers a request in the smart contract, 2) Off-chain oracle nodes monitor the blockchain for these requests, 3) The nodes fetch the requested data (e.g., a price) from external APIs, 4) The nodes submit the data back to the requesting contract in a subsequent transaction, and 5) The contract's execution proceeds using the newly provided data. This contrasts with push-based oracles, which continuously broadcast data to contracts without a specific request.

ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected Directly to Engineering Team
Pull-Based Oracle: On-Demand Data for Smart Contracts | ChainScore Glossary