bittensor-cli 9.8.0__py3-none-any.whl → 9.8.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bittensor_cli/cli.py +1 -1
- bittensor_cli/src/__init__.py +0 -64
- bittensor_cli/src/bittensor/subtensor_interface.py +78 -11
- bittensor_cli/src/commands/stake/add.py +32 -20
- bittensor_cli/src/commands/stake/list.py +35 -48
- bittensor_cli/src/commands/stake/move.py +20 -46
- bittensor_cli/src/commands/stake/remove.py +32 -94
- bittensor_cli/src/commands/sudo.py +1 -1
- bittensor_cli/src/commands/wallets.py +1 -25
- {bittensor_cli-9.8.0.dist-info → bittensor_cli-9.8.2.dist-info}/METADATA +1 -1
- {bittensor_cli-9.8.0.dist-info → bittensor_cli-9.8.2.dist-info}/RECORD +14 -14
- {bittensor_cli-9.8.0.dist-info → bittensor_cli-9.8.2.dist-info}/WHEEL +0 -0
- {bittensor_cli-9.8.0.dist-info → bittensor_cli-9.8.2.dist-info}/entry_points.txt +0 -0
- {bittensor_cli-9.8.0.dist-info → bittensor_cli-9.8.2.dist-info}/top_level.txt +0 -0
bittensor_cli/cli.py
CHANGED
@@ -3352,7 +3352,7 @@ class CLIManager:
|
|
3352
3352
|
)
|
3353
3353
|
else:
|
3354
3354
|
netuid_ = get_optional_netuid(None, all_netuids)
|
3355
|
-
netuids = [netuid_] if netuid_ else None
|
3355
|
+
netuids = [netuid_] if netuid_ is not None else None
|
3356
3356
|
if netuids:
|
3357
3357
|
for netuid_ in netuids:
|
3358
3358
|
# ensure no negative netuids make it into our list
|
bittensor_cli/src/__init__.py
CHANGED
@@ -814,67 +814,3 @@ class ColorPalette(Gettable):
|
|
814
814
|
|
815
815
|
COLOR_PALETTE = ColorPalette()
|
816
816
|
COLORS = COLOR_PALETTE
|
817
|
-
|
818
|
-
|
819
|
-
SUBNETS = {
|
820
|
-
0: "root",
|
821
|
-
1: "apex",
|
822
|
-
2: "omron",
|
823
|
-
3: "templar",
|
824
|
-
4: "targon",
|
825
|
-
5: "kaito",
|
826
|
-
6: "infinite",
|
827
|
-
7: "subvortex",
|
828
|
-
8: "ptn",
|
829
|
-
9: "pretrain",
|
830
|
-
10: "sturday",
|
831
|
-
11: "dippy",
|
832
|
-
12: "horde",
|
833
|
-
13: "dataverse",
|
834
|
-
14: "palaidn",
|
835
|
-
15: "deval",
|
836
|
-
16: "bitads",
|
837
|
-
17: "3gen",
|
838
|
-
18: "cortex",
|
839
|
-
19: "inference",
|
840
|
-
20: "bitagent",
|
841
|
-
21: "any-any",
|
842
|
-
22: "meta",
|
843
|
-
23: "social",
|
844
|
-
24: "omega",
|
845
|
-
25: "protein",
|
846
|
-
26: "alchemy",
|
847
|
-
27: "compute",
|
848
|
-
28: "oracle",
|
849
|
-
29: "coldint",
|
850
|
-
30: "bet",
|
851
|
-
31: "naschain",
|
852
|
-
32: "itsai",
|
853
|
-
33: "ready",
|
854
|
-
34: "mind",
|
855
|
-
35: "logic",
|
856
|
-
36: "automata",
|
857
|
-
37: "tuning",
|
858
|
-
38: "distributed",
|
859
|
-
39: "edge",
|
860
|
-
40: "chunk",
|
861
|
-
41: "sportsensor",
|
862
|
-
42: "masa",
|
863
|
-
43: "graphite",
|
864
|
-
44: "score",
|
865
|
-
45: "gen42",
|
866
|
-
46: "neural",
|
867
|
-
47: "condense",
|
868
|
-
48: "nextplace",
|
869
|
-
49: "automl",
|
870
|
-
50: "audio",
|
871
|
-
51: "celium",
|
872
|
-
52: "dojo",
|
873
|
-
53: "frontier",
|
874
|
-
54: "docs-insight",
|
875
|
-
56: "gradients",
|
876
|
-
57: "gaia",
|
877
|
-
58: "dippy-speech",
|
878
|
-
59: "agent-arena",
|
879
|
-
61: "red-team",
|
880
|
-
}
|
@@ -1423,23 +1423,40 @@ class SubtensorInterface:
|
|
1423
1423
|
return stake_info_map if stake_info_map else None
|
1424
1424
|
|
1425
1425
|
async def all_subnets(self, block_hash: Optional[str] = None) -> list[DynamicInfo]:
|
1426
|
-
result = await
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1426
|
+
result, prices = await asyncio.gather(
|
1427
|
+
self.query_runtime_api(
|
1428
|
+
"SubnetInfoRuntimeApi",
|
1429
|
+
"get_all_dynamic_info",
|
1430
|
+
block_hash=block_hash,
|
1431
|
+
),
|
1432
|
+
self.get_subnet_prices(block_hash=block_hash, page_size=129),
|
1430
1433
|
)
|
1431
|
-
|
1434
|
+
sns: list[DynamicInfo] = DynamicInfo.list_from_any(result)
|
1435
|
+
for sn in sns:
|
1436
|
+
if sn.netuid == 0:
|
1437
|
+
sn.price = Balance.from_tao(1.0)
|
1438
|
+
else:
|
1439
|
+
try:
|
1440
|
+
sn.price = prices[sn.netuid]
|
1441
|
+
except KeyError:
|
1442
|
+
sn.price = sn.tao_in / sn.alpha_in
|
1443
|
+
return sns
|
1432
1444
|
|
1433
1445
|
async def subnet(
|
1434
1446
|
self, netuid: int, block_hash: Optional[str] = None
|
1435
1447
|
) -> "DynamicInfo":
|
1436
|
-
result = await
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1448
|
+
result, price = await asyncio.gather(
|
1449
|
+
self.query_runtime_api(
|
1450
|
+
"SubnetInfoRuntimeApi",
|
1451
|
+
"get_dynamic_info",
|
1452
|
+
params=[netuid],
|
1453
|
+
block_hash=block_hash,
|
1454
|
+
),
|
1455
|
+
self.get_subnet_price(netuid=netuid, block_hash=block_hash),
|
1441
1456
|
)
|
1442
|
-
|
1457
|
+
subnet_ = DynamicInfo.from_any(result)
|
1458
|
+
subnet_.price = price
|
1459
|
+
return subnet_
|
1443
1460
|
|
1444
1461
|
async def get_owned_hotkeys(
|
1445
1462
|
self,
|
@@ -1581,3 +1598,53 @@ class SubtensorInterface:
|
|
1581
1598
|
)
|
1582
1599
|
|
1583
1600
|
return result
|
1601
|
+
|
1602
|
+
async def get_subnet_price(
|
1603
|
+
self,
|
1604
|
+
netuid: int = None,
|
1605
|
+
block_hash: Optional[str] = None,
|
1606
|
+
) -> Balance:
|
1607
|
+
"""
|
1608
|
+
Gets the current Alpha price in TAO for a specific subnet.
|
1609
|
+
|
1610
|
+
:param netuid: The unique identifier of the subnet.
|
1611
|
+
:param block_hash: The hash of the block to retrieve the price from.
|
1612
|
+
|
1613
|
+
:return: The current Alpha price in TAO units for the specified subnet.
|
1614
|
+
"""
|
1615
|
+
current_sqrt_price = await self.query(
|
1616
|
+
module="Swap",
|
1617
|
+
storage_function="AlphaSqrtPrice",
|
1618
|
+
params=[netuid],
|
1619
|
+
block_hash=block_hash,
|
1620
|
+
)
|
1621
|
+
|
1622
|
+
current_sqrt_price = fixed_to_float(current_sqrt_price)
|
1623
|
+
current_price = current_sqrt_price * current_sqrt_price
|
1624
|
+
return Balance.from_rao(int(current_price * 1e9))
|
1625
|
+
|
1626
|
+
async def get_subnet_prices(
|
1627
|
+
self, block_hash: Optional[str] = None, page_size: int = 100
|
1628
|
+
) -> dict[int, Balance]:
|
1629
|
+
"""
|
1630
|
+
Gets the current Alpha prices in TAO for all subnets.
|
1631
|
+
|
1632
|
+
:param block_hash: The hash of the block to retrieve prices from.
|
1633
|
+
:param page_size: The page size for batch queries (default: 100).
|
1634
|
+
|
1635
|
+
:return: A dictionary mapping netuid to the current Alpha price in TAO units.
|
1636
|
+
"""
|
1637
|
+
query = await self.substrate.query_map(
|
1638
|
+
module="Swap",
|
1639
|
+
storage_function="AlphaSqrtPrice",
|
1640
|
+
page_size=page_size,
|
1641
|
+
block_hash=block_hash,
|
1642
|
+
)
|
1643
|
+
|
1644
|
+
map_ = {}
|
1645
|
+
async for netuid_, current_sqrt_price in query:
|
1646
|
+
current_sqrt_price_ = fixed_to_float(current_sqrt_price.value)
|
1647
|
+
current_price = current_sqrt_price_**2
|
1648
|
+
map_[netuid_] = Balance.from_rao(int(current_price * 1e9))
|
1649
|
+
|
1650
|
+
return map_
|
@@ -245,12 +245,12 @@ async def stake_add(
|
|
245
245
|
# Get subnet data and stake information for coldkey
|
246
246
|
chain_head = await subtensor.substrate.get_chain_head()
|
247
247
|
_all_subnets, _stake_info, current_wallet_balance = await asyncio.gather(
|
248
|
-
subtensor.all_subnets(),
|
248
|
+
subtensor.all_subnets(block_hash=chain_head),
|
249
249
|
subtensor.get_stake_for_coldkey(
|
250
250
|
coldkey_ss58=wallet.coldkeypub.ss58_address,
|
251
251
|
block_hash=chain_head,
|
252
252
|
),
|
253
|
-
subtensor.get_balance(wallet.coldkeypub.ss58_address),
|
253
|
+
subtensor.get_balance(wallet.coldkeypub.ss58_address, block_hash=chain_head),
|
254
254
|
)
|
255
255
|
all_subnets = {di.netuid: di for di in _all_subnets}
|
256
256
|
|
@@ -307,6 +307,7 @@ async def stake_add(
|
|
307
307
|
return False
|
308
308
|
remaining_wallet_balance -= amount_to_stake
|
309
309
|
|
310
|
+
# TODO this should be asyncio gathered before the for loop
|
310
311
|
stake_fee = await subtensor.get_stake_fee(
|
311
312
|
origin_hotkey_ss58=None,
|
312
313
|
origin_netuid=None,
|
@@ -318,14 +319,20 @@ async def stake_add(
|
|
318
319
|
)
|
319
320
|
|
320
321
|
# Calculate slippage
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
322
|
+
# TODO: Update for V3, slippage calculation is significantly different in v3
|
323
|
+
# try:
|
324
|
+
# received_amount, slippage_pct, slippage_pct_float, rate = (
|
325
|
+
# _calculate_slippage(subnet_info, amount_to_stake, stake_fee)
|
326
|
+
# )
|
327
|
+
# except ValueError:
|
328
|
+
# return False
|
329
|
+
#
|
330
|
+
# max_slippage = max(slippage_pct_float, max_slippage)
|
331
|
+
|
332
|
+
# Temporary workaround - calculations without slippage
|
333
|
+
current_price_float = float(subnet_info.price.tao)
|
334
|
+
rate = 1.0 / current_price_float
|
335
|
+
received_amount = rate * amount_to_stake
|
329
336
|
|
330
337
|
# Add rows for the table
|
331
338
|
base_row = [
|
@@ -336,19 +343,19 @@ async def stake_add(
|
|
336
343
|
+ f" {Balance.get_unit(netuid)}/{Balance.get_unit(0)} ", # rate
|
337
344
|
str(received_amount.set_unit(netuid)), # received
|
338
345
|
str(stake_fee), # fee
|
339
|
-
str(slippage_pct), # slippage
|
346
|
+
# str(slippage_pct), # slippage
|
340
347
|
]
|
341
348
|
|
342
349
|
# If we are staking safe, add price tolerance
|
343
350
|
if safe_staking:
|
344
351
|
if subnet_info.is_dynamic:
|
345
|
-
|
346
|
-
_rate_with_tolerance =
|
347
|
-
1
|
352
|
+
price_with_tolerance = current_price_float * (1 + rate_tolerance)
|
353
|
+
_rate_with_tolerance = (
|
354
|
+
1.0 / price_with_tolerance
|
348
355
|
) # Rate only for display
|
349
356
|
rate_with_tolerance = f"{_rate_with_tolerance:.4f}"
|
350
357
|
price_with_tolerance = Balance.from_tao(
|
351
|
-
|
358
|
+
price_with_tolerance
|
352
359
|
).rao # Actual price to pass to extrinsic
|
353
360
|
else:
|
354
361
|
rate_with_tolerance = "1"
|
@@ -581,9 +588,10 @@ def _define_stake_table(
|
|
581
588
|
justify="center",
|
582
589
|
style=COLOR_PALETTE["STAKE"]["STAKE_AMOUNT"],
|
583
590
|
)
|
584
|
-
|
585
|
-
|
586
|
-
|
591
|
+
# TODO: Uncomment when slippage is reimplemented for v3
|
592
|
+
# table.add_column(
|
593
|
+
# "Slippage", justify="center", style=COLOR_PALETTE["STAKE"]["SLIPPAGE_PERCENT"]
|
594
|
+
# )
|
587
595
|
|
588
596
|
if safe_staking:
|
589
597
|
table.add_column(
|
@@ -628,8 +636,8 @@ The columns are as follows:
|
|
628
636
|
- [bold white]Hotkey[/bold white]: The ss58 address of the hotkey you are staking to.
|
629
637
|
- [bold white]Amount[/bold white]: The TAO you are staking into this subnet onto this hotkey.
|
630
638
|
- [bold white]Rate[/bold white]: The rate of exchange between your TAO and the subnet's stake.
|
631
|
-
- [bold white]Received[/bold white]: The amount of stake you will receive on this subnet after slippage.
|
632
|
-
- [bold white]Slippage[/bold white]: The slippage percentage of the stake operation. (0% if the subnet is not dynamic i.e. root)."""
|
639
|
+
- [bold white]Received[/bold white]: The amount of stake you will receive on this subnet after slippage."""
|
640
|
+
# - [bold white]Slippage[/bold white]: The slippage percentage of the stake operation. (0% if the subnet is not dynamic i.e. root)."""
|
633
641
|
|
634
642
|
safe_staking_description = """
|
635
643
|
- [bold white]Rate Tolerance[/bold white]: Maximum acceptable alpha rate. If the rate exceeds this tolerance, the transaction will be limited or rejected.
|
@@ -654,6 +662,9 @@ def _calculate_slippage(
|
|
654
662
|
- slippage_str: Formatted slippage percentage string
|
655
663
|
- slippage_float: Raw slippage percentage value
|
656
664
|
- rate: Exchange rate string
|
665
|
+
|
666
|
+
TODO: Update to v3. This method only works for protocol-liquidity-only
|
667
|
+
mode (user liquidity disabled)
|
657
668
|
"""
|
658
669
|
amount_after_fee = amount - stake_fee
|
659
670
|
|
@@ -670,6 +681,7 @@ def _calculate_slippage(
|
|
670
681
|
slippage_str = f"{slippage_pct_float:.4f} %"
|
671
682
|
rate = f"{(1 / subnet_info.price.tao or 1):.4f}"
|
672
683
|
else:
|
684
|
+
# TODO: Fix this. Slippage is always zero for static networks.
|
673
685
|
slippage_pct_float = (
|
674
686
|
100 * float(stake_fee.tao) / float(amount.tao) if amount.tao != 0 else 0
|
675
687
|
)
|
@@ -111,15 +111,15 @@ async def stake_list(
|
|
111
111
|
style=COLOR_PALETTE["POOLS"]["RATE"],
|
112
112
|
justify="center",
|
113
113
|
)
|
114
|
-
defined_table.add_column(
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
)
|
114
|
+
# defined_table.add_column(
|
115
|
+
# f"[white]Swap ({Balance.get_unit(1)} -> {Balance.unit})",
|
116
|
+
# footer_style="overline white",
|
117
|
+
# style=COLOR_PALETTE["STAKE"]["STAKE_SWAP"],
|
118
|
+
# justify="right",
|
119
|
+
# footer=f"τ {millify_tao(total_swapped_tao_value_.tao)}"
|
120
|
+
# if not verbose
|
121
|
+
# else f"{total_swapped_tao_value_}",
|
122
|
+
# )
|
123
123
|
defined_table.add_column(
|
124
124
|
"[white]Registered",
|
125
125
|
style=COLOR_PALETTE["STAKE"]["STAKE_ALPHA"],
|
@@ -168,25 +168,17 @@ async def stake_list(
|
|
168
168
|
tao_value_ = pool.alpha_to_tao(alpha_value)
|
169
169
|
total_tao_value_ += tao_value_
|
170
170
|
|
171
|
-
#
|
172
|
-
|
173
|
-
|
174
|
-
)
|
175
|
-
total_swapped_tao_value_ += swapped_tao_value_
|
176
|
-
|
177
|
-
# Slippage percentage cell
|
178
|
-
if pool.is_dynamic:
|
179
|
-
slippage_percentage = f"[{COLOR_PALETTE['STAKE']['SLIPPAGE_PERCENT']}]{slippage_percentage_:.3f}%[/{COLOR_PALETTE['STAKE']['SLIPPAGE_PERCENT']}]"
|
180
|
-
else:
|
181
|
-
slippage_percentage = f"[{COLOR_PALETTE['STAKE']['SLIPPAGE_PERCENT']}]0.000%[/{COLOR_PALETTE['STAKE']['SLIPPAGE_PERCENT']}]"
|
171
|
+
# TAO value cell
|
172
|
+
tao_value_ = pool.alpha_to_tao(substake_.stake)
|
173
|
+
total_swapped_tao_value_ += tao_value_
|
182
174
|
|
183
175
|
if netuid == 0:
|
184
|
-
swap_value = f"[{COLOR_PALETTE['STAKE']['NOT_REGISTERED']}]N/A[/{COLOR_PALETTE['STAKE']['NOT_REGISTERED']}]
|
176
|
+
swap_value = f"[{COLOR_PALETTE['STAKE']['NOT_REGISTERED']}]N/A[/{COLOR_PALETTE['STAKE']['NOT_REGISTERED']}]"
|
185
177
|
else:
|
186
178
|
swap_value = (
|
187
|
-
f"τ {millify_tao(
|
179
|
+
f"τ {millify_tao(tao_value_.tao)}"
|
188
180
|
if not verbose
|
189
|
-
else f"{
|
181
|
+
else f"{tao_value_}"
|
190
182
|
)
|
191
183
|
|
192
184
|
# Per block emission cell
|
@@ -214,7 +206,7 @@ async def stake_list(
|
|
214
206
|
else f"{symbol} {stake_value}", # Stake (a)
|
215
207
|
f"{pool.price.tao:.4f} τ/{symbol}", # Rate (t/a)
|
216
208
|
# f"τ {millify_tao(tao_ownership.tao)}" if not verbose else f"{tao_ownership}", # TAO equiv
|
217
|
-
swap_value, # Swap(α) -> τ
|
209
|
+
# swap_value, # Swap(α) -> τ
|
218
210
|
"YES"
|
219
211
|
if substake_.is_registered
|
220
212
|
else f"[{COLOR_PALETTE['STAKE']['NOT_REGISTERED']}]NO", # Registered
|
@@ -232,7 +224,7 @@ async def stake_list(
|
|
232
224
|
"value": tao_value_.tao,
|
233
225
|
"stake_value": substake_.stake.tao,
|
234
226
|
"rate": pool.price.tao,
|
235
|
-
"swap_value": swap_value,
|
227
|
+
# "swap_value": swap_value,
|
236
228
|
"registered": True if substake_.is_registered else False,
|
237
229
|
"emission": {
|
238
230
|
"alpha": per_block_emission,
|
@@ -317,9 +309,7 @@ async def stake_list(
|
|
317
309
|
alpha_value = Balance.from_rao(int(substake_.stake.rao)).set_unit(netuid)
|
318
310
|
tao_value_ = pool.alpha_to_tao(alpha_value)
|
319
311
|
total_tao_value_ += tao_value_
|
320
|
-
swapped_tao_value_
|
321
|
-
pool.alpha_to_tao_with_slippage(substake_.stake)
|
322
|
-
)
|
312
|
+
swapped_tao_value_ = pool.alpha_to_tao(substake_.stake)
|
323
313
|
total_swapped_tao_value_ += swapped_tao_value_
|
324
314
|
|
325
315
|
# Store current values for future delta tracking
|
@@ -364,19 +354,16 @@ async def stake_list(
|
|
364
354
|
)
|
365
355
|
|
366
356
|
if netuid != 0:
|
367
|
-
swap_cell = (
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
millify=True if not verbose else False,
|
375
|
-
)
|
376
|
-
+ f" ({slippage_pct:.2f}%)"
|
357
|
+
swap_cell = format_cell(
|
358
|
+
swapped_tao_value_.tao,
|
359
|
+
prev.get("swapped_value"),
|
360
|
+
unit="τ",
|
361
|
+
unit_first_=True,
|
362
|
+
precision=4,
|
363
|
+
millify=True if not verbose else False,
|
377
364
|
)
|
378
365
|
else:
|
379
|
-
swap_cell = f"[{COLOR_PALETTE['STAKE']['NOT_REGISTERED']}]N/A[/{COLOR_PALETTE['STAKE']['NOT_REGISTERED']}]
|
366
|
+
swap_cell = f"[{COLOR_PALETTE['STAKE']['NOT_REGISTERED']}]N/A[/{COLOR_PALETTE['STAKE']['NOT_REGISTERED']}]"
|
380
367
|
|
381
368
|
emission_value = substake_.emission.tao / (pool.tempo or 1)
|
382
369
|
emission_cell = format_cell(
|
@@ -408,7 +395,7 @@ async def stake_list(
|
|
408
395
|
exchange_cell, # Exchange value
|
409
396
|
stake_cell, # Stake amount
|
410
397
|
rate_cell, # Rate
|
411
|
-
swap_cell, # Swap value
|
398
|
+
# swap_cell, # Swap value
|
412
399
|
"YES"
|
413
400
|
if substake_.is_registered
|
414
401
|
else f"[{COLOR_PALETTE['STAKE']['NOT_REGISTERED']}]NO", # Registration status
|
@@ -591,12 +578,12 @@ async def stake_list(
|
|
591
578
|
f"Wallet:\n"
|
592
579
|
f" Coldkey SS58: [{COLOR_PALETTE['GENERAL']['COLDKEY']}]{coldkey_address}[/{COLOR_PALETTE['GENERAL']['COLDKEY']}]\n"
|
593
580
|
f" Free Balance: [{COLOR_PALETTE['GENERAL']['BALANCE']}]{balance}[/{COLOR_PALETTE['GENERAL']['BALANCE']}]\n"
|
594
|
-
f" Total TAO Value ({Balance.unit}): [{COLOR_PALETTE['GENERAL']['BALANCE']}]{total_tao_value}[/{COLOR_PALETTE['GENERAL']['BALANCE']}]
|
595
|
-
f" Total TAO Swapped Value ({Balance.unit}): [{COLOR_PALETTE['GENERAL']['BALANCE']}]{total_swapped_tao_value}[/{COLOR_PALETTE['GENERAL']['BALANCE']}]"
|
581
|
+
f" Total TAO Value ({Balance.unit}): [{COLOR_PALETTE['GENERAL']['BALANCE']}]{total_tao_value}[/{COLOR_PALETTE['GENERAL']['BALANCE']}]"
|
582
|
+
# f"\n Total TAO Swapped Value ({Balance.unit}): [{COLOR_PALETTE['GENERAL']['BALANCE']}]{total_swapped_tao_value}[/{COLOR_PALETTE['GENERAL']['BALANCE']}]"
|
596
583
|
)
|
597
584
|
dict_output["free_balance"] = balance.tao
|
598
585
|
dict_output["total_tao_value"] = all_hks_tao_value.tao
|
599
|
-
dict_output["total_swapped_tao_value"] = all_hks_swapped_tao_value.tao
|
586
|
+
# dict_output["total_swapped_tao_value"] = all_hks_swapped_tao_value.tao
|
600
587
|
if json_output:
|
601
588
|
json_console.print(json.dumps(dict_output))
|
602
589
|
if not sub_stakes:
|
@@ -658,12 +645,12 @@ async def stake_list(
|
|
658
645
|
),
|
659
646
|
(
|
660
647
|
"[bold tan]Exchange Value (α x τ/α)[/bold tan]",
|
661
|
-
"This is the potential τ you will receive
|
662
|
-
),
|
663
|
-
(
|
664
|
-
"[bold tan]Swap (α → τ)[/bold tan]",
|
665
|
-
"This is the actual τ you will receive, after factoring in the slippage charge, if you unstake from this hotkey now on this subnet. The slippage is calculated as 1 - (Swap(α → τ)/Exchange Value(α x τ/α)), and is displayed in brackets. This can change every block. \nFor more, see [blue]https://docs.bittensor.com/dynamic-tao/dtao-guide#swap-%CE%B1--%CF%84[/blue].",
|
648
|
+
"This is the potential τ you will receive if you unstake from this hotkey now on this subnet. Note: The TAO Equiv(τ_in x α/α_out) indicates validator stake weight while this Exchange Value shows τ you will receive if you unstake now. This can change every block. \nFor more, see [blue]https://docs.bittensor.com/dynamic-tao/dtao-guide#exchange-value-%CE%B1-x-%CF%84%CE%B1[/blue].",
|
666
649
|
),
|
650
|
+
# (
|
651
|
+
# "[bold tan]Swap (α → τ)[/bold tan]",
|
652
|
+
# "This is the τ you will receive if you unstake from this hotkey now on this subnet. This can change every block. \nFor more, see [blue]https://docs.bittensor.com/dynamic-tao/dtao-guide#swap-%CE%B1--%CF%84[/blue].",
|
653
|
+
# ),
|
667
654
|
(
|
668
655
|
"[bold tan]Registered[/bold tan]",
|
669
656
|
"Indicates if the hotkey is registered in this subnet or not. \nFor more, see [blue]https://docs.bittensor.com/learn/anatomy-of-incentive-mechanism#tempo[/blue].",
|
@@ -33,8 +33,8 @@ async def display_stake_movement_cross_subnets(
|
|
33
33
|
destination_hotkey: str,
|
34
34
|
amount_to_move: Balance,
|
35
35
|
stake_fee: Balance,
|
36
|
-
) -> tuple[Balance,
|
37
|
-
"""Calculate and display
|
36
|
+
) -> tuple[Balance, str]:
|
37
|
+
"""Calculate and display stake movement information"""
|
38
38
|
|
39
39
|
if origin_netuid == destination_netuid:
|
40
40
|
subnet = await subtensor.subnet(origin_netuid)
|
@@ -46,45 +46,32 @@ async def display_stake_movement_cross_subnets(
|
|
46
46
|
raise ValueError
|
47
47
|
|
48
48
|
received_amount = subnet.tao_to_alpha(received_amount_tao)
|
49
|
-
|
50
|
-
100 * float(stake_fee) / float(stake_fee + received_amount_tao)
|
51
|
-
if received_amount_tao != 0
|
52
|
-
else 0
|
53
|
-
)
|
54
|
-
slippage_pct = f"{slippage_pct_float:.4f}%"
|
55
|
-
price = Balance.from_tao(1).set_unit(origin_netuid)
|
49
|
+
price = subnet.price.tao
|
56
50
|
price_str = (
|
57
|
-
str(float(price
|
58
|
-
+ f"{Balance.get_unit(
|
51
|
+
str(float(price))
|
52
|
+
+ f"({Balance.get_unit(0)}/{Balance.get_unit(origin_netuid)})"
|
59
53
|
)
|
60
54
|
else:
|
61
55
|
dynamic_origin, dynamic_destination = await asyncio.gather(
|
62
56
|
subtensor.subnet(origin_netuid),
|
63
57
|
subtensor.subnet(destination_netuid),
|
64
58
|
)
|
65
|
-
|
66
|
-
|
67
|
-
)
|
68
|
-
|
69
|
-
|
70
|
-
)
|
59
|
+
price_origin = dynamic_origin.price.tao
|
60
|
+
price_destination = dynamic_destination.price.tao
|
61
|
+
rate = price_origin / (price_destination or 1)
|
62
|
+
|
63
|
+
received_amount_tao = dynamic_origin.alpha_to_tao(amount_to_move)
|
71
64
|
received_amount_tao -= stake_fee
|
72
|
-
received_amount
|
73
|
-
received_amount_tao
|
74
|
-
)
|
65
|
+
received_amount = dynamic_destination.tao_to_alpha(received_amount_tao)
|
75
66
|
received_amount.set_unit(destination_netuid)
|
76
67
|
|
77
68
|
if received_amount < Balance.from_tao(0):
|
78
69
|
print_error("Not enough Alpha to pay the transaction fee.")
|
79
70
|
raise ValueError
|
80
71
|
|
81
|
-
ideal_amount = amount_to_move * price
|
82
|
-
total_slippage = ideal_amount - received_amount
|
83
|
-
slippage_pct_float = 100 * (total_slippage.tao / ideal_amount.tao)
|
84
|
-
slippage_pct = f"{slippage_pct_float:.4f} %"
|
85
72
|
price_str = (
|
86
|
-
f"{
|
87
|
-
+ f"{Balance.get_unit(destination_netuid)}/{Balance.get_unit(origin_netuid)}"
|
73
|
+
f"{rate:.5f}"
|
74
|
+
+ f"({Balance.get_unit(destination_netuid)}/{Balance.get_unit(origin_netuid)})"
|
88
75
|
)
|
89
76
|
|
90
77
|
# Create and display table
|
@@ -137,15 +124,10 @@ async def display_stake_movement_cross_subnets(
|
|
137
124
|
style=COLOR_PALETTE["POOLS"]["TAO_EQUIV"],
|
138
125
|
)
|
139
126
|
table.add_column(
|
140
|
-
"Fee (
|
127
|
+
f"Fee ({Balance.get_unit(origin_netuid)})",
|
141
128
|
justify="center",
|
142
129
|
style=COLOR_PALETTE["STAKE"]["STAKE_AMOUNT"],
|
143
130
|
)
|
144
|
-
table.add_column(
|
145
|
-
"slippage",
|
146
|
-
justify="center",
|
147
|
-
style=COLOR_PALETTE["STAKE"]["SLIPPAGE_PERCENT"],
|
148
|
-
)
|
149
131
|
|
150
132
|
table.add_row(
|
151
133
|
f"{Balance.get_unit(origin_netuid)}({origin_netuid})",
|
@@ -155,20 +137,12 @@ async def display_stake_movement_cross_subnets(
|
|
155
137
|
str(amount_to_move),
|
156
138
|
price_str,
|
157
139
|
str(received_amount),
|
158
|
-
str(stake_fee),
|
159
|
-
str(slippage_pct),
|
140
|
+
str(stake_fee.set_unit(origin_netuid)),
|
160
141
|
)
|
161
142
|
|
162
143
|
console.print(table)
|
163
144
|
|
164
|
-
|
165
|
-
if slippage_pct_float > 5:
|
166
|
-
message = f"[{COLOR_PALETTE['STAKE']['SLIPPAGE_TEXT']}]-------------------------------------------------------------------------------------------------------------------\n"
|
167
|
-
message += f"[bold]WARNING:\tSlippage is high: [{COLOR_PALETTE['STAKE']['SLIPPAGE_PERCENT']}]{slippage_pct}[/{COLOR_PALETTE['STAKE']['SLIPPAGE_PERCENT']}], this may result in a loss of funds.[/bold] \n"
|
168
|
-
message += "-------------------------------------------------------------------------------------------------------------------\n"
|
169
|
-
console.print(message)
|
170
|
-
|
171
|
-
return received_amount, slippage_pct_float, slippage_pct, price_str
|
145
|
+
return received_amount, price_str
|
172
146
|
|
173
147
|
|
174
148
|
def prompt_stake_amount(
|
@@ -414,7 +388,7 @@ async def stake_swap_selection(
|
|
414
388
|
origin_stake = hotkey_stakes[origin_netuid]["stake"]
|
415
389
|
|
416
390
|
# Ask for amount to swap
|
417
|
-
amount,
|
391
|
+
amount, _ = prompt_stake_amount(origin_stake, origin_netuid, "swap")
|
418
392
|
|
419
393
|
all_netuids = sorted(await subtensor.get_all_subnet_netuids())
|
420
394
|
destination_choices = [
|
@@ -530,7 +504,7 @@ async def move_stake(
|
|
530
504
|
amount=amount_to_move_as_balance.rao,
|
531
505
|
)
|
532
506
|
|
533
|
-
#
|
507
|
+
# Display stake movement details
|
534
508
|
if prompt:
|
535
509
|
try:
|
536
510
|
await display_stake_movement_cross_subnets(
|
@@ -714,7 +688,7 @@ async def transfer_stake(
|
|
714
688
|
amount=amount_to_transfer.rao,
|
715
689
|
)
|
716
690
|
|
717
|
-
#
|
691
|
+
# Display stake movement details
|
718
692
|
if prompt:
|
719
693
|
try:
|
720
694
|
await display_stake_movement_cross_subnets(
|
@@ -883,7 +857,7 @@ async def swap_stake(
|
|
883
857
|
amount=amount_to_swap.rao,
|
884
858
|
)
|
885
859
|
|
886
|
-
#
|
860
|
+
# Display stake movement details
|
887
861
|
if prompt:
|
888
862
|
try:
|
889
863
|
await display_stake_movement_cross_subnets(
|
@@ -209,16 +209,12 @@ async def unstake(
|
|
209
209
|
)
|
210
210
|
|
211
211
|
try:
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
stake_fee=stake_fee,
|
216
|
-
)
|
212
|
+
current_price = subnet_info.price.tao
|
213
|
+
rate = current_price
|
214
|
+
received_amount = amount_to_unstake_as_balance * rate
|
217
215
|
except ValueError:
|
218
216
|
continue
|
219
|
-
|
220
217
|
total_received_amount += received_amount
|
221
|
-
max_float_slippage = max(max_float_slippage, slippage_pct_float)
|
222
218
|
|
223
219
|
base_unstake_op = {
|
224
220
|
"netuid": netuid,
|
@@ -229,8 +225,6 @@ async def unstake(
|
|
229
225
|
"amount_to_unstake": amount_to_unstake_as_balance,
|
230
226
|
"current_stake_balance": current_stake_balance,
|
231
227
|
"received_amount": received_amount,
|
232
|
-
"slippage_pct": slippage_pct,
|
233
|
-
"slippage_pct_float": slippage_pct_float,
|
234
228
|
"dynamic_info": subnet_info,
|
235
229
|
}
|
236
230
|
|
@@ -238,20 +232,18 @@ async def unstake(
|
|
238
232
|
str(netuid), # Netuid
|
239
233
|
staking_address_name, # Hotkey Name
|
240
234
|
str(amount_to_unstake_as_balance), # Amount to Unstake
|
241
|
-
|
235
|
+
f"{subnet_info.price.tao:.6f}"
|
242
236
|
+ f"({Balance.get_unit(0)}/{Balance.get_unit(netuid)})", # Rate
|
243
|
-
str(stake_fee), # Fee
|
237
|
+
str(stake_fee.set_unit(netuid)), # Fee
|
244
238
|
str(received_amount), # Received Amount
|
245
|
-
slippage_pct, # Slippage Percent
|
239
|
+
# slippage_pct, # Slippage Percent
|
246
240
|
]
|
247
241
|
|
248
242
|
# Additional fields for safe unstaking
|
249
243
|
if safe_staking:
|
250
244
|
if subnet_info.is_dynamic:
|
251
|
-
|
252
|
-
rate_with_tolerance =
|
253
|
-
1 - rate_tolerance
|
254
|
-
) # Rate only for display
|
245
|
+
price_with_tolerance = current_price * (1 - rate_tolerance)
|
246
|
+
rate_with_tolerance = price_with_tolerance
|
255
247
|
price_with_tolerance = Balance.from_tao(
|
256
248
|
rate_with_tolerance
|
257
249
|
).rao # Actual price to pass to extrinsic
|
@@ -263,7 +255,7 @@ async def unstake(
|
|
263
255
|
base_table_row.extend(
|
264
256
|
[
|
265
257
|
# Rate with tolerance
|
266
|
-
f"{rate_with_tolerance:.
|
258
|
+
f"{rate_with_tolerance:.6f} {Balance.get_unit(0)}/{Balance.get_unit(netuid)}",
|
267
259
|
# Partial unstake
|
268
260
|
f"[{'dark_sea_green3' if allow_partial_stake else 'red'}]"
|
269
261
|
f"{allow_partial_stake}[/{'dark_sea_green3' if allow_partial_stake else 'red'}]",
|
@@ -448,14 +440,13 @@ async def unstake_all(
|
|
448
440
|
justify="center",
|
449
441
|
style=COLOR_PALETTE["POOLS"]["TAO_EQUIV"],
|
450
442
|
)
|
451
|
-
table.add_column(
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
)
|
443
|
+
# table.add_column(
|
444
|
+
# "Slippage",
|
445
|
+
# justify="center",
|
446
|
+
# style=COLOR_PALETTE["STAKE"]["SLIPPAGE_PERCENT"],
|
447
|
+
# )
|
456
448
|
|
457
|
-
# Calculate
|
458
|
-
max_slippage = 0.0
|
449
|
+
# Calculate total received
|
459
450
|
total_received_value = Balance(0)
|
460
451
|
for stake in stake_info:
|
461
452
|
if stake.stake.rao == 0:
|
@@ -473,41 +464,33 @@ async def unstake_all(
|
|
473
464
|
destination_coldkey_ss58=wallet.coldkeypub.ss58_address,
|
474
465
|
amount=stake_amount.rao,
|
475
466
|
)
|
467
|
+
|
476
468
|
try:
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
469
|
+
current_price = subnet_info.price.tao
|
470
|
+
rate = current_price
|
471
|
+
received_amount = stake_amount * rate - stake_fee
|
472
|
+
|
473
|
+
if received_amount < Balance.from_tao(0):
|
474
|
+
print_error("Not enough Alpha to pay the transaction fee.")
|
475
|
+
continue
|
476
|
+
except (AttributeError, ValueError):
|
481
477
|
continue
|
482
478
|
|
483
|
-
max_slippage = max(max_slippage, slippage_pct_float)
|
484
479
|
total_received_value += received_amount
|
485
480
|
|
486
481
|
table.add_row(
|
487
482
|
str(stake.netuid),
|
488
483
|
hotkey_display,
|
489
484
|
str(stake_amount),
|
490
|
-
|
485
|
+
f"{float(subnet_info.price):.6f}"
|
491
486
|
+ f"({Balance.get_unit(0)}/{Balance.get_unit(stake.netuid)})",
|
492
487
|
str(stake_fee),
|
493
488
|
str(received_amount),
|
494
|
-
slippage_pct,
|
495
489
|
)
|
496
490
|
console.print(table)
|
497
|
-
if max_slippage > 5:
|
498
|
-
message = (
|
499
|
-
f"[{COLOR_PALETTE['STAKE']['SLIPPAGE_TEXT']}]--------------------------------------------------------------"
|
500
|
-
f"-----------------------------------------------------\n"
|
501
|
-
f"[bold]WARNING:[/bold] The slippage on one of your operations is high: "
|
502
|
-
f"[{COLOR_PALETTE['STAKE']['SLIPPAGE_PERCENT']}]{max_slippage:.4f}%"
|
503
|
-
f"[/{COLOR_PALETTE['STAKE']['SLIPPAGE_PERCENT']}], this may result in a loss of funds.\n"
|
504
|
-
"----------------------------------------------------------------------------------------------------------"
|
505
|
-
"---------\n"
|
506
|
-
)
|
507
|
-
console.print(message)
|
508
491
|
|
509
492
|
console.print(
|
510
|
-
f"
|
493
|
+
f"Total expected return: [{COLOR_PALETTE['STAKE']['STAKE_AMOUNT']}]{total_received_value}"
|
511
494
|
)
|
512
495
|
|
513
496
|
if prompt and not Confirm.ask(
|
@@ -848,51 +831,6 @@ async def _unstake_all_extrinsic(
|
|
848
831
|
|
849
832
|
|
850
833
|
# Helpers
|
851
|
-
def _calculate_slippage(
|
852
|
-
subnet_info, amount: Balance, stake_fee: Balance
|
853
|
-
) -> tuple[Balance, str, float]:
|
854
|
-
"""Calculate slippage and received amount for unstaking operation.
|
855
|
-
|
856
|
-
Args:
|
857
|
-
subnet_info: Subnet information containing price data
|
858
|
-
amount: Amount being unstaked
|
859
|
-
stake_fee: Stake fee to include in slippage calculation
|
860
|
-
|
861
|
-
Returns:
|
862
|
-
tuple containing:
|
863
|
-
- received_amount: Balance after slippage deduction
|
864
|
-
- slippage_pct: Formatted string of slippage percentage
|
865
|
-
- slippage_pct_float: Float value of slippage percentage
|
866
|
-
"""
|
867
|
-
received_amount, _, _ = subnet_info.alpha_to_tao_with_slippage(amount)
|
868
|
-
received_amount -= stake_fee
|
869
|
-
|
870
|
-
if received_amount < Balance.from_tao(0):
|
871
|
-
print_error("Not enough Alpha to pay the transaction fee.")
|
872
|
-
raise ValueError
|
873
|
-
|
874
|
-
if subnet_info.is_dynamic:
|
875
|
-
# Ideal amount w/o slippage
|
876
|
-
ideal_amount = subnet_info.alpha_to_tao(amount)
|
877
|
-
|
878
|
-
# Total slippage including fees
|
879
|
-
total_slippage = ideal_amount - received_amount
|
880
|
-
slippage_pct_float = (
|
881
|
-
100 * (float(total_slippage.tao) / float(ideal_amount.tao))
|
882
|
-
if ideal_amount.tao != 0
|
883
|
-
else 0
|
884
|
-
)
|
885
|
-
slippage_pct = f"{slippage_pct_float:.4f} %"
|
886
|
-
else:
|
887
|
-
# Root will only have fee-based slippage
|
888
|
-
slippage_pct_float = (
|
889
|
-
100 * float(stake_fee.tao) / float(amount.tao) if amount.tao != 0 else 0
|
890
|
-
)
|
891
|
-
slippage_pct = f"{slippage_pct_float:.4f} %"
|
892
|
-
|
893
|
-
return received_amount, slippage_pct, slippage_pct_float
|
894
|
-
|
895
|
-
|
896
834
|
async def _unstake_selection(
|
897
835
|
dynamic_info,
|
898
836
|
identities,
|
@@ -993,14 +931,14 @@ async def _unstake_selection(
|
|
993
931
|
table.add_column("Symbol", style=COLOR_PALETTE["GENERAL"]["SYMBOL"])
|
994
932
|
table.add_column("Stake Amount", style=COLOR_PALETTE["STAKE"]["STAKE_AMOUNT"])
|
995
933
|
table.add_column(
|
996
|
-
f"[bold white]
|
934
|
+
f"[bold white]Rate ({Balance.get_unit(0)}/{Balance.get_unit(1)})",
|
997
935
|
style=COLOR_PALETTE["POOLS"]["RATE"],
|
998
936
|
justify="left",
|
999
937
|
)
|
1000
938
|
|
1001
939
|
for netuid_, stake_amount in netuid_stakes.items():
|
1002
940
|
symbol = dynamic_info[netuid_].symbol
|
1003
|
-
rate = f"{dynamic_info[netuid_].price.tao:.
|
941
|
+
rate = f"{dynamic_info[netuid_].price.tao:.6f} τ/{symbol}"
|
1004
942
|
table.add_row(str(netuid_), symbol, str(stake_amount), rate)
|
1005
943
|
console.print("\n", table, "\n")
|
1006
944
|
|
@@ -1251,7 +1189,7 @@ def _create_unstake_table(
|
|
1251
1189
|
style=COLOR_PALETTE["POOLS"]["RATE"],
|
1252
1190
|
)
|
1253
1191
|
table.add_column(
|
1254
|
-
f"Fee ({Balance.get_unit(
|
1192
|
+
f"Fee ({Balance.get_unit(1)})",
|
1255
1193
|
justify="center",
|
1256
1194
|
style=COLOR_PALETTE["STAKE"]["STAKE_AMOUNT"],
|
1257
1195
|
)
|
@@ -1261,9 +1199,9 @@ def _create_unstake_table(
|
|
1261
1199
|
style=COLOR_PALETTE["POOLS"]["TAO_EQUIV"],
|
1262
1200
|
footer=str(total_received_amount),
|
1263
1201
|
)
|
1264
|
-
table.add_column(
|
1265
|
-
|
1266
|
-
)
|
1202
|
+
# table.add_column(
|
1203
|
+
# "Slippage", justify="center", style=COLOR_PALETTE["STAKE"]["SLIPPAGE_PERCENT"]
|
1204
|
+
# )
|
1267
1205
|
if safe_staking:
|
1268
1206
|
table.add_column(
|
1269
1207
|
f"Rate with tolerance: [blue]({rate_tolerance * 100}%)[/blue]",
|
@@ -542,14 +542,12 @@ async def wallet_balance(
|
|
542
542
|
|
543
543
|
total_free_balance = sum(free_balances.values())
|
544
544
|
total_staked_balance = sum(stake[0] for stake in staked_balances.values())
|
545
|
-
total_staked_with_slippage = sum(stake[1] for stake in staked_balances.values())
|
546
545
|
|
547
546
|
balances = {
|
548
547
|
name: (
|
549
548
|
coldkey,
|
550
549
|
free_balances[coldkey],
|
551
550
|
staked_balances[coldkey][0],
|
552
|
-
staked_balances[coldkey][1],
|
553
551
|
)
|
554
552
|
for (name, coldkey) in zip(wallet_names, coldkeys)
|
555
553
|
}
|
@@ -577,24 +575,12 @@ async def wallet_balance(
|
|
577
575
|
style=COLOR_PALETTE["STAKE"]["STAKE_ALPHA"],
|
578
576
|
no_wrap=True,
|
579
577
|
),
|
580
|
-
Column(
|
581
|
-
"[white]Staked (w/slippage)",
|
582
|
-
justify="right",
|
583
|
-
style=COLOR_PALETTE["STAKE"]["STAKE_SWAP"],
|
584
|
-
no_wrap=True,
|
585
|
-
),
|
586
578
|
Column(
|
587
579
|
"[white]Total Balance",
|
588
580
|
justify="right",
|
589
581
|
style=COLOR_PALETTE["GENERAL"]["BALANCE"],
|
590
582
|
no_wrap=True,
|
591
583
|
),
|
592
|
-
Column(
|
593
|
-
"[white]Total (w/slippage)",
|
594
|
-
justify="right",
|
595
|
-
style=COLOR_PALETTE["GENERAL"]["BALANCE"],
|
596
|
-
no_wrap=True,
|
597
|
-
),
|
598
584
|
title=f"\n[{COLOR_PALETTE['GENERAL']['HEADER']}]Wallet Coldkey Balance[/{COLOR_PALETTE['GENERAL']['HEADER']}]\n[{COLOR_PALETTE['GENERAL']['HEADER']}]Network: {subtensor.network}\n",
|
599
585
|
show_footer=True,
|
600
586
|
show_edge=False,
|
@@ -605,15 +591,13 @@ async def wallet_balance(
|
|
605
591
|
leading=True,
|
606
592
|
)
|
607
593
|
|
608
|
-
for name, (coldkey, free, staked
|
594
|
+
for name, (coldkey, free, staked) in balances.items():
|
609
595
|
table.add_row(
|
610
596
|
name,
|
611
597
|
coldkey,
|
612
598
|
str(free),
|
613
599
|
str(staked),
|
614
|
-
str(staked_slippage),
|
615
600
|
str(free + staked),
|
616
|
-
str(free + staked_slippage),
|
617
601
|
)
|
618
602
|
table.add_row()
|
619
603
|
table.add_row(
|
@@ -621,9 +605,7 @@ async def wallet_balance(
|
|
621
605
|
"",
|
622
606
|
str(total_free_balance),
|
623
607
|
str(total_staked_balance),
|
624
|
-
str(total_staked_with_slippage),
|
625
608
|
str(total_free_balance + total_staked_balance),
|
626
|
-
str(total_free_balance + total_staked_with_slippage),
|
627
609
|
)
|
628
610
|
console.print(Padding(table, (0, 0, 0, 4)))
|
629
611
|
await subtensor.substrate.close()
|
@@ -633,9 +615,7 @@ async def wallet_balance(
|
|
633
615
|
"coldkey": value[0],
|
634
616
|
"free": value[1].tao,
|
635
617
|
"staked": value[2].tao,
|
636
|
-
"staked_with_slippage": value[3].tao,
|
637
618
|
"total": (value[1] + value[2]).tao,
|
638
|
-
"total_with_slippage": (value[1] + value[3]).tao,
|
639
619
|
}
|
640
620
|
for (key, value) in balances.items()
|
641
621
|
}
|
@@ -644,11 +624,7 @@ async def wallet_balance(
|
|
644
624
|
"totals": {
|
645
625
|
"free": total_free_balance.tao,
|
646
626
|
"staked": total_staked_balance.tao,
|
647
|
-
"staked_with_slippage": total_staked_with_slippage.tao,
|
648
627
|
"total": (total_free_balance + total_staked_balance).tao,
|
649
|
-
"total_with_slippage": (
|
650
|
-
total_free_balance + total_staked_with_slippage
|
651
|
-
).tao,
|
652
628
|
},
|
653
629
|
}
|
654
630
|
json_console.print(json.dumps(output_dict))
|
@@ -1,14 +1,14 @@
|
|
1
1
|
bittensor_cli/__init__.py,sha256=Lpv4NkbAQgwrfqFOnTMuR_S-fqGdaWCSLhxnFnGTHM0,1232
|
2
|
-
bittensor_cli/cli.py,sha256=
|
2
|
+
bittensor_cli/cli.py,sha256=araPpzXJvIAQWG7Jt1AhsM183cYc1rpAIQZxCbufaQ8,231311
|
3
3
|
bittensor_cli/doc_generation_helper.py,sha256=GexqjEIKulWg84hpNBEchJ840oOgOi7DWpt447nsdNI,91
|
4
4
|
bittensor_cli/version.py,sha256=dU1xsa3mG5FPdhzvqlzDByNcCHmzcFQH3q1pQr4u76g,720
|
5
|
-
bittensor_cli/src/__init__.py,sha256=
|
5
|
+
bittensor_cli/src/__init__.py,sha256=2UhjaM4VHfixjmMZvz5OkWn5DsO08WRnOtk_ZNDGTUo,33012
|
6
6
|
bittensor_cli/src/bittensor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
7
|
bittensor_cli/src/bittensor/balances.py,sha256=q5KkxF8wmUguWAFddEKstfDKTxPe5ISHpT6br8x32rc,11148
|
8
8
|
bittensor_cli/src/bittensor/chain_data.py,sha256=_GATOCacWMN2jRurzn3hffJiq_l7AznGRkKePTAflwQ,44420
|
9
9
|
bittensor_cli/src/bittensor/minigraph.py,sha256=BIzmSVLfBYiRAeGD_i1LAC8Cw7zxp38a91SIFEPMqYc,10479
|
10
10
|
bittensor_cli/src/bittensor/networking.py,sha256=pZLMs8YXpZzDMLXWMBb_Bj6TVkm_q9khyY-lnbwVMuE,462
|
11
|
-
bittensor_cli/src/bittensor/subtensor_interface.py,sha256=
|
11
|
+
bittensor_cli/src/bittensor/subtensor_interface.py,sha256=nAVcSTbXZEp3A1Sks4Mfypp4G9F3m8qLl1z2UrNExng,62334
|
12
12
|
bittensor_cli/src/bittensor/utils.py,sha256=cvJZNhcm2tESZ43D1fmBH3Zc1rSe_BvanvhRuN7qL5o,47961
|
13
13
|
bittensor_cli/src/bittensor/extrinsics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
14
|
bittensor_cli/src/bittensor/extrinsics/registration.py,sha256=7ybqpJ7-Z_PTgj4boCOFxgfjMBCHv0JE7MNpJzJmyDc,66360
|
@@ -28,24 +28,24 @@ bittensor_cli/src/bittensor/templates/view.css,sha256=OS0V_ixzdTU15FbNzpZW1m7-c6
|
|
28
28
|
bittensor_cli/src/bittensor/templates/view.j2,sha256=4ux3uyqz34v9VVAX17GezuPESk4z9n5kkd9HbnTsF_Y,1101
|
29
29
|
bittensor_cli/src/bittensor/templates/view.js,sha256=QIPnPp9SuYS9wcl7cwL8nFzd8idiDjNzrDjwwxpiVvY,45076
|
30
30
|
bittensor_cli/src/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
31
|
-
bittensor_cli/src/commands/sudo.py,sha256=
|
31
|
+
bittensor_cli/src/commands/sudo.py,sha256=FJFjEQ-IU9c7W53EhwW7I_pEAJ9phJzarFg-neHZa_M,33758
|
32
32
|
bittensor_cli/src/commands/view.py,sha256=9lx6vfOkel8KIefUhDNaBS_j5lNR2djcRFRbK4mbnDE,12535
|
33
|
-
bittensor_cli/src/commands/wallets.py,sha256=
|
33
|
+
bittensor_cli/src/commands/wallets.py,sha256=v6JDcWhP_CcBruboixKM1XMqhUKL6GbllGd39wHKbBs,71646
|
34
34
|
bittensor_cli/src/commands/weights.py,sha256=BCJm_mlw0pVK4YEZuEMqQBpvvOoB7B1rzdvMeN3uTfM,16503
|
35
35
|
bittensor_cli/src/commands/liquidity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
36
36
|
bittensor_cli/src/commands/liquidity/liquidity.py,sha256=AXCjBvQb2gakP8n1z81npYkZ_QF5CQy7r82AMtQwXzk,21692
|
37
37
|
bittensor_cli/src/commands/liquidity/utils.py,sha256=egfZHnvBMc8ydntAHnU6V5Zyi-wLkomjNuucUj73aZQ,6361
|
38
38
|
bittensor_cli/src/commands/stake/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
39
|
-
bittensor_cli/src/commands/stake/add.py,sha256=
|
39
|
+
bittensor_cli/src/commands/stake/add.py,sha256=oEpWFnRWazaFsbKn06o4gwQ1JfFmn4AwxRNecimI3js,27614
|
40
40
|
bittensor_cli/src/commands/stake/children_hotkeys.py,sha256=lMiV-Z3SGZUEapdy0LRthFLx0RlFK0KVxytE47ybdEc,31746
|
41
|
-
bittensor_cli/src/commands/stake/list.py,sha256=
|
42
|
-
bittensor_cli/src/commands/stake/move.py,sha256=
|
43
|
-
bittensor_cli/src/commands/stake/remove.py,sha256=
|
41
|
+
bittensor_cli/src/commands/stake/list.py,sha256=tzjhiJucXgOGaw7TGt420nGosH85AEjvOimP1XXV3Xs,29038
|
42
|
+
bittensor_cli/src/commands/stake/move.py,sha256=JbEm_2nblStZV_IgwiDhj2HuHaD8qsmIcABjQM6xpWI,34597
|
43
|
+
bittensor_cli/src/commands/stake/remove.py,sha256=DX7yPXs5n8Gp3O_Fwz8cMYI8CAiRp16gbKLwSCAoYmM,47341
|
44
44
|
bittensor_cli/src/commands/subnets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
45
45
|
bittensor_cli/src/commands/subnets/price.py,sha256=akXkbilWjQYqTYvtOhXngX_cVkU0Mv-Gl3kjce6dtl0,21490
|
46
46
|
bittensor_cli/src/commands/subnets/subnets.py,sha256=yM74ct5a9xHyD_TdSAmZL6XOtkT6zk6F67VvOe8Ou68,94070
|
47
|
-
bittensor_cli-9.8.
|
48
|
-
bittensor_cli-9.8.
|
49
|
-
bittensor_cli-9.8.
|
50
|
-
bittensor_cli-9.8.
|
51
|
-
bittensor_cli-9.8.
|
47
|
+
bittensor_cli-9.8.2.dist-info/METADATA,sha256=oHcdDRVqyiik7oI6d-wKQZRLYQG-iRdXO0N7inI2bEk,6601
|
48
|
+
bittensor_cli-9.8.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
49
|
+
bittensor_cli-9.8.2.dist-info/entry_points.txt,sha256=hBTLGLbVxmAKy69XSKaUZvjTCmyEzDGZKq4S8UOto8I,49
|
50
|
+
bittensor_cli-9.8.2.dist-info/top_level.txt,sha256=DvgvXpmTtI_Q1BbDZMlK90LFcGFCreN1daViEPV2iFw,14
|
51
|
+
bittensor_cli-9.8.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|