> ## Documentation Index
> Fetch the complete documentation index at: https://www.diadata.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# updates Method

> The [Push Oracle ](/reference/architecture/data-delivery#push-model)model enables contracts to receive real-time updates based on predefined criteria such as fixed intervals, specific price deviations, or a combination of both. This design provides flexibility and efficiency for decentralized applications needing accurate and timely data.

### Usage

The Oracle maintains updates as a mapping, where each key maps to a Data struct containing the latest timestamp and value.

The `updates` mapping is a key-value store where:

* Key: A unique identifier, typically a string, representing the asset or data type (e.g., DIA/USD, BTC/USD).
* Value: A Data struct containing:
  * key: The identifier of the data entry (redundant for reference but useful for integrity checks).
  * timestamp: The timestamp of the latest update.
  * value: The most recent value associated with the key.

Here's an example of a `DIAOracleSample` contract that consumes the `BTC/USD` price feed:

```solidity theme={"system"}
pragma solidity ^0.8.13;

import { PushOracleReceiver } from "@dia-data/contracts-spectra/PushOracleReceiver.sol";

contract DIAOracleSample {

    PushOracleReceiver public diaOracle;
    string public key = "BTC/USD";

    constructor(address _oracle) {
        diaOracle = PushOracleReceiver(payable(_oracle));
    }

    function getPrice()
    external
    view
    returns (
        uint128 timestampOflatestPrice,
        uint128 latestPrice
    ) {
        (timestampOflatestPrice, latestPrice) =
                 diaOracle.updates(key);
    }
}
```

To deploy the contract, provide the oracle address for the destination chain you're reading from. You can find the contract addresses in the [chain-specific guides](/docs/guides/chain-guides-overview).

As an example, if you want to access the oracle on Ethereum Sepolia, you'll pass the Push Oracle address: [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://sepolia.etherscan.io/address/0x9bb71344ed950f9cfd85ee1c7258553b01d95fa0) to the constructor above. You can also change the key to any of the supported assets (e.g. `DIA/USD`).
