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

Real-time price updates in AMM UI #5019

Closed
samsiegart opened this issue Apr 5, 2022 · 4 comments · Fixed by Agoric/dapp-amm#23
Closed

Real-time price updates in AMM UI #5019

samsiegart opened this issue Apr 5, 2022 · 4 comments · Fixed by Agoric/dapp-amm#23
Assignees
Labels
AMM Inter-protocol Overarching Inter Protocol UI

Comments

@samsiegart
Copy link
Contributor

The AMM needs to be able to update the price of swaps from a notifier in real-time

@samsiegart samsiegart added AMM Inter-protocol Overarching Inter Protocol UI labels Apr 5, 2022
@samsiegart samsiegart added this to the Mainnet 1 milestone Apr 5, 2022
@samsiegart samsiegart self-assigned this Apr 5, 2022
@Tartuffo
Copy link
Contributor

Tartuffo commented May 5, 2022

This does not have to block launch. @samsiegart can you revisit the estimate on this one? Don't we already get state from notifiers, and this is just one more notification to render?

@samsiegart
Copy link
Contributor Author

@Tartuffo Currently the UI gets the price by polling the contract for the total liquidity for each asset in the pool and calculating the exchange rate from that. It only updates when you select different assets. It's my understanding that priceAuthority should be used instead.

Currently there's some bugs/crashes around the aforementioned logic, so I'll need to rewrite that code anyway. The estimate I believe is accurate because of those bugs, and there may be some nuance to iron out around debouncing price updates while the user is changing inputs.

@Tartuffo Tartuffo removed this from the Mainnet 1 milestone May 6, 2022
@dckc
Copy link
Member

dckc commented May 12, 2022

#4648 should provide the relevant notifier

@samsiegart
Copy link
Contributor Author

#4648 should provide the relevant notifier

To be explicit, we need the notifier for The pool amounts (X, Y, LP) to calculate the estimated results of each swap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AMM Inter-protocol Overarching Inter Protocol UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants