vega icon indicating copy to clipboard operation
vega copied to clipboard

[API]: Filter by multiple parties for accounts websocket stream

Open mattrussell36 opened this issue 1 year ago • 0 comments

API Overview

In order to provide a better experience for multi key users We will build an API to allow multiple partyIds in the websocket query parameters So that we can stream all account updates for a party using multiple keys

Specs

N/A

API request details

Currently you can only provide one party Id to the api/v2/stream/accounts websocket. This means if a party is using multiple keys you can only stream updates for one account at a time (or ALL accounts on the network, not ideal...)

The orders stream already provides this functionality and it would be good to align the accept query parameters and provide similar functionality. This will help frontends provide better experiences for people using multiple keys to trade.

NOTE: There are other websocket streams where we would like this behavior. Might be worth considering doing all together?

  • [ ] Add new partyIds query string parameter to the accounts stream
  • [ ] Support multiple partyIds in Graphql subscription
  • [ ] Optional: Support filtering by marketIds also. This would be nice to have so its aligned with the orders stream.

Filtering requirements (inputs)

  • [ ] partyIds
  • [ ] Optional: marketIds

Sample API output (optional)

Same output but for multiple keys

Additional Details (optional)

  • The orders and trades streams (api/v2/stream/orders) is already set up to accept multiple parties/markets
  • Best if we can add partyIds/marketIds as new fields and deprecate partyId/marketId
  • There are other trading related websocket streams (those concerning party data) where it would also be valuable to provide this functionality. It might be worth doing this all together
    • api/v2/stream/liquidity/provisions
    • api/v2/stream/margin/levels
    • api/v2/stream/positions

mattrussell36 avatar Jan 29 '24 19:01 mattrussell36