Skip to main content
When you’re past the prototype stage and shipping a production daemon, indexer, trading bot, or long-running agent worker, reach for the Rust SDK. Instead of managing raw HTTP requests, gRPC channels, and WebSocket connections yourself, the SDK handles connection lifecycle, authentication, retries, failover, and reconnection behind a clean API.
For interactive agent workflows in Claude Code or Cursor, prefer the MCP server. For shell scripts and CI, prefer the CLI. The SDK is for code your agents write: production services that run independently.

Install

Combine features as needed, e.g. --features "ws grpc" for an indexer that subscribes to both surfaces.

What’s included

Environment variables

The SDK reads endpoints from the environment if you don’t pass them explicitly. This is the recommended pattern for agent-generated code: the agent never has to hard-code URLs or keys, and the same binary works across regions and networks.

Quick example

A minimal RPC agent that reads its endpoint from the environment and queries balance with retry/failover handled automatically:
With explicit failover regions:
The first URL is primary; the rest are fallbacks tried in order on failure.

Streaming with Yellowstone gRPC

subscribe_yaml reads filters from a YAML config; for programmatic filters use client.subscribe(SubscribeRequest { .. }) instead. The Jetstream client mirrors this pattern. Swap GeyserClientBuilder for JetstreamClientBuilder.

Why use the SDK over raw HTTP

For agent-written production code, the SDK handles the cross-cutting concerns that are easy to get wrong:
  • Retries with exponential backoff, configurable per client
  • Multi-region failover: primary fails, fallbacks tried in order
  • Auth injection: license key added to every request, never stored in the endpoint
  • WebSocket reconnect: subscriptions auto-resubscribe after disconnect
  • gRPC channel management: keepalive, reconnect, backoff
  • Typed responses: common methods deserialize into Rust structs, with raw escape hatches available for everything else
When you ask an agent to write an OrbitFlare integration, point it at the SDK and the resulting code stays small, idiomatic, and resilient.

Source