Deposits

Storage Map v154 → current

Deposits reserved by accounts for entering or extending safe-mode.

Explore chain
Queried by: validatorsdevelopersanalytics

The Big Picture

This is the audit trail for safe-mode activations. Each deposit represents someone who put TAO at risk to protect the network. Governance uses this to decide which deposits to release (legitimate activations) or slash (abuse).

Why This Matters

If you activated safe-mode, your deposit is tracked here. After safe-mode ends and ReleaseDelay passes, you can call release_deposit to recover your funds.

Example Scenario

You entered safe-mode at block 1000000. Query Deposits(your_account, 1000000) returns 100000000000 (100 TAO in RAO). Your deposit is still reserved.

Common Questions

Why is the key (account, block)?
Supports multiple deposits per account at different times. Each deposit is tracked separately and released independently.

Use Cases

  • Check if your deposit is still reserved
  • Build governance dashboards showing outstanding deposits
  • Track who activated safe-mode and when

From Chain Metadata

Holds the reserve that was taken from an account at a specific block number. This helps governance to have an overview of outstanding deposits that should be returned or slashed.

Purpose & Usage

Purpose

Tracks who put up deposits to enter/extend safe-mode, and how much. Keyed by (account, block_number) to support multiple deposits per account and independent release timing.

Common Query Patterns

  • Query by (account, block) to check specific deposit
  • Iterate by account to find all deposits from an account
  • List all deposits for governance overview

Query Keys

#NameTypeDescription
1
key1
AccountId key1 (AccountId) (hex -> SS58)
2
key2
u32 key2 (u32)

Stored Value

Value in RAO (÷10⁹ for TAO)

RAO -> TAO (/ 10^9)

Relationships

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 });

// Query Deposits storage
const key1 = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const key2 = 0;

const result = await api.query
  [stringCamelCase("SafeMode")]
  [stringCamelCase("Deposits")](
  key1,
  key2
);

console.log("Deposits:", result.toHuman());

Runtime Info

Pallet
SafeMode
Storage Kind
Map
First Version
v154
Current Version
v393