@@ -93,7 +93,10 @@ async def price(
93
93
subnet_data = _process_current_subnet_data (
94
94
all_subnet_info , netuids , all_netuids
95
95
)
96
- _generate_cli_output_current (subnet_data )
96
+ if json_output :
97
+ json_console .print (json .dumps (_generate_json_output (subnet_data )))
98
+ else :
99
+ _generate_cli_output_current (subnet_data )
97
100
98
101
99
102
def _process_current_subnet_data (subnet_infos : list [DynamicInfo ], netuids , all_netuids ):
@@ -117,7 +120,7 @@ def _process_current_subnet_data(subnet_infos: list[DynamicInfo], netuids, all_n
117
120
else :
118
121
subnet_info = subnet_infos [0 ]
119
122
stats = {
120
- "current_price" : subnet_info .price ,
123
+ "current_price" : subnet_info .price . tao ,
121
124
"supply" : subnet_info .alpha_in .tao + subnet_info .alpha_out .tao ,
122
125
"market_cap" : subnet_info .price .tao
123
126
* (subnet_info .alpha_in .tao + subnet_info .alpha_out .tao ),
@@ -686,13 +689,13 @@ def _generate_cli_output_current(subnet_data):
686
689
console .print (
687
690
f"\n [{ COLOR_PALETTE .G .SYM } ]Subnet { netuid } - { stats ['symbol' ]} "
688
691
f"[cyan]{ stats ['name' ]} [/cyan][/{ COLOR_PALETTE .G .SYM } ]\n "
689
- f"Current: [blue]{ stats ['current_price' ]. tao :.6f} { stats ['symbol' ]} [/blue]\n "
692
+ f"Current: [blue]{ stats ['current_price' ]:.6f} { stats ['symbol' ]} [/blue]\n "
690
693
)
691
694
else :
692
695
console .print (
693
696
f"\n [{ COLOR_PALETTE .G .SYM } ]Subnet { netuid } - { stats ['symbol' ]} "
694
697
f"[cyan]{ stats ['name' ]} [/cyan][/{ COLOR_PALETTE .G .SYM } ]\n "
695
- f"Current: [blue]{ stats ['symbol' ]} { stats ['current_price' ]. tao :.6f} [/blue]\n "
698
+ f"Current: [blue]{ stats ['symbol' ]} { stats ['current_price' ]:.6f} [/blue]\n "
696
699
)
697
700
698
701
if netuid != 0 :
0 commit comments