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

Expose key AMM economic data via subscription #4648

Closed
Tartuffo opened this issue Feb 23, 2022 · 6 comments · Fixed by #5420
Closed

Expose key AMM economic data via subscription #4648

Tartuffo opened this issue Feb 23, 2022 · 6 comments · Fixed by #5420
Assignees
Labels
AMM Inter-protocol Overarching Inter Protocol
Milestone

Comments

@Tartuffo
Copy link
Contributor

Tartuffo commented Feb 23, 2022

This data can be used in Blockchain Explorers and via sites like The Graph for the community to get key information about the state of the RUN Protocol components.

From our meeting on Feb 22, here is the data we want to expose from the AMM:

  1. All trading pairs, the algo for them
  2. The pool amounts (X, Y, LP)
  3. Trades as they occur
  4. Liquidity change events (add, remove)
  5. Governance parameters, contract terms, fees
@Tartuffo Tartuffo changed the title Expose key RUN Protocol economic data via RPC and notification stream Expose key AMM economic data via RPC and notification stream Feb 23, 2022
@Tartuffo Tartuffo added AMM Inter-protocol Overarching Inter Protocol labels Feb 23, 2022
@Tartuffo Tartuffo added this to the Mainnet 1 milestone Mar 23, 2022
@Chris-Hibbert Chris-Hibbert self-assigned this Apr 11, 2022
@Chris-Hibbert
Copy link
Contributor

AIUI, our theory is to publish states rather than events. My interpretation of that is that we'll have a separate stream of updates for each pool. It will publish the central and secondary balances in the pool and the amount of liquidity outstanding. These will be updated on every trade and liquidity event. A watcher can infer from this stream whether it's a response to a trade or liquidity change.

We could also publish the fee balances, but since that isn't mentioned above, I'll leave it out for now.

I'll add a symbol for the algorithm, which will always be XY=K for now, and may eventually include "STABLE".

Chris-Hibbert added a commit that referenced this issue May 23, 2022
Chris-Hibbert added a commit that referenced this issue May 23, 2022
Chris-Hibbert added a commit that referenced this issue May 23, 2022
Chris-Hibbert added a commit that referenced this issue May 24, 2022
closes: #4648

add notifier and subscription to state
@mergify mergify bot closed this as completed in #5420 May 24, 2022
mergify bot added a commit that referenced this issue May 24, 2022
* feat: public econ stats from AMM

closes: #4648

add notifier and subscription to state

* test: integrate tests with changes from #5377

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
@dckc
Copy link
Member

dckc commented May 24, 2022

Should this stay open until the data are available via RPC?

If not, which issue represents the work to make the AMM data available via RPC?

@dckc
Copy link
Member

dckc commented May 24, 2022

Is it #5386 ? or #4331? should those be on the econ stress test release?

@turadg
Copy link
Member

turadg commented May 24, 2022

Should this stay open until the data are available via RPC?

I think we agreed to decouple reading and writing, trusting in the Subscriptions abstraction. So the tickets for pushing the data to a subscription on the public facet aren't concerned with how it gets read.

If not, which issue represents the work to make the AMM data available via RPC?
Is it #5386 ? or #4331? should those be on the econ stress test release?

I don't know yet how the econ testers will get the data. However it is, yes it should be included as a release dependency. cc @Tartuffo

@Tartuffo
Copy link
Contributor Author

Tartuffo commented May 24, 2022 via email

@dckc
Copy link
Member

dckc commented May 25, 2022

So the tickets for pushing the data to a subscription on the public facet aren't concerned with how it gets read.

Well, the title of this issue says "via RPC" in so many words. If that's no longer the scope, let's change it.

@turadg turadg changed the title Expose key AMM economic data via RPC and notification stream Expose key AMM economic data via subscription May 25, 2022
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants