API Reference

Open a new position. this function is equivalent to placing a market order.

function openPosition(address amm, uint8 side, uint quote, uint leverage, uint baseLimit) external;

params

  • amm amm address
  • side 0 (long), 1 (short)
  • quote margin amount (wei), (1 eth = 1000000000000000000 wei)
  • leverage leverage (wei)
  • baseLimit minimum base asset output expected (wei) (used for setting slippage, 0 to bypass slippage check)