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

# Chainlink (chainlink)

> Decentralized oracle network providing price feeds, VRF randomness, automation, and cross-chain interoperability (CCIP).

Decentralized oracle network providing price feeds, VRF randomness, automation, and cross-chain interoperability (CCIP).

| Fact | Value |
| - | - |
| Category | Oracles |
| Family | none |
| Namespace | `Chainlink` on ethereum, arc |
| Chains | ethereum, arc |

## What it offers

* **getLatestPrice**: Read latest price from a Chainlink price feed aggregator

## Notes

* Price feeds return answer in int256 with feed-specific decimals (usually 8 for USD pairs)
* Always check updatedAt timestamp for staleness - stale prices can cause issues
* Feed Registry is Ethereum-only; on L2s, use individual feed addresses directly
* VRF provides verifiable randomness for on-chain applications
* Common feed addresses vary by chain - check Chainlink docs for specific chain deployments

## Its names in a program

On Ethereum, `Chainlink` is a namespace: its contracts need no import.

```ts theme={null}
function main() {
  // Ethereum's ethUsdFeed, `0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419`.
  require(Chainlink.EthUsdFeed != 0);
}
```

## Deployments

| Chain | Contract | Address | In a program |
| - | - | - | - |
| [Ethereum](https://docs.eco.com/sauce-sdk/reference/chains/ethereum.md) | ethUsdFeed | `0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419` | `Chainlink.EthUsdFeed` |
| [Ethereum](https://docs.eco.com/sauce-sdk/reference/chains/ethereum.md) | feedRegistry | `0x47Fb2585D2C56Fe188D0E6ec628a38b74fCeeeDf` | `Chainlink.FeedRegistry` |
| [Ethereum](https://docs.eco.com/sauce-sdk/reference/chains/ethereum.md) | vrfV2Coordinator | `0x271682DEB8C4E0901D1a1550aD2e64D568E69909` | `Chainlink.VrfV2Coordinator` |
| [Arc](https://docs.eco.com/sauce-sdk/reference/chains/arc.md) | ethUsdFeed | `0x50FCDD99D6762D1C170DC6A9111db944AEE6D364` | `Chainlink.EthUsdFeed` |

## ABI

### `AggregatorV3ABI`

`import AggregatorV3ABI from "./protocols/chainlink/AggregatorV3ABI.json";` Speaks for: ethUsdFeed.

* `latestRoundData() view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)`
* `decimals() view returns (uint8)`

### `FeedRegistryABI`

`import FeedRegistryABI from "./protocols/chainlink/FeedRegistryABI.json";` Speaks for: feedRegistry.

* `latestRoundData(address base, address quote) view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)`
* `getFeed(address base, address quote) view returns (address aggregator)`

## Next steps

* [Protocols](https://docs.eco.com/sauce-sdk/reference/protocols.md): the other protocols, by what they do.
* [Protocols and tokens](https://docs.eco.com/sauce/names.md): calling a contract by its namespace, or through its ABI.
* [Glossary](https://docs.eco.com/sauce/glossary.md): the words these pages use, in plain terms.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.