Skip to content
First Access Exchange

Chain markets

dYdX v4 trades perpetuals priced by an oracle that validators feed from outside exchanges. A private company has no such price. So every market on First Access is a chain market: a perpetual that the chain's own x/binary module lists, prices and settles. To the order book, the messages and the clients it is still a dYdX perpetual with a clob pair, so dYdX's order types and tools work on it. Ordinary oracle-priced perpetuals can still be listed beside them; none are on the testnet.

The four kinds

A chain market's perpetual carries a chain_market record (PerpetualParams.chain_market) whose kind says what it is. Each kind sits in a liquidity tier reserved for it, which only x/binary can assign.

KindLiquidity tierOracle priceFundingLiquidated
CHAIN_MARKET_KIND_BINARY1,000,000 Binary (100% / 100%)Its own last trade, 0.1¢ to 99.9¢NeverNever: fully backed
CHAIN_MARKET_KIND_PUT1,000,001 Put (100% / 100%)Its own last trade, 1¢ to KNeverNever: fully backed
CHAIN_MARKET_KIND_CALL1,000,002 CallIts mark, which no trade sets (book average near a model value)NeverShort calls, below maintenance
CHAIN_MARKET_KIND_PERP1,000,003 CompanyPerp (50% initial, 30% maintenance)The company index IHourly, voted by the chainBoth sides, below maintenance

Two more chain-priced oracle markets have no order book: an event's implied market cap {BASE}Y{YYMM}CAP-USD (S) and, for the perpetual, the index itself on the perpetual's own oracle market. Validators' price daemons and the Slinky sidecar never price chain-priced markets; only the chain writes them, after each block.

What is the same as dYdX

  • Orders: MsgPlaceOrder and MsgCancelOrder, short-term and long-term, post-only, IOC, reduce-only, client ids and order flags, as upstream (orders).
  • Matching: every validator keeps the book in memory and matches; the proposer puts the fills in its block and every validator checks them.
  • Accounts: an address with numbered subaccounts holding USDC and positions; deposits, withdrawals and transfers with dYdX's x/sending messages.
  • Fees: dYdX's fee tiers (fees); builder codes on every order (builder codes).
  • Liquidation and deleveraging, for the kinds that can be liquidated, with dYdX's engine.

What differs

  • Isolated. Every chain market is an isolated market: a subaccount holding a position in one holds nothing else, and a subaccount rests long-term orders on one chain-market book at a time (accounts).
  • Units. Atomic resolution 0 and quantum conversion exponent 0: one quantum is one contract, and a price in subticks is micro-dollars a contract. The tick is $0.01, and $0.001 on a binary's book (units).
  • Price caps and bands. No order above the market's price cap. Orders and fills on a call or a company perpetual must be within a band around its mark or index.
  • Long-term orders are the price source. S, the call marks and the index read only long-term orders in chain state, never short-term orders, which live only in each validator's memory.
  • Settlement. Binaries and options resolve when their event does; the perpetual settles when the company lists or governance settles it. x/binary pays every holder, at most 500 holders a block across all resolving markets.
  • Order types. Conditional (stop) orders work on every chain market, but each kind triggers on its own trigger price, never on trades: the index on a company perpetual, the event's slow binary price reference on a binary, and its own book average of covered quotes on a call or a put, whose stops wait while the book has no valid average (stop orders). At most 20 untriggered stops a subaccount. TWAP orders are refused.
  • Leverage. MsgUpdateLeverage is refused for every chain market; the company perpetual is 2× by its tier.
  • Governance. Governance can't create, edit or change the status of a chain market's perpetual or book with dYdX's own messages; it uses x/binary's (x/binary reference).

Tickers

MarketTickerExample
Company perpetual (and its index's oracle market){BASE}PERP-USDTESTCOPERP-USD
Company expiry: binary{BASE}Y{YYMM}-USDTESTCOY2711-USD
Company expiry: call at $K B{BASE}Y{YYMM}C{K}-USDTESTCOY2711C50-USD
Company expiry: put at $K B{BASE}Y{YYMM}P{K}-USDTESTCOY2711P50-USD
Company expiry: implied market cap S{BASE}Y{YYMM}CAP-USDTESTCOY2711CAP-USD
Standalone IPO event{BASE}-USD, {BASE}C{K}-USD, {BASE}P{K}-USD, {BASE}CAP-USDACMEC30-USD
Standalone binary marketNAME-USDCOMPANYIPO27-USD

YYMM is the expiry's deadline year and month, in UTC. A company base is 1 to 11 capitals and digits; an event base 1 to 16. No base may be a prefix of another's, whatever their status, so no two tickers can be read as each other's. A strike with cents is written with D for the point: a $42.50B call is C42D5.