Skip to content

fix: alpha-as-TAO unit mixup for stakes#15

Open
kkowalski-reef wants to merge 1 commit into
unarbos:mainfrom
bittensor-church:fix/alpha-tao-unit-safety
Open

fix: alpha-as-TAO unit mixup for stakes#15
kkowalski-reef wants to merge 1 commit into
unarbos:mainfrom
bittensor-church:fix/alpha-tao-unit-safety

Conversation

@kkowalski-reef

Copy link
Copy Markdown

Fix α-as-τ unit confusion in stake handling

Stake was typed as Balance (τ) when it's α. The CLI showed α and τ columns with identical numbers, printed α with a τ label, and summed α across subnets - meaningless, since α is only comparable within a subnet at its price.

  • Retypes stake as AlphaBalance across neuron / metagraph / stake / delegate data, fetches per-subnet prices to convert α→τ, and shows α alongside a priced τ-equivalent (- when the price RPC is unavailable).
  • Cross-subnet totals convert to τ before summing.
  • JSON/CSV stake fields now carry α plus a separate τ-equivalent and price; τ-equiv totals are null when prices can't be fetched.

@kkowalski-reef

kkowalski-reef commented Jun 30, 2026

Copy link
Copy Markdown
Author

Some examples:

$ agcli diff portfolio --address 5FRXwb2qsEhqDQQKcm5m2MF26xTWwW65MHTEtKFFydypuqjG --block1 8515147 --block2 8515362

===== BEFORE =====
================================
Portfolio Diff: 5FRXwb2qsEhqDQQKcm5m2MF26xTWwW65MHTEtKFFydypuqjG (block 8515147 → 8515362)

                         Block 8515147   Block 8515362          Change
      Free balance (τ)          6.8367          6.8367               0
       Total stake (τ)     345450.3459     345490.3754        +40.0295
             Total (τ)     345457.1827     345497.2121        +40.0295
       Stake positions              11              11

===== AFTER =====
Portfolio Diff: 5FRXwb2qsEhqDQQKcm5m2MF26xTWwW65MHTEtKFFydypuqjG (block 8515147 → 8515362)

                         Block 8515147   Block 8515362          Change
      Free balance (τ)          6.8367          6.8367               0
         Total stake τ       4378.3131       4379.8393         +1.5261
             Total (τ)       4385.1499       4386.6760         +1.5261
       Stake positions              11              11


$ agcli view neuron --netuid 1 --uid 252

===== BEFORE =====
================================
Neuron UID 252 on SN1
  Hotkey:          5HbNZ77cXQXbUjXG3YLVBGk6N4WbtKtGQYAWLXd2aWa8fqGe
  Coldkey:         5FRXwb2qsEhqDQQKcm5m2MF26xTWwW65MHTEtKFFydypuqjG
  Active:          true
  Stake:           392527.115480885 τ
  Rank:            0.000000
  Trust:           0.000000
  Consensus:       0.000000
  Incentive:       0.000000
  Dividends:       0.610010
  Emission:        24.7609 τ
  Val. Trust:      0.999985
  Val. Permit:     true
  Pruning Score:   1.000000
  Last Update:     8515324
  Axon:            :::0 (v0, proto 0)
  Prometheus:      :::0 (v0)

===== AFTER =====
Neuron UID 252 on SN1
  Hotkey:          5HbNZ77cXQXbUjXG3YLVBGk6N4WbtKtGQYAWLXd2aWa8fqGe
  Coldkey:         5FRXwb2qsEhqDQQKcm5m2MF26xTWwW65MHTEtKFFydypuqjG
  Active:          true
  Stake:           392527.115480885 α ≈ 3426.797830643 τ
  Rank:            0.000000
  Trust:           0.000000
  Consensus:       0.000000
  Incentive:       0.000000
  Dividends:       0.610010
  Emission:        24.7609 α/tempo ≈ 0.2162 τ
  Val. Trust:      0.999985
  Val. Permit:     true
  Pruning Score:   1.000000
  Last Update:     8515324
  Axon:            :::0 (v0, proto 0)
  Prometheus:      :::0 (v0)

