Iris
Elysium mainnet

IrisWriter

The order lane. Your Elysium contract sends a HyperCore action with CoreWriter's encoding and some HYPE as escrow. A keeper runs it on HyperCore and posts a signed receipt.

The order lane is closed on Elysium mainnet for now: IrisWriter takes no deposits and no keeper runs. Prices on IrisOracle are live.

Send

sendRawAction{value: escrow}(data) records an intent with a deadline.

Execute

The keeper runs it on HyperCore as an agent wallet.

Receipt

2 of 3 signers sign Filled or Rejected with oid, filled size and average price.

Settle or reclaim

Keeper paid up to escrow, the rest refunded. No receipt by the deadline: anyone calls reclaim(id).

Supported actions

IdActionParams
1Limit order(uint32 asset, bool isBuy, uint64 limitPx, uint64 sz, bool reduceOnly, uint8 tif, uint128 cloid), tif 1 Alo, 2 Gtc, 3 Ioc
6Spot send(address destination, uint64 token, uint64 wei)
10Cancel by oid(uint32 asset, uint64 oid)
11Cancel by cloid(uint32 asset, uint128 cloid)
1001Ticker auction bid(string ticker, uint8 szDecimals, uint8 weiDecimals, uint64 maxGas, string fullName)

Limit order price and size are 1e8-scaled, as on CoreWriter.

Writer state

Address, signer set, escrow held and the keeper show here, read live from Elysium once IrisWriter is deployed. Default timeout is 10 minutes, settable from 1 minute to 7 days.
Solidity, send an order
IIrisWriter constant WRITER = IIrisWriter(WRITER_ADDRESS);

function hedge(uint64 limitPx, uint64 sz) external payable returns (uint256 id) {
    bytes memory data = abi.encodePacked(uint8(1), uint24(1),
        abi.encode(uint32(159), false, limitPx, sz, false, uint8(3), uint128(0))); // HYPE short, IOC
    id = WRITER.sendRawAction{value: msg.value}(data);
}
Solidity, receive the receipt
contract Hedger is IIrisReceiver {
    function onIrisReceipt(uint256 id, IIrisWriter.Status status, bytes calldata result) external {
        require(msg.sender == address(WRITER));
        (uint64 oid, uint64 filledSz, uint64 avgPx, string memory message) =
            abi.decode(result, (uint64, uint64, uint64, string));
        // update your books
    }
}

Latest intents

Open the explorer
Loading intents from the Iris API.