RISE Logo-Light

Overview

Introduction to RISEx API and setup

RISE API Usage Examples

This page gets you trading on RISEx in a few lines of TypeScript using the community risex-client SDK. For complete API documentation, refer to the Full API Documentation.

Base URL

https://developer.rise.trade/reference/general-information

Quickstart

The fastest way to get started is with risex-client, a community-maintained TypeScript SDK that handles EIP-712 signing, bitmap nonces, and rate limiting for you.

Note: risex-client is an unofficial community SDK. It is not maintained or endorsed by the RISEx team. For production use, consider integrating against the Full API directly.

Install

npm install risex-client

Requires Node.js 18+.

Get an API signer key

  1. Open the RISEx web app and go to API in the header
  2. Create a new API Wallet and store the private key
  3. Set environment variables:
ACCOUNT_ADDRESS=0x...        # your wallet address
SIGNER_PRIVATE_KEY=0x...     # the API signer private key

Read-only: fetch markets and orderbook

InfoClient exposes all public read endpoints — no keys required.

import { InfoClient } from 'risex-client';

const info = new InfoClient();

const markets = await info.getMarkets();
for (const m of markets) {
  console.log(`${m.display_name}: ${m.last_price}`);
}

const book = await info.getOrderbook(1); // BTC-PERP
console.log('Best bid:', book.bids[0]?.price);
console.log('Best ask:', book.asks[0]?.price);

Trading: place and close a position

ExchangeClient is the authenticated client. Always call await client.init() before any authenticated method — it fetches the EIP-712 domain and contract addresses from the API.

import { ExchangeClient } from 'risex-client';

const client = new ExchangeClient({
  account: process.env.ACCOUNT_ADDRESS,
  signerKey: process.env.SIGNER_PRIVATE_KEY,
});

await client.init();

// Market buy on ETH-PERP (market_id=2), 1 step = 0.001 ETH
const order = await client.marketBuy(2, 1);
console.log('Filled:', order.order_id, 'tx:', order.tx_hash);

// Inspect the resulting position
const pos = await client.info.getPosition(2, client.account);
if (pos) {
  console.log('Position:', pos.size, pos.side === 0 ? 'Long' : 'Short');
}

// Close it
await client.closePosition(2);

Sizes use integer steps and prices use integer ticks — see market.config.step_size and market.config.step_price for the conversion factors.

Streaming: subscribe to orderbook updates

import { WebSocketClient } from 'risex-client';

const ws = new WebSocketClient();

ws.onChannel('orderbook', (msg) => {
  const data = msg.data as {
    bids?: Array<{ price: string; quantity: string }>;
    asks?: Array<{ price: string; quantity: string }>;
  };
  if (data.bids?.[0]) console.log('Top bid:', data.bids[0].price);
  if (data.asks?.[0]) console.log('Top ask:', data.asks[0].price);
});

await ws.connect();
ws.subscribe({ channel: 'orderbook', market_ids: [1] }); // BTC-PERP

Available channels: orderbook, trades, orders, positions, oracle, ticker.

Full API Documentation

For complete API documentation including: