Message: MsgClosePosition
The MsgClosePosition
handler is responsible for closing an existing position and returning any remaining margin back to the user, or it realizes any bad debt if there is any.
The only parameter that is controllable by the user is the pair
, which is checked to ensure that it is valid and that there is an open position, a market, and an AMM for the pair.