This chapter lists every key that can do something the public cannot, what each contract can and cannot do, and the checks that stand between a pool price and your funds.
- No contract can be upgraded, and the LP-management contracts (vaults, zaps, range orders, the keeper, the launch pipeline, the pre-market perp, the fee router) have no owner and no pause switch.
- Elyra's own pools have one owner, a cold key behind
ProtocolConfig. It can pause swaps and deposits, set the protocol share up to 50 % of the swap fee and tune stock feeds and fees. It cannot move liquidity or block a withdrawal. - Stock and HYPE prices on chain come from Elyra's own feeds, which a feed keeper key updates. That key moves prices, not funds, and each feed at most 15 % an hour.
- The hedger key can move a hedged vault's share price through its reports: at most 15 % of the hedge an hour, and never past three times the margin funded. Exits count the lower of what was reported and what the vault believes, and zero on a report older than 1 h; deposits wait meanwhile, exits never do.
- A hedged vault's margin sits on Hyperliquid in an account owned by that vault's funder key, which the operator holds. That key can withdraw the margin there; the vault lets at most 25 % of its on-chain assets leave at once, refilling over a day, to the funder's address only.
- Perp orders are signed by agent wallets that Hyperliquid does not let withdraw or transfer.
Who holds a key
The deploy names its roles up front, with one funder per hedged vault, and refuses to run if any of them is the deploying key, if a funder is a hot key, if the owner is a funder or a hot key, if two hedged vaults share a funder, or if two of the three hot roles share a key. The API signs each bot role with its own key and, in production, refuses a shared one. After the deploy the deploying key is an ordinary address.
| Key | Kept | Holds |
|---|---|---|
| Owner | cold | the venue's admin calls: ProtocolConfig, AssetRegistry, FeeCollector, BuybackV2, the eight price feeds, and through ProtocolConfig the DLMM factory and the two venue vault factories |
| Hedger | hot, on the API server, its own key | hedge and sleeve reports |
| Vault keeper | hot, on the API server, its own key | rebalancing the DLMM and stock vaults |
| Price feed keeper | hot, on the API server, its own key | pushing stock and HYPE prices to Elyra's feeds, within their bounds |
| Funder, one per hedged vault | cold, never a hot key | taking margin from its vault to its own address, within caps; naming the vault's hedger; believing a reported drop at once; and, off chain, the vault's Hyperliquid account itself, including withdrawing from it |
| Builder account | owner-held | receiving Elyra's builder fees on Hyperliquid |
| Deployer | used once | nothing after the hand-over |
The venue owner
The four venue contracts and the eight feeds use OpenZeppelin Ownable2Step: the deploy proposes the owner and the owner must call acceptOwnership. The owner can:
- Pause the venue (
ProtocolConfig.setPaused). This stops swaps and liquidity adds on DAMM and stock pools, DLMM swaps, deposits and new pairs, deposits and rebalances in the DLMM and stock vaults, and new DLMM limit orders. It never gates an exit: the hooks have no remove-liquidity callback, andDlmmPair.burn, the position NFT'sdecreaseandburn, the venue vaults'withdrawand the limit orders'cancelandclaimdo not read the flag. - Direct protocol revenue. Set the protocol share of every swap fee, at most 5 000 bps; replace the fee collector; set the
FeeCollector's conversion routes, its slippage bound (at most 20 %) and where it sends HYPE; sweep tokens that have no conversion route; tuneBuybackV2's price guard, caller reward and interval (30 s to a day). - Curate stock pools. List or delist an EQX asset, choose its price feed and its heartbeats in and out of session, its fees (at most 1 000 bps) and its band, and set the session hours and holidays.
- Run the feeds. Name each feed's keeper, set its bounds (
setBounds: the step, the interval, the distance from the window's anchor, the window) and write an answer itself (setAnswer, emittingAnswerSet) for a genuine gap larger than the keeper may push. - Curate the rest. Enable DLMM bin steps and their fee presets (new pairs only), create DLMM and stock vaults, name their keeper and rebalance them itself.
None of these calls can take a liquidity provider's tokens. Two of them still matter to you: a wrong feed or answer for a stock moves that pool's band, and providers would trade at it; and delisting an asset stops swaps in its pools until it is listed again. The LP-management contracts read nothing the owner controls.
The price feed keeper
Elysium has no third-party oracle network, so every feed price the contracts read comes from Elyra's own AggregatorV3-compatible feeds, updated by Elyra's feed keeper. Stock pools band their swaps around it, stock vaults centre on it, the fee collector's price floor and the pre-market perp's index use it, and a hedged vault and an Income note convert reported equity with it. The keeper key cannot move funds. Each push moves a feed at most 10 %, at least a minute after the last, and within 15 % of the answer that stood at the first push of the hour, so a wrong price moves a feed at most 15 % an hour (about 32 % where two hours meet); a genuine larger gap is the owner's setAnswer. A wrong price can move a stock pool's band and what feed-priced reads value; a late one ages until each reader's limit (HYPE/USD an hour after its last push, a stock an hour while its session is open and four days while it is closed) and then counts as stale, which switches stock pools to their stale fee and band and values a hedge or sleeve at zero.
The hedger and the funder
A hedged vault cannot see its Hyperliquid position, so it believes the hedger's reportHedge(notionalUsd, unrealizedPnlUsd, equityUsd, asOf) and adds equityUsd to totalAssets(). An Income note does the same with reportSleeve, under the same rules, with a band measured on its anchor plus its collateral and a ceiling of half that collateral; a Protected note refuses it.
fundHedge(assetAmount) belongs to the funder alone. It can only send USDC to the funder's own address; it moves at most maxFundBpsPerCall (1 000 bps) of the vault's on-chain assets per call, out of an allowance of maxFundBpsPerPeriod (2 500 bps) that refills linearly over a day, both measured against the position and idle balance rather than the reported equity; it sells at a floor taken from the USDC pool's TWAP; and it is refused while deposits wait. No bot calls it. The USDC it delivers is added to the stored equity in the same transaction, and returnHedge (the funder again) takes the USDC it brings home off it, so margin on its way to or from Hyperliquid never drops out of the share price; the hedger reports what is still in flight (see Margin in transit).
The vault keeper's key may rebalance DLMM and stock vaults only when the contracts allow it: a DLMM vault once the active bin has drifted more than half its half-width, a stock vault on a session change or a large feed move and only while the pool sits near the feed price; at most every 5 minutes, and never with a swap.
Contracts with no admin
The LP-management contracts (the three vault kinds and VaultFactory, both zaps, RangeOrders, PositionKeeper, LaunchPipeline, PreMarketPerp, FeeRouter and ReferralRegistry) have no owner, no pause switch and no upgrade path. Every address they call (Uniswap, WHYPE, Permit2, price feeds) is a constructor immutable or, for the vault clones, written once in initialize. On the venue side the Router, the DLMM pairs, position NFT and limit orders, LaunchPools and LaunchVault have no owner of their own either; the pools among them follow the venue pause and protocol share described above.
The vaults are EIP-1167 clones of three implementations. Each implementation locks itself in its constructor, and VaultFactory clones and initialises in one transaction, so no stranger can configure a fresh clone. What that leaves:
- A vault pays out only to whoever redeems its shares. A vault's cap and policy are set once, at creation, and never change.
PositionKeepermints a rebalanced position to its owner and pays only the owner, the caller's bounty (capped by the owner, at mostMAX_BOUNTY_BPS, 300) and theFeeRouter. A position that changed hands since enrolment revertsOwnerChanged.FeeRouter.takebelieves a reported fee only if the router's balance covers it (FeeNotReceived), and referral links are write-once.- No contract can withdraw from Hyperliquid, and neither can the signer's agent wallets. The one key that can is a hedged vault's funder, for that vault's margin (see above).
LaunchPoolslocks each launch's seed liquidity for good; only the right to its fees can change hands.
Outside the Router and the hooks, functions that move tokens carry OpenZeppelin ReentrancyGuard. The two report functions carry it too, though they make no external call, so a report can never land in the middle of a deposit, exit or funding and move the share price under it. The Router keeps nothing between calls, and the hooks run inside the PoolManager's lock. The v3 zap approves exact amounts and clears them, while the v4 zap keeps standing Permit2 approvals and never holds a balance between calls.
Price checks
The threat is the same everywhere: move a pool, get Elyra to act at that price, move it back. TwapGuard.check is the shared answer. It reads spot and the mean tick over TWAP_WINDOW (30 minutes), compares them as prices, and reverts PriceDeviation when they are more than 300 bps apart. A new pool's observation ring holds one slot, so its "average" is the last swap; the guard therefore refuses to answer (TwapWindowTooShort) until the ring reaches back 10 minutes. VaultFactory, LaunchPipeline.track and PreMarketPerp grow each ring to 900 slots. A pool writes at most one observation a second, so 900 slots always reach back 15 minutes, over the 10-minute minimum, and no burst of swaps can shorten the window enough to stop deposits or withdrawals. Anyone can deepen a ring further. The cost is availability: on a fresh pool, deposits, withdrawals and rebalances wait until its history reaches back 10 minutes.
The guard is waived three times, on purpose. A vault with no shares skips it, so the first depositor into a freshly graduated pool can get in. harvest skips it, since it only compounds fees under a slippage bound and blocking it would let a manipulator stop a vault being paid. A Protected note stops checking its reserve pool once it holds no reserve token, which is what settle is for.
Inside the 300 bps band, more checks apply:
PositionKeeper.rebalancevalues what it unwound and what it minted at the TWAP, and revertsSlippageif the round trip lost more than the owner'smaxSlippageBps. This catches what the swap floor cannot see.- Swap floors: the vaults and the keeper quote at spot after the guard; a zap quotes at spot and also enforces the
minLiquiditythe app derives from the price you saw;fundHedgeand the reserve leg quote at the TWAP. - Mint minimums: the vaults allow 500 bps between the minted and the balanced amounts, the zaps your slippage. A zap refuses a slippage above 5 000 bps (
MAX_SLIPPAGE_BPS,SlippageTooHigh), so no call can switch its floors off. - Feed reads need a positive, complete answer younger than the reader's limit. A bad read values a hedge or sleeve at zero rather than freezing exits, and makes the perp's index unreadable.
- Stock pools end every swap inside their feed band or closer to the feed price, and DLMM deposits carry an active-bin and minimum-amount guard; see Elyra pools.
- Graduation measures pool depth as a 30-minute average, so liquidity added in the graduating block counts for nothing.
The pre-market perp's balance
PreMarketPerp has no counterparty; its USDC balance is all a winner can be paid from. Leverage is capped at 3x and a market's open interest at 5 times its virtual depth, which is at least 10 000 USDC. A third of each 30 bps taker fee feeds an insurance fund that absorbs bad debt first; what it cannot absorb becomes a deficit that the next profitable closers pay out of their profit, never their collateral. A payout never touches another position's collateral or the fund: whatever the contract cannot pay now becomes a deferred claim, collected with claimDeferred. Claims already waiting are set aside before any later close is paid; among themselves they are paid first come, first served.
The index, a 30-minute TWAP times Elyra's HYPE/USD feed, drives funding, capped at 1 % per hour and at most 24 hours charged at once. A liquidation must hold at both the mark and the index, so with the index unreadable liquidations wait while close stays open. Details are in Graduation and pre-market perps.
Off-chain keys
Perp orders go through a signer service that holds a per-user agent wallet, encrypted at rest, which your wallet approves on Hyperliquid. Hyperliquid does not let an agent wallet withdraw or transfer. The signer fails closed without a current mark, refuses a signed price more than LIMIT_PRICE_BAND_BPS (1 000 bps by default) from it or an order above MAX_ORDER_NOTIONAL_USD ($250 000 by default), and gives a market order at least 100 bps of slippage while rejecting requests above 1 000 bps. Every perp write to the API carries an EIP-712 signature from your wallet, at most 300 s old and with a fresh nonce. With an opt-in trading session, a key held by one browser tab signs orders and cancels instead, under a grant your wallet signed for at most 24 h; it can never withdraw or approve anything. Elyra's builder fee is charged only up to the maximum your wallet approved. See Perpetuals.
Limits
- Hedge margin in an operator account. Margin outside a hedged vault depends on the funder key and on the bridge and Hyperliquid while it is there. The Income note takes no deposits: its long has no funding path on chain.
- Withdrawal size. A hedged vault sizes exits against its on-chain holdings, so a withdrawal larger than them reverts
Shortfalluntil margin comes back from Hyperliquid, which takes at least the bridge's time. - The first depositor into a vault with no shares prices themselves, with no TWAP check. Shares carry three more decimals than the asset (1 000 virtual shares per virtual asset unit), so donating to a near-empty vault to round the next depositor down costs about a thousand times what it can take.
- Deferred perp profits are paid after the deficit haircut and only from realised losses.
- A frozen feed that keeps a positive answer is believed until it passes its reader's age limit.
Reference
| Name | Allowed | Default | Effect |
|---|---|---|---|
TWAP_WINDOW | constant | 30 min | Window TwapGuard averages over, when the ring allows. |
MIN_TWAP_WINDOW | constant | 10 min | Shortest history TwapGuard accepts. |
MAX_TWAP_DEVIATION_BPS | constant bps | 300 | Spot against the mean, compared as prices. |
MIN_OBS_CARDINALITY | constant | 900 | Ring size the factory, the pipeline and the perp grow pools to: 15 minutes at one write a second. |
MAX_FEED_AGE | constant | 1 h | Oldest HYPE/USD answer the vaults, the note and the perp accept. |
heartbeat / closedHeartbeat | per asset, owner-set | 1 h / 4 days | Feed age after which a stock pool counts as stale, in and out of session. A quote has the first only. |
maxDeviationBps / minInterval | per feed, owner-set bps | 1 000 / 60 s | Largest move of one push, and the least time between two. |
maxWindowMoveBps / window | per feed, owner-set bps | 1 500 / 1 h | Largest distance from the window's anchor, and the window's length. |
maxHedgeAge | per vault, fixed | 1 h | Report age after which a hedged vault or Income note values it at zero for exits and holds deposits. |
maxEquityJumpBps | per vault, fixed bps | 1 500 | Band around the hour's anchor the believed equity moves in (an Income note: of anchor plus collateral). |
MIN_REPORT_INTERVAL / REPORT_WINDOW | constant | 5 min / 1 h | Least time between two reports, and how often the anchor rolls. |
VALUE_MULTIPLE / SLEEVE_CEILING_BPS | constant | 3 / 5 000 | Ceiling on the believed figure: times the margin funded less returned (hedged vault), bps of the collateral (Income note). |
maxFundBpsPerCall / PerPeriod | per vault, fixed bps | 1 000 / 2 500 | fundHedge cap per call, and the allowance that refills linearly over a day. |
cap | per vault, fixed | none | Deposit limit, set once at creation. The vaults Elyra deploys have none; an Income note is created at 0. |
MAX_SLIPPAGE_BPS | constant bps | 5 000 | Highest maxSlippageBps a zap accepts. |
SHARE_DECIMALS_OFFSET | constant | 3 | Extra share decimals on the ERC-4626 vaults: 1 000 virtual shares per virtual asset unit. |
MAX_PROTOCOL_SHARE_BPS | constant bps | 5 000 | Highest protocol share of a swap fee the owner can set. |
MAX_BOUNTY_BPS | constant bps | 300 | Highest bounty a kept position can offer. |
- ProtocolConfigthe venue owner, the pause and the protocol share
- AssetRegistrystock feeds, heartbeats, fees, bands and sessions
- FeeCollectorthe owner-set fee routes
- PreMarketPerpthe perp bounds, payouts and deferred claims
Elyra