Basic Oracle
Last updated
Last updated
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 overflowing math as dependency to your project:
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: