On dYdX, we use three different prices:
Mid Market Price
The Mid Market Price is determined by the orderbook and is simply the mid point or average between the lowest ask (sell price) and highest bid (buy price) on the orderbook.
Index Price
The Index Price is an aggregate price based off price data from multiple exchanges and is used to trigger stop orders. To provide optimal performance, the index price is managed off-chain to ensure minimal delay and slippage in stop order triggering.
Since the index price is aggregated across multiple exchanges, users are protected from events such as flash crashes on any single exchange.
Oracle Price
The Oracle Price is also an aggregate price calculated using multiple on-chain price oracles. Collateralization and liquidations on dYdX are determined using the oracle prices of each asset. You can learn more about the oracles dYdX uses here: http://help.dydx.exchange/en/articles/4797371-price-oracles-on-layer-2
Since the oracle price is also an aggregate price, it offers similar protection from flash crashes as the index price does.
On Perpetuals, the oracle price is stored and updated on Layer 2 so is updated multiple times a second - making it almost instant. Therefore, only the index price is displayed on the product (as it is quickly reflected on the protocol).
You can read more about our authors here.