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

protos(view): create a new OwnedPositions rpc #4984

Open
erwanor opened this issue Jan 14, 2025 · 2 comments
Open

protos(view): create a new OwnedPositions rpc #4984

erwanor opened this issue Jan 14, 2025 · 2 comments
Labels
needs-refinement unclear, incomplete, or stub issue that needs work

Comments

@erwanor
Copy link
Member

erwanor commented Jan 14, 2025

Is your feature request related to a problem? Please describe.
I am a client, and I would like to query my view service to get a list of positions to inspect or render. Currently, I have to:

Describe the solution you'd like
Instead of making N queries, I would like to make one query to a streaming RPC:

message OwnedPositionsRequest {
  // If present, fetch the latest state for each position.
  bool latest_state = 1;
  // If present, return only positions with this position state.
  core.component.dex.v1.PositionState position_state = 2;
  // If present, return only positions for this trading pair.
  core.component.dex.v1.TradingPair trading_pair = 3;
  // If present, return only positions for this subaccount index.
  core.keys.v1.AddressIndex subaccount = 4;
}

message OwnedPositionsResponse {
  core.component.dex.v1.Position position = 1;
  // The subaccount this position belongs to.
  core.keys.v1.AddressIndex subaccount = 2;
}

Describe alternatives you've considered
I have considered augmenting the OwnedPositionIds RPC but making a new one seems cleaner and simpler. We can mark it as unimplemented in the rust view server.

Additional context
This is useful to improve rendering quality on the dex explorer. Market makers would probably defer to an outside OMS cache or something and not use this RPC.

@github-actions github-actions bot added the needs-refinement unclear, incomplete, or stub issue that needs work label Jan 14, 2025
@conorsch
Copy link
Contributor

What is timeline for this? Asking because I'm removing it from scope for 0.81.1 (#4988) to keep things moving.

@erwanor
Copy link
Member Author

erwanor commented Jan 17, 2025

End of Q1 earliest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-refinement unclear, incomplete, or stub issue that needs work
Projects
None yet
Development

No branches or pull requests

2 participants