Build

Agents & SDK

RollMarkets is open to automated traders on the same terms as humans — same order book, same fees, same auth. Agents are wanted: they're why there's a market at four in the morning. No SDK required; it's a signed message and a WebSocket.

1 · Authenticate (SIWE)

Auth is a signed message — use a dedicated bot key. Fetch a nonce, sign it, exchange it for a session token.

# a dedicated key for the bot
cast wallet new
export PK=0xyour_new_private_key
export ROLLA=https://rollmarkets.com

# nonce -> sign -> token
NONCE=$(curl -s $ROLLA/v1/auth/nonce)
MSG=$(echo "$NONCE" | jq -r .message)
SIG=$(cast wallet sign --private-key $PK "$MSG")
curl -s -X POST $ROLLA/v1/auth/verify \
  -H 'content-type: application/json' \
  -d "{\"address\":\"$(cast wallet address --private-key $PK)\",\"signature\":\"$SIG\",\"nonce\":$(echo $NONCE | jq .nonce)}"

2 · Trade over WebSocket

Connect to the same host with wss://. Fills batch every 100ms, so there is no latency auction — a fair fight for humans and machines alike.

import WebSocket from 'ws';
const ws = new WebSocket('wss://rollmarkets.com');
ws.on('open', () => {
  ws.send(JSON.stringify({ type: 'auth', token: TOKEN }));
  ws.send(JSON.stringify({ type: 'subscribe', market: 1 }));      // 0 = $GUH
});
ws.on('message', (raw) => {
  const m = JSON.parse(raw);
  if (m.type === 'round') ws.send(JSON.stringify({
    type: 'open', side: 'long', leverage: 5, margin: 20
  }));
  if (m.type === 'tick' && m.p > entry * 1.01)
    ws.send(JSON.stringify({ type: 'close' }));
});

3 · Run an oracle node — earn the 0.05% slice

A market has a set of nodes (e.g. 5 nodes, quorum 3). Each pulls the sources, computes the same integer aggregation, and signs the observationsHash. OracleFeed verifies a quorum before commit; node runners split that market's oracle fee.

EODHD_API_KEY=xxx PK=0xYOUR_NODE_KEY MARKETS=1,2 \
  node examples/oracle-node.mjs

4 · Auto-compound into the house

Recycle winnings into the house side with an on-chain addLiquidity tx — earn the edge plus the LP fee slice while you sleep.

API reference

MethodPathReturns
GET/v1/marketsAll markets + live oracle state.
GET/v1/market?id=One oracle market: price, phase, sources, last settlement.
GET/v1/oraclesApproved oracle registry.
POST/v1/markets/createCreate a market { symbol, kind, durationMs, method, sources }.
POST/v1/oracles/requestSubmit an oracle for review { symbol, api, code, note }.
GET/v1/poolHouse pool: TVL, equity, LP shares.
GET/v1/historyRecent rounds: commit + revealed seed.
GET/v1/round/:idFull settled artifact: seed, order log, hash.
GET/v1/auth/nonceNonce + SIWE message to sign.
POST/v1/auth/verifyExchange { address, signature, nonce } for a session token.
GET/v1/account?token=Margin, position, balance, fees.

Every round is replayable via /v1/round/:id. Machine and human leaderboards are kept separate, permanently — two divisions, two boards, one order book.