solana-priority-fee
Solana priority fee estimator for JavaScript
The compute unit price recent Solana blocks landed at, scoped to the pool or bonding curve your transaction writes to, as percentiles and levels, plus the Compute Budget instruction bytes to pay it. Any RPC. Zero dependencies.
Try it
npx github:blixvip/solana-priority-fee 58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2
The account is the Raydium SOL-USDC pool, which every swap through it writes to. Real output from the public mainnet RPC on 2026-11-17:
150 slots (470718277-470718426), 1 account; 59.3% of slots had a non-zero fee
percentile micro-lamports/CU
min 0
p25 0
p50 3,227
p75 10,000
p90 10,000
p95 10,000
max 1,000,000
level micro-lamports/CU cost at 200,000 CU
low (p25) 0 0 lamports
medium (p50) 3,227 646 lamports
high (p75) 10,000 2,000 lamports
veryHigh (p95) 10,000 2,000 lamports
unsafeMax (p100) 1,000,000 200,000 lamports
cost excludes the 5,000 lamport base fee per signature.
What it does
- Percentiles (min, p25, p50, p75, p90, p95, max) of the last ~150 blocks, in micro-lamports per compute unit
- Scoped to up to 128 writable accounts, so you see the price for your pool, not the whole network
- Named levels
low/medium/high/veryHigh, each one changeable - The lamport cost, rounded the way the runtime rounds it
- The SetComputeUnitLimit and SetComputeUnitPrice instruction bytes, without
@solana/web3.js - Works with any Solana RPC, including the free public one
Use it in your code
npm install github:blixvip/solana-priority-fee
import { estimatePriorityFee, toInstructionsData, costLamports } from "solana-priority-fee";
const fee = await estimatePriorityFee({ accounts: ["58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2"] });
fee.recommended.high; // p75, micro-lamports per CU
costLamports(fee.recommended.high, 200_000); // lamports on top of the base fee
toInstructionsData(fee.recommended.high, 200_000).instructions; // the two Compute Budget instructions
Ready-made integrations
- HTTP fee endpoint:
GET /fee?accounts=...returns the estimate as JSON, cached for two seconds, on plainnode:http. - Discord fee alert: posts to a channel webhook when fees on an account cross your threshold, and again when they come back down.
Full documentation, the API and the limits are in the README. MIT licensed, no dependencies.
Guides
- How to set a Solana priority fee in JavaScript
- What is a good Solana priority fee right now (and how to measure it)
From the team behind Blix
solana-priority-fee is a small, open piece of what runs behind Blix, the AI-powered Solana memecoin terminal with 0% fees: every pump.fun launch live, AI coin ratings, narratives, wallet and X tracking, and one-click trading. If you want the result rather than the plumbing, start trading at blixvip.com. There is also a public API and an MCP server for AI agents.
Contribute
Pull requests are welcome and there are good first issues with step-by-step instructions. Setup is git clone and npm test. Ideas and questions go in Discussions or the Discord.