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.
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.
| Action | Id | Used for |
|---|---|---|
| Limit order (IOC) | 1 | buy on mint, reduce-only sell on redeem |
| USD class transfer | 7 | margin moves on the main perp dex |
| Send asset | 13 | USDC from spot to the xyz dex (moveMargin) |
| Spot send | 6 | redemption 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, IOCWhat 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.