Market Order Execution
Execution of market orders happens in the following manner:
Users call the relevant functions mentioned above and create an increase/decrease position request.
The keeper bot listens to position requests being placed on the contract and executes them.
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