File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
bittensor/core/extrinsics Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -107,19 +107,19 @@ async def unstake_extrinsic(
107
107
}
108
108
if safe_staking :
109
109
pool = await subtensor .subnet (netuid = netuid )
110
- received_amount , _ = pool .alpha_to_tao_with_slippage (unstaking_balance )
111
- base_price = unstaking_balance .rao / received_amount .rao
112
- price_with_tolerance = base_price * (1 - rate_tolerance )
110
+ base_price = pool .price .tao
113
111
114
- # For logging
115
- base_rate = pool .price .tao
112
+ if pool .is_dynamic :
113
+ price_with_tolerance = base_price * (1 - rate_tolerance )
114
+ else :
115
+ price_with_tolerance = base_price
116
116
117
117
logging .info (
118
118
f":satellite: [magenta]Safe Unstaking from:[/magenta] "
119
119
f"netuid: [green]{ netuid } [/green], amount: [green]{ unstaking_balance } [/green], "
120
120
f"tolerance percentage: [green]{ rate_tolerance * 100 } %[/green], "
121
121
f"price limit: [green]{ price_with_tolerance } [/green], "
122
- f"original price: [green]{ base_rate } [/green], "
122
+ f"original price: [green]{ base_price } [/green], "
123
123
f"with partial unstake: [green]{ allow_partial_stake } [/green] "
124
124
f"on [blue]{ subtensor .network } [/blue][magenta]...[/magenta]"
125
125
)
Original file line number Diff line number Diff line change @@ -105,19 +105,19 @@ def unstake_extrinsic(
105
105
106
106
if safe_staking :
107
107
pool = subtensor .subnet (netuid = netuid )
108
- received_amount , _ = pool .alpha_to_tao_with_slippage (unstaking_balance )
109
- base_price = unstaking_balance .rao / received_amount .rao
110
- price_with_tolerance = base_price * (1 - rate_tolerance )
108
+ base_price = pool .price .tao
111
109
112
- # For logging
113
- base_rate = pool .price .tao
110
+ if pool .is_dynamic :
111
+ price_with_tolerance = base_price * (1 - rate_tolerance )
112
+ else :
113
+ price_with_tolerance = base_price
114
114
115
115
logging .info (
116
116
f":satellite: [magenta]Safe Unstaking from:[/magenta] "
117
117
f"netuid: [green]{ netuid } [/green], amount: [green]{ unstaking_balance } [/green], "
118
118
f"tolerance percentage: [green]{ rate_tolerance * 100 } %[/green], "
119
119
f"price limit: [green]{ price_with_tolerance } [/green], "
120
- f"original price: [green]{ base_rate } [/green], "
120
+ f"original price: [green]{ base_price } [/green], "
121
121
f"with partial unstake: [green]{ allow_partial_stake } [/green] "
122
122
f"on [blue]{ subtensor .network } [/blue][magenta]...[/magenta]"
123
123
)
You can’t perform that action at this time.
0 commit comments