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.
| Kind | Liquidity tier | Oracle price | Funding | Liquidated |
|---|---|---|---|---|
CHAIN_MARKET_KIND_BINARY | 1,000,000 Binary (100% / 100%) | Its own last trade, 0.1¢ to 99.9¢ | Never | Never: fully backed |
CHAIN_MARKET_KIND_PUT | 1,000,001 Put (100% / 100%) | Its own last trade, 1¢ to K | Never | Never: fully backed |
CHAIN_MARKET_KIND_CALL | 1,000,002 Call | Its mark, which no trade sets (book average near a model value) | Never | Short calls, below maintenance |
CHAIN_MARKET_KIND_PERP | 1,000,003 CompanyPerp (50% initial, 30% maintenance) | The company index I | Hourly, voted by the chain | Both 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:
MsgPlaceOrderandMsgCancelOrder, 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/sendingmessages. - 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/binarypays 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.
MsgUpdateLeverageis 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
| Market | Ticker | Example |
|---|---|---|
| Company perpetual (and its index's oracle market) | {BASE}PERP-USD | TESTCOPERP-USD |
| Company expiry: binary | {BASE}Y{YYMM}-USD | TESTCOY2711-USD |
| Company expiry: call at $K B | {BASE}Y{YYMM}C{K}-USD | TESTCOY2711C50-USD |
| Company expiry: put at $K B | {BASE}Y{YYMM}P{K}-USD | TESTCOY2711P50-USD |
| Company expiry: implied market cap S | {BASE}Y{YYMM}CAP-USD | TESTCOY2711CAP-USD |
| Standalone IPO event | {BASE}-USD, {BASE}C{K}-USD, {BASE}P{K}-USD, {BASE}CAP-USD | ACMEC30-USD |
| Standalone binary market | NAME-USD | COMPANYIPO27-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.