Pass a base64-encoded transaction to get fee settings for that transaction in one call. The method simulates it to estimate a compute-unit limit and loaded accounts data size limit, then prices the recent fee market for the accounts it write-locks, including accounts from lookup tables. contested is true when two or more fee payers wrote to one of those accounts in the sampled blocks.
Set the transaction's compute-unit limit to the returned cu_limit and its loaded accounts data size limit to loaded_accounts_data_size_limit before applying a fee quote. The quote is accurate only when both limits are set. Use recommended.priority_fee_lamports as the absolute fee for a version 1 transaction, or recommended.cu_price as the microlamport-per-compute-unit price for a legacy or version 0 transaction.
The transaction carries the account and compute information. Sending account, accounts, cu_limit, or api_version as separate parameters returns -32602.
Parameters
- transactionstringREQUIRED
Required. Base64-encoded legacy, version 0, or version 1 transaction, signed or unsigned. The method derives accounts and compute requirements from the transaction.
- last_n_blocksinteger
Optional. Number of recent blocks to analyze, from 1 to 200. Defaults to 150.
Returns
- resultobject
Transaction-specific version 3 fee quote and simulation results.
- contextobject
Response context.
- slotinteger
Current Solana slot.
- contestedboolean
True when two or more fee payers wrote to at least one account this transaction write-locks in the sampled block window; otherwise false.
- cu_limitinteger
Compute-unit limit used to calculate the lamport quotes. Set this limit on the transaction when applying a quote.
- levelsobject
Low, medium, high, and extreme fee quotes.
- lowobject
Low fee level.
- cu_priceinteger
Compute-unit price in microlamports for legacy and version 0 transactions.
- priority_fee_lamportsinteger
Total priority fee in lamports at the returned CU limit; use this amount for a version 1 transaction.
- percentileinteger
Percentile represented by this level.
- mediumobject
Medium fee level.
- cu_priceinteger
Compute-unit price in microlamports for legacy and version 0 transactions.
- priority_fee_lamportsinteger
Total priority fee in lamports at the returned CU limit; use this amount for a version 1 transaction.
- percentileinteger
Percentile represented by this level.
- highobject
High fee level.
- cu_priceinteger
Compute-unit price in microlamports for legacy and version 0 transactions.
- priority_fee_lamportsinteger
Total priority fee in lamports at the returned CU limit; use this amount for a version 1 transaction.
- percentileinteger
Percentile represented by this level.
- extremeobject
Extreme fee level.
- cu_priceinteger
Compute-unit price in microlamports for legacy and version 0 transactions.
- priority_fee_lamportsinteger
Total priority fee in lamports at the returned CU limit; use this amount for a version 1 transaction.
- percentileinteger
Percentile represented by this level.
- loaded_accounts_data_size_limitinteger
Loaded accounts data size limit in bytes used for the quote. Set this limit on the transaction when applying a quote.
- percentilesobject
Fee quotes at 5-percentile intervals from 5 through 95. Each percentile has cu_price in microlamports and priority_fee_lamports in lamports.
- <percentile>object
A percentile key from 5 through 95 in steps of 5; each value has the same fee quote fields.
- cu_priceinteger
Compute-unit price in microlamports for legacy and version 0 transactions.
- priority_fee_lamportsinteger
Total priority fee in lamports at the returned CU limit; use this amount for a version 1 transaction.
- recommendedobject
Recommended fee quote for the accounts this transaction write-locks, based on the sampled block window.
- cu_priceinteger
Compute-unit price in microlamports for legacy and version 0 transactions.
- priority_fee_lamportsinteger
Total priority fee in lamports at the returned CU limit; use this amount for a version 1 transaction.
- levelstring
Selected fee level: low, medium, high, or extreme.
- simulationobject
Resource use measured while simulating the supplied transaction.
- loaded_accounts_data_sizeinteger
Loaded accounts data size in bytes used during simulation.
- slotinteger
Slot at which the transaction was simulated.
- units_consumedinteger
Compute units consumed by the simulation.
1{2"id": 1,3"jsonrpc": "2.0",4"result": {5"contested": true,6"context": {7"slot": 4717888048},9"cu_limit": 11016,10"levels": {11"extreme": {12"cu_price": 1826344,13"percentile": 90,14"priority_fee_lamports": 2012015},16"high": {17"cu_price": 735385,18"percentile": 75,19"priority_fee_lamports": 810220},21"low": {22"cu_price": 0,23"percentile": 25,24"priority_fee_lamports": 025},26"medium": {27"cu_price": 0,28"percentile": 50,29"priority_fee_lamports": 030}31},32"loaded_accounts_data_size_limit": 98304,33"percentiles": {34"5": {35"cu_price": 0,36"priority_fee_lamports": 037},38"10": {39"cu_price": 0,40"priority_fee_lamports": 041},42"15": {43"cu_price": 0,44"priority_fee_lamports": 045},46"20": {47"cu_price": 0,48"priority_fee_lamports": 049},50"25": {51"cu_price": 0,52"priority_fee_lamports": 053},54"30": {55"cu_price": 0,56"priority_fee_lamports": 057},58"35": {59"cu_price": 0,60"priority_fee_lamports": 061},62"40": {63"cu_price": 0,64"priority_fee_lamports": 065},66"45": {67"cu_price": 0,68"priority_fee_lamports": 069},70"50": {71"cu_price": 0,72"priority_fee_lamports": 073},74"55": {75"cu_price": 0,76"priority_fee_lamports": 077},78"60": {79"cu_price": 0,80"priority_fee_lamports": 081},82"65": {83"cu_price": 0,84"priority_fee_lamports": 085},86"70": {87"cu_price": 321805,88"priority_fee_lamports": 354689},90"75": {91"cu_price": 735385,92"priority_fee_lamports": 810293},94"80": {95"cu_price": 1145425,96"priority_fee_lamports": 1261997},98"85": {99"cu_price": 1451798,100"priority_fee_lamports": 15994101},102"90": {103"cu_price": 1826344,104"priority_fee_lamports": 20120105},106"95": {107"cu_price": 2103577,108"priority_fee_lamports": 23174109}110},111"recommended": {112"cu_price": 735385,113"level": "high",114"priority_fee_lamports": 8102115},116"simulation": {117"loaded_accounts_data_size": 75085,118"slot": 471788804,119"units_consumed": 8805120}121}122}
1{2"id": 1,3"jsonrpc": "2.0",4"result": {5"contested": true,6"context": {7"slot": 4717888048},9"cu_limit": 11016,10"levels": {11"extreme": {12"cu_price": 1826344,13"percentile": 90,14"priority_fee_lamports": 2012015},16"high": {17"cu_price": 735385,18"percentile": 75,19"priority_fee_lamports": 810220},21"low": {22"cu_price": 0,23"percentile": 25,24"priority_fee_lamports": 025},26"medium": {27"cu_price": 0,28"percentile": 50,29"priority_fee_lamports": 030}31},32"loaded_accounts_data_size_limit": 98304,33"percentiles": {34"5": {35"cu_price": 0,36"priority_fee_lamports": 037},38"10": {39"cu_price": 0,40"priority_fee_lamports": 041},42"15": {43"cu_price": 0,44"priority_fee_lamports": 045},46"20": {47"cu_price": 0,48"priority_fee_lamports": 049},50"25": {51"cu_price": 0,52"priority_fee_lamports": 053},54"30": {55"cu_price": 0,56"priority_fee_lamports": 057},58"35": {59"cu_price": 0,60"priority_fee_lamports": 061},62"40": {63"cu_price": 0,64"priority_fee_lamports": 065},66"45": {67"cu_price": 0,68"priority_fee_lamports": 069},70"50": {71"cu_price": 0,72"priority_fee_lamports": 073},74"55": {75"cu_price": 0,76"priority_fee_lamports": 077},78"60": {79"cu_price": 0,80"priority_fee_lamports": 081},82"65": {83"cu_price": 0,84"priority_fee_lamports": 085},86"70": {87"cu_price": 321805,88"priority_fee_lamports": 354689},90"75": {91"cu_price": 735385,92"priority_fee_lamports": 810293},94"80": {95"cu_price": 1145425,96"priority_fee_lamports": 1261997},98"85": {99"cu_price": 1451798,100"priority_fee_lamports": 15994101},102"90": {103"cu_price": 1826344,104"priority_fee_lamports": 20120105},106"95": {107"cu_price": 2103577,108"priority_fee_lamports": 23174109}110},111"recommended": {112"cu_price": 735385,113"level": "high",114"priority_fee_lamports": 8102115},116"simulation": {117"loaded_accounts_data_size": 75085,118"slot": 471788804,119"units_consumed": 8805120}121}122}