Assessment reports>Nibiru>Threat Models>Message: MsgOpenPosition

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 either Direction_SHORT or Direction_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's MaxLeverage setting.

  • baseAmtLimit — This is the minimum base asset amount to open a position with; it must not be negative.

Zellic © 2024Back to top ↑