rise/ts— the TypeScript SDK, with HTTP route clients, a unified exchange-aware client, instruction builders, Flight helpers, and WebSocket adaptersrise/rust— the Rust workspace, centered on thephoenix-risecrate, with typed HTTP/WS clients, transaction builders, math helpers, and low-level instruction builders
Where to start
- Reach for
PhoenixHttpClient/client.apiwhen you need public HTTP data or invite activation. - Reach for
createPhoenixClient(...)when you want exchange metadata, PDA derivation, order-packet helpers, andclient.ixs. - Reach for
client.streamsorcreatePhoenixWsClient(...)when you want typed live adapters. - Reach for
PhoenixTxBuilderin Rust when you want to construct and sign your own Solana instructions.
Runnable entry points
- TypeScript
- Rust
Onboarding: access code vs referral code
These invite routes are not interchangeable:- Use
POST /v1/invite/activatewhen you have an access code / allowlist code. Send that value ascode. - Use
POST /v1/invite/activate-with-referralwhen you have a referral code. Send that value asreferral_code.
Fetching exchange, market, and trader state
The HTTP surface is intentionally split by what kind of state you want:exchange().getSnapshot()— exchange-wide state plus every market’s current config snapshotexchange().getMarket(symbol)— one market’s fees, risk, funding cadence, and configurationorderbook().getOrderbook(symbol)— an HTTP L2 snapshot for one markettraders().getTraderStateSnapshot(...)(TypeScript) ortraders().get_trader(...)(Rust) — a trader-centric view of collateral, positions, orders, and triggersmarkets().getMarketStatsHistory(...)andfunding().getFundingRateHistory(...)— time-series data for frontends, vault products, and analytics
ts/examples/01-http-client.ts and ts/examples/phoenix-client-example.ts.
Order placement and cancellation
The SDK separates packet construction from instruction construction:- Build packet sizes and prices with
client.orderPackets - Build or wrap the actual Solana instructions with
client.ixs - Use the lower-level builders when you need conditional-account setup or other specialized flows
buildPlaceStopLoss(...) takes tick-based trigger prices. When starting from USD prices, convert them from market metadata first, or reuse the conditional-order patterns in ts/examples/05-cancel-all-conditional-orders.ts.ts/examples/03-build-limit-order-ix.tsts/examples/05-cancel-all-conditional-orders.tsrust/sdk/examples/send_limit_order.rsrust/sdk/examples/send_market_order.rsrust/sdk/examples/cancel_order.rs
Flight builder activation and routed orders
Flight is the builder-routing layer. Key pieces:- The builder still needs a Phoenix trader account
- Builder registration is its own on-chain instruction
- The builder’s associated trader account is the fee collector for Flight-routed orders
- Once a client is configured with
flight: { builderAuthority, ... }, supported order instructions are wrapped automatically
ts/src/flight/README.md.
Live market data
Use the typed WebSocket adapters when you want continuous updates instead of a single HTTP snapshot.TypeScript