@@ -2145,15 +2145,21 @@ def add_stake(
2145
2145
amount (Balance): The amount of TAO to stake.
2146
2146
wait_for_inclusion (bool): Waits for the transaction to be included in a block.
2147
2147
wait_for_finalization (bool): Waits for the transaction to be finalized on the blockchain.
2148
- safe_staking (bool): If true, the staking process will have safety checks enabled. .
2149
- allow_partial_stake (bool): If true, partial stake will be allowed in-case full stake doesnt fulfill the threshold.
2150
- rate_threshold (float): The threshold in percentage of price which can be allowed to fluctuate. 0.005 = 0.5% by default.
2148
+ safe_staking (bool): If true, enables price safety checks to protect against fluctuating prices. The stake
2149
+ will only execute if the price change doesn't exceed the rate threshold. Default is False.
2150
+ allow_partial_stake (bool): If true and safe_staking is enabled, allows partial staking when
2151
+ the full amount would exceed the price threshold. If false, the entire stake fails if it would
2152
+ exceed the threshold. Default is False.
2153
+ rate_threshold (float): The maximum allowed price change ratio when staking. For example,
2154
+ 0.005 = 0.5% maximum price increase. Only used when safe_staking is True. Default is 0.005.
2151
2155
2152
2156
Returns:
2153
- bool: `` True`` if the staking is successful, False otherwise.
2157
+ bool: True if the staking is successful, False otherwise.
2154
2158
2155
2159
This function enables neurons to increase their stake in the network, enhancing their influence and potential
2156
2160
rewards in line with Bittensor's consensus and reward mechanisms.
2161
+ When safe_staking is enabled, it provides protection against price fluctuations during the time stake is
2162
+ executed and the time it is actually processed by the chain.
2157
2163
"""
2158
2164
amount = check_and_convert_to_balance (amount )
2159
2165
return add_stake_extrinsic (
@@ -2785,7 +2791,7 @@ def swap_stake(
2785
2791
amount (Union[Balance, float]): The amount to swap.
2786
2792
wait_for_inclusion (bool): Waits for the transaction to be included in a block.
2787
2793
wait_for_finalization (bool): Waits for the transaction to be finalized on the blockchain.
2788
- safe_staking (bool): If true, enables price safety checks to protect against price impact . The swap
2794
+ safe_staking (bool): If true, enables price safety checks to protect against fluctuating prices . The swap
2789
2795
will only execute if the price ratio between subnets doesn't exceed the rate threshold.
2790
2796
Default is False.
2791
2797
allow_partial_stake (bool): If true and safe_staking is enabled, allows partial stake swaps when
@@ -2923,12 +2929,20 @@ def unstake(
2923
2929
amount (Balance): The amount of TAO to unstake. If not specified, unstakes all.
2924
2930
wait_for_inclusion (bool): Waits for the transaction to be included in a block.
2925
2931
wait_for_finalization (bool): Waits for the transaction to be finalized on the blockchain.
2932
+ safe_staking (bool): If true, enables price safety checks to protect against fluctuating prices. The unstake
2933
+ will only execute if the price change doesn't exceed the rate threshold. Default is False.
2934
+ allow_partial_stake (bool): If true and safe_staking is enabled, allows partial unstaking when
2935
+ the full amount would exceed the price threshold. If false, the entire unstake fails if it would
2936
+ exceed the threshold. Default is False.
2937
+ rate_threshold (float): The maximum allowed price change ratio when unstaking. For example,
2938
+ 0.005 = 0.5% maximum price decrease. Only used when safe_staking is True. Default is 0.005.
2926
2939
2927
2940
Returns:
2928
2941
bool: ``True`` if the unstaking process is successful, False otherwise.
2929
2942
2930
2943
This function supports flexible stake management, allowing neurons to adjust their network participation and
2931
- potential reward accruals.
2944
+ potential reward accruals. When safe_staking is enabled, it provides protection against price fluctuations
2945
+ during the time unstake is executed and the time it is actually processed by the chain.
2932
2946
"""
2933
2947
amount = check_and_convert_to_balance (amount )
2934
2948
return unstake_extrinsic (
0 commit comments