File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
bittensor_cli/src/bittensor Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1604,6 +1604,14 @@ async def get_subnet_price(
1604
1604
netuid : int = None ,
1605
1605
block_hash : Optional [str ] = None ,
1606
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
+ """
1607
1615
current_sqrt_price = await self .query (
1608
1616
module = "Swap" ,
1609
1617
storage_function = "AlphaSqrtPrice" ,
@@ -1618,6 +1626,14 @@ async def get_subnet_price(
1618
1626
async def get_subnet_prices (
1619
1627
self , block_hash : Optional [str ] = None , page_size : int = 100
1620
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
+ """
1621
1637
query = await self .substrate .query_map (
1622
1638
module = "Swap" ,
1623
1639
storage_function = "AlphaSqrtPrice" ,
You can’t perform that action at this time.
0 commit comments