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 @@ -120,19 +120,19 @@ async def add_stake_extrinsic(
120
120
121
121
if safe_staking :
122
122
pool = await subtensor .subnet (netuid = netuid )
123
- received_amount , _ = pool .tao_to_alpha_with_slippage (staking_balance )
124
- base_price = received_amount .rao / staking_balance .rao
125
- price_with_tolerance = base_price * (1 + rate_tolerance )
123
+ base_price = pool .price .tao
126
124
127
- # For logging
128
- base_rate = pool .price .tao
125
+ if pool .is_dynamic :
126
+ price_with_tolerance = base_price * (1 + rate_tolerance )
127
+ else :
128
+ price_with_tolerance = base_price
129
129
130
130
logging .info (
131
131
f":satellite: [magenta]Safe Staking to:[/magenta] "
132
132
f"[blue]netuid: [green]{ netuid } [/green], amount: [green]{ staking_balance } [/green], "
133
133
f"tolerance percentage: [green]{ rate_tolerance * 100 } %[/green], "
134
134
f"price limit: [green]{ price_with_tolerance } [/green], "
135
- f"original price: [green]{ base_rate } [/green], "
135
+ f"original price: [green]{ base_price } [/green], "
136
136
f"with partial stake: [green]{ allow_partial_stake } [/green] "
137
137
f"on [blue]{ subtensor .network } [/blue][/magenta]...[/magenta]"
138
138
)
Original file line number Diff line number Diff line change @@ -112,19 +112,19 @@ def add_stake_extrinsic(
112
112
113
113
if safe_staking :
114
114
pool = subtensor .subnet (netuid = netuid )
115
- received_amount , _ = pool .tao_to_alpha_with_slippage (staking_balance )
116
- base_price = received_amount .rao / staking_balance .rao
117
- price_with_tolerance = base_price * (1 + rate_tolerance )
115
+ base_price = pool .price .tao
118
116
119
- # For logging
120
- base_rate = pool .price .tao
117
+ if pool .is_dynamic :
118
+ price_with_tolerance = base_price * (1 + rate_tolerance )
119
+ else :
120
+ price_with_tolerance = base_price
121
121
122
122
logging .info (
123
123
f":satellite: [magenta]Safe Staking to:[/magenta] "
124
124
f"[blue]netuid: [green]{ netuid } [/green], amount: [green]{ staking_balance } [/green], "
125
125
f"tolerance percentage: [green]{ rate_tolerance * 100 } %[/green], "
126
126
f"price limit: [green]{ price_with_tolerance } [/green], "
127
- f"original price: [green]{ base_rate } [/green], "
127
+ f"original price: [green]{ base_price } [/green], "
128
128
f"with partial stake: [green]{ allow_partial_stake } [/green] "
129
129
f"on [blue]{ subtensor .network } [/blue][/magenta]...[/magenta]"
130
130
)
You can’t perform that action at this time.
0 commit comments