Call by call
| Call | HyperEVM | Elysium | Input → output |
|---|---|---|---|
| position | 0x…0800 | 0x08008Ec6186285eE63c4dC21C03954F50eE20800 | (address user, uint16 perp) → (int64 szi, uint64 entryNtl, int64 isolatedRawUsd, uint32 leverage, bool isIsolated) |
| spotBalance | 0x…0801 | 0x08013FDF76E0B91ffDE7D9BED6D186bfD7900801 | (address user, uint64 token) → (uint64 total, uint64 hold, uint64 entryNtl) |
| vaultEquity | 0x…0802 | 0xd44Ac07AeD551a0649005b16E17A5AA8c40Ce6d9 (provisional) | (address user, address vault) → (uint64 equity, uint64 lockedUntilTimestamp) |
| withdrawable | 0x…0803 | 0x0803c9A659A9DC12B53B16b95267930D51e50803 | (address user) → (uint64 withdrawable) |
| markPx | 0x…0806 | 0x080687d0B2db46033615FD2F4d27fe37bCAB0806 | (uint32 perp) → uint64 |
| oraclePx | 0x…0807 | 0x080790fa5D297F2B619EC09d5E73E4fE081e0807 | (uint32 perp) → uint64 |
| spotPx | 0x…0808 | 0x0808b2E076976eAFC3d2ACFa4CEAa2E0287b0808 | (uint32 spot) → uint64 |
| l1BlockNumber | 0x…0809 | 0x080993bD400Eb8e00D64407014540ace3C3f0809 | () → uint64 |
| perpAssetInfo | 0x…080a | 0x1e9c401b2AA74afD60D6043385F9f891EC615eeC (provisional) | (uint32 perp) → (string coin, uint32 marginTableId, uint8 szDecimals, uint8 maxLeverage, bool onlyIsolated) |
| spotInfo | 0x…080b | 0x1954F7D1bCCB25d9e192898798e775a00616eF3a (provisional) | (uint32 spot) → (string name, uint64[2] tokens) |
| tokenInfo | 0x…080c | 0x127B136e872d462B9447aBAc3183ffbd7bF8e524 (provisional) | (uint32 token) → (string name, uint64[] spots, uint64 deployerTradingFeeShare, address deployer, address evmContract, uint8 szDecimals, uint8 weiDecimals, int8 evmExtraWeiDecimals) |
| bbo | 0x…080e | 0x080e076612C2845af543CC842Bb4B2A856e4080e | (uint32 asset) → (uint64 bid, uint64 ask) |
| accountMarginSummary | 0x…080f | 0x080f2FFc821db47DCDec5991FB636B6509dB080f | (uint32 perpDex, address user) → (int64 accountValue, uint64 marginUsed, uint64 ntlPos, int64 rawUsd) |
| coreUserExists | 0x…0810 | 0x69d3b2bb332e099c4A0aF31F4160D0B9eB1a591f (provisional) | (address user) → (bool exists) |
The book extensions live on CoreBook at 0x96Bb62868314d9CacEaCB17D2901e1B3A0087b87: book(asset) returns the top five levels, depthWithin(asset, bps) the resting size within a band of the mid, slippage(asset, sz, isBuy, limitPx) the average fill and filled size. These names are provisional and will carry Kinetiq's names as aliases once published.
Decimals
The same as HyperEVM. Perp prices divide by 10^(6 - szDecimals), spot prices by 10^(8 - base szDecimals). Account values in USDC are 1e6. Spot balances are in the token's wei. bbo takes a perp index, or 10000 plus a spot index.
Freshness and Stale
Prices are posted when they move 0.05% or every 30 seconds, so a covered market is about a second old in normal conditions. Accounts on the watch list are posted on every change and every 60 seconds. If the last post is older than 30 seconds the shim reverts Stale(uint64 age). A missing key reverts NotServed(uint8 kind, bytes32 key). Metadata never expires. The native read Kinetiq describes is fresher, 150 to 350 ms, and also fails visibly when stale.
Migration guide
- Keep your HyperEVM contract as it is.
- Replace the precompile constants with the Elysium addresses above. CoreWriter
0x3333333333333333333333333333333333333333becomes0x33337bcD680354087Bd66999EbE4e1b33b613333. - Handle a revert from the staticcall the way you already do. Today it can also mean
Stale. - Run it in the sandbox, or fork Elysium with anvil and deploy the shims with the same factory script.
- address constant MARK_PX = 0x0000000000000000000000000000000000000806;
+ address constant MARK_PX = 0x080687d0B2db46033615FD2F4d27fe37bCAB0806;