Docs / How it works

How a share is backed

ShareDesk on HyperEVM holds USDC margin on the HIP-3 dex and keeps a 1x long equal to the shares outstanding on Elysium.

The desk

For every share minted on Elysium the desk buys one unit of the market on HyperCore; for every share redeemed it sells one. The long is held at 1x, so its liquidation price sits near zero, and the desk keeps a margin floor of 120% of the notional before anything can leave it.

1.00
Shares outstanding
on Elysium, from MintQueue
1.00
Long size
on HyperCore, same units
1.2x
Margin
USDC on the xyz dex, at least 120%
The invariant: long size equals shares outstanding.

CoreWriter actions

The desk writes to HyperCore through the CoreWriter contract at 0x3333...3333. Each action is a version byte, a three-byte action id, then the ABI-encoded fields.

ActionIdUsed for
Limit order (IOC)1buy on mint, reduce-only sell on redeem
USD class transfer7margin moves on the main perp dex
Send asset13USDC from spot to the xyz dex (moveMargin)
Spot send6redemption proceeds to the payout route only

Order bounds

The contract checks every limit price against the live mark read from precompile 0x806: an order more than 1% through the mark reverts. Prices follow HyperCore rules, five significant figures in the market's price units.

desk.buy(10002, 154630, 6500, cloid)
// asset 110002, isBuy, limitPx 154.630, sz 6.500 NVDA, IOC

What the tests prove

The Foundry suite runs on a HyperEVM fork against the real CoreWriter: an IOC buy and a reduce-only sell on asset 110002 at the live best bid and offer, and a send-asset move of USDC from spot to dex 1, each emitting the exact bytes HyperCore reads. The live fill itself happens on HyperCore once the desk holds margin.