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 Oracle

A pull oracle is a decentralized oracle design pattern where external data is fetched and delivered on-chain only when explicitly requested by a smart contract.
Chainscore © 2026
definition
BLOCKCHAIN ORACLE ARCHITECTURE

What is a Pull Oracle?

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

A pull oracle is a decentralized oracle design pattern where off-chain data is retrieved on-demand by a smart contract, rather than being pushed to it automatically. In this model, the smart contract actively initiates a request for external data, typically by emitting an event. Off-chain oracle nodes, often called relayers, monitor the blockchain for these events, fetch the requested data from external sources, and submit the response back to the contract in a subsequent transaction. This creates a two-step, request-response cycle that contrasts with the continuous data streams of push oracles.

The key architectural components of a pull oracle system include the requesting contract, the oracle service (which listens for events), and a response transaction. This design offers significant gas efficiency for dApps that require infrequent data updates, as costs are only incurred when data is actually needed. It also shifts the gas cost burden for the final data delivery to the entity that submits the response, which can be the oracle operator, the dApp itself, or even the end-user. Prominent examples of this pattern include Chainlink's Any API and the Tellorflex oracle protocol.

Security in a pull model is often enforced through cryptographic proofs and economic incentives. Responses are typically accompanied by a signature from the oracle node, which the requesting contract verifies against a known set of authorized signers or a decentralized oracle network. This cryptographic verification ensures data authenticity. Furthermore, oracle nodes are often required to stake collateral, which can be slashed for providing incorrect data, aligning their economic incentives with honest reporting. This security model makes pull oracles highly resilient to manipulation.

The primary use cases for pull oracles are scenarios where data updates are event-driven or user-initiated. Common applications include: - Insurance contracts that need a weather report to process a claim. - Prediction markets that require a specific sports score or election result to resolve. - Dynamic NFTs that change based on real-world events. - Loan contracts that need a price feed to check collateralization ratios only during a liquidation check. For these applications, the cost-effectiveness and precise timing control of the pull model are major advantages.

When comparing pull oracles vs. push oracles, the choice fundamentally depends on data frequency and cost structure. Push oracles (or data feeds) provide continuous, automated updates and are ideal for constantly changing data like cryptocurrency prices, where latency is critical. Pull oracles excel for low-frequency, conditional logic where paying for constant updates is wasteful. A hybrid approach is also possible, where a dApp uses a push oracle for core price feeds but employs a pull mechanism for ancillary, less frequent data requests, optimizing for both performance and cost.

how-it-works
ORACLE MECHANISM

How a Pull Oracle Works

A pull oracle is a decentralized oracle design pattern where data is not pushed onto the blockchain automatically; instead, a smart contract explicitly requests, or 'pulls,' the data on-demand when needed for execution.

In a pull oracle model, the on-chain smart contract holds the responsibility for initiating the data retrieval. When a function requiring external data is called, the contract emits an event or makes a call that signals the need. Off-chain oracle nodes or a decentralized network monitor the blockchain for these events. Upon detection, they fetch the requested data—such as a price feed, weather data, or a random number—from the designated source, generate a cryptographically signed attestation, and submit a transaction back to the blockchain to deliver the data point to the requesting contract. This transaction typically includes a fee to compensate the oracle node for its work and gas costs.

This mechanism contrasts with a push oracle, where data is broadcast to contracts at regular intervals regardless of immediate need. The key advantage of the pull model is cost efficiency; data is only fetched and written on-chain when required, avoiding the continuous gas expenditure of maintaining live updates. It also provides greater determinism for the contract developer, as the data retrieval is an explicit, on-chain step in the transaction flow. However, it introduces latency, as the final contract execution must wait for the oracle's response transaction to be mined, which can require a second, separate transaction from the end-user or a relayer to complete the operation.

A common implementation is the data request-fulfillment pattern. First, a user transaction triggers Contract A, which emits a RequestData event. An oracle service like Chainlink listens for this event, fetches the data off-chain, and calls a fulfill function on Contract A (or a designated callback contract) with the verified data. The contract's state is then updated based on this input. This pattern is fundamental to systems like VRF (Verifiable Random Function) for provably fair randomness, where the request and the randomness delivery are two distinct transactions, ensuring the outcome cannot be known until the oracle responds.

key-features
ARCHITECTURE

Key Features of Pull Oracles

Pull oracles are a decentralized data-fetching architecture where the on-chain contract initiates the request for off-chain data. This design shifts the responsibility and gas costs to the requesting application.

01

On-Demand Data Retrieval

A pull oracle operates on a request-response model. The smart contract (the consumer) explicitly calls a function to fetch data, which triggers an off-chain process. This is in contrast to push oracles, which broadcast data continuously. Key steps include:

  • Contract emits an event with a data request.
  • Off-chain oracle node or relayer listens for the event.
  • Node fetches data from the specified API or source.
  • Node submits the data back to the contract in a subsequent transaction.
02

Gas Cost Responsibility

