How to Determine the SNS Treasury Token Balance?

Hello everyone,

I’m working on gathering information about SNS treasury tokens for various projects, and I’ve encountered a challenge I hope to get some guidance on.

My specific example involves the OpenChat project.

Goal:

I aim to identify how many tokens are in the SNS treasury.
For ICP, this process is straightforward:

  1. Go to the SNS page: ICP SNS Dashboard
  2. Locate the governance canister in the “Canisters” section: Governance Canister
  3. Derive its wallet address using the command:
    dfx ledger account-id --of-principal 2jvtu-yqaaa-aaaaq-aaama-cai
    This produces:
    a2200978cf15fa0d19b7c7eb75cc5d6d3ebabbacaec64a2a9a3f811277619c57
  4. Search for that account on the dashboard: Account Info

For the CHAT token ledger, I tried to follow a similar process. However, while the CHAT ledger balance shows 0, I noticed that funds are instead located in a subaccount: Subaccount Example

Question

What is the best way to derive and access this subaccount on-chain to confirm the treasury balance?

For context, I’m part of the ICPTokens team, and we are working to aggregate and calculate SNS token supplies.

Specifically:
Circulating Supply = Total Supply - Treasury Balance

We also aim to display what percentage of circulating tokens are locked in neurons.

Any advice or best practices would be greatly appreciated!

1 Like

This is how the subaccount is calculated - ic/rs/nervous_system/common/src/ledger.rs at fd5c4949944cde2a7301449b84df2acb4211e618 · dfinity/ic · GitHub

4 Likes

Thanks so much, @hpeebles!
This is exactly the clarity I needed.

Really appreciate your help! :raised_hands:

1 Like