> For the complete documentation index, see [llms.txt](https://sinqlarity.gitbook.io/sinqlarity-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sinqlarity.gitbook.io/sinqlarity-docs/contract-details/chainlink-oracle.md).

# CHAINLINK ORACLE

### DESCRIPTION

The Chainlink Price contract enables fetching the price of a currency pair on-chain using the Chainlink oracle. It provides a function getLatestPrice() that retrieves the latest price from the oracle and returns it as an int. The contract uses the AggregatorV3Interface to interact with the Chainlink oracle contract.

### FUNCTIONS

1. **getLatestPrice():** This function retrieves the latest price of a currency pair from the Chainlink oracle. It calls the latestRoundData() function of the AggregatorV3Interface contract and returns the price as an int. The scale depends on the pair, such as ETH/USD, where the scale is 10/8.

### EXTRA PARAMETERS

**Contract Level:** Easy

**Utility Tags:** Chainlink, Oracle, Price Feed, Currency Pair

1. **Address: address(string)**

### USES

1. **Real-time Price Tracking:** The contract can be used to fetch and monitor the latest price of a currency pair on the blockchain. This can be useful in various decentralized applications (dApps), decentralized finance (DeFi) protocols, or any other scenario where on-chain price data is required.
2. **Smart Contract Automation:** The price information obtained from the Chainlink oracle can be used as an input for smart contract automation. For example, it can be used to trigger certain actions or execute conditional logic based on the current price of a specific currency pair.
3. **Financial Calculations:** The retrieved price data can be utilized for financial calculations or conversions within smart contracts. This can be relevant for DeFi protocols, trading platforms, or any application involving value transfers and calculations based on price information.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sinqlarity.gitbook.io/sinqlarity-docs/contract-details/chainlink-oracle.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
