Liquidswap Docs
GithubDappPontem Network
Liquidswap V0 Docs
Liquidswap V0 Docs
  • Introduction
    • Security Audits
    • Bounty Program
    • Developer Links
  • Protocol Overview
  • Smart Contracts
    • Generics
    • LP Coins
    • Routers
    • Scripts
    • Advanced Topics
    • 💥V0.5 Update
  • Integration
    • Test Coins
    • Let's Swap
    • Create Pool
    • Add Liquidity
    • Burn Liquidity
    • Basic Oracle
    • Flashloans
    • Unit Testing
  • Staking / Harvest
    • Overview
    • Smart Contracts
    • Integration Examples
    • DApp
    • Create your own farming pool
  • SDKs
  • Liquidswap Widget
  • Liquidswap DApp
    • Bridge
    • Testnet
  • Coins Registry
Powered by GitBook
On this page
  1. Integration

Basic Oracle

PreviousBurn LiquidityNextFlashloans

Last updated 2 years ago

As Liquidswap accumulates cumulative prices for each pair at the start of each block, in case liquidity operation happens on the pool, developers can build their oracle with it.

First of all, add as dependency to your project:

[dependencies.OverflowingMath]
git = "https://github.com/pontem-network/overflowing-math.git"
rev = "v0.1.0"

It's important to use overflowing math when works with cumulative prices of Liquidswap, as cumulative prices can overflow and it's ok.

The basic example of oracle would be the following contract:

overflowing math