precompilisium
Reference

Reads

Every shim, its address, input and output, decimals, and what happens when data is old.

Call by call

CallHyperEVMElysiumInput → output
position0x…08000x08008Ec6186285eE63c4dC21C03954F50eE20800(address user, uint16 perp) → (int64 szi, uint64 entryNtl, int64 isolatedRawUsd, uint32 leverage, bool isIsolated)
spotBalance0x…08010x08013FDF76E0B91ffDE7D9BED6D186bfD7900801(address user, uint64 token) → (uint64 total, uint64 hold, uint64 entryNtl)
vaultEquity0x…08020xd44Ac07AeD551a0649005b16E17A5AA8c40Ce6d9 (provisional)(address user, address vault) → (uint64 equity, uint64 lockedUntilTimestamp)
withdrawable0x…08030x0803c9A659A9DC12B53B16b95267930D51e50803(address user) → (uint64 withdrawable)
markPx0x…08060x080687d0B2db46033615FD2F4d27fe37bCAB0806(uint32 perp) → uint64
oraclePx0x…08070x080790fa5D297F2B619EC09d5E73E4fE081e0807(uint32 perp) → uint64
spotPx0x…08080x0808b2E076976eAFC3d2ACFa4CEAa2E0287b0808(uint32 spot) → uint64
l1BlockNumber0x…08090x080993bD400Eb8e00D64407014540ace3C3f0809() → uint64
perpAssetInfo0x…080a0x1e9c401b2AA74afD60D6043385F9f891EC615eeC (provisional)(uint32 perp) → (string coin, uint32 marginTableId, uint8 szDecimals, uint8 maxLeverage, bool onlyIsolated)
spotInfo0x…080b0x1954F7D1bCCB25d9e192898798e775a00616eF3a (provisional)(uint32 spot) → (string name, uint64[2] tokens)
tokenInfo0x…080c0x127B136e872d462B9447aBAc3183ffbd7bF8e524 (provisional)(uint32 token) → (string name, uint64[] spots, uint64 deployerTradingFeeShare, address deployer, address evmContract, uint8 szDecimals, uint8 weiDecimals, int8 evmExtraWeiDecimals)
bbo0x…080e0x080e076612C2845af543CC842Bb4B2A856e4080e(uint32 asset) → (uint64 bid, uint64 ask)
accountMarginSummary0x…080f0x080f2FFc821db47DCDec5991FB636B6509dB080f(uint32 perpDex, address user) → (int64 accountValue, uint64 marginUsed, uint64 ntlPos, int64 rawUsd)
coreUserExists0x…08100x69d3b2bb332e099c4A0aF31F4160D0B9eB1a591f (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

posttypical age about 1 s (moves of 0.05% or more)30 s: every read reverts Stale(age)

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

  1. Keep your HyperEVM contract as it is.
  2. Replace the precompile constants with the Elysium addresses above. CoreWriter 0x3333333333333333333333333333333333333333 becomes 0x33337bcD680354087Bd66999EbE4e1b33b613333.
  3. Handle a revert from the staticcall the way you already do. Today it can also mean Stale.
  4. 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;