FeeStatsResponse

@Serializable
data class FeeStatsResponse(val lastLedger: Long, val lastLedgerBaseFee: Long, val ledgerCapacityUsage: String, val feeCharged: FeeStatsResponse.FeeDistribution, val maxFee: FeeStatsResponse.FeeDistribution) : Response

Represents fee statistics response from the Horizon API.

Fee stats provide information about the transaction fees network validators are accepting. This data helps users set appropriate transaction fees to ensure their transactions are accepted by the network in a timely manner.

The response includes:

  • Information about the last closed ledger

  • Fee charged statistics (actual fees that were charged)

  • Max fee statistics (maximum fees users were willing to pay)

  • Percentile distributions for both fee types

See also

Constructors

Link copied to clipboard
constructor(lastLedger: Long, lastLedgerBaseFee: Long, ledgerCapacityUsage: String, feeCharged: FeeStatsResponse.FeeDistribution, maxFee: FeeStatsResponse.FeeDistribution)

Types

Link copied to clipboard
@Serializable
data class FeeDistribution(val min: Long, val max: Long, val mode: Long, val p10: Long, val p20: Long, val p30: Long, val p40: Long, val p50: Long, val p60: Long, val p70: Long, val p80: Long, val p90: Long, val p95: Long, val p99: Long)

Represents the statistical distribution of transaction fees.

Properties

Link copied to clipboard
@SerialName(value = "fee_charged")
val feeCharged: FeeStatsResponse.FeeDistribution

Distribution of fees that were actually charged

Link copied to clipboard
@SerialName(value = "last_ledger")
val lastLedger: Long

The sequence number of the last ledger

Link copied to clipboard
@SerialName(value = "last_ledger_base_fee")
val lastLedgerBaseFee: Long

The base fee in the last ledger (in stroops)

Link copied to clipboard
@SerialName(value = "ledger_capacity_usage")
val ledgerCapacityUsage: String

The capacity usage of the last ledger (as a decimal string, e.g., "0.97" for 97%)

Link copied to clipboard
@SerialName(value = "max_fee")
val maxFee: FeeStatsResponse.FeeDistribution

Distribution of maximum fees that users were willing to pay