Message: MsgOpenPosition
The MsgOpenPosition
handler is responsible for creating a new long or short position on a specified pair as well as increasing or decreasing an existing position. The parameters that a user can control are
pair
— This is the pair to open or modify the position on. It is checked to ensure that the format is valid, that an enabled market exists for it, and that there is an AMM for it.dir
— This is the direction the user is taking and must be eitherDirection_SHORT
orDirection_LONG
.quoteAssetAmt
— This is the amount of quote asset to open a position with; it must be greater than zero.leverage
— This is the leverage to open a position with; it must be positive and not greater than the market'sMaxLeverage
setting.baseAmtLimit
— This is the minimum base asset amount to open a position with; it must not be negative.