Your dashboard has been live for a week. Tonight the SOL balance loads fine, one token row shows a number, then it flips to zero on the next refresh. Nothing on Solana broke. A second poll fired before the first response came back, an indexer answered from an older slot, and your UI believed both.
Every team hits that moment, and the fix is almost never "add more endpoints". It's picking the right delivery model for the data, then reading the number attached to it: credits per call, messages on an open connection, lamports per signature, compute-unit price.
Here's the working map, with the request shapes and the costs that go with each one.
Web3 API Types Compared at a Glance
| API type | Delivery model | Best for | Main cost driver |
|---|---|---|---|
| REST | Request and response | Wallet balances, token metadata, history lookups | Credits per request |
| JSON-RPC over HTTP | Request and response, batchable | Reading node state and sending transactions | Credits per method call |
| WebSocket | Persistent push subscription | Live prices, trades, slot and account changes | Message volume on an open connection |
| gRPC (Yellowstone) | Streaming over HTTP/2 | High-throughput indexing and enterprise pipelines | Subscription filters and stream volume |
REST answers one question per round trip. A wallet screen that loads a holdings table on page open wants exactly that: ask, receive, render, stop. JSON-RPC over HTTP keeps the same shape but speaks the JSON-RPC 2.0 format, so the call names a Solana method such as getBalance and passes its parameters, and it's also how transactions get submitted. WebSocket holds a connection open and pushes updates, so prices, trades and slot changes arrive without asking. gRPC, through a Yellowstone stream, pushes high-volume data over HTTP/2 and suits the indexer that needs every account update for a program rather than a summary.
The model isn't new. Ethereum's JSON-RPC documentation splits node interaction into gossip, state and history methods, which is the same split you're making when you choose between polling a balance and subscribing to a log.
Three scenarios, three rows: a wallet dashboard polling REST every 30 seconds, a trading bot listening on a WebSocket trade room, and a data indexer running gRPC filters on a single program. Match the row to your workload. If the bill is what worries you, start with the credit math rather than the feature list.
How JSON-RPC Requests Work on Solana
A Solana RPC call is a JSON object with four fields. Learn to read it and you can debug most failures from the response alone.

Request
{"jsonrpc":"2.0","id":1,"method":"getBalance","params":["7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",{"commitment":"confirmed"}]}
Response
{"jsonrpc":"2.0","id":1,"result":{"context":{"slot":"<slot>"},"value":"<lamports>"}}
The four fields that decide behavior
jsonrpc is fixed at 2.0. id is yours, and it's how you match a reply to a request. method names the Solana call, and params is an ordered array, so option order matters. The response carries result, and inside it a context.slot telling you which slot the answer came from.
The JSON-RPC 2.0 specification makes id optional on purpose. A request without one is a notification and gets no response at all, which is fine for fire-and-forget logging and wrong for anything you need to confirm. Batching several independent calls into one HTTP POST cuts transport overhead, and you should still cap the batch size and correlate every result by id.
Two failure paths need different handling. A JSON-RPC error object means the node understood you and refused, usually a bad parameter. An HTTP timeout or a 429 means you don't know whether the call ran, so back off with jitter and retry reads rather than writes.
A portfolio app can batch balance reads for ten wallets into one request, map each result to its id, and log any error object it gets back. The second call you'll hit on day one is getTokenAccountsByOwner: its response carries a context slot, so when a newer slot has already arrived, you can discard the stale answer instead of rendering it.
Subscribing to Live Data with WebSocket and gRPC
A trading dashboard for one token needs the current price and the last 50 trades on load. That is a REST call, and it bills as one request. Once that snapshot is on the page, stop asking.

