gimbal chain 99901 · Elysium
01 · What it is

A vault that publishes a two-sided market around a mid it keeps in its own storage.

It holds HYPE and one quoted ERC-20. No oracle, no pool, no price feed — the quote is a pure function of (hypeReserve, assetReserve, midX96) and the public constants below. Takers call buy() and sell(); the spread stays with the LPs, because the LPs are the ones carrying the inventory it pays for.

src/Gimbal.sol · the protocol's only take is FEE_BPS — bps of the HYPE leg, charged on top of the spread so it can never turn a fill the LPs wanted into one they did not.

02 · The constraint that shapes everything

Elysium is not HyperEVM, and it carries none of HyperCore.

Chain — is an Arbitrum Orbit L2 that settles on HyperEVM. The sixteen HyperCore read precompiles at 0x…0800–0x…080F and CoreWriter at 0x3333…3333 all return zero bytes of code.

So no contract deployed on Elysium can open, read or verify a Hyperliquid position. Not this one, not a better one, not today. Most projects hide that behind the word mirrored; this one puts it in the middle of the design.

NO PRECOMPILE, NO COREWRITER GIMBAL / ELYSIUM HYPEREVM HYPERCORE SETTLES ON 0x

Read off the live chain in test/ForkMontra.t.sol, and re-read in your browser on the panel. Check it yourself: cast code 0x…0807 --rpc-url https://rpc.elysium.kinetiq.xyz → 0x.

03 · The three behaviours that are the gimbal
The mid follows flow
A taker who buys the asset moves the stored mid up; a seller moves it down, in proportion to how much of the drawn reserve the fill took. That is the only price discovery here.

MID_DRIFT_FULL_BPS — with MAX_FILL_BPS — = 1 bp of mid movement per fill. Price discovery has to be slower than the spread it moves inside.

The quote re-centres against inventory
When the vault is long the asset it shades both sides down, so the cheapest way for the market to make money off it is to take the asset off its hands. The book leans the opposite way to the tilt.

RECENTRE_FULL_BPS — is forced by one inequality: 450 > 30 + 270. Below it, a fully long book would still ask more than its own mid for the asset it is desperate to shed.

The spread widens with the tilt
Carrying inventory is the risk; the price of adding to it rises with how much is already there. At a level book — bps a side; at a fully one-sided book — bps a side, and the whole quote shaded 450 — so the ask sits 1.6% below the stored mid.

The engine works internally in parts per million, not basis points: a shade of "4.5 bps" floored to "4 bps" is the difference between the gimbal re-centring and doing nothing. That was a real bug, found by a test.

04 · The hedge is an attestation

The hedger bonds. The watchers sign. The contract's job is not to believe them.

A Hedge is (account, size, isLong, markX96, timestamp, nonce), signed EIP-712. The hedger holds the key to the Hyperliquid account, so the hedger is the only party who can actually move the perp leg — which is why the hedger is the one who bonds. But the hedger's signature over the hedger's own position is worth nothing: it would sign whatever keeps the book quoting.

A Hyperliquid position is public per address, so any number of independent watchers can read the same position off the same API and sign what they see. Hence a quorum of 3 of 5, with the hedger's bond behind it.

The constructor enforces quorum × 2 > n, and that single inequality is what makes a contradiction provable on chain with no oracle: two quorums of a set cannot be disjoint, so if two different payloads both carry a quorum for the same nonce, at least one watcher signed both. That is the only fault the chain can see by itself, which is exactly why it is the one that slashes.

W1 W2 W3 W4 W5 QUORUM A — NONCE n QUORUM B — NONCE n

test_NoTwoQuorumsOfThisSetAreDisjoint enumerates all ten 3-of-5 subsets and all pairs of them rather than taking the algebra on trust. A proven contradiction is final: a signer set that has double-signed once cannot be trusted to say when it has stopped. The bond splits CHALLENGER_BPS —% to whoever proved it, the rest into the vault's reserves.

05 · Which way the mirror is wired

It can stop this book. It can never price it.

