Skip to main content
Rise is the developer-facing SDK surface for Phoenix perpetual futures. Use it after you understand the protocol concepts in the Phoenix docs and want to build an app, service, bot, or on-chain integration that reads Phoenix state and sends Phoenix instructions. The SDK sources live in the public repo: github.com/Ellipsis-Labs/rise-public. The SDK currently ships as:
  • rise/ts - TypeScript SDK with HTTP route clients, a unified Phoenix client, exchange metadata caching, instruction builders, order-packet helpers, WebSocket adapters, trader-state stores, and margin helpers.
  • rise/rust - Rust workspace centered on the phoenix-rise crate, with typed HTTP and WebSocket clients, PhoenixMetadata, PhoenixTxBuilder, trader-state containers, margin math, and low-level instruction builders.

Install

TypeScript

Rust

Create A Client

For package setup and runnable examples, use the public SDK sources:

Which Client To Use

Prefer the exchange cache for market parameters. In TypeScript, wait for client.exchange.ready() and read markets with client.exchange.market(symbol) or client.exchange.marketMetadata(symbol). In Rust, build PhoenixMetadata from http.get_exchange() and update it with live market stats through metadata.apply_market_stats(&stats). Prefer trader-state primitives for snapshots and deltas. In TypeScript, createTraderStateStore(client) maintains local trader resources and exposes marginInputs(). In Rust, Trader::apply_update(&msg) applies traderState snapshots and deltas to the local container.

First Reads

Runnable references:

Reading Order

  1. Auth - optional for most public reads, required for referral onboarding and notifications.
  2. Trader Onboarding - create or activate a trader account.
  3. Accounts - understand authority, position authority, cross accounts, isolated accounts, and trader-state streams.
  4. Collateral - move USDC into and out of Phoenix trader accounts.
  5. Exchange Data - exchange cache, market metadata, L2 orderbooks, market stats, and market calendars.
  6. WS/API Best Practices - when to stream, when to poll, and how to avoid rate-limit and drift issues.
  7. Orders - build order instructions and manage stop losses and conditionals.
  8. Margin - join market prices, compute account health, margin, and liquidation estimates.
  9. On-Chain Programs and LiteSVM Testing - program integrations and local tests.

REST, WebSocket, and RPC

Use REST for startup snapshots, historical data, and server-built transaction workflows. Use WebSocket streams for current market state, exchange deltas, orderbooks, and trader state. Use Solana RPC for blockhashes, simulation, transaction submission, confirmation, and custom account reads. The usual production pattern is:
  1. Fetch HTTP snapshots on startup.
  2. Subscribe to WebSocket streams.
  3. Apply exchange and trader deltas locally through SDK caches.
  4. Build and sign instructions with the user’s wallet or signer service.
  5. Confirm transactions through Solana RPC.
  6. Reconcile from trader-state streams, falling back to fresh HTTP snapshots after reconnects or sequence gaps.