Skip to main content
Version: Endpoint V2 Docs

Solana Guidance

Deploying Solana programs with a priority fee

This section applies if you are unable to land your deployment transaction due to network congestion.

Priority Fees are Solana's mechanism to allow transactions to be prioritized during periods of network congestion. When the network is busy, transactions without priority fees might never be processed. It is then necessary to include priority fees, or wait until the network is less congested.

Priority fees are calculated as follows: priorityFee = compute budget * compute unit price. We can make use of priority fees by attaching the --with-compute-unit-price flag to our solana program deploy command. Note that the flag takes in a value in micro lamports, where 1 micro lamport = 0.000001 lamport.

For example:

solana program deploy --program-id target/deploy/oft-keypair.json target/verifiable/oft.so -u devnet --with-compute-unit-price <COMPUTE_UNIT_PRICE_IN_MICRO_LAMPORTS>

You can run refer QuickNode's Solana Priority Fee Tracker to know what value you'd need to pass into the --with-compute-unit-price flag.

Deciding number of local decimals for your Solana OFT

As OFTs can span across VMs, with each VM potentially using a different data type for token amounts, it's important to understand the concept of decimals in the context of OFTs.

Make sure you understand shared decimals and local decimals before proceeding.

Before running the pnpm hardhat lz:oft:solana:create command, you should have decided the number of values to pass in for both the --shared-decimals and --local-decimals params.

For --shared-decimals, it should be the same across all your OFTs regardless of VM. Inconsistent values (i.e. one chain having a share decimals value of 4 while another has it as 6) can result in value loss. For more detail, read Token Transfer Precision.

On EVM chains, the data type that represents token amounts is uint256 and the common number of (local) decimals is 18. This results in an astronomically high possible max supply value.

(2^256 - 1) / 10^18 ≈ 1.1579 × 10^59 // (1.1579 million trillion trillion trillion trillion trillion)

In practice, tokens are typically created with a manually set max supply, for example: 1 billion (1 × 10⁹), 50 trillion (5 × 10¹³) or 1 quadrillion ( 1 × 10¹⁵).

Solana uses the u64 type to represent token amounts, with the decimals value defaulting to 9, although many tokens choose to go with 6 decimals. The possible max value by default (~18 billion) is a lot lower, so it's important to select a local decimals value on Solana that can fit your token's max supply.

Refer to the table below for a comparison between a Solana token's (local) decimals and the possible max supply value.

Max Supply in Solana for a Given Decimals Value (Decimals 9 to 4)

DecimalsMax Supply (in whole tokens)
9~1.84 × 10¹⁰ ( ~18 billion )
8~1.84 × 10¹¹ ( ~184 billion )
7~1.84 × 10¹² ( ~1.8 trillion )
6~1.84 × 10¹³ ( ~18 trillion )
5~1.84 × 10¹⁴ ( ~184 trillion )
4~1.84 × 10¹⁵ ( ~1.8 quadrillion )