TransactionFeePaid
Event v101 → current #0Emitted when a transaction fee has been paid by an account.
View events on chainThe Big Picture
Every transaction on Bittensor costs a fee, calculated from the weight (computational resources) plus any optional tip for priority. This event fires after every transaction, recording exactly how much was paid. The fee goes to block producers as reward for including your transaction. Understanding fees is crucial for cost estimation and network economics.
Why This Matters
Every transaction costs TAO. This event tells you exactly how much you paid - the base fee plus any tip you added. Monitor this to understand your transaction costs and optimize your fee strategy. High tips get priority; standard fees may wait during congestion.
Example Scenario
You submit a set_weights transaction with a 0.001 TAO tip to ensure fast inclusion. After execution, TransactionFeePaid fires showing: your account, actual_fee of 0.0015 TAO (base + tip), and tip of 0.001 TAO. Your balance is now 0.0015 TAO lower.
Common Questions
- What determines the actual_fee?
- It's weight-based fee (computational cost) + length fee (transaction size) + tip. Complex transactions cost more. The NextFeeMultiplier adjusts based on network load.
- Do I pay fees if my transaction fails?
- Yes - fees are paid regardless of transaction success. The chain did computational work to execute your call, even if it reverted. Only the fee differs based on actual weight used.
- Where does the fee go?
- To block producers (validators) as reward for including and executing your transaction. This incentivizes validators to build and validate blocks.
- How can I reduce fees?
- Submit simpler transactions (fewer operations), batch calls when possible, and submit during low-congestion periods. Tips are optional - use them only when you need priority.
Use Cases
- Calculate actual transaction costs after execution
- Track gas/fee usage patterns across the network
- Build fee estimation models from historical data
- Reconcile account balances with fee deductions
- Monitor tip behavior for priority transactions
How to Use This Event
- → Subscribe to your account to track fee spending
- → Index all events to build fee analytics dashboards
- → Compare actual_fee to estimated fees for model improvement
- → Track tip patterns during high-congestion periods
From Chain Metadata
A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee, has been paid by `who`.
Triggers
Preconditions
- Transaction has been executed (success or failure)
- Account has sufficient balance for fees
Effects
Postconditions
- Fee deducted from account's free balance
- Fee added to block author's rewards
Side Effects
- Reduces total issuance if fee is burned
- May trigger DustLost if remaining balance is below existential deposit
Event Data
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Subscribe to TransactionFeePaid events
api.query.system.events((events) => {
events
.filter(({ event }) =>
event.section === stringCamelCase("TransactionPayment") &&
event.method === "TransactionFeePaid"
)
.forEach(({ event }) => {
console.log("TransactionFeePaid:", event.data.toHuman());
});
});On-Chain Activity
Protocol plumbing — fires on nearly every extrinsic
#1 most emitted event
As of block 7,429,232
Runtime Info
- Pallet Index
- 6
- Event Index
- 0
- First Version
- v101
- Current Version
- v393