-
Notifications
You must be signed in to change notification settings - Fork 358
Open
Labels
needs-refinementunclear, incomplete, or stub issue that needs workunclear, incomplete, or stub issue that needs work
Description
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:
- make a
OwnedPositionIdsquery (equipped with protos(view): add a subaccount filter to theOwnedPositionIdsrpc #4992) - iterate over each position across all my subaccounts and query the DEX RPC to fetch the latest position state
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
Labels
needs-refinementunclear, incomplete, or stub issue that needs workunclear, incomplete, or stub issue that needs work