The mid never moves toward the attested mark. Rule 5 is not the mirror setting a price; it is the book admitting that if the two disagree by more than —%, one of them is quoting a market that no longer exists and it does not know which.

Rule 6 is measured against the neutral inventory, not against the exposure, on purpose: a ratio whose denominator is the exposure goes to infinity every time the book passes through level, and a halt rule that fires at every level book is a halt rule nobody will keep.

MIRROR BOOK STOP PRICE

The full table, with every verdict, is on the panel, and all six of its states are clickable on the book.

06 · LPs, and withdrawing during a halt

The halt never closes the door.

test_AWithdrawalDoesNotMoveTheQuote asserts the quote is bit-identical afterwards.

07 · The token and the fee sink

Ballast ships unarmed.

GIMBAL would be launched on Montra, the Elysium launchpad, like any other launch: the same factory, the same fixed 1e27 supply, the same Uniswap v4 pool. There is no ERC-20 for it in the repository and nothing to pre-mine, because the pad does not have an allocation to give. LP shares in the vault are internal accounting, not a token.

So the fee piles up as HYPE and trim() refuses until arm() is called, and the only thing arm() accepts is a token that answers factory() with the pad's own factory. A launch the pad did not make cannot be armed in, not by anyone, including the steward.

There is no Universal Router on Elysium, so the swap goes through PoolManager.unlock and Ballast's own unlockCallback, settling the native side with settle{value:} and taking the token side straight to 0x…dEaD — the tokens never rest in a contract that could be persuaded to let go of them.

The buyback is held to the same standard as the book: it will not trade on a price it cannot read, so its minimum comes from the token's own Gauge, a pull TWAP over a v4 pool with four density rules.

08 · Every constant, and why it has the value it has
ConstantValueWhy

Every row is public constant in the Solidity and carries a comment there justifying it. This table is built from js/config.js, which is a name-for-name transcription — so a constant cannot drift between the contract, the simulation and the words describing it without one place to fix.

09 · How it is tested

170 tests, and the halt rule twice.

SuitenWhat it is
Quote30the three gimbal behaviours, each attacked on its own; fills, rounding, the fee, the ladder
Mirror37quorum overlap, signature ordering, nonces, timestamps, bonding, challenge and slash
Vault22seed, deposit, withdraw, withdraw mid-halt, the bond cap, solvency
Halt22the rule table, twice — once off a stub mirror so every branch is reached, once through the real one
Ballast16unarmed, arming, the buyback's refusals
ForkMontra13against Elysium mainnet at the live head
Gauge11the four density rules
Gas7ceilings on the quote path
Invariant76 invariants plus a check that the driver drives
Flow4fill → fee → sweep → arm → burn, end to end
Dump1writes the engine vectors this site's JS is diffed against

A rule that is only ever tested through the contract that prevents it is a rule nobody has tested — hence the stub.

10 · What is NOT done

Read this part.

The same list, longer, is the last section of the repository's README.

11 · The engine diff
960 numbers

The market page draws a quote ladder, and since nothing is deployed it has to compute one. So js/engine.js is a BigInt port of the engine, and the port is checked rather than claimed.

forge test --match-contract DumpTest writes 64 books and their prices straight out of the Solidity; node tools/mirror.mjs recomputes 960 numbers and diffs them to the wei. If the port drifts, that script fails.

12 · What the fork test proves

Three independent pad launches rebuild to their own event's poolId.

Lotus, DEAL and Milly — made days apart — each rebuild from nothing but their token address to exactly the poolId their own Launched event carried in topics[3]. One match could be luck; three is the constant set being right. Changing any field of the key breaks the match.

And the whole book runs on the real chain: a vault seeded with a real pad token at the mid implied by its real pool, a real fill at the cap, then the book going Shut when the attestation goes stale.

13 · Montra, read off the chain
factory0x38D3…cD15
hook0x6b12…f8EC
PoolManager0xE2e1…23F1
fee0x800000 dynamic
tickSpacing200
supply1e27, fixed

The pool key is (address(0), token, fee, tickSpacing, hook) — the native side is ETH-style address(0), which on Elysium is HYPE. Every value checked against the real chain in test/ForkMontra.t.sol.