Which price oracles will dYdX use?
Asset prices on dYdX come from decentralized on-chain oracles, and are used to determine the collateralization of your account. These prices are fed to the dYdX smart contracts through price oracles that run on Ethereum.
For the Alpha launch, we’re using Chainlink’s oracle network to power secure price feeds for Layer 2. Chainlink has integrated with StarkWare to extend the Chainlink Network’s hyper-reliable oracle functions to high-performance Layer 2 solutions. In a short time, other oracle providers such as MakerDAO may be used for some markets.
dYdX and StarkWare have been working with the Chainlink and Maker Oracle Team on implementing an oracle solution using Stark Signatures. 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.
How do oracles interact with Layer 2?
Prices are verified by oracles using STARK-compatible signatures, allowing prices to be used by smart contracts as soon as they are signed, rather than waiting for a transaction to be mined. This significantly reduces the latency of oracle price updates from minutes on Ethereum’s Layer 1 chain to fractions of a second on StarkWare’s Layer 2 networks.