Portal Community

estimate

FieldTypeRequiredDescription
totext✓ YesTarget address of the call to estimate.
valuetextNoETH to send, in wei.
datatextNoCalldata hex, for a contract call.
fromtextNoCaller address to estimate as.
{ "success": true, "gasUnits": "51302" }

price

Legacy eth_gasPrice. No operation-specific fields.

{ "success": true, "gasPriceWei": "30000000000", "gasPriceGwei": 30.0 }

feeHistory

FieldTypeRequiredDescription
blockCountnumber✓ YesNumber of recent blocks to fetch fee data for. Must be positive.
newestBlocktextNo (default "latest")Block number/tag to end the range at.
rewardPercentilestext (JSON array of numbers)NoPercentiles (e.g. [10,50,90]) to sample priority-fee rewards at, per block.
{
  "success": true,
  "oldestBlock": 19383921,
  "blocks": [
    { "blockNumber": 19383921, "baseFeePerGasWei": "18500000000", "gasUsedRatio": 0.62, "rewardsWei": ["1000000000","2000000000","5000000000"] }
  ]
}

priorityFee

eth_maxPriorityFeePerGas — a non-standard-but-widely-supported RPC method. No operation-specific fields.

{ "success": true, "priorityFeeWei": "1500000000", "priorityFeeGwei": 1.5 }

optimize

A composite feature, not a raw RPC primitive — combines gas.price, gas.feeHistory, and gas.priorityFee into a single recommended EIP-1559 fee pair for a chosen risk strategy.

FieldTypeRequiredDescription
strategyselectNo (default "standard")safe | standard | fast.
operationstext (JSON array)NoPending call descriptions ({"to","value","data","from"}) to also estimate gas units and total cost for.
{
  "success": true,
  "strategy": "standard",
  "baseFeePerGasWei": "18500000000",
  "maxPriorityFeePerGasWei": "1500000000",
  "maxFeePerGasWei": "38500000000",
  "estimatedGasUnits": "51302",
  "estimatedTotalCostWei": "1975642700000000"
}
Heuristic, not empirically validated: the per-strategy fee multipliers are clearly labeled in code as a reasonable heuristic, not a rigorously tuned or empirically validated model. Treat gas.optimize's output as a starting point, especially for fast during volatile fee markets — re-check with gas.price/gas.feeHistory directly if a transaction is time-sensitive.