In a pull model, the end-user or the requesting contract pays the gas fees for the final callback transaction that delivers the data. This makes cost accounting transparent and predictable for the dApp. The oracle service typically only pays for the initial event emission. This contrasts with push models, where the oracle provider must continually pay to update data on-chain.

03

Enhanced Security & Censorship Resistance

Pull architectures can improve security by decentralizing the data delivery step. Anyone can act as a relayer by monitoring for data requests and competing to submit the response. This creates a permissionless network for data delivery, reducing reliance on a single trusted node. Protocols like Chainlink implement this with decentralized oracle networks (DONs) where multiple nodes respond, and the contract aggregates the results.

04

Data Freshness Control

The application has direct control over when data is fetched. The contract requests new data at the precise moment it's needed for logic execution (e.g., finalizing a trade or settling a loan). This eliminates stale data issues that can occur if a push oracle fails to update. The trade-off is higher latency, as the data is not pre-loaded on-chain.

05

Reduced Oracle Operational Overhead

For oracle node operators, the pull model is more efficient. Nodes do not need to maintain constant on-chain transactions for all supported data feeds. They only perform work and incur costs when there is a specific, paid request. This allows oracle networks to support a wider array of data feeds without prohibitive gas costs.

06

Common Implementation: User as Relayer

A simple pull oracle pattern uses the user as the relayer. For example, in a DEX requiring a price check:

  1. User initiates a swap, calling requestSwap().
  2. Contract returns an unsigned transaction with the needed price data field empty.
  3. User fetches the price off-chain (e.g., from an API).
  4. User signs and submits the completed transaction with the price data.
  5. Contract verifies the price is valid (e.g., within a time window) before executing. This pattern is used by protocols like Uniswap v3 for its oracle observations.
ORACLE ARCHITECTURE

Pull Oracle vs. Push Oracle

A comparison of the two fundamental architectural patterns for delivering external data to a blockchain.

FeaturePull Oracle (On-Demand)Push Oracle (Publish-Subscribe)

Data Request Initiator

Smart Contract

Oracle Node / Off-Chain Service

Transaction Flow

User tx triggers contract, which calls oracle function

Oracle service pushes data to contract via scheduled or event-driven tx

Gas Cost Payer

End user (requesting contract)

Oracle service provider or data subscriber

Latency

Higher (waits for next block after request)

Lower (data can be pre-fetched and pushed immediately)

Data Freshness

On-demand, but request-to-update delay

Can be pre-emptive, but depends on push interval

Complexity for Devs

Simpler (call a function)

Higher (manage subscriptions, access control)

Use Case Example

Price check for a specific user trade

Continuous price feed for a lending protocol

Primary Cost Model

Pay-per-call

Subscription or fee-per-update

examples
PULL ORACLE

Examples & Use Cases

Pull oracles are not a single application but a foundational design pattern. These examples illustrate how the on-demand data request model is implemented across different blockchain domains.

02

On-Chain Gaming & NFTs

Dynamic NFTs or blockchain games use pull oracles to fetch external state only when a user performs a specific action. For instance:

  • A weather-dependent NFT artwork pulls local weather data when the owner views it.
  • A game might request a verifiable random number (VRF) from an oracle only at the precise moment a player opens a loot box, ensuring fairness and minimizing gas fees during idle periods.
03

Cross-Chain Asset Verification

In cross-chain bridges or messaging protocols, a light client or relayer on the destination chain acts as a pull oracle. It does not automatically receive all source chain block headers. Instead, it requests and verifies specific Merkle proofs (pulls the data) only when a user initiates a withdrawal or message verification, optimizing for cost and scalability.

04

Enterprise Data Access

Businesses can use pull oracles to gate access to premium data feeds or backend APIs via smart contracts. A user pays a fee to the contract, which then acts as a client to pull a specific data point (e.g., a credit score, KYC result, or IoT sensor reading) from the enterprise's authenticated endpoint. The data is delivered in a single, auditable transaction.

05

Optimized DeFi Liquidations

While most lending protocols use push oracles for real-time price feeds, a pull oracle can optimize specific functions. A liquidation bot, instead of monitoring all positions, could be designed to request the latest collateral price (pull it) only after first detecting a potentially undercollateralized position via an event log. This hybrid approach can reduce overall network load.

06

The Request-Response Pattern

This is the core technical architecture enabling pull oracles. A smart contract emits an event with a data request. Off-chain oracle nodes listen, fetch the data from the source, and send the signed response back in a subsequent transaction. Key components include a request ID for matching, a callback function to receive data, and payment in the form of oracle gas to incentivize the node.

security-considerations
PULL ORACLE

Security Considerations

While Pull Oracles offer a decentralized data-fetching model, they introduce distinct security trade-offs and attack vectors that developers must architect around.

01

Data Freshness & Staleness Attacks

The core risk is stale data. If a user's transaction to pull data is not executed promptly, the smart contract may act on outdated information. Attackers can exploit this by:

  • Front-running the data pull transaction to manipulate market conditions before the update.
  • Delaying execution through network congestion or targeted spam.
  • Causing liquidation or settlement based on incorrect, old prices.