accountSubscribe watches one account, such as a wallet balance, and pushes a message when it changes. On a live socket the billable unit is that message, not another REST credit. logsSubscribe streams program logs, so a DEX trade shows up as an event. Filter by program id. This method does not filter by token, and a wide program feed will flood the client. slotSubscribe pushes slot and skip notices, which gives you timing without polling for the current slot.
Solana Tracker's Datastream packages the same push model into managed rooms for prices, trades, token launches, wallet activity, and volume, with 20+ room types and unlimited messages. Copy the Datastream key, or the full wss:// URL, from the Data API dashboard. The key is optional and only enables live mode. REST works with any Data API key and does not require Datastream.
gRPC changes the volume question. Yellowstone filters are set at subscribe time, so the server sends only matching account and transaction updates. That is what an indexer wants when it must see every account update for one program, instead of one WebSocket per account.
| Option | Transport | What you subscribe to | Practical limit |
|---|---|---|---|
| WebSocket accountSubscribe | Persistent WebSocket | Changes to one account, such as a wallet balance | One subscription per account, so a long wallet list multiplies sockets |
| WebSocket logsSubscribe | Persistent WebSocket | Program logs and token events | Filter by program id, not by token, or the feed floods |
| WebSocket slotSubscribe | Persistent WebSocket | Slot and skip notifications | Timing only; it does not carry account or trade data |
| Solana Tracker Datastream | Managed WebSocket rooms | Prices, trades, token launches, wallet activity, volume | 20+ room types, unlimited messages; streaming key optional and only for live mode |
| gRPC (Yellowstone) | HTTP/2 stream | Account and transaction updates filtered at subscribe time | Higher throughput; best for indexers that must see every account update |
Resubscribe, then resnapshot. Updates sent while your socket was down are gone for that client. Fetch a fresh snapshot before you trust the next message. A dropped socket is a gap, not a queue you can replay.
One dashboard might hold a trade room and a wallet-activity room while a separate backend runs a gRPC filter for the same program. I would keep the UI on those rooms and put the full-program firehose on gRPC. Different jobs, different transports.
Latency and Credit Tradeoffs to Weigh
| Read option | Latency profile | Credit use | Choose when |
|---|---|---|---|
| Standard RPC method | One round trip per call | Standard credit cost per call | One-off reads and transaction sends |
| RidgeDB-powered V2 method | One round trip per call | About 90% fewer credits | High-volume reads where a V2 method exists |
| WebSocket subscription | Pushed on change, no polling delay | Charged by message volume | Live dashboards and bots |
| Polling REST | Delay equal to the poll interval | Every poll costs credits | Low-frequency checks |
A single request waits one round trip. A subscription delivers on change with no polling delay. Polling adds a delay equal to its interval, and every one of those polls is billable.
Here's the arithmetic that surprises people. A dashboard refreshing 500 token prices every five seconds fires about 100 requests per second. A WebSocket feed on the same 500 tokens sends messages only when a price moves, and quiet markets cost almost nothing.
The rule of thumb: subscribe to data that changes constantly, batch reads for data you check occasionally.
V2 methods are the other lever. RidgeDB-backed V2 calls return the same shape as their V1 counterpart at roughly a tenth of the credit cost, so a high-volume read should default to V2 wherever an equivalent exists and fall back to standard only while one is missing. For latency-sensitive bots, Shredstream delivers shred-level data before block confirmation. The OWASP API Security Top 10 is blunt about where uncontrolled consumption lands, and a polling loop nobody reviewed is exactly that.
How Solana Transaction Fees Break Down
A swap cost shown as one unexplained SOL figure is a support ticket waiting to happen. Solana's fee documentation gives you the parts to show instead: a base fee of 5,000 lamports per signature, plus an optional priority fee computed from the requested compute-unit price multiplied by the compute-unit limit.
| Fee component | Rule | Recipient |
|---|---|---|
| Base fee | 5,000 lamports per signature | 50% burned, 50% to validator |
| Priority fee | Compute-unit price multiplied by compute-unit limit | Entirely to validator |
| Total fee | Base fee plus priority fee | Split as above |
A one-signer swap starts at 5,000 lamports before any priority fee; two signers means 10,000. A bot racing for a congested launch raises its compute-unit price, which raises the priority fee, and that increase deserves its own line in your UI rather than being folded into a total.
Return the signature, compute-unit limit, compute-unit price, base fee, priority fee, and the burn versus validator split. Estimate before signing, compare against what was paid after confirmation, and present the estimate as a range, because congestion moves the priority number between quote and send.
Confirmation States and Safe Retries
A launch monitor sees a swap in one slot, the next slot is skipped, and the bot has no idea whether the swap landed. Slots run at roughly half a second each, and skipped slots are common enough that any timeout logic built on slot timing alone will guess wrong under load. A submitted transaction is not a finished one.
Track four states against a chosen commitment level: submitted, processed, confirmed, finalized. Label everything provisional until it reaches the level your product promises, and price that choice with care, since waiting for finality costs you latency on every single write.
A timeout is not a failure. It's an unknown, and unknowns get queried, not resent.
- Persist the signed transaction and its signature before you send anything.
- Send with an explicit timeout, so the client doesn't hang on a node that never answers.
- Query signature status on timeout instead of resending, because the node may have accepted it.
- Resend only when the signature is confirmed missing and its blockhash has expired.
- Retry reads with exponential backoff and jitter, keeping writes out of that loop.
Step 4 is where the money lives. A resent transaction that was accepted burns a second set of fees for nothing, and a rebuilt transaction after blockhash expiry pays the priority fee market twice. Checking signature status before rebuilding is the difference between a clean fill and a double spend of fees.
Wallet and Transfer Calls in Practice
Raw RPC gives you balances. It doesn't give you decimals, prices, pool ids or liquidity in the same breath, so a holdings table built on getBalance and getTokenAccountsByOwner turns into a chain of extra calls and joins.
Our wallet endpoint does that join on the server. One getWallet call returns every token a wallet holds with its balance, decimals, USD price, USD value, pool id, price-change events and a 1–10 risk score, plus wallet totals in USD and SOL. The transfers endpoint returns native SOL, SPL and Token-2022 movements in and out of a wallet, newest first, filtered by address, direction (in, out or both) and a limit.
- Create a Data API key in the dashboard.
- Send the wallet address with the key in the
x-api-keyheader. - Render holdings and the wallet total.
- Load transfers when the user opens the activity tab.
A portfolio widget calls getWallet on page load for the holdings table, then transfers only when someone clicks activity. Fields, response formats and endpoints can change with or without notice, so validate before rendering, and treat USD value and risk score as the two derived fields never to paint without a schema check.
Reading Token Risk Signals Before You Trade
A clean price chart tells you a token is trading. It says nothing about whether it will still be trading tomorrow, and the launch data is brutal. Independent analysis reported more than seven million tokens launched on Pump.fun between January 2024 and March 2025, with only about 97,000 retaining at least $1,000 in liquidity, as covered in CoinDesk's report on the findings. That reporting also put 98.6% of launches showing rug-pull or pump-and-dump characteristics, and 93% of examined Raydium pools showing soft-rug-pull traits.
| Signal | What it measures | Raise a flag when |
|---|---|---|
| Liquidity floor | USD value locked in the pool | Below about $1,000, the level only 97,000 of seven million launches reached |
| Liquidity withdrawal | Pool USD value over the first hours | Sharp drop shortly after launch |
| Creator-linked selling | Transfers from wallets tied to the mint authority or deployer | Early sells before public volume arrives |
| Mint and freeze authority | Whether authority is revoked | Freeze authority still active or mint authority retained |
| Sniper and bundler wallets | Wallets buying in the launch slot or bundled transactions | Large share of supply bought at launch |
| Rugcheck score | 20+ weighted risk factors combined | Score near the risky end of the 1–10 scale |
Rugcheck-style scoring combines those factors into a single number, and you can check a Solana token's rug risk through the API before a swap rather than after.
A token with a spotless chart whose liquidity gets pulled by creator-linked wallets in the first hours should trigger the flag before your buyer enters, not an hour later. Keep the layers straight: authority status and liquidity amounts are on-chain facts, the score is a signal computed on top of them. Recheck after any large liquidity event, because a score from launch goes stale the moment the pool changes.
Securing Your API Key and Endpoints
An API key proves someone has a key. It doesn't prove who they are or what they're allowed to read. Four controls do that work.

