Skip to content

Commit 7ba1ce5

Browse files
committed
update add_stake_limit
1 parent 7d39145 commit 7ba1ce5

File tree

1 file changed

+4
-4
lines changed
  • bittensor_cli/src/commands/stake

1 file changed

+4
-4
lines changed

bittensor_cli/src/commands/stake/add.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,14 @@ async def stake_extrinsic(
342342
# If we are staking safe, add price tolerance
343343
if safe_staking:
344344
if subnet_info.is_dynamic:
345-
rate = 1 / subnet_info.price.tao or 1
345+
rate = amount_to_stake.rao / received_amount.rao
346346
_rate_with_tolerance = rate * (
347347
1 + rate_tolerance
348348
) # Rate only for display
349349
rate_with_tolerance = f"{_rate_with_tolerance:.4f}"
350-
price_with_tolerance = subnet_info.price.rao * (
351-
1 + rate_tolerance
352-
) # Actual price to pass to extrinsic
350+
price_with_tolerance = Balance.from_tao(
351+
_rate_with_tolerance
352+
).rao # Actual price to pass to extrinsic
353353
else:
354354
rate_with_tolerance = "1"
355355
price_with_tolerance = Balance.from_rao(1)

0 commit comments

Comments
 (0)