> ## Documentation Index
> Fetch the complete documentation index at: https://developers.fireblocks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate Balances

> How to reconcile incoming deposits against the blockchain with Fireblocks webhooks before you credit end users, and when to fall back to polling.

Before you credit end users for incoming transactions, confirm that each deposit is reflected in the vault balance and on the blockchain. Webhooks give you everything you need for this check. Subscribe to these events:

* [`transaction.status.updated`](https://developers.fireblocks.com/reference/webhooks-structures-eventtypes-transaction): transaction lifecycle. It includes the `blockInfo` object, with `blockHeight` and `blockHash` for the block that includes the transaction.
* [`vault_account.asset.balance_updated`](https://developers.fireblocks.com/reference/webhooks-structures-eventtypes-wallet): balance changes. Each event carries the full balance (`total`, `pending`, `frozen`, `lockedAmount`, `staked`) and, when available, `blockHeight` and `blockHash`. See [VaultAccountBalanceUpdate](https://developers.fireblocks.com/reference/vault-objects.md#vaultaccountbalanceupdate).

## Reconcile before you credit

Reconcile every deposit against the blockchain before you credit end users. This independent check complements the accuracy controls Fireblocks applies to balance data. Follow these steps:

1. Wait for `transaction.status.updated` with status `COMPLETED`. Note `blockInfo.blockHeight`.
2. Wait for a `vault_account.asset.balance_updated` event for the same vault account and asset with a `blockHeight` equal to or greater than the transaction's `blockHeight`.
3. Compare the balance with the blockchain state at that height. If they don't match, don't credit the end user until you investigate and resolve the difference.

`blockHeight` and `blockHash` can be missing for some asset types or in specific scenarios. In that case, order balance events by their `createdAt` timestamp and rely on the check against the blockchain in step 3.

For some assets, such as TRX and SOL, a balance event may not follow a completed transaction. See [When to poll](#when-to-poll).

The diagram shows this flow:

```mermaid theme={"system"}
sequenceDiagram
  participant BC as Blockchain
  participant FB as Fireblocks
  participant C as Your backend
  FB->>C: transaction.status.updated (COMPLETED, blockInfo.blockHeight)
  FB->>C: vault_account.asset.balance_updated (blockHeight >= transaction blockHeight)
  C->>BC: Check balance at that block height
  BC-->>C: On-chain balance
  alt Balances match
    C->>C: Credit the end user
  else Balances differ
    C->>C: Hold the credit and investigate
  end
```

## Handle balance event ordering

For general webhook handling, see:

* [Best practices for webhooks](https://developers.fireblocks.com/reference/webhooks-best-practices.md) for duplicate events and delivery order.
* [Responses and retries](https://developers.fireblocks.com/reference/webhooks-gettingstarted-responsesretries.md) for delivery and retry behavior.
* [Validating webhooks](https://developers.fireblocks.com/reference/validating-webhooks.md) for signature verification.

Balance events need two extra rules:

* Each balance event contains the full balance, not a delta. Replace your stored balance with the latest event and ignore events at a lower `blockHeight`.
* Several balance events can share a `blockHeight` (for example, when funds are locked or unlocked). Compare `blockHash` as well, because a reorg can change the hash at the same height.

## When to poll

Polling is a fallback, not the default. Use it only in the cases below, and keep requests low to stay within your [rate limit](https://developers.fireblocks.com/reference/rate-limiting.md) tier.

* **Assets that complete without a pending state** (for example, TRX and SOL). The transaction reaches `COMPLETED`, but a balance event may not follow when the balance didn't change. After the `COMPLETED` webhook, call [Get the asset balance for a vault account](https://developers.fireblocks.com/api-reference/vaults/get-the-asset-balance-for-a-vault-account.md) (`GET /vault/accounts/{vaultAccountId}/{assetId}`) once and apply step 3 of [Reconcile before you credit](#reconcile-before-you-credit).
* **Startup and catch-up.** Read the current balance when a consumer starts, after downtime, or when you add a subscription. Webhooks only carry changes.

The balance endpoint returns the same fields as the balance webhook. Use it to fetch state, not as an independent verification. Validate against the blockchain.
