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

An oracle design pattern where data is fetched from the oracle network and delivered on-chain only when explicitly requested by a smart contract.
Chainscore © 2026
definition
ORACLE ARCHITECTURE

What is a Pull-Based Oracle?

A pull-based oracle is a decentralized data feed where data is retrieved on-demand by a smart contract, rather than being pushed to it automatically.

A pull-based oracle is a type of blockchain oracle where data is fetched from an external source only when explicitly requested by a smart contract. This on-demand model contrasts with a push-based oracle, which automatically and continuously updates data on-chain. In a pull-based system, the smart contract initiates the data request, typically by emitting an event that an off-chain oracle node or network monitors and fulfills. This architecture shifts the gas cost and timing of the update to the end-user or dApp triggering the request.

The core mechanism involves a two-step process: request and response. First, a user interacts with a dApp, causing the smart contract to emit a log event containing the desired data query. Off-chain oracle nodes, often part of a decentralized network like Chainlink, detect this event. They then retrieve the required data from the specified API or source, validate it, and submit the response in a subsequent transaction back to the requesting contract. This response transaction carries the proof or signature needed for the contract to trust and utilize the data.

Key advantages of the pull-based model include cost efficiency for dApps that don't require constant data updates, as gas is only spent when data is needed. It also offers deterministic finality; the contract's execution pauses until the oracle's verified response is received, ensuring the outcome is based on the freshest available data. However, this introduces latency, as the contract must wait for the off-chain fetch and on-chain confirmation, which can take several block times. This makes it less suitable for high-frequency trading or real-time applications.

Common use cases for pull-based oracles include insurance contracts that need a specific weather datum to settle a claim, NFT dynamic metadata updates triggered by a user action, or decentralized identity verification where credentials are checked only upon login. The model is foundational to Chainlink's Request & Receive cycle and similar designs, providing a secure and reliable method for smart contracts to access any external data or computation in a trust-minimized way, without maintaining persistent on-chain data feeds.

how-it-works
ORACLE MECHANISM

How Does a Pull-Based Oracle Work?

A pull-based oracle is a decentralized oracle design where data is fetched on-demand by a smart contract, rather than being pushed to it automatically.

A pull-based oracle is a decentralized oracle design pattern where data is retrieved from external sources only when explicitly requested by an on-chain smart contract. This is the opposite of a push-based oracle, where data is continuously broadcast to the blockchain. In a pull model, the contract initiates the request, often by emitting an event that off-chain oracle nodes detect. These nodes then fetch, validate, and submit the required data back to the requesting contract in a subsequent transaction, completing the data cycle. This on-demand approach shifts the gas cost and transaction initiation responsibility to the end-user or dApp.

The core technical workflow involves several key steps. First, a user interacts with a dApp, triggering a smart contract function that requires external data. The contract emits a log event specifying the data needed (e.g., a price for ETH/USD). Specialized off-chain actors, known as oracle nodes or relayers, monitor the blockchain for these events. Upon detecting a valid request, a node retrieves the data from its predefined data sources, performs aggregation and validation to ensure accuracy, and then calls a function on the oracle contract to submit the result. The requesting contract finally receives and utilizes the data to execute its core logic.

This architecture offers distinct advantages and trade-offs. A primary benefit is cost efficiency for the oracle service provider, as they only incur gas fees when fulfilling a specific, paid request. It also allows for more flexible and customizable data queries. However, the model introduces latency (the time between request and fulfillment) and places the burden of initiating and paying for the final data-fulfillment transaction on the user or a designated payer. Prominent examples of pull-based oracles include Chainlink's Any API and Request-Response model, where developers fund a subscription contract that pays oracles per request.

key-features
ARCHITECTURE

Key Features of Pull-Based Oracles

Pull-based oracles operate on an on-demand model, where data is fetched from external sources only when a smart contract explicitly requests it. This contrasts with push-based models that broadcast data continuously.

01

On-Demand Data Retrieval

A pull-based oracle is a decentralized data feed where the consumer smart contract initiates the request for external data. This model is also known as a request-response model. The process is:

  • A user or contract calls a function requiring off-chain data.
  • The oracle network detects the request, fetches the data from specified sources.
  • The data is delivered back in a single, final on-chain transaction. This creates a clear, auditable link between request and fulfillment.
02

Gas Efficiency & Cost Control

The requester pays the gas costs for the data delivery transaction, providing direct cost accountability. This is efficient because:

  • Data is only fetched and paid for when needed, avoiding the continuous gas costs of push-based updates.
  • The requester can optimize for cost by batching requests or choosing simpler data types.
  • There are no wasted transactions for data that no contract is currently using.
