getblockstats

Back to blockchain

Summary

Compute per block statistics for a given window. All amounts are in satoshis.

Description

Compute per block statistics for a given window. All amounts are in satoshis. It won't work for some heights with pruning.

Arguments

  • hash_or_height (NUM, required): The block hash or height of the target block
  • stats (ARR): Values to plot (see result below)
  • height (STR): Selected statistic
  • time (STR): Selected statistic

Results

  • value (OBJ): No description.
  • avgfee (NUM, optional): Average fee in the block
  • avgfeerate (NUM, optional): Average feerate (in satoshis per virtual byte)
  • avgtxsize (NUM, optional): Average transaction size
  • blockhash (STR_HEX, optional): The block hash (to check for potential reorgs)
  • feerate_percentiles (ARR_FIXED, optional): Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte)
    • 10th_percentile_feerate (NUM): The 10th percentile feerate
    • 25th_percentile_feerate (NUM): The 25th percentile feerate
    • 50th_percentile_feerate (NUM): The 50th percentile feerate
    • 75th_percentile_feerate (NUM): The 75th percentile feerate
    • 90th_percentile_feerate (NUM): The 90th percentile feerate
  • height (NUM, optional): The height of the block
  • ins (NUM, optional): The number of inputs (excluding coinbase)
  • maxfee (NUM, optional): Maximum fee in the block
  • maxfeerate (NUM, optional): Maximum feerate (in satoshis per virtual byte)
  • maxtxsize (NUM, optional): Maximum transaction size
  • medianfee (NUM, optional): Truncated median fee in the block
  • mediantime (NUM, optional): The block median time past
  • mediantxsize (NUM, optional): Truncated median transaction size
  • minfee (NUM, optional): Minimum fee in the block
  • minfeerate (NUM, optional): Minimum feerate (in satoshis per virtual byte)
  • mintxsize (NUM, optional): Minimum transaction size
  • outs (NUM, optional): The number of outputs
  • subsidy (NUM, optional): The block subsidy
  • swtotal_size (NUM, optional): Total size of all segwit transactions
  • swtotal_weight (NUM, optional): Total weight of all segwit transactions
  • swtxs (NUM, optional): The number of segwit transactions
  • time (NUM, optional): The block time
  • total_out (NUM, optional): Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee])
  • total_size (NUM, optional): Total size of all non-coinbase transactions
  • total_weight (NUM, optional): Total weight of all non-coinbase transactions
  • totalfee (NUM, optional): The fee total
  • txs (NUM, optional): The number of transactions (including coinbase)
  • utxo_increase (NUM, optional): The increase/decrease in the number of unspent outputs (not discounting op_return and similar)
  • utxo_size_inc (NUM, optional): The increase/decrease in size for the utxo index (not discounting op_return and similar)
  • utxo_increase_actual (NUM, optional): The increase/decrease in the number of unspent outputs, not counting unspendables
  • utxo_size_inc_actual (NUM, optional): The increase/decrease in size for the utxo index, not counting unspendables

Examples

qbit-cli getblockstats '"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"' '["minfeerate","avgfeerate"]'
qbit-cli getblockstats 1000 '["minfeerate","avgfeerate"]'
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getblockstats", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09", ["minfeerate","avgfeerate"]]}' -H 'content-type: application/json' http://127.0.0.1:8352/
curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "getblockstats", "params": [1000, ["minfeerate","avgfeerate"]]}' -H 'content-type: application/json' http://127.0.0.1:8352/