$ agcli view validators --netuid 1 --limit 8

===== BEFORE =====
================================
Validators on SN1 (8 with permits)
+-----+-------------+--------------+--------+-----------+-----------+
| UID | Hotkey      | Stake        | VTrust | Dividends | Emission  |
+===================================================================+
| 252 | 5HbN...fqGe | 392527.1155τ | 1.0000 | 0.6100    | 24.7609 τ |
|-----+-------------+--------------+--------+-----------+-----------|
| 138 | 5E2L...eZ5u | 153671.3127τ | 0.9998 | 0.0031    | 0.1271 τ  |
|-----+-------------+--------------+--------+-----------+-----------|
| 52  | 5D1s...KGs1 | 113464.4486τ | 1.0000 | 0.0617    | 2.5054 τ  |
|-----+-------------+--------------+--------+-----------+-----------|
| 226 | 5Hmk...25H7 | 56018.5259τ  | 0.9999 | 0.0488    | 1.9812 τ  |
|-----+-------------+--------------+--------+-----------+-----------|
| 26  | 5Ev5...nh9s | 13955.0851τ  | 0.8919 | 0.0543    | 2.2027 τ  |
|-----+-------------+--------------+--------+-----------+-----------|
| 251 | 5H6y...TVRf | 11684.4877τ  | 1.0000 | 0.1031    | 4.1844 τ  |
|-----+-------------+--------------+--------+-----------+-----------|
| 248 | 5HCF...gDHh | 9629.0079τ   | 0.0000 | 0.0000    | 36.4398 τ |
|-----+-------------+--------------+--------+-----------+-----------|
| 253 | 5CUb...2XSG | 5287.3357τ   | 1.0000 | 0.1037    | 4.2091 τ  |
+-----+-------------+--------------+--------+-----------+-----------+

===== AFTER =====
Validators on SN1 (8 with permits)
+-----+-------------+---------------+------------------+--------+-----------+--------------+
| UID | Hotkey      | Stake (α)     | ≈ τ              | VTrust | Dividends | Emission (α) |
+==========================================================================================+
| 252 | 5HbN...fqGe | 392527.1155 α | 3426.797830643 τ | 1.0000 | 0.6100    | 24.7609 α    |
|-----+-------------+---------------+------------------+--------+-----------+--------------|
| 138 | 5E2L...eZ5u | 153671.3127 α | 1341.564697917 τ | 0.9998 | 0.0031    | 0.1271 α     |
|-----+-------------+---------------+------------------+--------+-----------+--------------|
| 52  | 5D1s...KGs1 | 113464.4486 α | 990.555075000 τ  | 1.0000 | 0.0617    | 2.5054 α     |
|-----+-------------+---------------+------------------+--------+-----------+--------------|
| 226 | 5Hmk...25H7 | 56018.5259 α  | 489.046885219 τ  | 0.9999 | 0.0488    | 1.9812 α     |
|-----+-------------+---------------+------------------+--------+-----------+--------------|
| 26  | 5Ev5...nh9s | 13955.0851 α  | 121.829176828 τ  | 0.8919 | 0.0543    | 2.2027 α     |
|-----+-------------+---------------+------------------+--------+-----------+--------------|
| 251 | 5H6y...TVRf | 11684.4877 α  | 102.006652166 τ  | 1.0000 | 0.1031    | 4.1844 α     |
|-----+-------------+---------------+------------------+--------+-----------+--------------|
| 248 | 5HCF...gDHh | 9629.0079 α   | 84.062124550 τ   | 0.0000 | 0.0000    | 36.4398 α    |
|-----+-------------+---------------+------------------+--------+-----------+--------------|
| 253 | 5CUb...2XSG | 5287.3357 α   | 46.158926740 τ   | 1.0000 | 0.1037    | 4.2091 α     |
+-----+-------------+---------------+------------------+--------+-----------+--------------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant