> For the complete documentation index, see [llms.txt](https://docs.alcor.exchange/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.alcor.exchange/alcor-swap/alcorswap-v2-price-oracles/how-to-use-alcor-price-oracle.md).

# How to Use Alcor Price Oracle

We've made it even easier for you to get started with the Alcor Price Oracle! You can find the full interface project at this **GitHub repository:** <https://github.com/alcorexchange/alcor-oracle-price>

Here's a step-by-step guide to help you effectively utilize the Alcor Price Oracle:

**Step 1**: Copy the hpp folder from our repository where we've provided a full interface for using the Alcor Price Oracle and paste it into your own project.&#x20;

**Step 2:** Access the Alcor Price Oracle within your cpp project by simply adding the following line of code:

| uint128\_t AlcorPriceOracle::getPriceTwapX64(poolId, twapInterval) |
| ------------------------------------------------------------------ |

Note: Most protocols use a 30-minute running TWAP, but it's essential to understand the trade-offs involved. Longer TWAPs are more tamper-resistant but may provide less accurate data during volatility. Shorter TWAPs offer more accurate data during volatility but may be less tamper-resistant. Consider your project needs and risks when selecting the TWAP length.&#x20;

**Step 3:** Modify and adapt it to work with your DApp's architecture and requirements.&#x20;

**Step 4:** Collaborate with the [**Community**](https://t.me/alcorexchange) We encourage you to join our community and engage with developers who are using the Alcor Price Oracle in their projects. Collaboration and knowledge-sharing are essential for building a stronger WAX Defi ecosystem.

By following these steps and using our provided interface, you can effortlessly integrate the Alcor Price Oracle into your project and leverage accurate and reliable asset prices on the WAX blockchain.

<br>


---

# 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://docs.alcor.exchange/alcor-swap/alcorswap-v2-price-oracles/how-to-use-alcor-price-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.
