Withdraw

Event v101 → current #8

Emitted when tokens are withdrawn from an account.

View events on chain
Useful for: walletsdevelopersanalyticsexchanges

The Big Picture

Withdrawals reduce your balance - most commonly for transaction fees. Every transaction you submit costs fees, and Withdraw is how those fees are taken. Understanding your withdrawal patterns helps you budget for transaction costs and detect any unexpected account activity.

Why This Matters

Every action on-chain costs fees. Withdraw events show you what you're paying. If you're doing many transactions, fees add up. This helps you optimize your activity and catch any unexpected charges.

Example Scenario

You submit an add_stake transaction. Balances.Withdraw fires first (fee payment), then your stake operations, then ExtrinsicSuccess. The Withdraw amount is your transaction fee - usually small but visible in your account history.

Common Questions

Can Withdraw happen without me doing anything?
Typically no - withdrawals require you to sign a transaction. If you see unexpected withdrawals, review your account security immediately.
How do I reduce my fees?
Fees are based on transaction weight (computation). Simpler operations cost less. Batch operations when possible. Some calls have minimum fees regardless of size.

Use Cases

  • Track transaction fees being charged
  • Monitor account for unexpected withdrawals
  • Build fee analytics and estimation tools
  • Reconcile account activity

How to Use This Event

  • Track fees paid per transaction type
  • Build fee estimation from historical data
  • Monitor for unusual withdrawal patterns

From Chain Metadata

Some amount was withdrawn from the account (e.g. for transaction fees).

Triggers

Preconditions

  • Account has sufficient balance
  • Withdrawal operation executed

Effects

Postconditions

  • Account balance decreased

Side Effects

  • Commonly used for transaction fees

Event Data

#NameTypeDescription
0
who
AccountId Account funds withdrawn from (hex -> SS58)
1
amount
u64 Withdrawal amount (RAO) (RAO -> TAO (/ 10^9))

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 Withdraw events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("Balances") &&
      event.method === "Withdraw"
    )
    .forEach(({ event }) => {
      console.log("Withdraw:", event.data.toHuman());
    });
});

On-Chain Activity

Emission Frequency
●●●●●○ Dominant 5M–50M emissions

Core protocol operations, high volume

#6 most emitted event

As of block 7,429,232

Runtime Info

Pallet Index
5
Event Index
8
First Version
v101
Current Version
v393