Skip to content

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

@erwanor

Description

@erwanor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-refinementunclear, incomplete, or stub issue that needs work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions