Understanding Solana Transaction Costs
Every Solana transaction requires a base fee (paid in SOL) to compensate validators for processing. You can also optionally pay a prioritization fee to increase the likelihood of your transaction being processed by the current leader (validator).
Fee Structure Breakdown
- Base Fee: 5,000 lamports per signature in the transaction
- Prioritization Fee (optional): Additional payment to validators to boost processing priority
- Prioritization fee formula: (Compute Unit Limit × Compute Unit Price)
Key Components Explained
- Compute Unit Limit: Maximum computational units your transaction can use
Compute Unit Price: Price per compute unit in micro-lamports
- Conversion: 1,000,000 micro-lamports = 1 lamport
- Fee Payer: Must be an account owned by the System Program
👉 Learn how to optimize your Solana transaction costs
Base Fee Mechanics
The base fee represents the fundamental cost of sending a transaction:
- Charged per signature included in the transaction
- Deducted from the fee payer's account (first signer in the transaction)
Fund distribution:
- 50% burned
- 50% paid to the processing validator
Prioritization Fees Explained
Optional fees that increase your transaction's processing priority:
- 100% goes to the validator processing your transaction (per SIMD-0096)
- Calculated based on requested compute units, not actual usage
Compute Units and Limits
When transactions execute, they consume computational resources measured in Compute Units (CU):
- Maximum Limit: 1.4 million CU per transaction
- Default Limit: 200,000 CU per instruction
- Custom Limits: Set via
SetComputeUnitLimitinstruction
👉 Discover advanced compute optimization techniques
Compute Unit Pricing
The compute unit price (in micro-lamports) determines your prioritization fee:
- Dynamic pricing based on network conditions
- Convertible to lamports (1 lamport = 1M micro-lamports)
- Set via
SetComputeUnitPriceinstruction
Prioritization Fee Calculation
Prioritization Fee = Compute Unit Limit × Compute Unit Price
Best practices for setting fees:
- Simulate transactions to estimate required CUs
- Add 10% safety margin
- Use optimized Compute Unit Limits
Priority ranking formula accounts for:
- Compute unit allocation
- Base fee
- Signature processing costs
- Write-lock operations
Practical Examples
Example 1: Basic Transaction
// Default settings (no prioritization fee)Example 2: Priority Transaction
SetComputeUnitLimit(300,000)
SetComputeUnitPrice(1,000) // 1,000 micro-lamports per CUFAQ Section
What happens if I set too high of a compute unit limit?
You may pay for unused compute units without gaining additional benefits. Always estimate needs accurately.
How do I estimate the right compute unit limit?
Simulate your transaction first, then add a 10-15% buffer to the observed usage.
Can I get refunded for unused compute units?
No, prioritization fees are calculated based on requested (not actual) usage.
Why is half the base fee burned?
This economic mechanism helps regulate SOL supply and network security.
How often do compute unit prices change?
Prices fluctuate based on network demand. Monitor current conditions for optimal fee setting.
Key Takeaways
- Understand both base and prioritization fee structures
- Optimize compute unit limits through simulation
- Monitor network conditions for best pricing
- Balance cost with transaction urgency
- Follow Solana's official guidelines for fee management