> For the complete documentation index, see [llms.txt](https://guide.dem.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.dem.exchange/evm/interacting-with-demex-l1/built-in-oracle-contracts.md).

# Built-in Oracle Contracts

## Overview

Demex EVM has built-in oracle smart contracts allow enable EVM developers to query the same set of oracle data that L1 modules use, without using a third-party like Chainlink or Band Protocol. This means all market data available to the L1 modules is also available to EVM smart contracts.

Each oracle created on Demex L1 automatically deploys a corresponding EVM oracle smart contract that is constantly updated with the latest data from the oracle.

Smart contract authors can make use of the same oracles that power Demex's perp trading and CDP capabilities to develop their own unique dApps such as binary options, gaming, DCA strategies etc.

### Usage

Oracle contracts possess a few simple methods for querying:

1. **Decimals**\
   Returns the the number of decimal places that the data contains. Different contract may implement a different number of decimals and incorrect conversion will result in erroneous data.
2. **Creator**\
   Users should verify that the contract deployed by Demex's Oracle module by checking the creator's address originate from Demex Core's Oracle Module. List of modules address are listed [here](https://api.carbon.network/carbon/evmcontract/v1/modules).
3. **GetLatestData**\
   Returns the latest results from the oracle which contains the latest price and the the timestamp of the data. The price data contains a specified number of decimals and need to be appropriately converted for usage.
4. **GetLastUpdateTime**\
   Returns the unix timestamp of which the contract was last updated. This method allows the callers of the contract to ensure that the contract is still lively and active.

{% hint style="info" %}
Developers should always verify the validity of the oracle results using the above methods and timestamps provided.
{% endhint %}

### Smart Contract Addresses

The list of available oracles and their corresponding built-in smart contract addresses can be found [here](https://api.carbon.network/carbon/oracle/v1/contracts).

The last result and parameters of the oracle can also be queried using the following API endpoint:

<https://api.carbon.network/carbon/oracle/v1/contract\\_params/\\><OracleID>

e.g.: <https://api.carbon.network/carbon/oracle/v1/contract_params/.CLDO>


---

# 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://guide.dem.exchange/evm/interacting-with-demex-l1/built-in-oracle-contracts.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.
