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

Reactive/streaming utilities for viewing a Market in realtime #1

Open
yornaath opened this issue Sep 23, 2022 · 2 comments
Open

Reactive/streaming utilities for viewing a Market in realtime #1

yornaath opened this issue Sep 23, 2022 · 2 comments
Assignees
Labels
discussion feature New feature or request minor Adding functionality in a backwards compatible manor

Comments

@yornaath
Copy link
Collaborator

The sdk should expose easily consumable apis for streaming market data for a singel market in realtime.

Data that should be streamed:

  • Market itself including its status, resolved outcome etc.
  • Asset volumes and current values/price.
  • Pool liquidity volume.
  • Price pool volume.

Options for streaming api:

  • Observables using rxjs.
  • Callbacks.
  • Event emitters.

Personally I am leaning towards using rxjs and possibly exposing a cps/callback style also on top of the stream if the developer prefers that.

@yornaath yornaath added feature New feature or request minor Adding functionality in a backwards compatible manor discussion labels Sep 23, 2022
@yornaath yornaath self-assigned this Sep 23, 2022
@yornaath yornaath added this to the SDK v2.0 alpha-0 milestone Sep 23, 2022
@TvrtkoM
Copy link

TvrtkoM commented Sep 29, 2022

Not sure if this is already planned, but think the sdk api should handle both static data similar as we already have now, but also expose a mechanism to subscribe to market changes etc via callbacks, rxjs observables or similar.

@yornaath
Copy link
Collaborator Author

@TvrtkoM Yes agreed. Im designing it from the ground up with realtime observables in mind. All methods where possible will have both a promise based and observable based version.

Example

const pool = await sdk.model.swaps.getPool({ marketId: 12 })
const pool$ = sdk.model.swaps.getPool.$({ marketId: 12 })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion feature New feature or request minor Adding functionality in a backwards compatible manor
Projects
None yet
Development

No branches or pull requests

2 participants