0x Order Types

## Trading Terminology * Limit Orders * Stop Limit Orders * Market Orders * Partial Fills
## Limit Orders * An offer to buy or sell an asset at a particular price * Variations * Buy Limit * Sell Limit * Stop Limit * Order executes at a particular price at an unknown time in the future

Buy Limit Order

Sell Limit Order

## Stop Limit Order * Also called stop loss orders * A standing order to sell an asset if the price drops below a certain level * Depends on an established market price. The order cannot execute until the market reaches the specified price
## Limit Orders in 0x * Orders on OpenRelay are limit orders * Buy vs Sell — Not always clear * Orders execute when the price is "good"
## Stop Limit Orders in 0x * Not possible without a trusted intermediary * Order book is off chain * Contracts cannot determine market price * Orders cannot become valid based on a market price
## Market Orders * Fill available limit orders * Order executes now at a price determined by the market
## Two approaches * Buy as much oil as I can get for $500 * Get 10 barrels of oil at the best available price
## Market Orders In 0x * Smart contract calls * `marketSellOrders()` — Taker specifies amount to spend * `marketBuyOrders()` — Taker specifies amount to acquire * Caller must provide a list of acceptable orders
## Partial Fills * Occurs when only part of a limit order is executed * Order of 100 barrels of oil at $60 each * Someone bought 20 barrels of oil for $1200 * Still 80 barrels of oil available at $60 each
## Partial Fills In 0x * 0x Orders are specified in terms of total offer and total demanded * eg. 1000 ZRX for 3 WETH * The 0x Exchange Contract tracks partial fills * Relayers remove filled orders * OpenRelay provides available taker amount in order metadata * Users should check exchange contract before trying to fill limit orders
# Next Time * Two weeks... * OpenRelay order pools