Real-time market data and account updates via WebSocket.
Connection
| Environment | URL |
|---|---|
| Testnet | wss://ws.testnet.rise.trade/ws |
| Mainnet | wss://ws.rise.trade/ws |
Authentication
Authentication is required before subscribing to private channels (orders, positions). Public channels (orderbook) can be subscribed without authentication.
Authentication Request
{
"method": "auth",
"params": {
"account": "0x1234567890123456789012345678901234567890",
"signer": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd",
"message": "Please sign in with your wallet to access rise.trade. You are signing in on 2025-01-15 12:00:00 (GMT). This message is exclusively signed with rise.trade for security.",
"nonce": 1736942400,
"signature": "0x..."
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
account | string | Yes | Your main Ethereum wallet address |
signer | string | Yes | Session key address (must be registered on-chain) |
message | string | Yes | Human-readable message that was signed |
nonce | number | Yes | Unix timestamp in seconds (must be within ±60 seconds of server time) |
signature | string | Yes | EIP-712 signature in hex format |
Authentication Response
Success:
{
"method": "auth",
"status": "success",
"message": "Authentication successful",
"data": {
"account": "0x1234567890123456789012345678901234567890",
"signer": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"
}
}Error:
{
"method": "auth",
"status": "error",
"message": "session key not active (status: 0)"
}Subscription Format
Subscribe
{
"method": "subscribe",
"params": {
"channel": "<channel_name>",
"market_ids": [1, 2],
"makers": ["0x..."]
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
channel | string | Yes | Channel name: orders, orderbook, positions, or trades |
market_ids | number[] | No | Filter by market IDs. Empty or omitted = all markets |
makers | string[] | No | Filter by account addresses. Empty or omitted = all accounts |
Unsubscribe
{
"method": "unsubscribe",
"params": {
"channel": "<channel_name>"
}
}Subscription Response
{
"method": "subscribe",
"status": "success",
"message": "Subscribed to orders",
"channel": "orders",
"data": {
"market_ids": [1, 2],
"makers": ["0x1234567890123456789012345678901234567890"]
}
}Available Channels
Message Types
All channel messages include a type field:
| Type | Description |
|---|---|
snapshot | Full state sent on initial subscription |
update | Incremental update |
Common Fields
All update messages include these fields:
| Field | Type | Description |
|---|---|---|
channel | string | Channel name |
type | string | snapshot or update |
market_id | string | Market ID |
data | array | Channel-specific data |
block_number | number | Blockchain block number |
block_timestamp | string | Blockchain timestamp (nanoseconds) |
timestamp | string | Server timestamp (nanoseconds) |
Re-subscription Behavior
Re-subscribing to the same channel replaces the previous subscription filters. To receive events from multiple markets, specify all market IDs in a single subscription.
Price and Size Format
All prices and sizes are represented as integer strings in wei (18 decimals).
Example: "50000000000000000000000" = 50,000
Market IDs
| Market ID | Symbol |
|---|---|
| 1 | BTC-PERP |
| 2 | ETH-PERP |
Error Handling
{
"method": "subscribe",
"status": "error",
"message": "authentication required",
"channel": "orders"
}Health Checks
The server sends ping messages every 30 seconds. Respond with pong to keep the connection alive. Connections timeout after 60 seconds of inactivity.