Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Price oracle functionality implementation #14

Open
iorveth opened this issue Oct 3, 2020 · 0 comments
Open

Price oracle functionality implementation #14

iorveth opened this issue Oct 3, 2020 · 0 comments
Assignees

Comments

@iorveth
Copy link
Contributor

iorveth commented Oct 3, 2020

Motivation

  • On-chain price feeds are a critical component for many decentralized financial applications including those similar to derivatives, lending, margin trading, prediction markets and more. Despite closely tracking the real-world price most of the time, current subdex implementation cannot be used safely as a price oracle because the price can move significantly in a short period of time.

Proposal

  • Introduce functionality to store cumulative price data on-chain (variable, which represents a sum of the price for every second in the entire history of the liquidity pair existence)
    This variable can subsequently be used to track accurate time-weighted average prices (TWAPs) across any time interval.
  • Must be fully covered with tests

Use https://uniswap.org/blog/uniswap-v2/#price-oracles for reference

@iorveth iorveth transferred this issue from another repository Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants