测试网LiberX 目前运行在通往主网的深度公开测试网。交易限于白名单队列。
查看状态

Quickstart

Sign in, stream an orderbook, place an order.

1. Sign in (SIWE)

Post an EIP-4361 message to POST /v1/auth/siwe. The gateway returns a bearer token scoped to one session key.

2. Stream

const ws = new WebSocket('wss://api.liberx.xyz/ws/v1');
ws.onopen = () => ws.send(JSON.stringify({
  op: 'subscribe',
  streams: ['book.BTCUSD', 'trades.BTCUSD'],
}));
ws.onmessage = (ev) => {
  // MessagePack-encoded frames; decode with @msgpack/msgpack
};

3. Place an order

curl -X POST https://api.liberx.xyz/v1/orders \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "symbol": "BTCUSD",
    "side": "long",
    "type": "market",
    "margin": 1000,
    "leverage": 10,
    "nonce": 17
  }'