USD asset prices on dYdX come from decentralized on-chain oracles, and are used to determine the collateralization of your account. These USD prices are fed to the dYdX smart contracts through price oracles that run on Ethereum.
Each market has a price called the "Oracle Price" that is calculated based on the oracle prices of the assets in the market. Any features that rely on collateralization, such as stop orders and liquidations, are determined using the oracle/index prices and not the mid market price of the orderbook.
dYdX uses different price oracles for different assets:
ETH, BTC Price
For ETH and BTC, dYdX uses the MakerDAO V2 Oracle System that is used by MakerDAO for their stablecoin DAI, and relies on a distributed network of reporters that report the price in USD. The reported prices are taken from the median of several liquid centralized exchanges to ensure they are not prone to manipulation.
For LINK, dYdX uses the ChainLink Oracle System. The reported prices are taken from the median of several liquid centralized exchanges to ensure they are not prone to manipulation.
For DAI, dYdX uses our own price oracle which calculates the USD price of DAI using a combination of Oasis Trade's on-chain orderbook, Uniswap, and the MakerDAO ETH-USD oracle. The oracle also has several protections against price manipulation on Oasis and Uniswap.
For USDC, dYdX uses a price of $1 as USDC is exchangeable 1:1 with USD on Coinbase.