⭐Order Gateway
Overview
The order gateway has two contracts
DelayedOrderGateway
orderGatewayV2 (used by front end and API)
DelayedOrderGateway is covered here; orderGatewayV2 is limited to use by the Perp v3 frontend and API (no external functions for direct contract interaction).
The order gateways have two key roles:
Route orders to the optimal liquidity source
Prevent trades from front-running the oracle using a 3 second delay
Workflow
Call
createOrder()to generate an order, includingcreatedAtandexecutableAttimestampsWait for
executableAt()timestampCall
executeOrder()withorderIdto execute a tradeCall
cancelOrder()withorderIDto cancel an unexecuted order
Contract
Last updated
Was this helpful?