IPO and governance settlement
A company perpetual ends in one of two ways:
- IPO settlement: the company lists, and the perpetual settles at u = the IPO-day closing market cap (basic shares outstanding × first-day close, in $B);
- governance settlement: an acquisition, a withdrawn IPO, or a company that will never list, and governance settles at a value it sets, or at the index.
Either way every position closes at u, and the money moves against M, the index I at the moment the perpetual halted.
The IPO halt
The IPO is when one of the company's expiries is halted before its deadline: its admin halts it once the company has listed and closed its first day. In the same transaction the chain:
- halts the perpetual, recording M = its oracle price (I) at the halt;
- halts every trading expiry of the company. Those with a later deadline will resolve with this one; one already past its deadline that the ladder hasn't halted yet is halted too, for its admin to resolve No;
- sets the company
COMPANY_STATUS_HALTED_IPO: I is frozen and the ladder stops.
From then on: no trading, no liquidation or deleveraging, funding 0, and no withdrawals, transfers or deposits for a subaccount holding the perpetual until its position is settled, so every holder's value at M stays fixed while the payout runs. A halt can't be undone; it commits the whole company.
An expiry halted at or after its deadline (the ladder's auto-halt, or by hand) triggers nothing.
The Yes resolution
When that expiry, or any expiry halted with it whose deadline is after the halt, resolves
Yes with the IPO-day shares and close, the other halted expiries with a deadline after the
halt resolve Yes with the same numbers, the company goes COMPANY_STATUS_SETTLING, and the
perpetual settles at u. An expiry whose deadline had passed at the halt is not resolved Yes
with them.
- Governance may resolve from the block after the halt.
- The admin may resolve Yes only once x/gov's expedited voting period plus an hour has passed since the halt, or the template's resolve delay if that is longer. That is time for governance to replace a stolen admin key, or settle the perpetual first. On the testnet the expedited voting period is 60 s, so the admin waits 3,660 s unless the template's delay is longer.
- The admin's band. The admin's Yes settles the perpetual only with u within
[M / 3, 3 × M] (
admin_settle_band_ppm, default 3×, from 1× to 100×). Outside it the expiries still resolve and pay out, but the perpetual stays halted, its holders' withdrawals blocked, and the company goesCOMPANY_STATUS_PENDING_GOVERNANCE(company_settlement_needs_governance, with the admin's value) until governance settles it.
Nothing else is triggered by a No resolution. An IPO halt followed by No (an early halt on a rumour, then No after that expiry's deadline) leaves the perpetual halted at M: it settles when a later expiry of the set resolves Yes, or when governance settles it.
Governance settlement
Governance settles the perpetual with MsgSettleCompanyPerp at u = a value it sets (the
deal's equity value, say) or the index I (use_index_value), with a reason (1 to 280
characters) and a source URL.
- If the perpetual still trades, the chain halts it in that block (M = I then), sets the
company
COMPANY_STATUS_SETTLING, and pays out from a later block. The withdrawal block applies. - A perpetual already halted for an IPO pays out against the M of its halt.
- The ladder stops; expiries already listed trade on and resolve as usual.
- Settling at the index with the book active gives u = M: every position closes at I and nothing is paid between the sides. A mistaken or stolen-key IPO halt is unwound this way.
- If a governance settlement executed in the IPO halt's own block hasn't started paying out
when an IPO Yes arrives (in the next block), the IPO close replaces it
(
company_settlement_replaced). Once the governance payout has started, a Yes resolves the sibling expiries only.
Settling against M
Every holder's position closes at u. The money moves in two passes, against M rather than against each holder's entry, so that the side that gained since the halt is the side that receives:
- each holder is valued at v = its USDC, funding settled, + n·M (n signed: + long, − short): what it would have if closed at M;
- w = |u − M| a contract. The payers are the longs if u < M (a gap down), the shorts if u > M (a gap up).
- Payers first. Each owes |n|·w, pays min(owed, v), and closes: its USDC changes by n·M − paid. What it couldn't pay is the shortfall.
- Payees second. What the payers paid is shared pro rata by contracts, rounded so it adds
up exactly; each closes with n·M + its share. If payers fell short, each payee takes the
same haircut (shortfall ÷ owed) and the chain emits
settlement_haircut.
With no shortfall, every holder ends with exactly its USDC + n·u (plus funding): the same as closing at u.
Covers come from this perpetual's insurance funds only: the perpetual's own fund, then
the cross insurance fund, never the cross collateral pool. What they can't cover is withheld
from this perpetual's own holders, pro rata by contracts on the side that bears it
(settled_withheld). Each side is scanned first (a bounded batch a block), then paid. Payouts
share x/binary's budget of 500 holders a block. The market is marked resolved only once the
shares settled on each side equal the open interest at the halt and the payout identities
hold.
Worked example
Four holders, M = $50B at the halt, all opened near 2×, funding left out:
| Holder | Position | Entry | Deposit | USDC at the halt | v = USDC + n·M |
|---|---|---|---|---|---|
| A | long 10 | $48 | $250 | −$230 | $270 |
| D | long 4 | $52 | $110 | −$98 | $102 |
| B | short 10 | $48 | $250 | $730 | $230 |
| C | short 4 | $52 | $110 | $318 | $118 |
Gap up, u = $70B (w = $20, the shorts pay):
| Holder | Owes / is owed | Pays / gets | USDC after | Check: deposit + PnL at u |
|---|---|---|---|---|
| B | owes 10 × 20 = $200 | pays $200 | 730 − 500 − 200 = $30 | 250 − 10 × 22 = $30 |
| C | owes 4 × 20 = $80 | pays $80 | 318 − 200 − 80 = $38 | 110 − 4 × 18 = $38 |
| A | is owed $200 | gets 280 × 10/14 = $200 | −230 + 500 + 200 = $470 | 250 + 10 × 22 = $470 |
| D | is owed $80 | gets 280 × 4/14 = $80 | −98 + 200 + 80 = $182 | 110 + 4 × 18 = $182 |
Gap up with a haircut, u = $80B (w = $30, the shorts pay): B owes $300 and has v = $230, pays $230 and ends at $0; C owes $120 with v = $118, pays $118, ends at $0. Collected $348 of $420 owed: a 17.14% haircut. A gets 348 × 10/14 = $248.57 instead of $300; D gets $99.43 instead of $120.
At 2× a company has to gap about 50% at its IPO, from the index at the halt, before a holder at the limit is wiped out; anything beyond is a haircut on the other side. Price caps, the open interest cap and the insurance funds bound it; there is no other backstop.
Reading it
The perpetual's settlement is in its binary-market record,
GET /dydxprotocol/binary/market/{perpetual_id}: settle_reference_price (M), final_value
(u), payers_long, payout_per_share (w), settled_paid, settled_shortfall,
settled_payee_pool, settled_withheld, status (MARKET_STATUS_HALTED, _RESOLVING, then
_RESOLVED_YES). The company record (/dydxprotocol/binary/company/{id}) carries the status,
ipo_event_id, final_value, settled_by, settle_reason and source_url.