Dras accumsan nulla nec lacus ultricies placerat.
  • By admin
  • July 29, 2024
  • No Comments

Solana Compute Unit Price Guide

The compute unit price is the core variable that determines your transaction priority on the Solana network. Expressed in microlamports per compute unit, it represents how much you are willing to pay per unit of computation your transaction requires.

Solana's validator scheduler calculates each transaction's priority score using the formula:

Priority Score = (Prioritization Fee + Non-burned Base Fee) / Estimated Compute Cost

Compute unit price diagram
Solana scheduler priority scoring

Transactions with higher priority scores are dequeued and executed first. Setting an unnecessarily high CU limit actually increases your estimated cost in the scheduler's view while keeping your fee fixed, resulting in a lower priority score than if you had set a more accurate CU limit.

Solana compute unit optimization guide

Best practice is to simulate your transaction first using simulateTransaction to find the actual compute unit consumption, then set your CU limit to that value plus a small buffer (typically 10–20%). Then set your compute unit price based on current network conditions from getRecentPrioritizationFees at your desired percentile.

Leave a Reply

Your email address will not be published. Required fields are marked *