03

Enhanced Data Freshness

Data is retrieved at the moment it is needed, ensuring high freshness for time-sensitive applications. This is critical for:

  • Perpetual futures and options pricing, where mark prices must reflect the latest market conditions.
  • Dynamic NFT attributes that change based on real-world events.
  • Insurance contracts that need to verify a specific condition (e.g., flight status) at a precise claim time. The data is not subject to staleness from pre-scheduled update cycles.
04

Requester-Pays Model

This architecture inverts the economic model of push oracles. Instead of data providers subsidizing updates, the end-user or dApp bears the cost for the specific data they consume. This aligns incentives, as:

  • Requesters are motivated to optimize their data calls.
  • Oracle nodes are compensated directly for fulfilling discrete jobs.
  • It enables a wider variety of customizable data feeds without requiring upfront subsidies from providers.
05

Architectural Components

A typical pull-based oracle system involves several key components working together:

  • Consumer Contract: The smart contract that initiates the request.
  • Oracle Contract: An on-chain contract that emits an event logging the data request.
  • Off-Chain Oracle Node: Listens for events, retrieves data from APIs, and submits the signed response.
  • Decentralized Oracle Network (DON): A group of independent nodes that provide cryptographically verified data to ensure security and reliability.
06

Primary Use Cases & Examples

Pull-based oracles excel in scenarios requiring specific, verifiable data points on demand. Common applications include:

  • Verifiable Random Function (VRF): Requesting a provably fair random number for NFTs or gaming.
  • Cross-Chain Communication (CCIP): Requesting proof of an event or state from another blockchain.
  • Custom Data Feeds: Fetching niche data (e.g., sports scores, weather) that isn't widely needed for continuous broadcast.
  • Any API Call: Generalizing smart contract access to any authenticated web API.
DATA DELIVERY ARCHITECTURE

Pull-Based vs. Push-Based Oracle Comparison

A comparison of the two fundamental models for how blockchain oracles deliver external data to smart contracts.

FeaturePull-Based OraclePush-Based Oracle

Data Delivery Trigger

On-demand by the consuming contract

Automated by the oracle service

Gas Cost Payer

End user / consuming contract

Oracle service / data provider

Latency (User Perspective)

Variable, includes request time

Predictable, near-instant on arrival

Network Overhead

Lower (no unsolicited broadcasts)

Higher (continuous data pushes)

Ideal Use Case

Infrequent, user-initiated actions

High-frequency, time-sensitive data

Data Freshness Guarantee

At time of request

Maintained per update schedule

Example Protocol / Pattern

Chainlink Any API, MakerDAO Oracles

Chainlink Data Feeds, Pyth Network

Primary Cost Model

Pay-per-query

Subscription / gas subsidy

examples
PULL-BASED ORACLE

Examples & Use Cases

Pull-based oracles are a foundational design pattern where data is fetched on-demand by a smart contract, typically to minimize costs and latency for infrequent updates. Here are key applications and real-world implementations.

02

Insurance Claim Verification

Parametric insurance smart contracts use pull oracles to verify external events triggering payouts. A contract for flight delay insurance would pull data from a trusted aviation API only when a user submits a claim. This ensures the contract pays for data verification solely during the claims process, aligning costs with usage. The oracle fetches and attests to the flight's status from the authoritative source.

03

Cross-Chain Asset Verification

In cross-chain bridges and messaging protocols, a pull-based oracle can be used to verify the state of another blockchain. A contract on the destination chain requests proof that assets were locked or burned on the source chain before minting wrapped tokens. This lazy evaluation model is efficient for bridges with sporadic user activity, as data is only pulled and validated when a user initiates a transfer.

04

Decentralized Identity & Credentials

Systems that verify off-chain credentials or attestations often employ a pull model. A DAO's governance contract might request verification of a member's proof-of-humanity or KYC status from a decentralized identifier (DID) registry only when they attempt to create a proposal. This keeps sensitive data off-chain until the precise moment it's required for a specific contract function.

05

The Request-Response Model

This is the core architectural pattern for pull oracles. The process involves:

  • Request: A user's transaction calls a smart contract, which emits an event with a data query.
  • Fetch: An off-chain oracle node (listening for events) retrieves the data from the API.
  • Response: The node submits a signed transaction back to the contract with the result.
  • Callback: The contract verifies the node's signature and executes its logic with the new data.
06

Trade-Offs: Cost vs. Latency

