# 24/7 Extended-Hours Data Feeds Source: https://docs.chain.link/data-feeds/24-7-extended-hours-data-feeds Some assets only trade during specific [market hours](/data-feeds/selecting-data-feeds#market-hours): precious metals and forex markets close on weekends and holidays, and some currencies trade mainly during local hours or are subject to capital controls. To support applications that need continuous price data anyway, Chainlink offers [custom feeds](/data-feeds/selecting-data-feeds#-custom-feeds) that publish 24/7 for certain assets in these categories. These feeds are not a single, uniform product. Each asset class uses a different methodology to produce a continuous price, and each has its own risk profile. Review the section below for the asset class you are integrating, alongside the [Custom Feeds](/data-feeds/selecting-data-feeds#-custom-feeds) section and [risk mitigation](/data-feeds/selecting-data-feeds#risk-mitigation) guidance appropriate for your use case. - [Precious Metals](#precious-metals) - [Forex](#forex) ## Precious Metals 24/7 blended precious metals price feeds publish a precious-metals-linked price both during and outside regular [precious metals market hours](/data-feeds/selecting-data-feeds#market-hours). They use a bespoke methodology rather than a continuously open physical precious metals spot market. ### How it works During [open precious metals market hours](/data-feeds/selecting-data-feeds#market-hours), the feed reports the underlying precious metals spot price (for example, XAU/USD for gold). When the precious metals market is *closed*, the feed starts from the last observed open-market price and adjusts it with a blended signal derived from tokenized precious metals price streams. For example, the current tGLD/USD implementation uses [XAUT/USD](/data-streams/crypto-streams?search=XAUT) and [PAXG/USD](/data-streams/crypto-streams?search=PAXG) streams for the closed-market signal. For each available tokenized precious metals stream, the adapter tracks the token's open-market premium or discount to the spot price with an EMA, uses that value to derive a spot-equivalent tokenized price, averages the valid derived prices, and smooths the resulting deviation from the last spot price with another EMA. The composite price applies configurable weighting and deviation controls before the closed-market adjustment is reflected in the answer. Other blended precious metals feeds may use different tokenized streams or methodology variations. ### Supported feeds The following table shows the available 24/7 blended precious metals feeds. Find these feeds on the [Price Feed Addresses](/data-feeds/price-feeds/addresses) page. ### Risks ## Forex Standard [Forex feeds](/data-feeds/selecting-data-feeds#market-hours) follow the global Forex market schedule (18:00 ET Sunday to 17:00 ET Friday). Some currencies, however, are thinly traded outside their local market hours, subject to capital controls, or otherwise lack a single institutional or interbank rate that is observable at all times. For a subset of these currency pairs, Chainlink offers 24/7 forex feeds that source a crypto-derived exchange rate instead of a traditional interbank or institutional rate. ### How it works A 24/7 crypto-derived forex rate is constructed by observing FX-to-stablecoin-to-FX arbitrage pathways: the implied exchange rate between two currencies, derived from the prices at which each currency trades against stablecoins and other crypto assets across global exchanges, 24 hours a day, 7 days a week. Because this rate is observed through crypto trading venues rather than through a country's official fixing mechanism or regulated banking channels, it is not constrained by capital controls and can be published continuously, including on weekends and local holidays. This also means a 24/7 crypto-derived rate measures a different market than an official, interbank, or institutional reference rate for the same currency pair, and the two can diverge, sometimes significantly. For example, [NCFX's analysis of its 24x7 USDARS rate](https://www.newchangefx.com/post/argentina-s-fifth-dollar-what-ncfx-s-24x7-usdars-rate-reveals) found the crypto-derived rate traded at a persistent premium of roughly 2.6% to 7.9% (averaging near 5%) above the institutional reference rate over a five-month period, with the premium widening or compressing in response to events such as central bank or IMF policy news. A 24/7 forex feed reflects the venue and methodology it is built on, not necessarily the rate you would get through a bank, a regulated exchange, or an official government fixing. ### Supported feeds 24/7 forex feeds are available for select currency pairs, such as [USD / ARS](https://data.chain.link/feeds/ethereum/mainnet/usd-ars). Check the specific feed's page on [data.chain.link](https://data.chain.link/) for its current data source and methodology before integrating it. ### Risks --- # Data Feeds API Reference Source: https://docs.chain.link/data-feeds/api-reference When you use data feeds, retrieve the feeds through the `AggregatorV3Interface` and the proxy address. Optionally, you can call variables and functions in the `AccessControlledOffchainAggregator` contract to get information about the aggregator behind the proxy. ## AggregatorV3Interface Import this interface to your contract and use it to run functions in the proxy contract. Create the interface object by pointing to the proxy address. For example, on Sepolia you could create the interface object in the constructor of your contract using the following example: ```solidity /** * Network: Sepolia * Data Feed: ETH/USD * Address: 0x694AA1769357215DE4FAC081bf1f309aDC325306 */ constructor() { priceFeed = AggregatorV3Interface(0x694AA1769357215DE4FAC081bf1f309aDC325306); } ``` To see examples for how to use this interface, read the [Using Data Feeds](/data-feeds/price-feeds) guide. You can see the code for the [`AggregatorV3Interface` contract](https://github.com/smartcontractkit/chainlink/blob/contracts-v1.3.0/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol) on GitHub. ### Functions in AggregatorV3Interface | Name | Description | | ----------------------------------- | -------------------------------------------------------------------- | | [decimals](#decimals) | The number of decimals in the response. | | [description](#description) | The description of the aggregator that the proxy points to. | | [getRoundData](#getrounddata) | Get data from a specific round. | | [latestRoundData](#latestrounddata) | Get data from the latest round. | | [version](#version) | The version representing the type of aggregator the proxy points to. | #### decimals Get the number of decimals present in the response value. ```solidity function decimals() external view returns (uint8); ``` - `RETURN`: The number of decimals. #### description Get the description of the underlying aggregator that the proxy points to. ```solidity function description() external view returns (string memory); ``` - `RETURN`: The description of the underlying aggregator. #### getRoundData Get data about a specific round, using the `roundId`. ```solidity function getRoundData( uint80 _roundId ) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); ``` **Parameters:** - `_roundId`: The round ID **Return values:** - `roundId`: The round ID - `answer`: The answer for this round - `startedAt`: Timestamp of when the round started - `updatedAt`: Timestamp of when the round was updated - `answeredInRound`: Deprecated - Previously used when answers could take multiple rounds to be computed #### latestRoundData Get the data from the latest round. ```solidity function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ) ``` **Return values:** - `roundId`: The round ID. - `answer`: The data that this specific feed provides. Depending on the feed you selected, this answer provides asset prices, reserves, and other types of data. - `startedAt`: Timestamp of when the round started. - `updatedAt`: Timestamp of when the round was updated. - `answeredInRound`: Deprecated - Previously used when answers could take multiple rounds to be computed #### version The version representing the type of aggregator the proxy points to. ```solidity function version() external view returns (uint256) ``` - `RETURN`: The version number. ## AccessControlledOffchainAggregator This is the contract for the aggregator. You can call functions on the aggregator directly, but it is a best practice to use the [AggregatorV3Interface](#aggregatorv3interface) to run functions on the proxy instead so that changes to the aggregator do not affect your application. Read the aggregator contract only if you need functions that are not available in the proxy. The aggregator contract has several variables and functions that might be useful for your application. Although aggregator contracts are similar for each data feed, some aggregators have different variables. Use the `typeAndVersion()` function on the aggregator to identify what type of aggregator it is and what version it is running. Always check the contract source code and configuration to understand how specific data feeds operate. For example, the [aggregator contract for BTC/USD on Arbitrum](https://arbiscan.io/address/0x942d00008D658dbB40745BBEc89A93c253f9B882#code) is different from the aggregators on other networks. For examples of the contracts that are typically used in aggregator deployments, see the [libocr repository](https://github.com/smartcontractkit/libocr/blob/master/contract/) on GitHub. ### Variables and functions in AccessControlledOffchainAggregator This contract imports `OffchainAggregator` and `SimpleReadAccessController`, which also include their own imports. The variables and functions lists include the publicly accessible items from these imported contracts. A simple way to read the variables or functions is to get the ABI from a blockchain explorer and point the ABI to the aggregator address. To do this in Remix, follow the [Using the ABI with AtAddress](https://remix-ide.readthedocs.io/en/latest/run.html#using-the-abi-with-ataddress) guide in the Remix documentation. As an example, you can find the ABI for the BTC/USD aggregator by viewing the [contract code in Etherscan](https://etherscan.io/address/0xAe74faA92cB67A95ebCAB07358bC222e33A34dA7#code). **Variables:** | Name | Description | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | LINK | The address for the LINK token contract on a specific network. | | billingAccessController | The address for the billingAccessController, which limits access to the [billing configuration](https://github.com/smartcontractkit/libocr/blob/master/contract/OffchainAggregatorBilling.sol) for the aggregator. | | checkEnabled | A boolean that indicates if access is limited to addresses on the internal access list. | | maxAnswer | This value is no longer used on most Data Feeds. Evaluate if your use case for Data Feeds requires a custom circuit breaker and implement it to meet the needs of your application. See the [Risk Mitigation](/data-feeds/selecting-data-feeds#risk-mitigation) page for more information. | | minAnswer | This value is no longer used on most Data Feeds. Evaluate if your use case for Data Feeds requires a custom circuit breaker and implement it to meet the needs of your application. See the [Risk Mitigation](/data-feeds/selecting-data-feeds#risk-mitigation) page for more information. | | owner | The address that owns this aggregator contract. This controls which address can execute specific functions. | **Functions:** | Name | Description | | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [decimals](#decimals-1) | Return the number of digits of precision for the stored answer. Answers are stored in fixed-point format. | | [description](#description-1) | Return a description for this data feed. This is different depending on which feed you select. | | [getAnswer](#getanswer) | Deprecated - Do not use this function. | | [getBilling](#getbilling) | Retrieve the current billing configuration. | | [getRoundData](#getrounddata-1) | Get the full information for a specific aggregator round including the answer and update timestamps. Use this to get the full historical data for a round. | | [getTimestamp](#gettimestamp) | Deprecated - Do not use this function. | | [hasAccess](#hasaccess) | Check if an address has internal access. | | [latestAnswer](#latestanswer) | Return the latest answer for this data feed. No timestamp is included to check data freshness. | | [latestConfigDetails](#latestconfigdetails) | Return information about the current offchain reporting protocol configuration. | | [latestRound](#latestround) | Deprecated - Do not use this function. | | [latestRoundData](#latestrounddata-1) | Get the full information for the most recent round including the answer and update timestamps. | | [latestTimestamp](#latesttimestamp) | Deprecated - Do not use this function. | | [latestTransmissionDetails](#latesttransmissiondetails) | Get information about the most recent answer. | | [linkAvailableForPayment](#linkavailableforpayment) | Get the amount of LINK on this contract that is available to make payments to oracles. This value can be negative if there are outstanding payment obligations. | | [oracleObservationCount](#oracleobservationcount) | Returns the number of observations that oracle is due to be reimbursed for. | | [owedPayment](#owedpayment) | Returns how much LINK an oracle is owed for its observations. | | [requesterAccessController](#requesteraccesscontroller) | Returns the address for the access controller contract. | | [transmitters](#transmitters) | The oracle addresses that can report answers to this aggregator. | | [typeAndVersion](#typeandversion) | Returns the aggregator type and version. Many aggregators are `AccessControlledOffchainAggregator 3.0.0`, but there are other variants in production. The version is for the type of aggregator, and different from the contract `version`. | | [validatorConfig](#validatorconfig) | Returns the address and the gas limit for the validator contract. | | [version](#version-1) | Returns the contract version. This is different from the `typeAndVersion` for the aggregator. | #### decimals Return the number of digits of precision for the stored answer. Answers are stored in fixed-point format. ```solidity function decimals() external view returns (uint8 decimalPlaces); ``` #### description Return a description for this data feed. Usually this is an asset pair for a price feed. ```solidity function description() public view override checkAccess returns (string memory) { return super.description(); } ``` #### getAnswer