Connect to Devnet
PRISM is deployed on Solana Devnet. To talk to it from a frontend, server script, or indexer you need three things:- A
Connectionto a Solana RPC endpoint. - An
AnchorProviderthat bundles the connection with a signer. - A
Programinstance for each on-chain program, built from the bundled IDL.
Architecture
Step-by-Step
Create a Solana connection
The connection wraps the RPC URL, a commitment level, and an optional WebSocket endpoint.For production-grade clients use Helius or another commercial RPC — the public devnet endpoint is rate-limited and shares one queue with every other developer.Setting
wsEndpoint is what enables real-time onAccountChange subscriptions later.Build a wallet-bound provider
The provider attaches a signer to the connection. The SDK supports two patterns.Server scripts and indexers (a Browser apps (Solana wallet adapter — Phantom, Backpack, Solflare):Read paths (
Keypair you control):useAnchorWallet() returns undefined until the user connects, so always guard the provider against null.Read-only (no signer needed for queries):program.account.X.fetch) never require a signature, so a dummy wallet is fine for indexers, dashboards, and SSR.Reading a Single Account
Every account type hasfetch (throws if missing) and fetchNullable (returns null):
Reading Multiple Accounts in Parallel
Promise.all is fine for a handful of accounts. For dashboards that read dozens at once, prefergetMultipleAccountsInfo and decode manually — one network round trip instead of N:
Decoding NAV (Q64.64)
NAV-per-share is stored as a Q64.64 fixed-pointu128. Q64_ONE = 2^64 represents the value 1.0. Convert with the SDK helper or inline:
Number() directly — JavaScript loses precision above 2^53. Always go through BigInt.
Live Updates with Account Subscriptions
For a live dashboard, subscribe to account changes over WebSocket:The Polling Pattern (No WebSocket)
If your environment doesn’t support WebSockets (Cloudflare Workers, some serverless platforms), poll instead. The PRISM frontend uses 5-second polling via React Query:Error Handling
Read paths throw if the network fails or an account is missing (fetch) or truncated. Wrap in try/catch and prefer fetchNullable when an account may legitimately not exist yet:
What’s Next
Now that you have a livecore and amm program in hand, the next step is your first signed transaction:
Invest in a Tranche
Deposit USDC and receive Prime, Core, or Alpha tranche tokens.
Deployed Addresses
Reference for every program ID, PDA seed, and mint.
