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(
16041604 netuid : int = None ,
16051605 block_hash : Optional [str ] = None ,
16061606 ) -> 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+ """
16071615 current_sqrt_price = await self .query (
16081616 module = "Swap" ,
16091617 storage_function = "AlphaSqrtPrice" ,
@@ -1618,6 +1626,14 @@ async def get_subnet_price(
16181626 async def get_subnet_prices (
16191627 self , block_hash : Optional [str ] = None , page_size : int = 100
16201628 ) -> 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+ """
16211637 query = await self .substrate .query_map (
16221638 module = "Swap" ,
16231639 storage_function = "AlphaSqrtPrice" ,
You can’t perform that action at this time.
0 commit comments