Pull oracles optimize for cost efficiency over speed. The key trade-offs are:

  • Lower Operational Cost: No need to pay for continuous data pushes.
  • Higher Per-Request Cost & Latency: The user's transaction must wait for the entire request-response cycle (off-chain fetch + on-chain confirmation), adding significant delay (seconds to minutes).
  • Design Complexity: Contracts must manage asynchronous callbacks and state changes, which is more complex than reading a constantly updated on-chain value.
security-considerations
PULL-BASED ORACLE

Security Considerations & Trade-offs

Pull-based oracles shift the responsibility and timing of data retrieval to the protocol itself, creating a distinct security model with inherent advantages and risks compared to push-based systems.

01

On-Demand Data Freshness

Data is fetched only when a transaction requires it, guaranteeing freshness and eliminating stale data risks inherent in periodic updates. This is critical for time-sensitive applications like options expirations or liquidations. However, it introduces latency as the transaction must wait for the data fetch to complete, which can increase gas costs and user wait times.

02

Cost & Incentive Structure

The protocol or end-user pays the gas cost for the data-fetching transaction, creating a transparent and verifiable cost model. This prevents subsidy attacks where an attacker spams updates to drain an oracle's funds. The trade-off is cost predictability for users, as gas fees can fluctuate, and the burden of payment is placed on the transaction initiator.

03

Censorship Resistance

Since any user can initiate the data pull by calling the oracle contract, the system is highly resistant to transaction censorship. No single entity controls the data update flow. The primary risk shifts to block builder (MEV) manipulation, where a malicious validator could reorder or censor the specific data-fetching transaction itself.

04

Verifiability & Trust Assumptions

Every data point's provenance is cryptographically verifiable on-chain, as the fetch transaction and its result are recorded in a block. This reduces trust in intermediary relayers. The core trust assumption moves to the data source's integrity and the security of the underlying blockchain (e.g., its consensus mechanism).

05

Liveness vs. Complexity

The system's liveness depends on users being incentivized to initiate pulls. Protocols must design proper incentives (e.g., fee rewards) to ensure data is available when needed. This adds protocol design complexity compared to a simple, automated push. Failure to attract pullers can result in a denial-of-service scenario for dependent smart contracts.

technical-details-request-lifecycle
PULL-BASED ORACLE

Technical Deep Dive: The Request Lifecycle

This section details the step-by-step process by which a smart contract on a blockchain retrieves external data via a pull-based oracle, a foundational mechanism for decentralized applications requiring off-chain information.

A pull-based oracle is a data-fetching model where a smart contract explicitly initiates a request for off-chain data, which is then delivered in a subsequent transaction. This is in contrast to a push-based oracle, where data is broadcast to the blockchain proactively. The defining characteristic is the on-demand nature of the request, giving smart contracts direct control over when and what data is fetched. This model is often implemented using a two-transaction pattern: one to request and one to deliver the data.

The lifecycle begins when a user or a decentralized application (dApp) calls a function on a consumer smart contract that requires external data, such as a price feed or a random number. This function emits a log event containing the request parameters, including the desired data source (e.g., a specific API endpoint) and a callback function. This event is detected by a network of off-chain oracle nodes or a decentralized oracle network (DON) that monitors the blockchain. These nodes are responsible for fulfilling the request.

Upon detecting the event, the oracle nodes perform the off-chain computation. They fetch the data from the specified external API, aggregate results if multiple sources are used, and apply any necessary formatting or proof mechanisms. Once consensus is reached among the nodes (if applicable), one node submits a callback transaction back to the requesting smart contract. This transaction invokes the predefined callback function, delivering the verified data as a parameter, which the contract logic then uses to execute its core function, such as settling a derivatives contract or minting an NFT.

Key technical considerations in this lifecycle include data authenticity (ensuring the response comes from an authorized oracle), timing (managing the delay between request and response), and gas costs (the user pays for both the request and the callback transactions). Security models like cryptographic proofs (e.g., TLSNotary) or decentralized attestation are often employed to verify that the fetched data is untampered. The design inherently introduces a latency period, making it suitable for non-time-critical applications.

A canonical example is Chainlink's Request & Receive data cycle or the older Oracle contract pattern in Ethereum, where a contract uses the requestData function. Another example is a provably fair gaming dApp that requests a verifiable random number from an oracle only when a player initiates a game round. The pull-based model's primary advantage is gas efficiency for the data provider, as costs are borne by the requester, and flexibility, as contracts can request data at precise moments in their execution flow.

DEBUNKING MYTHS

Common Misconceptions About Pull-Based Oracles

