Data Delivery Methods
Last updated
Was this helpful?
Last updated
Was this helpful?
UDF delivers data through two models, the pull and push models.
The Pull Model (On-Demand) fetches data only when required, ensuring it is up-to-date and reducing unnecessary updates. This method optimizes for accuracy and cost efficiency since the data is retrieved in real time based on the application’s needs. It eliminates delays caused by maintaining an on-chain state and is ideal for scenarios requiring real-time precision, such as DeFi trades or event-based actions.
On the other hand, for the Push Model (Continuous), data is delivered periodically, irrespective of immediate need, by maintaining an on-chain state. While it ensures that data is consistently available, this approach can introduce delays and inaccuracies due to the cost and technical limitations of frequently updating the on-chain state. As a result, data might lag behind real-world events, making it less suitable for applications that demand immediate, real-time accuracy.
The Push Model requires regular updates, even when the data remains unchanged, which can result in escalating costs as update frequency increases. However, it is well-suited for applications that need consistent updates at set intervals. Additionally, the Push Model becomes more cost-effective than the Pull Model as the number of users grows exponentially, since updates are broadcast universally rather than being fetched individually by each user.
While the Pull Model adopts a more efficient approach, avoiding the cost issues associated with traditional implementations. Unlike the traditional Pull Model, where users explicitly request fresh data on the target chain, triggering off-chain oracle updates and additional on-chain transactions (often resulting in higher network costs), the new UDF Pull Model eliminates these inefficiencies. It utilizes oracle updates that occur continuously and independently of user requests. Users simply fetch the latest data with accompanying proofs, which are already maintained by the oracle's non-stop update mechanism.
When submitting a transaction, users append the latest data and proofs directly to their transaction. During execution, the data proofs are verified on-chain to ensure validity before being used in contract logic. This streamlined approach requires only one user transaction, meaning that we no longer incur additional costs for data delivery, regardless of service demand or the frequency of user-triggered requests.
By shifting the responsibility of bringing data on-chain to the users and leveraging a continuous update mechanism, the UDF Pull Model ensures predictable, scalable, and cost-effective operations. Even with high user activity, this approach prevents exploding network costs, addressing the limitations of traditional Pull implementations while maintaining data reliability and availability.
The Pull Model ensures that data updates are available in real-time, with minimal delay since users fetch and verify upates themselves, making it particularly useful for time-sensitive applications where immediate data updates are crucial, such as trading platforms or live dashboards.
In contrast, the Push Model, may introduce some latency since data is fetched periodically as it requires state maintanance on-chain, an expensive process. While it is generally fast, it is better suited for applications where real-time updates are not as critical.
The Pull Model provides excellent scalability for applications requiring frequent updates. It is best suited for scenarios with lower transaction volumes, where the cost impact of update verification remains minimal.
On the other hand, the Push Model scales efficiently across all scenarios by minimizing redundant updates and maintaining low gas costs. It's particularly advantageous for applications with medium-to-high transaction volumes, where gas usage is a significant concern. Push users simply read the latest data from storage without incurring additional gas charges, making this model a more cost-effective solution for handling high transaction volumes.