Market Order Execution

Execution of market orders happens in the following manner:

  1. Users call the relevant functions mentioned above and create an increase/decrease position request.

  2. The keeper bot listens to position requests being placed on the contract and executes them.

  3. Keeper calls PriceFeed.setPricesAndExecute function which first updates the price on the pricefeed contract and executes market order in a single transaction. This is done to avoid front-running issues while executing market orders.

Last updated