Alcor
  • Alcor.exchange
  • What is Alcor Exchange?
  • Home Page Overview
    • Swap
      • Swap Charts
      • Add Liquidity
      • Manage Liquidity
    • Markets
      • Market Exchange
        • Order Books
        • Graph
        • Open Orders
        • Placing Trades
    • OTC
    • NFT
    • Wallet
  • Developers API
    • Amm Swap Contract API
      • Formulas
      • Contracts
      • Examples
    • Market creation
      • Open new market
    • Contract actions
    • Contract Tables
    • API
      • Markets API
      • Account
      • WebSocket
      • Node API
    • Public Alcor Data Access
  • Alcor Swap
    • Referral / Custom Market Fee
    • Introduction
    • Swap Page
    • Locking Liquidity
    • Providing liquidity
      • How to Add Liquidity on Alcor Exchange
    • Ranges: Everything you need to know
      • How to set a Range for your Liquidity position
    • Pool Page
    • Liquidity Provider FAQ
    • Concentrated liquidity FAQ
    • AlcorSwap v2 Price Oracles
      • Alcor Price Oracle vs DelphiOracle
      • Expanding Price Availability with RAM Purchase
      • How to Use Alcor Price Oracle
  • Alcor Farms: Unlocking DeFi Opportunities
    • Creating Farm Incentives - Quick Tutorial
    • Project Farms Unique Link
    • Technical details
  • LSW- Liquid Staked WAX
    • How it works
    • Exchange rate
    • Withdrawal process
  • Adding Token Information
    • Token logo
    • USD Price
  • Swap Widget
    • Swap Chart Widget
  • Networks Features
    • WAX
      • Alcor USDT
  • Additional Docs
  • Definitions
  • FAQ
    • Does Alcor Exchange Have Fees?
    • Whats the difference between using Swap, Market Trade, and OTC?
    • What is a liquidity Pool?
  • Social Media/Contact
Powered by GitBook
On this page

Was this helpful?

  1. Alcor Swap
  2. AlcorSwap v2 Price Oracles

How to Use Alcor Price Oracle

In 4 easy steps!

PreviousExpanding Price Availability with RAM PurchaseNextAlcor Farms: Unlocking DeFi Opportunities

Last updated 1 year ago

Was this helpful?

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:

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.

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.

Step 3: Modify and adapt it to work with your DApp's architecture and requirements.

Step 4: Collaborate with the 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.

https://github.com/alcorexchange/alcor-oracle-price
Community