Contracts
Four contracts on Elysium. Their functions and events are listed here.
Addresses
Elysium, chain ID 99901. Collateral is USDC with 6 decimals. Prices are 1e8, basis points are 1e4.
| Contract | Address |
|---|---|
| BoxEngine | Opening on Elysium |
| BoxVault | Opening on Elysium |
| BoxOracle | Opening on Elysium |
| FeeRouter | Opening on Elysium |
| USDC | 0xb47c4C8F73F009CC0C0d3f92B388d13E293F0B65 |
| $POP | Opening on Elysium |
Each address is listed here once it is published on Elysium.
BoxEngine
Markets, Box lifecycle, premium accrual (per second) and the permissionless trigger.
open(uint32 coin, uint256 size, uint32 bandBps, uint16 lev,
uint32 trailBps, uint256 budget) → uint256 id
topUp(uint256 id, uint256 amount)
close(uint256 id) // trader only
poke(uint256[] ids) // anyone; keeper reward per action
quote(uint32 coin, uint256 size, uint32 bandBps)
→ (uint256 premiumPerHour, uint256 openFee)
getBox(uint256 id) → Box
getMarket(uint32 coin) → Market
marketCount() → uint256
listedCoins() → uint32[]
nextId() → uint256
utilE18() → uint256setTurboMarket(uint32 coin, bool on) // owner setTurboPaused(uint32 coin, bool paused) // owner or keeper isTurbo(uint32 coin) → (bool on, bool paused) insuranceReserve() → uint256 requestClose(uint256 id) // trader; Turbo legs only settleClose(uint256 id) // anyone; needs a price with hlTimeMs > the request's pendingClose(uint256 id) → uint64 requestedHlTimeMs
open accepts lev above the Standard maximum only when isTurbo(coin) is on and not paused; trailBps must then be within the Turbo range and the oracle price fresher than the Turbo limit. close() on a Turbo leg reverts with UseRequestClose.
setPrivateKeeperKey(bytes uncompressedPubKey65) // owner
privateKeeperKey() → bytes
openPrivate(uint32 coin, uint256 size, uint16 lev, bytes32 commit,
uint256 ratePerHour, uint256 budget, bytes ciphertext) → uint256 id
collapsePrivate(uint256 id, uint32 bandBps, uint32 trailBps, bytes32 salt) // anyone with the preimage
revealPrivate(uint256 id, uint32 bandBps, uint32 trailBps, bytes32 salt) // trader or keeper
voidPrivate(uint256 id, uint32 bandBps, uint32 trailBps, bytes32 salt) // anyone, if the rate was under-declaredopen pulls margin (size / lev), the budget and the open fee with USDC transferFrom. Approve the engine first.
Box { trader, coin, phase, bandBps, lev, trailBps, size, margin,
budget, entryE8, fillE8, bestE8, lastAccrual, openedAt,
isPrivate, commit, lockedRate, sigmaAtOpenE6, utilAtOpenE18Scaled }
phase: 0 none · 1 open · 2 long · 3 short · 4 closed
Market { listed, paused, maxLev, weightBps, oiOpen, oiLong, oiShort, name }BoxVault
USDC ERC-4626 vault, shares “POP-LP”. Holds all margin and premium. Only BoxEngine can pay out.
deposit(uint256 assets, address receiver) → uint256 shares requestWithdraw(uint256 shares) claimWithdraw() → uint256 assets pendingWithdraw(address) → (uint256 shares, uint64 readyAt) totalAssets() → uint256 lockedMargin() → uint256
BoxOracle
Keeper-quorum price and σ store behind IPriceSource.
push(Px[] batch, uint64 deadline, bytes[] sigs)
price(uint32 coin) → (uint64 markE8, uint32 sigmaE6,
uint64 hlTimeMs, uint64 updatedAt)FeeRouter
Splits fees and premium between the vault, the buyback reserve and the treasury.
buybackReserve() → uint256 treasuryAccrued() → uint256 totalToVault() → uint256 pullBuyback(address to) → uint256 // keeper only
Events
| Event | Fields |
|---|---|
| BoxOpened | id, trader, coin, size, bandBps, lev, trailBps, entryE8, budget |
| BoxCollapsed | id, side (1 long, 2 short), fillE8, ts |
| BoxClosed | id, reason (0 user, 1 trail, 2 liq, 3 tp, 4 expire), exitE8, pnl, payout |
| BoxToppedUp | id, amount |
| PriceBatch | n, hlTimeMs |
| MarketListed | coin, name, maxLev |
| BoxOpenedPrivate | id, trader, coin, size, lev, commit, ratePerHour, budget, ciphertext |
| BoxRevealed | id, bandBps, trailBps |
| CloseRequested | id, hlTimeMs |
| InsurancePaid | id, amount (Turbo bad debt covered by the reserve) |