osmosis icon indicating copy to clipboard operation
osmosis copied to clipboard

query[CL]: UnderlyingPostionsValue

Open czarcas7ic opened this issue 1 year ago • 2 comments

Background

See the following comment for context https://github.com/osmosis-labs/osmosis/pull/6623#discussion_r1344814214

I added a UnderlyingPostionsValue method to help with some tests, but realized this would be really useful to expose as a query.

Suggested Design

The underlying logic is already completed in the UnderlyingPositionsValue method. One just has to wire this up to a respective query to expose via gRPC.

Acceptance Criteria

localosmosis tested against existing positions and the value returned makes sense. Preferable one in range, one above the current price, and one below the current price.

czarcas7ic avatar Oct 08 '23 19:10 czarcas7ic

hey @czarcas7ic! I have a question on this one: should it be possible to provide a list of positions in CLI when querying [1], or should it only take a single position id as an argument [2]?

[1]: <...> underlying-positions-value 1,2,3 [2]: <...> underlying-positions-value 1

pysel avatar Oct 17 '23 00:10 pysel

@pysel sorry just now seeing this, I think either implementation is fine!

czarcas7ic avatar Oct 22 '23 04:10 czarcas7ic