Getting Started
You can use APRO Data Push to connect your smart contracts to asset pricing data. These data feeds aggregate information from many independent APRO node operators. Each price feed has an on-chain address and functions that enable contracts to read real-time pricing data directly from that address.
This section explains the Data Push, where APRO pushes real-time data to your contracts, allowing for immediate access to pricing updates without requiring frequent manual requests. This approach optimizes performance by reducing on-chain calls and enhances efficiency for applications that need continuous updates.
You'll learn how to read Data Feeds and store the value on-chain using Solidity. The code for reading Data Feeds on BitLayer or other EVM-compatible blockchains remains consistent across different chains and data feed types. You can choose various types of feeds depending on your use case, but the request and response format stays the same. However, the answer's decimal length and expected value ranges might differ depending on the feed you are using.
The contract has the following components:
This example contract obtains the latest price answer from the BTC / USD feed on the Bitlayer testnet.