Key handling. Send the key in the x-api-key header from a server, never from browser code, never from a public repository. Scope. Read-only keys belong on read paths, and any endpoint that signs or sends a transaction should reject them outright. Limits. Per-key quotas, request-size caps, pagination ceilings and WebSocket subscription limits keep one runaway loop from becoming your whole bill. Logging. Record method, wallet, result, latency and a correlation ID, and never log private keys or seed material.
Ownership is the control people skip. A wallet address alone doesn't prove a caller may read a private portfolio, so private endpoints authenticate the caller, not the address the caller typed in.
Inventory the routes you retired. A deprecated endpoint left reachable with a live key is an open door nobody is watching.
A dashboard keeps its key on the server, calls the API from its backend, and returns only rendered data to the browser. Before launch, check that the key never ships to the client, read and write scopes are split, quotas are per key, logs carry a correlation ID, and every REST, RPC and WebSocket route including old versions is listed in one place and the dead ones are closed.
Pick Your Web3 API and Make a First Call
- One-off reads and transaction sends: REST or JSON-RPC over HTTP.
- Live updates: WebSocket, because a subscription beats a poll loop on both latency and credits.
- High-volume indexing: gRPC with filters set at subscribe time.
- The first build: skip streaming entirely until something needs it.
A Solana Tracker Data API key includes 2,500 free requests a month, with no credit card required, and REST access works with that key without any Datastream setup.
- Create a Data API key.
- Install the SDK, published on npm as
@solana-tracker/data-api. - Call
getWalletfor a test wallet address. - Check the returned fields against the wallet and risk tables above.
The request shape is short: the wallet address plus the key in the x-api-key header. Once that returns data you trust, add a WebSocket room only where the workload needs pushed updates, and switch a high-volume read to a V2 method when credits start climbing.
Staying Reliable When the Chain Is Up but Your API Is Degraded
Solana mainnet has run more than 15–16 months continuously with over 162 million daily transactions, according to Helius's Solana ecosystem report. Chain reliability and application reliability are different products. The same reporting documents January 2025 demand spikes producing degraded block-engine performance, slippage, badly configured priority fees and transactions that were never picked up, all while blocks kept landing.
The failure mode that costs money is quieter than an outage. A provider answering HTTP 200 with balances six slots old has not failed by its own uptime metric. It has failed by yours, and the only defense is labeling that data provisional until the slot catches up. Every retry you send on top of stale data still bills credits per call, still burns lamports per signature if it lands, and still pays the compute-unit price you attached. Degraded infrastructure does not refund any of those numbers.
- Read the same fact twice, from a direct RPC call and an indexed API, and compare the slots they report.
- Treat a missing WebSocket event as unconfirmed until a snapshot recheck agrees.
- Cap the priority fee from live compute-unit prices instead of a fixed number chosen last month.
- Route around a degraded endpoint by falling back to a second provider for the same method.
- Log slot, blockhash and signature status for every transaction the app reports, so a gap can be traced to the chain or to the indexer.
The first two checks are cheap insurance. Comparing slots costs one extra indexed call, and a snapshot recheck after a dropped stream event costs one REST request instead of a blind retry at a compute-unit price you cannot verify. The third item is where budgets leak during congestion: a priority fee hardcoded in calm conditions either overpays when demand falls or underpays exactly when inclusion matters, and a capped live quote keeps that number honest.
Solana Tracker covers these checks through separate keys for separate jobs. REST calls, including the wallet endpoint that joins mints, decimals, prices and liquidity server side, authenticate with a Data API key from the Data API dashboard. Live mode over the Datastream WebSocket uses an optional Datastream key copied from the same dashboard, so a streaming problem never blocks your snapshot rechecks: when a room goes quiet, the REST fallback already works on the key you have. The Solana RPC side adds Shredstream and V2 methods when credit consumption on high-volume reads starts to matter.
One caution applies to any provider in the loop, this one included: API schemas, response formats, and endpoints may change with or without notice. Pin your SDK version, keep the parsing layer thin, and treat the checklist above as a permanent part of the app rather than incident plumbing. A chain that stays up while your data layer degrades is the normal case, and the apps that handle it are the ones that measure freshness instead of trusting status codes.