@@ -2821,7 +2821,7 @@ async def add_stake(
2821
2821
wait_for_finalization : bool = False ,
2822
2822
safe_staking : bool = False ,
2823
2823
allow_partial_stake : bool = False ,
2824
- rate_threshold : float = 0.005 ,
2824
+ rate_tolerance : float = 0.005 ,
2825
2825
) -> bool :
2826
2826
"""
2827
2827
Adds the specified amount of stake to a neuron identified by the hotkey ``SS58`` address.
@@ -2836,11 +2836,11 @@ async def add_stake(
2836
2836
wait_for_inclusion (bool): Waits for the transaction to be included in a block.
2837
2837
wait_for_finalization (bool): Waits for the transaction to be finalized on the blockchain.
2838
2838
safe_staking (bool): If true, enables price safety checks to protect against fluctuating prices. The stake
2839
- will only execute if the price change doesn't exceed the rate threshold . Default is False.
2839
+ will only execute if the price change doesn't exceed the rate tolerance . Default is False.
2840
2840
allow_partial_stake (bool): If true and safe_staking is enabled, allows partial staking when
2841
2841
the full amount would exceed the price threshold. If false, the entire stake fails if it would
2842
2842
exceed the threshold. Default is False.
2843
- rate_threshold (float): The maximum allowed price change ratio when staking. For example,
2843
+ rate_tolerance (float): The maximum allowed price change ratio when staking. For example,
2844
2844
0.005 = 0.5% maximum price increase. Only used when safe_staking is True. Default is 0.005.
2845
2845
2846
2846
Returns:
@@ -2861,7 +2861,7 @@ async def add_stake(
2861
2861
wait_for_finalization = wait_for_finalization ,
2862
2862
safe_staking = safe_staking ,
2863
2863
allow_partial_stake = allow_partial_stake ,
2864
- rate_threshold = rate_threshold ,
2864
+ rate_tolerance = rate_tolerance ,
2865
2865
)
2866
2866
2867
2867
async def add_stake_multiple (
@@ -3540,7 +3540,7 @@ async def swap_stake(
3540
3540
wait_for_finalization : bool = False ,
3541
3541
safe_staking : bool = False ,
3542
3542
allow_partial_stake : bool = False ,
3543
- rate_threshold : float = 0.005 ,
3543
+ rate_tolerance : float = 0.005 ,
3544
3544
) -> bool :
3545
3545
"""
3546
3546
Moves stake between subnets while keeping the same coldkey-hotkey pair ownership.
@@ -3555,12 +3555,12 @@ async def swap_stake(
3555
3555
wait_for_inclusion (bool): Waits for the transaction to be included in a block.
3556
3556
wait_for_finalization (bool): Waits for the transaction to be finalized on the blockchain.
3557
3557
safe_staking (bool): If true, enables price safety checks to protect against fluctuating prices. The swap
3558
- will only execute if the price ratio between subnets doesn't exceed the rate threshold .
3558
+ will only execute if the price ratio between subnets doesn't exceed the rate tolerance .
3559
3559
Default is False.
3560
3560
allow_partial_stake (bool): If true and safe_staking is enabled, allows partial stake swaps when
3561
3561
the full amount would exceed the price threshold. If false, the entire swap fails if it would
3562
3562
exceed the threshold. Default is False.
3563
- rate_threshold (float): The maximum allowed increase in the price ratio between subnets
3563
+ rate_tolerance (float): The maximum allowed increase in the price ratio between subnets
3564
3564
(origin_price/destination_price). For example, 0.005 = 0.5% maximum increase. Only used
3565
3565
when safe_staking is True. Default is 0.005.
3566
3566
@@ -3570,9 +3570,9 @@ async def swap_stake(
3570
3570
The price ratio for swap_stake in safe mode is calculated as: origin_subnet_price / destination_subnet_price
3571
3571
When safe_staking is enabled, the swap will only execute if:
3572
3572
- With allow_partial_stake=False: The entire swap amount can be executed without the price ratio
3573
- increasing more than rate_threshold
3573
+ increasing more than rate_tolerance
3574
3574
- With allow_partial_stake=True: A partial amount will be swapped up to the point where the
3575
- price ratio would increase by rate_threshold
3575
+ price ratio would increase by rate_tolerance
3576
3576
"""
3577
3577
amount = check_and_convert_to_balance (amount )
3578
3578
return await swap_stake_extrinsic (
@@ -3586,7 +3586,7 @@ async def swap_stake(
3586
3586
wait_for_finalization = wait_for_finalization ,
3587
3587
safe_staking = safe_staking ,
3588
3588
allow_partial_stake = allow_partial_stake ,
3589
- rate_threshold = rate_threshold ,
3589
+ rate_tolerance = rate_tolerance ,
3590
3590
)
3591
3591
3592
3592
async def transfer_stake (
@@ -3677,7 +3677,7 @@ async def unstake(
3677
3677
wait_for_finalization : bool = False ,
3678
3678
safe_staking : bool = False ,
3679
3679
allow_partial_stake : bool = False ,
3680
- rate_threshold : float = 0.005 ,
3680
+ rate_tolerance : float = 0.005 ,
3681
3681
) -> bool :
3682
3682
"""
3683
3683
Removes a specified amount of stake from a single hotkey account. This function is critical for adjusting
@@ -3692,11 +3692,11 @@ async def unstake(
3692
3692
wait_for_inclusion (bool): Waits for the transaction to be included in a block.
3693
3693
wait_for_finalization (bool): Waits for the transaction to be finalized on the blockchain.
3694
3694
safe_staking (bool): If true, enables price safety checks to protect against fluctuating prices. The unstake
3695
- will only execute if the price change doesn't exceed the rate threshold . Default is False.
3695
+ will only execute if the price change doesn't exceed the rate tolerance . Default is False.
3696
3696
allow_partial_stake (bool): If true and safe_staking is enabled, allows partial unstaking when
3697
3697
the full amount would exceed the price threshold. If false, the entire unstake fails if it would
3698
3698
exceed the threshold. Default is False.
3699
- rate_threshold (float): The maximum allowed price change ratio when unstaking. For example,
3699
+ rate_tolerance (float): The maximum allowed price change ratio when unstaking. For example,
3700
3700
0.005 = 0.5% maximum price decrease. Only used when safe_staking is True. Default is 0.005.
3701
3701
3702
3702
Returns:
@@ -3716,7 +3716,7 @@ async def unstake(
3716
3716
wait_for_finalization = wait_for_finalization ,
3717
3717
safe_staking = safe_staking ,
3718
3718
allow_partial_stake = allow_partial_stake ,
3719
- rate_threshold = rate_threshold ,
3719
+ rate_tolerance = rate_tolerance ,
3720
3720
)
3721
3721
3722
3722
async def unstake_multiple (
0 commit comments