02

User Responsibility & Gas Cost Risk

Security shifts from the oracle provider to the end-user or a designated relayer. This creates risks:

  • Unpaid gas costs: If a user fails to call the update function, the protocol state becomes stale, potentially leading to insolvency.
  • Relayer centralization: Protocols often rely on a single bot or keeper network to pull data, creating a single point of failure. If the relayer goes offline, the system halts.
03

Manipulation of the Pull Trigger

The mechanism that triggers the data pull is a critical attack surface. Considerations include:

  • Permissionless vs. Permissioned Triggers: Who can call the update function? Permissionless is more decentralized but open to spam.
  • Timelocks & Incentives: Implementing time-based or deviation-based triggers can reduce spam but add complexity.
  • Oracle Extractable Value (OEV): The value of being the first to trigger an update with new data, which can be captured by searchers and validators, potentially distorting incentives.
04

Data Source & Verification Integrity

Even with a pull model, the source and verification of data remain paramount.

  • Source Centralization: If the oracle pulls from a single API endpoint, that endpoint becomes a centralized point of failure subject to manipulation or downtime.
  • On-Chain Verification: How does the contract verify the fetched data is correct? Pure pull oracles may lack cryptographic proofs (like zero-knowledge proofs or TLSNotary), relying instead on trust in the reporter's signed message.
05

Comparison: Push Oracle Risks

Contrasting with Push Oracles (like Chainlink Data Feeds) highlights the trade-offs:

  • Push Oracle Risk: Centralized around the oracle node network (e.g., node collusion, sybil attacks). The protocol pays for continuous updates.
  • Pull Oracle Risk: Centralized around update liveness and relayer incentives. The user/relayer pays for updates.
  • Hybrid models (e.g., push with pull fallback) are emerging to balance freshness guarantees with cost efficiency.
06

Mitigation Strategies & Best Practices

Protocols can mitigate pull oracle risks through careful design:

  • Incentivized Relay Networks: Use keeper networks with slashing for liveness failures.
  • Fallback Mechanisms: Implement circuit breakers or grace periods when data is stale.
  • Decentralized Data Sources: Pull from multiple, independent sources and aggregate results on-chain.
  • Explicit Staleness Tolerance: Design contracts to function safely within a known time-to-freshness window.
PULL ORACLES

Common Misconceptions

Pull oracles are a foundational data-fetching mechanism in decentralized systems, but their design is often misunderstood. This section clarifies key technical distinctions and operational realities.

A pull oracle is a decentralized data-fetching mechanism where data is retrieved on-demand by the end-user application, rather than being pushed onto the blockchain by the oracle network. It works by storing a data commitment (like a Merkle root or a cryptographic signature) on-chain, which serves as a verifiable promise that the data exists off-chain. When a smart contract needs the data, it must call a function that pulls the full data payload from an off-chain data provider, using the on-chain commitment to cryptographically verify its authenticity and integrity before use. This model contrasts with push oracles, which proactively write data to the blockchain at regular intervals.

PULL ORACLE

Technical Details

A pull oracle is a decentralized data-fetching mechanism where data is retrieved on-demand by the consuming smart contract, rather than being pushed to it automatically. This section details its core architecture, trade-offs, and implementation patterns.

A pull oracle is a decentralized oracle design pattern where a smart contract explicitly requests and pulls external data into the blockchain only when needed. Unlike a push oracle, which proactively sends data, the pull model operates on-demand. The workflow typically involves:

  1. User Request: A user (or a dApp) initiates an on-chain transaction that calls a function requiring external data.
  2. Data Request Emission: The smart contract emits an event (a log) specifying the required data, such as a price for a specific asset pair.
  3. Off-Chain Listening: A network of oracle nodes monitors the blockchain for these events.
  4. Data Fetching & Signing: The nodes fetch the data from the specified external API, reach consensus on the value, and cryptographically sign it.
  5. Callback Execution: The user (or a designated relayer) submits a second transaction containing the signed data to the contract, which verifies the signatures and uses the data in its logic. Protocols like Chainlink implement this via their Any API and Data Streams products.
PULL ORACLE

Frequently Asked Questions

A pull oracle is a decentralized data feed where data is fetched on-demand by the smart contract, rather than being pushed to it automatically. This section answers common questions about its mechanism, security, and use cases.

A pull oracle is a decentralized oracle design pattern where a smart contract actively requests, or 'pulls,' external data on-demand, rather than receiving it via a continuous push mechanism. The workflow involves a user or contract initiating a transaction that calls a function requiring external data. This triggers a request to an off-chain oracle network, which fetches the data, returns it on-chain, and the requesting contract's transaction completes using that verified data. This model contrasts with push oracles, which automatically and periodically update on-chain data feeds. Key protocols utilizing pull models include Chainlink's Any API and API3's dAPIs, where data is fetched only when needed for a specific contract execution.

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