Units: contracts, quantums, subticks
One contract pays $1 per $1B
Every company market, the perpetual and the options alike, is defined in $1 per $1B of market cap. A perpetual quoted at $50.45 values the company at $50.45B; a long of 10 contracts gains $10 for every $1B the company gains. A call at strike $60B quoted at $12.50 costs $12.50 a contract. So a price in dollars a contract is the same number as a market cap in $B, and the docs write both as "$50.45B" or "$50.45".
A binary's Yes share pays $1, so its price is a probability in dollars: $0.62 is 62%, and $0.605 is 60.5%.
On the wire
Every chain market has the same shape, set when x/binary lists it:
| Field | Value | Meaning |
|---|---|---|
atomic_resolution (perpetual) | 0 | one base quantum is one contract |
step_base_quantums (clob pair) | 1 | sizes are whole contracts |
quantum_conversion_exponent (clob pair) | 0 | one subtick is one micro-dollar a contract |
subticks_per_tick (clob pair) | 10,000; 1,000 on a binary's book | the tick is $0.01; $0.001 on a binary's book |
| oracle price exponent | −6 | an oracle price of 1,000,000 is $1 a contract |
So:
- Size (
Order.quantums): contracts. 25 contracts is25. - Price (
Order.subticks,conditional_order_trigger_subticks): micro-dollars a contract, a multiple of the book's tick: 10,000 on a perpetual, call or put, 1,000 on a binary. $50.45 is50450000; a binary at 62¢ is620000, at 60.5¢605000. A binary's prices run from1000(0.1¢) to999000(99.9¢). - Oracle price (
/dydxprotocol/prices/market/{id}): the same number as subticks. The index I at $50B is50000000. - Money (subaccount USDC, fees, payouts): quote quantums, micro-USDC. $100 is
100000000. - Notional = contracts × subticks, in quote quantums, exactly: 10 contracts at $50.45 is
504500000, $504.50. - Probabilities and rates are in ppm (parts per million): the binary's price p as
p_ppm(600,000 is 60%), margin rates, bands and funding rates the same way.
On-chain uint64 and SerializableInt values come back from the REST API as decimal strings.
Strikes and caps
Strikes, price caps and the reference market cap are micro-dollars a contract (micro-$B),
multiples of $0.01. A $50B strike is 50000000. A Yes resolution records the IPO-day market
cap as basic shares outstanding × the closing price, the price in micro-dollars a share: the
chain refuses a cap of 0 or above $100,000B.
Ordinary perpetuals
An ordinary dYdX perpetual (none are listed on the testnet) keeps dYdX's own units: its atomic
resolution, quantum conversion exponent and tick come from its listing. Read them from
/dydxprotocol/perpetuals/perpetual/{id} and /dydxprotocol/clob/clob_pair/{id}, or from the
indexer's atomicResolution, quantumConversionExponent, stepBaseQuantums and
subticksPerTick, as dYdX's clients do.