Pull-based oracles, where data is fetched on-demand by the dApp, are often misunderstood. This section clarifies key technical distinctions and corrects prevalent inaccuracies.

Pull-based oracles are not inherently slower; their latency is determined by the user's transaction and the underlying blockchain's confirmation time. In a pull-based model, the data request and delivery are bundled into a single user-initiated transaction. The perceived "slowness" is the blockchain's block time, not the oracle's data retrieval speed. For many use cases like NFT minting or discretionary trades, this on-demand latency is acceptable and often more gas-efficient than paying for constant push-based updates.

ecosystem-usage
PULL-BASED ORACLE

Ecosystem Usage & Protocols

A pull-based oracle is a decentralized data-fetching mechanism where data is retrieved on-demand by the end-user application, rather than being pushed automatically by the oracle network. This section details its core operational model, key protocols, and trade-offs.

01

Core Mechanism: On-Demand Data Retrieval

In a pull-based oracle model, the smart contract (the consumer) explicitly requests data when needed by calling a function on the oracle contract. This triggers a transaction where an oracle node fetches the data, submits it on-chain with a proof, and the consumer contract pays a fee for the service. This contrasts with push-based oracles where data is broadcast at regular intervals.

  • Key Actors: Consumer Contract, Oracle Node, Oracle Contract.
  • Process: Request → Fetch → Submit → Pay.
  • Use Case: Ideal for low-frequency, event-driven updates like settling a prediction market or executing a limit order.
03

Advantages & Design Trade-offs

Pull-based architectures offer distinct benefits and impose specific constraints compared to push-based systems.

Advantages:

  • Cost-Efficiency: Pay only for data when you use it; no cost for unused updates.
  • Freshness: Data is as recent as the request, avoiding staleness for time-sensitive functions.
  • Flexibility: Supports a vast array of custom, one-off data requests.

Trade-offs:

  • Latency: Data is not pre-available; the request-and-fulfill cycle adds delay (seconds to minutes).
  • Complexity: Requires more intricate contract logic to handle asynchronous callbacks.
  • Reliability: Depends on a node being available to fulfill the specific request.
04

Typical Use Cases in DeFi & NFTs

Pull-based oracles are deployed where data needs are irregular, customizable, or cost-sensitive.

  • Dynamic NFT Minting: An NFT's traits are determined by pulling real-world data (e.g., weather, sports scores) at mint time.
  • Insurance Payouts: A parametric insurance contract pulls data from a trusted source (e.g., NOAA for hurricanes) to verify an event and trigger a payout automatically.
  • Custom DeFi Triggers: Executing a limit order or liquidation based on a specific asset reaching a precise price point, requested only when market conditions are near the threshold.
05

Security Model & Decentralization

The security of a pull-based oracle hinges on the decentralization and correctness of its node network.

  • Node Decentralization: Multiple independent nodes are typically tasked with the same request. Consensus mechanisms (like averaging or median selection) are applied to their responses to mitigate single-point failures or manipulation.
  • Cryptographic Proofs: Reputable protocols provide cryptographic proof (e.g., a signature) from the oracle node, allowing the consumer to verify the data's origin.
  • Oracle Reputation: Systems often incorporate reputation frameworks and staked bonds (SLAs) to penalize malicious or unreliable nodes, aligning economic incentives with honest reporting.
06

Comparison: Pull vs. Push Oracles

Understanding the fundamental difference between pull and push models is key to selecting the right oracle design.

AspectPull-Based OraclePush-Based Oracle
Data FlowOn-demand, user-initiated.Scheduled, oracle-initiated.
Cost BearerEnd-user/Consumer contract.Oracle service/dApp treasury.
Data FreshnessFresh at request time.Can be stale between updates.
Best ForIrregular, custom requests.High-frequency, constant data (e.g., asset prices).
ExampleChainlink Any API, custom event.Chainlink Data Feeds, constant price updates.
PULL-BASED ORACLES

Frequently Asked Questions (FAQ)

Common questions about pull-based oracles, a foundational design pattern for fetching external data on-chain.

A pull-based oracle is a decentralized data-fetching mechanism where on-chain data is updated only when a user transaction explicitly requests it. It works by having a user's smart contract call an oracle contract, which triggers a transaction from an off-chain oracle node to fetch the requested data (e.g., a price feed) and submit it back on-chain, completing the original request. This is in contrast to push-based oracles that broadcast data at regular intervals regardless of demand. The process typically involves a request-response model, where the data is cryptographically signed by the oracle node for verification. This design prioritizes cost-efficiency, as data is only paid for and written to the blockchain when needed.

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